Пример #1
0
             showmessage('article_push_invalid_private');
         }
         $article['title'] = getstr($blog['subject'], 0);
         $article['summary'] = portalcp_get_summary($blog['message']);
         $article['fromurl'] = 'home.php?mod=space&uid=' . $blog[uid] . '&do=blog&id=' . $blog[blogid];
         $article['author'] = $blog['username'];
         $article_content['content'] = dhtmlspecialchars($blog['message']);
     }
     break;
 default:
     $posttable = getposttablebytid($_GET['from_id']);
     $thread = C::t('forum_thread')->fetch($_GET['from_id']);
     $thread = array_merge($thread, C::t('forum_post')->fetch_threadpost_by_tid_invisible($_GET['from_id']));
     if ($thread) {
         $article['title'] = $thread['subject'];
         $thread['message'] = portalcp_get_postmessage($thread, $_GET['getauthorall']);
         $article['summary'] = portalcp_get_summary($thread['message']);
         $article['fromurl'] = 'forum.php?mod=viewthread&tid=' . $thread['tid'];
         $article['author'] = $thread['author'];
         $article_content['content'] = dhtmlspecialchars($thread['message']);
         $article['attach_image'] = $article['attach_file'] = '';
         foreach (C::t('forum_attachment_n')->fetch_all_by_id('tid:' . $thread['tid'], 'pid', $thread['pid'], 'aid DESC') as $attach) {
             $attachcode = '[attach]' . $attach['aid'] . '[/attach]';
             if (!strexists($article_content['content'], $attachcode)) {
                 $article_content['content'] .= '<br /><br />' . $attachcode;
             }
             if ($attach['isimage']) {
                 if ($article['pic']) {
                     $attach['pic'] = $article['pic'];
                 }
             } else {
Пример #2
0
         if ($blog['friend']) {
             showmessage('article_push_invalid_private');
         }
         $article['title'] = getstr($blog['subject'], 0);
         $article['summary'] = portalcp_get_summary($blog['message']);
         $article['fromurl'] = 'home.php?mod=space&uid=' . $blog[uid] . '&do=blog&id=' . $blog[blogid];
         $article['author'] = $blog['username'];
         $article_content['content'] = dhtmlspecialchars($blog['message']);
     }
     break;
 default:
     $posttable = getposttablebytid($_GET['from_id']);
     $query = DB::query("SELECT t.*, p.* FROM " . DB::table('forum_thread') . " t\r\n\t\t\t\tLEFT JOIN " . DB::table($posttable) . " p ON p.tid=t.tid AND p.first='1'\r\n\t\t\t\tWHERE t.tid='{$_GET['from_id']}'");
     if ($thread = DB::fetch($query)) {
         $article['title'] = $thread['subject'];
         $thread['message'] = portalcp_get_postmessage($thread);
         $article['summary'] = portalcp_get_summary($thread['message']);
         $article['fromurl'] = 'forum.php?mod=viewthread&tid=' . $thread['tid'];
         $article['author'] = $thread['author'];
         $article_content['content'] = dhtmlspecialchars($thread['message']);
         $article['attach_image'] = $article['attach_file'] = '';
         $query = DB::query("SELECT * FROM " . DB::table(getattachtablebytid($thread['tid'])) . " WHERE pid='{$thread['pid']}' ORDER BY aid DESC");
         while ($attach = DB::fetch($query)) {
             $attachcode = '[attach]' . $attach['aid'] . '[/attach]';
             if (!strexists($article_content['content'], $attachcode)) {
                 $article_content['content'] .= '<br /><br />' . $attachcode;
             }
             if ($attach['isimage']) {
                 if ($article['pic']) {
                     $attach['pic'] = $article['pic'];
                 }