function view_logs($user, $start = 0, $limit = 10) { //GRAB AND STORE USER MODULE ID $sql = "SELECT * FROM " . $this->config->db_prefix . "_modules WHERE name = 'class_users'"; $results = $this->db->DB_Q_C($sql); $row = mysql_fetch_array($results); $user_mod_id = $row[0]; //GRAB PERMISSIONS FOR THE USER - A USER CAN ONLY SEE ACCESS LOGS THAT THEY HAVE PERMISSION TOO SEE $mods .= "("; for ($i = 0; $i < count($user->user_perms); $i++) { if ($user->user_perms[$i][0] == 1) { $tmp_var = $i + 1; $mods .= "module_id = {$tmp_var} OR "; } } $mods = substr($mods, 0, strlen($mods) - 4); $mods .= ")"; $sql = "SELECT * FROM \r\r\n " . $this->config->db_prefix . "_logs, \r\r\n " . $this->config->db_prefix . "_object, \r\r\n " . $this->config->db_prefix . "_user \r\r\n WHERE\r\r\n " . $this->config->db_prefix . "_logs.object_id = " . $this->config->db_prefix . "_object.id AND\r\r\n " . $this->config->db_prefix . "_logs.user_id = " . $this->config->db_prefix . "_user.id AND {$mods}\r\r\n ORDER BY " . $this->config->db_prefix . "_logs.id DESC LIMIT {$start}, {$limit}"; $results = $this->db->DB_Q_C($sql); $count = mysql_affected_rows(); //COUNT ALL THE RECORDS IN THE SYSTEM $sql = "SELECT * FROM " . $this->config->db_prefix . "_logs, " . $this->config->db_prefix . "_object, " . $this->config->db_prefix . "_user WHERE\r\r\n " . $this->config->db_prefix . "_logs.object_id = " . $this->config->db_prefix . "_object.id AND\r\r\n " . $this->config->db_prefix . "_logs.user_id = " . $this->config->db_prefix . "_user.id AND {$mods}\r\r\n ORDER BY " . $this->config->db_prefix . "_logs.id DESC"; $results2 = $this->db->DB_Q_C($sql); $total = mysql_affected_rows(); // print "<div id='records'><div id='content'>"; print "<table cellpadding='0' cellspacing='0'>"; print "<tr><th class='record_head'>Access Logs</th></tr>"; if ($count > 0) { if ($total > $count) { $name = array("pid", "cid"); $data = array($_REQUEST['pid'], $_REQUEST['cid']); print "<tr><th colspan='3' class='record_footer'>"; pageNav($start, $limit, $total, $name, $data); print "</th></tr>"; } print "<tr><th>User</th><th>Action</th></tr>"; while ($row = mysql_fetch_array($results)) { //GET AND CONVERT DATE ACCORDINGLY $tmp_date = $this->time->convertTime($user->user_timezone, $row['create_date']); $create_date = DateFormat($tmp_date, $this->config->date_format); if ($striper) { $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\""; } else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } $striper = !$striper; //DETERMINE THE ACTION $sql = "SELECT * FROM " . $this->config->db_prefix . "_modules WHERE id = " . $row['module_id']; $results2 = $this->db->DB_Q_C($sql); $row2 = mysql_fetch_array($results2); // //if($user->user_perms[$row2[0]-1][0]=='1'){ $module = new $row2['name']($this->db, $this->config, $this->time); //} //if($user->user_perms[$mod_id]==1){ print "<tr {$effect}>\r\r\n <td><a class='toolTipElement' title='View::View details about this user.' href='?pid={$user_mod_id}&cid=2&theid=" . $row['user_id'] . "'>" . $row['username'] . "</a></td>\r\r\n <td>" . $module->display_log($row['action'], $row['sub_module_id'], $create_date, $row['record_id']) . "</td>\r\r\n </tr>"; //} } if ($total > $count) { print "<tr><th align='right' colspan='3' class='record_footer'>"; $name = array("pid", "cid"); $data = array($_REQUEST['pid'], $_REQUEST['cid']); pageNav($start, $limit, $total, $name, $data); print "</th></tr>"; print "<tr><th colspan='3' class='record_footer'>"; print "Showing {$count} out of a total of <b>{$total}</b> records in the system</th></tr>"; } else { if ($count > 1) { print "<tr><th colspan='3' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>"; } else { print "<tr><th colspan='3' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>"; } } } else { print "<tr><td>There are no records in the system.</td></tr>"; } print "</table>"; print "</div></div>"; }
$numReplies -= 1; } if ($topic_title == '') { $topic_title = $l_emptyTopic; } if ($i > 0) { $bg = 'tbCel1'; } else { $bg = 'tbCel2'; } if (isset($mod_rewrite) and $mod_rewrite) { $urlp = "{$main_url}/{$forum}_{$topic}_"; } else { $urlp = "{$main_url}/{$indexphp}action=vthread&forum={$forum}&topic={$topic}&page="; } $pageNavCell = pageNav(0, $numReplies + 1, $urlp, $forum == $CONF['forum_submittedarticles'] || $forum == $CONF['forum_gallery'] ? 10 : $viewmaxreplys, TRUE); $whenPosted = convert_date($cols[4]); if (trim($cols[1]) == '') { $cols[1] = $l_emptyTopic; } //Forum icon if (isset($fIcon[$forum])) { $forumIcon = $fIcon[$forum]; } else { $forumIcon = 'default.gif'; } if (isset($mod_rewrite) and $mod_rewrite) { $linkToTopic = "{$main_url}/{$forum}_{$topic}_0.html"; } else { $linkToTopic = "{$main_url}/{$indexphp}action=vthread&forum={$forum}&topic={$topic}"; }
$ids_arr = get_clients_ids_for_user($user_id); $query = "SELECT*FROM `".PLANNER."` WHERE `client_id` IN ('".implode("','",$ids_arr)."')"; $query .= " ORDER BY `exec_datetime`"; // `status` = 'new' /////////////////// page nav /////////////////// $num_row = mysql_query($query,$db); $all_itmes_num = mysql_num_rows($num_row); $one_page_itmes_num = isset($_GET['one_page_itmes_num'])? $_GET['one_page_itmes_num'] : 50 ;// $all_num_page = intval(($all_itmes_num - 1)/ $one_page_itmes_num) + 1; $num_page = ($num_page > $all_num_page)? $all_num_page : $num_page ; $url_query = $_SERVER['QUERY_STRING']; $page_navigation = pageNav($num_page,9,$all_num_page,$url_query); ////////////////////////////////////////////////////////////// $result = mysql_query($query." LIMIT ".($num_page-1)*$one_page_itmes_num.", ".$one_page_itmes_num."",$db); if(mysql_num_rows($result) > 0){ ob_start(); // palnner_rows $tpl_plan_name = './skins/tpl/planner/planner_table_rows.tpl'; $fd = fopen($tpl_plan_name,'r'); $tpl_plan_row = fread($fd,filesize($tpl_plan_name)); fclose($fd);
function fck_file_view($user, $start = 0, $limit = 10) { //SET THE DIRECTORY if (!isset($_REQUEST['dir'])) { $directory = "../../../../../../../" . $this->config->file_dir . "/"; $no_upload = true; } else { $directory = "../../../../../../../" . $this->config->file_dir . "/" . $_REQUEST['dir']; } //READ THE CURRENT DIRECTORY WE ARE IN $dir_list = $this->read_dir($directory); //TRIM OFF OUR ../ OFF OF OUR DIRECTORY $tmp = substr($directory, 21); $dir_pos = explode("/", $tmp); print "<div id='records'><div id='content'>"; print "<table cellpadding='0' cellspacing='0'>"; print "<tr><th class='record_head'>"; //DISPLAY OUR DIRECTOY LINKS $add = ""; for ($i = 0; $i < count($dir_pos) - 1; $i++) { //SPECIAL FOR OUR FIRST, DOESNT NEED ANY DIR VAR if ($i == 0) { print "<a href='?'>" . $dir_pos[$i] . "</a><b>»</b>"; } else { print "<a href='?dir={$add}" . $dir_pos[$i] . "/'>" . $dir_pos[$i] . "</a><b>»</b>"; $add .= $dir_pos[$i] . "/"; } } print "</th></tr>"; //DISPLAY OUR FOLDERS, FOR THE CURRENT DIRECTORY print "<tr><th>Folder Name</th></tr>"; for ($i = 0; $i < count($dir_list); $i++) { if ($dir_list[$i]['type'] == "dir") { $tmp = explode("/", $dir_list[$i]['name']); if ($striper) { $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\""; } else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } $striper = !$striper; print "<tr {$effect}>\r\r\n <td>\r\r\n <img src='../../../../../../../" . $this->config->install_dir . "/images/folder.png' align='left'' alt='folder' />\r\r\n <a href='?pid=" . $this->id . "&dir=" . $add . $tmp[count($tmp) - 2] . "/'>" . $tmp[count($tmp) - 2] . "</a>\r\r\n </td>\r\r\n </tr>"; } } //DISPLAY OUR FILES FOR THE CURRENT DIRECTORY print "<tr><th>File Name</th></tr>"; //GRAB DATA FROM THE DATABASE, SELECT JUST FILES FROM OUR CURRENT DIRECTORY $tmp = substr($directory, 18); $sql = "SELECT * FROM " . $this->config->db_prefix . "_files WHERE\r\r\n location = '{$tmp}' AND\r\r\n extension != 'folder'\r\r\n ORDER BY id DESC LIMIT {$start}, {$limit}"; $results = $this->db->DB_Q_C($sql); $count = mysql_affected_rows(); $sql = "SELECT * FROM " . $this->config->db_prefix . "_files WHERE\r\r\n location = '{$tmp}' AND\r\r\n extension != 'folder'\r\r\n ORDER BY id DESC"; $results2 = $this->db->DB_Q_C($sql); $total = mysql_affected_rows(); //CHECK TO SEE IF WE HAVE ANY RESULTS if ($count > 0) { while ($row = mysql_fetch_array($results)) { /************************************************************************************* VERY IMPORTANT - WE NEED TO ADD THE SITE ROOT TO OUR IMAGE THAT WE RETURN *************************************************************************************/ $tmp_path = $this->config->site_url . substr($row['location'] . $row['sys_name'], 3); //LIVE VERSION if ($striper) { $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\""; } else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } $striper = !$striper; print "<tr {$effect}><td>"; $ext = $row['extension']; if ($row['note'] == "thumbnail") { print "<a href='#' onclick='setImage(\"" . $tmp_path . "\")'><img src='../../../../../../" . $row['location'] . $row['sys_name'] . "' alt='" . $row['name'] . "' border='0' /></a>"; } else { if ($ext == "gif" || $ext == "jpg" || $ext == "jpeg" || $ext == "png" || $ext == "wbmp") { print "<a href='#' onclick='setImage(\"" . $tmp_path . "\")'><img src='../../../../../../" . $row['location'] . "thumbs/" . $row['sys_name'] . "' alt='" . $row['name'] . "' border='0' /></a>"; } else { print "<a href='#' onclick='setImage(\"" . $tmp_path . "\")'>" . $row['name'] . "</a>"; } } print "</td>"; print "</tr>"; } if ($total > $count) { $name = array("pid", "dir"); $data = array($_REQUEST['pid'], $_REQUEST['dir']); pageNav($start, $limit, $total, $name, $data); print "<tr><th class='record_footer' colspan='2'>"; print "Showing {$count} out of a total of <b>{$total}</b> records in the system</th></tr>"; } else { if ($count > 1) { print "<tr><th class='record_footer' colspan='2'>There are a total of <b>{$total}</b> files in this folder</th></tr>"; } else { print "<tr><th class='record_footer'>There is <b>{$total}</b> file in this folder</th></tr>"; } } } else { print "<tr><td>There are no files in this folder.</td></tr>"; } if ($no_upload == false) { print "<tr><th>Upload Files</th></tr>"; print "<tr><td>"; $this->fck_create_form($user); print "</td></tr>"; } // print "</table>"; print "</div></div>"; }
function view($user, $ret_code = 0, $start = 0, $limit = 10) { $sql = "SELECT * FROM " . $this->config->db_prefix . "_user\r\r\n ORDER BY id DESC LIMIT {$start}, {$limit}"; $results = $this->db->DB_Q_C($sql); $count = mysql_affected_rows(); //COUNT ALL THE RECORDS IN THE SYSTEM $sql = "SELECT * FROM " . $this->config->db_prefix . "_user\r\r\n ORDER BY id DESC"; $results2 = $this->db->DB_Q_C($sql); $total = mysql_affected_rows(); // print "<div id='records'><div id='content'>"; if ($ret_code == 0) { } else { if ($ret_code == 1) { print "<table width='100%'>\r\r\n <tr><th class='notice_record_head'>The user has been saved.</th></tr>\r\r\n </table>"; } else { if ($ret_code == 2) { print "<table width='100%'>\r\r\n <tr><th class='notice_record_head'>The user has been deleted.</th></tr>\r\r\n </table>"; } else { if ($ret_code == -2) { print "<table width='100%'>\r\r\n <tr><th class='notice_record_head'>The user has not been deleted.</th></tr>\r\r\n </table>"; } } } } print "<table cellpadding='0' cellspacing='0'>"; print "<tr><th colspan='6' class='record_head'>Site Users</th></tr>"; if ($count > 0) { print "<tr><th>User Name</th><th>Last Login</th><th colspan='3'>Options</th></tr>"; while ($row = mysql_fetch_array($results)) { //GET AND CONVERT DATE ACCORDINGLY $tmp_date = $this->time->convertTime($user->user_timezone, $row['last_log']); $last_log = DateFormat($tmp_date, $this->config->date_format); if ($striper) { $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\""; } else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } $striper = !$striper; print "<tr {$effect}>\r\r\n <td>" . $row['username'] . "</td>\r\r\n <td>" . $last_log . "</td>\r\r\n <td width='23'><a class='toolTipElement' title='User Details::View details about this user.' href='?pid=" . $this->id . "&cid=2&theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>"; if ($user->user_perms[$this->id - 1][2] == 1) { //ONLY THE ADMIN USER AND THIS USER CAN EDIT if ($user->user_id == 1 || $row[0] == $user->user_id) { print "<td width='23'><a class='toolTipElement' title='Edit User::Edit this user.' href='?pid=" . $this->id . "&cid=3&theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='edit' /></a></td>"; } else { print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='' /></td>"; } } else { print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='' /></td>"; } if ($user->user_perms[$this->id - 1][3] == 1) { //ONLY THE ADMIN USER CAN DELETE if ($user->user_id == 1) { print "<td width='23'><a class='toolTipElement' title='Delete User::Delete this user from the system.' href='?pid=" . $this->id . "&cid=4&theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='delete' /></a></td>"; } else { print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='' /></td>"; } } else { print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='' /></td>"; } print "</tr>"; } if ($total > $count) { $name = array("pid", "cid"); $data = array($_REQUEST['pid'], $_REQUEST['cid']); pageNav($start, $limit, $total, $name, $data); print "<tr><th colspan='5' class='record_footer'>"; print "Showing {$count} out of a total of <b>{$total}</b> records in the system</th></tr>"; } else { if ($count > 1) { print "<tr><th colspan='7' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>"; } else { print "<tr><th colspan='7' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>"; } } } else { print "<tr><td>There are no users in the system.</td></tr>"; } print "</table>"; print "</div></div>"; }
} else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } print "<tr {$effect}>\r <td>" . $this->padImage($depth) . " " . $row['name'] . "</td>\r <td>" . $rec_count . "</td>\r <td width='23'><a class='toolTipElement' title='View Category::View the details of this category.' href='?pid=" . $this->id . "&cid=12&theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>"; // if ($user->user_perms[$this->id - 1][5] == 1) { print "<td width='23'><a class='toolTipElement' title='Update Feed::Update the RSS feed for this category.' href='?pid=" . $this->id . "&cid=13&theid=" . $row[0] . "&formprocess=yes&the_action=submitexitok_cats'><img src='images/rss.png' border='0' alt='update feed' /></a></td>"; } else { print "<td width='23'><img src='images/rss_disabled.png' border='0' alt='update feed' /></td>"; } // if ($user->user_perms[$this->id - 1][6] == 1) { print "<td width='23'><a class='toolTipElement' title='Edit Category::Edit this category.' href='?pid=" . $this->id . "&cid=14&theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='' /></a></td>"; } else { print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='edit' /></td>"; } // if ($user->user_perms[$this->id - 1][7] == 1) { print "<td width='23'><a class='toolTipElement' title='Delete Category::Delete this categry from the system.' href='?pid=" . $this->id . "&cid=15&theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='' /></a></td>"; } else { print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='delete' /></td>"; } print "</tr>"; $striper = $this->getChildsForView($user, $row[0], $striper, $depth); } } else { print "<tr><td>There are no categories in the system.</td></tr>"; } print "</table>\r </div></div>"; } /****************************************************************************************** view - view entries in the database, in a table format ******************************************************************************************/ function view($user, $ret_code = 0, $start = 0, $limit = 10) { /******************************************************************** NOT PUBLISHED ARTICLES ********************************************************************/ $sql = "SELECT * FROM " . $this->config->db_prefix . "_news WHERE\r " . $this->config->db_prefix . "_news.published = 0\r ORDER BY id DESC "; $results = $this->db->DB_Q_C($sql); $count = mysql_affected_rows(); print "<div id='records'><div id='content'>"; //CHECK RETURN CODE, SPIT OUT THE CORRECT MESSAGE if ($ret_code == -100) { print "<table width='100%'>\r <tr><th class='notice_record_head'>There was an error with the request. Please try again.</th></tr>\r </table>"; } else { if ($ret_code == 0) { } else { if ($ret_code == 1) { print "<table width='100%'>\r <tr><th class='notice_record_head'>The news article has been published and is live on your site.</th></tr>\r </table>"; } else { if ($ret_code == -1) { print "<table width='100%'>\r <tr><th class='notice_record_head'>The news article has not been published.</th></tr>\r </table>"; } else { if ($ret_code == 2) { print "<table width='100%'>\r <tr><th class='notice_record_head'>The news article has been deleted.</th></tr>\r </table>"; } else { if ($ret_code == -2) { print "<table width='100%'>\r <tr><th class='notice_record_head'>The news article has not been deleted.</th></tr>\r </table>"; } else { if ($ret_code == 3) { print "<table width='100%'>\r <tr><th class='notice_record_head'>The news article has been saved.</th></tr>\r </table>"; } else { if ($ret_code == 4) { print "<table width='100%'>\r <tr><th class='notice_record_head'>The news comment has been saved.</th></tr>\r </table>"; } else { if ($ret_code == 5) { print "<table width='100%'>\r <tr><th class='notice_record_head'>The news comment has been deleted.</th></tr>\r </table>"; } else { if ($ret_code == -5) { print "<table width='100%'>\r <tr><th class='notice_record_head'>The news comment has not been deleted.</th></tr>\r </table>"; } } } } } } } } } } print "<table cellpadding='0' cellspacing='0'>\r <tr><th colspan='5' class='record_head'>Articles waiting to be published</th></tr>"; if ($count > 0) { print "<tr><th>Title</th><th colspan='4'>Options</th></tr>"; while ($row = mysql_fetch_array($results)) { if ($striper) { $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\""; } else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } $striper = !$striper; print "<tr {$effect}>\r <td width='100%'>" . stripslashes($row['title']) . "</td>\r <td width='23'><a class='toolTipElement' title='Article Details::View details about the news article.' href='?pid=" . $this->id . "&cid=2&theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>"; // if ($user->user_perms[$this->id - 1][4] == 1) { print "<td width='23'><a class='toolTipElement' title='Article Publishing::Publish this news article.' href='?pid=" . $this->id . "&cid=5&theid=" . $row[0] . "'><img src='images/publish.png' border='0' alt='publish' /></a></td>"; } else { print "<td width='23'><img src='images/publish_disabled.png' border='0' alt='' /></td>"; } // if ($user->user_perms[$this->id - 1][2] == 1) { print "<td width='23'><a class='toolTipElement' title='Article Editing::Edit this news article.' href='?pid=" . $this->id . "&cid=3&theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='' /></a></td>"; } else { print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='' /></td>"; } // if ($user->user_perms[$this->id - 1][3] == 1) { print "<td width='23'><a class='toolTipElement' title='Article Deletion::Delete this news article from the system.' href='?pid=" . $this->id . "&cid=4&theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='' /></a></td>"; } else { print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='' /></td>"; } print "</tr>"; } if ($count > 1) { print "<tr><th colspan='5' class='record_footer'>There are a total of <b>{$count}</b> records waiting to be published</th></tr>"; } else { print "<tr><th colspan='5' class='record_footer'>There is <b>{$count}</b> record waiting to be published</th></tr>"; } } else { print "<tr><td colspan='5'>There are no news articles in the system.</td></tr>"; } print "</table>\r </div></div>"; /******************************************************************** PUBLISHED ARTICLES ********************************************************************/ $sql = "SELECT * FROM " . $this->config->db_prefix . "_news WHERE\r " . $this->config->db_prefix . "_news.published = 1\r ORDER BY id DESC LIMIT {$start}, {$limit}"; $results = $this->db->DB_Q_C($sql); $count = mysql_affected_rows(); //COUNT ALL THE RECORDS IN THE SYSTEM $sql = "SELECT * FROM " . $this->config->db_prefix . "_news WHERE\r " . $this->config->db_prefix . "_news.published = 1\r ORDER BY id DESC"; $results2 = $this->db->DB_Q_C($sql); $total = mysql_affected_rows(); // print "<div id='records'><div id='content'>\r <table cellpadding='0' cellspacing='0'>\r <tr><th colspan='4' class='record_head'>Published Articles</th></tr>"; if ($count > 0) { print "<tr><th>Title</th><th colspan='3'>Options</th></tr>"; while ($row = mysql_fetch_array($results)) { if ($striper) {
//echo $sqlStr; if ($row = db_searchSelect(0, $table, 'count(*)', $sqlStr)) { $numRows = $row[0]; } else { $numRows = 0; } if ($numRows == 0) { $warning = '<span class="warning">' . $l_searchFailed . '</span>'; } else { $warning = $l_recordsFound . ' ' . $numRows; /* Finally! We get all topics/messages list */ $phrase1 = urlencode($phrase); if ($phrase1 != '') { $navUrl .= "&phrase={$phrase1}"; } $pageNav = pageNav($page, $numRows, "{$main_url}/{$indexphp}action=search{$navUrl}&searchGo=1", $viewmaxsearch, FALSE, 'Gen'); $makeLim = makeLim($page, $numRows, $viewmaxsearch); $searchResults = ''; if ($where == 0) { /* If we search by messages, first select the messages, then their topic titles. 2 requests */ $searchTopics = array(); $searchData = array(); $i = 0; if ($row = db_searchSelect(0, $Tp, 'post_id, forum_id, topic_id, post_time, post_text', $sqlStr, $makeLim, 'post_id desc')) { do { if (!in_array($row[2], $searchTopics)) { $searchTopics[] = $row[2]; } $txt = highlightText($row[4], $phrase, $searchType); $searchData[$i] = array('post_id' => $row[0], 'forum_id' => $row[1], 'forum_name' => isset($forums[$row[1]]) ? $forums[$row[1]] : 'N/A', 'topic_id' => $row[2], 'datetime' => $row[3], 'text' => $txt); $i++;
$topicAuthor = $cols[3]; if ($i > 0) { $bg = 'tbCel1'; } else { $bg = 'tbCel2'; } if (isset($mod_rewrite) and $mod_rewrite) { $urlp = genTopicURL($main_url, $forum, $fTitle[$forum], $topic, $topic_title); $urlForum = addForumURLPage(genForumURL($main_url, $forum, $fTitle[$forum]), PAGE1_OFFSET + 1); $urlType = 'Topic'; } else { $urlp = "{$main_url}/{$indexphp}action=vthread&forum={$forum}&topic={$topic}"; $urlForum = "{$main_url}/{$indexphp}action=vtopic&forum={$forum}"; $urlType = 'Gen'; } $pageNavCell = pageNav(PAGE1_OFFSET + 1, $numReplies + 1, $urlp, $viewmaxreplys, TRUE, $urlType); $whenPosted = convert_date($cols[4]); if (trim($cols[1]) == '') { $cols[1] = $l_emptyTopic; } //Forum icon if (isset($fIcon[$forum])) { $forumIcon = $fIcon[$forum]; } else { $forumIcon = 'default.gif'; } if (isset($mod_rewrite) and $mod_rewrite) { $linkToTopic = addTopicURLPage(genTopicURL($main_url, $forum, $fTitle[$forum], $topic, $topic_title), PAGE1_OFFSET + 1); } else { $linkToTopic = "{$main_url}/{$indexphp}action=vthread&forum={$forum}&topic={$topic}"; }
function view($user, $ret_code = 0, $start = 0, $limit = 10) { print "<div id='records'><div id='content'>"; /****************************************************************************************** EXPIRED EVENTS ******************************************************************************************/ print "<table cellpadding='0' cellspacing='0'>\r\r\n <tr><th colspan='5' class='record_head'>Expired Events</th></tr>"; $sql = "SELECT * FROM " . $this->config->db_prefix . "_events \r\r\n WHERE\r\r\n " . $this->config->db_prefix . "_events.id NOT IN\r\r\n (\r\r\n SELECT event_id \r\r\n FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE \r\r\n event_date >= '" . date('Y-m-d') . "'\r\r\n ) \r\r\n ORDER BY (\r\r\n SELECT event_date \r\r\n FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE \r\r\n event_id = " . $this->config->db_prefix . "_events.id\r\r\n ORDER BY event_date DESC LIMIT 1 \r\r\n ) ASC"; $results = $this->db->DB_Q_C($sql); $count = mysql_affected_rows(); //COUNT ALL THE RECORDS IN THE SYSTEM $sql = "SELECT * FROM " . $this->config->db_prefix . "_events \r\r\n WHERE\r\r\n " . $this->config->db_prefix . "_events.id NOT IN\r\r\n (\r\r\n SELECT event_id \r\r\n FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE \r\r\n event_date >= '" . date('Y-m-d') . "'\r\r\n ) \r\r\n ORDER BY (\r\r\n SELECT event_date \r\r\n FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE \r\r\n event_id = " . $this->config->db_prefix . "_events.id\r\r\n ORDER BY event_date DESC LIMIT 1 \r\r\n ) ASC\r\r\n LIMIT {$start}, {$limit}"; $results2 = $this->db->DB_Q_C($sql); $total = mysql_affected_rows(); if ($count > 0) { print "<tr><th>Title</th><th colspan='3'>Options</th></tr>"; while ($row = mysql_fetch_array($results)) { if ($striper) { $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\""; } else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } $striper = !$striper; print "<tr {$effect}>\r\r\n <td>" . stripslashes($row['title']) . "</td>\r\r\n <td width='23'><a class='toolTipElement' title='View Details::View details about the event.' href='?pid=" . $this->id . "&cid=2&theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>"; // if ($user->user_perms[$this->id - 1][2] == 1) { print "<td width='23'><a class='toolTipElement' title='Edit Events::Edit this event.' href='?pid=" . $this->id . "&cid=3&theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='' /></a></td>"; } else { print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='' /></td>"; } // if ($user->user_perms[$this->id - 1][3] == 1) { print "<td width='23'><a class='toolTipElement' title='Delete Events::Delete this event from the system.' href='?pid=" . $this->id . "&cid=4&theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='' /></a></td>"; } else { print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='' /></td>"; } print "</tr>"; } if ($count > 1) { print "<tr><th colspan='5' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>"; } else { print "<tr><th colspan='5' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>"; } } else { print "<tr><td colspan='5'>There are no expired events in the system.</td></tr>"; } print "</table>"; /****************************************************************************************** ACTIVE/UPCOMING EVENTS ******************************************************************************************/ print "<table cellpadding='0' cellspacing='0'>\r\r\n <tr><th colspan='6' class='record_head'>Active/Upcoming Events</th></tr>"; $sql = "SELECT * FROM " . $this->config->db_prefix . "_events \r\r\n WHERE\r\r\n " . $this->config->db_prefix . "_events.id IN\r\r\n (\r\r\n SELECT event_id \r\r\n FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE \r\r\n event_date >= '" . date('Y-m-d') . "'\r\r\n ) \r\r\n ORDER BY (\r\r\n SELECT event_date \r\r\n FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE \r\r\n event_id = " . $this->config->db_prefix . "_events.id\r\r\n ORDER BY event_date DESC LIMIT 1 \r\r\n ) ASC\r\r\n LIMIT {$start}, {$limit}"; $results = $this->db->DB_Q_C($sql); $count = mysql_affected_rows(); //COUNT ALL THE RECORDS IN THE SYSTEM $sql = "SELECT * FROM " . $this->config->db_prefix . "_events \r\r\n WHERE\r\r\n " . $this->config->db_prefix . "_events.id IN\r\r\n (\r\r\n SELECT event_id \r\r\n FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE \r\r\n event_date >= '" . date('Y-m-d') . "'\r\r\n ) \r\r\n ORDER BY (\r\r\n SELECT event_date \r\r\n FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE \r\r\n event_id = " . $this->config->db_prefix . "_events.id\r\r\n ORDER BY event_date DESC LIMIT 1 \r\r\n ) ASC\r\r\n LIMIT {$start}, {$limit}"; $results2 = $this->db->DB_Q_C($sql); $total = mysql_affected_rows(); if ($count > 0) { print "<tr><th>Title</th><th>Event Date/Times</th><th colspan='3'>Options</th></tr>"; $check_date = date('Y-m-d'); while ($row = mysql_fetch_array($results)) { if ($striper) { $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\""; } else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } $striper = !$striper; //COUNT THE NUMBER OF THE EVENT DATES //IF MORE THEN ONE DISPLAY EARLIEST TO THE LATEST $sql = "SELECT * FROM " . $this->config->db_prefix . "_events_data \r\r\n WHERE event_id = " . $row[0] . " \r\r\n ORDER BY event_date ASC"; $results3 = $this->db->DB_Q_C($sql); $total_dates = mysql_affected_rows(); $more_dates = ""; while ($row3 = mysql_fetch_array($results3)) { $tmp1 = explode(" ", $row3['event_date']); //ADD OUR START DATE'S TIME WITH THE DURATION OF THE EVENT TO GET THE END TIME $tmp_start = explode(":", $tmp1[1]); $tmp_end = explode(":", $row3['duration']); $tmp_min = $tmp_start[1] + $tmp_end[1]; $tmp_hour1 = $tmp_start[0] + $tmp_end[0]; $tmp_hour = floor($tmp_min / 60) + $tmp_hour1; if ($tmp_hour < 10) { $tmp_hour = "0{$tmp_hour}"; } $tmp_min = ($tmp_min / 60 - $tmp_hour_add) * 60; $tmp3 = $tmp_hour . ":" . $tmp_min . ":00"; $end_time = $tmp1[0] . " " . $tmp3; //CONVERT OUR DATES FOR DISPLAy if ($user->user_timezone != $row3['tz']) { $tmp_date = $this->time->convertTime($user->user_timezone, $row3['event_date']); $event_date = DateFormat($tmp_date, "l m/d/Y"); $time_start = DateFormat($tmp_date, "g:ia"); $tmp_date = $this->time->convertTime($user->user_timezone, $end_time); $time_end = DateFormat($tmp_date, "g:ia"); } else { $event_date = DateFormat($row3['event_date'], "l m/d/Y"); $time_start = DateFormat($row3['event_date'], "g:ia"); $time_end = DateFormat($end_time, "g:ia"); } // if ($row3['event_date'] >= $check_date) { if ($time_start == $time_end) { $time_str = $time_start; } else { $time_str = "{$time_start} - {$time_end}"; } $more_dates .= "<a href='#' class='toolTipElement' title='{$event_date}::{$time_str}'><img src='images/calendar_view_day.png' /></a>"; } else { $more_dates .= "<a href='#' class='toolTipElement' title='{$event_date}::This event has expired.'><img src='images/calendar_view_day_expired.png' /></a>"; } //$more_dates.= "<a href='#' class='toolTipElement' title='$event_date::$time_start - $time_end'><img src='images/calendar_view_day.png' /></a>"; } //$more_dates.=" - <i>$total_dates</i>"; print "<tr {$effect}>\r\r\n <td>" . stripslashes($row['title']) . "</td>\r\r\n <td>{$more_dates}</td>\r\r\n <td width='23'><a class='toolTipElement' title='View Details::View details about the event.' href='?pid=" . $this->id . "&cid=2&theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>\r\r\n <td width='23'><a class='toolTipElement' title='Edit Events::Edit this event.' href='?pid=" . $this->id . "&cid=3&theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='' /></a></td>\r\r\n <td width='23'><a class='toolTipElement' title='Delete Events::Delete this event from the system.' href='?pid=" . $this->id . "&cid=4&theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='' /></a></td>\r\r\n </tr>"; } if ($total > $count) { $name = array("pid", "cid"); $data = array($_REQUEST['pid'], $_REQUEST['cid']); pageNav($start, $limit, $total, $name, $data); print "<tr><th colspan='5' class='record_footer'>\r\r\n Showing {$count} out of a total of <b>{$total}</b> records in the system</th></tr>"; } else { if ($count > 1) { print "<tr><th colspan='6' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>"; } else { print "<tr><th colspan='6' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>"; } } } else { print "<tr><td>There are no events in the system.</td></tr>"; } print "</table>"; print "</div></div>"; }
$searchResults = '<span class=txtSm>' . $l_search[10] . '</span>'; } else { if (!isset($searchResults)) { $searchResults = ''; } $i = $viewmaxsearch * $page; $and = $extra && !$searchWhere ? 'AND' : 'WHERE'; $xtrE = $extra == 1 ? getClForums($closedForums, $and, $sTA[$searchWhere], 'forum_id', 'AND', '!=') : ''; $and = $extra || !$searchWhere ? 'AND' : 'WHERE'; $xtr = $xtrE . getByDay($and, $sTA[$searchWhere], $sTTA[$searchWhere]) . db_searchWithin($searchWhere, true); if (!$searchWhere) { $numRows = db_simpleSelect(2, $sCA[$searchWhere], 'count(*)', $Tp . '.topic_id', '=', "{$Tt}.topic_id"); } else { $numRows = db_simpleSelect(2, $sCA[$searchWhere], 'count(*)'); } $pageNav = pageNav($page, $numRows, "{$main_url}/{$indexphp}action=search&searchFor={$searchFor}&searchWhere={$searchWhere}&searchHow={$searchHow}&searchForum={$searchForum}&days={$days}&exact={$exact}&page=", $viewmaxsearch, false); $makeLim = makeLim($page, $numRows, $viewmaxsearch); $xtr = str_replace('WHERE', 'AND', $xtr); if ($searchWhere == 0 && $numRows) { $xtr .= db_searchWithin($searchWhere, false); $cols = db_simpleSelect(0, $Tp . ',' . $Tt . ',' . $Tf, "{$Tp}.post_id, {$Tp}.forum_id, {$Tp}.topic_id, {$Tp}.post_text, {$Tp}.post_time, {$Tt}.topic_title, {$Tf}.forum_name", '', '', '', 'post_id DESC', $makeLim, $Tp . '.topic_id', '=', $Tt . '.topic_id', false); do { $i++; $forum = $cols[1]; $topic = $cols[2]; $pageAnchor = db_searchDeSlice(false, $cols[0]); $searchResults .= '<b>' . $i . '. </b><span class=txtSm>' . $l_posted . ': ' . $cols[4] . '</span> - <a href="' . $indexphp . 'action=vtopic&forum=' . $forum . '&page=' . db_searchDeSlice(true, $topic) . '"><b>' . $cols[6] . '</b></a> <b>—›</b> <a href="' . $indexphp . 'action=vthread&forum=' . $forum . '&topic=' . $topic . '">' . $cols[5] . '</a><br>' . "\n" . ' <span class=txtSm><a href="' . $indexphp . 'action=vthread&forum=' . $forum . '&topic=' . $topic . '&page=' . $pageAnchor[0] . $pageAnchor[1] . '">' . substr(strip_tags($cols[3]), 0, 81) . '...</a></span><br><br>' . "\n"; } while ($cols = db_simpleSelect(1)); } elseif ($searchWhere == 1 && $numRows) { $cols = db_simpleSelect(0, $Tt . ',' . $Tf, "{$Tt}.topic_id, {$Tt}.forum_id, {$Tt}.topic_title, {$Tt}.topic_time, {$Tf}.forum_name", '', '', '', "{$Tt}.topic_id DESC", $makeLim, $Tt . '.forum_id', '=', $Tf . '.forum_id', false);
$rDate = convert_date($row[2]); $lReplies = $row[5]; $numReplies = $row[6]; $Results .= ParseTpl($Rest); } while ($row = db_deadUsers(1, $less)); } $warning = $l_recordsFound . ' ' . $num; } } elseif ($searchus == 'notmember') { $makeLim = ''; $num = 0; if ($row = db_simpleSelect(0, $Tu, 'count(*)', $dbUserAct, '=', '0')) { $num = $row[0]; } $makeLim = makeLim($page, $num, $viewmaxsearch); $pageNav = pageNav($page, $num, "{$main_url}/{$bb_admin}action=searchusers2&whatus={$whatus}&searchus=notmember", $viewmaxsearch, FALSE); if ($row = db_simpleSelect(0, $Tu, $dbUserId . ',' . $dbUserSheme['username'][1] . ',' . $dbUserDate . ',' . $dbUserSheme['user_password'][1] . ',' . $dbUserSheme['user_email'][1] . ', ' . $dbUserSheme['num_posts'][1], $dbUserAct, '=', '0', "{$dbUserId} ASC", $makeLim)) { $tot = 0; $whatus = ''; do { $Rest = $tR; $idArray .= $row[0] . ', '; $numReplies = $row[5]; if ($numReplies > 0) { $delCheckBox = ''; $RES1 = $result; $CNT1 = $countRes; if ($lRepl = db_simpleSelect(0, $Tp, 'post_time', 'poster_id', '=', $row[0], 'post_id DESC', 1)) { $lReplies = convert_date($lRepl[0]); } } else {
$topicDesc = 1; $topic_reverse = "<img src=\"{$main_url}/img/topic_reverse.gif\" align=\"middle\" border=\"0\" alt=\"\" /> "; } if ($page == -1 and $topicDesc == 0) { $page = pageChk($page, $numRows, $viewmaxreplys); } elseif ($page == -1 and $topicDesc == 1) { $page = PAGE1_OFFSET + 1; } if (isset($mod_rewrite) and $mod_rewrite) { $urlp = genTopicURL($main_url, $forum, $forumName, $topic, $topicData[0]); $urlType = 'Topic'; } else { $urlp = "{$main_url}/{$indexphp}action=vthread&forum={$forum}&topic={$topic}"; $urlType = 'Gen'; } $pageNav = pageNav($page, $numRows, $urlp, $viewmaxreplys, FALSE, $urlType); if ($pageNav != '') { $mbpn = 'mb'; } $makeLim = makeLim($page, $numRows, $viewmaxreplys); $anchor = 1; if ($page == PAGE1_OFFSET + 1) { $anchor2 = 1; } else { $anchor2 = ($page - PAGE1_OFFSET - 1) * $viewmaxreplys + 1; } $i = 1; $ii = 0; if (isset($themeDesc) and in_array($topic, $themeDesc)) { $srt = 'DESC'; } else {
function view_templates($user, $ret_code = 0, $start = 0, $limit = 10) { //GRAB OUR TEMPLATES $sql = "SELECT * FROM " . $this->config->db_prefix . "_block_template\n\n ORDER BY id DESC LIMIT {$start}, {$limit}"; $results = $this->db->DB_Q_C($sql); $count = mysql_affected_rows(); //COUNT ALL THE RECORDS IN THE SYSTEM $sql = "SELECT * FROM " . $this->config->db_prefix . "_block_template\n\n ORDER BY id DESC"; $results2 = $this->db->DB_Q_C($sql); $total = mysql_affected_rows(); // print "<div id='records'><div id='content'>"; //DISPLAY ANY MESSAGES HERE if ($ret_code == 0) { } else { if ($ret_code == 1) { print "<table width='100%'>\n\n <tr><th class='notice_record_head'>The template has been saved.</th></tr>\n\n </table>"; } else { if ($ret_code == 2) { print "<table width='100%'>\n\n <tr><th class='notice_record_head'>The template has been removed from the system.</th></tr>\n\n </table>"; } else { if ($ret_code == 3) { print "<table width='100%'>\n\n <tr><th class='notice_record_head'>The template has not been removed from the system.</th></tr>\n\n </table>"; } } } } //PRINT OUR OUR TEMPLATES print "<table cellpadding='0' cellspacing='0'>\n\n <tr><th colspan='4' class='record_head'>Templates</th></tr>"; if ($count > 0) { print "<tr><th>Title</th><th colspan='3'>Options</th></tr>"; while ($row = mysql_fetch_array($results)) { if ($striper) { $effect = "class='odd' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='odd'\""; } else { $effect = "class='even' onMouseOver=\"this.className='over'\" onMouseout=\"this.className='even'\""; } $striper = !$striper; print "<tr {$effect}>\n\n <td width='100%'>" . stripslashes($row['name']) . "</td>\n\n <td width='23'><a class='toolTipElement' title='Template Details::View details about this template.' href='?pid=" . $this->id . "&cid=2&theid=" . $row[0] . "'><img src='images/preview.png' border='0' alt='view' /></a></td>"; // if ($user->user_perms[$this->id - 1][2] == 1) { print "<td width='23'><a class='toolTipElement' title='Template Editing::Edit this template.' href='?pid=" . $this->id . "&cid=3&theid=" . $row[0] . "'><img src='images/edit.png' border='0' alt='' /></a></td>"; } else { print "<td width='23'><img src='images/edit_disabled.png' border='0' alt='' /></td>"; } // if ($user->user_perms[$this->id - 1][3] == 1) { print "<td width='23'><a class='toolTipElement' title='Template Deletion::Delete this template from the system.' href='?pid=" . $this->id . "&cid=4&theid=" . $row[0] . "'><img src='images/delete.png' border='0' alt='' /></a></td>"; } else { print "<td width='23'><img src='images/delete_disabled.png' border='0' alt='' /></td>"; } print "</tr>"; } if ($total > $count) { $name = array("pid", "cid"); $data = array($_REQUEST['pid'], $_REQUEST['cid']); pageNav($start, $limit, $total, $name, $data); print "<tr><th colspan='4' class='record_footer'>\n\n Showing {$count} out of a total of <b>{$total}</b> records in the system</th></tr>"; } else { if ($count > 1) { print "<tr><th colspan='4' class='record_footer'>There are a total of <b>{$total}</b> records in the system</th></tr>"; } else { print "<tr><th colspan='4' class='record_footer'>There is <b>{$total}</b> record in the system</th></tr>"; } } } else { print "<tr><td colspan='4'>There are no templates in the system.</td></tr>"; } print "</table>\n\n </div></div>"; }
$tot++; $result = $RES1; $countRes = $CNT1; } while ($row = db_simpleSelect(1)); } $warning = $l_recordsFound . ' ' . $tot; } elseif ($searchus == 'registr') { $num = 0; if (!preg_match("/^[12][019][0-9][0-9]-[01][0-9]-[0123][0-9]\$/", $whatus)) { $warning = $l_wrongData; } else { $less = $whatus . ' 00:00:00'; if ($row = db_deadUsers(0, $less)) { $num = $countRes; $makeLim = makeLim($page, $num, $viewmaxsearch); $pageNav = pageNav($page, $num, "{$bb_admin}action=searchusers2&whatus={$whatus}&searchus=registr&page=", $viewmaxsearch, FALSE); $Results = ''; $row = db_deadUsers(0, $less); do { $Rest = $tR; $rDate = convert_date($row[2]); $lReplies = $row[5]; $Results .= ParseTpl($Rest); } while ($row = db_deadUsers(1, $less)); } $warning = $l_recordsFound . ' ' . $num; } } else { $tot = 0; if ($row = db_simpleSelect(0, $Tu, $dbUserId . ',' . $dbUserSheme['username'][1] . ',' . $dbUserDate . ',' . $dbUserSheme['user_password'][1] . ',' . $dbUserSheme['user_email'][1], $dbUserId, '=', $whatus)) { $Results = makeUp('admin_searchusersres');
if (isset($pVals[$topic][1])) { $lastPoster = $pVals[$topic][1]; } else { $lastPoster = 'N/A'; } if (isset($pVals[$topic][2])) { $lastPostDate = convert_date($pVals[$topic][2]); } else { $lastPostDate = 'N/A'; } if (isset($mod_rewrite) and $mod_rewrite) { $urlp = "{$main_url}/{$forum}_{$topic}_"; } else { $urlp = "{$main_url}/{$indexphp}action=vthread&forum={$forum}&topic={$topic}&page="; } $pageNavCell = pageNav(0, $numReplies + 1, $urlp, $viewmaxreplys, TRUE); if ($cols[7] == 1 and $cols[5] == 1) { $tpcIcon = 'stlock'; } elseif ($cols[7] == 1) { $tpcIcon = 'sticky'; } elseif ($cols[5] == 1) { $tpcIcon = 'locked'; } elseif ($numReplies <= 0) { $tpcIcon = 'empty'; } elseif ($numReplies >= $viewmaxreplys) { $tpcIcon = 'hot'; } else { $tpcIcon = 'default'; } if (isset($mod_rewrite) and $mod_rewrite) { $linkToTopic = "{$main_url}/{$forum}_{$topic}_0.html";