function upgrade() { require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "common.class.php"; require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "settings.class.php"; $common = new common(); $settings = new settings(); try { // Set proper permissions on the SQLite file. if ($settings::db_driver == "sqlite") { chmod($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "portal.sqlite", 0666); } // Update the version and patch settings.. $common->updateSetting("version", "2.0.2"); $common->updateSetting("patch", ""); // The upgrade process completed successfully. $results['success'] = TRUE; $results['message'] = "Upgrade to v2.0.2 successful."; return $results; } catch (Exception $e) { // Something went wrong during this upgrade process. $results['success'] = FALSE; $results['message'] = $e->getMessage(); return $results; } }
function display(&$pageData) { $common = new common($this); // Check if the portal is installed or needs upgraded. $thisVersion = "2.5.0"; if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/classes/settings.class.php")) { header("Location: /install/install.php"); } elseif ($common->getSetting("version") != $thisVersion) { header("Location: /install/upgrade.php"); } // The Base URL of this page (needed for Plane Finder client link) $pageData['baseurl'] = $common->getBaseUrl(); // Load the master template along with required data for the master template.. $master = $this->readTemplate('master.tpl'); require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "links.class.php"; $links = new links(); $pageData['links'] = $links->getAllLinks(); // Load the template for the requested page. $page = $this->readTemplate($common->removeExtension($_SERVER["SCRIPT_NAME"]) . '.tpl'); $output = $this->mergeAreas($master, $page); $output = $this->mergeSettings($output); $output = $this->mergePageData($output, $pageData); $output = $this->processIfs($output, $pageData); $output = $this->processForeach($output, $pageData); $output = $this->processFors($output, $pageData); $output = $this->processWhiles($output, $pageData); $output = $this->removeComments($output); // Insert page ID mainly used to mark an active navigation link when using Bootstrap. $output = str_replace("{template:pageId}", $common->removeExtension($_SERVER["SCRIPT_NAME"]) . "-link", $output); echo $output; }
private function getOrganizations() { // Common functions $common = new common(); // Ldap Connections $ldap = $common->ldapConnect($this->ldap_host, $this->ldap_root_dn, $this->ldap_root_pw); if ($ldap) { $filter = "objectClass=organizationalUnit"; $justthese = array("ou"); $search = ldap_list($ldap, $this->ldap_context, $filter, $justthese); $entry = ldap_get_entries($ldap, $search); } if ($entry['count'] > 0) { foreach ($entry as $tmp) { if ($tmp['ou'][0] != "") { $result_ou[] = $tmp['ou'][0]; } } } else { $result_ou[] = $this->ldap_context; } natcasesort($result_ou); ldap_close($ldap); return $result_ou ? $result_ou : ''; }
function getVisibleFlights() { require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "settings.class.php"; require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "common.class.php"; $settings = new settings(); $common = new common(); // Get all flights to be notified about from the flightNotifications.xml file. $lookingFor = array(); if ($settings::db_driver == "xml") { // XML $savedFlights = simplexml_load_file($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "flightNotifications.xml"); foreach ($savedFlights as $savedFlight) { $lookingFor[] = array($savedFlight); } } else { // PDO $dbh = $common->pdoOpen(); $sql = "SELECT flight, lastMessageCount FROM " . $settings::db_prefix . "flightNotifications"; $sth = $dbh->prepare($sql); $sth->execute(); $lookingFor = $sth->fetchAll(); $sth = NULL; $dbh = NULL; } // Check dump1090-mutability's aircraft JSON output to see if the flight is visible. $visibleFlights = array(); $url = "http://localhost/dump1090/data/aircraft.json"; $json = file_get_contents($url); $data = json_decode($json, true); foreach ($data['aircraft'] as $aircraft) { if (array_key_exists('flight', $aircraft)) { $visibleFlights[] = strtoupper(trim($aircraft['flight'])); } } $foundFlights = array(); $foundFlights['tracking'] = ''; foreach ($lookingFor as $flight) { if (strpos($flight[0], "%") !== false) { $searchFor = str_replace("%", "", $flight[0]); foreach ($visibleFlights as $visible) { // Still needs to be modified to send data using the new format as done below. if (strpos(strtolower($visible), strtolower($searchFor)) !== false) { $foundFlights[] = $visible; } } } else { if (in_array($flight[0], $visibleFlights)) { $thisFlight['flight'] = $flight[0]; $thisFlight['lastMessageCount'] = $flight[1]; $foundFlights['tracking'][] = $thisFlight; } } } return json_decode(json_encode((array) $foundFlights), true); }
function photo() { $objConfig = new config(); $objCommon = new common(); $this->domainPath = "http://" . $_SERVER['HTTP_HOST'] . "/"; $this->fullPath = $_SERVER['DOCUMENT_ROOT'] . "/"; $this->uploadDir = $_SERVER['DOCUMENT_ROOT'] . "/userimages/"; $this->imageQuality = $objCommon->getConfigValue("imageQuality"); $this->error = ""; $this->mysql = new mysql(); }
function upgrade() { require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "common.class.php"; require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "settings.class.php"; $common = new common(); $settings = new settings(); try { // Add the positions.aircraft column if the portal is using MySQL or SQLite database. if ($settings::db_driver == "mysql") { // Check to see if the column already exists. $dbh = $common->pdoOpen(); if (count($dbh->query("SHOW COLUMNS FROM `" . $settings::db_prefix . "positions` LIKE 'aircraft'")->fetchAll()) == 0) { // Add the column if it does not exist. $sql = "ALTER TABLE " . $settings::db_prefix . "positions ADD COLUMN aircraft BIGINT"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; } $dbh = NULL; } if ($settings::db_driver == "sqlite") { // Check to see if the column already exists. $dbh = $common->pdoOpen(); $columns = $dbh->query("pragma table_info(positions)")->fetchArray(SQLITE3_ASSOC); $columnExists = FALSE; foreach ($columns as $column) { if ($column['name'] == 'lastSeen') { $columnExists = TRUE; } } // Add the column if it does not exist. if (!$columnExists) { $sql = "ALTER TABLE " . $settings::db_prefix . "positionss ADD COLUMN aircraft BIGINT"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; } $dbh = NULL; } // Update the version and patch settings.. $common->updateSetting("version", "2.1.0"); $common->updateSetting("patch", ""); // The upgrade process completed successfully. $results['success'] = TRUE; $results['message'] = "Upgrade to v2.1.0 successful."; return $results; } catch (Exception $e) { // Something went wrong during this upgrade process. $results['success'] = FALSE; $results['message'] = $e->getMessage(); return $results; } }
function pageContent() { $common = new common(); global $posts, $pageLinks, $previewLength; ?> <div class="container"> <h1>Blog Posts</h1> <hr /> <?php foreach ($posts as $post) { ?> <h2><a href="post.php?title=<?php echo urlencode($post['title']); ?> "><?php echo $post['title']; ?> </a></h2> <p>Posted <strong><?php echo date_format(date_create($post['date']), "F jS, Y"); ?> </strong> by <strong><?php echo $post['author']; ?> </strong>.</p> <div><?php echo substr($common->removeHtmlTags($post['contents']), 0, $previewLength); ?> </div> <?php } ?> <ul class="pagination"> <?php $i = 1; while ($i <= $pageLinks) { ?> <li><a href="?page=<?php echo $i; ?> "><?php echo $i; ?> </a></li> <?php $i++; } ?> </ul> </div> <?php }
function upgrade() { require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "common.class.php"; require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "settings.class.php"; $common = new common(); $settings = new settings(); try { // Change tables containing datetime data to datetime. if ($settings::db_driver != "mysql") { $dbh = $common->pdoOpen(); $sql = "ALTER TABLE " . $settings::db_prefix . "aircraft MODIFY firstSeen DATETIME NOT NULL"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; $sql = "ALTER TABLE adsb_aircraft MODIFY lastSeen DATETIME NOT NULL"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; $sql = "ALTER TABLE adsb_blogPosts MODIFY date DATETIME NOT NULL"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; $sql = "ALTER TABLE adsb_flights MODIFY firstSeen DATETIME NOT NULL"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; $sql = "ALTER TABLE adsb_flights MODIFY firstSeen DATETIME NOT NULL"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; $sql = "ALTER TABLE adsb_positions MODIFY time DATETIME NOT NULL"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; $dbh = NULL; } // Add timezone setting. $common->addSetting("timeZone", date_default_timezone_get()); // update the version and patch settings. $common->updateSetting("version", "2.0.1"); $common->updateSetting("patch", ""); // The upgrade process completed successfully. $results['success'] = TRUE; $results['message'] = "Upgrade to v2.0.1 successful."; return $results; } catch (Exception $e) { // Something went wrong during this upgrade process. $results['success'] = FALSE; $results['message'] = $e->getMessage(); return $results; } }
function photo($files) { $objConfig = new config(); $objCommon = new common(); $this->domainPath = $objConfig->get_domain_path(); $this->fullPath = $objConfig->get_full_domain_path(); $this->uploadDir = $objConfig->get_upload_dir(); $this->imageQuality = $objCommon->getConfigValue("imageQuality"); $this->files = $files; $this->description = ""; $this->fileType = ""; $this->title = ""; $this->tags = ""; }
function BlogSearch($args) { global $addonPathData; $this->Init(); $search_obj = $args[0]; $label = common::GetLabelIndex('special_blog'); $full_path = $addonPathData . '/index.php'; // config of installed addon to get to know how many post files are if (!file_exists($full_path)) { return; } require $full_path; $fileIndexMax = floor($blogData['post_index'] / 20); // '20' I found in SimpleBlogCommon.php function GetPostFile (line 62) for ($fileIndex = 0; $fileIndex <= $fileIndexMax; $fileIndex++) { $postFile = $addonPathData . '/posts_' . $fileIndex . '.php'; if (!file_exists($postFile)) { continue; } require $postFile; foreach ($posts as $id => $post) { $title = $label . ': ' . str_replace('_', ' ', $post['title']); $content = str_replace('_', ' ', $post['title']) . ' ' . $post['content']; SimpleBlogCommon::UrlQuery($id, $url, $query); $search_obj->FindString($content, $title, $url, $query); } $posts = array(); } }
/** * initialize page elements * */ function init() { global $locate, $config; $objResponse = new xajaxResponse(); $objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin, $_SESSION['curuser']['country'], $_SESSION['curuser']['language'])); $objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin)); $objResponse->addScript("xajax_showGrid(0," . ROWSXPAGE . ",'','','')"); $objResponse->addAssign("btnContact", "value", $locate->Translate("contact")); $objResponse->addAssign("btnNote", "value", $locate->Translate("note")); $objResponse->addAssign("btnCustomerLead", "value", $locate->Translate("customer_leads")); if ($config['system']['customer_leads'] == 'default_move' || $config['system']['customer_leads'] == 'move') { $objResponse->addAssign("customerLeadAction", "innerHTML", "<input type=\"button\" onclick=\"xajax_customerLeadsAction('" . $config['system']['customer_leads'] . "',xajax.getFormValues('delGrid'),xajax.getFormValues('searchForm'));\" id=\"btnCustomerlead\" name=\"btnCustomerlead\" value=\"" . $locate->Translate("move_to_customerleads") . "\">"); } else { if ($config['system']['customer_leads'] == 'default_copy' || $config['system']['customer_leads'] == 'copy') { $objResponse->addAssign("customerLeadAction", "innerHTML", "<input type=\"button\" onclick=\"xajax_customerLeadsAction('" . $config['system']['customer_leads'] . "',xajax.getFormValues('delGrid'),xajax.getFormValues('searchForm'));\" id=\"btnCustomerlead\" name=\"btnCustomerlead\" value=\"" . $locate->Translate("copy_to_customerleads") . "\">"); } else { $objResponse->addAssign("customerLeadAction", "innerHTML", ""); } } //******* $objResponse->addAssign("by", "value", $locate->Translate("by")); //搜索条件 $objResponse->addAssign("search", "value", $locate->Translate("search")); //搜索内容 //******* return $objResponse; }
private function _load_agent_file() { $user_agents = common::get_config('user_agents'); // obullo changes .. $return = FALSE; if (isset($user_agents['platforms'])) { $this->platforms =& $user_agents['platforms']; unset($user_agents['platforms']); $return = TRUE; } if (isset($user_agents['browsers'])) { $this->browsers =& $user_agents['browsers']; unset($user_agents['browsers']); $return = TRUE; } if (isset($user_agents['mobiles'])) { $this->mobiles =& $user_agents['mobiles']; unset($user_agents['mobiles']); $return = TRUE; } if (isset($user_agents['robots'])) { $this->robots =& $user_agents['robots']; unset($robots); $return = TRUE; } return $return; }
/** * function to init import page * * * @return $objResponse * */ function init($fileName) { global $locate, $config; $objResponse = new xajaxResponse(); $file_list = getExistfilelist(); $objResponse->addAssign('filelist', 'innerHTML', ''); $objResponse->addScript("addOption('filelist','0','" . $locate->Translate('select a existent file') . "');"); foreach ($file_list as $file) { $objResponse->addScript("addOption('filelist','" . $file['fileid'] . "','" . $file['originalname'] . "');"); } $tableList = "<select name='sltTable' id='sltTable' onchange='selectTable(this.value);' >\n\t\t\t\t\t\t\t\t\t\t\t<option value=''>" . $locate->Translate("selecttable") . "</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='customer'>customer</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='contact'>contact</option>\n\t\t\t\t\t\t\t\t\t\t\t<option value='diallist'>diallist</option>\n\t\t\t\t\t\t\t\t\t\t</select>"; $objResponse->addAssign("divTables", "innerHTML", $tableList); $objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin, $_SESSION['curuser']['country'], $_SESSION['curuser']['language'])); $objResponse->addAssign("divGrid", "innerHTML", ''); //$objResponse->addScript("xajax_showDivMainRight(document.getElementById('hidFileName').value);"); //$objResponse->loadXML(showDivMainRight($fileName)); //$objResponse->addAssign("divDiallistImport", "innerHTML", ''); $objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin)); if ($_SESSION['curuser']['usertype'] == 'admin') { // add all group $res = astercrm::getGroups(); while ($row = $res->fetchRow()) { $objResponse->addScript("addOption('groupid','" . $row['groupid'] . "','" . $row['groupname'] . "');"); } } else { // add self $objResponse->addScript("addOption('groupid','" . $_SESSION['curuser']['groupid'] . "','" . $_SESSION['curuser']['group']['groupname'] . "');"); } $objResponse->addScript("setCampaign();"); $objResponse->loadXML(showDivMainRight($fileName)); return $objResponse; }
public function __construct() { parent::__construct(); $this->load->model("news_model"); $this->load->model("view_model"); $this->load->model("mypage_model"); }
function ShowCategory() { $this->showing_category = $this->catindex; $catname = $this->categories[$this->catindex]; //paginate $per_page = SimpleBlogCommon::$data['per_page']; $page = 0; if (isset($_GET['page']) && is_numeric($_GET['page'])) { $page = (int) $_GET['page']; } $start = $page * $per_page; $include_drafts = common::LoggedIn(); $show_posts = $this->WhichCatPosts($start, $per_page, $include_drafts); $this->ShowPosts($show_posts); //pagination links echo '<p class="blog_nav_links">'; if ($page > 0) { $html = SimpleBlogCommon::CategoryLink($this->catindex, $catname, '%s', 'page=' . ($page - 1), 'class="blog_newer"'); echo gpOutput::GetAddonText('Newer Entries', $html); echo ' '; } if (($page + 1) * $per_page < $this->total_posts) { $html = SimpleBlogCommon::CategoryLink($this->catindex, $catname, '%s', 'page=' . ($page + 1), 'class="blog_older"'); echo gpOutput::GetAddonText('Older Entries', $html); } echo '</p>'; }
public function __construct() { parent::__construct(); $this->load->model('program_model'); $this->load->model('member_model'); $this->load->model('tag_model'); }
private function _set_routing() { if (common::config_item('enable_query_strings') === TRUE and isset($_GET[config_item('controller_trigger')])) { $this->query_string = TRUE; $this->set_directory(trim($this->uri->_filter_uri($_GET[config_item('directory_trigger')]))); $this->set_class(trim($this->uri->_filter_uri($_GET[config_item('controller_trigger')]))); if (isset($_GET[config_item('function_trigger')])) { $this->set_method(trim($this->uri->_filter_uri($_GET[config_item('function_trigger')]))); } return; } $this->default_controller = (!isset($this->routes['default_controller']) or $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']); $this->uri->_fetch_uri_string(); if ($this->uri->uri_string == '') { if ($this->default_controller === FALSE) { throw new Exception("Unable to determine what should be displayed. A default route has not been specified in the routing file."); } $segments = $this->_validate_request(explode('/', $this->default_controller)); $this->set_class($segments[1]); $this->set_method($this->routes['index_method']); // index $this->uri->rsegments = $segments; $this->uri->_reindex_segments(); //log_message('debug', "No URI present. Default controller set."); return; } unset($this->routes['default_controller']); $this->uri->_remove_url_suffix(); $this->uri->_explode_segments(); $this->_parse_routes(); $this->uri->_reindex_segments(); }
/** * Request the api. * * @param string $moduleName * @param string $methodName * @param string $action * @access public * @return void */ public function request($moduleName, $methodName, $action) { $host = common::getSysURL() . $this->config->webRoot; $param = ''; if ($action == 'extendModel') { if (!isset($_POST['noparam'])) { foreach ($_POST as $key => $value) { $param .= ',' . $key . '=' . $value; } $param = ltrim($param, ','); } $url = rtrim($host, '/') . inlink('getModel', "moduleName={$moduleName}&methodName={$methodName}¶ms={$param}", 'json'); $url .= $this->config->requestType == "PATH_INFO" ? '?' : '&'; $url .= $this->config->sessionVar . '=' . session_id(); } else { if (!isset($_POST['noparam'])) { foreach ($_POST as $key => $value) { $param .= '&' . $key . '=' . $value; } $param = ltrim($param, '&'); } $url = rtrim($host, '/') . helper::createLink($moduleName, $methodName, $param, 'json'); $url .= $this->config->requestType == "PATH_INFO" ? '?' : '&'; $url .= $this->config->sessionVar . '=' . session_id(); } /* Unlock session. After new request, restart session. */ session_write_close(); $content = file_get_contents($url); session_start(); return array('url' => $url, 'content' => $content); }
/** * 用户登陆 * @param string $username * @param string $password * @throws Exception */ public function login($username, $password) { try { if (empty($username)) { throw new Exception('请填写用户名'); } if (empty($password)) { throw new Exception('请填写密码'); } $username = addslashes($username); $password = md5(addslashes($password)); $mysql = C('mysql'); if (!($result = $mysql->fetchOne('id', 'user', "name='{$username}' and pass='******'"))) { throw new Exception('登陆失败'); } $_SESSION['uid'] = $result['id']; $_SESSION['username'] = $username; parent::__construct(); $this->check_permission(__FUNCTION__); jump('登陆成功', 'admin.php', true); } catch (Exception $e) { echo $e->getMessage(); jump('', 'login.html'); } }
public function __construct() { parent::__construct(); $this->load->model("content_model"); $this->load->model("liveschedule_model"); $this->load->model("popupschedule_model"); }
private static function singleton() { if (!isset(self::$instance)) { self::$instance = new self(); } return self::$instance; }
function init() { global $locate; $objResponse = new xajaxResponse(); $peers = array(); if ($_SESSION['curuser']['usertype'] == 'admin') { // set all group first $group = astercrm::getAll('astercrm_accountgroup'); $objResponse->addScript("addOption('groupid',0,'" . $locate->Translate("All") . "');"); while ($group->fetchInto($row)) { $objResponse->addScript("addOption('groupid','" . $row['id'] . "','" . $row['groupname'] . "');"); } } else { // set one group $objResponse->addScript("addOption('groupid','" . $_SESSION['curuser']['groupid'] . "','" . "" . "');"); // set all account $account = astercrm::getGroupMemberListByID($_SESSION['curuser']['groupid']); $objResponse->addScript("addOption('accountid','" . "0" . "','" . "All" . "');"); while ($account->fetchInto($row)) { $objResponse->addScript("addOption('accountid','" . $row['id'] . "','" . $row['username'] . "');"); } } $objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin, $_SESSION['curuser']['country'], $_SESSION['curuser']['language'])); $objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin)); return $objResponse; }
/** * Print all categories and their contents on gadget * */ function Run() { echo '<div class="simple_blog_gadget"><div>'; echo '<span class="simple_blog_gadget_label">'; echo gpOutput::GetAddonText('Categories'); echo '</span>'; echo '<ul>'; foreach ($this->categories as $catdata) { if (!$catdata['visible']) { continue; //skip hidden categories } echo '<li>'; $sum = count($catdata['posts']); echo '<a class="blog_gadget_link">' . $catdata['ct'] . ' (' . $sum . ')</a>'; if ($sum) { echo '<ul class="nodisplay">'; foreach ($catdata['posts'] as $post_index => $post_title) { echo '<li>'; echo common::Link('Special_Blog', $post_title, 'id=' . $post_index); echo '</li>'; } echo '</ul>'; } echo '</li>'; } echo '</ul>'; echo '</div></div>'; }
function cell_process($content, $layout_id = '') { #####解析单元开始####### $cells_info = common::parse_cell(html_entity_decode($content)); $cells = $cells_info[1]; if (is_array($cells) && count($cells) > 0) { foreach ($cells as $k => $v) { if ($k > 0) { if ($cells[0] == $v) { $this->errorOutput('单元名称不能重复'); } } } } $exist_cells = $layout_id ? $this->get_exist_cell($layout_id) : array(); $celladding = array_diff($cells, $exist_cells); //将要增加的单元 $celldeling = array_diff($exist_cells, $cells); //将要删除的单元 $insert_id = array(); if (is_array($celladding) && count($celladding) > 0) { foreach ($celladding as $k => $v) { $add_cell = array('layout_id' => $layout_id, 'cell_name' => $v, 'cell_code' => $cells_info[0][$k], 'create_time' => TIMENOW, 'update_time' => TIMENOW, 'sign' => uniqid(), 'user_id' => $this->user['user_id'], 'user_name' => $this->user['user_name'], 'appid' => $this->user['appid'], 'appname' => $this->user['display_name']); $insert_id[] = $this->db->insert_data($add_cell, 'layout_cell'); } } $celldeling = implode("','", $celldeling); if ($celldeling) { $sql = "DELETE FROM " . DB_PREFIX . "layout_cell WHERE cell_name IN('" . $celldeling . "') AND layout_id = " . $layout_id; $this->db->query($sql); } return implode(',', $insert_id); #####解析单元开始####### }
public static function getStuff() { $config = self::getConfig(); if (common::LoggedIn()) { if ($config['wysiwygEnabled']) { global $addonPathCode, $page; require_once $addonPathCode . "/Renderer.php"; $renderer = new Renderer($config, $addonPathCode . "/lib/parsedown"); print $renderer->render($_REQUEST['content']); //haha, very secure. NOT! $nonce_str = 'EasyMark4Life!'; //TODO: sanitize $config stuff //"stuff" is defined in edit.js print "<script>"; print "var nonceStr = '" . $nonce_str . "';"; print "var postNonce = '" . common::new_nonce('post', true) . "';"; print "setTimeout(stuff, " . htmlspecialchars($config['wysiwygDelay']) . "*1000);"; print "</script>"; // cleanup old page object unset($page); } } else { print "Have to be logged in to use this feature"; } }
private function _init() { $Classes = array('config' => 'Config', 'router' => 'Router', 'uri' => 'URI', 'output' => 'Output'); foreach ($Classes as $public_var => $Class) { $this->{$public_var} = common::register($Class); } }
public function __construct() { parent::__construct(); $this->member_lib->adminCheck(); $this->load->model('liveschedule_model'); $this->load->model('popupschedule_dt_model'); }
/** * function to init import page * * * @return $objResponse * */ function init($fileName) { global $locate, $config; $objResponse = new xajaxResponse(); $objResponse->addAssign("spanSelectFile", "innerHTML", $locate->Translate("please_select_file")); $file_list = getExistfilelist(); $objResponse->addScript("addOption('filelist','0','" . $locate->Translate('select a existent file') . "');"); foreach ($file_list as $file) { $objResponse->addScript("addOption('filelist','" . $file['fileid'] . "','" . $file['originalname'] . "');"); } $objResponse->addAssign("btnUpload", "value", $locate->Translate("upload")); $objResponse->addAssign("btnImportData", "value", $locate->Translate("import")); $objResponse->addAssign("spanFileManager", "innerHTML", $locate->Translate("file_manager")); $objResponse->addAssign("hidOnUploadMsg", "value", $locate->Translate("uploading")); $objResponse->addAssign("hidOnSubmitMsg", "value", $locate->Translate("data_importing")); if ($_SESSION['curuser']['usertype'] == 'admin') { $tableList = "<select name='sltTable' id='sltTable' onchange='selectTable(this.value);' >\r\n\t\t\t\t\t\t\t<option value=''>" . $locate->Translate("selecttable") . "</option>\r\n\t\t\t\t\t\t\t<option value='resellerrate'>resellerrate</option>\r\n\t\t\t\t\t\t\t<option value='callshoprate'>callshoprate</option>\r\n\t\t\t\t\t\t\t<option value='myrate'>myrate</option>\r\n\t\t\t\t\t\t</select>"; } elseif ($_SESSION['curuser']['usertype'] == 'reseller') { $tableList = "<select name='sltTable' id='sltTable' onchange='selectTable(this.value);' >\r\n\t\t\t\t\t\t\t<option value=''>" . $locate->Translate("selecttable") . "</option>\r\n\t\t\t\t\t\t\t<option value='callshoprate'>callshoprate</option>\r\n\t\t\t\t\t\t\t<option value='myrate'>myrate</option>\r\n\t\t\t\t\t\t</select>"; } elseif ($_SESSION['curuser']['usertype'] == 'groupadmin') { $tableList = "<select name='sltTable' id='sltTable' onchange='selectTable(this.value);' >\r\n\t\t\t\t\t\t\t<option value=''>" . $locate->Translate("selecttable") . "</option>\r\n\t\t\t\t\t\t\t<option value='myrate'>myrate</option>\r\n\t\t\t\t\t\t</select>"; } $objResponse->addAssign("divTables", "innerHTML", $tableList); $objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin)); $objResponse->addAssign("divGrid", "innerHTML", ''); //$objResponse->addScript("xajax_showDivMainRight(document.getElementById('hidFileName').value);"); //$objResponse->loadXML(showDivMainRight($fileName)); //$objResponse->addAssign("divDiallistImport", "innerHTML", ''); $objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin)); $objResponse->loadXML(showDivMainRight($fileName)); if ($_SESSION['curuser']['usertype'] == 'admin') { // add all reseller $res = astercrm::getAll('resellergroup'); $objResponse->addScript("addOption('resellerid','0','" . $locate->Translate("All") . "');"); while ($row = $res->fetchRow()) { if ($config['synchronize']['id_autocrement_byset'] && ($row['id'] < $config['local_host']['minId'] || $row['id'] > $config['local_host']['maxId'])) { continue; } $objResponse->addScript("addOption('resellerid','" . $row['id'] . "','" . $row['resellername'] . "');"); } } elseif ($_SESSION['curuser']['usertype'] == 'reseller') { // add self $objResponse->addScript("addOption('resellerid','" . $_SESSION['curuser']['resellerid'] . "','" . "" . "');"); // add groups $objResponse->addScript("addOption('groupid','0','" . $locate->Translate("All") . "');"); $res = astercrm::getAll('accountgroup', "resellerid", $_SESSION['curuser']['resellerid']); while ($row = $res->fetchRow()) { if ($config['synchronize']['id_autocrement_byset'] && ($row['id'] < $config['local_host']['minId'] || $row['id'] > $config['local_host']['maxId'])) { continue; } $objResponse->addScript("addOption('groupid','" . $row['id'] . "','" . $row['groupname'] . "');"); } } else { // add self $objResponse->addScript("addOption('resellerid','" . $_SESSION['curuser']['resellerid'] . "','" . "" . "');"); $objResponse->addScript("addOption('groupid','" . $_SESSION['curuser']['groupid'] . "','" . "" . "');"); } $objResponse->addScript("setCampaign();"); return $objResponse; }
public function __construct() { parent::__construct(); $this->member_lib->adminCheck(); $this->load->model('cfg_board_model'); $this->load->model('board_model'); }
/** * Get The Image * */ public function Child($title) { global $dirPrefix; $content = $this->TitleContent($title); $img_pos = strpos($content, '<img'); if ($img_pos === false) { return; } $src_pos = strpos($content, 'src=', $img_pos); if ($src_pos === false) { return; } $src = substr($content, $src_pos + 4); $quote = $src[0]; if ($quote != '"' && $quote != "'") { return; } $src_pos = strpos($src, $quote, 1); $src = substr($src, 1, $src_pos - 1); // check for resized image, get original source if img is resized if (strpos($src, 'image.php') !== false && strpos($src, 'img=') !== false) { $src = $dirPrefix . '/data/_uploaded/' . urldecode(substr($src, strpos($src, 'img=') + 4)); } $thumb_path = common::ThumbnailPath($src); echo '<li>'; echo '<img src="' . $thumb_path . '"/>'; $label = common::GetLabel($title); echo common::Link($title, $label); echo '</li>'; }