PDA

View Full Version : This game has been viewed VIEWS; ?> times


Boon™
12-12-2007, 01:18 PM
I've done a fresh install of 2.0.0 A1 (test server - localhost).

On the game detail page, where it should show views I get this

This game has been viewed VIEWS; ?> times.

Also when I check the database, games table, the views counter is not incrementing.

Server
PHP Version: 5.2.4
MySQL Version: 5.0.45-community-nt
iGaming CMS: 2.0.0 A1

Windows XP

Looking at the gamedetails.php file, I don't see where this information is output to template so not sure where to look to fix it.

Shujjah
12-14-2007, 01:24 PM
it is Alpha not everything is done

UnderDog
06-21-2008, 12:32 PM
it is Alpha not everything is done
You're absolutely right, but it's quite easy to fix, so here we go:
Go to /admin/templates.php (unfortunately there isn't a menu choice so you need to type it in manually)
You see all possible templates you can edit
Click on game_profile
You see a bunch of html, just ignore it.
Scroll all the way down
Find

<p>
This game has been viewed <?php echo $row->VIEWS; ?> times.
</p>

Replace with

<p>
This game has been viewed {views} times.
</p>

Click on Save Template

Now you need to change 1 more thing
Open gamedetails.php
Find
$game->addvar( '{description}', clean($row->DESCRIPTION) );
Below that, add
$game->addvar( '{views}', stripslashes($row->VIEWS) );

It keeps showing that it has been viewed 0 times, but we can fix that later on :p

Tyler2499
03-07-2009, 10:42 PM
You should tell them how to get it so it can be on the menu... I guess i will.
go to yoursite.com/root/admin/modules.php?do=install
type in Modules Then click bottom box and type modules.php Click Install then enable it by going to modules.php finding it and clicking enable module

do the same for templates.php

Now you can access the template section a lot easier

EDIT: Fix View Count!
Edit the gamedetails.php file

Find $views = $row->VIEWS + 1;
$db->Execute("UPDATE `sp_games` SET `views` = '$views' WHERE `id` = '$row->ID'");
Replace with

$views2=($row->VIEWS+1);
$db->Execute("UPDATE `sp_games` SET `views` = '$views2' WHERE `id` = '$id'");