Example #1
0
function html_comments($pid)
{
    global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $username, $FAVPICS, $CURRENT_PIC_DATA, $THEME_DIR;
    global $template_image_comments, $template_add_your_comment, $db;
    $html = '';
    if (!$CONFIG['enable_smilies']) {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_no_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_smilies');
        template_extract_block($template_add_your_comment, 'input_box_smilies');
    } else {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_no_smilies');
        template_extract_block($template_add_your_comment, 'input_box_no_smilies');
    }
    $tmpl_comments_buttons = template_extract_block($template_image_comments, 'buttons', '{BUTTONS}');
    $tmpl_comments_ipinfo = template_extract_block($template_image_comments, 'ipinfo', '{IPINFO}');
    $result = $db->sql_query("SELECT msg_id, msg_author, msg_body, msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='{$pid}' ORDER BY msg_id ASC", false, __FILE__, __LINE__);
    while ($row = $db->sql_fetchrow($result)) {
        $user_can_edit = GALLERY_ADMIN_MODE || USER_ID > 1 && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS || USER_ID < 2 && USER_CAN_POST_COMMENTS && $USER['ID'] == $row['author_md5_id'];
        $comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
        $comment_edit_box = $user_can_edit ? $tmpl_comment_edit_box : '';
        $comment_ipinfo = $row['msg_raw_ip'] && GALLERY_ADMIN_MODE ? $tmpl_comments_ipinfo : '';
        if ($CONFIG['enable_smilies']) {
            $comment_body = set_smilies(make_clickable($row['msg_body']));
            $smilies = smilies_table('onerow', 'msg_body', "f{$row['msg_id']}");
        } else {
            $comment_body = make_clickable($row['msg_body']);
            $smilies = '';
        }
        $params = array('{EDIT}' => &$comment_edit_box, '{BUTTONS}' => &$comment_buttons, '{IPINFO}' => &$comment_ipinfo);
        $template = template_eval($template_image_comments, $params);
        $info = '';
        if (!in_array($pid, $FAVPICS)) {
            $info = '<a href="' . URL::index('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . ADDFAV . '</a>';
        } else {
            $info = '<a href="' . URL::index('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . REMFAV . '</a>';
        }
        $params = array('{MSG_AUTHOR}' => $row['msg_author'], '{MSG_ID}' => $row['msg_id'], '{MSG_TYPE}' => GALLERY_ADMIN_MODE ? 'text' : 'hidden', '{EDIT_TITLE}' => COM_EDIT_TITLE, '{CONFIRM_DELETE}' => CONFIRM_DELETE_COM, '{DELETE_LINK}' => URL::index("&amp;file=delete"), '{DELETE_TEXT}' => DELETE . ' ' . COMMENT, '{MSG_DATE}' => localised_date($row['msg_date'], COMMENT_DATE_FMT), '{MSG_BODY}' => &$comment_body, '{MSG_BODY_RAW}' => $row['msg_body'], '{OK}' => OK, '{SMILIES}' => $smilies, '{HDR_IP}' => NET::decode_ip($row['msg_hdr_ip']), '{RAW_IP}' => NET::decode_ip($row['msg_raw_ip']), '{ACTION}' => 'action="' . URL::index('&amp;file=db_input') . '" enctype="multipart/form-data" accept-charset="utf-8"', '{ADDFAVLINK}' => URL::index("&amp;file=addfav&amp;pid={$pid}"), '{ADDFAVTEXT}' => $info, '{THEMEDIR}' => $THEME_DIR);
        $html .= template_eval($template, $params);
    }
    if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments']) {
        if (USER_ID > 1) {
            $username_input = '<input type="hidden" name="msg_author" value="' . CPG_USERNAME . '" />';
            template_extract_block($template_add_your_comment, 'username_input', $username_input);
            // $username = '';
        } else {
            $username = isset($USER['name']) ? '"' . htmlprepare($USER['name']) . '"' : '"' . YOUR_NAME . '" onclick="javascript:this.value=\'\';"';
        }
        if (!in_array($pid, $FAVPICS)) {
            $info = '<a href="' . URL::index('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . ADDFAV . '</a>';
        } else {
            $info = '<a href="' . URL::index('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . REMFAV . '</a>';
        }
        $params = array('{ADD_YOUR_COMMENT}' => ADD_YOUR_COMMENT, '{NAME}' => COM_NAME, '{COMMENT}' => COMMENT, '{PIC_ID}' => $pid, '{username}' => $username, '{MAX_COM_LENGTH}' => $CONFIG['max_com_size'], '{OK}' => OK, '{SMILIES}' => '', '{ACTION}' => 'action="' . URL::index("&amp;file=db_input") . '" enctype="multipart/form-data" accept-charset="utf-8"', '{ADDFAVLINK}' => URL::index("&amp;file=addfav&amp;pid={$pid}"), '{ADDFAVTEXT}' => $info);
        if ($CONFIG['enable_smilies']) {
            $params['{SMILIES}'] = smilies_table('onerow', 'message', 'post');
        }
        //		if ($CONFIG['enable_smilies']) $params['{SMILIES}'] = generate_smilies();
        $html .= template_eval($template_add_your_comment, $params);
    }
    if (USER_ID > 1 or $CONFIG['allow_anon_fullsize'] or USER_IS_ADMIN) {
        return $html;
    }
}
Example #2
0
                 $temp_message .= substr($message, $end_html + 1, $grab_length);
                 $message = trim($temp_message);
             } else {
                 $message = preg_replace($highlight_match, '<span style="color:#FFA34F;"><b>\\1</b></span>', $message);
             }
         }
     }
     if (count($orig_word)) {
         $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
         $post_subject = $searchset[$i]['post_subject'] != "" ? preg_replace($orig_word, $replacement_word, $searchset[$i]['post_subject']) : $topic_title;
         $message = preg_replace($orig_word, $replacement_word, $message);
     } else {
         $post_subject = $searchset[$i]['post_subject'] != '' ? $searchset[$i]['post_subject'] : $topic_title;
     }
     if ($board_config['allow_smilies'] && $searchset[$i]['enable_smilies']) {
         $message = set_smilies($message);
     }
     $message = nl2br($message);
 }
 $poster = $searchset[$i]['user_id'] != ANONYMOUS ? '<a href="' . URL::index("Your_Account&amp;profile=" . $searchset[$i]['user_id']) . '">' : '';
 $poster .= $searchset[$i]['user_id'] != ANONYMOUS ? $searchset[$i]['username'] : ($searchset[$i]['post_username'] != "" ? $searchset[$i]['post_username'] : $lang['Guest']);
 $poster .= $searchset[$i]['user_id'] != ANONYMOUS ? '</a>' : '';
 if (is_user() && $searchset[$i]['post_time'] > $userdata['user_lastvisit']) {
     if (!empty($tracking_topics[$topic_id]) && !empty($tracking_forums[$forum_id])) {
         $topic_last_read = $tracking_topics[$topic_id] > $tracking_forums[$forum_id] ? $tracking_topics[$topic_id] : $tracking_forums[$forum_id];
     } else {
         if (!empty($tracking_topics[$topic_id]) || !empty($tracking_forums[$forum_id])) {
             $topic_last_read = !empty($tracking_topics[$topic_id]) ? $tracking_topics[$topic_id] : $tracking_forums[$forum_id];
         }
     }
     if ($searchset[$i]['post_time'] > $topic_last_read) {
Example #3
0
global $prefix, $db, $bgcolor1, $bgcolor2, $MAIN_CFG, $userinfo;
require_once 'includes/nbbcode.php';
$conf = $MAIN_CFG['Shoutblock'];
// Top half
$content = '<div style="border:0; height:' . $MAIN_CFG['Shoutblock']['height'] . 'px; width:100%; overflow:auto;">';
if ($conf['themecolors']) {
    $conf['color1'] = $bgcolor1;
    $conf['color2'] = $bgcolor2;
}
// Messages
$result = $db->sql_query('SELECT * FROM ' . $prefix . "_shoutblock ORDER BY id DESC LIMIT {$conf['number']}");
$bgcolor = $conf['color2'];
while ($row = $db->sql_fetchrow($result)) {
    $bgcolor = $bgcolor != $conf['color1'] ? $conf['color1'] : $conf['color2'];
    $content .= '<div style="background-color:' . $bgcolor . ';" class="content">';
    $row[2] = set_smilies($row[2]);
    $content .= '<a href="' . getlink('Your_Account&amp;profile=' . $row[1]) . "\"><b>{$row['1']}:</b></a>";
    $content .= " {$row['2']}<br />";
    if ($conf['date']) {
        $content .= formatDateTime($row[3], '%d-%b-%Y ');
    }
    // date
    if ($conf['time']) {
        $content .= formatDateTime($row[3], '%H:%M:%S');
    }
    // time
    $content .= '</div>';
}
$content .= '</div>';
// bottom half
if (!$conf['anonymouspost'] && !is_user()) {
Example #4
0
function decode_bb_all($text, $allowed = 0, $allow_html = false, $url = '')
{
    return set_smilies(decode_bbcode($text, $allowed, $allow_html), $url);
}
Example #5
0
function all_shouts()
{
    global $prefix, $db, $shoutconf, $userinfo;
    $result = $db->sql_query("SELECT * FROM " . $prefix . "_shoutblock ORDER BY id DESC");
    while ($row = $db->sql_fetchrow($result)) {
        echo '<div class="content">';
        $row[2] = set_smilies($row[2]);
        echo '<a href="' . getlink('Your_Account&amp;profile=' . $row[1]) . '"><strong>' . $row[1] . ':</strong></a>';
        if ($shoutconf['date']) {
            echo formatDateTime($row[3], '%d-%b-%Y ');
        }
        // date
        if ($shoutconf['time']) {
            echo formatDateTime($row[3], '%H:%M:%S');
        }
        // time
        echo '<br />' . $row[2] . '</div><hr />';
    }
    $db->sql_freeresult($result);
    $number = 0;
}
Example #6
0
     $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
     if ($user_sig != '') {
         $user_sig = str_replace('\\"', '"', substr(preg_replace('#(\\>(((?>([^><]+|(?R)))*)\\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
     }
     $message = str_replace('\\"', '"', substr(preg_replace('#(\\>(((?>([^><]+|(?R)))*)\\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));
 }
 # Replace newlines (we use this rather than nl2br because till recently it wasn't XHTML compliant)
 if ($user_sig != '') {
     $user_sig = '<br />_________________<br />' . $user_sig;
 }
 # added for dragonflycms.org 9/3/ 2004 10:41PM akamu
 if ($poster_id != ANONYMOUS && isset($postrow[$i]['server_specs'])) {
     if ($postrow[$i]['server_specs'] != '') {
         $user_sig .= '<br /><br /><span class="postdetails" style="color: #333399">' . $postrow[$i]['username'] . '\'s server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)<br />' . preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $postrow[$i]['server_specs']) . '</span>';
     } else {
         $user_sig .= '<br /><br /><span class="postdetails" style="color: #333399">' . $postrow[$i]['username'] . ' please enter your server specs in your user profile!</span> ' . set_smilies(' :cry: ');
     }
 }
 #	$message = str_replace("\n", "\n<br />\n", $message);
 # Editing information
 if ($postrow[$i]['post_edit_count']) {
     $l_edit_time_total = $postrow[$i]['post_edit_count'] == 1 ? $lang['Edited_time_total'] : $lang['Edited_times_total'];
     $l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $poster, create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time']), $postrow[$i]['post_edit_count']);
 } else {
     $l_edited_by = '';
 }
 # Again this will be handled by the templating code at some point
 $row_color = !($i % 2) ? $bgcolor1 : $bgcolor2;
 $row_class = !($i % 2) ? 'row1' : 'row2';
 $template->assign_block_vars('postrow', array('S_HAS_ATTACHMENTS' => isset($attachments['_' . $postrow[$i]['post_id']]), 'ROW_COLOR' => $row_color, 'ROW_CLASS' => $row_class, 'POSTER_NAME' => $poster, 'POSTER_RANK' => $poster_rank, 'RANK_IMAGE' => $rank_image, 'POSTER_JOINED' => $poster_joined, 'POSTER_POSTS' => $poster_posts, 'POSTER_FROM' => $poster_from, 'POSTER_AVATAR' => $poster_avatar, 'POSTER_BIO' => $poster_bio, 'POSTER_TZ' => $poster_timezone, 'POSTER_OCC' => $poster_occ, 'POSTER_INTERESTS' => $poster_interests, '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, 'PROFILE_IMG' => $profile_img, 'PROFILE' => $profile, 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, 'PM_IMG' => $pm_img, 'PM' => $pm, 'EMAIL_IMG' => $email_img, 'EMAIL' => $email, 'WWW_IMG' => $www_img, 'WWW' => $www, 'ICQ_STATUS_IMG' => $icq_status_img, 'ICQ_IMG' => $icq_img, 'ICQ' => $icq, 'AIM_IMG' => $aim_img, 'AIM' => $aim, 'MSN_IMG' => $msn_img, 'MSN' => $msn, 'YIM_IMG' => $yim_img, 'YIM' => $yim, 'GAL_IMG' => $gal_img, 'GAL' => $gal, 'EDIT_IMG' => $edit_img, 'EDIT' => $edit, 'QUOTE_IMG' => $quote_img, 'QUOTE' => $quote, 'IP_IMG' => $ip_img, 'IP' => $ip, 'DELETE_IMG' => $delpost_img, 'DELETE' => $delpost, 'L_MINI_POST_ALT' => $mini_post_alt, 'U_MINI_POST' => $mini_post_url, 'U_POST_ID' => $postrow[$i]['post_id']));
 if ($poster_id != ANONYMOUS && !$old_theme) {
Example #7
0
 }
 //$gallery_dir
 $gallery_url_prefix = $CONFIG['ecards_more_pic_target'];
 if ($CONFIG['make_intermediate'] && max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width']) {
     $n_picname = get_pic_url($row, 'normal');
     $image = $row['filepath'] . $CONFIG['normal_pfx'] . $row['filename'];
 } else {
     $n_picname = get_pic_url($row, 'fullsize');
     $image = $row['filepath'] . $row['filename'];
 }
 if (!stristr($n_picname, 'http:')) {
     $n_picname = $CONFIG['ecards_more_pic_target'] . "{$n_picname}";
 }
 $data = array('rn' => $_POST['recipient_name'], 'sn' => $_POST['sender_name'], 'se' => $_POST['sender_email'], 'p' => $n_picname, 'g' => $greetings, 'm' => $message);
 $encoded_data = urlencode(base64_encode(serialize($data)));
 $params = array('{LANG_DIR}' => CPG_TEXT_DIR, '{TITLE}' => sprintf(E_ECARD_TITLE, $sender_name), '{CHARSET}' => _CHARSET, '{VIEW_ECARD_TGT}' => URL::index("&amp;file=displayecard&amp;data={$encoded_data}", false, 1), '{VIEW_ECARD_LNK}' => VIEW_ECARD, '{PIC_URL}' => 'cid:the-image', '{IMG_PATH}' => $MAIN_CFG['global']['nukeurl'] . '/' . $THEME_DIR . '/images/', '{GREETINGS}' => $greetings, '{MESSAGE}' => nl2br(set_smilies($message, $MAIN_CFG['global']['nukeurl'])), '{SENDER_EMAIL}' => $sender_email, '{SENDER_NAME}' => $sender_name, '{VIEW_MORE_TGT}' => URL::index("", 1, 1), '{VIEW_MORE_LNK}' => VIEW_MORE_PICS);
 $message = template_eval($template_ecard, $params);
 $mail->IsHTML(true);
 $mail->AltBody = strip_tags($message);
 $mail->Body = $message;
 $ext = strtolower(substr($row['filename'], -3));
 if ($ext == "gif") {
     $type = "image/gif";
 } else {
     if ($ext == "png") {
         $type = "image/png";
     } else {
         $type = "image/jpeg";
     }
 }
 if (!$mail->AddEmbeddedImage($image, "the-image", "ecard.{$ext}", "base64", $type)) {
Example #8
0
         $preview_message = decode_bbcode($preview_message, 1, true);
     }
     if (!empty($orig_word)) {
         $preview_username = !empty($username) ? preg_replace($orig_word, $replacement_word, $preview_username) : '';
         $preview_subject = !empty($subject) ? preg_replace($orig_word, $replacement_word, $preview_subject) : '';
         $preview_message = !empty($preview_message) ? preg_replace($orig_word, $replacement_word, $preview_message) : '';
     }
     if ($user_sig != '') {
         $user_sig = make_clickable($user_sig);
     }
     $preview_message = make_clickable($preview_message);
     if ($smilies_on) {
         if ($userdata['user_allowsmile'] && $user_sig != '') {
             $user_sig = set_smilies($user_sig);
         }
         $preview_message = set_smilies($preview_message);
     }
     if ($attach_sig && $user_sig != '') {
         $preview_message = $preview_message . '<br /><br />_________________<br />' . $user_sig;
     }
     $template->set_filenames(array('preview' => 'forums/posting_preview.html'));
     //		if (defined('BBAttach_mod')) {
     $attachment_mod['posting']->preview_attachments();
     $template->assign_vars(array('TOPIC_TITLE' => $preview_subject, 'POST_SUBJECT' => $preview_subject, 'POSTER_NAME' => $preview_username, 'POST_DATE' => create_date($board_config['default_dateformat'], time()), 'MESSAGE' => $preview_message, 'L_POST_SUBJECT' => $lang['Post_subject'], 'L_PREVIEW' => $lang['Preview'], 'L_POSTED' => $lang['Posted'], 'L_POST' => $lang['Post']));
     $template->assign_var_from_handle('POST_PREVIEW_BOX', 'preview');
 } else {
     if ($error_msg != '') {
         $template->set_filenames(array('reg_header' => 'forums/error_body.html'));
         $template->assign_vars(array('ERROR_MESSAGE' => $error_msg));
         $template->assign_var_from_handle('ERROR_BOX', 'reg_header');
     }
Example #9
0
function topic_review($topic_id, $is_inline_review)
{
    global $db, $board_config, $template, $lang, $images, $phpbb_root_path;
    global $userdata, $user_ip;
    global $orig_word, $replacement_word, $bgcolor1, $bgcolor2;
    $is_auth = array();
    if (!$is_inline_review) {
        if (!isset($topic_id) || !$topic_id) {
            message_die(GENERAL_MESSAGE, 'Topic_not_exist');
        }
        //
        // Get topic info ...
        //
        $sql = "SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments, f.auth_download, t.topic_attachment\n\t\t\tFROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f\n\t\t\tWHERE t.topic_id = {$topic_id}\n\t\t\t\tAND f.forum_id = t.forum_id";
        $result = $db->sql_query($sql);
        if (!($forum_row = $db->sql_fetchrow($result))) {
            message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
        }
        $db->sql_freeresult($result);
        $forum_id = $forum_row['forum_id'];
        $topic_title = $forum_row['topic_title'];
        //
        // Start session management
        //
        $userdata = session_pagestart($user_ip, $forum_id);
        init_userprefs($userdata);
        //
        // End session management
        //
        $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
        if (!$is_auth['auth_read']) {
            message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']));
        }
    }
    //
    // Define censored word matches
    //
    if (empty($orig_word) && empty($replacement_word)) {
        $orig_word = array();
        $replacement_word = array();
        obtain_word_list($orig_word, $replacement_word);
    }
    //
    // Dump out the page header and load viewtopic body template
    //
    if (!$is_inline_review) {
        $gen_simple_header = TRUE;
        $page_title = $lang['Topic_review'] . ' - ' . $topic_title;
        include "includes/phpBB/page_header.php";
        $template->set_filenames(array('body' => 'forums/posting_topic_review.html'));
        //
        // Go ahead and pull all data for this topic
        //
        $sql = "SELECT u.username, u.user_id, p.*,\tpt.post_text, pt.post_subject\n\t\t\tFROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt\n\t\t\tWHERE p.topic_id = {$topic_id}\n\t\t\t\tAND p.poster_id = u.user_id\n\t\t\t\tAND p.post_id = pt.post_id\n\t\t\tORDER BY p.post_time DESC\n\t\t\tLIMIT " . $board_config['posts_per_page'];
        $result = $db->sql_query($sql);
        //	  if (defined('BBAttach_mod')) {
        //	init_display_review_attachments($is_auth);
        //
        // Okay, let's do the loop, yeah come on baby let's do the loop
        // and it goes like this ...
        //
        if ($db->sql_numrows($result) < 1) {
            message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', '', __LINE__, __FILE__, $sql);
        }
        $mini_post_img = $images['icon_minipost'];
        $mini_post_alt = $lang['Post'];
        while ($row = $db->sql_fetchrow($result, SQL_ASSOC)) {
            $i = 0;
            $poster_id = $row['user_id'];
            $poster = $row['username'];
            $post_date = create_date($board_config['default_dateformat'], $row['post_time']);
            //
            // Handle anon users posting with usernames
            //
            if ($poster_id == ANONYMOUS && $row['post_username'] != '') {
                $poster = $row['post_username'];
                $poster_rank = $lang['Guest'];
            } elseif ($poster_id == ANONYMOUS) {
                $poster = $lang['Guest'];
                $poster_rank = '';
            }
            $post_subject = $row['post_subject'] != '' ? $row['post_subject'] : '';
            $message = $row['post_text'];
            //
            // If the board has HTML off but the post has HTML
            // on then we process it, else leave it alone
            //
            if (!$board_config['allow_html'] && $row['enable_html']) {
                $message = preg_replace('#(<)([\\/]?.*?)(>)#is', '&lt;\\2&gt;', $message);
            }
            if ($board_config['allow_bbcode']) {
                $message = decode_bbcode($message, 1, false);
            }
            $message = make_clickable($message);
            if (count($orig_word)) {
                $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
                $message = preg_replace($orig_word, $replacement_word, $message);
            }
            if ($board_config['allow_smilies'] && $row['enable_smilies']) {
                $message = set_smilies($message);
            }
            if (!$board_config['allow_bbcode']) {
                $message = nl2br($message);
            }
            //
            // Again this will be handled by the templating
            // code at some point
            //
            $row_color = !($i % 2) ? $bgcolor2 : $bgcolor1;
            $row_class = !($i % 2) ? 'row1' : 'row2';
            $template->assign_block_vars('postrow', array('ROW_COLOR' => $row_color, 'ROW_CLASS' => $row_class, 'MINI_POST_IMG' => $mini_post_img, 'POSTER_NAME' => $poster, 'POST_DATE' => $post_date, 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'L_MINI_POST_ALT' => $mini_post_alt));
            display_review_attachments($row['post_id'], $row['post_attachment'], $is_auth);
            ++$i;
        }
        $db->sql_freeresult($result);
    }
    $template->assign_vars(array('L_AUTHOR' => $lang['Author'], 'L_MESSAGE' => $lang['Message'], 'L_POSTED' => $lang['Posted'], 'L_POST_SUBJECT' => $lang['Post_subject'], 'L_TOPIC_REVIEW' => $lang['Topic_review'], 'S_NOT_INLINE' => !$is_inline_review));
    if (!$is_inline_review) {
        include 'includes/phpBB/page_tail.php';
    }
}
Example #10
0
 <tr><td class="row1" colspan="2"><span class="gen">' . $blog_text . '</span></td></tr>
 </table><br /><table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
 <tr><td class="row1" colspan="2" align="center">' . ($_GET['comments'] == 'show' ? '<a href="' . getlink('&amp;mode=display&amp;id=' . $blog_id) . '">' . _B_COMMENTS_HIDE . '</a>' : '<a href="' . getlink('&amp;mode=display&amp;id=' . $blog_id . '&amp;comments=show') . '">' . _B_COMMENTS . ' (' . $blog_comments . ')</a>') . ' | <a href="' . getlink('Your_Account&amp;op=userinfo&amp;username='******'">' . $blog_author . '\'s ' . _B_PROFILE . '</a>' . ($blog_author == $userinfo['username'] || is_admin() ? ' | <a href="' . getlink('&amp;mode=edit&amp;id=' . $blog_id) . '">' . _B_EDIT_TITLE . '</a>' : '') . ($blog_author == $userinfo['username'] || is_admin() ? ' | <a href="' . getlink('&amp;mode=remove&amp;type=blog&amp;id=' . $blog_id) . '">' . _B_REMOVE_BLOG . '</a>' : '') . '</td></tr>
 </table>';
 if ($_GET['comments'] == 'show') {
     echo '<br /><table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
     <tr><td class="catleft" colspan="2" align="center"><b><span class="gen">' . _B_COMMENTS . '</span></b></td></tr>';
     while (list($comment_id, $comment_blog, $comment_author, $comment_email, $comment_ip, $comment_text, $comment_timestamp) = $db->sql_fetchrow($result)) {
         $comment_ip = decode_ip($comment_ip);
         $info = getusrdata($comment_author, 'user_viewemail');
         if (!empty($comment_email)) {
             $usrlink = $info['user_viewemail'] ? 'mailto:' . $comment_email : getlink('Blogs&amp;mode=user&amp;nick=' . $comment_author);
         } else {
             $usrlink = getlink('Your_Account&amp;profile=' . $comment_author);
         }
         echo '<tr><td class="row1" colspan="2"><span class="gen">' . set_smilies($comment_text) . '</span></td></tr>
         <tr><td class="row1" align="left">' . _POSTEDBY . ' <a href="' . $usrlink . '">' . $comment_author . '</a> | ' . formatDateTime($comment_timestamp, _DATESTRING) . '</td>';
         if (is_admin()) {
             echo '<td class="row2" align="right">IP: <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=' . $comment_ip . '" target="ResourceWindow">' . $comment_ip . '</a> | <a href="' . getlink('&amp;mode=remove&amp;type=comment&amp;id=' . $comment_id) . '">' . _B_REMOVE . '</a></td>';
         }
         echo '</tr></table><br /><table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">';
     }
     if ($db->sql_numrows($result) < 1) {
         echo '<tr><td class="row1" colspan="2" align="center"><span class="gen">' . _B_COMMENTS_NONEYET . '</span></td></tr>';
     }
     $db->sql_freeresult($result);
     $my_name = $my_email = $disabled = '';
     if (is_user()) {
         $my_name = $userinfo['username'];
         $my_email = $userinfo['user_email'];
         $disabled = ' readonly="readonly"';
Example #11
0
echo '<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
  <title>' . htmlprepare($sitename) . '</title>
  <link>' . $BASEHREF . '</link>
  <description>' . htmlprepare($backend_title) . '</description>
  <language>' . $backend_language . '</language>
  <pubDate>' . $date . '</pubDate>
  <ttl>' . 60 * 24 . '</ttl>
  <generator>NexOS RSS Generator</generator>
  <copyright>' . htmlprepare($sitename) . '</copyright>
  <category>' . $category . '</category>
  <docs>http://backend.userland.com/rss</docs>
  <image>
    <url>' . $BASEHREF . 'images/' . $MAIN_CFG['global']['site_logo'] . '</url>
    <title>' . htmlprepare($sitename) . '</title>
    <link>' . $BASEHREF . "</link>\n  </image>\n\n";
if ($row) {
    do {
        $forumname = isset($_GET['f']) ? '' : $row['forum_name'] . ': ';
        echo '<item>
  <title>' . $forumname . $row['topic_title'] . '</title>
  <link>' . URL::index("Forums&amp;file=viewtopic&amp;p={$row['topic_last_post_id']}#{$row['topic_last_post_id']}", true, true) . '</link>
  <description>' . htmlprepare(decode_bbcode(set_smilies($row['post_text']), 1), false, ENT_QUOTES, true) . '</description>
  <pubDate>' . date('D, d M Y H:i:s \\G\\M\\T', $row['post_time']) . "</pubDate>\n</item>\n\n";
    } while ($row = $db->sql_fetchrow($result));
}
?>
</channel>
</rss>
Example #12
0
    }
    if ($privmsg['privmsgs_enable_html']) {
        $private_message = preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $private_message);
    }
}
if ($user_sig != '' && $privmsg['privmsgs_attach_sig']) {
    require_once 'includes/nbbcode.php';
    $user_sig = $MAIN_CFG['private_messages']['allow_bbcode'] ? decode_bbcode($user_sig, 1, false) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $user_sig);
}
$private_message = $MAIN_CFG['private_messages']['allow_bbcode'] ? decode_bbcode($private_message, 1, false) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $private_message);
$private_message = make_clickable($private_message);
if ($privmsg['privmsgs_attach_sig'] && $user_sig != '') {
    $private_message .= '<br /><br />_________________<br />' . make_clickable($user_sig);
}
if ($MAIN_CFG['private_messages']['allow_smilies'] && $privmsg['privmsgs_enable_smilies']) {
    $private_message = set_smilies($private_message);
}
//	  $private_message = str_replace("\n", '<br />', $private_message);
$template->assign_vars(array('MESSAGE_FROM' => $privmsg['username_1'], 'MESSAGE_TO' => $privmsg['username_2'], 'POST_SUBJECT' => $post_subject, 'POST_DATE' => L10NTime::date($MAIN_CFG['global']['dateformat'], $privmsg['privmsgs_date'], $userinfo['user_dst'], $userinfo['user_timezone']), 'MESSAGE' => $private_message, 'U_MESSAGE_FROM' => URL::index('Your_Account&amp;profile=' . $privmsg['username_1']), 'U_MESSAGE_TO' => URL::index('Your_Account&amp;profile=' . $privmsg['username_2'])));
// PM QUICK REPLY
//if ( $MAIN_CFG['private_messages']['ropm_quick_reply'] && $privmsg['privmsgs_from_userid'] != $userinfo['user_id'] )
if ($folder == 'inbox' && $MAIN_CFG['private_messages']['quick_reply']) {
    require_once 'includes/nbbcode.php';
    $last_msg = $privmsg['privmsgs_text'];
    $last_msg = '[quote="' . $privmsg['username_1'] . '"]' . $last_msg . '[/quote]';
    $last_msg = str_replace('\\', '\\\\', $last_msg);
    //'
    $last_msg = str_replace('"', '&quot;', $last_msg);
    $last_msg = str_replace(chr(13), '', $last_msg);
    $s_hidden_fields = '
<input type="hidden" name="folder" value="' . $folder . '" />
Example #13
0
  $Revision: 9.1 $
  $Author: nanocaiordo $
  $Date: 2008/07/31 14:11:20 $
****************************************************************************/
if (!defined('CPG_NUKE')) {
    exit;
}
define('DISPLAYECARD_PHP', true);
require "modules/" . $module_name . "/include/load.inc";
require_once 'includes/nbbcode.php';
//require($CPG_M_DIR . '/include/smilies.inc.php');
if (!isset($_GET['data'])) {
    cpg_die(_CRITICAL_ERROR, PARAM_MISSING, __FILE__, __LINE__);
}
$data = array();
$data = unserialize(base64_decode($_GET['data']));
if (!is_array($data)) {
    cpg_die(_CRITICAL_ERROR, 'ECARD_LINK_CORRUPT', __FILE__, __LINE__);
}
// Remove HTML tags as we can't trust what we receive
foreach ($data as $key => $value) {
    $data[$key] = htmlprepare($value);
}
// Load template parameters
$path = $MAIN_CFG['server']['domain'] . $MAIN_CFG['server']['path'];
$host = ($_SERVER['SERVER_PORT'] != 443 ? 'http' : 'https') . '://' . $path;
//$link = $CONFIG['ecards_more_pic_target'] . $CPG_M_URL;
$link = URL::index($module_name, 1, 1);
$params = array('{LANG_DIR}' => CPG_TEXT_DIR, '{BASE}' => $host, '{TITLE}' => sprintf(E_ECARD_TITLE, $data['sn']), '{CHARSET}' => $CONFIG['charset'] == 'language file' ? _CHARSET : $CONFIG['charset'], '{VIEW_ECARD_TGT}' => '', '{VIEW_ECARD_LNK}' => '', '{PIC_URL}' => $data['p'], '{IMG_PATH}' => $THEME_DIR . '/images/', '{GREETINGS}' => $data['g'], '{MESSAGE}' => nl2br(set_smilies($data['m'])), '{SENDER_EMAIL}' => $data['se'], '{SENDER_NAME}' => $data['sn'], '{VIEW_MORE_TGT}' => $link, '{VIEW_MORE_LNK}' => VIEW_MORE_PICS);
// Parse template
echo template_eval($template_ecard, $params);