what is "dev servers list" it's the first time I hear it :)
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Previous 10 entries
- 1
- 2
- Page 33(current)
in _config.php
Director::set_dev_servers(array(
'localhost',
'127.0.0.1',
'yourserver.com'
));
listing is very long, please give me your IP and I add yours to give you the access. site is here http://87.207.57.202/boston/
here you can see code
class Page extends SiteTree {
public static $db = array(
'ShowInTopMenu' => 'Boolean',
'ShowInLeftMenu' => 'Boolean',
'ShowInLeftMenu2' => 'Boolean',
'visits' => 'Int'
);
public static $has_one = array(
);
function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Behaviour", new CheckboxField("ShowInTopMenu", "Pokaż w menu górnym"));
$fields->addFieldToTab("Root.Behaviour", new CheckboxField("ShowInLeftMenu", "Pokaż w menu lewym"));
$fields->addFieldToTab("Root.Behaviour", new CheckboxField("ShowInLeftMenu2", "Pokaż w menu lewym 2"));
return $fields;
}
}
class Page_Controller extends ContentController
{
function topMenu()
{
$whereStatement = "ShowInTopMenu = 1";
return DataObject::get("Page", $whereStatement);
}
function leftMenu()
{
$whereStatement = "ShowInLeftMenu = 1";
return DataObject::get("Page", $whereStatement);
}
function leftMenu2()
{
$whereStatement = "ShowInLeftMenu2 = 1";
return DataObject::get("Page", $whereStatement);
}
function totalVisits()
{
return DB::query("SELECT SUM(visits) FROM page_live")->value();
}
public static $allowed_actions = array(
);
public function init()
{
parent::init();
Requirements::themedCSS('layout');
Requirements::themedCSS('typography');
Requirements::themedCSS('form');
//if( ?? cookie or session variable doesn't exist ?? )
//{
//?? create session or cookie ??
$this->visits++;
$this->write();
//}
}
}
so the important is $this->visits++; in Page Controller and 'visits' => 'Int' in public static $db
there is no update query on visits in any page* table
- Previous 10 entries
- 1
- 2
- Page 33(current)