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

PHP shorten_subject函数代码示例

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

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



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

示例1: boardindex

 public static function boardindex()
 {
     global $context, $txt, $sourcedir, $user_info;
     $data = array();
     if (($data = CacheAPI::getCache('github-feed-index', 1800)) === null) {
         $f = curl_init();
         if ($f) {
             curl_setopt_array($f, array(CURLOPT_URL => self::$my_git_api_url, CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false));
             $json_response = curl_exec($f);
             $data = json_decode($json_response, true);
             CacheAPI::putCache('github-feed-index', $data, 1800);
             curl_close($f);
         }
     }
     $n = 0;
     foreach ($data as $commit) {
         if (is_array($commit) && isset($commit['commit'])) {
             $context['gitfeed'][] = array('message_short' => shorten_subject($commit['commit']['message'], 60), 'message' => nl2br($commit['commit']['message']), 'dateline' => timeformat(strtotime($commit['commit']['committer']['date'])), 'sha' => $commit['sha'], 'href' => self::$my_git_url . 'commit/' . $commit['sha']);
         }
         if (++$n > 5) {
             break;
         }
     }
     if (!empty($data)) {
         /* 
          * add our plugin directory to the list of directories to search for templates
          * and register the template hook.
          * only do this if we actually have something to display
          */
         EoS_Smarty::addTemplateDir(dirname(__FILE__));
         EoS_Smarty::getConfigInstance()->registerHookTemplate('sidebar_below_userblock', 'gitfeed_sidebar_top');
         $context['gitfeed_global']['see_all']['href'] = self::$my_git_url . 'commits/master';
         $context['gitfeed_global']['see_all']['txt'] = 'Browse all commits';
     }
 }
开发者ID:norv,项目名称:EosAlpha,代码行数:35,代码来源:main.php


示例2: getLastPost

function getLastPost()
{
    global $user_info, $scripturl, $modSettings, $smcFunc;
    // Find it by the board - better to order by board than sort the entire messages table.
    $request = $smcFunc['db_query']('substring', '
		SELECT ml.poster_time, ml.subject, ml.id_topic, ml.poster_name, SUBSTRING(ml.body, 1, 385) AS body,
			ml.smileys_enabled
		FROM {db_prefix}boards AS b
			INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = b.id_last_msg)
		WHERE {query_wanna_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
			AND b.id_board != {int:recycle_board}' : '') . '
			AND ml.approved = {int:is_approved}
		ORDER BY b.id_msg_updated DESC
		LIMIT 1', array('recycle_board' => $modSettings['recycle_board'], 'is_approved' => 1));
    if ($smcFunc['db_num_rows']($request) == 0) {
        return array();
    }
    $row = $smcFunc['db_fetch_assoc']($request);
    $smcFunc['db_free_result']($request);
    // Censor the subject and post...
    censorText($row['subject']);
    censorText($row['body']);
    $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled']), array('<br />' => '&#10;')));
    if ($smcFunc['strlen']($row['body']) > 128) {
        $row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';
    }
    // Send the data.
    return array('topic' => $row['id_topic'], 'subject' => $row['subject'], 'short_subject' => shorten_subject($row['subject'], 24), 'preview' => $row['body'], 'time' => timeformat($row['poster_time']), 'timestamp' => forum_time(true, $row['poster_time']), 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.new;topicseen#new', 'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.new;topicseen#new">' . $row['subject'] . '</a>');
}
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:29,代码来源:Recent.php


示例3: getLastPosts

function getLastPosts($latestPostOptions)
{
    global $scripturl, $txt, $user_info, $modSettings, $smcFunc, $context;
    // Find all the posts.  Newer ones will have higher IDs.  (assuming the last 20 * number are accessable...)
    // !!!SLOW This query is now slow, NEEDS to be fixed.  Maybe break into two?
    $request = $smcFunc['db_query']('substring', '
		SELECT
			m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg,
			IFNULL(mem.real_name, m.poster_name) AS poster_name, t.id_board, b.name AS board_name,
			SUBSTRING(m.body, 1, 385) AS body, m.smileys_enabled
		FROM {db_prefix}messages AS m
			INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
			INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
		WHERE m.id_msg >= {int:likely_max_msg}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
			AND b.id_board != {int:recycle_board}' : '') . '
			AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
			AND t.approved = {int:is_approved}
			AND m.approved = {int:is_approved}' : '') . '
		ORDER BY m.id_msg DESC
		LIMIT ' . $latestPostOptions['number_posts'], array('likely_max_msg' => max(0, $modSettings['maxMsgID'] - 50 * $latestPostOptions['number_posts']), 'recycle_board' => $modSettings['recycle_board'], 'is_approved' => 1));
    $posts = array();
    $context['MemberColor_ID_MEMBER'] = array();
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        // Censor the subject and post for the preview ;).
        censorText($row['subject']);
        censorText($row['body']);
        $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '&#10;')));
        if ($smcFunc['strlen']($row['body']) > 128) {
            $row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';
        }
        // Build the array.
        $posts[] = array('board' => array('id' => $row['id_board'], 'name' => $row['board_name'], 'href' => $scripturl . '?board=' . $row['id_board'] . '.0', 'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'), 'topic' => $row['id_topic'], 'poster' => array('id' => $row['id_member'], 'name' => $row['poster_name'], 'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'], 'link' => empty($row['id_member']) ? (!empty($modSettings['MemberColorGuests']) ? '<span style="color:' . $modSettings['MemberColorGuests'] . ';">' : '') . $row['poster_name'] . (!empty($modSettings['MemberColorGuests']) ? '</span>' : '') : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['poster_name'] . '">' . $row['poster_name'] . '</a>'), 'subject' => $row['subject'], 'short_subject' => shorten_subject($row['subject'], 24), 'preview' => $row['body'], 'time' => timeformat($row['poster_time']), 'timestamp' => forum_time(true, $row['poster_time']), 'raw_timestamp' => $row['poster_time'], 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'], 'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>');
        //The Last Posters id for the MemberColor.
        if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($row['id_member'])) {
            $context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
        }
    }
    $smcFunc['db_free_result']($request);
    // Know set the colors for the Recent posts...
    if (!empty($context['MemberColor_ID_MEMBER'])) {
        $colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
        //So Let's Color The Recent Posts ;)
        if (!empty($modSettings['MemberColorRecentLastPost']) && is_array($posts)) {
            foreach ($posts as $postkey => $postid_memcolor) {
                if (!empty($colorDatas[$postid_memcolor['poster']['id']]['colored_link'])) {
                    $posts[$postkey]['poster']['link'] = $colorDatas[$postid_memcolor['poster']['id']]['colored_link'];
                }
            }
        }
    }
    return $posts;
}
开发者ID:Kheros,项目名称:MMOver,代码行数:53,代码来源:Subs-Recent.php


示例4: getLastPosts

function getLastPosts($showlatestcount)
{
    global $scripturl, $txt, $db_prefix, $user_info, $modSettings, $func;
    // Find all the posts.  Newer ones will have higher IDs.  (assuming the last 20 * number are accessable...)
    // !!!SLOW This query is now slow, NEEDS to be fixed.  Maybe break into two?
    $request = db_query("\n\t\tSELECT\n\t\t\tm.posterTime, m.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG,\n\t\t\tIFNULL(mem.realName, m.posterName) AS posterName, t.ID_BOARD, b.name AS bName,\n\t\t\tLEFT(m.body, 384) AS body, m.smileysEnabled\n\t\tFROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)\n\t\t\tLEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)\n\t\tWHERE m.ID_MSG >= " . max(0, $modSettings['maxMsgID'] - 20 * $showlatestcount) . "\n\t\t\tAND t.ID_TOPIC = m.ID_TOPIC\n\t\t\tAND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "\n\t\t\tAND b.ID_BOARD != {$modSettings['recycle_board']}" : '') . "\n\t\t\tAND {$user_info['query_see_board']}\n\t\tORDER BY m.ID_MSG DESC\n\t\tLIMIT {$showlatestcount}", __FILE__, __LINE__);
    $posts = array();
    while ($row = mysql_fetch_assoc($request)) {
        // Censor the subject and post for the preview ;).
        censorText($row['subject']);
        censorText($row['body']);
        $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']), array('<br />' => '&#10;')));
        if ($func['strlen']($row['body']) > 128) {
            $row['body'] = $func['substr']($row['body'], 0, 128) . '...';
        }
        // Build the array.
        $posts[] = array('board' => array('id' => $row['ID_BOARD'], 'name' => $row['bName'], 'href' => $scripturl . '?board=' . $row['ID_BOARD'] . '.0', 'link' => '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '.0">' . $row['bName'] . '</a>'), 'topic' => $row['ID_TOPIC'], 'poster' => array('id' => $row['ID_MEMBER'], 'name' => $row['posterName'], 'href' => empty($row['ID_MEMBER']) ? '' : $scripturl . '?action=profile;u=' . $row['ID_MEMBER'], 'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'), 'subject' => $row['subject'], 'short_subject' => shorten_subject($row['subject'], 24), 'preview' => $row['body'], 'time' => timeformat($row['posterTime']), 'timestamp' => forum_time(true, $row['posterTime']), 'raw_timestamp' => $row['posterTime'], 'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . ';topicseen#msg' . $row['ID_MSG'], 'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . ';topicseen#msg' . $row['ID_MSG'] . '">' . $row['subject'] . '</a>');
    }
    mysql_free_result($request);
    return $posts;
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:21,代码来源:Recent.php


示例5: getLastPosts

function getLastPosts($latestPostOptions)
{
    global $scripturl, $txt, $user_info, $modSettings, $smcFunc, $context;
    // Find all the posts.  Newer ones will have higher IDs.  (assuming the last 20 * number are accessable...)
    // !!!SLOW This query is now slow, NEEDS to be fixed.  Maybe break into two?
    $request = smf_db_query('
		SELECT
			m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg, b.name, m1.subject AS first_subject,
			IFNULL(mem.real_name, m.poster_name) AS poster_name, t.id_board, b.name AS board_name,
			SUBSTRING(m.body, 1, 385) AS body, m.smileys_enabled
		FROM {db_prefix}messages AS m
			INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
			INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
			INNER JOIN {db_prefix}messages AS m1 ON (m1.id_msg = t.id_first_msg)
			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
		WHERE m.id_msg >= {int:likely_max_msg}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
			AND b.id_board != {int:recycle_board}' : '') . '
			AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
			AND t.approved = {int:is_approved}
			AND m.approved = {int:is_approved}' : '') . '
		ORDER BY m.id_msg DESC
		LIMIT ' . $latestPostOptions['number_posts'], array('likely_max_msg' => max(0, $modSettings['maxMsgID'] - 50 * $latestPostOptions['number_posts']), 'recycle_board' => $modSettings['recycle_board'], 'is_approved' => 1));
    $posts = array();
    while ($row = mysql_fetch_assoc($request)) {
        // Censor the subject and post for the preview ;).
        censorText($row['subject']);
        censorText($row['body']);
        $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '&#10;')));
        if (commonAPI::strlen($row['body']) > 128) {
            $row['body'] = commonAPI::substr($row['body'], 0, 128) . '...';
        }
        $bhref = URL::board($row['id_board'], $row['board_name'], 0, true);
        $mhref = URL::user($row['id_member'], $row['poster_name']);
        $thref = URL::topic($row['id_topic'], $row['first_subject'], 0, false, '.msg' . $row['id_msg'], ';topicseen#msg' . $row['id_msg']);
        // Build the array.
        $posts[] = array('board' => array('id' => $row['id_board'], 'name' => $row['board_name'], 'href' => $bhref, 'link' => '<a href="' . $bhref . '">' . $row['board_name'] . '</a>'), 'topic' => $row['id_topic'], 'poster' => array('id' => $row['id_member'], 'name' => $row['poster_name'], 'href' => empty($row['id_member']) ? '' : $mhref, 'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $mhref . '">' . $row['poster_name'] . '</a>'), 'subject' => $row['subject'], 'short_subject' => shorten_subject($row['subject'], 35), 'preview' => $row['body'], 'time' => timeformat($row['poster_time']), 'timestamp' => forum_time(true, $row['poster_time']), 'raw_timestamp' => $row['poster_time'], 'href' => $thref, 'link' => '<a href="' . $thref . '" rel="nofollow">' . $row['first_subject'] . '</a>');
    }
    mysql_free_result($request);
    return $posts;
}
开发者ID:norv,项目名称:EosAlpha,代码行数:40,代码来源:Subs-Recent.php


示例6: ShowDrafts

/**
 * Loads in a group of drafts for the user of a given type (0/posts, 1/pm's)
 * loads a specific draft for forum use if selected.
 * Used in the posting screens to allow draft selection
 * WIll load a draft if selected is supplied via post
 *
 * @param type $member_id
 * @param type $topic
 * @param type $draft_type
 * @return boolean
 */
function ShowDrafts($member_id, $topic = false, $draft_type = 0)
{
    global $smcFunc, $scripturl, $context, $txt, $modSettings;
    // Permissions
    if ($draft_type === 0 && empty($context['drafts_save']) || $draft_type === 1 && empty($context['drafts_pm_save']) || empty($member_id)) {
        return false;
    }
    $context['drafts'] = array();
    // has a specific draft has been selected?  Load it up if there is not a message already in the editor
    if (isset($_REQUEST['id_draft']) && empty($_POST['subject']) && empty($_POST['message'])) {
        ReadDraft((int) $_REQUEST['id_draft'], $draft_type, true, true);
    }
    // load the drafts this user has available
    $request = $smcFunc['db_query']('', '
		SELECT *
		FROM {db_prefix}user_drafts
		WHERE id_member = {int:id_member}' . (!empty($topic) && empty($draft_type) ? '
			AND id_topic = {int:id_topic}' : (!empty($topic) ? '
			AND id_reply = {int:id_topic}' : '')) . '
			AND type = {int:draft_type}' . (!empty($modSettings['drafts_keep_days']) ? '
			AND poster_time > {int:time}' : '') . '
		ORDER BY poster_time DESC', array('id_member' => $member_id, 'id_topic' => (int) $topic, 'draft_type' => $draft_type, 'time' => !empty($modSettings['drafts_keep_days']) ? time() - $modSettings['drafts_keep_days'] * 86400 : 0));
    // add them to the draft array for display
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        // Post drafts
        if ($draft_type === 0) {
            $context['drafts'][] = array('subject' => censorText(shorten_subject(stripslashes($row['subject']), 24)), 'poster_time' => timeformat($row['poster_time']), 'link' => '<a href="' . $scripturl . '?action=post;board=' . $row['id_board'] . ';' . (!empty($row['id_topic']) ? 'topic=' . $row['id_topic'] . '.0;' : '') . 'id_draft=' . $row['id_draft'] . '">' . $row['subject'] . '</a>');
        } elseif ($draft_type === 1) {
            $context['drafts'][] = array('subject' => censorText(shorten_subject(stripslashes($row['subject']), 24)), 'poster_time' => timeformat($row['poster_time']), 'link' => '<a href="' . $scripturl . '?action=pm;sa=send;id_draft=' . $row['id_draft'] . '">' . (!empty($row['subject']) ? $row['subject'] : $txt['drafts_none']) . '</a>');
        }
    }
    $smcFunc['db_free_result']($request);
}
开发者ID:albertlast,项目名称:SMF2.1,代码行数:44,代码来源:Drafts.php


示例7: getBoardIndex


//.........这里部分代码省略.........
            }
            // If this board has new posts in it (and isn't the recycle bin!) then the category is new.
            if (empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $row_board['id_board']) {
                $categories[$row_board['id_cat']]['new'] |= empty($row_board['is_read']) && $row_board['poster_name'] != '';
            }
            // Avoid showing category unread link where it only has redirection boards.
            $categories[$row_board['id_cat']]['show_unread'] = !empty($categories[$row_board['id_cat']]['show_unread']) ? 1 : !$row_board['is_redirect'];
            // Collapsed category - don't do any of this.
            if ($categories[$row_board['id_cat']]['is_collapsed']) {
                continue;
            }
            // Let's save some typing.  Climbing the array might be slower, anyhow.
            $this_category =& $categories[$row_board['id_cat']]['boards'];
        }
        // This is a parent board.
        if ($row_board['id_parent'] == $boardIndexOptions['parent_id']) {
            // Is this a new board, or just another moderator?
            if (!isset($this_category[$row_board['id_board']])) {
                // Not a child.
                $isChild = false;
                $this_category[$row_board['id_board']] = array('new' => empty($row_board['is_read']), 'id' => $row_board['id_board'], 'name' => $row_board['board_name'], 'description' => $row_board['description'], 'moderators' => array(), 'link_moderators' => array(), 'children' => array(), 'link_children' => array(), 'children_new' => false, 'topics' => $row_board['num_topics'], 'posts' => $row_board['num_posts'], 'is_redirect' => $row_board['is_redirect'], 'unapproved_topics' => $row_board['unapproved_topics'], 'unapproved_posts' => $row_board['unapproved_posts'] - $row_board['unapproved_topics'], 'can_approve_posts' => !empty($user_info['mod_cache']['ap']) && ($user_info['mod_cache']['ap'] == array(0) || in_array($row_board['id_board'], $user_info['mod_cache']['ap'])), 'href' => $scripturl . '?board=' . $row_board['id_board'] . '.0', 'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['board_name'] . '</a>');
            }
            if (!empty($row_board['id_moderator'])) {
                $this_category[$row_board['id_board']]['moderators'][$row_board['id_moderator']] = array('id' => $row_board['id_moderator'], 'name' => $row_board['mod_real_name'], 'href' => $scripturl . '?action=profile;u=' . $row_board['id_moderator'], 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_board['id_moderator'] . '" title="' . $txt['board_moderator'] . '">' . $row_board['mod_real_name'] . '</a>');
                $this_category[$row_board['id_board']]['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $row_board['id_moderator'] . '" title="' . $txt['board_moderator'] . '">' . $row_board['mod_real_name'] . '</a>';
            }
        } elseif (isset($this_category[$row_board['id_parent']]['children']) && !isset($this_category[$row_board['id_parent']]['children'][$row_board['id_board']])) {
            // A valid child!
            $isChild = true;
            $this_category[$row_board['id_parent']]['children'][$row_board['id_board']] = array('id' => $row_board['id_board'], 'name' => $row_board['board_name'], 'description' => $row_board['description'], 'new' => empty($row_board['is_read']) && $row_board['poster_name'] != '', 'topics' => $row_board['num_topics'], 'posts' => $row_board['num_posts'], 'is_redirect' => $row_board['is_redirect'], 'unapproved_topics' => $row_board['unapproved_topics'], 'unapproved_posts' => $row_board['unapproved_posts'] - $row_board['unapproved_topics'], 'can_approve_posts' => !empty($user_info['mod_cache']['ap']) && ($user_info['mod_cache']['ap'] == array(0) || in_array($row_board['id_board'], $user_info['mod_cache']['ap'])), 'href' => $scripturl . '?board=' . $row_board['id_board'] . '.0', 'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['board_name'] . '</a>');
            // Counting child board posts is... slow :/.
            if (!empty($boardIndexOptions['countChildPosts']) && !$row_board['is_redirect']) {
                $this_category[$row_board['id_parent']]['posts'] += $row_board['num_posts'];
                $this_category[$row_board['id_parent']]['topics'] += $row_board['num_topics'];
            }
            // Does this board contain new boards?
            $this_category[$row_board['id_parent']]['children_new'] |= empty($row_board['is_read']);
            // This is easier to use in many cases for the theme....
            $this_category[$row_board['id_parent']]['link_children'][] =& $this_category[$row_board['id_parent']]['children'][$row_board['id_board']]['link'];
        } elseif (!empty($boardIndexOptions['countChildPosts'])) {
            if (!isset($parent_map)) {
                $parent_map = array();
            }
            if (!isset($parent_map[$row_board['id_parent']])) {
                foreach ($this_category as $id => $board) {
                    if (!isset($board['children'][$row_board['id_parent']])) {
                        continue;
                    }
                    $parent_map[$row_board['id_parent']] = array(&$this_category[$id], &$this_category[$id]['children'][$row_board['id_parent']]);
                    $parent_map[$row_board['id_board']] = array(&$this_category[$id], &$this_category[$id]['children'][$row_board['id_parent']]);
                    break;
                }
            }
            if (isset($parent_map[$row_board['id_parent']]) && !$row_board['is_redirect']) {
                $parent_map[$row_board['id_parent']][0]['posts'] += $row_board['num_posts'];
                $parent_map[$row_board['id_parent']][0]['topics'] += $row_board['num_topics'];
                $parent_map[$row_board['id_parent']][1]['posts'] += $row_board['num_posts'];
                $parent_map[$row_board['id_parent']][1]['topics'] += $row_board['num_topics'];
                continue;
            }
            continue;
        } else {
            continue;
        }
        // Prepare the subject, and make sure it's not too long.
        censorText($row_board['subject']);
        $row_board['short_subject'] = shorten_subject($row_board['subject'], 24);
        $this_last_post = array('id' => $row_board['id_msg'], 'time' => $row_board['poster_time'] > 0 ? timeformat($row_board['poster_time']) : $txt['not_applicable'], 'timestamp' => forum_time(true, $row_board['poster_time']), 'subject' => $row_board['short_subject'], 'member' => array('id' => $row_board['id_member'], 'username' => $row_board['poster_name'] != '' ? $row_board['poster_name'] : $txt['not_applicable'], 'name' => $row_board['real_name'], 'href' => $row_board['poster_name'] != '' && !empty($row_board['id_member']) ? $scripturl . '?action=profile;u=' . $row_board['id_member'] : '', 'link' => $row_board['poster_name'] != '' ? !empty($row_board['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['id_member'] . '">' . $row_board['real_name'] . '</a>' : $row_board['real_name'] : $txt['not_applicable']), 'start' => 'msg' . $row_board['new_from'], 'topic' => $row_board['id_topic']);
        // Provide the href and link.
        if ($row_board['subject'] != '') {
            $this_last_post['href'] = $scripturl . '?topic=' . $row_board['id_topic'] . '.msg' . ($user_info['is_guest'] ? $row_board['id_msg'] : $row_board['new_from']) . (empty($row_board['is_read']) ? ';boardseen' : '') . '#new';
            $this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>';
        } else {
            $this_last_post['href'] = '';
            $this_last_post['link'] = $txt['not_applicable'];
        }
        // Set the last post in the parent board.
        if ($row_board['id_parent'] == $boardIndexOptions['parent_id'] || $isChild && !empty($row_board['poster_time']) && $this_category[$row_board['id_parent']]['last_post']['timestamp'] < forum_time(true, $row_board['poster_time'])) {
            $this_category[$isChild ? $row_board['id_parent'] : $row_board['id_board']]['last_post'] = $this_last_post;
        }
        // Just in the child...?
        if ($isChild) {
            $this_category[$row_board['id_parent']]['children'][$row_board['id_board']]['last_post'] = $this_last_post;
            // If there are no posts in this board, it really can't be new...
            $this_category[$row_board['id_parent']]['children'][$row_board['id_board']]['new'] &= $row_board['poster_name'] != '';
        } elseif ($row_board['poster_name'] == '') {
            $this_category[$row_board['id_board']]['new'] = false;
        }
        // Determine a global most recent topic.
        if (!empty($boardIndexOptions['set_latest_post']) && !empty($row_board['poster_time']) && $row_board['poster_time'] > $latest_post['timestamp'] && !$ignoreThisBoard) {
            $latest_post = array('timestamp' => $row_board['poster_time'], 'ref' => &$this_category[$isChild ? $row_board['id_parent'] : $row_board['id_board']]['last_post']);
        }
    }
    $smcFunc['db_free_result']($result_boards);
    // By now we should know the most recent post...if we wanna know it that is.
    if (!empty($boardIndexOptions['set_latest_post']) && !empty($latest_post['ref'])) {
        $context['latest_post'] = $latest_post['ref'];
    }
    return $boardIndexOptions['include_categories'] ? $categories : $this_category;
}
开发者ID:sk8rdude461,项目名称:moparscape.org-smf,代码行数:101,代码来源:Subs-BoardIndex.php


示例8: template_boardindex_outer_below

function template_boardindex_outer_below()
{
    global $modSettings;
    // Info center collapse object.
    echo '</td></tr></tbody></table>';
    if (!empty($modSettings['sideright'])) {
        echo '<td valign="top" id="upshrinkRightBarTD">
				<div id="upshrinkRightBar" style="width:', $modSettings['siderightwidth'] ? $modSettings['siderightwidth'] : '200px', '; overflow:hidden;">
				', empty($modSettings['sideright1']) ? '' : '<div class="cat_bar"><h3 class="catbg">' . $modSettings['righthtmlbaslik'] . '</h3></div>' . $modSettings['sideright1'] . '', '
				', empty($modSettings['siderightphp']) ? '' : '<div class="cat_bar"><h3 class="catbg">' . $modSettings['rightphpbaslik'] . '</h3></div>';
        eval($modSettings['siderightphp']);
        if (!empty($modSettings['siderighthaberetkin'])) {
            $array = ssi_boardNews($modSettings['siderighthaber'], $modSettings['siderightsay'], null, 1000, 'array');
            echo '<div class="cat_bar">
							<h3 class="catbg">', $modSettings['rbaslik'], '</h3>
						</div>';
            global $memberContext;
            foreach ($array as $news) {
                loadMemberData($news['poster']['id']);
                loadMemberContext($news['poster']['id']);
                echo '<div class="sidehaber">
								<div class="sideBaslik">
								
								<h3><a href="', $news['href'], '"><span class="generic_icons sort_up"></span> ', shorten_subject($news['subject'], 30), '</a></h3>
								</div>
								<div class="snrj"> ', $memberContext[$news['poster']['id']]['avatar']['image'], ' 
								<p>', $txt['by'], '', $news['poster']['link'], '</p>
								</div>
								</div>';
            }
        }
        echo '</div>
			</td>
			<td valign="top">
			<button type="button" onclick="rightPanel.toggle();" id="teknoright"></button>
			</td>';
    }
    echo '</td>
		</tr></tbody></table>';
    template_info_center();
}
开发者ID:CeeMoo,项目名称:pisi,代码行数:41,代码来源:BoardIndex.template.php


示例9: adk_ultimosmensajes

function adk_ultimosmensajes()
{
    global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
    global $modSettings, $smcFunc, $adkportal, $boardurl, $adkFolder;
    //SSI FUNCTION
    $exclude_boards = null;
    $include_boards = null;
    $num_recent = !empty($adkportal['adk_two_column']) ? $adkportal['ultimos_mensajes'] * 2 : $adkportal['ultimos_mensajes'];
    $output_method = 'array';
    if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0) {
        $exclude_boards = array($modSettings['recycle_board']);
    } else {
        $exclude_boards = empty($exclude_boards) ? array() : (is_array($exclude_boards) ? $exclude_boards : array($exclude_boards));
    }
    // Only some boards?.
    if (is_array($include_boards) || (int) $include_boards === $include_boards) {
        $include_boards = is_array($include_boards) ? $include_boards : array($include_boards);
    } elseif ($include_boards != null) {
        $output_method = $include_boards;
        $include_boards = array();
    }
    $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
    $icon_sources = array();
    foreach ($stable_icons as $icon) {
        $icon_sources[$icon] = 'images_url';
    }
    // Find all the posts in distinct topics.  Newer ones will have higher IDs.
    $request = $smcFunc['db_query']('substring', '
		SELECT
			m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name, t.num_replies, t.num_views,
			mem.avatar,
			mg.online_color,
			IFNULL(a.id_attach, 0) AS id_attach, a.filename, a.attachment_type,
			IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
			IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
			IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', SUBSTRING(m.body, 1, 384) AS body, m.smileys_enabled, m.icon
		FROM {db_prefix}topics AS t
			INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
			INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
			INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '
			LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
			LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
			LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
			LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = {int:reg_mem_group} THEN mem.id_post_group ELSE mem.id_group END)
		WHERE t.id_last_msg >= {int:min_message_id}
			' . (empty($exclude_boards) ? '' : '
			AND b.id_board NOT IN ({array_int:exclude_boards})') . '
			' . (empty($include_boards) ? '' : '
			AND b.id_board IN ({array_int:include_boards})') . '
			AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
			AND t.approved = {int:is_approved}
			AND m.approved = {int:is_approved}' : '') . '
		ORDER BY t.id_last_msg DESC
		LIMIT ' . $num_recent, array('current_member' => $user_info['id'], 'include_boards' => empty($include_boards) ? '' : $include_boards, 'exclude_boards' => empty($exclude_boards) ? '' : $exclude_boards, 'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5), 'is_approved' => 1, 'reg_mem_group' => 0));
    $posts = array();
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '&#10;')));
        if ($smcFunc['strlen']($row['body']) > 128) {
            $row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';
        }
        // Censor the subject.
        censorText($row['subject']);
        censorText($row['body']);
        if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']])) {
            $icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';
        }
        // Build the array.
        $posts[] = array('board' => array('id' => $row['id_board'], 'name' => $row['board_name'], 'href' => $scripturl . '?board=' . $row['id_board'] . '.0', 'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'), 'avatar' => $row['avatar'] == '' ? $row['id_attach'] > 0 ? '<img width="50" height="50" src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" border="0" />' : '' : (stristr($row['avatar'], 'http://') ? '<img width="50" height="50" src="' . $row['avatar'] . '" alt="" border="0" />' : '<img width="50" height="50" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar']) . '" alt="" border="0" />'), 'topic' => $row['id_topic'], 'poster' => array('id' => $row['id_member'], 'name' => $row['poster_name'], 'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'], 'link' => empty($row['id_member']) ? '<b>' . $row['poster_name'] . '</b>' : '<a style="color: ' . $row['online_color'] . '; font-weight: bold;" href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'), 'online_color' => $row['online_color'], 'subject' => $row['subject'], 'replies' => $row['num_replies'], 'views' => $row['num_views'], 'short_subject' => shorten_subject($row['subject'], 25), 'preview' => $row['body'], 'time' => timeformat($row['poster_time']), 'timestamp' => forum_time(true, $row['poster_time']), 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new', 'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new" rel="nofollow">' . $row['subject'] . '</a>', 'new' => !empty($row['is_read']), 'is_new' => empty($row['is_read']), 'new_from' => $row['new_from'], 'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />');
    }
    $smcFunc['db_free_result']($request);
    echo '
		<table style="width: 100%;">';
    if (!empty($adkportal['adk_two_column'])) {
        $i = 0;
        echo '
			<tr>';
    }
    if (!empty($posts)) {
        $u = 1;
        $totales = count($posts);
        foreach ($posts as $Output) {
            $ID_TOPIC = $Output['topic'];
            $subject = $Output['subject'];
            $posterTime = !empty($adkportal['adk_two_column']) ? timeformat($Output['timestamp'], '%d/%m - %H:%M:%S') : $Output['time'];
            $id_member = $Output['poster']['id'];
            $href_last = $Output['href'];
            if ($id_member == 0) {
                $MEMBER_STARTED = $Output['poster']['link'];
                $avatar = '<img src="' . $adkFolder['images'] . '/noavatar.jpg" class="adk_avatar" alt="" />';
            } else {
                $MEMBER_STARTED = $Output['poster']['link'];
                if (!empty($Output['avatar'])) {
                    $avatar = $Output['avatar'];
                } else {
                    $avatar = '<img src="' . $adkFolder['images'] . '/noavatar.jpg" class="adk_avatar" alt="" />';
                }
            }
            if (!empty($adkportal['adk_two_column'])) {
                if ($i == 2) {
//.........这里部分代码省略.........
开发者ID:lucasruroken,项目名称:adkportal,代码行数:101,代码来源:Subs-adkblocks.php


示例10: tp_recentTopics

function tp_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo')
{
    global $context, $settings, $scripturl, $txt, $db_prefix, $user_info;
    global $modSettings, $smcFunc;
    if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0) {
        $exclude_boards = array($modSettings['recycle_board']);
    } else {
        $exclude_boards = empty($exclude_boards) ? array() : (is_array($exclude_boards) ? $exclude_boards : array($exclude_boards));
    }
    // Only some boards?.
    if (is_array($include_boards) || (int) $include_boards === $include_boards) {
        $include_boards = is_array($include_boards) ? $include_boards : array($include_boards);
    } elseif ($include_boards != null) {
        $output_method = $include_boards;
        $include_boards = array();
    }
    // Find all the posts in distinct topics.  Newer ones will have higher IDs.
    $request = $smcFunc['db_query']('substring', '
		SELECT
			m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name, t.num_replies, t.num_views,
			IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
			IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
			IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', SUBSTRING(m.body, 1, 384) AS body, m.smileys_enabled, m.icon,
			IFNULL(a.id_attach, 0) AS ID_ATTACH, a.filename, a.attachment_type as attachmentType,  mem.avatar as avy
		FROM {db_prefix}topics AS t
			INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
			INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
			INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '
			LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
			LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
			LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)

		WHERE t.id_last_msg >= {int:min_message_id}
			' . (empty($exclude_boards) ? '' : '
			AND b.id_board NOT IN ({array_int:exclude_boards})') . '

			' . (empty($include_boards) ? '' : '
			AND b.id_board IN ({array_int:include_boards})') . '

			AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
			AND t.approved = {int:is_approved}
			AND m.approved = {int:is_approved}' : '') . '

		ORDER BY t.id_last_msg DESC
		LIMIT ' . $num_recent, array('current_member' => $user_info['id'], 'include_boards' => empty($include_boards) ? '' : $include_boards, 'exclude_boards' => empty($exclude_boards) ? '' : $exclude_boards, 'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5), 'is_approved' => 1));
    $posts = array();
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        $row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '&#10;')));
        if ($smcFunc['strlen']($row['body']) > 128) {
            $row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';
        }
        // Censor the subject.
        censorText($row['subject']);
        censorText($row['body']);
        // Build the array.
        $posts[] = array('board' => array('id' => $row['id_board'], 'name' => $row['board_name'], 'href' => $scripturl . '?board=' . $row['id_board'] . '.0', 'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'), 'topic' => $row['id_topic'], 'poster' => array('id' => $row['id_member'], 'name' => $row['poster_name'], 'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'], 'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>', 'avatar' => $row['avy'] == '' ? $row['ID_ATTACH'] > 0 ? '<img src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="recent_avatar" border="0" />' : '' : (stristr($row['avy'], 'http://') ? '<img src="' . $row['avy'] . '" alt="" class="recent_avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avy'], ENT_QUOTES) . '" alt="" class="recent_avatar" border="0" />')), 'subject' => $row['subject'], 'short_subject' => shorten_subject($row['subject'], 25), 'time' => timeformat($row['poster_time']), 'timestamp' => forum_time(true, $row['poster_time']), 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new', 'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new" rel="nofollow">' . $row['subject'] . '</a>', 'new' => !empty($row['is_read']), 'is_new' => empty($row['is_read']), 'new_from' => $row['new_from']);
    }
    $smcFunc['db_free_result']($request);
    return $posts;
}
开发者ID:DiegoCortes,项目名称:TinyPortal,代码行数:61,代码来源:TPSubs.php


示例11: ssi_getSDTickets

/**
 *	Gets tickets based on supplied criteria; this is a helper function not really intended to be called directly.
 *
 *	@todo Finish writing and documenting this function.
 *	@param string $query_where SQL clauses to be supplied to the query in addition to {query_see_ticket} - note 'AND' is not required at the start.
 *	@param array $query_where_params Key/value associative array to be injected into the query, related to $query_where.
 *	@param int $query_limit Number of items to limit the query to.
 *	@param string $query_order The clause to order tickets by, defaults to tickets by order of creation.
 *	@return array An array of arrays, each primary item containing the following:
 *	<ul>
 *	<li>id: Main ticket id</li>
 *	<li>display_id: Formatted ticket id in [0000x] format</li>
 *	<li>subject: Ticket subject</li>
 *	<li>short_subject: Shortened version of ticket subject</li>
 *	<li>href: Ticket href</li>
 *	<li>opener: array of details about the ticket starter:
 *		<ul>
 *			<li>id: user id of the person who opened the ticket</li>
 *			<li>name: username of the person who opened the ticket</li>
 *			<li>link: link to the profile of the person who opened the ticket</li>
 *		</ul>
 *	</li>
 *	<li>replier: array of details about the last person to reply to the ticket:
 *		<ul>
 *			<li>id: user id of the last person to reply to the ticket</li>
 *			<li>name: username of the last person to reply to the ticket</li>
 *			<li>link: link to the profile of the last person to reply to the ticket</li>
 *		</ul>
 *	</li>
 *	<li>assigned: array of details about the person who the ticket is assigned to:
 *		<ul>
 *			<li>id: user id of the person who the ticket is assigned to</li>
 *			<li>name: username of the person who the ticket is assigned to or 'Unassigned' otherwise</li>
 *			<li>link: link to the profile of the person  who the ticket is assigned to or 'Unassigned' otherwise</li>
 *		</ul>
 *	</li>
 *	<li>num_replies: Number of replies in the ticket</li>
 *	<li>start_time: Formatted string of time the ticket was opened</li>
 *	<li>start_timestamp: Raw timestamp (adjusted for timezones) of ticket being opened</li>
 *	<li>last_time: Formatted string of time the ticket was last replied to</li>
 *	<li>last_timestamp: Raw timestamp (adjusted for timezones) of ticket's last reply</li>
 *	<li>private: Whether the ticket is private or not</li>
 *	<li>urgency_id: Number representing ticket urgency</li>
 *	<li>urgency_string: String representing ticket urgency</li>
 *	<li>status_id: Number representing ticket status</li>
 *	<li>status_text: String representing ticket status</li>
 *  <li>department: Number representing ticket department ID</li>
 *	</ul>
 *	@since 2.0
*/
function ssi_getSDTickets($query_where, $query_where_params = array(), $query_limit = 0, $query_order = 'hdt.id_ticket ASC', $output_method = 'echo')
{
    global $smcFunc, $scripturl, $txt, $modSettings;
    $query_limit = (int) $query_limit;
    $query = shd_db_query('', '
		SELECT hdt.id_ticket, hdt.subject, hdt.num_replies, hdt.private, hdt.urgency, hdt.status, hdt.dept,
			hdtr_first.poster_time AS start_time, hdt.last_updated AS last_time,
			IFNULL(mem.real_name, hdtr_first.poster_name) AS starter_name, IFNULL(mem.id_member, 0) AS starter_id,
			IFNULL(ma.real_name, 0) AS assigned_name, IFNULL(ma.id_member, 0) AS assigned_id,
			IFNULL(mm.real_name, hdtr_last.modified_name) AS modified_name, IFNULL(mm.id_member, 0) AS modified_id
		FROM {db_prefix}helpdesk_tickets AS hdt
			INNER JOIN {db_prefix}helpdesk_ticket_replies AS hdtr_first ON (hdt.id_first_msg = hdtr_first.id_msg)
			INNER JOIN {db_prefix}helpdesk_ticket_replies AS hdtr_last ON (hdt.id_last_msg = hdtr_last.id_msg)
			LEFT JOIN {db_prefix}members AS mem ON (hdt.id_member_started = mem.id_member)
			LEFT JOIN {db_prefix}members AS ma ON (hdt.id_member_assigned = ma.id_member)
			LEFT JOIN {db_prefix}members AS mm ON (hdt.id_member_updated = mm.id_member)
		WHERE {query_see_ticket} AND ' . $query_where . '
		ORDER BY ' . $query_order . '
		' . ($query_limit == 0 ? '' : 'LIMIT ' . $query_limit), array_merge($query_where_params, array()));
    $tickets = array();
    while ($row = $smcFunc['db_fetch_assoc']($query)) {
        censorText($row['subject']);
        $tickets[] = array('id' => $row['id_ticket'], 'display_id' => str_pad($row['id_ticket'], $modSettings['shd_zerofill'], '0', STR_PAD_LEFT), 'subject' => $row['subject'], 'short_subject' => shorten_subject($row['subject'], 25), 'href' => $scripturl . '?action=helpdesk;sa=ticket;ticket=' . $row['id_ticket'], 'opener' => array('id' => $row['starter_i 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP shorten_text函数代码示例发布时间:2022-05-24
下一篇:
PHP shortenTextDisplay函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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