/** * 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(); }
/** * Constructor * * @access public */ public function __construct() { parent::__construct(); $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(); }
/** * 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(); }
public function getAvatarUrl() { if (!$this->_resourceUrl) { throw new \Exception("Can't getWebsiteUrl() because resourceUrl not set on this HistoryItem object"); } $this->load($this->_resourceUrl); foreach ($this->_data['associatedWebsites'] as $websiteResourceUrl) { $website = new Website(); $website->load($websiteResourceUrl); $avatarUrl = $website->getAvatarUrl(); if ($avatarUrl) { return $avatarUrl; } } return "https://app.buzzstream.com/img/default_avatar_media.png"; }
$DB = new database(); if (!$DB->connect()) { die(APP_NAME . ' # ERROR<br /> ' . $DB->get_last_error()); } // session checking if (empty($_SESSION['APP_USER#' . APP_UNIQUE])) { $DB->disconnect(); die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "No user logged in."}, "id" : "id"}'); } else { $user = new user(); $user->load($_SESSION['APP_USER#' . APP_UNIQUE]); } // load the working website $website = new Website(); if (!empty($_SESSION['website_active'])) { $website->load($_SESSION['website_active']); } else { $website->load(); } // load the first available // force loading user permissions before desconnecting from the database $foo = $user->permission("foo"); session_write_close(); $DB->disconnect(); function navigate_upload_remove_temporary($targetDir, $maxFileAge = 86400) { if (is_dir($targetDir) && ($dir = opendir($targetDir))) { while (($file = readdir($dir)) !== false) { $filePath = $targetDir . DIRECTORY_SEPARATOR . $file; // Remove temp files if they are older than the max age if (preg_match('/\\.tmp$/', $file) && filemtime($filePath) < time() - $maxFileAge) {
$id = $_REQUEST['id']; if (!empty($_REQUEST['id'])) { if (is_int($id)) { $item->load($id); } else { $item->load($_REQUEST['id']); } } if (!$item->id) { echo 'Error: no item found with id ' . $_REQUEST['id'] . '.'; session_write_close(); $DB->disconnect(); // we don't need the database anymore (we'll see) exit; } $website = new Website(); if (!empty($_GET['wid'])) { $website->load(intval($_GET['wid'])); } else { if ($item->website > 0) { $website->load($item->website); } else { $website->load(); } } $path = NAVIGATE_PRIVATE . '/' . $website->id . '/files/' . $item->id; // pass control to usual website download (ignoring enabled check) $_REQUEST['type'] = $item->type; $_REQUEST['force_resize'] = 'true'; nvweb_object(true, true); // ignore all permissions
set_time_limit(0); $menu_layout = new menu_layout(); $menu_layout->load(); // load the working website $website = new Website(); if ((@$_GET['act'] == '0' || @$_GET['quickedit'] == 'true') && !empty($_GET['wid'])) { $website->load(intval($_GET['wid'])); } else { if (!empty($_SESSION['website_active'])) { $website->load($_SESSION['website_active']); } else { $url = nvweb_self_url(); $website = nvweb_load_website_by_url($url, false); if (!$website) { $website = new Website(); $website->load(); } } } // if there are no websites, auto-create the first one if (empty($website->id)) { $website->create_default(); } // check allowed websites for this user $wa = $user->websites; if (!empty($wa)) { if (array_search($website->id, $wa) === false) { $website = new website(); if (!empty($wa[0])) { // load first website allowed $website->load(intval($wa[0]));