• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP General类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中General的典型用法代码示例。如果您正苦于以下问题:PHP General类的具体用法?PHP General怎么用?PHP General使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了General类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ProductUpdateCart

 function ProductUpdateCart($argProductID, $argQty)
 {
     $objCore = new Core();
     $objGeneral = new General();
     $arrCartDetails = array();
     $arrNewCart = array();
     if (isset($_SESSION['sessCartDetails'])) {
         $arrCartDetails = $_SESSION['sessCartDetails'];
     }
     foreach ($arrCartDetails as $arrTempCartData) {
         $varPrdId = $arrTempCartData['ProductId'];
         if ($varPrdId == $argProductID) {
             $arrTempCartData['Qty'] = $argQty;
             //getting  details
             $arrCol = array('pkProductID', 'ProductName', 'ProductCode', 'ProductDescription', 'ProductSpecifications', 'ProductWeight', 'ProductCost', 'ProductActualCost', 'ProductQuantity', 'ProductQuantityAvailable', 'ProductStatus', 'ProductIsFeatured', 'ProductImage', 'ProductIsSpecailOffer', 'ProductDateAdded', 'ProductDateModified');
             $varWhr = 'pkProductID=' . $argProductID;
             $arrProduct = $objGeneral->getRecord(TABLE_PRODUCTS, $arrCol, $varWhr);
         }
         array_push($arrNewCart, $arrTempCartData);
     }
     if ($_SESSION['sessMess']) {
         $_SESSION['sessVarMsg'] = '';
         $_SESSION['sessVarMsg'] = 'Cart details have been updated successfully .';
         $_SESSION['sessFlag'] = false;
         $objCore->setSuccessMsg($_SESSION['sessVarMsg']);
     }
     unset($_SESSION['sessCartDetails']);
     $_SESSION['sessCartDetails'] = $arrNewCart;
 }
开发者ID:saurabhs4,项目名称:demoshop,代码行数:29,代码来源:class.cart_utilities.php


示例2: forgotPasswordMail

 function forgotPasswordMail($argArrPOST)
 {
     $objTemplate = new EmailTemplate();
     $objValid = new Validate_fields();
     $objCore = new Core();
     $objGeneral = new General();
     $objValid->check_4html = true;
     $_SESSION['sessForgotValues'] = array();
     $objValid->add_text_field('Login ID', strip_tags($argArrPOST['frmUserName']), 'text', 'y', 255);
     $objValid->add_text_field('Verification Code', strip_tags($argArrPOST['frmSecurityCode']), 'text', 'y', 255);
     if (!$objValid->validation()) {
         $errorMsg = $objValid->create_msg();
     }
     if ($errorMsg) {
         $_SESSION['sessForgotValues'] = $argArrPOST;
         $objCore->setErrorMsg($errorMsg);
         return false;
     } else {
         if ($_SESSION['security_code'] == $argArrPOST['frmSecurityCode'] && !empty($_SESSION['security_code'])) {
             $varWhereCond = " AND ClientEmailAddress  ='" . $argArrPOST['frmUserName'] . "'";
             $userRecords = $this->getClientNumRows($varWhereCond);
             $userInfo = $this->getClientInfo($varWhereCond);
             if ($userRecords > 0) {
                 $varClientID = $userInfo['0']['pkClientID'];
                 $varMemberData = trim(strip_tags($argArrPOST['frmUserName']));
                 $varForgotPasswordCode = $objGeneral->getValidRandomKey(TABLE_CLIENTS, array('pkClientID'), 'ClientForgotPWCode', '25');
                 $varForgotPasswordLink = '<a href="' . SITE_ROOT_URL . 'clients/reset_password.php?mid=' . $varClientID . '&code=' . $varForgotPasswordCode . '">' . SITE_ROOT_URL . 'clients/reset_password.php?mid=' . $varClientID . '&code=' . $varForgotPasswordCode . '</a>';
                 $arrColumns = array('ClientForgotPWStatus' => 'Active', 'ClientForgotPWCode' => $varForgotPasswordCode);
                 $varWhereCondition = 'pkClientID = \'' . $varClientID . '\'';
                 $this->update(TABLE_CLIENTS, $arrColumns, $varWhereCondition);
                 $varClientEmail = $userInfo[0]['ClientEmailAddress'];
                 $varToUser = $varClientEmail;
                 $varFromUser = SITE_NAME . '<' . $varClientEmail . '>';
                 $varSiteName = SITE_NAME;
                 $varWhereTemplate = ' EmailTemplateTitle= \'Forgot password\' AND EmailTemplateStatus = \'Active\' ';
                 $arrMailTemplate = $objTemplate->getTemplateInfo($varWhereTemplate);
                 $varOutput = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateDescription']));
                 $varSubject = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateSubject']));
                 $varSubject = str_replace('{PROJECT_NAME}', SITE_NAME, html_entity_decode(stripcslashes($arrMailTemplate['0']['EmailTemplateSubject'])));
                 $varKeyword = array('{IMAGE_PATH}', '{MEMBER}', '{PROJECT_NAME}', '{USER_DATA}', '{FORGOT_PWD_LINK}', '{SITE_NAME}');
                 $varKeywordValues = array($varPathImage, 'Client', SITE_NAME, $varMemberData, $varForgotPasswordLink, SITE_NAME);
                 $varOutPutValues = str_replace($varKeyword, $varKeywordValues, $varOutput);
                 $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varOutPutValues);
                 $_SESSION['sessForgotValues'] = '';
                 $objCore->setSuccessMsg(ADMIN_FORGOT_PASSWORD_CONFIRM_MSG);
                 return true;
             } else {
                 $_SESSION['sessForgotValues'] = $argArrPOST;
                 $objCore->setErrorMsg(EMAIL_NOT_EXIST_MSG);
                 return true;
             }
         } else {
             $_SESSION['sessForgotValues'] = $argArrPOST;
             $objCore->setErrorMsg(INVALID_SECURITY_CODE_MSG);
             return false;
         }
     }
 }
开发者ID:saurabhs4,项目名称:niches,代码行数:58,代码来源:class.clients_login.php


示例3: render

 public static function render($e)
 {
     if (is_null($e->getTemplatePath())) {
         header('HTTP/1.0 500 Server Error');
         echo '<h1>Symphony Fatal Error</h1><p>' . $e->getMessage() . '</p>';
         exit;
     }
     $xml = new DOMDocument('1.0', 'utf-8');
     $xml->formatOutput = true;
     $root = $xml->createElement('data');
     $xml->appendChild($root);
     $root->appendChild($xml->createElement('heading', General::sanitize($e->getHeading())));
     $root->appendChild($xml->createElement('message', General::sanitize($e->getMessageObject() instanceof SymphonyDOMElement ? (string) $e->getMessageObject() : trim($e->getMessage()))));
     if (!is_null($e->getDescription())) {
         $root->appendChild($xml->createElement('description', General::sanitize($e->getDescription())));
     }
     header('HTTP/1.0 500 Server Error');
     header('Content-Type: text/html; charset=UTF-8');
     header('Symphony-Error-Type: ' . $e->getErrorType());
     foreach ($e->getHeaders() as $header) {
         header($header);
     }
     $output = parent::__transform($xml, basename($e->getTemplatePath()));
     header(sprintf('Content-Length: %d', strlen($output)));
     echo $output;
     exit;
 }
开发者ID:pointybeard,项目名称:symphony-3,代码行数:27,代码来源:class.symphony.php


示例4: createNewSession

 /**
  * Creates a new Session-object, if password is correct
  */
 static function createNewSession($password, $project_id = null)
 {
     if (!$project_id) {
         $project_id = Config::$default_project_id;
     }
     // Delete old Session object from php_session cache
     // and create new session_id to prevent session fixation:
     self::destroySession();
     $session = self::getInstance();
     if ($password) {
         // some password has to be entered
         //Allow login via Master Password
         if (Config::$allow_project_login_with_master_password && General::CheckPostMasterPassword($password)) {
             $password = '';
         }
         try {
             $session->project = new Project($project_id, $password);
         } catch (PasswordException $e) {
             $session->project = null;
         }
     } else {
         $session->project = null;
     }
     return $session;
 }
开发者ID:BackupTheBerlios,项目名称:reson-svn,代码行数:28,代码来源:Session.php


示例5: install

 public function install()
 {
     Symphony::Configuration()->set('lang', 'en', 'redactor');
     Symphony::Configuration()->set('direction_ltr', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_toolbar', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_source', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_focus', 'no', 'redactor');
     Symphony::Configuration()->set('enable_shortcuts', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_autoresizing', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_cleanup', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_fixed', 'no', 'redactor');
     Symphony::Configuration()->set('enable_fixedbox', 'no', 'redactor');
     Symphony::Configuration()->set('enable_paragraphy', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_convertlinks', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_convertdivs', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_fileupload', 'no', 'redactor');
     Symphony::Configuration()->set('enable_imageupload', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_overlay', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_observeimages', 'yes', 'redactor');
     Symphony::Configuration()->set('enable_airmode', 'no', 'redactor');
     Symphony::Configuration()->set('enable_wym', 'no', 'redactor');
     Symphony::Configuration()->set('enable_mobile', 'yes', 'redactor');
     Symphony::Configuration()->set('buttons', implode($this->buttons, ','), 'redactor');
     Symphony::Configuration()->set('airbuttons', implode($this->airbuttons, ','), 'redactor');
     Symphony::Configuration()->set('allowedtags', implode($this->allowedtags, ','), 'redactor');
     Symphony::Configuration()->set('filepath', WORKSPACE . '/redactor/files', 'redactor');
     Symphony::Configuration()->set('imagepath', WORKSPACE . '/redactor/images', 'redactor');
     Symphony::Configuration()->write();
     return General::realiseDirectory(Symphony::Configuration()->get('filepath', 'redactor')) && General::realiseDirectory(Symphony::Configuration()->get('imagepath', 'redactor'));
 }
开发者ID:remie,项目名称:richtext_redactor,代码行数:30,代码来源:extension.driver.php


示例6: __viewIndex

 public function __viewIndex()
 {
     $this->setPageType('table');
     $this->setTitle('Symphony &ndash; Importers');
     $tableHead = array(array('Name', 'col'), array('Version', 'col'), array('Author', 'col'));
     $tableBody = array();
     if (!is_array($this->_importers) or empty($this->_importers)) {
         $tableBody = array(Widget::TableRow(array(Widget::TableData(__('None Found.'), 'inactive', null, count($tableHead)))));
     } else {
         foreach ($this->_importers as $importer) {
             $importer = (object) $importer;
             $col_name = Widget::TableData(Widget::Anchor($this->_driver->truncateValue($importer->name), $this->_uri . "/importers/edit/{$importer->handle}/"));
             $col_name->appendChild(Widget::Input("items[{$importer->id}]", null, 'checkbox'));
             $col_version = Widget::TableData($this->_driver->truncateValue($importer->version));
             $col_author = Widget::TableData($this->_driver->truncateValue($importer->version));
             if (isset($importer->author['website']) and preg_match('/^[^\\s:\\/?#]+:(?:\\/{2,3})?[^\\s.\\/?#]+(?:\\.[^\\s.\\/?#]+)*(?:\\/[^\\s?#]*\\??[^\\s?#]*(#[^\\s#]*)?)?$/', $importer->author['website'])) {
                 $col_author = Widget::Anchor($importer->author['name'], General::validateURL($importer->author['website']));
             } elseif (isset($importer->author['email']) and preg_match('/^\\w(?:\\.?[\\w%+-]+)*@\\w(?:[\\w-]*\\.)+?[a-z]{2,}$/i', $importer->author['email'])) {
                 $col_author = Widget::Anchor($importer->author['name'], 'mailto:' . $importer->author['email']);
             } else {
                 $col_author = $importer->author['name'];
             }
             $col_author = Widget::TableData($col_author);
             $tableBody[] = Widget::TableRow(array($col_name, $col_version, $col_author));
         }
     }
     $table = Widget::Table(Widget::TableHead($tableHead), null, Widget::TableBody($tableBody));
     $this->Form->appendChild($table);
 }
开发者ID:psychoticmeowArchives,项目名称:importmanager,代码行数:29,代码来源:content.importers.php


示例7: view

 public function view()
 {
     $params = array();
     $filter = $_GET['query'];
     if ($_GET['template']) {
         $this->template = General::sanitize($_GET['template']);
     }
     // Environment parameters
     if ($filter == 'env') {
         $params = array_merge($params, $this->__getEnvParams());
         // Page parameters
     } elseif ($filter == 'page') {
         $params = array_merge($params, $this->__getPageParams());
         // Data source parameters
     } elseif ($filter == 'ds') {
         $params = array_merge($params, $this->__getDSParams());
         // All parameters
     } else {
         $params = array_merge($params, $this->__getEnvParams());
         $params = array_merge($params, $this->__getPageParams());
         $params = array_merge($params, $this->__getDSParams());
     }
     foreach ($params as $param) {
         if (empty($filter) || strripos($param, $filter) !== false) {
             $this->_Result[] = $param;
         }
     }
     sort($this->_Result);
 }
开发者ID:rc1,项目名称:WebAppsWithCmsStartHere,代码行数:29,代码来源:content.ajaxparameters.php


示例8: write_file

 function write_file($filename, $text, $db_escape = false)
 {
     $text = General::input_clean($text);
     $filename = RheinaufFile::get_enc($filename);
     if (!is_file($filename) && defined('USE_FTP') && USE_FTP === true) {
         $filename = str_replace(docroot(), '', $filename);
         $root_dir = FTP_ROOTDIR;
         $tmpname = TMPDIR . '/' . uniqid('RheinaufCMS_tmp_' . basename($filename));
         $file = fopen($tmpname, "wb");
         $fwrite = fwrite($file, $text);
         fclose($file);
         $ftp_filename = $root_dir . $filename;
         RheinaufFile::ftpcmd("ftp_put(\$conn_id,'{$ftp_filename}','{$tmpname}',FTP_BINARY);");
         RheinaufFile::chmod($filename, 777);
         RheinaufFile::delete($tmpname);
     } else {
         if (is_file($filename) && !is_writable($filename)) {
             RheinaufFile::chmod($filename, '0777');
         }
         $file = fopen($filename, "wb");
         $fwrite = fwrite($file, $text);
         fclose($file);
         if (is_file($filename)) {
             RheinaufFile::chmod($filename, 777);
         }
         return $fwrite;
     }
 }
开发者ID:BackupTheBerlios,项目名称:rheinaufcms-svn,代码行数:28,代码来源:RheinaufFile.php


示例9: listAll

 function listAll()
 {
     $result = array();
     $people = array();
     $structure = General::listStructure(TEXTFORMATTERS, '/formatter.[\\w-]+.php/', false, 'ASC', TEXTFORMATTERS);
     if (is_array($structure['filelist']) && !empty($structure['filelist'])) {
         foreach ($structure['filelist'] as $f) {
             $f = str_replace(array('formatter.', '.php'), '', $f);
             $result[$f] = $this->about($f);
         }
     }
     $extensionManager = new ExtensionManager($this->_Parent);
     $extensions = $extensionManager->listInstalledHandles();
     if (is_array($extensions) && !empty($extensions)) {
         foreach ($extensions as $e) {
             if (!is_dir(EXTENSIONS . "/{$e}/text-formatters")) {
                 continue;
             }
             $tmp = General::listStructure(EXTENSIONS . "/{$e}/text-formatters", '/formatter.[\\w-]+.php/', false, 'ASC', EXTENSIONS . "/{$e}/text-formatters");
             if (is_array($tmp['filelist']) && !empty($tmp['filelist'])) {
                 foreach ($tmp['filelist'] as $f) {
                     $f = preg_replace(array('/^formatter./i', '/.php$/i'), '', $f);
                     $result[$f] = $this->about($f);
                 }
             }
         }
     }
     ksort($result);
     return $result;
 }
开发者ID:bauhouse,项目名称:sym-form-builder,代码行数:30,代码来源:class.textformattermanager.php


示例10: __buildPageXML

 public function __buildPageXML($page, $page_types, $qf)
 {
     $lang_code = FLang::getLangCode();
     $oPage = new XMLElement('page');
     $oPage->setAttribute('handle', $page['handle']);
     $oPage->setAttribute('id', $page['id']);
     // keep current first
     $oPage->appendChild(new XMLElement('item', General::sanitize($page['plh_t-' . $lang_code]), array('lang' => $lang_code, 'handle' => $page['plh_h-' . $lang_code])));
     // add others
     foreach (FLang::getLangs() as $lc) {
         if ($lang_code != $lc) {
             $oPage->appendChild(new XMLElement('item', General::sanitize($page['plh_t-' . $lc]), array('lang' => $lc, 'handle' => $page['plh_h-' . $lc])));
         }
     }
     if (in_array($page['id'], array_keys($page_types))) {
         $xTypes = new XMLElement('types');
         foreach ($page_types[$page['id']] as $type) {
             $xTypes->appendChild(new XMLElement('type', $type));
         }
         $oPage->appendChild($xTypes);
     }
     if ($page['children'] != '0') {
         if ($children = PageManager::fetch(false, array($qf . 'id, handle, title'), array(sprintf('`parent` = %d', $page['id'])))) {
             foreach ($children as $c) {
                 $oPage->appendChild($this->__buildPageXML($c, $page_types, $qf));
             }
         }
     }
     return $oPage;
 }
开发者ID:siimsoni,项目名称:page_lhandles,代码行数:30,代码来源:class.datasource.MultilingualNavigation.php


示例11: appendFormattedElement

 public function appendFormattedElement(&$wrapper, $data, $encode = false, $mode = NULL, $entry_id = NULL)
 {
     if (is_null($data) || !is_array($data) || is_null($data['value'])) {
         return;
     }
     $wrapper->appendChild(new XMLElement($this->get('element_name'), $encode ? General::sanitize($data['value']) : $data['value'], array('handle' => $data['handle'])));
 }
开发者ID:symphonists,项目名称:html_panel,代码行数:7,代码来源:field.html_panel.php


示例12: store

 public function store()
 {
     if (Input::has('btnThem')) {
         $nhomquyen = Input::get('quyen');
         $mst = str_replace(" ", "", Input::get('txtMaSoThe'));
         $pass = Hash::make(General::randomPassword());
         $hoten = str_replace("  ", " ", trim(Input::get('txtHoTen')));
         $gioitinh = Input::get('gioiTinh');
         $ngaysinh = Input::get('txtNgaySinh');
         $email = str_replace(" ", "", Input::get('txtEmail'));
         $ngaycapthe = Input::get('txtNgayCapThe');
         $ngayhethan = null;
         if (Input::get('txtNgayHetHan') != "") {
             $ngayhethan = Input::get('txtNgayHetHan');
         }
         $tthoatdong = 0;
         if (Input::get('checkHoatDong') == "hoatdong") {
             $tthoatdong = 1;
         } else {
             $tthoatdong = 0;
         }
         $result = DB::table('nguoi_dung')->insert(array('id_nhom_quyen_han' => $nhomquyen, 'ma_so_the' => $mst, 'password' => $pass, 'ho_ten' => $hoten, 'gioi_tinh' => $gioitinh, 'ngay_sinh' => $ngaysinh, 'email' => $email, 'ngay_cap_the' => $ngaycapthe, 'ngay_het_han' => $ngayhethan, 'trang_thai_hoat_dong' => $tthoatdong));
         General::storeevents(QUAN_LY_THEM_NGUOI_DUNG . " có mã số thẻ " . $mst);
         return Redirect::back()->with('message', 'Thêm người dùng thành công!');
     }
 }
开发者ID:ngogiangthanh,项目名称:code-nien-luan-ktpm-k36,代码行数:26,代码来源:QuanLyQuanLyNguoiDung.php


示例13: transform

 public function transform($data)
 {
     if (!General::validateXML($data, $errors, false, new XsltProcess())) {
         throw new TransformException('Data returned is invalid.', $errors);
     }
     return $data;
 }
开发者ID:hotdoy,项目名称:EDclock,代码行数:7,代码来源:class.xml.php


示例14: loadDrivers

 /**
  *
  * Utility function that loads all the drivers
  * in the drivers directory
  * @throws ServiceDriverException
  */
 private static final function loadDrivers()
 {
     // if the pointer is null, then we sould load the drivers
     if (self::$drivers == null) {
         // create a new array
         self::$drivers = array();
         // get all files in the drivers folders
         $drivers = General::listStructure(OEMBED_DRIVERS_DIR, '/class.service[a-zA-Z0-9]+.php/', false, 'asc');
         // for each file found
         foreach ($drivers['filelist'] as $class) {
             $class = basename($class);
             try {
                 // include the class code
                 require_once OEMBED_DRIVERS_DIR . $class;
                 // get class name
                 $class = str_replace(array('class.', '.php'), '', $class);
                 // create new instance
                 $class = new $class($url);
                 // add the class to the stack
                 self::$drivers[$class->getName()] = $class;
             } catch (Exception $ex) {
                 throw new ServiceDriverException($url, $ex);
             }
         }
     }
 }
开发者ID:justinjaywang,项目名称:oembed_field,代码行数:32,代码来源:class.serviceDispatcher.php


示例15: processForm

 function processForm()
 {
     if (!$_POST['name']) {
         return Messages::getString('CreateProjectPage.ProjectNameNotEmpty');
     }
     if (!$_POST['pwd']) {
         return Messages::getString('CreateProjectPage.PasswordNotEmpty');
     }
     if ($_POST['pwd'] != $_POST['pwd2']) {
         return Messages::getString('CreateProjectPage.PasswordsNotEqual');
     }
     if (!General::CheckPostMasterPassword()) {
         return Messages::getString('CreateProjectPage.MasterPasswordWrong');
     }
     try {
         $db = Database::getInstance();
         $project_info = array('name' => stripslashes($_POST['name']), 'pwd' => stripslashes($_POST['pwd']), 'info' => Config::$default_project_info['info'], 'access' => Config::$default_project_info['access'], 'introduction' => Config::$default_project_info['introduction'], 'hint' => Config::$default_project_info['hint']);
         if (!($this->new_project_id = $db->insertProject($project_info))) {
             return sprintf("%s: %s", Messages::getString('General.dbError'), $db->lastError());
         }
     } catch (Exception $exception) {
         // in this case, render exception as error.
         return $exception;
     }
     return '';
 }
开发者ID:BackupTheBerlios,项目名称:reson-svn,代码行数:26,代码来源:CreateProjectPage.php


示例16: grab

 public function grab(&$param_pool)
 {
     self::__init();
     $result = new XMLElement($this->dsParamROOTELEMENT);
     $rows = Symphony::Database()->fetch("SELECT *\n\t\t\t\tFROM `tbl_sessions` \n\t\t\t\tWHERE `session_data` != 'sym-|a:0:{}sym-members|a:0:{}' \n\t\t\t\tAND `session_data` REGEXP 'sym-members'\n\t\t\t\tAND `session_expires` > (UNIX_TIMESTAMP() - " . self::AGE . ") \n\t\t\t\tORDER BY `session_expires` DESC");
     $added = array();
     if (count($rows) > 0) {
         foreach ($rows as $r) {
             $raw = $r['session_data'];
             $data = self::session_real_decode($raw);
             if (!isset($data['sym-members'])) {
                 continue;
             }
             $record = ASDCLoader::instance()->query(sprintf("SELECT\n\t\t\t\t\t\t\t\temail.value AS `email`,\n\t\t\t\t\t\t\t\tMD5(email.value) AS `hash`,\n\t\t\t\t\t\t\t\tcreated_by.username AS `username`\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tFROM `tbl_entries_data_%d` AS `created_by`\n\t\t\t\t\t\t\tLEFT JOIN `tbl_entries_data_%d` AS `email` ON created_by.member_id = email.entry_id\n\t\t\t\t\t\t\tWHERE `created_by`.username = '%s'\n\t\t\t\t\t\t\tLIMIT 1", self::findFieldID('created-by', 'comments'), self::findFieldID('email-address', 'members'), ASDCLoader::instance()->escape($data['sym-members']['username'])));
             if ($record->length() == 0) {
                 continue;
             }
             $member = $record->current();
             // This is so we dont end up with accidental duplicates. No way to select
             // distinct via the SQL since we grab raw session data
             if (in_array($member->username, $added)) {
                 continue;
             }
             $added[] = $member->username;
             $result->appendChild(new XMLElement('member', General::sanitize($member->username), array('email-hash' => $member->hash)));
         }
     } else {
         $result->setValue('No Records Found.');
         //This should never happen!
     }
     return $result;
 }
开发者ID:bauhouse,项目名称:sym-forum-ensemble,代码行数:32,代码来源:data.whosonline.php


示例17: append_preferences

 public function append_preferences($context)
 {
     # Add new fieldset
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'PayPal Payments'));
     # Add Merchant Email field
     $label = Widget::Label('Merchant Email/Account ID');
     $label->appendChild(Widget::Input('settings[paypal-payments][business]', General::Sanitize($this->_get_paypal_business())));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'The merchant email address or account ID of the payment recipient.', array('class' => 'help')));
     # Country <select>
     $countries = array('Australia', 'United Kingdom', 'United States');
     $selected_country = $this->_get_country();
     foreach ($countries as $country) {
         $selected = $country == $selected_country ? TRUE : FALSE;
         $options[] = array($country, $selected);
     }
     $label = Widget::Label();
     $select = Widget::Select('settings[paypal-payments][country]', $options);
     $label->setValue('PayPal Country' . $select->generate());
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Country you want to target.', array('class' => 'help')));
     # Sandbox
     $label = Widget::Label();
     $input = Widget::Input('settings[paypal-payments][sandbox]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('sandbox', 'paypal-payments') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Enable testing mode');
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Directs payments to PayPal’s Sandbox: <code>http://www.sandbox.paypal.com/</code>', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:34,代码来源:extension.driver.php


示例18: displayPublishPanel

 function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
 {
     $note = isset($data['value']) ? $data['value'] : $this->get('note');
     $editable = $this->get('editable');
     # Add <div>
     $div = new XMLElement("div", $note, array("id" => Lang::createHandle($this->get('label')), "class" => "publishnotes-note"));
     $wrapper->appendChild($div);
     # Editable
     if (isset($editable) && $editable) {
         $wrapper->setAttribute('class', $wrapper->getAttribute('class') . " editable");
         $edit = new XMLElement("a", __("Edit note"), array("class" => "publishnotes-edit", "href" => "#edit"));
         $wrapper->appendChild($edit);
         # Add <textarea>
         $label = Widget::Label("Edit: " . $this->get('label'), NULL, Lang::createHandle($this->get('label')));
         $textarea = Widget::Textarea('fields' . $fieldnamePrefix . '[' . $this->get('element_name') . ']' . $fieldnamePostfix, 8, 50, strlen($note) != 0 ? General::sanitize($note) : NULL);
         $label->appendChild($textarea);
         $control = new XMLElement("div", '<input type="submit" value="Change note"/> or <a href="#">cancel</a>', array("class" => "control"));
         $label->appendChild($control);
         if ($flagWithError != NULL) {
             $wrapper->appendChild(Widget::Error($label, $flagWithError));
         } else {
             $wrapper->appendChild($label);
         }
     }
 }
开发者ID:hotdoy,项目名称:EDclock,代码行数:25,代码来源:field.publishnotes.php


示例19: view

 /**
  *
  * Overrides the view method
  */
 public function view()
 {
     // if this is the unban request
     if (isset($this->_context) && is_array($this->_context) && count($this->_context) > 0) {
         // check if we have a hash present
         $hash = $this->_context[0];
         if (strlen($hash) == 36) {
             // Sanatize user inputed values... ALWAYS
             $hash = General::sanitize($hash);
             $this->__unban($hash);
         }
         // redirect not matter what
         // evil users won't be able to detect anything from the response
         // they *should* still be blocked since guessing a hash is
         // practically infeasible
         redirect(SYMPHONY_URL);
         die;
     } else {
         // not banned ? do not show this page!
         if (!ABF::instance()->isCurrentlyBanned()) {
             redirect(SYMPHONY_URL);
             die;
         }
         $this->setTitle(sprintf('%1$s &ndash; %2$s', __('Unban via email'), __('Symphony')));
         $this->Form = Widget::Form('', 'post');
         $this->Form->setAttribute('class', 'frame');
         $this->Form->appendChild(new XMLElement('h1', __('Symphony')));
         $this->__buildFormContent();
         $this->Body->appendChild($this->Form);
     }
 }
开发者ID:korelogic,项目名称:anti_brute_force,代码行数:35,代码来源:content.login.php


示例20: __construct

 protected function __construct()
 {
     $this->Profiler = new Profiler();
     if (get_magic_quotes_gpc()) {
         General::cleanArray($_SERVER);
         General::cleanArray($_COOKIE);
         General::cleanArray($_GET);
         General::cleanArray($_POST);
     }
     include CONFIG;
     self::$Configuration = new Configuration(true);
     self::$Configuration->setArray($settings);
     DateTimeObj::setDefaultTimezone(self::$Configuration->get('timezone', 'region'));
     self::$_lang = self::$Configuration->get('lang', 'symphony') ? self::$Configuration->get('lang', 'symphony') : 'en';
     // Legacy support for __LANG__ constant
     define_safe('__LANG__', self::lang());
     define_safe('__SYM_DATE_FORMAT__', self::$Configuration->get('date_format', 'region'));
     define_safe('__SYM_TIME_FORMAT__', self::$Configuration->get('time_format', 'region'));
     define_safe('__SYM_DATETIME_FORMAT__', __SYM_DATE_FORMAT__ . ' ' . __SYM_TIME_FORMAT__);
     $this->initialiseLog();
     GenericExceptionHandler::initialise();
     GenericErrorHandler::initialise(self::$Log);
     $this->initialiseCookie();
     $this->initialiseDatabase();
     if (!$this->initialiseExtensionManager()) {
         throw new SymphonyErrorPage('Error creating Symphony extension manager.');
     }
     Lang::loadAll($this->ExtensionManager);
 }
开发者ID:bauhouse,项目名称:sym-forum,代码行数:29,代码来源:class.symphony.php



注:本文中的General类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP GeneralCache类代码示例发布时间:2022-05-23
下一篇:
PHP GenderCache类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap