Pages: [1]
Author Topic: game played  (Read 2518 times)
Customers
Jr. Member
*

Karma: 3
Posts: 15


on: Jan 29, 09, 05:19 PM

this is a little addon to display how many time a game has been played in the game page:

open game.php file and find:

Code:
$tpl->assign( 'CURRENTGAMETITLE',  $gameres['title'] );

under that line add:

Code:
$tpl->assign( 'PLAYS', $gameres['plays_total'] );

save and close

open templates\Toys\page_game.html file and find:

Code:
!RELATED!

above it add:

Code:
!PLAYS!

this will display the number of times that game has been played.
see picture:

Logged
Jr. Member
**

Karma: 0
Posts: 23


Reply #1 on: Jan 29, 09, 06:40 PM

Once again a great post, thanks.
Logged
Customers
Jr. Member
*

Karma: 3
Posts: 15


Reply #2 on: Oct 17, 09, 05:40 PM

Hi again,

Long time no see,

a little fix for ProArcadeScript game played mod for script version > 1.3.2

to make this mod work please note that the following change has to be made:

open game.php file and find:

Code:
'CURRENTGAMETITLE' => $gameres['title'],

and after it add

Code:
'PLAYS' => $gameres['plays_total'],

all other changes remains the same

regards,
Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #3 on: Oct 18, 09, 12:37 AM

I'd suggest to add a page block instead... with this block you will not have to edit game.php (which is a part of the script's core) each time I release a new version of the script.
The block is pretty simple: it must be PHP, active on game page only (all in terms of the "new page block" tab inside admin cp), filename is up to you, block_gameinfo for example (to be sure there is no block with the same filename check the /content/blocks/ folder contents in your ftp program), title, max elements, comments and sorting fields will not be used so enter anything in them.
The code is almost the same to one you know from the original post:
Code:
<?php
$tpl
->assign('INFO_PLAYS'$gameres['plays_total']);
?>

So, the block itself is ready and assigns the number of plays to "INFO_PLAYS" macro which should be placed in the form "!INFO_PLAYS!" somewhere in the page_game.html template (you'll find it under the "pages" tab in admin  cp.)

One more thing: inside this block you can assign all other values to appropriate macros to show on the game page, for example plays_today, etc. to see the entire list of variables inside $gameres array open your database in phpmyadmin and check out the <prefix>_games table's structure.

Also I'd suggest you to use prefixes in all macros you'll assign (different for different blocks, INFO_ in my case) - this will prevent the blocks from overriting other blocks' macros.
Logged
Customers
Full Member
*

Karma: 0
Posts: 31



WWW Email
Reply #4 on: Oct 20, 09, 07:24 AM

Cool add on, i'll give it a try later tonight.
Logged

Free Online and Arcade Games! -- http://www.nightgamers.com
Free Online and Flash Games! --  http://www.sevengamers.com
Newbie
*

Karma: 0
Posts: 3


Email
Reply #5 on: Aug 10, 11, 06:41 AM

added, but nothing appears, did not generate any errors, everything ok, however nothing appears, everything is as before.
Logged
Pages: [1]
 
Jump to: