Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Number of site displays


Reply

20 Posts   1950 Views

Avatar
sebastiankozub

5 November 2010 at 11:43am Community Member, 40 Posts

page       
page_live    
page_versions

all those tables have everywhere visits = 0 :/

Avatar
sebastiankozub

6 November 2010 at 9:03am Community Member, 40 Posts

I created:

   public static $db = array(
      'ShowInTopMenu' => 'Boolean',
      'ShowInLeftMenu' => 'Boolean',
      'ShowInLeftMenu2' => 'Boolean',
      'visits' => 'Int'
   );

in class Page and:

   $this->visits++;
   $this->write();

in class Page_Controller. Is $this->visits++ correct operation to increment 'visits' in $db?

Avatar
sebastiankozub

9 November 2010 at 5:36am Community Member, 40 Posts

Anybody see the mistake?

Avatar
bartvanirsel

9 November 2010 at 9:51am Community Member, 94 Posts

What do you see when debugging SQL using ?showqueries=1 ?

Avatar
sebastiankozub

9 November 2010 at 7:50pm Community Member, 40 Posts

I see nothing, when I am logged page is opening but no warnings and error show

Avatar
bartvanirsel

9 November 2010 at 9:09pm Community Member, 94 Posts

Do you see queries for incrementing Visits there?

Avatar
sebastiankozub

10 November 2010 at 1:03am Community Member, 40 Posts

Do I have to be logged as Admin?
I can't see any difference between page with ?showqueries=1 and page without it

Avatar
bartvanirsel

10 November 2010 at 1:13am Community Member, 94 Posts

you need to be logged in as admin, and maybe the domain should be in dev servers list