本文整理汇总了PHP中Website类的典型用法代码示例。如果您正苦于以下问题:PHP Website类的具体用法?PHP Website怎么用?PHP Website使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Website类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: subscriptionList
function subscriptionList()
{
global $bdd;
global $_TABLES;
$content = "";
$view = new Template(dirname(dirname(__FILE__)) . '/html/media.html');
if (!is_null($bdd) && !is_null($_TABLES)) {
if (isset($_SESSION['user_id'])) {
$user_id = $_SESSION['user_id'];
$objWebsiteSubscription = new WebsiteSubscription($bdd, $_TABLES);
$website_subscriptions = $objWebsiteSubscription->getAllWebsiteSubscriptionsByUser($user_id);
if (!is_null($website_subscriptions)) {
$objWebsite = new Website($bdd, $_TABLES);
foreach ($website_subscriptions as $key => $value) {
$website = $objWebsite->getData($value->website_id);
if (!is_null($website)) {
$temp_subscription = "<div class='unsubscription' website_id='%%website_id%%'></div>";
$content .= $view->getView(array("url" => $website->url, "title" => $website->website, "logo_site" => $website->logo, "alt_logo_site" => $website->website, "title_site" => $website->website, "subscription" => $temp_subscription, "website_id" => $website->id));
}
}
return $content;
} else {
// 404
return "404 Not Found";
}
} else {
// 404
return "404 Not Found";
}
} else {
error_log("BDD ERROR : " . json_encode($bdd));
error_log("TABLES ERROR : " . json_encode($_TABLES));
}
}
示例2: save_website
function save_website($datas)
{
global $templatesList;
load_lib();
//Etape 1 : sauvegarde du site
require_once MODELS . DS . 'website.php';
$websiteModel = new Website();
$templateId = $datas['template_id'];
$template = $templatesList[$templateId];
$datas['tpl_layout'] = $template['layout'];
$datas['tpl_code'] = $template['code'];
$datas['search_engine_position'] = 'header';
$datas['created_by'] = 1;
$datas['modified_by'] = 1;
$datas['online'] = 1;
$websiteModel->save($datas);
define('CURRENT_WEBSITE_ID', $websiteModel->id);
//Etape 2 : sauvegarde du menu racine
require_once MODELS . DS . 'category.php';
$categoryModel = new Category();
unset($categoryModel->searches_params);
////////////////////////////////////////////////////////
// INITIALISATION DE LA CATEGORIE PARENTE DU SITE //
$categorie = array('parent_id' => 0, 'type' => 3, 'name' => 'Racine Site ' . $websiteModel->id, 'slug' => 'racine-site-' . $websiteModel->id, 'online' => 1, 'redirect_category_id' => 0, 'display_contact_form' => 0, 'website_id' => $websiteModel->id);
$categoryModel->save($categorie);
return $websiteModel->id + $categoryModel->id;
}
示例3: __construct
/**
* Constructor
*
* @access public
*/
public function __construct()
{
parent::__construct();
$this->load->model('Questionnaire_model', 'Questionnaire_model', True);
$this->load->model('Visistor_questionnaire_answer_model', 'Visistor_questionnaire_answer_model', True);
$this->load->controller('Website');
$website_object = new Website();
$website_object->load();
}
示例4: __construct
/**
* Constructor
*
* @access public
*/
public function __construct()
{
parent::__construct();
$this->load->model('Collaborate_model', 'Collaborate_model', True);
$this->load->model('Menu_link_model', 'Menu_link_model', True);
$this->load->model('Email_setting_model', 'Email_setting_model', True);
$this->load->controller('Website');
$website_object = new Website();
$website_object->load();
}
示例5: __construct
/**
* Constructor
*
* @access public
*/
public function __construct()
{
parent::__construct();
$this->load->model('Video_model', 'Video_model', True);
$this->load->model('Page_model', 'Page_model', True);
$this->load->model('Writer_model', 'Writer_model', True);
$this->load->model('Page_selected_model', 'Page_selected_model', True);
$this->load->controller('Website');
$website_object = new Website();
$website_object->load();
}
示例6: testBeforeSave
public function testBeforeSave()
{
$websiteId = 1;
$object = $this->getMockBuilder('Magento\\Framework\\Object')->disableOriginalConstructor()->setMethods(['hasData', 'setData'])->getMock();
$store = $this->getMockBuilder('Magento\\Framework\\Object')->setMethods(['getWebsiteId'])->getMock();
$store->expects($this->once())->method('getWebsiteId')->will($this->returnValue($websiteId));
$this->storeManager->expects($this->once())->method('getStore')->will($this->returnValue($store));
$object->expects($this->once())->method('hasData')->with('website_id')->will($this->returnValue(false));
$object->expects($this->once())->method('setData')->with($this->logicalOr('website_id', $websiteId))->will($this->returnSelf());
/** @var \Magento\Framework\Object $object */
$this->assertInstanceOf('Magento\\Customer\\Model\\Customer\\Attribute\\Backend\\Website', $this->testable->beforeSave($object));
}
示例7: getwebsitepages
function getwebsitepages($websiteid)
{
$website = new Website();
$res = $website->fetchwebpages($websiteid);
$pagearr = array();
$count = 0;
while ($pagerow = $website->fetch_assoc($res)) {
if (empty($pagecontent)) {
$pagearr[$count] = $pagerow['page_id'];
$count++;
}
}
return $pagearr;
}
示例8: trigger
public function trigger($nickname = null)
{
$user = $this->load_user($nickname);
Website::triggerAll($user);
Site::Flash('notice', 'Update has been triggered');
Redirect("admin/users/" . $user->permalink());
}
示例9: action_index
public function action_index()
{
// get acl
$acl = Acl::instance();
// get modules
$modules = Settings::factory('modules')->as_array();
// get navigation
$settings = Settings::factory('navigation', array('settings' . DIRECTORY_SEPARATOR . Website::instance()->id() . DIRECTORY_SEPARATOR, 'settings'));
$navigation = $settings->get('menu');
// filter out allowed modules
$allowedModules = array();
foreach ($modules as $module => $data) {
if ($acl->allowed($module, 'access')) {
$allowedModules[$module] = $data;
}
}
// fill up sections
$sections = array();
foreach ($navigation as $section => $modules) {
foreach ($modules as $module) {
if (isset($allowedModules[$module])) {
// section has a allowed module, so include it
if (!isset($sections[$section])) {
$sections[$section] = array();
}
// add module to section
$sections[$section][$module] = $allowedModules[$module];
}
}
}
$view = View::factory('start', array('sections' => $sections));
$this->response->body($view->render());
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:33,代码来源:Start.php
示例10: instance
/**
* get instance
*/
public static function instance()
{
if (self::$_instance === FALSE) {
self::$_instance = new Website();
}
return self::$_instance;
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:10,代码来源:Website.php
示例11: website
function website()
{
$website_id = $this->parent_id;
if (empty($website_id)) {
return null;
}
$where = "blog_id = " . $website_id;
require_once 'class.mt_website.php';
$website = new Website();
$sites = $website->Find($where);
$site = null;
if (!empty($sites)) {
$site = $sites[0];
}
return $site;
}
示例12: init
/**
* init: check if user is logged in
*
* if not: redirect to login
*/
public function init()
{
// call parent before first
parent::init();
// only check if the controller is not auth
if (Request::initial()->controller() != 'Auth') {
// url to loginpage
$url = URL::to('Auth@login');
// init identity
$identity = Identity::instance();
//revert identity to original user (maybe assume was called somewhere else)
$identity->revert();
// check authentication
if (!$identity->authenticated()) {
// if user is not allready authenticated, redirect to login page
$this->redirect($url);
} else {
$website = Website::instance();
// else: initialise acl
Acl::init($identity, new Model_Rights($website->websites()));
// set current environment
Acl::environment($website->id());
// if user is not entitled to access backend
if (!Acl::instance()->allowed('Backend', 'access')) {
$this->redirect($url);
}
// if user is not entitled to access controller
if (!Acl::instance()->allowed(Request::initial()->controller(), 'access')) {
$this->redirect($url);
}
}
}
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:38,代码来源:Auth.php
示例13: __construct
public function __construct($type, $limit = 5, $page = 0, $worldId = 0, $vocation = '')
{
$this->highscoreConfig = Website::getWebsiteConfig();
parent::__construct();
$this->skillType = $type;
$this->setLimit($limit);
$this->setOffset($page * $limit);
$this->worldId = $worldId;
$this->vocation = $vocation;
switch ($type) {
case self::SKILL_FIST:
case self::SKILL_CLUB:
case self::SKILL_SWORD:
case self::SKILL_AXE:
case self::SKILL_DISTANCE:
case self::SKILL_SHIELD:
case self::SKILL_FISHING:
$this->loadSkill();
break;
case self::SKILL__MAGLEVEL:
$this->loadMagic();
break;
case self::SKILL__LEVEL:
$this->loadLevel();
break;
default:
new Error_Critic('', __METHOD__ . '(), unknown type: ' . htmlspecialchars($type));
break;
}
}
示例14: run
public function run()
{
Banner::truncate();
Website::truncate();
$user = User::create(array("username" => "danheyman", "name" => "Daniel Heyman", "email" => "heymandan@gmail.com", "password" => "hello", "newsletter" => true, "admin_emails" => true, "membership" => "platinum", "paypal" => "", "membership_expires" => Carbon::now()->addMonth(), "referrals" => 0, "upline" => "", "cash" => 0, "credits" => 0, "credits_today" => 0, "views_total" => 0, "views_today" => 0, 'auto_assign' => 0, 'register_ip' => Request::getClientIp(), 'last_login' => Carbon::now()));
for ($x = 0; $x < 20; $x++) {
$website = new Website();
$website->url = "http://listviral.com";
$website->enabled = true;
$website->credits = 10000;
$website->views = 0;
$website->days = array();
$website->hours = array();
$user->websites()->save($website);
$banner = new Banner();
$banner->banner = "http://brisksurf.com/banner.png";
$banner->url = "http://brisksurf.com";
$banner->enabled = true;
$banner->credits = 10000;
$banner->views = 0;
$banner->days = array();
$banner->hours = array();
$user->banners()->save($banner);
}
}
示例15: websites
/**
* @before _secure, _admin
*/
public function websites($user_id)
{
$this->seo(array("title" => "View Users Websites", "keywords" => "admin", "description" => "admin", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$websites = Website::all(array("user_id = ?" => $user_id));
$view->set("websites", $websites);
}