示例#1
0
 $cur_post = $db->fetch_assoc($result);
 if ($owner != $pun_user['id']) {
     message($lang_common['No permission']);
 }
 if (!$cur_post['showed']) {
     $db->query('UPDATE ' . $db->prefix . 'messages SET showed=1 WHERE id=' . $id) or error('Unable to update message info', __FILE__, __LINE__, $db->error());
 }
 if ($cur_post['id'] > 0) {
     $username = '******' . $cur_post['id'] . '">' . pun_htmlspecialchars($cur_post['username']) . '</a>';
     $user_title = get_title($cur_post);
     if ($pun_config['o_censoring'] == 1) {
         $user_title = censor_words($user_title);
     }
     // Format the online indicator
     $is_online = $cur_post['is_online'] == $cur_post['id'] ? '<strong>' . $lang_topic['Online'] . '</strong>' : $lang_topic['Offline'];
     $user_avatar = pun_show_avatar();
     // We only show location, register date, post count and the contact links if "Show user info" is enabled
     if ($pun_config['o_show_user_info'] == 1) {
         if ($cur_post['location']) {
             if ($pun_config['o_censoring'] == 1) {
                 $cur_post['location'] = censor_words($cur_post['location']);
             }
             $user_info[] = '<dd>' . $lang_topic['From'] . ': ' . pun_htmlspecialchars($cur_post['location']);
         }
         $user_info[] = '<dd>' . $lang_common['Registered'] . ': ' . date($pun_config['o_date_format'], $cur_post['registered']);
         if ($pun_config['o_show_post_count'] == 1 || $pun_user['g_id'] < PUN_GUEST) {
             $user_info[] = '<dd>' . $lang_common['Posts'] . ': ' . $cur_post['num_posts'];
         }
         // Now let's deal with the contact links (E-mail and URL)
         if (!$cur_post['email_setting'] && !$pun_user['is_guest'] || $pun_user['g_id'] < PUN_GUEST) {
             $user_contacts[] = '<a href="mailto:' . $cur_post['email'] . '">' . $lang_common['E-mail'] . '</a>';
示例#2
0
         $smarty->assign('birthday', $birthday);
     }
     $smarty->display('profile.personal.tpl');
     exit;
 } else {
     if ($section == 'messaging') {
         $smarty->display('profile.messaging.tpl');
         exit;
     } else {
         if ($section == 'personality') {
             $smarty->assign('parsed_signature', @$parsed_signature);
             $pun_config['o_avatars'] = 1;
             $cur_post['use_avatar'] = 1;
             $pun_user['show_avatars'] = 1;
             $cur_post['poster_id'] = $id;
             $smarty->assign('user_avatar', pun_show_avatar());
             $smarty->display('profile.personality.tpl');
             exit;
         } else {
             if ($section == 'display') {
                 $styles = array();
                 $d = opendir(PUN_ROOT . 'include/template/wap');
                 while (false !== ($entry = readdir($d))) {
                     if ($entry[0] !== '.' && is_dir(PUN_ROOT . 'include/template/wap/' . $entry)) {
                         $styles[] = $entry;
                     }
                 }
                 closedir($d);
                 $smarty->assign('styles', $styles);
                 $smarty->display('profile.display.tpl');
                 exit;
示例#3
0
// hcs AJAX POLL MOD END
$bg_switch = true;
// Used for switching background color in posts
$post_count = 0;
// Keep track of post numbers
// Retrieve the posts (and their respective poster/online status)
$result = $db->query('
    SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online
    FROM ' . $db->prefix . 'posts AS p
    INNER JOIN ' . $db->prefix . 'users AS u ON u.id=p.poster_id
    INNER JOIN ' . $db->prefix . 'groups AS g ON g.g_id=u.group_id
    LEFT JOIN ' . $db->prefix . 'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0)
    WHERE p.id=' . $pid) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
$cur_post = $db->fetch_assoc($result);
$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies'], $cur_post['id']);
$cur_post['user_avatar'] = pun_show_avatar();
$db->free_result($result);
$karma = array();
if ($pun_config['o_show_post_karma'] == 1 || $pun_user['g_id'] < PUN_GUEST) {
    $karmaCount = $db->query('SELECT COUNT(1), ' . '(SELECT COUNT(1) ' . 'FROM `' . $db->prefix . 'karma` ' . 'WHERE `vote` = "-1" AND `to` = ' . $cur_post['poster_id'] . ') ' . 'FROM `' . $db->prefix . 'karma` ' . 'WHERE `vote` = "1" AND `to` = ' . $cur_post['poster_id']);
    $karma = $db->fetch_row($karmaCount);
    $cur_post['karma']['val'] = (int) $karma[0] - (int) $karma[1];
    $karmaVoteAccess = $db->query('SELECT 1 ' . 'FROM `' . $db->prefix . 'karma` ' . 'WHERE `id`=' . $pun_user['id'] . ' AND `to`=' . $cur_post['poster_id'] . ' LIMIT 1');
    $cur_post['karma']['used'] = $pun_user['is_guest'] || $db->num_rows($karmaVoteAccess);
}
// Retrieve the attachments
require PUN_ROOT . 'include/attach/fetch.php';
// Increment "num_views" for topic
$db->query('UPDATE ' . $db->prefix . 'topics SET num_views=num_views+1 WHERE id=' . $id) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
$smarty->assign('show_poll', $show_poll);
$smarty->assign('pun_start', $pun_start);
示例#4
0
     $cur_post['user_avatar'] = pun_show_avatar();
 }
 if ($pun_user['g_pm_limit'] && $pun_user['g_id'] > PUN_GUEST) {
     // Get total message count
     $result = $db->query('SELECT COUNT(1) FROM ' . $db->prefix . 'messages WHERE owner=' . $pun_user['id']) or error('Unable to count messages', __FILE__, __LINE__, $db->error());
     list($tot_messages) = $db->fetch_row($result);
     $proc = ceil($tot_messages / $pun_user['g_pm_limit'] * 100);
 }
 // Fetch messages
 $result = $db->query('SELECT * FROM ' . $db->prefix . 'messages WHERE owner=' . $pun_user['id'] . ' AND status=' . $box . ' ORDER BY posted DESC ' . $limit) or error('Unable to fetch messages list for forum', __FILE__, __LINE__, $db->error());
 // If there are messages in this folder.
 if ($all = $db->num_rows($result)) {
     $messages = array();
     while ($cur_mess = $db->fetch_assoc($result)) {
         $cur_mess['message'] = parse_message($cur_mess['message'], !$cur_mess['smileys'], $cur_mess['id']);
         $cur_mess['user_avatar'] = pun_show_avatar();
         $messages[] = $cur_mess;
     }
 }
 if (@$_GET['action'] == 'all') {
     $p = $num_pages + 1;
 }
 $page_links = paginate($num_pages, $p, 'message_list.php?box=' . $box);
 ////////
 $smarty->assign('cur_post', @$cur_post);
 $smarty->assign('pun_user', $pun_user);
 $smarty->assign('lang_topic', $lang_topic);
 $smarty->assign('status', @$status);
 $smarty->assign('lang_pms', $lang_pms);
 $smarty->assign('messages', @$messages);
 $smarty->assign('p', $p);