![]() |
V3Arcade - Game Rating addon
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 ; -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 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(); Code:
$phrasegroups = array('arcade','showthread'); Find: Code:
Add right after: Code:
Code:
Add right after: Code:
Save arcade.php 4. Edit arcade templates to place the voting form in play control panel -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ In arcade_play template find: Code:
Add right after: Code:
<tr> Find: Code:
Add right after: Code:
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" /> Thats all! I hope it works :classic: |
Awesome! I'll certainly have a look at this one later tonight..
Thanks for sharing your work. :) |
Quote:
game size, champion, record, played games, personal record... |
cool, when you say game rating, does this include your arcade home layout, too? That looks very organized!
let us know :) |
Rick Sample.
No. The rest was made before. And it's mush more hard for me to make clear instructions than to make the code :) Generally it's templates modification. Because my board in russian it needs to translate back :ermm: |
thanks for sharing looks like a very nice addon.
|
you beat frankenberrie at that one!
|
Where are the phrases?
|
you've got one extra space in your alter table games query for votetotal and votenum on this page that gives a database column not found error. Removing the space fixes that.
|
where are the spaces to be removed?
|
ALTER TABLE `games` ADD `votetotal ` smallint(5) UNSIGNED DEFAULT '0' NOT NULL ;
ALTER TABLE `games` ADD `votenum ` votetotal ' should be votetotal' same for votenum |
Quote:
The phrases are using by standart redirects in gamerate.php ( it's based on threadrate.php ;) ) like Code:
$vbphrase[threadrate_add] ="Your vote on this thread has been added." You can change it to something like eval(print_standard_redirect('redirect_game_add')) and add the new phrase $vbphrase[game_add] ="Your vote on this game has been added." BUT you also can edit the original phrase to $vbphrase[threadrate_add] ="Your vote has been added." :) :) :) Up to you. I desabled redirects at all. |
I removed the arcade phrases and used the showthread. Arcade was giving a myaql error since they were non existant.
|
Hi!
Thats a very nice Hack, but it seems I have a problem! See my Screenshot! How can I format the stars correctly? |
align="left"
|
Great mod, however I had a problem with the phrases.
It gave this error; mysql error: Unknown column 'language.phrasegroup_arcade' in 'field list' So I changed the arcade.php to this $phrasegroups = array('showthread'); Removed the arcade bit |
Where must I put this Code?
|
Quote:
|
Sorry can you post the complete piece of Code? I´am an absolutely php-Noob!
|
This is basic html in your template
|
Nice that works!
Big THX! |
never mind :o
|
Now that we have the games rated, what would be nice is a top rated list and a most popular (most played)
|
Will this sql query work if i use table prefix for my forum? My forum uses vb3_ as prefix and i think, that this will not work for me. ??
|
Thx. GenSec.
[high]* Intex clicks INSTALL.[/high] |
Quote:
It creates only one new table without prefix: "game_rate". If you want to add prefix to "game_rate" it's very simple. Just rename this table ;) |
Quote:
Find in arcade.php Code:
// Selects all games from the database Code:
if ($_GET['show'] == "best") Code:
$gamecount = $DB_site->num_rows($result_allgames); Code:
} |
Most popular is another hack :)
|
Thanks... but that returned no items (perhaps because of the category hack?). I have two instances of // select all games
the first one returns a parse error and the second no results... |
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 |
Quote:
PHP Code:
and I changed pagenav to PHP Code:
|
Quote:
|
I also added:
PHP Code:
:) |
Based on your code, here is my "Newest Additions" :)
PHP Code:
|
Quote:
Any games that have a decimal place appear at the top of the list. Do you know a workaround? Also, would it be difficult to have the titles of the games appear alphabetically from A>Z. Currently they appear as highest ranked in DESC order which shows the game titles from Z>A. |
Quote:
|
Quote:
Also you should have fields votetotal and votenum at the end of "vb3_games" table. |
Quote:
Your ex. has votetotal=5. You саn change it to alphabetically from A>Z just using instead of above "ORDER BY title". |
Quote:
|
I found some code by Natch over there and adjusted a bit. ;)
PHP Code:
|
All times are GMT. The time now is 04:45 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|