function message_box() { global $prefix, $MAIN_CFG, $currentlang, $db, $userinfo; require_once CORE_PATH . 'nbbcode.php'; $query = $MAIN_CFG['global']['multilingual'] ? "AND (mlanguage='{$currentlang}' OR mlanguage='')" : ''; if (!is_admin()) { if (is_user()) { $query .= ' AND view!=2 AND view!=3'; } else { $query .= ' AND (view=0 OR view=3)'; } } $result = $db->sql_query('SELECT mid, title, content, date, expire, view FROM ' . $prefix . "_message WHERE active='1' {$query} ORDER BY date DESC"); while (list($mid, $title, $content, $date, $expire, $view) = $db->sql_fetchrow($result)) { $content = decode_bb_all($content, 1, true); if (!empty($title) && !empty($content)) { $output = ''; if ($view == 0) { $output = _MVIEWALL; } elseif ($view == 1) { $output = _MVIEWUSERS; } elseif ($view == 2) { $output = _MVIEWADMIN; } elseif ($view == 3) { $output = _MVIEWANON; } elseif ($view > 3 && (in_group($view - 3) || is_admin())) { // <= phpBB User Groups Integration $view = $view - 3; if (!in_group($view)) { list($output) = $db->sql_ufetchrow("SELECT group_name FROM " . $prefix . "_bbgroups WHERE group_id='{$view}'", SQL_NUM); } else { $output = in_group($view); } } if ($output != '') { $remain = ''; if (can_admin()) { if ($expire == 0) { $remain = _UNLIMITED; } else { $etime = ($date + $expire - time()) / 3600; $etime = intval($etime); $remain = $etime < 1 ? _EXPIRELESSHOUR : _EXPIREIN . " {$etime} " . _HOURS; } } global $cpgtpl; $cpgtpl->assign_block_vars('messageblock', array('S_TITLE' => $title, 'S_CONTENT' => $content, 'S_OUTPUT' => $output, 'S_DATE' => _POSTEDON . ' ' . formatDateTime($date, _DATESTRING2), 'S_REMAIN' => $remain, 'S_EDIT' => _EDIT, 'U_EDITMSG' => URL::admin('messages&edit=' . $mid))); } if ($expire != 0) { if ($date + $expire < time()) { $db->sql_query("UPDATE " . $prefix . "_message SET active='0' WHERE mid='{$mid}'"); } } } } $db->sql_freeresult($result); }
} else { $cpgtpl->assign_block_vars('newscat', array('S_GOHOME' => _GOTOHOME, 'S_SEARCH' => _SEARCH, 'S_SEARCHON' => _SEARCHONTOPIC, 'S_SELECT' => _SELECTNEWTOPIC, 'S_SITENAME' => $MAIN_CFG['global']['sitename'], 'S_TOPIC_T' => $topic_title, 'I_TOPIC' => $topic, 'U_HOME' => $mainindex, 'U_SEARCH' => URL::index('Search'), 'U_TOPICS' => URL::index('Topics'))); } $db->sql_freeresult($result_a); } $sql = 'SELECT s.*, sc.title AS cattitle, t.topicimage, t.topictext FROM ' . $prefix . '_stories AS s LEFT JOIN ' . $prefix . '_stories_cat AS sc ON (sc.catid=s.catid) LEFT JOIN ' . $prefix . '_topics t ON t.topicid=s.topic WHERE '; $sql .= $catid > 0 ? "s.catid='{$catid}' {$querylang} ORDER BY" : "{$qdb} {$querylang} ORDER BY display_order DESC,"; $result = $db->sql_query($sql . ' sid DESC LIMIT ' . $storynum . ' OFFSET ' . $offset); // $sql .= ($catid > 0) ? "s.catid='$catid' $querylang ORDER BY sid DESC" : "$qdb $querylang ORDER BY display_order DESC, time DESC"; // $result = $db->sql_query($sql.' LIMIT '.$storynum.' OFFSET 0'); require_once 'includes/nbbcode.php'; while ($row = $db->sql_fetchrow($result, SQL_ASSOC)) { $title = $row['title']; $row['hometext'] = decode_bb_all($row['hometext'], 1, true); $morecount = strlen($row['bodytext']); $comments = $row['comments']; $datetime = formatDateTime($row['time'], _DATESTRING); $story_link = '<a href="' . URL::index('News&file=article&sid=' . $row['sid']) . '">'; $morelink = $commentlink = $catlink = ''; if ($morecount > 0 || $comments > 0) { $morelink .= $story_link . '<b>' . _READMORE . '</b></a>'; if ($morecount > 0) { $morelink .= ' (' . filesize_to_human($morecount) . ') | '; } else { $morelink .= ' | '; } } if ($row['acomm']) { if ($comments == 0) {
// <ttl>60</ttl> a number of minutes that indicates how long a channel can be cached before refresh. 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 Feeder</generator> <copyright>' . htmlprepare($sitename) . '</copyright> <category>News</category> <docs>http://cyber.law.harvard.edu/rss/rss.html</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 { echo '<item> <title>' . htmlprepare($row['title']) . '</title> <link>' . URL::index('News&file=article&sid=' . $row['sid'], true, true) . '</link> <description>' . htmlprepare(decode_bb_all($row['hometext'], 1, true), false, ENT_QUOTES, true) . '</description> <pubDate>' . date('D, d M Y H:i:s \\G\\M\\T', $row['time']) . "</pubDate>\n</item>\n\n"; } while ($row = $db->sql_fetchrow($result)); } ?> </channel> </rss>
LEFT JOIN ' . $prefix . '_topics t ON t.topicid=s.topic WHERE s.sid=' . $sid); if ($db->sql_numrows($result) != 1) { URL::redirect(URL::index()); } $story = $db->sql_fetchrow($result); $db->sql_freeresult($result); $db->sql_query('UPDATE ' . $prefix . '_stories SET counter=counter+1 WHERE sid=' . $sid); $pagetitle .= _NewsLANG . ' ' . _BC_DELIM . ' ' . $story['title']; require_once 'includes/nbbcode.php'; $datetime = formatDateTime($story['time'], _DATESTRING); $hometext = decode_bb_all($story['hometext'], 1, true); $bodytext = decode_bb_all($story['bodytext'], 1, true); $notes = decode_bb_all($story['notes'], 1, true); if ($story['catid'] > 0) { $story['title'] = '<a href="' . URL::index('&catid=' . $story['catid']) . '"><span class="storycat">' . $story['cattitle'] . '</span></a>: ' . $story['title']; } $code_lang = get_langcode($language); $story['topicimage'] = $story['topicimage'] != '' ? $story['topicimage'] : 'AllTopics.gif'; $story['informant'] = $story['informant'] != '' ? '<a href="' . URL::index('Your_Account&profile=' . $story['informant']) . "\">{$story['informant']}</a>" : _ANONYMOUS; $cpgtpl->assign_vars(array('IMG_TOPIC' => (file_exists("themes/{$CPG_SESS['theme']}/images/topics/" . $story['topicimage']) ? "themes/{$CPG_SESS['theme']}/" : '') . 'images/topics/' . $story['topicimage'], 'NEWS_ADMIN' => can_admin('News') ? '<a href="' . URL::admin('&edit=' . $sid) . '">' . _EDIT . '</a> | <a href="' . URL::admin('&del=' . $sid) . '">' . _DELETE . '</a>' : '', 'S_AUTHOR' => $story['aid'], 'S_INFORMANT' => $story['informant'], 'S_NOTE' => _NOTE, 'S_NOTES' => $notes, 'S_POSTEDBY' => _POSTEDBY, 'S_STORY' => $hometext, 'S_STORYEXT' => $bodytext, 'S_ON' => _ON, 'S_TEXTCOLOR1' => $textcolor1, 'S_TEXTCOLOR2' => $textcolor2, 'S_TIME' => " {$datetime} ", 'S_READS' => "({$story['counter']} " . _READS . ")", 'S_TITLE' => $story['title'], 'S_TOPIC' => $story['topictext'], 'S_WRITES' => _WRITES, 'S_SID' => $sid, 'U_NEWTOPIC' => URL::index('&topic=' . $story['topic']))); // Show Associated topics $assoc = ''; if ($story['associated'] != '') { if (substr($story['associated'], -1) == '-') { $story['associated'] = substr($story['associated'], 0, -1); } $story['associated'] = str_replace('-', ',', $story['associated']); $result = $db->sql_query('SELECT topicid, topicimage, topictext from ' . $prefix . "_topics \n\t\tWHERE topicid IN ({$story['associated']})");
} else { $cpgtpl->assign_var('DL_REVIEWS', false); } $db->sql_freeresult($result); if (can_admin($module_name) || $row['submitter'] == $userinfo['user_id']) { // pagination $cur_page2 = isset($_GET['p_page']) && $_GET['p_page'] > 0 ? intval($_GET['p_page']) : 1; $limit2 = ($cur_page2 - 1) * $perpage; $result = $db->sql_query("SELECT r.id, r.uid, r.ip, r.title, r.comment, r.score, r.timestamp, u.username, COUNT(r.score) AS votes FROM " . $dl_prefix . "_ratings r\n\tLEFT JOIN " . $user_prefix . "_users u ON (u.user_id = r.uid)\n\tWHERE r.lid='{$global_id}' AND r.comment!='' AND active=0 \n\tGROUP BY r.id DESC, r.uid, r.ip, r.title, r.comment, r.score, r.timestamp, u.username \n\tLIMIT {$perpage} OFFSET {$limit2}"); list($pending) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $dl_prefix . "_ratings \n\tWHERE lid='{$global_id}' AND active=0"); if ($db->sql_numrows($result)) { $cpgtpl->assign_vars(array('DL_P_REVIEW_PAGES' => ceil($pending / $perpage) > 1 ? gen_pagination($pending, $perpage, $cur_page2, '&file=details&id=' . $global_id, 'p_reviews', 'p_page') : false, 'DL_P_REVIEWS' => $pending)); $i = 0; while (list($review_id, $review_uid, $review_ip, $review_title, $review_comment, $review_score, $review_timestamp, $review_uname, $review_votes) = $db->sql_fetchrow($result)) { $rating_info = get_rating($review_score, $review_votes); $cpgtpl->assign_block_vars('dl_p_review', array('ID' => $review_id, 'U_ID' => htmlprepare(URL::uri()) . '#r' . $review_id, 'RATING' => _DLP_REVIEW . ' #' . $review_id . ': ' . $rating_info['desc'], 'U_MEMBER' => URL::index('Your_Account&profile=' . $review_uid), 'MEMBERNAME' => $review_uname, 'DATE' => generate_date($review_timestamp), 'U_DEL' => can_admin($module_name) || $row['submitter'] == $userinfo['user_id'] ? '<a href="' . URL::index('&del_review=' . $review_id) . '">[' . strtolower(_DELETE) . ']</a>' : false, 'U_APPR' => can_admin($module_name) || $row['submitter'] == $userinfo['user_id'] ? '<a href="' . URL::index('&approve_review=' . $review_id) . '">[' . strtolower(_DLP_APPROVE) . ']</a>' : false, 'TITLE' => $review_title, 'COMMENT' => decode_bb_all($review_comment), 'IP' => decode_ip($review_ip), 'IMG_RATE' => dl_image('stars/' . $rating_info['rating'] . '.png'), 'SPACER' => $i > 0)); $i++; } } else { $cpgtpl->assign_var('DL_P_REVIEWS', false); } $db->sql_freeresult($result); } else { $cpgtpl->assign_var('DL_P_REVIEWS', false); } } if ($row['pick']) { $cpgtpl->assign_block_vars('dl_image', array('SRC' => dl_image('pick.png'), 'TITLE' => _DLP_EDPICK)); } // custom fields: images $result = $db->sql_query("SELECT field, img_path, img_alt FROM " . $dl_prefix . "_fields \n\tWHERE type=3 AND visible > 0");
**********************************************/ if (!defined('CPG_NUKE')) { exit; } if (isset($_GET['sid'])) { $sid = intval($_GET['sid']); $result = $db->sql_query('SELECT s.title, s.time, s.hometext, s.bodytext, s.informant, s.notes FROM ' . $prefix . '_stories s LEFT JOIN ' . $prefix . "_topics t ON (t.topicid = s.topic) WHERE s.sid='{$sid}'"); if ($db->sql_numrows($result) < 1) { URL::redirect(URL::index()); } list($title, $time, $hometext, $bodytext, $author, $notes) = $db->sql_fetchrow($result); $db->sql_freeresult($result); require_once 'includes/nbbcode.php'; $hometext = decode_bb_all($hometext, 1, true); $bodytext = decode_bb_all($bodytext, 1, true); $notes = decode_bb_all($notes, 1, true); if (!defined('_CHARSET')) { define('_CHARSET', 'UTF-8'); } if (!defined('_BROWSER_LANGCODE')) { define('_BROWSER_LANGCODE', _LANGCODE); } echo ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="' . _TEXT_DIR . '" lang="' . _BROWSER_LANGCODE . '"> <head> <base href="' . $BASEHREF . '" /> <meta http-equiv="Content-Type" content="text/html; charset=' . _CHARSET . '" /> <title>' . $MAIN_CFG['global']['sitename'] . ' ' . _BC_DELIM . ' ' . $title . '</title> <link rel="stylesheet" href="themes/' . $CPG_SESS['theme'] . '/style/style.css" type="text/css" media="screen" />
function replyPreview($sid) { global $userinfo; $subject = $_POST['subject']; $comment = $_POST['comment']; require_once 'header.php'; OpenTable(); echo '<div style="text-align:center;" class="title"><b>' . _COMREPLYPRE . '</b></div><br />'; CloseTable(); OpenTable(); echo '<b>' . $subject . '</b>' . '<br /><span class="content">' . _BY . ' ' . (is_user() ? $userinfo['username'] : _ANONYMOUS) . ' ' . _ONN . '</span><br /><br />'; echo decode_bb_all(encode_bbcode(htmlprepare($comment))); CloseTable(); replyform($sid, intval($_POST['pid']), $subject, $comment); }
if (NULL === $item['installed_v']) { if (!isset($item['status_txt'])) { $item['status_txt'] = 'Inactive or not installed'; $item['status_bg'] = '#DDDDDD'; } } else { switch (version_compare($item['installed_v'], $item['version'])) { case -1: $item['status_txt'] = _UPGRADE; $item['status_bg'] = '#FFDDDD'; break; case 0: $item['status_txt'] = _UPTODATE; $item['status_bg'] = '#DDFFDD'; break; case 1: $item['status_txt'] = 'CVS'; $item['status_bg'] = '#DDDDFF'; break; } } $item['description'] = decode_bb_all($item['description'], 0, true); $item['url_short'] = shrink_url($item['url']); $cpgtpl->assign_block_vars('channel.item', array_change_key_case(array_key_prefix($item, 's_'), CASE_UPPER)); } // foreach item } // foreach channel unset($data, $dir, $item, $IOthemes, $IOmodules); $cpgtpl->set_handle('body', 'admin/plugins.html'); $cpgtpl->display('body');
function userinfo($username) { global $db, $prefix, $user_prefix, $currentlang, $pagetitle, $MAIN_CFG, $CPG_SESS, $CLASS, $cpgtpl; $owninfo = is_user() && ($username == is_user() || strtolower($username) == strtolower($CLASS['member']->members[is_user()]['username'])); if ($owninfo) { $userinfo =& $CLASS['member']->members[is_user()]; global $Blocks; $block = array('bid' => 10000, 'view' => 1, 'side' => 'l', 'title' => _TB_BLOCK, 'content' => member_block()); $Blocks->custom($block); $block = NULL; } else { if (!is_user() && $username != 'Anonymous') { URL::redirect(URL::index('&profile=Anonymous')); } else { if (!($userinfo = getusrdata($username)) || $userinfo['user_level'] < 1) { require_once 'header.php'; OpenTable(); echo _NOINFOFOR . ' <strong>' . htmlspecialchars($username) . '</strong>'; if (!$userinfo) { echo '<br /><br /><em>' . _MA_USERNOEXIST . '</em>'; } elseif ($userinfo['user_level'] == 0) { echo '<br /><br /><em>' . _ACCSUSPENDED . '</em>'; } elseif ($userinfo['user_level'] == -1) { echo '<br /><br /><em>' . _ACCDELETED . '</em>'; } CloseTable(); return; } } } $username = $userinfo['username']; $imgpath = 'themes/' . $CPG_SESS['theme'] . '/images/forums/lang_'; $imgpath .= file_exists($imgpath . $currentlang . '/icon_email.gif') ? $currentlang : 'english'; if ($owninfo) { $pagetitle .= ' ' . _BC_DELIM . ' ' . $username . ', ' . _THISISYOURPAGE; } else { $pagetitle .= ' ' . _BC_DELIM . ' ' . _PERSONALINFO . ' ' . _BC_DELIM . ' ' . $username; } require_once 'header.php'; require_once CORE_PATH . 'nbbcode.php'; if ($userinfo['user_avatar_type'] == 1) { $avatar = $MAIN_CFG['avatar']['path'] . '/' . $userinfo['user_avatar']; } else { if ($userinfo['user_avatar_type'] == 2) { $avatar = $userinfo['user_avatar']; } else { if ($userinfo['user_avatar_type'] == 3 && !empty($userinfo['user_avatar'])) { $avatar = $MAIN_CFG['avatar']['gallery_path'] . '/' . $userinfo['user_avatar']; } else { $avatar = $MAIN_CFG['avatar']['gallery_path'] . '/' . $MAIN_CFG['avatar']['default']; } } } if ($avatar) { $avatar = '<img src="' . $avatar . '" alt="" />'; } if ($userinfo['user_website']) { if (false === strpos($userinfo['user_website'], '://')) { $userinfo['user_website'] = "http://{$userinfo['user_website']}"; } } if (!preg_match('#^(http[s]?\\:\\/\\/)?([a-z0-9\\-\\.]+)?[a-z0-9\\-]+\\.[a-z]{2,4}$#i', $userinfo['user_website'])) { $userinfo['user_website'] = ''; } if ($userinfo['user_rank']) { $sql = 'rank_id = ' . $userinfo['user_rank'] . ' AND rank_special = 1'; } else { $sql = 'rank_min <= ' . intval($userinfo['user_posts']) . ' AND rank_special = 0 ORDER BY rank_min DESC'; } list($poster_rank, $rank_image) = $db->sql_ufetchrow('SELECT rank_title, rank_image FROM ' . $prefix . '_bbranks WHERE ' . $sql, SQL_NUM); $poster_rank = $rank_image ? '<img src="' . $rank_image . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" />' : $poster_rank; if (can_admin('members') || $owninfo) { $result = $db->sql_query("SELECT field, langdef, type FROM " . $user_prefix . "_users_fields WHERE section = 2 OR section = 3"); } else { $result = $db->sql_query("SELECT field, langdef, type FROM " . $user_prefix . "_users_fields WHERE section = 2"); } if ($db->sql_numrows($result) > 0) { while ($row = $db->sql_fetchrow($result)) { if ($row['type'] == 1) { $value = $userinfo[$row['field']] ? _YES : _NO; } else { $value = $userinfo[$row['field']]; } if (defined($row['langdef'])) { $row['langdef'] = constant($row['langdef']); } $cpgtpl->assign_block_vars('custom_field', array('NAME' => $row['langdef'], 'VALUE' => $value)); } } $blog_url = 0; if (is_active('Blogs')) { list($num_blogs) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $prefix . "_blogs \n\t\tWHERE aid='{$username}' AND private=0"); if ($num_blogs > 0) { $blog_url = 1; } } $show_email = 0; if ($userinfo['user_viewemail'] && is_user() || $owninfo || is_admin() && !$CLASS['member']->demo) { $email = $userinfo['user_email']; } else { if ($userinfo['femail']) { $email = $userinfo['femail']; } } if (isset($email) && Security::check_email($email)) { $email = 'mailto:' . $email; if (!$owninfo && is_user()) { define('IN_PHPBB', true); define('PHPBB_INSTALLED', true); $phpbb_root_path = "./modules/Forums/"; require_once $phpbb_root_path . 'common.php'; global $board_config; if ($board_config['board_email_form']) { $email = URL::index('Forums&file=profile&mode=email&u=' . $userinfo['user_id']); } } $show_email = 1; } $show_pm = 0; if (!$owninfo && is_user() && is_active('Private_Messages')) { $show_pm = 1; } $show_gallery = 0; if (is_active('coppermine')) { $user_gallery = 10000 + $userinfo['user_id']; $ugall_result = $db->sql_query("SELECT p.pid FROM " . $prefix . "_cpg_pictures AS p, " . $prefix . "_cpg_albums AS a WHERE a.aid = p.aid AND a.category = {$user_gallery}"); if ($db->sql_numrows($ugall_result) > 0) { $show_gallery = 1; } } $cpgtpl->assign_vars(array('ABOUT_USER' => _ABOUT_USER . $username, 'AVATAR' => $avatar, 'JOINED_DATE' => formatDateTime($userinfo['user_regdate'], _DATESTRING3), 'USER_RANK' => $poster_rank, 'USER_LOCATION' => decode_bb_all($userinfo['user_from']), 'USER_WEBSITE' => $userinfo['user_website'], 'USER_OCCUPATION' => decode_bb_all($userinfo['user_occ']), 'USER_INTERESTS' => decode_bb_all($userinfo['user_interests']), 'USER_SIGNATURE' => $userinfo['user_sig'] ? decode_bb_all($userinfo['user_sig'], 1, false) : false, 'USER_EXTRA_INFO' => $userinfo['bio'] ? decode_bb_all($userinfo['bio'], 1, false) : false, 'BLOG_URL' => $blog_url ? URL::index('Blogs&mode=user&nick=' . $username) : false, 'EMAIL_ADDRESS' => $show_email ? $email : false, 'IMG_PATH' => $imgpath, 'U_PM' => $show_pm ? URL::index("Private_Messages&mode=post&u={$userinfo['user_id']}") : false, 'USER_MSNM' => $userinfo['user_msnm'], 'USER_YIM' => $userinfo['user_yim'], 'USER_AIM' => $userinfo['user_aim'], 'USER_ICQ' => $userinfo['user_icq'], 'USER_SKYPE' => $userinfo['user_skype'], 'USER_GALLERY' => $show_gallery ? URL::index('coppermine&cat=' . (10000 + $userinfo['user_id'])) : false, 'OWN_OR_CAN_ADMIN' => $owninfo || can_admin('members'), 'OWN_INFO' => $owninfo, 'SUBSCRIBED' => $userinfo['newsletter'], 'CAN_ADMIN_MEMBERS' => can_admin('members'), 'U_EDIT_USER' => URL::admin('users&mode=edit&edit=profile&id=' . $userinfo['user_id']), 'U_SUSPEND_USER' => URL::admin('users&mode=edit&edit=admin&id=' . $userinfo['user_id']), 'HEADLINES_ALLOWED' => $owninfo && $MAIN_CFG['member']['my_headlines'], 'URL_URI' => URL::uri(), 'SHOW_RSS' => false)); if ($owninfo && $MAIN_CFG['member']['my_headlines']) { $hid = isset($_POST['hid']) ? intval($_POST['hid']) : 0; $url = isset($_POST['url']) ? $_POST['url'] : ''; $sql4 = 'SELECT hid, sitename FROM ' . $prefix . '_headlines ORDER BY sitename'; $headl = $db->sql_query($sql4); while (list($nhid, $hsitename) = $db->sql_fetchrow($headl)) { $sel = $hid == $nhid ? ' selected="selected"' : ''; $cpgtpl->assign_block_vars('feed_option', array('VALUE' => $nhid, 'SELECTED' => $sel, 'NAME' => $hsitename)); } if ($hid > 0 || $hid == 0 && strlen($url) > 10) { if ($hid > 0) { $sql5 = 'SELECT sitename, headlinesurl FROM ' . $prefix . "_headlines WHERE hid='{$hid}'"; $result5 = $db->sql_query($sql5); list($title, $url) = $db->sql_fetchrow($result5); $siteurl = str_ireplace('http://', '', $url); $siteurl = explode('/', $siteurl); } else { if (false === strpos($url, '://')) { $url = 'http://' . $url; } $siteurl = str_ireplace('http://', '', $url); $siteurl = explode('/', $siteurl); $title = 'http://' . $siteurl[0]; } include_once CORE_PATH . 'classes/rss.php'; $content = CPG_RSS::display($url); $cpgtpl->assign_vars(array('SHOW_RSS' => true, 'RSS_CONTENT' => $content, 'RSS_URL' => $siteurl[0], 'RSS_TITLE' => $title)); } } $cpgtpl->set_handle('userinfo', 'your_account/userinfo.html'); $cpgtpl->display('userinfo'); $blocksdir = dir('modules/Your_Account/blocks'); while ($func = $blocksdir->read()) { if (substr($func, -3) == 'php') { $blockslist[] = $func; } } closedir($blocksdir->handle); natcasesort($blockslist); for ($i = 0; $i < sizeof($blockslist); $i++) { require_once 'modules/Your_Account/blocks/' . $blockslist[$i]; } }
$result = $db->sql_query("SELECT * FROM " . $prefix . "_blogs WHERE id='{$disp_id}'"); if ($db->sql_numrows($result) < 1) { cpg_error('<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline"> <tr><td class="row1" colspan="2" align="center" height="30">' . sprintf(_ERROR_NONE_TO_DISPLAY, strtolower(_B_TITLE)) . '</td></tr> </table>'); } list($blog_id, $blog_author, $blog_title, $blog_text, $blog_private, $blog_timestamp) = $db->sql_fetchrow($result); $db->sql_freeresult($result); if ($blog_private && $blog_author != $userinfo['username']) { cpg_error('<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline"> <tr><td class="row1" colspan="2" align="center" height="30">' . _B_PRIVATE . '</td></tr> </table>'); } $result = $db->sql_query("SELECT * FROM " . $prefix . "_blogs_comments WHERE bid='{$blog_id}' ORDER BY timestamp ASC"); $blog_comments = $db->sql_numrows($result); $blog_text = decode_bb_all($blog_text, 1); $blog_timestamp = formatDateTime($blog_timestamp, _DATESTRING); echo '<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline"> <tr><td class="row1" colspan="2"><a href="' . getlink() . '">' . _MAIN . '</a> | ' . (is_user() ? '<a href="' . getlink('&mode=user&nick=' . $userinfo['username']) . '">' . _B_MYBLOG . '</a> | ' : '') . '<a href="' . getlink('&mode=add') . '">' . _B_CREATE_TITLE . '</a></td></tr> <tr><td class="catleft" colspan="2" align="center"><b><span class="gen">' . $blog_title . '</span></b></td></tr> <tr><td class="row1" colspan="2" align="center">' . $blog_timestamp . '</td></tr> <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('&mode=display&id=' . $blog_id) . '">' . _B_COMMENTS_HIDE . '</a>' : '<a href="' . getlink('&mode=display&id=' . $blog_id . '&comments=show') . '">' . _B_COMMENTS . ' (' . $blog_comments . ')</a>') . ' | <a href="' . getlink('Your_Account&op=userinfo&username='******'">' . $blog_author . '\'s ' . _B_PROFILE . '</a>' . ($blog_author == $userinfo['username'] || is_admin() ? ' | <a href="' . getlink('&mode=edit&id=' . $blog_id) . '">' . _B_EDIT_TITLE . '</a>' : '') . ($blog_author == $userinfo['username'] || is_admin() ? ' | <a href="' . getlink('&mode=remove&type=blog&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');
} 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'] : ''; require_once BASEDIR . 'includes/wysiwyg/wysiwyg.inc'; $story_editor = new Wysiwyg('submitnews', 'story', '100%', '200px', $story); $storyext_editor = new Wysiwyg('submitnews', 'storyext', '100%', '300px', $storyext); $story_editor->setHeader(); require_once 'header.php'; OpenTable(); if ($story) { $f_story = decode_bb_all(encode_bbcode($story), 1, true); $f_storyext = decode_bb_all(encode_bbcode($storyext), 1, true); if ($topic < 1) { $topicimage = 'AllTopics.gif'; $warning = '<div style="text-align:center;" class="option">' . _SELECTTOPIC . '</div>'; } else { $warning = ''; $result = $db->sql_query('SELECT topicimage, topictext FROM ' . $prefix . "_topics WHERE topicid='{$topic}'"); list($topicimage, $topictext) = $db->sql_fetchrow($result); } echo '<div style="text-align:center;" class="gen"><b>' . _NEWSUBPREVIEW . '</b></div><br /> <div style="text-align:center;">' . _CHECKSTORY . '</div><br /> <table class="newsarticle" style="width:70%; margin:auto;"><tr><td> <img src="images/topics/' . $topicimage . '" style="border:0; float:right;" alt="' . (isset($topictext) ? $topictext : '') . '" title="' . (isset($topictext) ? $topictext : '') . '" /> <span class="gen"><b>' . $subject . '</b></span><br /><br /> <span style="font-size:10px;">' . $f_story; if ($f_storyext != '') {