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


PHP IPSText::truncate方法代碼示例

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


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

示例1: bbCodeEvent

 function bbCodeEvent($event = array(), $type = '', $ends = '')
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_calendar', $this->_funcHooks['bbCodeEvent'])) {
         $count_9d2c4a6233c711353aa8df4a9626a07a = is_array($this->functionData['bbCodeEvent']) ? count($this->functionData['bbCodeEvent']) : 0;
         $this->functionData['bbCodeEvent'][$count_9d2c4a6233c711353aa8df4a9626a07a]['event'] = $event;
         $this->functionData['bbCodeEvent'][$count_9d2c4a6233c711353aa8df4a9626a07a]['type'] = $type;
         $this->functionData['bbCodeEvent'][$count_9d2c4a6233c711353aa8df4a9626a07a]['ends'] = $ends;
     }
     $IPBHTML .= "<div class='_sharedMediaBbcode'>\n\t<div class='bbcode_mediaWrap clearfix'>\n\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=calendar&amp;module=calendar&amp;section=view&amp;do=showevent&amp;event_id={$event['event_id']}", "public", ''), "{$event['event_title_seo']}", "cal_event") . "\"><img src='{$this->settings['img_url']}/sharedmedia/events.png' alt='{$this->lang->words['event_img_alt']}' class='sharedmedia_screenshot' /></a>\n\t\t<div class='details'>\n\t\t\t<h5><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=calendar&amp;module=calendar&amp;section=view&amp;do=showevent&amp;event_id={$event['event_id']}", "public", ''), "{$event['event_title_seo']}", "cal_event") . "\">" . IPSText::truncate($event['event_title'], 60) . "</a></h5>\n\t\t\t<div><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=calendar&amp;module=calendar&amp;section=view&amp;cal_id={$event['cal_id']}", "public", ''), "{$event['cal_title_seo']}", "cal_calendar") . "\">{$this->lang->words['event_calendar']} {$event['cal_title']}</a></div>\n\t\t\t<div>{$event['_start_date']} \n\t\t\t\t" . (!$ends ? "{$event['_event_time']}" : "") . " \n\t\t\t\t" . ($ends ? "{$ends} " : "") . " \n\t\t\t\t" . (($ends and $event['_event_time']) ? "{$event['_event_time']} " . ($event['_event_etime'] ? "- {$event['_event_etime']}" : "") . "" : "") . "\n\t\t\t\t" . (($event['_event_etime'] and !$ends) ? "- {$event['_event_etime']}" : "") . "\n\t\t\t\t({$type})</div>\n\t\t</div>\n\t</div>\n</div>\n<br />";
     return $IPBHTML;
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:12,代碼來源:skin_calendar.php

示例2: forumIndexTemplate

 function forumIndexTemplate($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum = 1)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_forum', $this->_funcHooks['forumIndexTemplate'])) {
         $count_a249c0aecf82d8bd8ed21846ebf07357 = is_array($this->functionData['forumIndexTemplate']) ? count($this->functionData['forumIndexTemplate']) : 0;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['forum_data'] = $forum_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['announce_data'] = $announce_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['topic_data'] = $topic_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['other_data'] = $other_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['multi_mod_data'] = $multi_mod_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['sub_forum_data'] = $sub_forum_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['footer_filter'] = $footer_filter;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['active_user_data'] = $active_user_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['mod_data'] = $mod_data;
         $this->functionData['forumIndexTemplate'][$count_a249c0aecf82d8bd8ed21846ebf07357]['inforum'] = $inforum;
     }
     $IPBHTML .= "<h2>" . IPSText::truncate($forum_data['name']) . "</h2>\n" . ((is_array($sub_forum_data) and count($sub_forum_data)) ? "\n\t<div class='master_list' id='board_index'>\n\t\t" . $this->__f__e5abccb8d9df641b5917cb4cf33bad9e($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t</div>\n" : "") . "\n<div class='master_list'>\n\t" . ($forum_data['sub_can_post'] ? "<!--<h2>{$forum_data['name']}</h2>-->\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t" . ((is_array($announce_data) and count($announce_data)) ? "\n\t\t\t" . $this->__f__f4abb4bd3e08583c176554ce47ba5aed($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "") . "\n\t\t\n\t\t" . ((is_array($topic_data) and count($topic_data)) ? "\n\t\t\t<h3>{$this->lang->words['forum_topic_list']}</h3>\n\t\t\t" . $this->__f__483cf29b8e814e500f0244d2155831c0($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "\n\t\t\t<div class='row no_messages'>\n\t\t\t\t{$this->lang->words['no_topics']}\n\t\t\t</div>\n\t\t") . "\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>" : "") . "\t\n</div>";
     return $IPBHTML;
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:19,代碼來源:skin_forum.php

示例3: forumIndexTemplate

 function forumIndexTemplate($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum = 1)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_forum', $this->_funcHooks['forumIndexTemplate'])) {
         $count_67ce811bd382cf82cfdfbb680caeba94 = is_array($this->functionData['forumIndexTemplate']) ? count($this->functionData['forumIndexTemplate']) : 0;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['forum_data'] = $forum_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['announce_data'] = $announce_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['topic_data'] = $topic_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['other_data'] = $other_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['multi_mod_data'] = $multi_mod_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['sub_forum_data'] = $sub_forum_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['footer_filter'] = $footer_filter;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['active_user_data'] = $active_user_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['mod_data'] = $mod_data;
         $this->functionData['forumIndexTemplate'][$count_67ce811bd382cf82cfdfbb680caeba94]['inforum'] = $inforum;
     }
     $IPBHTML .= "<h2>" . IPSText::truncate($forum_data['name']) . "</h2>\n" . ((is_array($sub_forum_data) and count($sub_forum_data)) ? "\n\t<div class='master_list' id='board_index'>\n\t\t" . $this->__f__04dc268cba1692f1c8246bcd4bb0185e($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t</div>\n" : "") . "\n<div class='master_list'>\n\t" . ($forum_data['sub_can_post'] ? "<!--<h2>{$forum_data['name']}</h2>-->\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t" . ((is_array($announce_data) and count($announce_data)) ? "\n\t\t\t" . $this->__f__062f9f3b211ecceff0d0d46789b6b494($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "") . "\n\t\t\n\t\t" . ((is_array($topic_data) and count($topic_data)) ? "\n\t\t\t<h3>{$this->lang->words['forum_topic_list']}</h3>\n\t\t\t" . $this->__f__c71a1045be627115405724f888f32a3c($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "\n\t\t\t<div class='row no_messages'>\n\t\t\t\t{$this->lang->words['no_topics']}\n\t\t\t</div>\n\t\t") . "\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>" : "") . "\t\n</div>";
     return $IPBHTML;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:19,代碼來源:skin_forum.php

示例4: forumIndexTemplate

 function forumIndexTemplate($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum = 1)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_forum', $this->_funcHooks['forumIndexTemplate'])) {
         $count_1c0d88849d33c13a953f8d516e9dfae1 = is_array($this->functionData['forumIndexTemplate']) ? count($this->functionData['forumIndexTemplate']) : 0;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['forum_data'] = $forum_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['announce_data'] = $announce_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['topic_data'] = $topic_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['other_data'] = $other_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['multi_mod_data'] = $multi_mod_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['sub_forum_data'] = $sub_forum_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['footer_filter'] = $footer_filter;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['active_user_data'] = $active_user_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['mod_data'] = $mod_data;
         $this->functionData['forumIndexTemplate'][$count_1c0d88849d33c13a953f8d516e9dfae1]['inforum'] = $inforum;
     }
     $IPBHTML .= "<h2>" . IPSText::truncate($forum_data['name']) . "</h2>\n" . ((is_array($sub_forum_data) and count($sub_forum_data)) ? "\n\t<div class='master_list' id='board_index'>\n\t\t" . $this->__f__657fdca28a215b7889a52919d0d2c30e($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t</div>\n" : "") . "\n<div class='master_list'>\n\t" . ($forum_data['sub_can_post'] ? "<!--<h2>{$forum_data['name']}</h2>-->\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t" . ((is_array($announce_data) and count($announce_data)) ? "\n\t\t\t" . $this->__f__6dbe4c72a84744daf9627a13b0c09751($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "") . "\n\t\t\n\t\t" . ((is_array($topic_data) and count($topic_data)) ? "\n\t\t\t<h3>{$this->lang->words['forum_topic_list']}</h3>\n\t\t\t" . $this->__f__fc42cc8e03b8a187527c238f5293feb2($forum_data, $announce_data, $topic_data, $other_data, $multi_mod_data, $sub_forum_data, $footer_filter, $active_user_data, $mod_data, $inforum) . "\t\t" : "\n\t\t\t<div class='row no_messages'>\n\t\t\t\t{$this->lang->words['no_topics']}\n\t\t\t</div>\n\t\t") . "\n\t\t<div class='controls'>\n\t\t\t<div class='buttons'>\n\t\t\t\t" . ($forum_data['_user_can_post'] ? "\n\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("module=post&amp;section=post&amp;do=new_post&amp;f={$forum_data['id']}", "publicWithApp", ''), "", "") . "' title='{$this->lang->words['topic_start']}' accesskey='s' class='button'>{$this->lang->words['topic_start']}</a>\n\t\t\t\t" : "") . "\n\t\t\t\t{$forum_data['SHOW_PAGES']}\n\t\t\t</div>\n\t\t</div>" : "") . "\t\n</div>";
     return $IPBHTML;
 }
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:19,代碼來源:skin_forum.php

示例5: recent_topics_discussions_last_x

 /**
  * Show the recently started topic titles
  *
  * @access	public
  * @return	string		HTML content to replace tag with
  */
 public function recent_topics_discussions_last_x()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $results = array();
     $limit = $this->settings['recent_topics_discuss_number'] ? $this->settings['recent_topics_discuss_number'] : 5;
     $where_clause = array();
     /* Loop through the forums and build a list of forums we're allowed access to */
     $forumIdsOk = array();
     foreach ($this->registry->class_forums->forum_by_id as $id => $data) {
         /* Can we read? */
         if (!$this->registry->permissions->check('read', $data)) {
             continue;
         }
         /* Can read, but is it password protected, etc? */
         if (!$this->registry->class_forums->forumsCheckAccess($id, 0, 'forum', array(), true)) {
             continue;
         }
         if (!$data['can_view_others']) {
             continue;
         }
         if ($data['min_posts_view'] > $this->memberData['posts']) {
             continue;
         }
         $forumIdsOk[] = $id;
     }
     if (count($forumIdsOk)) {
         /* Add allowed forums */
         $where_clause[] = "t.forum_id IN (" . implode(",", $forumIdsOk) . ")";
         $this->DB->build(array('select' => 't.tid, t.title, t.posts, t.start_date as post_date, t.views, t.title_seo', 'from' => array('topics' => 't'), 'where' => "t.approved=1 and t.state != 'closed' and (t.state != 'link') " . (count($where_clause) ? ' AND ' . implode(' AND ', $where_clause) : ''), 'order' => 't.tid DESC', 'limit' => array(0, $limit), 'add_join' => array(array('from' => array('forums' => 'f'), 'where' => "f.id=t.forum_id", 'type' => 'left'), array('select' => 'm.member_id, m.members_display_name, m.members_seo_name', 'from' => array('members' => 'm'), 'where' => "m.member_id=t.starter_id", 'type' => 'left'))));
         $outer = $this->DB->execute();
         while ($row = $this->DB->fetch($outer)) {
             $row['title_display'] = IPSText::truncate($row['title'], 30);
             $row['date'] = $this->registry->class_localization->getDate($row['post_date'], "manual{{$this->settings['csite_article_date']}}");
             $results[] = $row;
         }
     }
     return $this->registry->getClass('output')->getTemplate('portal')->latestPosts($results);
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:46,代碼來源:recent_topics.php

示例6: manageBookmarks

    /**
     * manageBookmarks
     *
     * @param	array	Bookmarks
     * @return	@e string
     */
    public function manageBookmarks($bookmarks)
    {
        $IPBHTML = "";
        //--starthtml--//
        $IPBHTML .= <<<EOF
<h3>{$this->lang->words['bookmarks_title']}</h3>
<div class='ipsPad fixed_inner'>
<div class='right desctext'>{$this->lang->words['bookmarks_make_home']}</div>
<br />
<ul id='sortable'>
EOF;
        foreach ($bookmarks as $id => $data) {
            $url = IPSText::truncate($data['bookmark_url'], 42);
            $sel = $data['bookmark_home'] ? ' checked="checked" ' : '';
            $pos = intval($data['bookmark_pos']);
            $IPBHTML .= <<<EOF
\t<li data-rowid='{$id}' id='bookmark_{$id}'>
\t\t<span class="draghandle"></span>
\t\t<div class='right'>
\t\t\t<input type='checkbox' data-cboxid='{$id}' name='bookmarkHome[{$id}]' value='{$id}' {$sel}>
\t\t\t&nbsp; <img src="{$this->settings['skin_acp_url']}/images/aff_cross.png" data-deleteid="{$id}" class='clickable' />
\t\t</div>
\t\t<input type='text' class='input_text' size='60' data-inputname="{$id}" name='bookmarkName[{$id}]' value='{$data['bookmark_title']}' />
\t\t<span class='desctext'><a href="{$this->settings['_base_url']}&amp;{$data['bookmark_url']}" target="_blank">{$url}</a></span>
\t</li>
EOF;
        }
        $IPBHTML .= <<<EOF
</ul>
<div class='ipsPad'><input type='button' id='saveBookmarksManage' class='realbutton right' value='{$this->lang->words['bookmarks_save']}' /></div>
</div>
<script type="text/javascript">
(function(\$){
\t\$("#sortable").sortable();
}(jQuery));
</script>
EOF;
        //--endhtml--//
        return $IPBHTML;
    }
開發者ID:mover5,項目名稱:imobackup,代碼行數:46,代碼來源:cp_skin_global.php

示例7: addCommentToDB

 /**
  * Adds a new profile comment to the database
  *
  * @access	public
  * @param	integer	$comment_for_id	Member id that this comment is for
  * @param	string	$comment		Text of the comment to create
  * @return	string					Error key on failure, blank on success
  */
 public function addCommentToDB($comment_for_id, $comment)
 {
     /* Load the member that this comment is for */
     $member = IPSMember::load($comment_for_id);
     /* Make sure we found a member */
     if (!$member['member_id']) {
         return 'error';
     }
     /* Are we allowed to comment? */
     if (!$this->memberData['g_reply_other_topics']) {
         return 'nopermission';
     }
     if ($this->memberData['restrict_post']) {
         if ($this->memberData['restrict_post'] == 1) {
             return 'nopermission';
         }
         $post_arr = IPSMember::processBanEntry($this->memberData['restrict_post']);
         if (time() >= $post_arr['date_end']) {
             /* Update this member's profile */
             IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0)));
         } else {
             return 'nopermission';
         }
     }
     /* Does this member have mod_posts enabled? */
     $comment_approved = 1;
     if ($this->memberData['mod_posts']) {
         if ($this->memberData['mod_posts'] == 1) {
             $comment_approved = 0;
         } else {
             $mod_arr = IPSMember::processBanEntry($this->memberData['mod_posts']);
             if (time() >= $mod_arr['date_end']) {
                 /* Update this member's profile */
                 IPSMember::save($this->memberData['member_id'], array('core' => array('mod_posts' => 0)));
             } else {
                 $comment_approved = 0;
             }
         }
     }
     /* Format the comment */
     $comment = IPSText::truncate($comment, 400);
     $comment = preg_replace("#(\r\n|\r|\n|<br />|<br>){1,}#s", "\n", $comment);
     $comment = trim(IPSText::getTextClass('bbcode')->stripBadWords($comment));
     /* Make sure we still have a comment */
     if (!$comment) {
         return 'error-no-comment';
     }
     /* Comment requires approval? */
     if ($member['pp_setting_moderate_comments'] and $member['member_id'] != $this->memberData['member_id']) {
         $comment_approved = 0;
     }
     /* Member is ignoring you! */
     if ($comment_approved) {
         $_you_are_being_ignored = explode(",", $member['ignored_users']);
         if (is_array($_you_are_being_ignored) and count($_you_are_being_ignored)) {
             if (in_array($this->memberData['member_id'], $_you_are_being_ignored)) {
                 $comment_approved = 0;
             }
         }
     }
     /* Add comment to the DB... */
     $this->DB->insert('profile_comments', array('comment_for_member_id' => $comment_for_id, 'comment_by_member_id' => $this->memberData['member_id'], 'comment_date' => time(), 'comment_ip_address' => $this->member->ip_address, 'comment_approved' => $comment_approved, 'comment_content' => nl2br($comment)));
     $new_id = $this->DB->getInsertId();
     /* Send notifications.. */
     if (!$comment_approved and $member['pp_setting_notify_comments'] and $member['member_id'] != $this->memberData['member_id']) {
         IPSText::getTextClass('email')->getTemplate("new_comment_request", $member['language']);
         IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $member['members_display_name'], 'COMMENT_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser=' . $member['member_id']));
         $message = IPSText::getTextClass('email')->message;
         $subject = IPSText::getTextClass('email')->subject;
         $to = $member;
         $from = $this->memberData;
         $return_msg = 'pp_comment_added_mod';
     } else {
         if ($member['pp_setting_notify_comments'] and $member['member_id'] != $this->memberData['member_id']) {
             IPSText::getTextClass('email')->getTemplate("new_comment_added", $member['language']);
             IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $member['members_display_name'], 'COMMENT_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser=' . $member['member_id']));
             $message = IPSText::getTextClass('email')->message;
             $subject = IPSText::getTextClass('email')->subject;
             $to = $member;
             $from = $this->memberData;
             $return_msg = '';
         }
     }
     /* Got anything to send? */
     if ($message and $subject) {
         /* Email ? */
         if ($member['pp_setting_notify_comments'] == 'email' or $member['pp_setting_notify_comments'] and $member['members_disable_pm']) {
             IPSText::getTextClass('email')->subject = $subject;
             IPSText::getTextClass('email')->message = $message;
             IPSText::getTextClass('email')->to = $to['email'];
             IPSText::getTextClass('email')->sendMail();
         } else {
//.........這裏部分代碼省略.........
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:101,代碼來源:comments.php

示例8: __f__d15d4688fdc77171a81348ac17a00ed7

 function __f__d15d4688fdc77171a81348ac17a00ed7($results)
 {
     $_ips___x_retval = '';
     $__iteratorCount = 0;
     foreach ($results as $forum_data) {
         $__iteratorCount++;
         $_ips___x_retval .= "\n\t\t\t<tr class='_recordRow " . ($forum_data['_has_unread'] ? "unread" : "") . "'>\n\t\t\t\t<td class='col_c_icon altrow'>\n\t\t\t\t\t" . ($forum_data['_has_unread'] ? "\n\t\t\t\t\t\t<a id='forum_img_{$forum_data['id']}' href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=forums&amp;section=markasread&amp;marktype=forum&amp;forumid={$forum_data['id']}&amp;returntoforumid={$this->request['f']}&amp;i=1", "public", ''), "", "") . "\" data-tooltip=\"{$this->lang->words['bi_markread']}\" class='forum_marker'><img src='{$this->settings['img_url']}/f_icon.png' /></a>\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tipb.global.registerMarker( \"forum_img_{$forum_data['id']}\", \"{$forum_data['img_new_post']}\", markerURL + \"&forumid={$forum_data['id']}\" );\n\t\t\t\t\t\t</script>\n\t\t\t\t\t" : "\n\t\t\t\t\t\t<img src='{$this->settings['img_url']}/f_icon_read.png' />\n\t\t\t\t\t") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='col_c_forum'>\n\t\t\t\t\t<h4><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showforum={$forum_data['id']}", "public", ''), "{$forum_data['name_seo']}", "showforum") . "\" title='{$forum_data['name']}'>{$forum_data['name']}</a></h4>\n\t\t\t\t\t\n\t\t\t\t\t" . (($forum_data['show_subforums'] and count($forum_data['subforums']) and $forum_data['show_subforums']) ? "\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<ol class='ipsList_inline ipsType_small subforums toggle_notify_off' id='subforums_{$forum_data['id']}'>\n\t\t\t\t\t\t\t" . $this->__f__b22b473bc6d31fed5fc9aec77ee0f2f5($results, $forum_data) . "\t\t\t\t\t\t</ol>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . (count($forum_data['_followData']) ? "\n\t\t\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('search'), 'followData') ? $this->registry->getClass('output')->getTemplate('search')->followData($forum_data['_followData']) : '') . "\n\t\t\t\t\t" : "") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='col_c_stats ipsType_small'>\n\t\t\t\t\t<strong>{$forum_data['topics']}</strong> {$this->lang->words['topics']}<br />\n\t\t\t\t\t<strong>{$forum_data['posts']}</strong> {$this->lang->words['replies']}\n\t\t\t\t</td>\n\t\t\t\t<td class='col_c_post'>\n\t\t\t\t\t" . ($forum_data['hide_last_info'] ? "\n\t\t\t\t\t\t<ul class='last_post'>\n\t\t\t\t\t\t\t<li class='desc'>{$this->lang->words['f_protected']}</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t" : "" . (($forum_data['pp_small_photo'] and !$forum_data['hide_last_info']) ? "\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$forum_data['last_poster_id']}", "public", ''), "{$forum_data['seo_last_name']}", "showuser") . "' class='ipsUserPhotoLink left'>\n\t\t\t\t\t\t\t\t<img src='{$forum_data['pp_small_photo']}' alt='{$this->lang->words['photo']}' class='ipsUserPhoto ipsUserPhoto_mini' />\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t<ul class='last_post ipsType_small'>\n\t\t\t\t\t\t\t" . (!$forum_data['last_id'] ? "\n\t\t\t\t\t\t\t\t<li class='desc lighter'><em>{$this->lang->words['f_none']}</em></li>\n\t\t\t\t\t\t\t" : "<li>\n\t\t\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$forum_data['last_topic_id']}&amp;view=getnewpost", "public", ''), "{$forum_data['seo_last_title']}", "showtopic") . "' title=\"{$this->lang->words['view_new_post']}\">\n\t\t\t\t\t\t\t\t\t\t" . IPSText::truncate($forum_data['last_title'], 28) . "\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t" . ($forum_data['last_poster_id'] ? "\n\t\t\t\t\t\t\t\t\t<li>{$this->lang->words['by_ucfirst']} " . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($forum_data) : '') . "</li>\n\t\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t\t" . ($forum_data['_hide_last_date'] ? "\n\t\t\t\t\t\t\t\t\t<li class='desc lighter'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($forum_data['last_post'], "DATE", 0)) . "</li>\n\t\t\t\t\t\t\t\t" : "\n\t\t\t\t\t\t\t\t\t<li class='desc lighter blend_links'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$forum_data['last_id']}&amp;view=getlastpost", "public", ''), "{$forum_data['seo_last_title']}", "showtopic") . "' title='{$this->lang->words['view_last_post']}'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($forum_data['last_post'], "DATE", 0)) . "</a></li>\n\t\t\t\t\t\t\t\t") . "") . "\n\t\t\t\t\t\t</ul>") . "\n\t\t\t\t</td>\n\t\t\t\t<td class='col_f_mod'>\n\t\t\t\t\t<a href='#' class='ipsButton_secondary no_width ipbmenu' id='change_{$forum_data['id']}'>{$this->lang->words['followed_changeopts']}</a>\n\t\t\t\t\t<input class='input_check checkall toggle_notify_on' type=\"checkbox\" name=\"likes[]\" value=\"{$forum_data['_followData']['like_app']}-{$forum_data['_followData']['like_area']}-{$forum_data['_followData']['like_rel_id']}\" />\n\t\t\t\t\t<div class='ipbmenu_content' id='change_{$forum_data['id']}_menucontent' style='display: none; width: 400px; padding: 5px;'>\n\t\t\t\t\t\t<select name='modaction_row' class='input_select' id='form_change_{$forum_data['id']}'>\n\t\t\t\t\t\t\t<option value=''>{$this->lang->words['like_mod__chose']}</option>\n\t\t\t\t\t\t\t<option value='delete'>{$this->lang->words['like_mod__delete']}</option>\n\t\t\t\t\t\t\t<option value='change-donotify'>{$this->lang->words['like_mod__change_donotify']}</option>\n\t\t\t\t\t\t\t<option value='change-donotnotify'>{$this->lang->words['like_mod__change_nonotify']}</option>\n\t\t\t\t\t\t\t<option value='change-immediate'>{$this->lang->words['like_mod__change_immediate']}</option>\n\t\t\t\t\t\t\t<option value='change-offline'>{$this->lang->words['like_mod__change_offline']}</option>\n\t\t\t\t\t\t\t" . ($this->request['search_app'] == 'forums' ? "\n\t\t\t\t\t\t\t\t<option value='change-daily'>{$this->lang->words['like_mod__change_daily']}</option>\n\t\t\t\t\t\t\t\t<option value='change-weekly'>{$this->lang->words['like_mod__change_weekly']}</option>\n\t\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t\t\t<option value='change-anon'>{$this->lang->words['like_mod__change_anon']}</option>\n\t\t\t\t\t\t\t<option value='change-noanon'>{$this->lang->words['like_mod__change_noanon']}</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<input type=\"submit\" class=\"input_submit submit_modaction_row\" value=\"{$this->lang->words['update_selected']}\" />\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\n";
     }
     $_ips___x_retval .= '';
     unset($__iteratorCount);
     return $_ips___x_retval;
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:12,代碼來源:skin_search.php

示例9: __f__9798b4ea44a00f669a45f347ab223c07

 function __f__9798b4ea44a00f669a45f347ab223c07($results)
 {
     $_ips___x_retval = '';
     $__iteratorCount = 0;
     foreach ($results as $data) {
         $__iteratorCount++;
         $_ips___x_retval .= "\n\t\t<div class='post_block hentry clear no_sidebar ipsBox_container'>\n\t\t\t<div class='post_wrap'>\n\t\t\t\t" . ($data['author_id'] ? "\n\t\t\t\t\t<h3 class='row2'>\n\t\t\t\t" : "\n\t\t\t\t\t<h3 class='guest row2'>\n\t\t\t\t") . "\n\t\t\t\t\t<span class='post_id right ipsType_small desc blend_links'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$data['topic_id']}&amp;view=findpost&amp;p={$data['pid']}", "public", ''), "{$data['title_seo']}", "showtopic") . "' rel='bookmark' title='{$data['topic_title']}{$this->lang->words['link_to_post']} #{$data['pid']}'>#{$data['pid']}</a></span>\n\t\t\t\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$data['tid']}", "public", ''), "{$data['title_seo']}", "showtopic") . "\">" . IPSText::truncate($data['topic_title'], 80) . "</a>\n\t\t\t\t</h3>\n\t\t\t\t<div class='post_body'>\n\t\t\t\t\t<p class='posted_info desc lighter ipsType_small'>\n\t\t\t\t\t\t<img src='{$data['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_tiny' /> {$this->lang->words['posted']} {$this->lang->words['search_by']}\n\t\t\t\t\t\t" . ($data['member_id'] ? "<span class=\"author vcard\">" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($data) : '') . "</span>" : "{$data['members_display_name']}") . "\n\t\t\t\t\t\t{$this->lang->words['on']} <abbr class=\"published\" title=\"" . date('c', $data['post_date']) . "\">" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($data['post_date'], "long", 0)) . "</abbr>\n\t\t\t\t\t\t" . ($data['_forum_trail'] ? "\n\t\t\t\t\t\t\tin\n\t\t\t\t\t\t\t" . $this->__f__14837d740329e582a4ef8455d2aa03a6($results, $data) . "\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t</p>\n\t\t\t\t\t<div class='post entry-content clearfix'>\n\t\t\t\t\t\t{$data['post']}\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global_other'), 'repButtons') ? $this->registry->getClass('output')->getTemplate('global_other')->repButtons($data, array_merge(array('primaryId' => $data['pid'], 'domLikeStripId' => 'like_post_' . $data['pid'], 'domCountId' => 'rep_post_' . $data['pid'], 'app' => 'forums', 'type' => 'pid', 'likeFormatted' => $data['repButtons']['formatted'], 'has_given_rep' => $data['repButtons']['iLike']), $data)) : '') . "\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<br />\n\t\t</div>\n\t\t<br />\n\t\n";
     }
     $_ips___x_retval .= '';
     unset($__iteratorCount);
     return $_ips___x_retval;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:12,代碼來源:skin_profile.php

示例10: _iframeList

 /**
  * Loads the content for the friends tab
  *
  * @access	private
  * @return	void		[Prints to screen]
  * @since	IPB 2.2.0.2006-08-15
  */
 private function _iframeList()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $member_id = intval($this->request['member_id']);
     $content = '';
     $friends = array();
     //-----------------------------------------
     // Load member
     //-----------------------------------------
     $member = IPSMember::load($member_id);
     //-----------------------------------------
     // Check
     //-----------------------------------------
     if (!$member['member_id']) {
         $this->returnString($this->lang->words['nofriendid']);
     }
     //-----------------------------------------
     // Grab the friends
     //-----------------------------------------
     $this->DB->build(array('select' => 'f.*', 'from' => array('profile_friends' => 'f'), 'where' => 'f.friends_member_id=' . $member_id . ' AND f.friends_approved=1', 'order' => 'm.members_display_name ASC', 'add_join' => array(1 => array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=f.friends_friend_id', 'type' => 'left'), 2 => array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => 'm.member_id=f.friends_friend_id', 'type' => 'left'))));
     $outer = $this->DB->execute();
     //-----------------------------------------
     // Get and store...
     //-----------------------------------------
     while ($row = $this->DB->fetch($outer)) {
         $row['members_display_name_short'] = IPSText::truncate($row['members_display_name'], 13);
         $friends[] = IPSMember::buildDisplayData($row, 0);
     }
     //-----------------------------------------
     // Ok.. show the friends
     //-----------------------------------------
     $content = $this->registry->getClass('output')->getTemplate('profile')->friendsIframe($member, $friends);
     $this->returnHtml($content);
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:43,代碼來源:friends.php

示例11: _multiMergePost

 /**
  * Post multi-mod: Merge posts
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function _multiMergePost()
 {
     $this->_resetModerator($this->topic['forum_id']);
     $this->_genericPermissionCheck('split_merge');
     if (count($this->pids) < 2) {
         $this->_showError('mod_only_one_pid', 10383);
     }
     //-----------------------------------------
     // Form or print?
     //-----------------------------------------
     if (!$this->request['checked']) {
         //-----------------------------------------
         // Get post data
         //-----------------------------------------
         $master_post = "";
         $dropdown = array();
         $authors = array();
         $seen_author = array();
         $upload_html = "";
         $seoTitle = '';
         //-----------------------------------------
         // Grab teh posts
         //-----------------------------------------
         $this->DB->build(array('select' => 'p.*', 'from' => array('posts' => 'p'), 'where' => "p.pid IN (" . implode(",", $this->pids) . ")", 'add_join' => array(array('select' => 't.forum_id, t.title_seo', 'from' => array('topics' => 't'), 'where' => 't.tid=p.topic_id', 'type' => 'left'))));
         $outer = $this->DB->execute();
         while ($p = $this->DB->fetch($outer)) {
             if (IPSMember::checkPermissions('read', $p['forum_id']) == TRUE) {
                 $master_post .= $p['post'] . "<br /><br />";
                 $dropdown[] = array($p['pid'], ipsRegistry::getClass('class_localization')->getDate($p['post_date'], 'LONG') . " (#{$p['pid']})");
                 if (!in_array($p['author_id'], $seen_author)) {
                     $authors[] = array($p['author_id'], "{$p['author_name']} (#{$p['pid']})");
                     $seen_author[] = $p['author_id'];
                 }
                 $seoTitle = $p['title_seo'];
             }
         }
         //-----------------------------------------
         // Get Attachment Data
         //-----------------------------------------
         $this->DB->build(array('select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module='post' AND attach_rel_id IN (" . implode(",", $this->pids) . ")"));
         $this->DB->execute();
         while ($row = $this->DB->fetch()) {
             $row['image'] = $this->caches['attachtypes'][$row['attach_ext']]['atype_img'];
             $row['size'] = IPSLib::sizeFormat($row['attach_filesize']);
             $row['attach_file'] = IPSText::truncate($row['attach_file'], 50);
             $attachments[] = $row;
         }
         //-----------------------------------------
         // Print form
         //-----------------------------------------
         /* Load editor stuff */
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
         $_editor = new $classToLoad();
         $_editor->setContent(trim($master_post));
         $editor = $_editor->show('Post', array('autoSaveKey' => md5('merge-' . $this->topic['tid']), 'height' => 350));
         $this->output .= $this->registry->getClass('output')->getTemplate('mod')->mergePostForm($editor, $dropdown, $authors, $attachments, $seoTitle);
         if ($this->topic['tid']) {
             $this->registry->getClass('output')->addNavigation($this->topic['title'], "showtopic={$this->topic['tid']}", $this->topic['title_seo'], 'showtopic');
         }
         $this->registry->getClass('output')->addNavigation($this->lang->words['cm_title'], '');
         $this->registry->getClass('output')->setTitle($this->lang->words['cm_title'] . ' - ' . ipsRegistry::$settings['board_name']);
         $this->registry->output->addContent($this->output);
         $this->registry->getClass('output')->sendOutput();
     } else {
         //-----------------------------------------
         // DO THE THING, WITH THE THING!!
         //-----------------------------------------
         $this->request['postdate'] = intval($this->request['postdate']);
         if (empty($this->request['selectedpids']) || empty($this->request['postdate']) || empty($this->request['Post'])) {
             $this->_showError('mod_merge_posts', 10384);
         }
         /* Load editor stuff */
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
         $_editor = new $classToLoad();
         /* remove saved content */
         if ($this->memberData['member_id']) {
             $_editor->removeAutoSavedContent(array('member_id' => $this->memberData['member_id'], 'autoSaveKey' => md5('merge-' . $this->topic['tid'])));
         }
         IPSText::getTextClass('bbcode')->parse_smilies = 1;
         IPSText::getTextClass('bbcode')->parse_html = 0;
         IPSText::getTextClass('bbcode')->parse_bbcode = 1;
         IPSText::getTextClass('bbcode')->parsing_section = 'topics';
         $post = $_editor->process($_POST['Post']);
         $post = IPSText::getTextClass('bbcode')->preDbParse($post);
         //-----------------------------------------
         // Post to keep...
         //-----------------------------------------
         $posts = array();
         $author = array();
         $post_to_delete = array();
         $new_post_key = md5(time());
         $topics = array();
         $forums = array();
         $append_edit = 0;
         //-----------------------------------------
//.........這裏部分代碼省略.........
開發者ID:mover5,項目名稱:imobackup,代碼行數:101,代碼來源:moderate.php

示例12: modCPpost

 function modCPpost($post, $displayData, $topic, $type)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_modcp', $this->_funcHooks['modCPpost'])) {
         $count_2cc4004cd3ee4869731c07f458d6e93d = is_array($this->functionData['modCPpost']) ? count($this->functionData['modCPpost']) : 0;
         $this->functionData['modCPpost'][$count_2cc4004cd3ee4869731c07f458d6e93d]['post'] = $post;
         $this->functionData['modCPpost'][$count_2cc4004cd3ee4869731c07f458d6e93d]['displayData'] = $displayData;
         $this->functionData['modCPpost'][$count_2cc4004cd3ee4869731c07f458d6e93d]['topic'] = $topic;
         $this->functionData['modCPpost'][$count_2cc4004cd3ee4869731c07f458d6e93d]['type'] = $type;
     }
     $IPBHTML .= "<!--post:{$post['post']['pid']}-->\n<script type=\"text/javascript\">\nvar pid = parseInt({$post['post']['pid']});\nif ( pid > ipb.topic.topPid ){\n\tipb.topic.topPid = pid;\n}\n</script>\n<div class='post_block hentry clear no_sidebar " . ($this->settings['reputation_enabled'] ? "with_rep" : "") . "' id='post_id_{$post['post']['pid']}'>\n\t<a id='entry{$post['post']['pid']}'></a>\n\t" . ((!empty($post['post']['_repignored']) and $post['post']['_repignored'] == 1 && $post['post']['_ignored'] != 1) ? "<div class='post_ignore'>\n\t\t\t" . ($post['post']['rep_points'] == 0 ? "\n\t\t\t\t<span class='reputation zero' title='{$this->lang->words['top_rep']}'>\n\t\t\t" : "") . "\n\t\t\t" . ($post['post']['rep_points'] > 0 ? "\n\t\t\t\t<span class='reputation positive' title='{$this->lang->words['top_rep']}'>\n\t\t\t" : "") . "\n\t\t\t" . ($post['post']['rep_points'] < 0 ? "\n\t\t\t\t<span class='reputation negative' title='{$this->lang->words['top_rep']}' >\n\t\t\t" : "") . "\n\t\t\t\t\t{$post['post']['rep_points']}</span> {$this->lang->words['top_this_post_by']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$post['author']['member_id']}", "public", ''), "", "") . "'>{$post['author']['members_display_name']}</a> {$this->lang->words['top_below_thresh']}. <a href='#' title='{$this->lang->words['ignore_view_post']}' id='unhide_post_{$post['post']['pid']}'>{$this->lang->words['rep_view_anyway']}</a>\n\t\t</div>" : "") . "\n\t\n\t<div class='post_wrap'>\n\t\t<h3 class='" . (empty($post['author']['member_id']) ? "guest " : "") . "row2'>\n\t\t\t<img src='{$post['author']['pp_small_photo']}' class='ipsUserPhoto ipsUserPhoto_tiny' />&nbsp;\n\t\t\t" . ($post['author']['member_id'] ? "\n\t\t\t\t<span class=\"author vcard\">" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($post['author']) : '') . "</span>\n\t\t\t" : "\n\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($post['author']) : '') . "\n\t\t\t") . "\n\t\t\t\n\t\t\t" . ($post['post']['_show_ip'] ? "<span class='ip right ipsType_small'>({$this->lang->words['ip']}:\n\t\t\t\t" . ($post['author']['g_access_cp'] ? "\n\t\t\t\t\t<em>{$this->lang->words['ip_private']}</em>\n\t\t\t\t" : "\n\t\t\t\t\t<a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=modcp&amp;tab=iplookup&amp;fromapp=members&amp;_do=submit&amp;ip={$post['post']['ip_address']}", "public", ''), "", "") . "\" title='{$this->lang->words['info_about_this_ip']}'>{$post['post']['ip_address']}</a>\n\t\t\t\t") . ")\n\t\t\t\t</span>" : "") . "\n\t\t</h3>\n\t\t\n\t\t<div class='post_body'>\n\t\t\t" . ($type == 'deleted' ? "<ul class='ipsList_inline modcp_post_controls right'>\n\t\t\t\t\t" . (!$post['post']['_isDeleted'] ? "\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<img data-tooltip=\"{$this->lang->words['hard_delete_warn_post']}\" src='{$this->settings['img_url']}/icon_timewarning.png' />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . ($this->registry->getClass('class_forums')->canSoftDeletePosts($post['post']['forum_id'], $post) ? "\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=moderate&amp;section=moderate&amp;do=p_hrestore&amp;f={$post['post']['forum_id']}&amp;t={$post['post']['topic_id']}&amp;pid[]={$post['post']['pid']}&amp;st={$this->request['st']}&amp;auth_key={$this->member->form_hash}&amp;return=modcp:deleted", "public", ''), "", "") . "' class='ipsButton_secondary ipsType_smaller' title='{$this->lang->words['restore_post_desc']}'>{$this->lang->words['restore_post']}</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . ($this->registry->getClass('class_forums')->canHardDeletePosts($post['post']['forum_id'], $post) ? "\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=moderate&amp;section=moderate&amp;do=p_hdelete&amp;f={$post['post']['forum_id']}&amp;t={$post['post']['topic_id']}&amp;pid[]={$post['post']['pid']}&amp;st={$this->request['st']}&amp;auth_key={$this->member->form_hash}&amp;return=modcp:deleted", "public", ''), "", "") . "' class='ipsButton_secondary ipsType_smaller important' title='{$this->lang->words['perm_delete_post']}'>{$this->lang->words['perm_delete_post']}</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t</ul>\n\t\t\t\t<ul class='ipsList_inline" . (empty($displayData['sdData'][$post['post']['pid']]) ? " modcp_post_controls" : "") . "'>\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['posted']}</strong> <span class='desc lighter'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($post['post']['post_date'], "short", 0)) . "</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['deleted_post_date']}</strong> <span class='desc lighter'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($topic['post']['pdelete_time'], "short", 0)) . "</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['delete_from_topic']}</strong> <a class='desc lighter' href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$topic['post']['tid']}", "public", ''), "{$topic['post']['title_seo']}", "showtopic") . "' title='{$this->lang->words['go_to_topic']}'>" . IPSText::truncate($topic['post']['title'], 25) . "</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t" . (!empty($displayData['sdData'][$post['post']['pid']]) ? "<ul class='ipsList_inline modcp_post_controls'>\n\t\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t\t<strong>{$this->lang->words['dlt_topic_deletedby']}</strong> <span class='desc lighter blend_links'>" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($displayData['sdData'][$post['post']['pid']]) : '') . "</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t" . ($post['post']['_softDeleteReason'] ? "<li class='desc'>\n\t\t\t\t\t\t\t\t<strong>{$this->lang->words['dlt_topic_reason']}</strong> <span class='desc lighter'><em>" . ($displayData['sdData'][$post['post']['pid']]['sdl_obj_reason'] ? "{$displayData['sdData'][$post['post']['pid']]['sdl_obj_reason']}" : "{$this->lang->words['tdb__noreasongi']}") . "</em></span>\n\t\t\t\t\t\t\t</li>" : "") . "\n\t\t\t\t\t</ul>" : "") . "" : "") . "\n\t\t\t" . ($type == 'unapproved' ? "<ul class='ipsList_inline modcp_post_controls'>\n\t\t\t\t\t" . ($post['post']['_can_edit'] === TRUE ? "\n\t\t\t\t\t\t<li class='post_edit'><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=post&amp;section=post&amp;do=edit_post&amp;f={$post['post']['forum_id']}&amp;t={$post['post']['topic_id']}&amp;p={$post['post']['pid']}&amp;st={$this->request['st']}&amp;return=modcp:unapproved", "public", ''), "", "") . "' title='{$this->lang->words['post_edit_title']}' class='ipsButton_secondary ipsType_smaller' id='edit_post_{$post['post']['pid']}'>{$this->lang->words['post_edit']}</a></li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t<!-- Matt: Approve / unapprove post button -->\n\t\t\t\t\t" . ($this->memberData['is_mod'] ? "<li id='toggle_post_{$post['post']['pid']}'>\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=moderate&amp;section=moderate&amp;do=postchoice&amp;tact=approve&amp;selectedpids[{$post['post']['pid']}]={$post['post']['pid']}&amp;t={$post['post']['topic_id']}&amp;f={$post['post']['forum_id']}&amp;auth_key={$this->member->form_hash}&amp;return=modcp:unapproved", "public", ''), "", "") . "' title='{$this->lang->words['post_toggle_visible']}' class='ipsButton_secondary ipsType_smaller'><span id='toggletext_post_{$post['post']['pid']}'>" . ($post['post']['queued'] == 1 ? "{$this->lang->words['post_approve']}" : "{$this->lang->words['post_unapprove']}") . "</span></a>\n\t\t\t\t\t\t</li>" : "") . "\n\t\t\t\t\t" . (($post['post']['_can_delete'] === TRUE or $post['post']['_softDelete']) ? "\n\t\t\t\t\t\t<li class='post_del' id='del_post_{$post['post']['pid']}'>\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&amp;module=moderate&amp;section=moderate&amp;do=04&amp;f={$post['post']['forum_id']}&amp;t={$post['post']['topic_id']}&amp;p={$post['post']['pid']}&amp;st={$this->request['st']}&amp;auth_key={$this->member->form_hash}&amp;return=modcp:unapproved", "public", ''), "", "") . "' title='{$this->lang->words['post_delete_title']}' class='delete_post ipsButton_secondary important ipsType_smaller'>{$this->lang->words['post_delete']}</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . ($this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['gfx'] > 0 ? "\n\t\t\t\t\t\t<img src=\"{$this->settings['img_url']}/reports/post_alert_{$this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['gfx']}.png\" alt=\"\" class='ipbmenu clickable' id='post-report-{$post['post']['pid']}' />\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['posted']}</strong> <span class='desc lighter'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($post['post']['post_date'], "short", 0)) . "</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class='desc'>\n\t\t\t\t\t\t<strong>{$this->lang->words['in_topic']}</strong> <a class='desc lighter' href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$topic['post']['tid']}", "public", ''), "{$topic['post']['title_seo']}", "showtopic") . "'>" . IPSText::truncate($topic['post']['title'], 35) . "</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>" : "") . "\n\t\t\t<div class='post entry-content " . ($post['post']['_repignored'] == 1 ? "imgsize_ignore" : "") . "'>\n\t\t\t\t{$post['post']['post']}\n\t\t\t\t{$post['post']['attachmentHtml']}\n\t\t\t\t<br />\n\t\t\t\t" . ($post['post']['edit_by'] ? "<p class='edit'>\n\t\t\t\t\t\t{$post['post']['edit_by']}\n\t\t\t\t\t\t" . ($post['post']['post_edit_reason'] != '' ? "\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t<span class='reason'>{$post['post']['post_edit_reason']}</span>\n\t\t\t\t\t\t" : "") . "\n\t\t\t\t\t</p>" : "") . "\n\t\t\t</div>\n\t\t\t<br />\n\t\t</div>\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\tif( \$('toggle_post_{$post['post']['pid']}') ){\n\t\t\t\t\$('toggle_post_{$post['post']['pid']}').show();\n\t\t\t}\n\t\t\t\n\t\t\t// Add perm data\n\t\t\tipb.topic.deletePerms[{$post['post']['pid']}] = { 'canDelete' : " . intval($post['post']['_can_delete']) . ", 'canSoftDelete' : " . intval($post['post']['_softDelete']) . " };\n\t\t</script>\n\t\t" . ($this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['gfx'] > 0 ? "\n\t\t\t<ul id='post-report-{$post['post']['pid']}_menucontent' class='ipbmenu_content report_menu' style='display: none'>\n\t\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&amp;module=reports&amp;do=show_report&amp;rid={$this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['info']['id']}", "public", ''), "", "") . "\" id='report_mark_{$post['post']['pid']}'><img src='{$this->settings['img_url']}/reports/mark_complete.png' alt='' /> {$this->lang->words['report_menu_mark_complete']}</a></li>\n\t\t\t\t<li><a href=\"{$this->settings['base_url']}app=core&amp;module=reports&amp;section=reports&amp;do=show_report&amp;rid={$this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['info']['id']}\"><img src='{$this->settings['img_url']}/reports/view_report.png' alt='' /> {$this->lang->words['report_menu_view_report']}</a></li>\n\t\t\t</ul>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\$('report_mark_{$post['post']['pid']}').observe('click',\n\t\t\t\t \tipb.global.updateReportStatus.bindAsEventListener( \t\n\t\t\t\t\t\tthis, {$this->memberData['_cache']['report_temp']['post_marker']['post'][$post['post']['pid']]['info']['id']},2,2\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t</script>\n\t\t" : "") . "\n\t</div>\n</div>";
     return $IPBHTML;
 }
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:13,代碼來源:skin_modcp.php

示例13: showFormAttachments


//.........這裏部分代碼省略.........
         case 'date':
             $sort_key = 'a.attach_date ASC';
             $info['date_order'] = 'rdate';
             $info['size_order'] = 'size';
             break;
         case 'rdate':
             $sort_key = 'a.attach_date DESC';
             $info['date_order'] = 'date';
             $info['size_order'] = 'size';
             break;
         case 'size':
             $sort_key = 'a.attach_filesize DESC';
             $info['date_order'] = 'date';
             $info['size_order'] = 'rsize';
             break;
         case 'rsize':
             $sort_key = 'a.attach_filesize ASC';
             $info['date_order'] = 'date';
             $info['size_order'] = 'size';
             break;
         default:
             $sort_key = 'a.attach_date DESC';
             $info['date_order'] = 'date';
             $info['size_order'] = 'size';
             break;
     }
     //-----------------------------------------
     // Get some stats...
     //-----------------------------------------
     $maxspace = intval($this->memberData['g_attach_max']);
     if ($this->memberData['g_attach_max'] == -1) {
         $this->registry->getClass('output')->showError('no_permission_to_attach', 1010);
     }
     //-----------------------------------------
     // Limit by forums
     //-----------------------------------------
     $stats = $this->DB->buildAndFetch(array('select' => 'count(*) as count, ' . $this->DB->buildCoalesce(array('sum(attach_filesize)', 0)) . ' as sum', 'from' => 'attachments', 'where' => 'attach_member_id=' . $this->memberData['member_id'] . " AND attach_rel_module IN( 'post', 'msg' )"));
     if ($maxspace > 0) {
         //-----------------------------------------
         // Figure out percentage used
         //-----------------------------------------
         $info['has_limit'] = 1;
         $info['full_percent'] = $stats['sum'] ? sprintf("%.0f", $stats['sum'] / ($maxspace * 1024) * 100) : 0;
         if ($info['full_percent'] > 100) {
             $info['full_percent'] = 100;
         } else {
             if ($info['full_percent'] < 1 and $stats['count'] > 0) {
                 $info['full_percent'] = 1;
             }
         }
         $info['attach_space_count'] = sprintf($this->lang->words['attach_space_count'], intval($stats['count']), intval($info['full_percent']));
         $info['attach_space_used'] = sprintf($this->lang->words['attach_space_used'], IPSLib::sizeFormat($stats['sum']), IPSLib::sizeFormat($maxspace * 1024));
     } else {
         $info['has_limit'] = 0;
         $info['attach_space_used'] = sprintf($this->lang->words['attach_space_unl'], IPSLib::sizeFormat($stats['sum']));
     }
     //-----------------------------------------
     // Pages
     //-----------------------------------------
     $pages = $this->registry->getClass('output')->generatePagination(array('totalItems' => $stats['count'], 'itemsPerPage' => $perpage, 'currentStartValue' => $start, 'baseUrl' => "app=core&amp;module=usercp&amp;tab=core&amp;area=attachments&amp;sort=" . $this->request['sort'] . ""));
     //-----------------------------------------
     // Get attachments...
     //-----------------------------------------
     if ($stats['count']) {
         $this->DB->build(array('select' => 'a.*', 'from' => array('attachments' => 'a'), 'where' => "a.attach_member_id=" . $this->memberData['member_id'] . " AND a.attach_rel_module IN( 'post', 'msg' )", 'order' => $sort_key, 'limit' => array($start, $perpage), 'add_join' => array(array('select' => 'p.topic_id', 'from' => array('posts' => 'p'), 'where' => 'p.pid=a.attach_rel_id', 'type' => 'left'), array('select' => 't.*', 'from' => array('topics' => 't'), 'where' => 't.tid=p.topic_id', 'type' => 'left'))));
         $outer = $this->DB->execute();
         $this->registry->getClass('class_localization')->loadLanguageFile(array('public_topic'), 'forums');
         $cache = $this->cache->getCache('attachtypes');
         /* Load topic class */
         if (!$this->registry->isClassLoaded('topics')) {
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums');
             $this->registry->setClass('topics', new $classToLoad($this->registry));
         }
         while ($row = $this->DB->fetch($outer)) {
             $row['_link'] = true;
             if (!$this->registry->topics->canView($row)) {
                 $row['title'] = $this->lang->words['attach_topicmoved'];
                 $row['_link'] = false;
             }
             //-----------------------------------------
             // Full attachment thingy
             //-----------------------------------------
             if ($row['attach_rel_module'] == 'post') {
                 $row['_type'] = 'post';
             } else {
                 if ($row['attach_rel_module'] == 'msg') {
                     $row['_type'] = 'msg';
                     $row['title'] = $this->lang->words['attach_inpm'];
                 }
             }
             /* IPB 2.x conversion */
             $row['image'] = str_replace('folder_mime_types', 'mime_types', $cache[$row['attach_ext']]['atype_img']);
             $row['short_name'] = IPSText::truncate($row['attach_file'], 30);
             $row['attach_date'] = $this->registry->getClass('class_localization')->getDate($row['attach_date'], 'SHORT');
             $row['real_size'] = IPSLib::sizeFormat($row['attach_filesize']);
             $attachments[] = $row;
         }
     }
     return $this->registry->getClass('output')->getTemplate('ucp')->coreAttachments($info, $pages, $attachments);
 }
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:101,代碼來源:usercpForms.php

示例14: _showForumSubsRecurse

 /**
  * Recursively build up the tracked forums
  *
  * @access	private
  * @param	array 		Tracked forums
  * @param	integer		Forum id to start at
  * @param	array 		Forum data thus far
  * @param	integer		Depth level
  * @return	array 		Forums
  */
 private function _showForumSubsRecurse($forums, $root, $forumArray = array(), $depth = 0)
 {
     if (is_array($this->registry->getClass('class_forums')->forum_cache[$root]) and count($this->registry->getClass('class_forums')->forum_cache[$root])) {
         foreach ($this->registry->getClass('class_forums')->forum_cache[$root] as $id => $forum) {
             if (in_array($id, array_keys($forums))) {
                 //-----------------------------------------
                 // Got perms to see this forum?
                 //-----------------------------------------
                 if (!$this->registry->getClass('class_forums')->forum_by_id[$forum['id']]) {
                     continue;
                 }
                 $forum['_depth'] = $depth;
                 $forum['_newTopics'] = $forums[$forum['id']]['_newTopics'];
                 $forum['_type'] = $forums[$forum['id']]['_type'];
                 $forum['folder_icon'] = $this->registry->getClass('class_forums')->forumsNewPosts($forum);
                 $forum['last_title'] = str_replace("&#33;", "!", $forum['last_title']);
                 $forum['last_title'] = str_replace("&quot;", '"', $forum['last_title']);
                 if (IPSText::mbstrlen($forum['last_title']) > 30) {
                     $forum['last_title'] = IPSText::truncate($forum['last_title'], 30);
                 }
                 $forumArray[$forum['id']] = $forum;
             }
             $forumArray = $this->_showForumSubsRecurse($forums, $forum['id'], $forumArray, $depth + 1);
         }
     }
     return $forumArray;
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:37,代碼來源:usercpForms.php

示例15: showTab

 /**
  * Return the HTML to display the tab
  *
  * @return	@e string
  */
 public function showTab($string)
 {
     //-----------------------------------------
     // Are we a member?
     //-----------------------------------------
     if (!$this->memberData['member_id']) {
         return '';
     }
     //-----------------------------------------
     // How many attachments do we have?
     //-----------------------------------------
     $mimes = $this->cache->getCache('attachtypes');
     $st = intval($this->request['st']);
     $each = 30;
     $where = '';
     if ($string) {
         $where = " AND attach_file LIKE '%{$string}%'";
     }
     /* Exclude PMs */
     $count = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as total', 'from' => 'attachments', 'where' => "attach_rel_module != 'msg' AND attach_member_id={$this->memberData['member_id']}" . $where));
     $rows = array();
     $pages = $this->registry->output->generatePagination(array('totalItems' => $count['total'], 'itemsPerPage' => $each, 'currentStartValue' => $st, 'seoTitle' => '', 'method' => 'nextPrevious', 'noDropdown' => true, 'ajaxLoad' => 'mymedia_content', 'baseUrl' => "app=core&amp;module=ajax&amp;section=media&amp;do=loadtab&amp;tabapp=core&amp;tabplugin=attachments&amp;search=" . urlencode($string)));
     $this->DB->build(array('select' => '*', 'from' => 'attachments', 'where' => "attach_rel_module != 'msg' AND attach_member_id={$this->memberData['member_id']}" . $where, 'order' => 'attach_date DESC', 'limit' => array($st, $each)));
     $outer = $this->DB->execute();
     while ($r = $this->DB->fetch($outer)) {
         if ($r['attach_thumb_location']) {
             $image = $this->settings['upload_url'] . '/' . $r['attach_thumb_location'];
             $dims = IPSLib::scaleImage(array('cur_width' => $r['attach_thumb_width'], 'cur_height' => $r['attach_thumb_height'], 'max_width' => 80, 'max_height' => 80));
             $width = $dims['img_width'];
             $height = $dims['img_height'];
         } else {
             $image = $this->settings['public_dir'] . $mimes[$r['attach_ext']]['atype_img'];
             $width = 0;
             $height = 0;
         }
         $rows[] = array('image' => $image, 'width' => $width, 'height' => $height, 'title' => IPSText::truncate($r['attach_file'], 25), 'desc' => '', 'insert' => "core:attachments:" . $r['attach_id']);
     }
     return $this->registry->output->getTemplate('editors')->mediaGenericWrapper($rows, $pages, 'core', 'attachments');
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:44,代碼來源:plugin_attachments.php


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