当前位置: 首页>>代码示例>>PHP>>正文


PHP display_attachments函数代码示例

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


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

示例1: display_post_attachments

/**
* Display Attachments in Posts
*/
function display_post_attachments($post_id, $switch_attachment)
{
    global $attach_config, $is_auth;
    if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod'])) {
        return;
    }
    if ($is_auth['auth_download'] && $is_auth['auth_view']) {
        display_attachments($post_id);
    }
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:13,代码来源:displaying.php

示例2: cms_block_forum_attach

 function cms_block_forum_attach()
 {
     global $db, $cache, $config, $template, $images, $lang, $bbcode, $block_id, $cms_config_vars;
     if (!class_exists('class_topics')) {
         include IP_ROOT_PATH . 'includes/class_topics.' . PHP_EXT;
     }
     $class_topics = new class_topics();
     @(include_once IP_ROOT_PATH . ATTACH_MOD_PATH . 'displaying.' . PHP_EXT);
     $template->_tpldata['articles_fp.'] = array();
     $index_file = !empty($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : getenv('SCRIPT_NAME');
     $index_file = htmlspecialchars(urldecode($index_file));
     $template->set_filenames(array('forum_attach_block' => 'blocks/forum_attach_block.tpl'));
     $template->assign_vars(array('L_COMMENTS' => $lang['Comments'], 'L_VIEW_COMMENTS' => $lang['View_comments'], 'L_POST_COMMENT' => $lang['Post_your_comment'], 'L_POSTED' => $lang['Posted'], 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_REPLIES' => $lang['Replies'], 'L_REPLY_NEWS' => $lang['News_Reply'], 'L_PRINT_NEWS' => $lang['News_Print'], 'L_EMAIL_NEWS' => $lang['News_Email'], 'MINIPOST_IMG' => $images['icon_minipost'], 'NEWS_REPLY_IMG' => $images['news_reply'], 'NEWS_PRINT_IMG' => $images['news_print'], 'NEWS_EMAIL_IMG' => $images['news_email'], 'IMG_CLOCK' => $images['news_clock']));
     // $only_auth_view must have the opposite value of $cms_config_vars['md_ignore_auth_view'][$block_id]
     // Suggested by JHL - To Be Verified!
     //$only_auth_view = (!empty($cms_config_vars['md_ignore_auth_view'][$block_id]) ? true : false);
     $only_auth_view = !empty($cms_config_vars['md_ignore_auth_view'][$block_id]) || $cms_config_vars['md_ignore_auth_view'][$block_id] == true ? false : true;
     if ($cms_config_vars['md_single_post_retrieve'][$block_id]) {
         $single_post_id = request_var('post_id', 0);
         if ($cms_config_vars['md_single_post_auto_id'][$block_id]) {
             $single_post_id = !empty($single_post_id) ? $single_post_id : $cms_config_vars['md_single_post_id'][$block_id];
         } else {
             $single_post_id = $cms_config_vars['md_single_post_id'][$block_id];
         }
         // Mighty Gorgon: edited by JHL, I still need to check the impacts of this amendment
         //$fetchposts = $class_topics->fetch_posts($single_post_id, 1, $cms_config_vars['md_single_post_length'][$block_id], false, false, true, $only_auth_view);
         $fetchposts = $class_topics->fetch_posts($single_post_id, 1, $cms_config_vars['md_single_post_length'][$block_id], false, 0, true, $only_auth_view);
     } else {
         $fetchposts = $class_topics->fetch_posts($cms_config_vars['md_posts_forum_id'][$block_id], $cms_config_vars['md_num_posts'][$block_id], $cms_config_vars['md_posts_length'][$block_id], $cms_config_vars['md_posts_show_portal'][$block_id], $cms_config_vars['md_posts_random'][$block_id], false, $only_auth_view);
     }
     for ($i = 0; $i < sizeof($fetchposts); $i++) {
         init_display_post_attachments($fetchposts[$i]['topic_attachment'], $fetchposts[$i], true, $block_id);
         $open_bracket = '';
         $close_bracket = '';
         $read_full = '';
         if ($fetchposts[$i]['striped'] == 1) {
             $open_bracket = '[ ';
             $close_bracket = ' ]';
             $read_full = $lang['Read_Full'];
         }
         // Convert and clean special chars!
         $topic_title = htmlspecialchars_clean($fetchposts[$i]['topic_title']);
         $template->assign_block_vars('articles_fp', array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'FORUM_ID' => $fetchposts[$i]['forum_id'], 'TITLE' => $topic_title, 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'TEXT' => $fetchposts[$i]['post_text'], 'REPLIES' => $fetchposts[$i]['topic_replies'], 'U_VIEW_COMMENTS' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&amp;' . POST_POST_URL . '=' . $fetchposts[$i]['post_id'] . '#p' . $fetchposts[$i]['post_id'], true), 'U_POST_COMMENT' => append_sid('posting.' . PHP_EXT . '?mode=reply&amp;' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']), 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&amp;start=0'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($fetchposts[$i]['topic_title'])) . '&amp;topic_id=' . $fetchposts[$i]['topic_id']), 'U_READ_FULL' => append_sid($index_file . '?article=' . $i), 'L_READ_FULL' => $read_full, 'OPEN' => $open_bracket, 'CLOSE' => $close_bracket));
         display_attachments($fetchposts[$i]['post_id'], 'articles_fp');
     }
 }
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:46,代码来源:forum_attach.php

示例3: prepareArticles

 /**
  * prepares a list of articles.
  *
  * @param integer (optional) the article id to the article to be displayed.
  *
  * @return void
  *
  * @access private
  */
 function prepareArticles($articles, $show_abstract = false, $show_attachments = true)
 {
     global $lang, $config, $images, $is_auth, $theme, $user, $block_id, $cms_config_var;
     if (isset($cms_config_var['md_news_length'])) {
         $news_trim = $cms_config_var['md_news_length'];
     } else {
         $news_trim = $this->config['news_item_trim'];
     }
     if (is_array($articles)) {
         if ($config['display_tags_box']) {
             @(include_once IP_ROOT_PATH . 'includes/class_topics_tags.' . PHP_EXT);
             $class_topics_tags = new class_topics_tags();
         }
         foreach ($articles as $article) {
             $trimmed = false;
             // Trim the post body if needed.
             if ($show_abstract && $news_trim > 0) {
                 $article['post_abstract'] = $this->trimText($article['post_text'], $news_trim, $trimmed);
                 $article['post_abstract'] = $this->parseMessage($article['post_abstract'] . ' ... ', $article['enable_bbcode'], $article['enable_html'], $article['enable_smilies'], $article['enable_autolinks_acronyms']);
             }
             $article['post_text'] = $this->parseMessage($article['post_text'], $article['enable_bbcode'], $article['enable_html'], $article['enable_smilies'], $article['enable_autolinks_acronyms']);
             if ($show_attachments == true) {
                 init_display_post_attachments($article['topic_attachment'], $article, false, $block_id);
             }
             $sql = '';
             $dateformat = $user->data['user_id'] == ANONYMOUS ? $config['default_dateformat'] : $user->data['user_dateformat'];
             $timezone = $user->data['user_id'] == ANONYMOUS ? $config['board_timezone'] : $user->data['user_timezone'];
             $this->setVariables(array('L_REPLIES' => $lang['Replies'], 'L_REPLY_NEWS' => $lang['News_Reply'], 'L_PRINT_NEWS' => $lang['News_Print'], 'L_EMAIL_NEWS' => $lang['News_Email'], 'MINIPOST_IMG' => $images['icon_minipost'], 'NEWS_REPLY_IMG' => $images['news_reply'], 'NEWS_PRINT_IMG' => $images['news_print'], 'NEWS_EMAIL_IMG' => $images['news_email']));
             //$index_file = CMS_PAGE_HOME;
             $index_file = !empty($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : getenv('SCRIPT_NAME');
             //$page_query = $_SERVER['QUERY_STRING'];
             //$page_query = (!empty($_SERVER['QUERY_STRING'])) ? explode('&', $_SERVER['QUERY_STRING']) : explode('&', getenv('QUERY_STRING'));
             if ($this->config['news_base_url'] != '') {
                 $index_file = $this->config['news_base_url'] . $index_file;
             }
             $index_file = htmlspecialchars(urldecode($index_file));
             $portal_page_id = request_var('page', 0);
             $portal_page_id = !empty($portal_page_id) ? 'page=' . $portal_page_id . '&amp;' : '';
             $ubid_link = request_var('ubid', 0);
             $ubid_link = !empty($ubid_link) ? 'ubid=' . $ubid_link . '&amp;' : '';
             $format = 'r';
             $gmepoch = $article['post_time'];
             $tz = $timezone;
             $news_dst_sec = get_dst($gmepoch, $tz);
             $news_date = @gmdate($format, $gmepoch + 3600 * $tz + $news_dst_sec);
             $topic_tags_links = '';
             $topic_tags_display = false;
             if ($config['display_tags_box']) {
                 $topic_id = $article['topic_id'];
                 $topic_tags_links = $class_topics_tags->build_tags_list(array($topic_id));
                 $topic_tags_display = !empty($topic_tags_links) ? true : false;
             }
             // Convert and clean special chars!
             $topic_title = htmlspecialchars_clean($article['topic_title']);
             $this->setBlockVariables('articles', array('L_TITLE' => $topic_title, 'ID' => $article['topic_id'], 'KEY' => !empty($article['article_key']) ? $article['article_key'] : '', 'DAY' => $this->getDay($article['topic_time']), 'MONTH' => $this->getMonth($article['topic_time']), 'YEAR' => $this->getYear($article['topic_time']), 'CATEGORY' => $article['news_category'], 'CAT_ID' => $article['news_id'], 'COUNT_VIEWS' => $article['topic_views'], 'CAT_IMG' => $article['news_image'] ? $this->root_path . $config['news_path'] . '/' . $article['news_image'] : '', 'POST_DATE' => create_date_ip($dateformat, $article['post_time'], $timezone, true), 'RFC_POST_DATE' => $news_date, 'L_POSTER' => colorize_username($article['user_id'], $article['username'], $article['user_color'], $article['user_active']), 'L_COMMENTS' => $article['topic_replies'], 'S_TOPIC_TAGS' => $topic_tags_display, 'TOPIC_TAGS' => $topic_tags_links, 'U_COMMENTS' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $article['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $article['topic_id']), 'U_COMMENT' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $article['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $article['topic_id']), 'U_VIEWS' => append_sid('topic_view_users.' . PHP_EXT . '?' . POST_TOPIC_URL . '=' . $article['topic_id']), 'U_POST_COMMENT' => append_sid('posting.' . PHP_EXT . '?mode=reply&amp;' . POST_FORUM_URL . '=' . $article['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $article['topic_id']), 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $article['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $article['topic_id'] . '&amp;start=0'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($article['topic_title'])) . '&amp;topic_id=' . $article['topic_id']), 'L_TITLE_HTML' => urlencode(ip_utf8_decode($article['topic_title'])), 'COUNT_COMMENTS' => $article['topic_replies'], 'BODY' => $show_abstract && $trimmed ? $article['post_abstract'] : $article['post_text'], 'READ_MORE_LINK' => $show_abstract && $trimmed ? '<a href="' . $index_file . '?' . $portal_page_id . $ubid_link . 'topic_id=' . $article['topic_id'] . '">' . $lang['Read_More'] . '</a>' : ''));
             if ($show_attachments) {
                 display_attachments($article['post_id'], 'articles');
             }
             $post_id = $article['post_id'];
         }
     }
     if (sizeof($articles) == 0) {
         $this->setBlockVariables('no_articles', array('L_NO_NEWS' => $lang['No_articles']));
     }
 }
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:74,代码来源:news.php

示例4: cms_block_kb

 function cms_block_kb()
 {
     global $db, $cache, $config, $template, $theme, $images, $table_prefix, $user, $lang, $block_id, $cms_config_vars;
     global $ip_cms;
     if (!class_exists('class_topics')) {
         include IP_ROOT_PATH . 'includes/class_topics.' . PHP_EXT;
     }
     $class_topics = new class_topics();
     @(include_once IP_ROOT_PATH . ATTACH_MOD_PATH . 'displaying.' . PHP_EXT);
     $template->_tpldata['kb_list.'] = array();
     $template->_tpldata['kb_article.'] = array();
     $template->_tpldata['cat_row.'] = array();
     $template->_tpldata['menu_row.'] = array();
     $template->set_filenames(array('kb_block' => 'blocks/kb_block.tpl'));
     $template->assign_vars(array('L_COMMENTS' => $lang['Comments'], 'L_VIEW_COMMENTS' => $lang['View_comments'], 'L_POST_COMMENT' => $lang['Post_your_comment'], 'L_POSTED' => $lang['Posted'], 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_REPLIES' => $lang['Replies'], 'L_REPLY_ARTICLE' => $lang['Article_Reply'], 'L_PRINT_ARTICLE' => $lang['Article_Print'], 'L_EMAIL_ARTICLE' => $lang['Article_Email'], 'L_TOPIC' => $lang['Topic'], 'L_ARTICLES' => $lang['Articles'], 'L_TIME' => $lang['Articles_time'], 'L_OPTIONS' => $lang['Articles_options'], 'MINIPOST_IMG' => $images['icon_minipost'], 'ARTICLE_COMMENTS_IMG' => $images['vf_topic_nor'], 'ARTICLE_REPLY_IMG' => $images['news_reply'], 'ARTICLE_PRINT_IMG' => $images['news_print'], 'ARTICLE_EMAIL_IMG' => $images['news_email']));
     if (isset($_GET['kb']) && $_GET['kb'] == 'article') {
         $template->assign_block_vars('kb_article', array());
         $forum_id = request_var(POST_FORUM_URL, 0);
         // Mighty Gorgon: edited by JHL, I still need to check the impacts on the auth system
         //$fetchposts = $class_topics->fetch_posts($forum_id, 0, 0, false, false, false, false);
         $fetchposts = $class_topics->fetch_posts($forum_id, 0, 0);
         $id = isset($_GET[POST_TOPIC_URL]) ? intval($_GET[POST_TOPIC_URL]) : intval($_POST[POST_TOPIC_URL]);
         $i = 0;
         while ($fetchposts[$i]['topic_id'] != $id) {
             $i++;
         }
         init_display_post_attachments($fetchposts[$i]['topic_attachment'], $fetchposts[$i], true, $block_id);
         $template->assign_vars(array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'KB_TITLE' => $fetchposts[$i]['topic_title'], 'TOPIC_DESC' => $fetchposts[$i]['topic_desc'], 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'TEXT' => $fetchposts[$i]['post_text'], 'REPLIES' => $fetchposts[$i]['topic_replies'], 'U_VIEW_COMMENTS' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $forum_id . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'], true), 'U_POST_COMMENT' => append_sid('posting.' . PHP_EXT . '?mode=reply&amp;' . POST_FORUM_URL . '=' . $forum_id . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']), 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $forum_id . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&amp;start=0'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($fetchposts[$i]['topic_title'])) . '&amp;topic_id=' . $fetchposts[$i]['topic_id'])));
         display_attachments($fetchposts[$i]['post_id'], 'articles_fp');
     } else {
         if (isset($_GET['kb']) && $_GET['kb'] == 'category') {
             $template->assign_block_vars('kb_list', array());
             $forum_id = request_var(POST_FORUM_URL, 0);
             // Mighty Gorgon: edited by JHL, I still need to check the impacts on the auth system
             //$fetchposts = $class_topics->fetch_posts($forum_id, 0, 0, false, false, false, false);
             $fetchposts = $class_topics->fetch_posts($forum_id, 0, 0);
             for ($i = 0; $i < sizeof($fetchposts); $i++) {
                 init_display_post_attachments($fetchposts[$i]['topic_attachment'], $fetchposts[$i], true, $block_id);
                 $template->assign_block_vars('kb_list.kb_articles', array('TOPIC_ID' => $fetchposts[$i]['topic_id'], 'TOPIC_TITLE' => $fetchposts[$i]['topic_title'], 'TOPIC_DESC' => $fetchposts[$i]['topic_desc'], 'POSTER' => $fetchposts[$i]['username'], 'POSTER_CG' => colorize_username($fetchposts[$i]['user_id'], $fetchposts[$i]['username'], $fetchposts[$i]['user_color'], $fetchposts[$i]['user_active']), 'TIME' => $fetchposts[$i]['topic_time'], 'REPLIES' => $fetchposts[$i]['topic_replies'], 'U_VIEW_ARTICLE' => append_sid($_SERVER['SCRIPT_NAME'] . '?kb=article&f=' . $forum_id . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'], true), 'U_VIEW_COMMENTS' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_FORUM_URL . '=' . $forum_id . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'], true), 'U_POST_COMMENT' => append_sid('posting.' . PHP_EXT . '?mode=reply&amp;' . POST_FORUM_URL . '=' . $forum_id . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']), 'U_PRINT_TOPIC' => append_sid('printview.' . PHP_EXT . '?' . POST_FORUM_URL . '=' . $forum_id . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id'] . '&amp;start=0'), 'U_EMAIL_TOPIC' => append_sid('tellafriend.' . PHP_EXT . '?topic_title=' . urlencode(ip_utf8_decode($fetchposts[$i]['topic_title'])) . '&amp;topic_id=' . $fetchposts[$i]['topic_id'])));
                 display_attachments($fetchposts[$i]['post_id'], 'articles_fp');
             }
             $template->assign_vars(array('KB_TITLE' => $lang['Kb_name']));
         } else {
             $template->assign_block_vars('cat_row', array());
             $sql = "SELECT * FROM " . CMS_NAV_MENU_TABLE . "\n\t\t\t\t\t\t\tWHERE menu_id = '" . intval($cms_config_vars['kb_cat_id'][$block_id]) . "'\n\t\t\t\t\t\t\tLIMIT 1";
             $result = $db->sql_query($sql, 0, 'cms_menu_', CMS_CACHE_FOLDER);
             //$row = $db->sql_fetchrow($result);
             while ($row = $db->sql_fetchrow($result)) {
                 break;
             }
             $db->sql_freeresult($result);
             if ($row['menu_name_lang'] != '' && isset($lang[$row['menu_name_lang']])) {
                 $main_menu_name = $lang[$row['menu_name_lang']];
             } else {
                 $main_menu_name = $row['menu_name'] != '' ? $row['menu_name'] : $lang['quick_links'];
             }
             $sql = "SELECT * FROM " . CMS_NAV_MENU_TABLE . "\n\t\t\t\t\t\t\tWHERE menu_parent_id = '" . intval($cms_config_vars['kb_cat_id'][$block_id]) . "'\n\t\t\t\t\t\t\tORDER BY cat_parent_id ASC, menu_order ASC";
             $result = $db->sql_query($sql, 0, 'cms_menu_', CMS_CACHE_FOLDER);
             $menu_cat = array();
             $cat_item = array();
             $menu_item = array();
             $auth_levels = $ip_cms->cms_auth_view();
             while ($menu_item = $db->sql_fetchrow($result)) {
                 if ($menu_item['cat_id'] > 0) {
                     $cat_item[$menu_item['cat_id']] = $menu_item;
                 }
                 if ($menu_item['cat_parent_id'] > 0) {
                     $menu_cat[$menu_item['cat_parent_id']][$menu_item['menu_item_id']] = $menu_item;
                 }
             }
             $db->sql_freeresult($result);
             foreach ($cat_item as $cat_item_data) {
                 if ($cat_item_data['menu_status'] == false) {
                     $cat_allowed = false;
                 } else {
                     $auth_level_req = $cat_item_data['auth_view'];
                     $cat_allowed = in_array($auth_level_req, $auth_levels) ? true : false;
                 }
                 if (!empty($cat_allowed)) {
                     //echo($cat_item_data['menu_name'] . '<br />');
                     $cat_id = $cat_item_data['cat_id'];
                     if ($cat_item_data['menu_name_lang'] != '' && isset($lang[$cat_item_data['menu_name_lang']])) {
                         $cat_name = $lang[$cat_item_data['menu_name_lang']];
                     } else {
                         $cat_name = $cat_item_data['menu_name'] != '' ? stripslashes($cat_item_data['menu_name']) : 'cat_item' . $cat_item_data['cat_id'];
                     }
                     $cat_icon = $cat_item_data['menu_icon'] != '' ? '<img src="' . $cat_item_data['menu_icon'] . '" alt="" title="' . $cat_name . '" style="vertical-align:middle;" />&nbsp;&nbsp;' : '<img src="' . $images['nav_menu_sep'] . '" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;';
                     //$cat_icon = (($cat_item_data['menu_icon'] != '') ? '<img src="' . $cat_item_data['menu_icon'] . '" alt="" title="' . $cat_name . '" style="vertical-align:middle;" />&nbsp;&nbsp;' : '&nbsp;');
                     if ($cat_item_data['menu_link'] != '') {
                         $cat_link = append_sid($cat_item_data['menu_link']);
                         if ($cat_item_data['menu_link_external'] == true) {
                             $cat_link .= '" target="_blank';
                         }
                     }
                     $template->assign_block_vars('cat_row', array('CAT_ID' => $cat_item_data['cat_id'], 'CAT_ITEM' => $cat_name, 'CAT_ICON' => $cat_icon));
                     foreach ($menu_cat[$cat_id] as $menu_cat_item_data) {
                         if ($menu_cat_item_data['menu_status'] == false) {
                             $menu_allowed = false;
                         } else {
                             $auth_level_req = $menu_cat_item_data['auth_view'];
//.........这里部分代码省略.........
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:101,代码来源:kb.php

示例5: display_review_attachments

function display_review_attachments($post_id, $switch_attachment, $is_auth)
{
    global $attach_config, $attachments;
    if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']) || !($is_auth['auth_download'] && $is_auth['auth_view']) || intval($attach_config['attachment_topic_review']) == 0) {
        return;
    }
    @reset($attachments);
    $attachments['_' . $post_id] = get_attachments_from_post($post_id);
    if (count($attachments['_' . $post_id]) == 0) {
        return;
    }
    display_attachments($post_id);
}
开发者ID:forummaks,项目名称:forum_maks,代码行数:13,代码来源:displaying.php

示例6: parse_inline_attachments

/**
* Inline Attachment processing
*/
function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_id = 0, $preview = false)
{
    global $config, $user;
    $attachments = display_attachments($forum_id, NULL, $attachments, $update_count, false, true);
    $tpl_size = sizeof($attachments);
    $unset_tpl = array();
    preg_match_all('#<!\\-\\- ia([0-9]+) \\-\\->(.*?)<!\\-\\- ia\\1 \\-\\->#', $text, $matches, PREG_PATTERN_ORDER);
    $replace = array();
    foreach ($matches[0] as $num => $capture) {
        // Flip index if we are displaying the reverse way
        $index = $config['display_order'] ? $tpl_size - ($matches[1][$num] + 1) : $matches[1][$num];
        $replace['from'][] = $matches[0][$num];
        $replace['to'][] = isset($attachments[$index]) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
        $unset_tpl[] = $index;
    }
    if (isset($replace['from'])) {
        $text = str_replace($replace['from'], $replace['to'], $text);
    }
    return array_unique($unset_tpl);
}
开发者ID:yunsite,项目名称:gloryroad,代码行数:23,代码来源:functions.php

示例7: parse_inline_attachments

function parse_inline_attachments(&$text, $attachments, &$update_count, $forum_id = 0, $preview = false)
{
    global $config, $_CLASS;
    $unset_array = array();
    $tpl_size = count($attachments);
    preg_match_all('#<!\\-\\- ia([0-9]+) \\-\\->(.*?)<!\\-\\- ia\\1 \\-\\->#', $text, $matches, PREG_PATTERN_ORDER);
    //print_r($matches);
    if (count($matches[1])) {
        $matches[1] = array_unique($matches[1]);
        foreach ($matches[1] as $key => $index) {
            // Flip index if we are displaying the reverse way
            // whats this display_order all about ?
            $index = $config['display_order'] ? $tpl_size - ($index + 1) : $index;
            if (isset($attachments[$index])) {
                $inline_attachments[$key] = display_attachments($forum_id, array($attachments[$index]), $update_count, $preview, true);
                $unset_array[] = $index;
            } else {
                $inline_attachments[$key] = false;
            }
        }
        $replace = array();
        foreach ($matches[1] as $key => $index) {
            $replace['from'][] = $matches[0][$key];
            $replace['to'][] = $inline_attachments[$key] ? $inline_attachments[$key][0] : sprintf($_CLASS['core_user']->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
        }
        if (isset($replace['from'])) {
            $text = str_replace($replace['from'], $replace['to'], $text);
        }
    }
    return $unset_array;
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:functions.php

示例8:

	
				
	switch ($_GET['cmd']) {
						
		case 'set_email_view_log':
			set_email_view_log();
			break;	
		case 'get_email_view_log':
			get_email_view_log();
			break;
		case 'view_error_file':
			view_error_file();
			break;		
			
		case 'display_attachments':
			display_attachments();
			break;
		case 'delete_attachment':
			delete_attachment();
			break;
		case 'rename_attachment':
			rename_attachment();
			break;	
		case 'fetch_file_info':
			fetch_file_info();
			break;	
		case 'rename_document':
			rename_document();
			break;	
		case 'view_attached_file':
			view_attached_file();
开发者ID:jeff-holloway,项目名称:cce,代码行数:29,代码来源:ajax.php

示例9: display_attachments

            $template->assign_block_vars('postrow.user_details', $msn);
        }
        if (!empty($yim)) {
            $template->assign_block_vars('postrow.user_details', $yim);
        }
        if (!empty($skype)) {
            $template->assign_block_vars('postrow.user_details', $skype);
        }
        if (!empty($gal)) {
            $template->assign_block_vars('postrow.user_details', $gal);
        }
    }
    # Display Attachments in Posts
    #	if (defined('BBAttach_mod') && $postrow[$i]['post_attachment']) {
    if (!intval($attach_config['disable_mod']) && $is_auth['auth_download'] && $postrow[$i]['post_attachment']) {
        display_attachments($postrow[$i]['post_id']);
    }
}
# Quick Reply Mod
if ((!$is_auth['auth_reply'] || $board_config['ropm_quick_reply'] == '0' || $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED) && $userdata['user_level'] != ADMIN) {
    $template->assign_vars(array('QUICK_REPLY_FORM' => ''));
} else {
    if ($can_watch_topic && $is_watching_topic) {
        $notify = 1;
    } else {
        $notify = $userdata['user_notify'];
    }
    $last_poster = $postrow[$total_posts - 1]['username'];
    $last_msg = $postrow[$total_posts - 1]['post_text'];
    $last_msg = "[quote=\"{$last_poster}\"]" . $last_msg . '[/quote]';
    $last_msg = str_replace("'", "&#39;", $last_msg);
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:viewtopic.php

示例10: T_

    $Form->radio('comment_status', $edited_Comment->status, $sharing_options, T_('Visibility'), true);
}
// Display renderers
$comment_renderer_checkboxes = $edited_Comment->renderer_checkboxes(NULL, false);
if (!empty($comment_renderer_checkboxes)) {
    $Form->info(T_('Text Renderers'), $comment_renderer_checkboxes);
}
// Display comment attachments
$LinkOwner = new LinkComment($edited_Comment);
if ($LinkOwner->count_links()) {
    // there are attachments to display
    $Form->switch_template_parts(array('fieldset_begin' => '<tr><td class="left" valign="top"><strong>$fieldset_title$:</strong></td><td class="row2 left">'));
    $Form->begin_fieldset(T_('Attachments'));
    if ($current_User->check_perm('files', 'view')) {
        // User has permission to view files
        display_attachments($LinkOwner);
    } else {
        echo T_('You do not have permission to edit file attachments for this comment');
    }
    $Form->end_fieldset();
    $Form->switch_template_parts($disp_params['edit_form_params']);
}
$Form->begin_fieldset();
$Form->submit(array('actionArray[update]', T_('Save changes'), 'SaveButton submit'));
$Form->end_fieldset();
$Form->end_form();
?>
<script type="text/javascript">
	function switch_edit_view()
	{
		var form = document.getElementById('comment_edit');
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_edit_comment.disp.php

示例11: append_sid

    }
    //
    // Again this will be handled by the templating
    // code at some point
    //
    $row_color = !($i % 2) ? $theme['td_color1'] : $theme['td_color2'];
    $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
    $s_post_download = '<a href="' . append_sid("viewtopic.{$phpEx}?download=" . $postrow[$i]['post_id'] . "&amp;" . POST_TOPIC_URL . "={$topic_id}") . '">' . $lang['Download_post'] . '</a>';
    $s_post_download_img = isset($images['icon_download']) ? '<a href="' . append_sid("viewtopic.{$phpEx}?download=" . $postrow[$i]['post_id'] . "&amp;" . POST_TOPIC_URL . "={$topic_id}") . '"><img src="' . $images['icon_download'] . '" alt="' . $lang['Download_post'] . '" title="' . $lang['Download_post'] . '"></a>' : '';
    $num_attachments = count($attachments['_' . $postrow[$i]['post_id']]);
    if ($num_attachments > 0) {
        $s_has_attachment = TRUE;
    }
    $template->assign_block_vars('postrow', array('POST_ID' => $postrow[$i]['post_id'], 'AUTHOR_PANEL' => $postrow[$i]['user_my_ignore'] ? $ignore_panel : $author_panel, 'BUTTONS_PANEL' => $buttons_panel, 'IGNORE_IMG' => $ignore_buttons, 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'POSTER_NAME' => $poster, 'POST_NUMBER' => $i + $start + 1, 'POST_DATE' => $post_date, 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'SIGNATURE' => $user_sig, 'EDITED_MESSAGE' => $l_edited_by, 'MINI_POST_IMG' => $mini_post_img, 'S_DOWNLOAD_POST' => $s_post_download, 'S_DOWNLOAD_POST_IMG' => $s_post_download_img, 'EDIT_IMG' => $edit_img, 'EDIT' => $edit, 'QUOTE_IMG' => $quote_img, 'QUOTE' => $quote, 'IP_IMG' => $ip_img, 'IP' => $ip, 'DELETE_IMG' => $delpost_img, 'DELETE' => $delpost, 'USER_WARNINGS' => $user_warnings, 'CARD_IMG' => $card_img, 'CARD_HIDDEN_FIELDS' => $card_hidden, 'CARD_EXTRA_SPACE' => $r_card_img || $y_card_img || $g_card_img || $b_card_img ? ' ' : '', 'L_MINI_POST_ALT' => $mini_post_alt, 'U_MINI_POST' => $mini_post_url, 'U_G_CARD' => $g_card_img, 'U_Y_CARD' => $y_card_img, 'U_R_CARD' => $r_card_img, 'U_B_CARD' => $b_card_img, 'S_CARD' => append_sid("card." . $phpEx), 'U_POST_ID' => $postrow[$i]['post_id'], 'S_HAS_ATTACHMENT' => $s_has_attachment));
    if ($s_has_attachment) {
        display_attachments($postrow[$i]['post_id'], $num_attachments);
    }
    $cm_viewtopic->post_vars($postrow[$i], $userdata, $forum_id);
    //-- mod : profile cp ------------------------------------------------------------------------------
    //-- add
    if ($postrow[$i]['user_my_ignore']) {
        $template->assign_block_vars('postrow.switch_buddy_ignore', array());
    } else {
        $template->assign_block_vars('postrow.switch_no_buddy_ignore', array());
    }
    //-- fin mod : profile cp --------------------------------------------------------------------------
}
//-- mod : profile cp ------------------------------------------------------------------------------
//-- add
$template->assign_vars(array('L_IGNORE_CHOOSEN' => $lang['Ignore_choosed']));
//-- fin mod : profile cp --------------------------------------------------------------------------
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:31,代码来源:viewtopic.php

示例12: view_message

function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
{
    global $_CLASS, $_CORE_CONFIG, $site_file_root, $config;
    $_CLASS['core_user']->add_lang('viewtopic');
    $msg_id = (int) $msg_id;
    $folder_id = (int) $folder_id;
    $author_id = (int) $message_row['author_id'];
    // Not able to view message, it was deleted by the sender
    if ($message_row['deleted']) {
        trigger_error('NO_AUTH_READ_REMOVED_MESSAGE');
    }
    // Grab icons
    $icons = array();
    obtain_icons($icons);
    // Instantiate BBCode if need be
    if ($message_row['bbcode_bitfield']) {
        require $site_file_root . 'includes/forums/bbcode.php';
        $bbcode = new bbcode($message_row['bbcode_bitfield']);
    }
    // Assign TO/BCC Addresses to template
    write_pm_addresses(array('to' => $message_row['to_address'], 'bcc' => $message_row['bcc_address']), $author_id);
    $user_info = get_user_informations($author_id, $message_row);
    // Parse the message and subject
    $message = $message_row['message_text'];
    // If the board has HTML off but the message has HTML on then we process it, else leave it alone
    if ($message_row['enable_html'] && (!$config['auth_html_pm'] || !$_CLASS['auth']->acl_get('u_pm_html'))) {
        $message = preg_replace('#(<!\\-\\- h \\-\\-><)([\\/]?.*?)(><!\\-\\- h \\-\\->)#is', "&lt;\\2&gt;", $message);
    }
    // Second parse bbcode here
    if ($message_row['bbcode_bitfield']) {
        $bbcode->bbcode_second_pass($message, $message_row['bbcode_uid'], $message_row['bbcode_bitfield']);
    }
    // Always process smilies after parsing bbcodes
    $message = smiley_text($message);
    // Replace naughty words such as farty pants
    $message_row['message_subject'] = censor_text($message_row['message_subject']);
    $message = str_replace("\n", '<br />', censor_text($message));
    // Editing information
    if ($message_row['message_edit_count'] && $config['display_last_edited']) {
        $l_edit_time_total = $message_row['message_edit_count'] == 1 ? $_CLASS['core_user']->lang['EDITED_TIME_TOTAL'] : $_CLASS['core_user']->lang['EDITED_TIMES_TOTAL'];
        $l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, !$message_row['message_edit_user'] ? $message_row['username'] : $message_row['message_edit_user'], $_CLASS['core_user']->format_date($message_row['message_edit_time']), $message_row['message_edit_count']);
    } else {
        $l_edited_by = '';
    }
    // Pull attachment data
    $display_notice = false;
    $attachments = array();
    if ($message_row['message_attachment'] && $config['allow_pm_attach']) {
        if ($config['auth_download_pm'] && $_CLASS['auth']->acl_get('u_pm_download')) {
            $sql = 'SELECT * 
				FROM ' . FORUMS_ATTACHMENTS_TABLE . "\n\t\t\t\tWHERE post_msg_id = {$msg_id}\n\t\t\t\t\tAND in_message = 1\n\t\t\t\tORDER BY filetime " . (!$config['display_order'] ? 'DESC' : 'ASC') . ', post_msg_id ASC';
            $result = $_CLASS['core_db']->query($sql);
            while ($row = $_CLASS['core_db']->fetch_row_assoc($result)) {
                $attachments[] = $row;
            }
            $_CLASS['core_db']->free_result($result);
            // No attachments exist, but message table thinks they do so go ahead and reset attach flags
            if (empty($attachments)) {
                $sql = 'UPDATE ' . FORUMS_PRIVMSGS_TABLE . " \n\t\t\t\t\tSET message_attachment = 0 \n\t\t\t\t\tWHERE msg_id = {$msg_id}";
                $_CLASS['core_db']->query($sql);
            }
        } else {
            $display_notice = true;
        }
    }
    $_CLASS['core_template']->assign('S_HAS_ATTACHMENTS', false);
    if (!empty($attachments)) {
        require_once SITE_FILE_ROOT . 'includes/forums/functions_display.php';
        $null = array();
        $unset_attachments = parse_inline_attachments($message, $attachments, $update_count, 0);
        // Needed to let not display the inlined attachments at the end of the post again
        foreach ($unset_attachments as $index) {
            unset($attachments[$index]);
        }
        unset($unset_attachments);
        if (!empty($attachments)) {
            $_CLASS['core_template']->assign('S_HAS_ATTACHMENTS', true);
            $_CLASS['core_template']->assign('attachment', display_attachments(0, $attachments, $update_count, true));
        }
        unset($attachment_data, $null);
    }
    if (!mb_strpos($_CLASS['core_user']->data['session_url'], '&amp;t=' . $msg_id) && !empty($update_count)) {
        // Update the attachment download counts
        $sql = 'UPDATE ' . FORUMS_ATTACHMENTS_TABLE . ' 
			SET download_count = download_count + 1 
			WHERE attach_id IN (' . implode(', ', array_unique($update_count)) . ')';
        $_CLASS['core_db']->query($sql);
    }
    $signature = $message_row['enable_sig'] && $config['allow_sig'] && $_CLASS['auth']->acl_get('u_sig') && $_CLASS['core_user']->optionget('viewsigs') ? $user_info['user_sig'] : '';
    // End signature parsing, only if needed
    if ($signature) {
        if ($user_info['user_sig_bbcode_bitfield']) {
            if (!isset($bbcode) || !$bbcode) {
                require $site_file_root . 'includes/forums/bbcode.php';
                $bbcode = new bbcode($user_info['user_sig_bbcode_bitfield']);
            }
            $bbcode->bbcode_second_pass($signature, $user_info['user_sig_bbcode_uid'], $user_info['user_sig_bbcode_bitfield']);
        }
        $signature = smiley_text($signature);
        $signature = str_replace("\n", '<br />', censor_text($signature));
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:101,代码来源:ucp_pm_viewmessage.php

示例13: compose_pm


//.........这里部分代码省略.........
            unset($message_parser);
            // ((!$message_subject) ? $subject : $message_subject)
            $msg_id = submit_pm($action, $subject, $pm_data, $update_message);
            $return_message_url = generate_link('Control_Panel&amp;i=pm&amp;mode=view_messages&amp;action=view_message&amp;p=' . $msg_id);
            $return_folder_url = generate_link('Control_Panel&amp;i=pm&amp;folder=outbox');
            $_CLASS['core_display']->meta_refresh(3, $return_message_url);
            $message = $_CLASS['core_user']->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['VIEW_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>') . '<br /><br />' . sprintf($_CLASS['core_user']->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $_CLASS['core_user']->lang['PM_OUTBOX']);
            trigger_error($message);
        }
        $message_subject = stripslashes($subject);
    }
    if (empty($error) && $preview) {
        $post_time = $action == 'edit' ? $post_time : $current_time;
        $preview_message = $message_parser->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, false);
        $preview_signature = $_CLASS['core_user']->data['user_sig'];
        $preview_signature_uid = $_CLASS['core_user']->data['user_sig_bbcode_uid'];
        $preview_signature_bitfield = $_CLASS['core_user']->data['user_sig_bbcode_bitfield'];
        // Signature
        if ($enable_sig && $config['allow_sig'] && $preview_signature) {
            $parse_sig = new parse_message($preview_signature);
            $parse_sig->bbcode_uid = $preview_signature_uid;
            $parse_sig->bbcode_bitfield = $preview_signature_bitfield;
            $parse_sig->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies);
            $preview_signature = $parse_sig->message;
            unset($parse_sig);
        } else {
            $preview_signature = '';
        }
        // Attachment Preview
        if (!empty($message_parser->attachment_data)) {
            require $site_file_root . 'includes/forums/functions_display.php';
            $extensions = $update_count = array();
            $_CLASS['core_template']->assign('S_HAS_ATTACHMENTS', true);
            display_attachments(0, 'attachment', $message_parser->attachment_data, $update_count, true);
        }
        $preview_subject = censor_text($subject);
        if (empty($error)) {
            $_CLASS['core_template']->assign(array('POST_DATE' => $_CLASS['core_user']->format_date($post_time), 'PREVIEW_SUBJECT' => $preview_subject, 'PREVIEW_MESSAGE' => $preview_message, 'PREVIEW_SIGNATURE' => $preview_signature, 'S_DISPLAY_PREVIEW' => true));
        }
        unset($message_text);
    }
    // Decode text for message display
    $bbcode_uid = ($action == 'quote' || $action == 'forward') && !$preview && !$refresh && empty($error) ? $bbcode_uid : $message_parser->bbcode_uid;
    $message_parser->decode_message($bbcode_uid);
    if ($action == 'quote' && !$preview && !$refresh) {
        $message_parser->message = '[quote="' . $quote_username . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
    }
    if (($action == 'reply' || $action == 'quote') && !$preview && !$refresh) {
        $message_subject = (!preg_match('/^Re:/', $message_subject) ? 'Re: ' : '') . censor_text($message_subject);
    }
    if ($action == 'forward' && !$preview && !$refresh) {
        $fwd_to_field = write_pm_addresses(array('to' => $to_address), 0, true);
        $forward_text = array();
        $forward_text[] = $_CLASS['core_user']->lang['FWD_ORIGINAL_MESSAGE'];
        $forward_text[] = sprintf($_CLASS['core_user']->lang['FWD_SUBJECT'], censor_text($message_subject));
        $forward_text[] = sprintf($_CLASS['core_user']->lang['FWD_DATE'], $_CLASS['core_user']->format_date($message_time));
        $forward_text[] = sprintf($_CLASS['core_user']->lang['FWD_FROM'], $quote_username);
        $forward_text[] = sprintf($_CLASS['core_user']->lang['FWD_TO'], implode(', ', $fwd_to_field['to']));
        $message_parser->message = implode("\n", $forward_text) . "\n\n[quote=\"[url=" . generate_link("Members_List&mode=viewprofile&u={$author_id}]{$quote_username}") . "[/url]\"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
        $message_subject = (!preg_match('/^Fwd:/', $message_subject) ? 'Fwd: ' : '') . censor_text($message_subject);
    }
    $attachment_data = $message_parser->attachment_data;
    $filename_data = $message_parser->filename_data;
    $message_text = $message_parser->message;
    unset($message_parser);
    // MAIN PM PAGE BEGINS HERE
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:67,代码来源:ucp_pm_compose.php

示例14: sprintf

    }
    // Bump information
    if ($topic_data['topic_bumped'] && $row['post_id'] == $topic_data['topic_last_post_id']) {
        // It is safe to grab the username from the user cache array, we are at the last
        // post and only the topic poster and last poster are allowed to bump
        $l_bumped_by = '<br /><br />' . sprintf($_CLASS['core_user']->lang['BUMPED_BY'], $user_cache[$topic_data['topic_bumper']]['username'], $_CLASS['core_user']->format_date($topic_data['topic_last_post_time']));
    } else {
        $l_bumped_by = '';
    }
    if (empty($icons[$row['icon_id']])) {
        $icons[$row['icon_id']] = array('img' => '', 'width' => '', 'height' => '');
    }
    if ($unread = $row['post_time'] > $topic_last_read) {
        $update_mark = $update_mark ? (int) max($row['post_time'], $update_mark) : $row['post_time'];
    }
    $postrow = array('ATTACHMENTS' => empty($attachments[$row['post_id']]) ? false : display_attachments($forum_id, $attachments[$row['post_id']], $update_count), 'POSTER_NAME' => $row['poster'], 'POSTER_RANK' => $user_cache[$poster_id]['rank_title'], 'RANK_IMAGE' => $user_cache[$poster_id]['rank_image'], 'POSTER_JOINED' => $user_cache[$poster_id]['joined'], 'POSTER_POSTS' => $user_cache[$poster_id]['posts'], 'POSTER_FROM' => $user_cache[$poster_id]['from'], 'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'], 'POST_DATE' => $_CLASS['core_user']->format_date($row['post_time']), 'POST_SUBJECT' => censor_text($row['post_subject']), 'MESSAGE' => censor_text($row['post_text']), 'SIGNATURE' => $row['enable_sig'] ? $user_cache[$poster_id]['sig'] : '', 'EDITED_MESSAGE' => $l_edited_by, 'EDIT_REASON' => $row['post_edit_reason'], 'BUMPED_MESSAGE' => $l_bumped_by, 'MINI_POST_IMG' => $unread ? $_CLASS['core_user']->img('icon_post_new', 'NEW_POST') : $_CLASS['core_user']->img('icon_post', 'POST'), 'POST_ICON_IMG' => $icons[$row['icon_id']]['img'], 'POST_ICON_IMG_WIDTH' => $icons[$row['icon_id']]['width'], 'POST_ICON_IMG_HEIGHT' => $icons[$row['icon_id']]['height'], 'ICQ_STATUS_IMG' => $user_cache[$poster_id]['icq_status_img'], 'ONLINE_IMG' => $poster_id == ANONYMOUS || !$config['load_onlinetrack'] ? '' : ($user_cache[$poster_id]['online'] ? $_CLASS['core_user']->img('btn_online', 'ONLINE') : $_CLASS['core_user']->img('btn_offline', 'OFFLINE')), 'U_EDIT' => $_CLASS['core_user']->data['user_id'] == $poster_id && $_CLASS['auth']->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time']) || $_CLASS['auth']->acl_get('m_edit', $forum_id) ? generate_link("Forums&amp;file=posting&amp;mode=edit&amp;p=" . $row['post_id']) : '', 'U_QUOTE' => $_CLASS['auth']->acl_get('f_quote', $forum_id) ? generate_link("Forums&amp;file=posting&amp;mode=quote&amp;p=" . $row['post_id']) : '', 'U_INFO' => $_CLASS['auth']->acl_get('m_', $forum_id) ? generate_link('Forums&amp;file=mcp&amp;mode=post_details&amp;p=' . $row['post_id'], false, false) : '', 'U_DELETE' => $_CLASS['core_user']->data['user_id'] == $poster_id && $_CLASS['auth']->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time']) || $_CLASS['auth']->acl_get('m_delete', $forum_id) ? generate_link("Forums&amp;file=posting&amp;mode=delete&amp;p=" . $row['post_id']) : '', 'U_PROFILE' => $user_cache[$poster_id]['profile'], 'U_SEARCH' => $user_cache[$poster_id]['search'], 'U_PM' => $poster_id != ANONYMOUS ? generate_link('Control_Panel&amp;i=pm&amp;mode=compose&amp;action=quote&amp;q=1&amp;p=' . $row['post_id']) : '', 'U_EMAIL' => $user_cache[$poster_id]['email'], 'U_WWW' => $user_cache[$poster_id]['www'], 'U_ICQ' => $user_cache[$poster_id]['icq'], 'U_AIM' => $user_cache[$poster_id]['aim'], 'U_MSN' => $user_cache[$poster_id]['msn'], 'U_YIM' => $user_cache[$poster_id]['yim'], 'U_JABBER' => $user_cache[$poster_id]['jabber'], 'U_REPORT' => generate_link('Forums&amp;file=report&amp;p=' . $row['post_id']), 'U_MCP_REPORT' => $_CLASS['auth']->acl_gets(array('m_', 'a_', 'f_report'), $forum_id) ? generate_link('Forums&amp;file=mcp&amp;mode=post_details&amp;p=' . $row['post_id']) : '', 'U_MCP_APPROVE' => $_CLASS['auth']->acl_get('m_approve', $forum_id) ? generate_link('Forums&amp;file=mcp&amp;i=queue&amp;mode=approve&amp;post_id_list[]=' . $row['post_id'], false, false) : '', 'U_MCP_DETAILS' => $_CLASS['auth']->acl_get('m_', $forum_id) ? generate_link('Forums&amp;file=mcp&amp;mode=post_details&amp;p=' . $row['post_id']) : '', 'U_MINI_POST' => generate_link('Forums&amp;file=viewtopic&amp;p=' . $row['post_id']) . '#' . $row['post_id'], 'U_NEXT_POST_ID' => $i < $i_total && isset($rowset[$i + 1]) ? $rowset[$i + 1]['post_id'] : '', 'U_PREV_POST_ID' => $prev_post_id, 'POST_ID' => $row['post_id'], 'S_IGNORE_POST' => false, 'S_POST_UNAPPROVED' => !$row['post_approved'], 'S_POST_REPORTED' => $row['post_reported'] && $_CLASS['auth']->acl_get('m_', $forum_id) ? TRUE : FALSE, 'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'] ? true : false, 'S_FRIEND' => $row['friend'], 'S_UNREAD_POST' => $unread, 'S_FIRST_UNREAD' => false);
    if ($unread && !$first_unread_makred) {
        $postrow['S_FIRST_UNREAD'] = true;
        $first_unread_makred = true;
    }
    // Dump vars into template
    $_CLASS['core_template']->assign_vars_array('postrow', $postrow);
    $prev_post_id = $row['post_id'];
    unset($rowset[$i], $attachments[$row['post_id']]);
}
unset($rowset, $user_cache);
// Quick mod tools
$topic_mod = '';
$topic_mod .= $_CLASS['auth']->acl_get('m_lock', $forum_id) || $_CLASS['auth']->acl_get('f_user_lock', $forum_id) && $_CLASS['core_user']->data['user_id'] != ANONYMOUS && $_CLASS['core_user']->data['user_id'] == $topic_data['topic_poster'] ? $topic_data['topic_status'] == ITEM_UNLOCKED ? '<option value="lock">' . $_CLASS['core_user']->lang['LOCK_TOPIC'] . '</option>' : '<option value="unlock">' . $_CLASS['core_user']->lang['UNLOCK_TOPIC'] . '</option>' : '';
$topic_mod .= $_CLASS['auth']->acl_get('m_delete', $forum_id) ? '<option value="delete_topic">' . $_CLASS['core_user']->lang['DELETE_TOPIC'] . '</option>' : '';
$topic_mod .= $_CLASS['auth']->acl_get('m_move', $forum_id) ? '<option value="move">' . $_CLASS['core_user']->lang['MOVE_TOPIC'] . '</option>' : '';
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:viewtopic.php

示例15: array

    }
    $_CLASS['core_template']->assign('S_HAS_ATTACHMENTS', false);
    // Attachment Preview
    if (!empty($message_parser->attachment_data)) {
        require_once SITE_FILE_ROOT . 'includes/forums/functions_display.php';
        $null = array();
        $attachment_data = $message_parser->attachment_data;
        $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id, true);
        // Needed to let not display the inlined attachments at the end of the post again
        foreach ($unset_attachments as $index) {
            unset($attachment_data[$index]);
        }
        unset($unset_attachments);
        if (!empty($attachment_data)) {
            $_CLASS['core_template']->assign('S_HAS_ATTACHMENTS', true);
            $_CLASS['core_template']->assign('attachment', display_attachments($forum_id, $attachment_data, $null, true));
        }
        unset($attachment_data, $null);
    }
    $_CLASS['core_template']->assign_array(array('PREVIEW_SUBJECT' => $preview_subject, 'PREVIEW_MESSAGE' => $preview_message, 'PREVIEW_SIGNATURE' => $preview_signature, 'S_DISPLAY_PREVIEW' => true));
    unset($preview_message, $preview_subject, $preview_signature, $preview_signature);
}
// Decode text for message display
$bbcode_uid = $mode == 'quote' && !$preview && !$refresh && empty($error) ? $bbcode_uid : $message_parser->bbcode_uid;
$message_parser->decode_message($bbcode_uid);
if ($mode == 'quote' && !$preview && !$refresh) {
    $quote_username = isset($posting_data['username']) ? $posting_data['username'] : (isset($posting_data['post_username']) ? $posting_data['post_username'] : '');
    $message_parser->message = '[quote="' . $quote_username . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
}
if (($mode == 'reply' || $mode == 'quote') && !$preview && !$refresh) {
    $post_subject = (!preg_match('/^Re:/', $post_subject) ? 'Re: ' : '') . censor_text($post_subject);
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:posting.php


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