Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
v3arcade Favorites Mod Details »»
v3arcade Favorites Mod
Version: 1.00, by amykhar amykhar is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: 3.5.1 Rating:
Released: 11-28-2005 Last Update: 01-31-2006 Installs: 38
DB Changes Template Edits
 
No support by the author.

As written, the favorites list is generated by the number of times a game is played. This modification changes that behavior so that users can select their own favorite games. It includes the ability to add and remove games from the favorites list.

I am not offering support for this modification. It is provided as-is. It is working fine for me, but I'm not guaranteeing that it will work for you.

Show Your Support

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

Comments
  #22  
Old 11-30-2005, 01:23 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't do that because I didn't want to bulk up the query, Michelle. But, I may do it in the future.
Reply With Quote
  #23  
Old 11-30-2005, 01:25 AM
Vizionz Vizionz is offline
 
Join Date: Jul 2003
Location: Chicago
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by amykhar
You guys do realize that John's probably never going to read this thread and it might be better to discuss your arcade wish list somewhere John'll read it, right?
i know that but i like you to see ideas too since your a great coder amy and maybe you would find use in something and decide to do it for yourself then shair the code like usual :P
Reply With Quote
  #24  
Old 11-30-2005, 01:27 AM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by amykhar
I didn't do that because I didn't want to bulk up the query, Michelle. But, I may do it in the future.
I suspected that You could add it as an option though so that smaller forums can take advantage of it
Reply With Quote
  #25  
Old 11-30-2005, 06:28 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by amykhar
I didn't do that because I didn't want to bulk up the query, Michelle. But, I may do it in the future.
I remember trying to handle that with a cache in the 3.0.x version, but it was an absolute nightmare.. :speechless:
Reply With Quote
  #26  
Old 11-30-2005, 06:11 PM
Gizmo5h1t3's Avatar
Gizmo5h1t3 Gizmo5h1t3 is offline
 
Join Date: Aug 2005
Location: ROCHDALE LANCS UK
Posts: 650
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

might be wise to add that this wont work with the alternative layout hack released on here......
Reply With Quote
  #27  
Old 11-30-2005, 11:22 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess you just added that I haven't seen the alternative layout mod.
Reply With Quote
  #28  
Old 12-01-2005, 06:54 AM
wcbryant wcbryant is offline
 
Join Date: Dec 2003
Location: Florida
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #29  
Old 12-01-2005, 12:55 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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	{
Replace with:
-----------
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']);
Replace with:
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']);
In your arcade_game_bit template, Replace the code block you added previously with:
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>
(Note: only the conditional changed in the template.)
Reply With Quote
  #30  
Old 12-01-2005, 02:28 PM
Maagic's Avatar
Maagic Maagic is offline
 
Join Date: Mar 2002
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm getting

Parse error: parse error, unexpected T_ELSE in /home/(deleted)/public_html/forum/arcade.php on line 442
Reply With Quote
  #31  
Old 12-01-2005, 05:35 PM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wcbryant
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.
Nope, this works fine with the Who's Online and Leader Board addons..


Quote:
Originally Posted by Gizmo5h1t3
might be wise to add that this wont work with the alternative layout hack released on here......
Once I've updated the Alternative Layout mod, I'll provide some instructions for adding this mod to it..
Reply With Quote
Reply

Thread Tools

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 06:14 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.04665 seconds
  • Memory Usage 2,320KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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