Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
V3Arcade - Game Rating addon Details »»
V3Arcade - Game Rating addon
Version: 1.00, by GenSec GenSec is offline
Developer Last Online: Jun 2010 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 11-06-2004 Last Update: Never Installs: 24
 
No support by the author.

These hack adds rating system for your arcade games.

Files to edit: 1
Templates to edit: 2
Files to add: 1

Add 1 new db table + 2 changes for games table

Very easy to install...
################################################## ##############################################
Before the installation!
Please make a Backup of your database and the changed files!
################################################## ##############################################

1. ADD this to MySQL DB using phpmyadmin or admincp :
Code:
ALTER TABLE `games` ADD `votetotal` smallint(5)  UNSIGNED DEFAULT '0' NOT NULL ;

ALTER TABLE `games` ADD `votenum` smallint(5)  UNSIGNED DEFAULT '0' NOT NULL ;

CREATE TABLE `game_rate` (
  `gamerateid` int(11) NOT NULL auto_increment,
  `gameid` int(11) NOT NULL default '0',
  `userid` int(10) NOT NULL default '0',
  `vote` smallint(5) default NULL,
  `ipaddress` char(15) NOT NULL default '',
  PRIMARY KEY  (`gamerateid`)
) TYPE=MyISAM AUTO_INCREMENT=8 ;
2. Upload gamerate.php to your forumroot directory.
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
There are somу redirects phrases like "redirect_threadrate_add", "error_threadratevoted" etc.
You саn change them to similar with the word "game" instead of "thread".
I didn't. And it works fine on my board.

3. Edit arcade.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Find:
Code:
$phrasegroups = array();
Change to:
Code:
$phrasegroups = array('arcade','showthread');
* in case you decide to use the above "thread" phrases


Find:
Code:
	// While loop constructs the $gamebits variable, with games where scores have been recorded
	while ($game = $DB_site->fetch_array($result_topscore2)) {

Add right after:
Code:
      // display ratings if enabled
    	if ($game['votenum'] > 0)
	    {
		$game['voteavg'] = vb_number_format($game['votetotal'] / $game['votenum'], 2);
		$game['rating'] = round($game['voteavg']);
		} else { 
        $game['rating']=0;
	    }
        //
Find:
Code:
$thisGame = $DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "games WHERE gameid=$gameid");


Add right after:
Code:
// display ratings if enabled
$show['rating'] = false;

	if ($thisGame['votenum'] > 0)
	{
		$thisGame['voteavg'] = vb_number_format($thisGame['votetotal'] / $thisGame['votenum'], 2);
		$game['rating'] = round($thisGame['voteavg']);
			$show['rating'] = true;
	}

	 if ($rating = $DB_site->query_first("
	 	SELECT vote, gamerateid FROM " . TABLE_PREFIX . "game_rate
		WHERE userid = $bbuserinfo[userid] AND gameid = $gameid
	")) {

    		if ($$rating['vote'])
 	          {
				$voteselected["$rating[vote]"] = HTML_SELECTED;
				$votechecked["$rating[vote]"] = HTML_CHECKED;
			  }	else {
				$voteselected[0] = HTML_SELECTED;
				$votechecked[0] = HTML_CHECKED;
			  }
     }
//
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Save arcade.php

4. Edit arcade templates

to place the voting form in play control panel

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+



In arcade_play template find:
Code:
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"> 
  <tr> 
    <td class="thead" colspan="2"><span class="smallfont">$thisGame[title]</span></td> 
  </tr>


Add right after:
Code:
<tr>
<td class="alt2" align="center" id="gamerating" nowrap="nowrap"><span class="smallfont">
<a href="#goto_gamerating">
<if condition="$show['rating']">$vbphrase[rating]</a>: <img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$game[rating].gif" alt="<phrase 1="$thisGame[votenum]" 2="$thisGame[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" border="0" />
                  <else />$vbphrase[rate_thread]</a></if>
<if condition="$show['popups']"><script type="text/javascript"> vbmenu_register("gamerating"); </script></if>
</span></td></tr>

Find:
Code:
 <tr><td class="alt1" align="center"><img src="$stylevar[imgdir_arcade]/backtip.gif" border=0></td>
</table>
</td>
</tr></table>

Add right after:

Code:
<div class="vbmenu_popup" id="gamerating_menu" style="display:none">
<form action="gamerate.php" method="post">
	<table cellpadding="4" cellspacing="1" border="0">
	<tr>
		<td class="thead">Зацени игру<a name="goto_gamerating"></a></td>
	</tr>
	<tr>
		<td class="vbmenu_option" title="nohilite">
		<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_5.gif" alt="$vbphrase[excellent]" /><label for="vote5"><input type="radio" name="vote" id="vote5" value="5" $votechecked[5] />$vbphrase[excellent]</label></div>
		<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_4.gif" alt="$vbphrase[good]" /><label for="vote4"><input type="radio" name="vote" id="vote4" value="4" $votechecked[4] />$vbphrase[good]</label></div>
		<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_3.gif" alt="$vbphrase[average]" /><label for="vote3"><input type="radio" name="vote" id="vote3" value="3" $votechecked[3] />$vbphrase[average]</label></div>
		<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_2.gif" alt="$vbphrase[bad]" /><label for="vote2"><input type="radio" name="vote" id="vote2" value="2" $votechecked[2] />$vbphrase[bad]</label></div>
		<div><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_1.gif" alt="$vbphrase[terrible]" /><label for="vote1"><input type="radio" name="vote" id="vote1" value="1" $votechecked[1] />$vbphrase[terrible]</label></div>
		</td>
	</tr>
	<tr>
		<td class="vbmenu_option" title="nohilite" align="center">
	<input type="hidden" name="s" value="$session[dbsessionhash]" />
	<input type="hidden" name="gameid" value="$gameid" />
	<input type="submit" class="button" value="$vbphrase[vote_now]" />
		</td>
	</tr>
	</table>
</form>
</div>
Save arcade_play


5. At last find the right place to show the game rating

I placed in arcade_main_games_bit temlate :
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


Code:
<if condition="$game['rating'] > 0"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$game[rating].gif" alt="<phrase 1="$game[votenum]" 2="$game[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" border="0" />
</if>
#############################
Thats all!

I hope it works :classic:

Show Your Support

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

Comments
  #62  
Old 01-09-2005, 04:59 PM
Slapp3r Slapp3r is offline
 
Join Date: Jul 2004
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cheers
Reply With Quote
  #63  
Old 01-17-2005, 02:36 AM
MorrisMcD's Avatar
MorrisMcD MorrisMcD is offline
 
Join Date: Nov 2003
Location: Cincinnati, Ohio
Posts: 415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nealparry
didn't work for me, came up with DB error (No number, just standard error) so had to remove it.

Same here.. Checked and double checked
Reply With Quote
  #64  
Old 02-28-2005, 06:44 PM
sim tech sim tech is offline
 
Join Date: Jan 2005
Location: Georgia
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NightWalk8r
I keep getting this error when i try to run the query in Admincp =(



Query
ALTER TABLE `vb3_games` ADD `votetotal` smallint(5) UNSIGNED DEFAULT '0' NOT NULL ;

ALTER TABLE `vb3_games` ADD `votenum` smallint(5) UNSIGNED DEFAULT '0' NOT NULL ;

CREATE TABLE `vb3_game_rate` (
`gamerateid` int(11) NOT NULL auto_increment,
`gameid` int(11) NOT NULL default '0',
`userid` int(10) NOT NULL default '0',
`vote` smallint(5) default NULL,
`ipaddress` char(15) NOT NULL default '',
PRIMARY KEY (`gamerateid`)
) TYPE=MyISAM AUTO_INCREMENT=8

vBulletin Message
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';

ALTER TABLE `vb3_games` ADD `votenum` smallint(5) UNSIGNED
I ran into the same problems, and being a php-noob it took a while to see the problems.

First of all, you can't run all of the queries at once (there's actually 3 there) and 2nd: if you are running version 3 or higher there is no table just called "games" (someone else pointed this out here - thanks!)

Here's the 3 that I ran separate:
PHP Code:
ALTER TABLE `vb3_gamesADD `votetotalsmallint(5)  UNSIGNED DEFAULT '0' NOT NULL 
PHP Code:
ALTER TABLE `vb3_gamesADD `votenumsmallint(5)  UNSIGNED DEFAULT '0' NOT NULL 

PHP Code:
CREATE TABLE `vb3_game_rate` (
  `
gamerateidint(11NOT NULL auto_increment,
  `
gameidint(11NOT NULL default '0',
  `
useridint(10NOT NULL default '0',
  `
votesmallint(5) default NULL,
  `
ipaddresschar(15NOT NULL default '',
  
PRIMARY KEY  (`gamerateid`)
TYPE=MyISAM AUTO_INCREMENT=
That part helped with my pucker-factor which was caused when the arcade would not run.
Reply With Quote
  #65  
Old 02-28-2005, 07:33 PM
MicroLinux? MicroLinux? is offline
 
Join Date: Feb 2005
Location: Southeast, PA
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work for vBulliten 3.0.7 with the categories mod installed?
Reply With Quote
  #66  
Old 02-28-2005, 08:21 PM
sim tech sim tech is offline
 
Join Date: Jan 2005
Location: Georgia
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know about the catagories mod, but the kind of works on mine and I'm running 3.0.7.

I say "kind of" because of several issues that I am pulling my hair out on (and I'm already going bald, so this is a bad thing):

I'd like the rating option to be available on the main arcade.php page, but the rate drop down screen only appears when someone selects a specific game.... at at that point it's labeled Rate Thread. I saw where someone else asked about this but did not see where to fix it.

I have the standard v3arcade layout - can the star ratings be placed on the main arcade page rather than the individual game page?

Is this an option that I screwed up on? :ermm: Other screenshots make it look like it's on the arcade.php page.

Thanks
Reply With Quote
  #67  
Old 03-01-2005, 07:57 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 sim tech
at that point it's labeled Rate Thread. I saw where someone else asked about this but did not see where to fix it.
The mod was made that way for the "ease" factor. It's fairly easy to create your own phrases for it and update the code and templates to display this..


Quote:
Originally Posted by sim tech
I have the standard v3arcade layout - can the star ratings be placed on the main arcade page rather than the individual game page?

Is this an option that I screwed up on? :ermm: Other screenshots make it look like it's on the arcade.php page.
By default, you can only rate games on an individual game's play page. If you've seen different elsewhere, it's likely to be a custom job that they've done themselves.
Reply With Quote
  #68  
Old 03-11-2005, 02:55 PM
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
Posts: 893
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

after playing around with it for a while, I finally got it working they way I wanted Thank you for sharing this with the community
Reply With Quote
  #69  
Old 03-24-2005, 05:32 AM
sim tech sim tech is offline
 
Join Date: Jan 2005
Location: Georgia
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ditto here - thanks!

One (more) question though... is there a query to reset all of the existing game ratings? I had some bogus rates and I'd rather just wipe them all out.
Reply With Quote
  #70  
Old 03-30-2005, 08:53 PM
mcoco1 mcoco1 is offline
 
Join Date: Mar 2005
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to change the display order on the arcade.php page? I would like to display the most played first so you don't have to dig through several pages for the games which are most fun.

Thanks!
Reply With Quote
  #71  
Old 04-14-2005, 09:44 PM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am sorry, but I made all the changes explain and I do not have any rating which appears has to games, nor in the principal main, an idea of the problem??
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 07:23 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04929 seconds
  • Memory Usage 2,340KB
  • 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
  • (12)bbcode_code
  • (3)bbcode_php
  • (4)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