示例#1
0
            $extcredits = $_DCACHE['settings']['extcredits'];
            $creditstransextra = $_DCACHE['settings']['creditstransextra'];
            $rewardend = $thread['price'] > 0;
            $rewardprice = abs($thread['price']);
            $message = cutmessage($db->result_first("SELECT message FROM {$tablepre}posts WHERE tid='{$tid}' AND first=1"), 100);
        } elseif ($thread['special'] == 4) {
            $message = cutmessage($db->result_first("SELECT message FROM {$tablepre}posts WHERE tid='{$tid}' AND first=1"), 100);
            $number = $db->result_first("SELECT number FROM {$tablepre}activities WHERE tid='{$tid}'");
            $applynumbers = $db->result_first("SELECT COUNT(*) FROM {$tablepre}activityapplies WHERE tid='{$tid}' AND verified=1");
            $aboutmembers = $number - $applynumbers;
        } elseif ($thread['special'] == 5) {
            $message = cutmessage($db->result_first("SELECT message FROM {$tablepre}posts WHERE tid='{$tid}' AND first=1"), 100);
            $debate = $db->fetch_first("SELECT affirmdebaters, negadebaters, affirmvotes, negavotes FROM {$tablepre}debates WHERE tid='{$tid}'");
            $debate['affirmvoteswidth'] = $debate['affirmvotes'] ? intval(80 * (($debate['affirmvotes'] + 1) / ($debate['affirmvotes'] + $debate['negavotes'] + 1))) : 1;
            $debate['negavoteswidth'] = $debate['negavotes'] ? intval(80 * (($debate['negavotes'] + 1) / ($debate['affirmvotes'] + $debate['negavotes'] + 1))) : 1;
        } elseif ($thread['special'] == 6) {
            require_once DISCUZ_ROOT . './api/video.php';
            $video = $db->fetch_first("SELECT vid, vtitle, vthumb FROM {$tablepre}videos WHERE tid='{$tid}' ORDER BY displayorder LIMIT 1");
            $video['vthumb'] = VideoClient_Util::getThumbUrl($video['vid'], 'small');
        } else {
            $message = cutmessage($db->result_first("SELECT message FROM {$tablepre}posts WHERE tid='{$tid}' AND first=1"), 100);
        }
    }
    include template('request_thread');
} else {
    $request_version = '1.0';
    $request_name = $requestlang['thread_name'];
    $request_description = $requestlang['thread_desc'];
    $request_copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>';
    $request_settings = array('tid' => array($requestlang['thread_id'], '', 'text'));
}
             $feed['body_template'] = 'feed_thread_activity_message';
             $feed['body_data'] = array('subject' => "<a href=\"{$boardurl}viewthread.php?tid={$tid}\">{$subject}</a>", 'starttimefrom' => $starttimefrom[$activitytime], 'activityplace' => $activityplace, 'cost' => $cost, 'message' => cutstr(strip_tags(preg_replace(array("/\\[hide=?\\d*\\].+?\\[\\/hide\\]/is", "/\\[.+?\\]/is"), array('', ''), $message)), 150));
         } elseif ($special == 5) {
             $feed['icon'] = 'debate';
             $feed['title_template'] = 'feed_thread_debate_title';
             $feed['body_template'] = 'feed_thread_debate_message';
             $feed['body_data'] = array('subject' => "<a href=\"{$boardurl}viewthread.php?tid={$tid}\">{$subject}</a>", 'message' => cutstr(strip_tags(preg_replace(array("/\\[hide=?\\d*\\].+?\\[\\/hide\\]/is", "/\\[.+?\\]/is"), array('', ''), $message)), 150), 'affirmpoint' => cutstr(strip_tags(preg_replace("/\\[.+?\\]/is", '', $affirmpoint)), 150), 'negapoint' => cutstr(strip_tags(preg_replace("/\\[.+?\\]/is", '', $negapoint)), 150));
         } elseif ($special == 6) {
             $feed['icon'] = 'video';
             $feed['title_template'] = 'feed_thread_video_title';
             $feed['body_template'] = 'feed_thread_video_message';
             $feed['body_data'] = array('subject' => "<a href=\"{$boardurl}viewthread.php?tid={$tid}\">{$subject}</a>", 'play' => "<a href=\"{$boardurl}viewthread.php?tid={$tid}\" class=\"playbutton\">Play</a>", 'message' => cutstr(strip_tags(preg_replace(array("/\\[hide=?\\d*\\].+?\\[\\/hide\\]/is", "/\\[.+?\\]/is"), array('', ''), $message)), 150), 'vlength' => sprintf("%02d", intval($vlength / 60)) . ':' . sprintf("%02d", intval($vlength % 60)));
         }
     }
     if ($special == 6) {
         $feed['images'][] = array('url' => VideoClient_Util::getThumbUrl($vid, 'small'), 'link' => "{$boardurl}viewthread.php?tid={$tid}");
     } else {
         if (in_array($attachments[1]['type'], array('image/gif', 'image/jpeg', 'image/png'))) {
             $attachurl = preg_match("/^((https?|ftps?):\\/\\/|www\\.)/i", $attachurl) ? $attachurl : $boardurl . $attachurl;
             $imgurl = $attachurl . '/' . $attachments[1]['attachment'] . ($attachments[1]['thumb'] && $attachments[1]['type'] != 'image/gif' ? '.thumb.jpg' : '');
             $feed['images'][] = $attachments[1]['attachment'] ? array('url' => $imgurl, 'link' => "{$boardurl}viewthread.php?tid={$tid}") : array();
         }
     }
     if ($feed) {
         postfeed($feed);
     }
 }
 if ($digest) {
     foreach ($digestcredits as $id => $addcredits) {
         $postcredits[$id] = (isset($postcredits[$id]) ? $postcredits[$id] : 0) + $addcredits;
     }
示例#3
0
        $multipage = multi($num, $tpp, $page, "my.php?item=debate&amp;type=reply{$extrafid}");
        $query = $db->query("SELECT m.dateline, t.tid, t.fid, t.subject, t.displayorder, t.closed\r\n\t\t\tFROM {$tablepre}myposts m, {$tablepre}threads t\r\n\t\t\tWHERE m.uid='{$discuz_uid}' AND m.special='5' AND m.tid=t.tid {$threadadd}\r\n\t\t\tORDER BY m.dateline DESC LIMIT {$start_limit}, {$tpp}");
        while ($debate = $db->fetch_array($query)) {
            $debate['dateline'] = dgmdate("{$dateformat} {$timeformat}", $debate['dateline'] + $timeoffset * 3600);
            $debate['forumname'] = $_DCACHE['forums'][$debate['fid']]['name'];
            $debatelist[] = $debate;
        }
    }
} elseif ($item == 'video') {
    require_once DISCUZ_ROOT . './api/video.php';
    $videolist = array();
    $num = $db->result_first("SELECT COUNT(*) FROM {$tablepre}videos WHERE uid='{$discuz_uid}'");
    $multipage = multi($num, $tpp, $page, "my.php?item=video");
    $query = $db->query("SELECT * FROM {$tablepre}videos WHERE uid='{$discuz_uid}' ORDER BY dateline DESC LIMIT {$start_limit}, {$tpp}");
    while ($video = $db->fetch_array($query)) {
        $video['vthumb'] = !$videoinfo['vthumb'] ? VideoClient_Util::getThumbUrl($video['vid'], 'small') : $videoinfo['vthumb'];
        $video['dateline'] = dgmdate("{$dateformat} {$timeformat}", $video['dateline'] + $timeoffset * 3600);
        $video['vtime'] = $video['vtime'] ? sprintf("%02d", intval($video['vtime'] / 60)) . ':' . sprintf("%02d", intval($video['vtime'] % 60)) : '';
        $videolist[] = $video;
    }
    $videonum = count($videolist);
    $videoendrows = '';
    if ($colspan = $videonum % 2) {
        while ($colspan - 2 < 0) {
            $videoendrows .= '<td></td>';
            $colspan++;
        }
        $videoendrows .= '</tr>';
    }
} elseif ($item == 'buddylist') {
    include_once DISCUZ_ROOT . './uc_client/client.php';