Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
html username color for v3Arcade Champions Details »»
html username color for v3Arcade Champions
Version: 1, by stangger5 stangger5 is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: Add-On Releases - Version: 4.1.11 Rating:
Released: 05-06-2012 Last Update: Never Installs: 6
Code Changes  
No support by the author.

html username color for the side box ,,v3Arcade Champions..
v3Arcade Mod Version: 2.0.3A..

Demo: www.next-level-arcade.com

Need to edit includes/v3arcade_functions.php

Fine: // ##### Update Champion Cache #####
replace all of the Update Champion Cache code with this

PHP Code:
// ##### Update Champion Cache ################################################
function build_arcade_champ_cache()
{
    global 
$vbulletin;

    if (!
$vbulletin->options['arcadechamps'])
    {
        return;
    }

    
$cache = array();
    
$getchamps $vbulletin->db->query_read("
        SELECT games.highscorerid, user.username, user.userid, user.usergroupid
        FROM " 
TABLE_PREFIX "v3arcade_games AS games
        INNER JOIN " 
TABLE_PREFIX "user AS user ON (games.highscorerid = user.userid)
    "
);

    while (
$champs $vbulletin->db->fetch_array($getchamps))
    {
                
$champss['username'] = fetch_musername($champs);
        
$cache[$champs['highscorerid']]['count']++;
        
$cache[$champs['highscorerid']]['username'] = $champss['username'];
        
$cache[$champs['highscorerid']]['userid'] = $champs['highscorerid'];
    }
    
$vbulletin->db->free_result($getchamps);
    
uasort($cache'order_scores');
//    $cache = array_slice($cache, 0, $vbulletin->options['arcadechamps']);
    
$ccount 0;
    
$arcadechamps '';
    foreach (
array_keys($cache) AS $suserid)
    {
        
$ccount++;

        if (
$cache[$suserid]['count'] == $lastcount)
        {
            
$rank $lastrank;
        }
        else
        {
            
$rank $ccount;
            
$lastcount $cache[$suserid]['count'];
            
$lastrank $rank;
        }
        
$cache[$suserid]['rank'] = $rank ordinal($rank);
    }
    
build_datastore('v3a_champs'serialize($cache), 1);
    return 
$cache;


Important:It will update the user color after someone gets a high score...

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-07-2012, 11:19 PM
Reycer Reycer is offline
 
Join Date: Jul 2008
Location: Lebanon, MO (USA)
Posts: 747
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

...and I don't plan on joining the forum just to see a demo.
Reply With Quote
  #3  
Old 05-08-2012, 07:41 AM
Gemma's Avatar
Gemma Gemma is offline
 
Join Date: Apr 2004
Location: Scotland
Posts: 1,229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Reycer View Post
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

...and I don't plan on joining the forum just to see a demo.
It only takes a couple of seconds to backup and edit the file; you could probably do it quicker than it took you to type your post

Anyway, here you go - the Arcade Champions block on the main page and the leaderboard page

http://www.forumbanter.com/flashgames-arcade/
http://www.forumbanter.com/arcade-leaderboard.html
Reply With Quote
  #4  
Old 05-10-2012, 02:57 PM
datoneer datoneer is offline
 
Join Date: Jul 2011
Posts: 453
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't see different colors
Reply With Quote
  #5  
Old 06-14-2012, 01:44 PM
doctorsexy's Avatar
doctorsexy doctorsexy is offline
 
Join Date: Mar 2011
Location: earth
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i get this on Arcade Champions

align="left" style="padding-right: 4px;" width="75" height="75" /> the doc with 5 awards.
Reply With Quote
  #6  
Old 09-23-2012, 12:11 PM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know this is a old thread, but it doesn't work for me. Page shows an error page after I've made the edits.
Reply With Quote
  #7  
Old 09-23-2012, 02:39 PM
Gemma's Avatar
Gemma Gemma is offline
 
Join Date: Apr 2004
Location: Scotland
Posts: 1,229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FF|Skyrider View Post
I know this is a old thread, but it doesn't work for me. Page shows an error page after I've made the edits.
What error does it show?

Re-check your file edit as it works properly

http://www.arcadejunkies.org/arcade-leaderboard.html
http://www.arcadejunkies.org/flashgames-arcade/
Reply With Quote
  #8  
Old 09-25-2012, 09:09 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well it seems I made a slight error and forgot to replace the part after:

Code:
//	$cache = array_slice($cache, 0, $vbulletin->options['arcadechamps']);
But while no errors shows up now, the username colors below Arcade Champions are still the same color. Nothing has changed, nor are they using the usergroup color.

Also. Is there anyway I can apply this to the entire arcade, including the leaderboard at the top of the arcade? (plugin).
Reply With Quote
  #9  
Old 09-27-2012, 08:28 AM
skol skol is offline
 
Join Date: Oct 2008
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by doctorsexy View Post
i get this on Arcade Champions

align="left" style="padding-right: 4px;" width="75" height="75" /> the doc with 5 awards.
How did you fix that...
Reply With Quote
  #10  
Old 11-23-2012, 08:35 PM
Nirjonadda Nirjonadda is offline
 
Join Date: Dec 2011
Location: Italy
Posts: 739
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its does not work on 4.1.10 ! Any one can edit and upload v3arcade_functions.php ?

Here is my v3arcade_functions.php code

PHP Code:
<?php
/*======================================================================*\
|| #################################################################### ||
|| # v3 Arcade for vBulletin                                          # ||
|| # Support: http://www.v3arcade.com                                 # ||
|| # Copyright: http://www.cinvin.com                                 # ||
|| #################################################################### ||
\*======================================================================*/

// ##### Getmicrotime #########################################################
function getmicrotime()
{
    list(
$usec$sec) = explode(' 'microtime());
    return 
sprintf('%.4f', ($usec $sec));
}

// ##### Format a score #######################################################
function v3_score_format($value)
{
    return 
vb_number_format($value, (strpos($value'.000') ? 3));
}

// ##### Ordinal - Add suffix to rank numbers #################################
function ordinal($number)
{
    if (
$number 100 10 AND $number %100 14)
    {
        
$suffix 'th';
    }
    else
    {
        switch(
$number 10)
        {
            case 
0:
                
$suffix 'th';
            break;
            case 
1:
                
$suffix 'st';
            break;
            case 
2:
                
$suffix 'nd';
            break;
            case 
3:
                
$suffix 'rd';
            break;
            default:
                
$suffix 'th';
            break;
        }
    }

    return 
'<sup>' $suffix '</sup>';
}

// ##### Convert seconds to hour/minute/second ################################
function sec2hms($sec$full true)
{
    global 
$vbphrase;

    
$hours intval($sec 3600);
    
$minutes intval(($sec 60) % 60);
    
$seconds intval($sec 60);

    if (
$full)
    {
        return 
$hours ' ' $vbphrase['hours'] . ', '
            
$minutes ' ' $vbphrase['minutes'] . ', '
            
$seconds ' ' $vbphrase['seconds'];
    }
    else
    {
        if (
$minutes 10)
        {
            
$minutes '0' $minutes;
        }
        if (
$seconds 10)
        {
            
$seconds '0' $seconds;
        }

        return (
$hours $hours ':' '') . ($minutes $minutes ':' '') . $seconds;
    }
}

// ##### Print Award Image ####################################################
function arcade_award_img($game)
{
    global 
$vbulletin;

    switch (
$vbulletin->options['arcadeawards'])
    {
        case 
1:
            return 
'trophy.gif';
        break;

        case 
2:
        case 
3:
            return 
'crown1.gif';
        break;

        case 
4:
            return 
$game['miniimage'];
        break;
    }
}

// ##### Print Scores Row #####################################################
function fetch_arcade_score_row($score$highscore false)
{
    global 
$vbulletin$vbphrase$parser$show$stylevar$bgclass$altbgclass;
    global 
$scorebits$placecounter$pagenumber$game;

    if (
$placecounter == 1)
    {
        
$score['avatar'] = fetch_avatar_url($score['userid']);
        
$score['useravatar'] = $score['avatar'][0];
        
$score['avdimensions'] = $score['avatar'][1];

        
// If the user has no avatar, use the default placeholder.
        
if (!$score['useravatar'])
        {
            
$score['useravatar'] = $vbulletin->options['arcadeimages'] . '/noavatar.gif';
        }
    }

    
// Calculates the session's length.
    
$score['sessionlength'] = sec2hms($score['finish'] - $score['start'], false);
    
$score['date'] = vbdate($vbulletin->options['scoredateformat'], $score['finish']);
    
$score['score'] = v3_score_format($score['score']);
    
$score['ordinal'] = ordinal($placecounter);

    if (!
$highscore)
    {
        
$score['comment'] = $parser->do_parse(
            
$score['comment'],
            
$vbulletin->options['comments_allowhtml'],
            
$vbulletin->options['comments_allowsmilies'],
            
$vbulletin->options['comments_allowbbcode'],
            
$vbulletin->options['comments_allowimgcode'],
            
0
        
);
    }

    (
$hook vBulletinHook::fetch_hook('arcade_score_row')) ? eval($hook) : false;

    
exec_switch_bg();

    
// Spit out the row.
    
$templater vB_Template::create('v3arcade_scorebit');
    
$templater->register('game'$game);
    
$templater->register('pagenumber'$pagenumber);
    
$templater->register('placecounter'$placecounter);
    
$templater->register('score'$score);
    
$scorebits .= $templater->render();

    
$placecounter++;
}

// ##### Fetch Award ##########################################################
function fetch_arcade_award_img(&$game)
{
    global 
$vbulletin$show;

    if (!
$vbulletin->options['v3profile_awardimg'])
    {
        return 
'';
    }

    switch (
$vbulletin->options['arcadeawards'])
    {
        
// single crown
        
case 2:
            
$game['miniimage'] = 'crown1.gif';
            
$show['awardimgbit'] = true;
        break;

        
// multi-color crowns
        
case 3:
            
$game['miniimage'] = $game['imgname'];
            
$show['awardimgbit'] = true;
        break;

        
// mini image is already set
        
case 4:
        break;

        default:
            
$game['miniimage'] = 'trophy.gif';
            
$show['awardimgbit'] = true;
    }
    
    return 
$game['miniimage'];
}

// ##### Fetch Member Awardbits ###############################################
function fetch_member_award_bits($userid$displaytype '1')
{
     
// Displaytype
     // 1 = BAU (for example, the user profile page)
     // 2 = Leaderboard Champion

    
global $vbulletin$vbphrase$show;

    
$show['champgames'] = true;
    
$show['isfirstgame'] = true;

    foreach (
$vbulletin->v3a_awards[$userid] AS $gameid => $game)
    {
        
fetch_arcade_award_img($game);

        
//if ($vbulletin->options['v3profile_awardimg'])
        //{
            //$game['stdimage'] = $game['miniimage'];
        //}

        
$game['linktitle'] = construct_phrase($vbphrase['x_y_points'], $game['title'], v3_score_format($game['highscore']));
        
$templater vB_Template::create('memberinfo_v3arcade_gamebits');
          
$templater->register('game'$game);
          
$templater->register('displaytype'$displaytype);
          
$images .= $templater->render();
        
$show['isfirstgame'] = false;
    }

    return 
$images;
}

// ##### Insert Arcade News ###################################################
function insert_arcade_news($text$newstype 'auto')
{
    global 
$db;

    
$db->query_write("
        INSERT INTO " 
TABLE_PREFIX "v3arcade_news
            (newstext, newstype, datestamp)
        VALUES (
            '" 
$db->escape_string($text) . "',
            '
$newstype',
            " 
TIMENOW "
    )"
);

    
build_arcade_news_cache();
}

// ##### Update News Cache ####################################################
function build_arcade_news_cache()
{
    global 
$vbulletin;

    
$cache = array(
        
'newslimit' => $vbulletin->options['arcade_newslimit'],
        
'newsevents' => array()
    );

    
$newsquery $vbulletin->db->query_read("
        SELECT *
        FROM " 
TABLE_PREFIX "v3arcade_news AS arcade_news
        ORDER BY datestamp DESC
        LIMIT " 
$vbulletin->options['arcade_newslimit']
    );
    while (
$news $vbulletin->db->fetch_array($newsquery))
    {
        
$cache['newsevents'][] = $news;
    }

    
build_datastore('v3a_news'serialize($cache), 1);

    return 
$cache;
}

// ##### Cache Awards #########################################################
function build_arcade_award_cache()
{
    global 
$vbulletin;

    if (!
$vbulletin->options['arcadeawards'] OR !$vbulletin->options['arcadeleaders'])
    {
        
build_datastore('v3a_awards'serialize(array()), 1);
        
//return false;
    
}

    
// multi-color crowns
    
if ($vbulletin->options['arcadeawards'] == 3)
    {
        
$crownimages range(18);
    }

    
$cache = array();
    
$awards $vbulletin->db->query_read("
        SELECT gameid, title, highscorerid, highscore, miniimage, stdimage
        FROM " 
TABLE_PREFIX "v3arcade_games
        WHERE highscorerid IS NOT NULL
            AND (gamepermissions & " 
$vbulletin->bf_misc_gamepermissions['showaward'] . ")
        ORDER BY gameid
    "
);
    while (
$award $vbulletin->db->fetch_array($awards))
    {
        
// multi-color crowns
        
if ($vbulletin->options['arcadeawards'] == 3)
        {
            
$award['imgname'] = 'crown' current($crownimages) . '.gif';
            if (!
next($crownimages))
            {
                
reset($crownimages);
            }
        }

        
$cache[$award['highscorerid']][$award['gameid']] = $award;
    }

    
build_datastore('v3a_awards'serialize($cache), 1);
}

// ##### Cache Tournament Data ################################################
function build_tournament_cache()
{
    global 
$vbulletin$db;

    
$cache = array();

    
$tourcounts = array();
    
$gettours $db->query_read("
        SELECT status, COUNT(*) AS statuscnt
        FROM " 
TABLE_PREFIX "v3arcade_tournaments
        GROUP BY status
    "
);
    while (
$tour $db->fetch_array($gettours))
    {
        
$tourcounts[$tour['status']] = $tour['statuscnt'];
        
$cache['tourdata']['total'] += $tour['statuscnt'];
    }

    
$cache['tourdata']['awaiting'] = $tourcounts['0'];
    
$cache['tourdata']['active'] = $tourcounts['1'];
    
$cache['tourdata']['finished'] = $tourcounts['2'];

    
$db->free_result($gettours);

    
// Tournaments - Most wins
    
$mosttourwins 0;
    
$getmosttours $db->query_read("
        SELECT COUNT(tournaments.winner) as numwins, tournaments.winner, user.username
        FROM " 
TABLE_PREFIX "v3arcade_tournaments AS tournaments
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON (tournaments.winner = user.userid)
        WHERE tournaments.status = 2
        GROUP BY tournaments.winner
        ORDER BY numwins DESC
        LIMIT 3
    "
);
    while (
$tour $db->fetch_array($getmosttours))
    {
        if (
$mosttourwins AND $tour['numwins'] != $mosttourwins)
        {
            continue;
        }

        
$mosttour_winners .= $winscomma '<a href="' fetch_seo_url('member'$tournull'winner') . '&amp;tab=v3arcade_stats">' $tour['username'] . '</a>';
        
$mosttourwins $tour['numwins'];
        
$winscomma ', ';
    }

    
$db->free_result($getmosttours);

    
$cache['mostwins'] = array(
        
'winner' => $mosttour_winners,
        
'numwins' => $mosttourwins
    
);

    
build_datastore('v3a_tournament'serialize($cache), 1);

    return 
$cache;
}

// ##### Update Finished Tournament Cache #####################################
function build_finished_challenge_cache()
{
    global 
$vbulletin;

    
$cache = array(
        
'challengelimit' => $vbulletin->options['frontminichallenges'],
        
'challenges' => array()
    );

    
$challenges $vbulletin->db->query_read("
        SELECT challenges.*, touser.username AS tousername, fromuser.username AS fromusername, games.miniimage, games.title
        FROM " 
TABLE_PREFIX "v3arcade_challenges AS challenges
        LEFT JOIN " 
TABLE_PREFIX "user AS touser ON (touser.userid = challenges.touserid)
        LEFT JOIN " 
TABLE_PREFIX "user AS fromuser ON (fromuser.userid = challenges.fromuserid)
        LEFT JOIN " 
TABLE_PREFIX "v3arcade_games AS games ON (games.gameid = challenges.gameid)
        WHERE status = 3
        ORDER BY datestamp DESC
        LIMIT " 
$vbulletin->options['frontminichallenges']
    );
    while (
$challenge $vbulletin->db->fetch_array($challenges))
    {
        
$cache['challenges'][$challenge['challengeid']] = $challenge;
    }

    
build_datastore('v3a_challenge'serialize($cache), 1);

    return 
$cache;
}

// ##### Update Latest Scores Cache ###########################################
function build_arcade_latest()
{
    global 
$vbulletin;

    if (!
$vbulletin->options['arcadelatescores'])
    {
        return 
false;
    }

    
$cache = array(
        
'scoreslimit' => $vbulletin->options['arcadelatescores'],
        
'scores' => array()
    );

    
// Show the latest scores, excluding tournament events
    
$latest $vbulletin->db->query_read("
        SELECT sessions.*, games.title, user.username
        FROM " 
TABLE_PREFIX "v3arcade_sessions AS sessions
        LEFT JOIN " 
TABLE_PREFIX "v3arcade_games AS games ON (sessions.gameid = games.gameid)
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON (sessions.userid = user.userid)
        WHERE valid = 1
            AND tourid = 0
        ORDER BY finish DESC
        LIMIT " 
$vbulletin->options['arcadelatescores']
    );
    while (
$late $vbulletin->db->fetch_array($latest))
    {
        
$late['score'] = v3_score_format($late['score']);
        
$cache['scores'][] = $late;
    }

    
build_datastore('v3a_newscores'serialize($cache), 1);

    return 
$cache;
}

// ##### Update Champion Cache ################################################
function build_arcade_champ_cache()
{
    global 
$vbulletin;

    if (!
$vbulletin->options['arcadechamps'])
    {
        return;
    }

    
$cache = array();
    
$getchamps $vbulletin->db->query_read("
        SELECT games.highscorerid, user.username, user.userid, user.usergroupid
        FROM " 
TABLE_PREFIX "v3arcade_games AS games
        INNER JOIN " 
TABLE_PREFIX "user AS user ON (games.highscorerid = user.userid)
    "
);

    while (
$champs $vbulletin->db->fetch_array($getchamps))
    {
                
$champss['username'] = fetch_musername($champs);
        
$cache[$champs['highscorerid']]['count']++;
        
$cache[$champs['highscorerid']]['username'] = $champss['username'];
        
$cache[$champs['highscorerid']]['userid'] = $champs['highscorerid'];
    }
    
$vbulletin->db->free_result($getchamps);
    
uasort($cache'order_scores');
//    $cache = array_slice($cache, 0, $vbulletin->options['arcadechamps']);
    
$ccount 0;
    
$arcadechamps '';
    foreach (
array_keys($cache) AS $suserid)
    {
        
$ccount++;

        if (
$cache[$suserid]['count'] == $lastcount)
        {
            
$rank $lastrank;
        }
        else
        {
            
$rank $ccount;
            
$lastcount $cache[$suserid]['count'];
            
$lastrank $rank;
        }
        
$cache[$suserid]['rank'] = $rank ordinal($rank);
    }
    
build_datastore('v3a_champs'serialize($cache), 1);
    return 
$cache;
}

// ##### Orders scores for the function above #################################
function order_scores($a$b)
{
    return (
$b['count'] < $a['count']) ? -1;
}

// ##### Find Category Page ###################################################
function findcatpage()
{
    global 
$vbulletin;

    
$categoryid intval(fetch_bbarray_cookie('arcade_viewdata''categoryid'));
    
$pagenumber intval(fetch_bbarray_cookie('arcade_viewdata''pagenumber'));

    if (
$categoryid AND $pagenumber)
    {
        return 
"categoryid=$categoryid&pagenumber=$pagenumber";
    }

    return 
'';
}

// ##### Build Ratings ########################################################
function build_ratings($gameid)
{
    global 
$db$vbulletin;

    if (
$ratingcount $db->query_first("
        SELECT SUM(rating) AS votepoints, COUNT(*) AS votecount
        FROM " 
TABLE_PREFIX "v3arcade_ratings
        WHERE gameid = 
$gameid
    "
))
    {
        
$db->query_write("
            UPDATE " 
TABLE_PREFIX "v3arcade_games SET
                votepoints = " 
$ratingcount['votepoints'] . ",
                votecount = " 
$ratingcount['votecount'] . "
            WHERE gameid = 
$gameid
        "
);
    }
}

// ##### Check Game Perms #####################################################
function check_canplay($game)
{
    global 
$vbulletin$vbphrase$arcadeadmin;

    if (
$arcadeadmin)
    {
        return 
true;
    }

    if (!
$vbulletin->userinfo['userid'])
    {
        
$vbulletin->userinfo['posts'] = 0;
        
$vbulletin->userinfo['reputation'] = 0;
    }

    
// How long has the player been a member?
    
$game['membershiplength'] = (TIMENOW $vbulletin->userinfo['joindate']) / 86400;

    
// Minimum post check.
    
$minpostneeded max($game['minpoststotal'], $vbulletin->userinfo['permissions']['minpoststoplay']);
    if (
$vbulletin->userinfo['posts'] < $minpostneeded)
    {
        eval(
standard_error(fetch_error(
            
'v3_not_enough_posts',
            
vb_number_format($minpostneeded),
            
vb_number_format($vbulletin->userinfo['posts']),
            
$game['title']
        )));
    }

    
// Minimum reputation check.
    
$minrepneeded max($game['minrep'], $vbulletin->userinfo['permissions']['minreptoplay']);
    if (
$vbulletin->options['reputationenable'] AND $vbulletin->userinfo['reputation'] < $minrepneeded)
    {
        eval(
standard_error(fetch_error(
            
'v3_rep_too_low',
            
vb_number_format($minrepneeded),
            
vb_number_format($vbulletin->userinfo['reputation']),
            
$game['title']
        )));
    }

    
// Minimum average posts per day check.
    
$game['postsperday'] = $vbulletin->userinfo['posts'] / $game['membershiplength'];
    if (
$game['postsperday'] < $game['minpostsperday'])
    {
        eval(
standard_error(fetch_error(
            
'v3_not_enough_ppd',
            
$game['minpostsperday'],
            
vb_number_format($game['postsperday']),
            
$game['title']
        )));
    }

    
// Minimum membership length check.
    
$minregneeded max($game['minreglength'], $vbulletin->userinfo['permissions']['minreglengthtoplay']);
    if (
floor($game['membershiplength']) < $minregneeded)
    {
        eval(
standard_error(fetch_error(
            
'v3_not_registered_for_long_enough',
            
$minregneeded,
            
floor($game['membershiplength']),
            
$game['title']
        )));
    }

    
// Minimum posts today check.
    
if ($game['minpoststhisday'])
    {
        
$postcheck $vbulletin->db->query_first("
            SELECT COUNT(*) AS count
            FROM " 
TABLE_PREFIX "post
            WHERE userid = " 
$vbulletin->userinfo['userid'] . "
                AND dateline < " 
TIMENOW "
                AND dateline > " 
. (TIMENOW 86400)
        );
        if (
$postcheck['count'] < $game['minpoststhisday'])
        {
            eval(
standard_error(fetch_error(
                
'v3_not_enough_posts_today',
                
$game['minpoststhisday'],
                
$postcheck['count'],
                
$game['title']
            )));
        }
    }

    return 
true;
}

// ##### Build Favorites Cache ################################################
function build_favcache()
{
    global 
$db$vbulletin;

    
$favcache = array();

    
$fcq $db->query_read("
        SELECT * FROM " 
TABLE_PREFIX "v3arcade_favorites
        WHERE userid = " 
$vbulletin->userinfo['userid']
    );
    while (
$fc $db->fetch_array($fcq))
    {
        
$favcache[$fc['gameid']] = $fc['gameid'];
    }

    
$db->query_write("
        UPDATE " 
TABLE_PREFIX "user SET
            favcache = '" 
$db->escape_string(serialize($favcache)) . "'
        WHERE userid = " 
$vbulletin->userinfo['userid']
    );
}

?>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:05 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04930 seconds
  • Memory Usage 2,579KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete