The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#22
|
||||
|
||||
I didn't do that because I didn't want to bulk up the query, Michelle. But, I may do it in the future.
|
#23
|
|||
|
|||
Quote:
|
#24
|
|||
|
|||
Quote:
|
#25
|
||||
|
||||
Quote:
|
#26
|
||||
|
||||
might be wise to add that this wont work with the alternative layout hack released on here......
|
#27
|
||||
|
||||
I guess you just added that I haven't seen the alternative layout mod.
|
#28
|
|||
|
|||
Does anyone have this working in v3a 1.0.2 with OK's "Who's Online" and the "Leader Board" hacks? I know that's a stretch, but thought I'd try. I seem to get a blank white page, and wonder if it's a conflict with any of the above.
|
#29
|
||||
|
||||
A bit of experimentation on my site shows that performance isn't taking a big hit when I do this. So... I have updated the code to dynamically show if a game is a favorite or not on the category lists.
If you have already installed the mod, here is how to upgrade: 1. Find: Code:
else if ($vbulletin->GPC['categoryid']==2) { // Favorites $gamecountquery = ("SELECT * FROM " . TABLE_PREFIX."eaarcade_favorites WHERE userid=" . $vbulletin->userinfo['userid'] . " GROUP BY userid ASC"); $gamecount = $db->num_rows($gamecountquery); $perpage = $vbulletin->input->clean_gpc('r', 'perpage', TYPE_UINT); // set defaults sanitize_pageresults($gamecount, $pagenumber, $perpage, 100, $vbulletin->options['gamesperpage']); $start = (int)($perpage*$pagenumber)-$perpage; $pagenav = construct_page_nav($pagenumber, $perpage, $gamecount, 'arcade.php?' . $vbulletin->session->vars['sessionurl'], "" . (!empty($vbulletin->GPC['categoryid']) ? "&categoryid=" . $vbulletin->GPC['categoryid'] : "") . (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage" : "") ); $games = $db->query_read("SELECT eaarcade_favorites.gameid, arcade_games.*, user.username, arcade_categories.catname FROM " . TABLE_PREFIX . "eaarcade_favorites AS eaarcade_favorites LEFT JOIN " . TABLE_PREFIX . "arcade_games AS arcade_games ON (arcade_games.gameid=eaarcade_favorites.gameid) LEFT JOIN " . TABLE_PREFIX . "user AS user ON (arcade_games.highscorerid=user.userid) LEFT JOIN " . TABLE_PREFIX . "arcade_categories AS arcade_categories ON (arcade_games.categoryid=arcade_categories.categoryid) WHERE eaarcade_favorites.userid=" . $vbulletin->userinfo['userid'] . " AND arcade_games.title IS NOT NULL " . iif($bitfieldcheck, "AND $bitfieldcheck") . " ORDER BY eaarcade_favorites.gameid DESC LIMIT $start,".$vbulletin->options['gamesperpage']); } else { ----------- Code:
else if ($vbulletin->GPC['categoryid']==2) { // Favorites $gamecountquery = ("SELECT * FROM " . TABLE_PREFIX."eaarcade_favorites WHERE userid=" . $vbulletin->userinfo['userid'] . " GROUP BY userid ASC"); $gamecount = $db->num_rows($gamecountquery); $perpage = $vbulletin->input->clean_gpc('r', 'perpage', TYPE_UINT); // set defaults sanitize_pageresults($gamecount, $pagenumber, $perpage, 100, $vbulletin->options['gamesperpage']); $start = (int)($perpage*$pagenumber)-$perpage; $pagenav = construct_page_nav($pagenumber, $perpage, $gamecount, 'arcade.php?' . $vbulletin->session->vars['sessionurl'], "" . (!empty($vbulletin->GPC['categoryid']) ? "&categoryid=" . $vbulletin->GPC['categoryid'] : "") . (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage" : "") ); $games = $db->query_read("SELECT eaarcade_favorites.*, arcade_games.*, user.username, arcade_categories.catname FROM " . TABLE_PREFIX . "eaarcade_favorites AS eaarcade_favorites LEFT JOIN " . TABLE_PREFIX . "arcade_games AS arcade_games ON (arcade_games.gameid=eaarcade_favorites.gameid) LEFT JOIN " . TABLE_PREFIX . "user AS user ON (arcade_games.highscorerid=user.userid) LEFT JOIN " . TABLE_PREFIX . "arcade_categories AS arcade_categories ON (arcade_games.categoryid=arcade_categories.categoryid) WHERE eaarcade_favorites.userid=" . $vbulletin->userinfo['userid'] . " AND arcade_games.title IS NOT NULL " . iif($bitfieldcheck, "AND $bitfieldcheck") . " ORDER BY eaarcade_favorites.gameid DESC LIMIT $start,".$vbulletin->options['gamesperpage']); } else { Find: Code:
$games = $db->query_read("SELECT arcade_games.*, user.username, arcade_categories.catname FROM " . TABLE_PREFIX . "arcade_games AS arcade_games LEFT JOIN " . TABLE_PREFIX . "user AS user ON (arcade_games.highscorerid=user.userid) LEFT JOIN " . TABLE_PREFIX . "arcade_categories AS arcade_categories ON (arcade_games.categoryid=arcade_categories.categoryid) " . iif($vbulletin->GPC['categoryid']!=-1, "WHERE arcade_games.categoryid=" . $vbulletin->GPC['categoryid'] . iif($bitfieldcheck, " AND $bitfieldcheck"), iif($bitfieldcheck, "WHERE $bitfieldcheck")) . " ORDER BY title ASC LIMIT $start, " . $vbulletin->options['gamesperpage']); Code:
$games = $db->query_read("SELECT arcade_games.*, favorites.favid AS favid, user.username, arcade_categories.catname FROM " . TABLE_PREFIX . "arcade_games AS arcade_games LEFT JOIN " . TABLE_PREFIX . "user AS user ON (arcade_games.highscorerid=user.userid) LEFT JOIN " . TABLE_PREFIX . "eaarcade_favorites AS favorites ON (favorites.gameid=arcade_games.gameid) LEFT JOIN " . TABLE_PREFIX . "arcade_categories AS arcade_categories ON (arcade_games.categoryid=arcade_categories.categoryid) " . iif($vbulletin->GPC['categoryid']!=-1, "WHERE favorites.userid=". $vbulletin->userinfo[userid]." AND arcade_games.categoryid=" . $vbulletin->GPC['categoryid'] . iif($bitfieldcheck, " AND $bitfieldcheck"), iif($bitfieldcheck, "WHERE $bitfieldcheck")) . " ORDER BY title ASC LIMIT $start, " . $vbulletin->options['gamesperpage']); Code:
<br /> <if condition="$game[favid]"><a href="arcade.php?do=delfav&gameid=$game[gameid]">$vbphrase[arcadedelfav]</a><else /><a href="arcade.php?do=addfav&gameid=$game[gameid]">$vbphrase[arcadeaddfav]</a></if> |
#30
|
||||
|
||||
I'm getting
Parse error: parse error, unexpected T_ELSE in /home/(deleted)/public_html/forum/arcade.php on line 442 |
#31
|
||||
|
||||
Quote:
Quote:
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|