コード例 #1
0
ファイル: index.php プロジェクト: cbsistem/nexos
function list_cat_albums($cat = 0, $buffer = true)
{
    global $db, $CONFIG, $USER, $PAGE, $USER_DATA, $CPG_M_DIR;
    if ($cat == 0 && $buffer) {
        return '';
    }
    $cat = intval($cat);
    $alb_per_page = $CONFIG['albums_per_page'];
    $maxTab = $CONFIG['max_tabs'];
    $visible = '';
    if (!USER_IS_ADMIN && !$CONFIG['show_private']) {
        $visible = "AND " . VIS_GROUPS;
        // NEW gtroll
        $tmpvis = explode(',', USER_IN_GROUPS);
        $vis[0] = 0;
        foreach ($tmpvis as $dummy => $group) {
            $vis[$group] = $group;
        }
        unset($tmpvis);
    }
    /*
    $result = $db->sql_query("SELECT count(*) FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = $cat $visible",false,__FILE__,__LINE__);
    $nbEnr = $db->sql_fetchrow($result);
    $nbAlb = $nbEnr[0];
    $db->sql_freeresult($result);
    */
    //$nbAlb = cpg_tablecount($CONFIG['TABLE_ALBUMS']." WHERE category = $cat $visible", 'count(*)',__FILE__, __LINE__);
    $nbAlb = 0;
    foreach (get_albums_data() as $row) {
        if ($row['category'] != $cat) {
            continue;
        }
        if (isset($vis) && !isset($vis[$row['visibility']])) {
            continue;
        }
        $nbAlb++;
    }
    if (!$nbAlb) {
        return '';
    }
    $totalPages = ceil($nbAlb / $alb_per_page);
    if (isset($_GET['page'])) {
        $PAGE = max(intval($_GET['page']), 1);
    }
    //if ($PAGE > $totalPages || $cat != $_GET['cat']) $PAGE = 1;
    if ($PAGE > $totalPages) {
        $PAGE = 1;
    }
    $lower_limit = ($PAGE - 1) * $alb_per_page;
    $upper_limit = min($nbAlb, $PAGE * $alb_per_page);
    $sql = "SELECT a.aid, a.title, a.description, visibility, filepath, " . "filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_ALBUMS']} as a " . "LEFT JOIN {$CONFIG['TABLE_PICTURES']} as p ON thumb=pid " . "WHERE category = '{$cat}' {$visible} ORDER BY pos " . "LIMIT " . ($upper_limit - $lower_limit) . " OFFSET " . $lower_limit;
    $alb_thumbs = $db->sql_ufetchrowset($sql, SQL_BOTH, __FILE__, __LINE__);
    $disp_album_count = count($alb_thumbs);
    $album_set = '';
    foreach ($alb_thumbs as $value) {
        $album_set .= $value['aid'] . ', ';
    }
    $album_set = '(' . substr($album_set, 0, -2) . ')';
    $sql = "SELECT aid, count(pid) as pic_count, max(pid) as last_pid, max(ctime) as last_upload " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE aid IN {$album_set} AND approved = '1' " . "GROUP BY aid";
    if ($alb_stats = $db->sql_ufetchrowset($sql, SQL_BOTH)) {
        foreach ($alb_stats as $key => $value) {
            $cross_ref[$value['aid']] =& $alb_stats[$key];
        }
    }
    for ($alb_idx = 0; $alb_idx < $disp_album_count; $alb_idx++) {
        $alb_thumb =& $alb_thumbs[$alb_idx];
        $aid = $alb_thumb['aid'];
        if (isset($cross_ref[$aid])) {
            $alb_stat = $cross_ref[$aid];
            $count = $alb_stat['pic_count'];
        } else {
            $alb_stat = array();
            $count = 0;
        }
        // Inserts a thumbnail if the album contains 1 or more images
        $visibility = $alb_thumb['visibility'];
        if ($visibility == '0' || $visibility == FIRST_USER_CAT + USER_ID || $visibility == $USER_DATA['group_id'] || USER_IS_ADMIN || user_ingroup($visibility, $USER_DATA['user_group_list_cp'])) {
            if ($count > 0) {
                // Inserts a thumbnail if the album contains 1 or more images
                if ($alb_thumb['filename']) {
                    $picture =& $alb_thumb;
                } else {
                    $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} WHERE pid='{$alb_stat['last_pid']}'";
                    $result = $db->sql_query($sql, false, __FILE__, __LINE__);
                    $picture = $db->sql_fetchrow($result);
                    $db->sql_freeresult($result);
                }
                $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . get_pic_url($picture, 'thumb') . "\" {$image_size['geom']} title=\"" . $alb_thumb['title'] . "\" alt=\"" . $alb_thumb['title'] . "\" border=\"0\" class=\"image\" />";
            } else {
                // Inserts an empty thumbnail if the album contains 0 images
                $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"{$CPG_M_DIR}/images/nopic.jpg\" {$image_size['geom']} alt=\"" . NO_IMG_TO_DISPLAY . "\" title=\"" . NO_IMG_TO_DISPLAY . "\" border=\"0\" class=\"image\" />";
            }
        } elseif ($CONFIG['show_private']) {
            $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
            $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"{$CPG_M_DIR}/images/private.jpg\" {$image_size['geom']} alt=\"" . MEMBERS_ONLY . "\" title=\"" . MEMBERS_ONLY . "\" border=\"0\" class=\"image\" />";
        }
        // Prepare everything
        $last_upload_date = $count ? localised_date($alb_stat['last_upload'], LASTUP_DATE_FMT) : '';
        $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
        $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
        $alb_list[$alb_idx]['album_desc'] = decode_bbcode($alb_thumb['description']);
        $alb_list[$alb_idx]['pic_count'] = $count;
        $alb_list[$alb_idx]['last_upl'] = $last_upload_date;
        $alb_list[$alb_idx]['album_info'] = sprintf(N_PICTURES, $count) . ($count ? sprintf(LAST_ADDED, $last_upload_date) : "");
        $alb_list[$alb_idx]['album_adm_menu'] = GALLERY_ADMIN_MODE || USER_ADMIN_MODE && $cat == USER_ID + FIRST_USER_CAT ? html_albummenu($alb_thumb['aid']) : '';
    }
    if ($buffer) {
        ob_start();
        theme_display_album_list_cat($alb_list, $nbAlb, $cat, $PAGE, $totalPages);
        $cat_albums = ob_get_contents();
        ob_end_clean();
        return $cat_albums;
    } else {
        theme_display_album_list($alb_list, $nbAlb, $cat, $PAGE, $totalPages);
    }
}
コード例 #2
0
ファイル: nbbcode.php プロジェクト: cbsistem/nexos
function decode_bb_all($text, $allowed = 0, $allow_html = false, $url = '')
{
    return set_smilies(decode_bbcode($text, $allowed, $allow_html), $url);
}
コード例 #3
0
ファイル: details.php プロジェクト: cbsistem/nexos
$rating_info = get_rating($row['score'], $row['votes']);
if (!is_admin() && $row['submitter'] != is_user()) {
    update_views($global_id);
}
//$modheader .= '<link rel="stylesheet" type="text/css" href="modules/'.$module_name.'/include/style.css" />';
$pagetitle .= $module_title . ' ' . _BC_DELIM . ' ' . $row['title'];
if ($row['img_url']) {
    if (ereg('://', $row['img_url'])) {
        $row['img_url'] .= '" width="' . $dl_config['dimension_thumb'];
    } else {
        $row['img_url'] = dl_thumbimage($row['img_url']);
    }
}
$can_dl = can_download($row['active'], $row['access']);
//$submitter_count = $db->sql_count($dl_prefix.'_downloads', "submitter='".Fix_Quotes($row['submitter'])."'")-1;
$cpgtpl->assign_vars(array('L_SUBMITTEDBY' => _DLP_SUBMITTEDBY, 'L_AUTHORNAME' => _AUTHORNAME, 'L_AUTHOREMAIL' => _AUTHOREMAIL, 'L_PUBLISHED' => _DLP_PUBLISHED, 'L_UPDATED' => _DLP_UPDATED, 'L_DESCRIPTION' => _DESCRIPTION, 'L_CATEGORY' => _CATEGORY, 'L_RATING' => _RATING, 'L_VOTES' => _VOTES, 'L_DOWNLOADS' => _DOWNLOADS, 'L_ACTIVE' => _ACTIVE, 'L_EDIT' => _EDIT, 'L_DELETE' => _DELETE, 'L_ISDLOWNER' => sprintf(_DLP_ISDLOWNER, URL::index('&amp;file=manage&amp;edit=' . $global_id)), 'L_MIRSUB' => sprintf(_DLP_MIRSUB, URL::index('&amp;file=manage&amp;mirrors=' . $global_id)), 'L_EDNOTE' => _DLP_EDNOTE, 'L_MEMREVIEWS' => _DLP_MEMREVIEWS, 'L_PENDREVIEWS' => _DLP_PENDREVIEWS, 'L_BY' => _BY, 'L_ON' => _ON, 'L_PAGE' => _DLP_PAGE, 'L_VIEWALLSCREENS' => _DLP_VIEWALLSCREENS, 'L_POPULARITY' => _POPULARITY, 'L_PAGEVIEWS' => _DLP_PAGEVIEWS, 'L_ADMINTOOLS' => _ADMINISTRATION, 'L_EDPICK' => _DLP_EDPICK, 'DL_MENU' => dl_detail_menu($global_id, $row['title'], $row['pick'], $row['active'], 1), 'DL_CATEGORY' => DL_Cat::breadcrumb($row['cid']), 'DL_SUBMITTER' => is_numeric($row['submitter']) ? '<a href="' . URL::index('&amp;file=search&amp;sa=' . $row['submitter']) . '">' . $row['username'] . '</a>' : $row['submitter'], 'DL_AUTHORNAME' => $row['name'], 'DL_AUTHOREMAIL' => $row['email'] ? spam_protect($row['email']) : false, 'DL_PUBLISHED' => generate_date($row['date']), 'DL_PUBLISHTYPE' => mark_date($row['date'], 3, 1, 'right'), 'DL_UPDATED' => $row['updated'] > $row['date'] ? generate_date($row['updated']) : false, 'DL_UPDATE_TYPE' => $row['updated'] > $row['date'] ? mark_date($row['updated'], 3, 2, 'right') : false, 'DL_DESCRIPTION' => nl2br($row['desc_short']) . (!empty($row['desc_long']) ? decode_bbcode("\n\n" . $row['desc_long'], true) : ''), 'DL_NOTES' => decode_bbcode($row['notes']), 'DL_REVIEWS_ACTIVE' => $dl_config['r_active'], 'IMG_DL_RATING' => $rating_info['image'], 'DL_VOTES' => intval($row['votes']), 'DL_POPULARITY' => popularity($global_id), 'DL_HITS' => intval($row['hits']), 'DL_VIEWS' => intval($row['views']), 'DL_SUB_MIRRORS' => $dl_config['pub_mirror'], 'U_DL_SCREENSHOT' => URL::index('&amp;screen=' . $row['screen']), 'IMG_DL_SCREENSHOT' => $row['img_url'], 'B_DL_ADMIN' => can_admin($module_name), 'DL_IS_OWNER' => $row['submitter'] == $userinfo['user_id'], 'U_DL_DELETE' => URL::admin('&amp;del_dl=' . $global_id), 'U_DL_EDIT' => URL::index('&amp;file=manage&amp;edit=' . $global_id), 'U_DL_MIRSUB' => URL::index('&amp;file=manage&amp;mirrors=' . $global_id), 'U_DL_MIRROR' => URL::index('&amp;mirror=' . $global_id), 'U_DL_MIRRORS' => URL::index('&amp;get=' . $global_id), 'U_DL_ACTIVE' => URL::admin('&amp;active=' . $global_id), 'U_DL_PICK' => URL::admin('&amp;pick=' . $global_id), 'IMG_DL_MIRRORS' => dl_image($can_dl ? 'download.png' : 'register.png'), 'IMG_DL_ACTIVE' => dl_image($row['active'] == 1 ? 'checked.png' : 'unchecked.png'), 'IMG_DL_PICK' => dl_image($row['pick'] ? 'checked.png' : 'unchecked.png'), 'S_DL_ACTIVE' => $row['active'] == 1 ? _YES : _NO, 'S_DL_PICK' => $row['pick'] ? _YES : _NO, 'S_DL_MIRRORS' => $can_dl ? _DLP_DLNOW : _DLP_NADL));
$result = $db->sql_query("SELECT field, title, type FROM " . $dl_prefix . "_fields \n\tWHERE type!=3 AND visible > 0");
if ($db->sql_numrows($result)) {
    while ($row2 = $db->sql_fetchrow($result)) {
        if ($row2['type'] == 1) {
            $row[$row2['field']] = $row[$row2['field']] ? _YES : _NO;
        }
        if ($row[$row2['field']]) {
            $row2['title'] = defined($row2['title']) ? constant($row2['title']) : $row2['title'];
            if ($row2['field'] == 'homepage' && $row[$row2['field']]) {
                $row[$row2['field']] = '<a href="' . $row[$row2['field']] . '" target="_blank">' . shrink_url($row[$row2['field']]) . '</a>';
            }
            $cpgtpl->assign_block_vars('dl_field', array('TITLE' => $row2['title'], 'VALUE' => $row[$row2['field']]));
        }
    }
}
コード例 #4
0
ファイル: viewtopic.php プロジェクト: cbsistem/nexos
 # Note! The order used for parsing the message _is_ important, moving things around could break any output
 # 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'] || !$userdata['user_allowhtml']) {
     if ($user_sig != '') {
         $user_sig = preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $user_sig);
     }
     if ($postrow[$i]['enable_html']) {
         $message = preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $message);
     }
 }
 # Parse message and/or sig for BBCode if reqd
 if ($user_sig != '') {
     $user_sig = $board_config['allow_bbcode'] ? decode_bbcode($user_sig, 1, false) : nl2br($user_sig);
 }
 if ($postrow[$i]['enable_bbcode']) {
     $message = $board_config['allow_bbcode'] ? decode_bbcode($message, 1, false) : nl2br($message);
 } else {
     $message = nl2br($message);
 }
 if ($user_sig != '') {
     $user_sig = make_clickable($user_sig);
 }
 $message = make_clickable($message);
 # Parse smilies
 if ($board_config['allow_smilies']) {
     if ($postrow[$i]['user_allowsmile'] && $user_sig != '') {
         $user_sig = set_smilies($user_sig);
     }
     if ($postrow[$i]['enable_smilies']) {
         $message = set_smilies($message);
     }
コード例 #5
0
ファイル: posting.php プロジェクト: cbsistem/nexos
 $preview_message = message_prepare($message, $html_on, $bbcode_on);
 $preview_subject = $subject;
 $preview_username = $username;
 //
 // Finalise processing as per viewtopic
 //
 if (!$html_on) {
     if ($user_sig != '' || !$userdata['user_allowhtml']) {
         $user_sig = BBCode::encode_html($user_sig);
     }
 }
 if ($attach_sig && $user_sig != '') {
     $user_sig = decode_bbcode($user_sig, 1, false);
 }
 if ($bbcode_on) {
     $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);
コード例 #6
0
ファイル: index.php プロジェクト: cbsistem/nexos
        $gfx_check = isset($_POST['gfx_contact_check']) ? $_POST['gfx_contact_check'] : '';
        if (strlen($gfx_check) < 2 || $code != $gfx_check) {
            $error = _SECURITYCODE . ' incorrect';
        }
    }
    if (!isset($error)) {
        if (isset($_SESSION[$module_name])) {
            unset($_SESSION[$module_name]);
        }
        $msg = $MAIN_CFG['global']['sitename'] . " " . _FEEDBACK . "\n\n";
        $msg .= _SENDERNAME . ": {$sender_name}\n";
        $msg .= _SENDEREMAIL . ": {$sender_email}\n";
        $msg .= _MESSAGE . ": " . $message . "\n\n--\n";
        if (is_admin() && !empty($send_to)) {
            $recip_email = $send_to;
            $recip_name = $send_to;
            $msg .= _POSTEDBY . " IP: " . $_SERVER['SERVER_ADDR'];
        } else {
            $recip_email = $MAIN_CFG['global']['adminmail'];
            $recip_name = $MAIN_CFG['global']['sitename'];
            $msg .= _POSTEDBY . " IP: " . decode_ip($userinfo['user_ip']);
        }
        if (send_mail($error, $msg, $html, $subject, $recip_email, $recip_name, $sender_email, $sender_name)) {
            cpg_error(_SUCCESS_MESSAGE_SENT . '<br /><br />' . decode_bbcode("[quote=\"" . $sender_name . "\"]" . $msg . "[/quote]", 1) . '<br />' . _MAHALO, _ContactLANG, $mainindex);
        }
    }
    if (isset($error) && !empty($message)) {
        $_SESSION[$module_name]['message'] = $message;
    }
    cpg_error($error);
}
コード例 #7
0
ファイル: topic_review.php プロジェクト: cbsistem/nexos
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';
    }
}
コード例 #8
0
ファイル: index.php プロジェクト: cbsistem/nexos
            $CPG_SESS['update_monitor'] = true;
            Cache::array_save('data', 'update_monitor', $data);
        }
    }
    OpenTable();
    echo '<div><center><span class="genmed"><strong>' . _UM . '</strong></span><br /><br />';
    if (!$CPG_SESS['update_monitor']) {
        echo '<img src="images/update/error.png" alt="" /><br /><br />' . _UM_F . '</center>';
    } else {
        echo version_compare(CPG_NUKE, $data['current'], '>=') ? '<img src="images/update/green.png" alt="" /><br /><br /><span style="color: #009933;"><strong>' . _UM_G . ' (' . CPG_NUKE . (version_compare(CPG_NUKE, $data['current'], '>') ? ' CVS' : '') . ')</strong></span>' : '<img src="images/update/red.png" alt="" /><br /><br /><span style="color: #ae0000;"><strong>' . sprintf(_UM_R, $data['current'], $data['url']) . '</strong></span>';
        echo '</center>';
        if (count($data['msg'])) {
            echo '<br />';
        }
        foreach ($data['msg'] as $item) {
            echo '<fieldset><legend>' . $item['title'] . '</legend>' . decode_bbcode($item['desc']) . '<br /><br />' . _POSTEDON . ' ' . formatDateTime($item['date'], '%B %d, %Y') . '</fieldset>';
        }
    }
    echo '</div>';
    CloseTable();
    echo '<br />';
}
GraphicAdmin();
$result = $db->sql_query('SELECT COUNT(*), guest FROM ' . $prefix . '_session GROUP BY guest ORDER BY guest');
$online_num = array(0, 0, 0, 0);
while ($row = $db->sql_fetchrow($result)) {
    $online_num[$row[1]] = intval($row[0]);
}
$db->sql_freeresult($result);
$day = L10NTime::tolocal(mktime(0, 0, 0, date('n'), date('j'), date('Y')) - date('Z'), $userinfo['user_dst'], $userinfo['user_timezone']);
list($userCount) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users WHERE user_regdate>='" . $day . "'", SQL_NUM);
コード例 #9
0
ファイル: index.php プロジェクト: cbsistem/nexos
        echo '<a id="top"></a>
		<a href="' . URL::index() . '">' . _MAIN . '</a> | <a href="' . URL::index('&amp;file=search&amp;cat=' . $id_cat) . '">' . _SEARCH . '</a><br /><br />
		<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
		<tr><td align="center" class="catleft" colspan="2"><b><span class="gen">' . _QUESTION . '</span></b></td></tr>
		<tr><td align="center" class="row1" colspan="2">' . _SORT . ': ' . (isset($_GET['sort']) && $_GET['sort'] == 'asc' ? '<b>' . _ASCENDING . '</b>' : '<a href="' . URL::index('&amp;cat=' . $id_cat . '&amp;sort=asc') . '">' . _ASCENDING . '</a>') . '
		 / ' . (isset($_GET['sort']) && $_GET['sort'] == 'desc' ? '<b>' . _DESCENDING . '</b>' : '<a href="' . URL::index('&amp;cat=' . $id_cat . '&amp;sort=desc') . '">' . _DESCENDING . '</a>') . '
		</td></tr>';
        foreach ($result as $row) {
            echo '<tr><td class="row1" colspan="2"><span class="gen"><a href="' . htmlprepare(URL::uri()) . '#' . $row['id'] . '">' . $row['question'] . '</a></span></td></tr>';
        }
        echo '</table><br />
		<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline" align="center">
		<tr><td align="center" class="catleft" colspan="2"><b><span class="gen">' . _ANSWER . '</span></b></td></tr>';
        foreach ($result as $row) {
            echo '<tr><td align="justify" class="row1" colspan="2"><a id="' . $row['id'] . '"></a><b><span class="gen">' . $row['question'] . '</span></b><br /><br />
			<span class="gen">' . decode_bbcode($row['answer'], 1) . '</span><br /><br />
			<div style="float:left;"><a href="' . htmlprepare(URL::uri()) . '#top">' . _BACKTOTOP . '</a></div>';
            if (can_admin('faq')) {
                echo '<div style="float:right;"><a href="' . URL::admin('&amp;mode=edit&amp;faq=' . $row['id']) . '">' . _EDIT . '</a> | <a href="' . URL::admin('&amp;mode=delete&amp;faq=' . $row['id']) . '">' . _DELETE . '</a></div>';
            }
            echo '</tr><tr><td class="spaceRow" style="height:1px;"><img src="images/spacer.gif" alt="" width="1" height="1" /></td></tr>';
        }
        echo '</table>';
    } else {
        echo '<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline" align="center">
		<tr><td align="center" class="row1" colspan="2" style="height:22px;">' . sprintf(_ERROR_NONE_TO_DISPLAY, strtolower(_FAQ2)) . '<br /><br /><a href="' . URL::index() . '">' . _BACKTOFAQINDEX . '</a></td></tr>
		</table>';
    }
} else {
    $order = isset($_GET['sort']) && $_GET['sort'] == 'desc' ? 'categories DESC' : (isset($_GET['sort']) ? 'categories ASC' : 'id ASC');
    $querylang = $multilingual ? 'WHERE (flanguage=\'' . $currentlang . '\' OR flanguage= \'\') ' : '';
コード例 #10
0
ファイル: index.php プロジェクト: cbsistem/nexos
function showcontent()
{
    global $uimages, $prefix, $db, $module_name;
    if (!isset($_GET['id'])) {
        URL::redirect(URL::index());
    }
    $id = intval($_GET['id']);
    $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
    $result = $db->sql_query("SELECT * FROM " . $prefix . "_reviews \n\tWHERE id='{$id}'");
    if ($db->sql_numrows($result) < 1) {
        URL::redirect(URL::index());
    }
    if ($page == 1 || $page == '') {
        $db->sql_query("UPDATE " . $prefix . "_reviews \n\t\tSET hits=hits+1 \n\t\tWHERE id='{$id}'");
    }
    require_once 'header.php';
    OpenTable();
    $myrow = $db->sql_fetchrow($result);
    $id = $myrow['id'];
    $date = $myrow['date'];
    $year = substr($date, 0, 4);
    $month = substr($date, 5, 2);
    $day = substr($date, 8, 2);
    $fdate = date('F jS Y', mktime(0, 0, 0, $month, $day, $year));
    $title = $myrow['title'];
    $text = $myrow['text'];
    $text = decode_bbcode($text, 1);
    $cover = $myrow['cover'];
    $reviewer = $myrow['reviewer'];
    $email = $myrow['email'];
    $hits = $myrow['hits'];
    $url = $myrow['url'];
    $url_title = $myrow['url_title'];
    $score = $myrow['score'];
    $language = $myrow['language'];
    $contentpages = explode('<!--pagebreak-->', $text);
    $pageno = count($contentpages);
    if ($page == '' || $page < 1) {
        $page = 1;
    }
    if ($page > $pageno) {
        $page = $pageno;
    }
    $arrayelement = (int) $page;
    $arrayelement--;
    echo '<table align="center"><tr><td>';
    if ($cover != '') {
        echo "<img src=\"images/reviews/{$cover}\" align=\"right\" border=\"1\" hspace=\"5\" alt=\"\" />";
    }
    echo "<span class=\"title\"><i><b>{$title}</b></i></span><br />";
    echo '<div style="text-align:justify;"><blockquote>' . $contentpages[$arrayelement];
    echo '</blockquote></div>';
    if (can_admin(strtolower($module_name))) {
        echo '<b>' . _ADMIN . '</b> [ <a href="' . URL::index('&amp;rop=mod_review&amp;id=' . $id) . '">' . _EDIT . '</a> | <a href="' . URL::index('&amp;rop=del_review&amp;id_del=' . $id) . '">' . _DELETE . '</a> ]<br />';
    }
    echo '<b>' . _ADDED . "</b> {$fdate}<br />";
    if ($reviewer != '') {
        echo '<b>' . _REVIEWER . "</b> <a href=\"mailto:{$email}\">{$reviewer}</a><br />";
    }
    if ($score != '') {
        echo '<b>' . _SCORE . '</b> ';
    }
    display_score($score);
    if ($url != '') {
        echo '<br /><b>' . _RELATEDLINK . ":</b> <a href=\"{$url}\" target=\"new\">{$url_title}</a>";
    }
    echo '<br /><b>' . _HITS . ":</b> {$hits}";
    echo '<br /><b>' . _LANGUAGE . ":</b> {$language}</td></tr></table>";
    echo '<div style="text-align:center;">';
    if ($pageno > 1) {
        echo '<br /><b>' . _PAGE . ":</b> {$page}/{$pageno}<br />";
    }
    //    $title = urlencode($title);
    if ($page >= $pageno) {
        $next_page = '';
    } else {
        $next_pagenumber = $page + 1;
        if ($page != 1) {
            $next_page .= '<img src="images/spacer.gif" width="10" height="2" alt="" /> &nbsp;&nbsp; ';
        }
        $next_page .= '
        <a href="' . URL::index("&amp;rop=showcontent&amp;id={$id}&amp;page={$next_pagenumber}") . '">' . _NEXTPAGE . " ({$next_pagenumber}/{$pageno})</a>\n        <a href=\"" . URL::index("&amp;rop=showcontent&amp;id={$id}&amp;page={$next_pagenumber}") . '">&#9658;</a>';
    }
    if ($page <= 1) {
        $previous_page = '';
    } else {
        $previous_pagenumber = $page - 1;
        $previous_page = '
        <a href="' . URL::index("&amp;rop=showcontent&amp;id={$id}&amp;page={$previous_pagenumber}") . '">&#9668;</a>
        <a href="' . URL::index("&amp;rop=showcontent&amp;id={$id}&amp;page={$previous_pagenumber}") . '">' . _PREVIOUSPAGE . " ({$previous_pagenumber}/{$pageno})</a>";
    }
    echo '' . $previous_page . " &nbsp;&nbsp; {$next_page}<br /><br />" . '[ <a href="' . URL::index() . '">' . _RBACK . '</a> | <a href="' . URL::index("&amp;rop=postcomment&amp;id={$id}") . '">' . _REPLYMAIN . '</a> ]</div>';
    CloseTable();
    if ($page == 1 || $page == '') {
        echo '<br />';
        r_comments($id, $title);
    }
}
コード例 #11
0
ファイル: forums.php プロジェクト: cbsistem/nexos
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>
コード例 #12
0
ファイル: read.php プロジェクト: cbsistem/nexos
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
if (!$MAIN_CFG['private_messages']['allow_html'] || !$userinfo['user_allowhtml']) {
    if ($user_sig != '') {
        $user_sig = preg_replace('#(<)([\\/]?.*?)(>)#is', "&lt;\\2&gt;", $user_sig);
    }
    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]';
コード例 #13
0
ファイル: blocks.php プロジェクト: cbsistem/nexos
 public function display($side)
 {
     if (!$this->{$side}) {
         return;
     }
     if ($this->start) {
         $this->blocks = array_merge_recursive($this->custom, $this->blocks);
         $this->custom = array();
     }
     require_once CORE_PATH . 'nbbcode.php';
     foreach ($this->blocks[$side] as $block) {
         $block['title'] = defined($block['title']) ? constant($block['title']) : $block['title'];
         switch ($block['bkey']) {
             case 'admin':
                 if (can_admin()) {
                     if ($content = adminblock($block['bid'], $block['title'], $block['content'])) {
                         $this->assign($side, $content);
                     }
                 }
                 break;
             case 'userbox':
                 global $userinfo;
                 if (is_user() && $userinfo['ublockon']) {
                     $block['title'] = _MENUFOR . " {$userinfo['username']}";
                     $block['content'] = decode_bbcode($userinfo['ublock'], 1, true);
                     $this->assign($side, $block);
                 }
                 break;
             case 'rss':
                 $this->rss($side, $block);
                 break;
             case 'custom':
                 $block['content'] = decode_bbcode($block['content'], 1, true);
                 $this->assign($side, $block);
                 break;
             case 'file':
                 $this->blockfile($side, $block);
                 break;
             default:
                 trigger_error('Undefined bkey for ' . $block['title'], E_USER_WARNING);
         }
     }
     $this->blocks[$side] = array();
 }
コード例 #14
0
ファイル: displayimage.php プロジェクト: cbsistem/nexos
function html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER, $CPG_M_DIR;
    global $album, $template_display_picture;
    $pid = $CURRENT_PIC_DATA['pid'];
    // $ina is where the Registered Only picture is
    $ina = "{$CPG_M_DIR}/images/ina.jpg";
    // Check for anon picture viewing - only for registered user, admin, or if admin allows anon access to full size images
    if (USER_ID > 1 or $CONFIG['allow_anon_fullsize'] or USER_IS_ADMIN) {
        // Add 1 to hit counter unless the user reloaded the page
        if (!isset($USER['liv']) || !is_array($USER['liv'])) {
            $USER['liv'] = array();
        }
        // Add 1 to hit counter
        if ($album != "lasthits" && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
            add_hit($pid);
            if (count($USER['liv']) > 4) {
                array_shift($USER['liv']);
            }
            //pass by ref depreciated in 4.3.9 array_push($USER['liv'], $pid);
            $USER['liv'][] = $pid;
        }
        if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
            $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
        } else {
            $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        }
        $picture_menu = USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID || GALLERY_ADMIN_MODE || $CURRENT_PIC_DATA['owner_id'] == USER_ID ? html_picture_menu($pid) : '';
        $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);
        $pic_title = '';
        if ($CURRENT_PIC_DATA['title'] != '') {
            $pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
        }
        if ($CURRENT_PIC_DATA['caption'] != '') {
            $pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
        }
        if ($CURRENT_PIC_DATA['keywords'] != '') {
            $pic_title .= KEYWORDS . ": " . $CURRENT_PIC_DATA['keywords'];
        }
        if (isset($image_size['reduced'])) {
            $CONFIG['justso'] = 0;
            if ($CONFIG['justso']) {
                //require_once('jspw.js');
                $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
                $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
                $hug = 'hug image';
                $hugwidth = '4';
                $bgclr = '#000000';
                $alt = CLICK_TO_CLOSE;
                // $lang_fullsize_popup[1];
                $pic_html = '<a href="' . URL::index("&amp;file=justsofullsize&amp;pid={$pid}", false, true) . '" target="' . uniqid(rand()) . "\" onclick=\"JustSoPicWindow('" . URL::index("&amp;file=justsofullsize&amp;pid={$pid}", false, true) . "','{$winsizeX}','{$winsizeY}','{$alt}','{$bgclr}','{$hug}','{$hugwidth}');return false\">";
            } else {
                $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
                $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
                $pic_html = '<a href="' . URL::index("&amp;file=displayimagepopup&amp;pid={$pid}&amp;fullsize=1", true, true) . '" target="' . uniqid(rand()) . "\" onclick=\"imgpop('" . URL::index("&amp;file=displayimagepopup&amp;pid={$pid}&amp;fullsize=1", true, true) . "','" . uniqid(rand()) . "','resizable=yes,scrollbars=yes,width={$winsizeX},height={$winsizeY},left=0,top=0');return false\">";
                //toolbar=yes,status=yes,
                $pic_title = VIEW_FS . "\n ============== \n" . $pic_title;
                //added by gaugau
            }
            $pic_html .= "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"{$pic_title}\" title=\"{$pic_title}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} alt=\"{$pic_title}\" title=\"{$pic_title}\" class=\"image\" border=\"0\" /><br />\n";
        }
        if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_picture, 'img_desc');
        } else {
            if (!$CURRENT_PIC_DATA['title']) {
                template_extract_block($template_display_picture, 'title');
            }
            if (!$CURRENT_PIC_DATA['caption']) {
                template_extract_block($template_display_picture, 'caption');
            }
        }
    } else {
        $imagesize = getimagesize($ina);
        $image_size = compute_img_size($imagesize[0], $imagesize[1], $CONFIG['picture_width']);
        $pic_html = '<a href="' . NEWUSER_URL . '">';
        $pic_html .= "<img src=\"" . $ina . "\" {$image_size['geom']} alt=\"Click to register\" title=\"Click to register\" class=\"image\" border=\"0\" /></a><br />";
        $picture_menu = "";
        $CURRENT_PIC_DATA['title'] = MEMBERS_ONLY;
        $CURRENT_PIC_DATA['caption'] = '';
    }
    $params = array('{CELL_HEIGHT}' => '100', '{IMAGE}' => $pic_html, '{ADMIN_MENU}' => $picture_menu, '{TITLE}' => $CURRENT_PIC_DATA['title'], '{CAPTION}' => decode_bbcode($CURRENT_PIC_DATA['caption']));
    return template_eval($template_display_picture, $params);
}
コード例 #15
0
ファイル: index.php プロジェクト: cbsistem/nexos
 $preview_message = message_prepare($privmsg_message, $html_on, $bbcode_on);
 $privmsg_message = preg_replace($html_entities_match, $html_entities_replace, $privmsg_message);
 //
 // Finalise processing as per viewtopic
 //
 /*if (!$html_on || ($html_on && !$userinfo['user_allowhtml'])) {
 			if ($user_sig) {
 				$user_sig = htmlprepare($user_sig);
 			}
 		}
 		if ($attach_sig && $user_sig) {
 			$user_sig = decode_bbcode($user_sig, 1, false);
 		}
 		*/
 if ($bbcode_on) {
     $preview_message = decode_bbcode($preview_message, 1);
 }
 /*
 		if ( $attach_sig && $user_sig != '' ) {
 			$preview_message = $preview_message.'<br /><br />_________________<br />'.$user_sig;
 		}
 */
 $preview_subject = $privmsg_subject;
 if ($smilies_on) {
     $preview_message = set_smilies($preview_message);
 }
 $preview_message = make_clickable($preview_message);
 $s_hidden_fields = '<input type="hidden" name="folder" value="' . $folder . '" />';
 $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />';
 if (isset($privmsg_id)) {
     $s_hidden_fields .= '<input type="hidden" name="p" value="' . $privmsg_id . '" />';
コード例 #16
0
ファイル: search.php プロジェクト: cbsistem/nexos
 //
 // If the board has HTML off but the post has HTML
 // on then we process it, else leave it alone
 //
 if ($return_chars != -1) {
     $message = strip_tags($message);
     $message = preg_replace('/\\[url\\]|\\[\\/url\\]/si', '', $message);
     $message = strlen($message) > $return_chars ? substr($message, 0, $return_chars) . ' ...' : $message;
 } else {
     if (!$board_config['allow_html']) {
         if ($postrow[$i]['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 ($highlight_active) {
         if (preg_match('/<.*>/', $message)) {
             $message = preg_replace($highlight_match, '<!-- #sh -->\\1<!-- #eh -->', $message);
             $end_html = 0;
             $start_html = 1;
             $temp_message = '';
             $message = ' ' . $message . ' ';
             while ($start_html = strpos($message, '<', $start_html)) {
                 $grab_length = $start_html - $end_html - 1;
                 $temp_message .= substr($message, $end_html + 1, $grab_length);
                 if ($end_html = strpos($message, '>', $start_html)) {
                     $length = $end_html - $start_html + 1;
                     $hold_string = substr($message, $start_html, $length);
コード例 #17
0
ファイル: submit.php プロジェクト: cbsistem/nexos
     if (!isset($CPG_SESS['submit_story']) && !$CPG_SESS['submit_story']) {
         cpg_error(_SPAMGUARDPROTECTED);
     }
     $uid = is_user() ? $userinfo['user_id'] : 1;
     $name = is_user() ? $userinfo['username'] : _ANONYMOUS;
     $subject = isset($_POST['subject']) ? Fix_Quotes($_POST['subject']) : '';
     $story = isset($_POST['story']) ? Fix_Quotes(html2bb($_POST['story'])) : '';
     $storyext = isset($_POST['storyext']) ? Fix_Quotes(html2bb($_POST['storyext'])) : '';
     $topic = isset($_POST['topic']) ? intval($_POST['topic']) : 1;
     $alanguage = isset($_POST['alanguage']) ? Fix_Quotes($_POST['alanguage']) : '';
     $subject = check_words($subject);
     $story = encode_bbcode(check_words($story));
     $storyext = encode_bbcode(check_words($storyext));
     $db->sql_query('INSERT INTO ' . $prefix . '_queue (qid, uid, uname, subject, story, storyext, timestamp, topic, alanguage) ' . "VALUES (DEFAULT, '{$uid}', '{$name}', '{$subject}', '{$story}', '{$storyext}', " . time() . ", {$topic}, '{$alanguage}')");
     if ($MAIN_CFG['global']['notify']) {
         $notify_message = "{$MAIN_CFG['global']['notify_message']}\n\n\n========================================================\n{$subject}\n\n\n" . decode_bbcode($story, 1, true) . "\n\n" . decode_bbcode($storyext, 1, true) . "\n\n{$name}";
         if (!send_mail($mailer_message, $notify_message, 0, $MAIN_CFG['global']['notify_subject'], $MAIN_CFG['global']['notify_email'], $MAIN_CFG['global']['notify_email'], $MAIN_CFG['global']['notify_from'], $name)) {
             echo $mailer_message;
         }
     }
     $CPG_SESS['submit_story'] = false;
     unset($CPG_SESS['submit_story']);
     list($waiting) = $db->sql_ufetchrow("SELECT COUNT(*) FROM {$prefix}_queue", SQL_NUM);
     cpg_error(_SUBTEXT . '<br />' . _WEHAVESUB . ' <strong>' . $waiting . '</strong> ' . _WAITING, _Submit_NewsLANG, URL::index('&file=submit'));
 } else {
     $CPG_SESS['submit_story'] = true;
     $story = isset($_POST['story']) ? $_POST['story'] : false;
     $storyext = isset($_POST['storyext']) ? $_POST['storyext'] : false;
     $subject = isset($_POST['subject']) ? htmlprepare($_POST['subject']) : false;
     $topic = isset($_POST['topic']) ? intval($_POST['topic']) : 0;
     $alanguage = isset($_POST['alanguage']) ? $_POST['alanguage'] : '';