當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IPSText::monthNameRu2En方法代碼示例

本文整理匯總了PHP中IPSText::monthNameRu2En方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::monthNameRu2En方法的具體用法?PHP IPSText::monthNameRu2En怎麽用?PHP IPSText::monthNameRu2En使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在IPSText的用法示例。


在下文中一共展示了IPSText::monthNameRu2En方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doExecute


//.........這裏部分代碼省略.........
     $dates = array('lastpost', 'lastvisit', 'joined');
     $mapit = array('posts' => 'm.posts', 'joined' => 'm.joined', 'lastpost' => 'm.last_post', 'lastvisit' => 'm.last_visit', 'signature' => 'pp.signature', 'name' => 'm.members_display_name', 'photoonly' => 'pp.pp_main_photo');
     //-----------------------------------------
     // Do search
     //-----------------------------------------
     foreach ($mapit as $in => $tbl) {
         /**
          * Leave isset && != '', can't use empty or 0 values are skipped as well
          * @link	http://community.invisionpower.com/tracker/issue-37350-sorting-members-by-post-count/
          */
         $this->request[$in] = isset($this->request[$in]) && $this->request[$in] != '' ? $this->request[$in] : '';
         $inbit = $this->request[$in] = IPSText::parseCleanValue(trim(urldecode(IPSText::stripslashes($this->request[$in]))));
         $url[$in] = $in . '=' . urlencode($this->request[$in]);
         //-----------------------------------------
         // Name...
         //-----------------------------------------
         if ($in == 'name' and $inbit != "") {
             if ($this->request['name_box'] == 'begins') {
                 $query[] = "m.members_l_display_name LIKE '" . mb_strtolower($inbit) . "%'";
             } else {
                 $query[] = "m.members_l_display_name LIKE '%" . mb_strtolower($inbit) . "%'";
             }
         } else {
             if ($in == 'posts' and is_numeric($inbit) and intval($inbit) > -1) {
                 $ltmt = $this->request[$in . '_ltmt'] == 'lt' ? '<' : '>';
                 $query[] = $tbl . ' ' . $ltmt . ' ' . intval($inbit);
                 $url[$in] = $in . '_ltmt=' . $this->request[$in . '_ltmt'] . '&posts=' . intval($inbit);
             } else {
                 if (in_array($in, $dates) and $inbit) {
                     if (preg_match('/\\d{2}-\\d{2}-\\d{4}/', $this->request[$in])) {
                         $_tmp = explode('-', $this->request[$in]);
                         $time_int = mktime(23, 59, 59, $_tmp[0], $_tmp[1], $_tmp[2]);
                     } else {
                         $time_int = strtotime(IPSText::monthNameRu2En($this->request[$inbit]));
                     }
                     if ($time_int) {
                         $ltmt = $this->request[$in . '_ltmt'] == 'lt' ? '<' : '>';
                         $query[] = $tbl . ' ' . $ltmt . ' ' . $time_int;
                         $url[$in . '_ltmt'] = $in . '_ltmt=' . $this->request[$in . '_ltmt'];
                     }
                 } else {
                     if ($in == 'photoonly') {
                         if ($this->request['photoonly'] == 1) {
                             $_queryPP = true;
                             $query[] = $tbl . "<> ''";
                             $url[] = 'photoonly=1';
                         }
                     } else {
                         if ($inbit != "" and $in != 'posts') {
                             $_queryPP = true;
                             $query[] = $tbl . " LIKE '%{$inbit}%'";
                         }
                     }
                 }
             }
         }
     }
     //-----------------------------------------
     // Custom fields?
     //-----------------------------------------
     if (count($this->custom_fields->out_fields)) {
         foreach ($this->custom_fields->out_fields as $id => $data) {
             if (!empty($this->request['field_' . $id])) {
                 $_queryPP = true;
                 if (is_array($this->request['field_' . $id])) {
                     foreach ($this->request['field_' . $id] as $k => $v) {
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:67,代碼來源:view.php

示例2: searchResults

 /**
  * Processes a search request
  *
  * @return	@e void
  */
 public function searchResults()
 {
     /* Search Term */
     if (isset($this->request['search_term']) && !is_string($this->request['search_term'])) {
         $this->registry->getClass('output')->showError('invalid_search_term', 10312564);
     }
     $_st = $this->searchController->formatSearchTerm(trim($this->request['search_term']));
     $search_term = $_st['search_term'];
     $removedTerms = $_st['removed'];
     /* Set up some defaults */
     $this->settings['max_search_word'] = $this->settings['max_search_word'] ? $this->settings['max_search_word'] : 300;
     /* Did we come in off a post request? */
     if ($this->request['request_method'] == 'post') {
         /* Set a no-expires header */
         $this->registry->getClass('output')->setCacheExpirationSeconds(30 * 60);
     }
     if (is_array($this->request['search_app_filters'])) {
         array_walk_recursive($this->request['search_app_filters'], create_function('&$item, $key', '$item = IPSText::htmlspecialchars($item);'));
     }
     /* App specific */
     if (isset($this->request['search_sort_by_' . $this->request['search_app']])) {
         $this->request['search_sort_by'] = $_POST['search_sort_by_' . $this->request['search_app']] ? htmlspecialchars($_POST['search_sort_by_' . $this->request['search_app']]) : $this->request['search_sort_by_' . $this->request['search_app']];
         $this->request['search_sort_order'] = $_POST['search_sort_order_' . $this->request['search_app']] ? htmlspecialchars($_POST['search_sort_order_' . $this->request['search_app']]) : $this->request['search_sort_order_' . $this->request['search_app']];
     }
     /* Populate the registry */
     IPSSearchRegistry::set('in.search_app', $this->request['search_app']);
     IPSSearchRegistry::set('in.raw_search_term', trim($this->request['search_term']));
     IPSSearchRegistry::set('in.clean_search_term', $search_term);
     IPSSearchRegistry::set('in.raw_search_tags', str_replace('&amp;', '&', trim(IPSText::parseCleanValue(IPSText::urldecode_furlSafe($_REQUEST['search_tags'])))));
     IPSSearchRegistry::set('in.search_higlight', str_replace('.', '', $this->request['search_term']));
     IPSSearchRegistry::set('in.search_date_end', $this->request['search_date_start'] && $this->request['search_date_end'] ? $this->request['search_date_end'] : 'now');
     IPSSearchRegistry::set('in.search_date_start', $this->request['search_date_start'] ? $this->request['search_date_start'] : '');
     IPSSearchRegistry::set('in.search_author', !empty($this->request['search_author']) ? $this->request['search_author'] : '');
     /* Set sort filters */
     $this->_setSortFilters();
     /* These can be overridden in the actual engine scripts */
     //	IPSSearchRegistry::set('set.hardLimit'        , 0 );
     IPSSearchRegistry::set('set.resultsCutToLimit', false);
     IPSSearchRegistry::set('set.resultsAsForum', false);
     /* Are we option to show titles only / search in titles only */
     IPSSearchRegistry::set('opt.searchType', (!empty($this->request['search_content']) and in_array($this->request['search_content'], array('both', 'titles', 'content'))) ? $this->request['search_content'] : 'both');
     /* Time check */
     if (IPSSearchRegistry::get('in.search_date_start') and strtotime(IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_start'))) > time()) {
         IPSSearchRegistry::set('in.search_date_start', 'now');
     }
     if (IPSSearchRegistry::get('in.search_date_end') and strtotime(IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_end'))) > time()) {
         IPSSearchRegistry::set('in.search_date_end', 'now');
     }
     /* Do some date checking */
     if (IPSSearchRegistry::get('in.search_date_end') and IPSSearchRegistry::get('in.search_date_start') and strtotime(IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_start'))) > strtotime(IPSText::monthNameRu2En(IPSSearchRegistry::get('in.search_date_end')))) {
         $this->searchAdvancedForm($this->lang->words['search_invalid_date_range']);
         return;
     }
     /**
      * Lower limit
      */
     if ($this->settings['min_search_word'] && !IPSSearchRegistry::get('in.search_author') && !IPSSearchRegistry::get('in.raw_search_tags')) {
         if ($this->settings['search_method'] == 'sphinx' && substr_count($search_term, '"') >= 2) {
             $_ok = true;
         } else {
             $_words = explode(' ', preg_replace("#\"(.*?)\"#", '', $search_term));
             $_ok = $search_term ? true : false;
             foreach ($_words as $_word) {
                 $_word = preg_replace('#^\\+(.+?)$#', "\\1", $_word);
                 if (!$_word or $_word == '|') {
                     continue;
                 }
                 if (strlen($_word) < $this->settings['min_search_word']) {
                     $_ok = false;
                     break;
                 }
             }
         }
         if (!$_ok) {
             $this->searchAdvancedForm(sprintf($this->lang->words['search_term_short'], $this->settings['min_search_word']), $removedTerms);
             return;
         }
     }
     /**
      * Ok this is an upper limit.
      * If you needed to change this, you could do so via conf_global.php by adding:
      * $INFO['max_search_word'] = #####;
      */
     if ($this->settings['max_search_word'] && strlen(IPSSearchRegistry::get('in.raw_search_term')) > $this->settings['max_search_word']) {
         $this->searchAdvancedForm(sprintf($this->lang->words['search_term_long'], $this->settings['max_search_word']));
         return;
     }
     /* Search Flood Check */
     if ($this->memberData['g_search_flood']) {
         /* Check for a cookie */
         $last_search = IPSCookie::get('sfc');
         $last_term = str_replace("&quot;", '"', IPSCookie::get('sfct'));
         $last_term = str_replace("&amp;", '&', $last_term);
         /* If we have a last search time, check it */
         if ($last_search && $last_term) {
//.........這裏部分代碼省略.........
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:101,代碼來源:search.php

示例3: globalSetUp

 /**
  * Global checks and set up
  * Functions pertaining to ALL posting methods
  *
  * @return	@e void
  * Exception Codes:
  * NO_USER_SET			No user has been set
  * NO_POSTING_PPD		No posting perms 'cos of PPD
  */
 public function globalSetUp()
 {
     //-----------------------------------------
     // Checks...
     //-----------------------------------------
     if (!$this->getForumID()) {
         throw new Exception('NO_FORUM_ID');
     }
     if (!is_array($this->getAuthor())) {
         throw new Exception('NO_AUTHOR_SET');
     }
     //-----------------------------------------
     // Forum checks
     //-----------------------------------------
     # No forum id?
     if (!$this->getForumData('id')) {
         throw new Exception('NO_FORUM_ID');
     }
     # Non postable sub forum
     if (!$this->getForumData('sub_can_post')) {
         throw new Exception('NO_SUCH_FORUM');
     }
     /* Make sure we have someone set */
     if (!$this->getAuthor('member_group_id') or !$this->getAuthor('members_display_name')) {
         throw new Exception("NO_USER_SET");
     }
     /* Auto check published */
     $pub = $this->getPublished();
     if (is_string($pub)) {
         $this->setPublished($this->_checkPostModeration($pub));
     }
     //-----------------------------------------
     // Do we have the member group info for this member?
     //-----------------------------------------
     if (!$this->getAuthor('g_id')) {
         $group_cache = $this->registry->cache()->getCache('group_cache');
         $this->setAuthor(array_merge($this->getAuthor(), $group_cache[$this->getAuthor('member_group_id')]));
     }
     //-----------------------------------------
     // Allowed to upload?
     //-----------------------------------------
     $perm_id = $this->getAuthor('org_perm_id') ? $this->getAuthor('org_perm_id') : $this->getAuthor('g_perm_id');
     $perm_array = explode(",", $perm_id);
     if ($this->registry->permissions->check('upload', $this->getForumData(), $perm_array) === TRUE) {
         if ($this->getAuthor('g_attach_max') != -1) {
             $this->can_upload = 1;
         }
     }
     //-----------------------------------------
     // Allowed poll?
     //-----------------------------------------
     $_moderator = $this->getAuthor('forumsModeratorData');
     $this->can_add_poll = intval($this->getAuthor('g_post_polls'));
     $this->max_poll_choices_per_question = intval($this->settings['max_poll_choices']);
     $this->max_poll_questions = intval($this->settings['max_poll_questions']);
     $this->can_edit_poll = $this->getAuthor('g_is_supmod') ? $this->getAuthor('g_is_supmod') : (isset($_moderator[$this->getForumData('id')]['edit_post']) ? intval($_moderator[$this->getForumData('id')]['edit_post']) : 0);
     if (!$this->max_poll_questions) {
         $this->can_add_poll = 0;
     }
     if (!$this->getForumData('allow_poll')) {
         $this->can_add_poll = 0;
     }
     $this->settings['max_post_length'] = $this->settings['max_post_length'] ? $this->settings['max_post_length'] : 2140000;
     //-----------------------------------------
     // Are we a moderator?
     //-----------------------------------------
     if ($this->getAuthor('member_id') != 0 and $this->getAuthor('g_is_supmod') == 0) {
         /* Load Moderator Options */
         $this->moderator = $_moderator[$this->getForumID()];
     }
     //-----------------------------------------
     // Set open and close time
     //-----------------------------------------
     $this->can_set_open_time = $this->getAuthor('g_is_supmod') ? $this->getAuthor('g_is_supmod') : (isset($_moderator[$this->getForumData('id')]['mod_can_set_open_time']) ? intval($_moderator[$this->getForumData('id')]['mod_can_set_open_time']) : 0);
     $this->can_set_close_time = $this->getAuthor('g_is_supmod') ? $this->getAuthor('g_is_supmod') : (isset($_moderator[$this->getForumData('id')]['mod_can_set_close_time']) ? intval($_moderator[$this->getForumData('id')]['mod_can_set_close_time']) : 0);
     //-----------------------------------------
     // OPEN...
     //-----------------------------------------
     $_POST['open_time_date'] = isset($_POST['open_time_date']) ? $_POST['open_time_date'] : NULL;
     $_POST['open_time_time'] = isset($_POST['open_time_time']) ? $_POST['open_time_time'] : NULL;
     $_POST['close_time_date'] = isset($_POST['close_time_date']) ? $_POST['close_time_date'] : NULL;
     $_POST['close_time_time'] = isset($_POST['close_time_time']) ? $_POST['close_time_time'] : NULL;
     if ($this->can_set_open_time and $_POST['open_time_date'] and $_POST['open_time_time']) {
         $date = strtotime(IPSText::monthNameRu2En($_POST['open_time_date']));
         list($hour, $minute) = explode(":", $_POST['open_time_time']);
         if ($date) {
             // Bug #20374
             $this->times['open'] = $date + $minute * 60 + $hour * 3600 - $this->registry->class_localization->getTimeOffset();
         }
     }
     //-----------------------------------------
//.........這裏部分代碼省略.........
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:101,代碼來源:classPost.php


注:本文中的IPSText::monthNameRu2En方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。