本文整理汇总了PHP中gmdate_format函数的典型用法代码示例。如果您正苦于以下问题:PHP gmdate_format函数的具体用法?PHP gmdate_format怎么用?PHP gmdate_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gmdate_format函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_file
function load_file($url)
{
if (($file = @file_get_contents_emulate($url)) !== false) {
$this->data = new FeedData();
if (preg_match('`<item>(.*)</item>`is', $file)) {
$expParsed = explode('<item>', $file);
$nbItems = count($expParsed) - 1 > $nbItems ? $nbItems : count($expParsed) - 1;
$this->data->set_date(preg_match('`<!-- RSS generated by PHPBoost on (.*) -->`is', $expParsed[0], $var) ? $var[1] : '');
$this->data->set_title(preg_match('`<title>(.*)</title>`is', $expParsed[0], $var) ? $var[1] : '');
$this->data->set_link(preg_match('`<atom:link href="(.*)" rel="self" type="application/rss+xml" />`is', $expParsed[0], $var) ? $var[1] : '');
$this->data->set_host(preg_match('`<link>(.*)</link>`is', $expParsed[0], $var) ? $var[1] : '');
$this->data->set_desc(preg_match('`<description>(.*)</description>`is', $expParsed[0], $var) ? $var[1] : '');
$this->data->set_lang(preg_match('`<language>(.*)</language>`is', $expParsed[0], $var) ? $var[1] : '');
for ($i = 1; $i <= $nbItems; $i++) {
$item = new FeedItem();
$item->set_title(preg_match('`<title>(.*)</title>`is', $expParsed[$i], $title) ? $title[1] : '');
$item->set_link(preg_match('`<link>(.*)</link>`is', $expParsed[$i], $url) ? $url[1] : '');
$item->set_guid(preg_match('`<guid>(.*)</guid>`is', $expParsed[$i], $guid) ? $guid[1] : '');
$item->set_desc(preg_match('`<desc>(.*)</desc>`is', $expParsed[$i], $desc) ? $desc[1] : '');
$item->set_date_rfc822(preg_match('`<pubDate>(.*)</pubDate>`is', $expParsed[$i], $date) ? gmdate_format('date_format_tiny', strtotime($date[1])) : '');
$this->data->add_item($item);
}
return true;
}
return false;
}
return false;
}
示例2: load_file
function load_file($url)
{
if (($file = @file_get_contents_emulate($url)) !== false) {
$this->data = new FeedData();
if (preg_match('`<entry>(.*)</entry>`is', $file)) {
$expParsed = explode('<entry>', $file);
$nbItems = count($expParsed) - 1 > $nbItems ? $nbItems : count($expParsed) - 1;
$this->data->set_date(preg_match('`<updated>(.*)</updated>`is', $expParsed[0], $var) ? $var[1] : '');
$this->data->set_title(preg_match('`<title>(.*)</title>`is', $expParsed[0], $var) ? $var[1] : '');
$this->data->set_link(preg_match('`<link href="(.*)"/>`is', $expParsed[0], $var) ? $var[1] : '');
$this->data->set_host(preg_match('`<link href="(.*)"/>`is', $expParsed[0], $var) ? $var[1] : '');
for ($i = 1; $i <= $nbItems; $i++) {
$item = new FeedItem();
$item->set_title(preg_match('`<title>(.*)</title>`is', $expParsed[$i], $title) ? $title[1] : '');
$item->set_link(preg_match('`<link href="(.*)"/>`is', $expParsed[$i], $url) ? $url[1] : '');
$item->set_guid(preg_match('`<id>(.*)</id>`is', $expParsed[$i], $guid) ? $guid[1] : '');
$item->set_desc(preg_match('`<summary>(.*)</summary>`is', $expParsed[$i], $desc) ? $desc[1] : '');
$item->set_date_rfc3339(preg_match('`<updated>(.*)</updated>`is', $expParsed[$i], $date) ? gmdate_format('date_format_tiny', strtotime($date[1])) : '');
$this->data->add_item($item);
}
return true;
}
return false;
}
return false;
}
示例3: change_day
function change_day()
{
global $Sql, $CONFIG_USER;
#######Taches de maintenance#######
$yesterday_timestamp = time() - 86400;
$Sql->query_inject("INSERT INTO " . DB_TABLE_STATS . " (stats_year, stats_month, stats_day, nbr, pages, pages_detail) VALUES ('" . gmdate_format('Y', $yesterday_timestamp, TIMEZONE_SYSTEM) . "', '" . gmdate_format('m', $yesterday_timestamp, TIMEZONE_SYSTEM) . "', '" . gmdate_format('d', $yesterday_timestamp, TIMEZONE_SYSTEM) . "', 0, 0, '')", __LINE__, __FILE__);
$last_stats = $Sql->insert_id("SELECT MAX(id) FROM " . PREFIX . "stats");
#######Statistiques#######
$Sql->query_inject("UPDATE " . DB_TABLE_STATS_REFERER . " SET yesterday_visit = today_visit", __LINE__, __FILE__);
$Sql->query_inject("UPDATE " . DB_TABLE_STATS_REFERER . " SET today_visit = 0, nbr_day = nbr_day + 1", __LINE__, __FILE__);
$Sql->query_inject("DELETE FROM " . DB_TABLE_STATS_REFERER . " WHERE last_update < '" . (time() - 604800) . "'", __LINE__, __FILE__);
$pages_displayed = pages_displayed();
import('io/filesystem/file');
$pages_file = new File(PATH_TO_ROOT . '/cache/pages.txt');
$pages_file->delete();
$total_visit = $Sql->query("SELECT total FROM " . DB_TABLE_VISIT_COUNTER . " WHERE id = 1", __LINE__, __FILE__);
$Sql->query_inject("DELETE FROM " . DB_TABLE_VISIT_COUNTER . " WHERE id <> 1", __LINE__, __FILE__);
$Sql->query_inject("UPDATE " . DB_TABLE_VISIT_COUNTER . " SET time = '" . gmdate_format('Y-m-d', time(), TIMEZONE_SYSTEM) . "', total = 1 WHERE id = 1", __LINE__, __FILE__);
$Sql->query_inject("INSERT INTO " . DB_TABLE_VISIT_COUNTER . " (ip, time, total) VALUES('" . USER_IP . "', '" . gmdate_format('Y-m-d', time(), TIMEZONE_SYSTEM) . "', '0')", __LINE__, __FILE__);
$Sql->query_inject("UPDATE " . DB_TABLE_STATS . " SET nbr = '" . $total_visit . "', pages = '" . array_sum($pages_displayed) . "', pages_detail = '" . addslashes(serialize($pages_displayed)) . "' WHERE id = '" . $last_stats . "'", __LINE__, __FILE__);
Session::garbage_collector();
import('io/filesystem/folder');
$week = 3600 * 24 * 7;
$cache_image_folder_path = new Folder(PATH_TO_ROOT . '/images/maths/');
foreach ($cache_image_folder_path->get_files('`\\.png$`') as $image) {
if (time() - $image->get_last_modification_date() > $week) {
$image->delete();
}
}
import('modules/modules_discovery_service');
$modules_loader = new ModulesDiscoveryService();
$modules = $modules_loader->get_available_modules('on_changeday');
foreach ($modules as $module) {
if ($module->is_enabled()) {
$module->functionality('on_changeday');
}
}
$CONFIG_USER['delay_unactiv_max'] = $CONFIG_USER['delay_unactiv_max'] * 3600 * 24;
if (!empty($CONFIG_USER['delay_unactiv_max']) && $CONFIG_USER['activ_mbr'] != 2) {
$Sql->query_inject("DELETE FROM " . DB_TABLE_MEMBER . " WHERE timestamp < '" . (time() - $CONFIG_USER['delay_unactiv_max']) . "' AND user_aprob = 0", __LINE__, __FILE__);
}
if ($CONFIG_USER['verif_code'] == '1') {
$Sql->query_inject("DELETE FROM " . DB_TABLE_VERIF_CODE . " WHERE timestamp < '" . (time() - 3600 * 24) . "'", __LINE__, __FILE__);
}
import('core/updates');
new Updates();
}
示例4: while
while ($row = $Sql->fetch_assoc($result)) {
if (!empty($row['last_view_id'])) {
$last_msg_id = $row['last_view_id'];
$last_page = 'idm=' . $row['last_view_id'] . '&';
$last_page_rewrite = '-0-' . $row['last_view_id'];
} else {
$last_msg_id = $row['last_msg_id'];
$last_page = ceil($row['t_nbr_msg'] / $CONFIG_FORUM['pagination_msg']);
$last_page_rewrite = $last_page > 1 ? '-' . $last_page : '';
$last_page = $last_page > 1 ? 'pt=' . $last_page . '&' : '';
}
$last_topic_title = ($CONFIG_FORUM['activ_display_msg'] && $row['display_msg'] ? $CONFIG_FORUM['display_msg'] : '') . ' ' . ucfirst($row['title']);
$last_topic_title = strlen(html_entity_decode($last_topic_title, ENT_COMPAT, 'ISO-8859-1')) > 25 ? substr_html($last_topic_title, 0, 25) . '...' : $last_topic_title;
$last_topic_title = addslashes($last_topic_title);
$row['login'] = !empty($row['login']) ? $row['login'] : $LANG['guest'];
$contents .= '<tr><td class="forum_notread" style="width:100%"><a href="topic' . url('.php?' . $last_page . 'id=' . $row['tid'], '-' . $row['tid'] . $last_page_rewrite . '+' . addslashes(url_encode_rewrite($row['title'])) . '.php') . '#m' . $last_msg_id . '"><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a> <a href="topic' . url('.php?id=' . $row['tid'], '-' . $row['tid'] . '+' . addslashes(url_encode_rewrite($row['title'])) . '.php') . '" class="small_link">' . $last_topic_title . '</a></td><td class="forum_notread" style="white-space:nowrap">' . ($row['last_user_id'] != '-1' ? '<a href="../member/member' . url('.php?id=' . $row['last_user_id'], '-' . $row['last_user_id'] . '.php') . '" class="small_link">' . addslashes($row['login']) . '</a>' : '<em>' . addslashes($LANG['guest']) . '</em>') . '</td><td class="forum_notread" style="white-space:nowrap">' . gmdate_format('date_format', $row['last_timestamp']) . '</td></tr>';
$nbr_msg_not_read++;
}
$Sql->query_close($result);
$max_visible_topics = 10;
$height_visible_topics = $nbr_msg_not_read < $max_visible_topics ? 23 * $nbr_msg_not_read : 23 * $max_visible_topics;
echo "array_unread_topics[0] = '" . $nbr_msg_not_read . "';\n";
echo "array_unread_topics[1] = '" . '<a class="small_link" href="../forum/unread.php' . SID . '" title="' . addslashes($LANG['show_not_reads']) . '">' . addslashes($LANG['show_not_reads']) . ($User->get_attribute('user_id') !== -1 ? ' (' . $nbr_msg_not_read . ')' : '') . '</a>' . "';\n";
echo "array_unread_topics[2] = '" . '<div class="row2" style="width:438px;height:' . max($height_visible_topics, 65) . 'px;overflow:auto;padding:0px;" onmouseover="forum_hide_block(\\\'forum_unread\\\', 1);" onmouseout="forum_hide_block(\\\'forum_unread\\\', 0);"><table class="module_table" style="margin:2px;width:99%">' . $contents . "</table></div>';";
} else {
echo '';
}
} elseif (retrieve(GET, 'del', false)) {
$Session->csrf_get_protect();
include_once '../forum/forum.class.php';
$Forumfct = new Forum();
示例5: retrieve
$idcat = retrieve(POST, 'idcat', 0);
$compt = retrieve(POST, 'compt', 0);
$aprob = retrieve(POST, 'aprob', 0);
if (!empty($title) && !empty($url) && !empty($idcat)) {
$Sql->query_inject("UPDATE " . PREFIX . "web SET title = '" . $title . "', contents = '" . $contents . "', url = '" . $url . "', idcat = '" . $idcat . "', compt = '" . $compt . "', aprob = '" . $aprob . "' WHERE id = '" . $id_post . "'", __LINE__, __FILE__);
redirect(HOST . SCRIPT);
} else {
redirect(HOST . DIR . '/web/admin_web.php?id= ' . $id_post . '&error=incomplete#errorh');
}
} elseif ($del && !empty($id)) {
$Session->csrf_get_protect();
$Sql->query_inject("DELETE FROM " . PREFIX . "web WHERE id = '" . $id . "'", __LINE__, __FILE__);
$Sql->query_inject("DELETE FROM " . DB_TABLE_COM . " WHERE idprov = '" . $id . "' AND script = 'web'", __LINE__, __FILE__);
redirect(HOST . SCRIPT);
} else {
$Template->set_filenames(array('admin_web_management' => 'web/admin_web_management.tpl'));
$nbr_web = $Sql->count_table('web', __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('PAGINATION' => $Pagination->display('admin_web.php?p=%d', $nbr_web, 'p', 25, 3), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'KERNEL_EDITOR' => display_editor(), 'L_WEB_ADD' => $LANG['web_add'], 'L_WEB_MANAGEMENT' => $LANG['web_management'], 'L_WEB_CAT' => $LANG['cat_management'], 'L_WEB_CONFIG' => $LANG['web_config'], 'L_DEL_ENTRY' => $LANG['delete_link'], 'L_LISTE' => $LANG['list'], 'L_NAME' => $LANG['name'], 'L_CATEGORY' => $LANG['category'], 'L_URL' => $LANG['url'], 'L_VIEW' => $LANG['view'], 'L_DATE' => $LANG['date'], 'L_APROB' => $LANG['aprob'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete']));
$result = $Sql->query_while("SELECT d.*, ad.name \n\tFROM " . PREFIX . "web d \n\tLEFT JOIN " . PREFIX . "web_cat ad ON ad.id = d.idcat\n\tORDER BY timestamp DESC \n\t" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$aprob = $row['aprob'] == 1 ? $LANG['yes'] : $LANG['no'];
$title = $row['title'];
$title = strlen($title) > 45 ? substr_html($title, 0, 45) . '...' : $title;
$Template->assign_block_vars('web', array('IDWEB' => $row['id'], 'NAME' => $title, 'IDCAT' => $row['idcat'], 'CAT' => $row['name'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'APROBATION' => $aprob, 'COMPT' => $row['compt']));
}
$Sql->query_close($result);
$Template->pparse('admin_web_management');
}
require_once '../admin/admin_footer.php';
示例6: foreach
foreach ($array_cat_list as $key_cat => $option_value) {
$cat_list .= $key_cat == $info_pics['idcat'] ? sprintf($option_value, 'selected="selected"') : sprintf($option_value, '');
}
$activ_note = $CONFIG_GALLERY['activ_note'] == 1 && $User->check_level(MEMBER_LEVEL);
if ($activ_note) {
import('content/note');
$Note = new Note('gallery', $info_pics['id'], url('.php?cat=' . $info_pics['idcat'] . '&id=' . $info_pics['id'], '-' . $info_pics['idcat'] . '-' . $info_pics['id'] . '.php'), $CONFIG_GALLERY['note_max'], '', NOTE_DISPLAY_NOTE);
}
if ($thumbnails_before < $nbr_pics_display_before) {
$end_thumbnails += $nbr_pics_display_before - $thumbnails_before;
}
if ($thumbnails_after < $nbr_pics_display_after) {
$start_thumbnails += $nbr_pics_display_after - $thumbnails_after;
}
$html_protected_name = strprotect($info_pics['name'], HTML_PROTECT, ADDSLASHES_FORCE);
$Template->assign_vars(array('C_GALLERY_PICS_MAX' => true, 'C_GALLERY_PICS_MODO' => $is_modo ? true : false, 'ID' => $info_pics['id'], 'IMG_MAX' => '<img src="show_pics' . url('.php?id=' . $g_idpics . '&cat=' . $g_idcat) . '" alt="" />', 'NAME' => '<span id="fi_' . $info_pics['id'] . '">' . $info_pics['name'] . '</span> <span id="fi' . $info_pics['id'] . '"></span>', 'POSTOR' => '<a class="small_link" href="../member/member' . url('.php?id=' . $info_pics['user_id'], '-' . $info_pics['user_id'] . '.php') . '">' . $info_pics['login'] . '</a>', 'DATE' => gmdate_format('date_format_short', $info_pics['timestamp']), 'VIEWS' => $info_pics['views'] + 1, 'DIMENSION' => $info_pics['width'] . ' x ' . $info_pics['height'], 'SIZE' => number_round($info_pics['weight'] / 1024, 1), 'COM' => Comments::com_display_link($info_pics['nbr_com'], '../gallery/gallery' . url('.php?cat=' . $info_pics['idcat'] . '&id=' . $info_pics['id'] . '&com=0&sort=' . $g_sort, '-' . $info_pics['idcat'] . '-' . $info_pics['id'] . '.php?com=0&sort=' . $g_sort), $info_pics['id'], 'gallery'), 'KERNEL_NOTATION' => $activ_note ? $Note->display_form() : '', 'COLSPAN' => $CONFIG_GALLERY['nbr_column'] + 2, 'CAT' => $cat_list, 'RENAME' => $html_protected_name, 'RENAME_CUT' => $html_protected_name, 'IMG_APROB' => get_ulang() . '/' . ($info_pics['aprob'] == 1 ? 'unvisible.png' : 'visible.png'), 'ARRAY_JS' => $array_js, 'NBR_PICS' => $i - 1, 'MAX_START' => $i - 1 - $nbr_column_pics, 'START_THUMB' => $pos_pics - $start_thumbnails > 0 ? $pos_pics - $start_thumbnails : 0, 'END_THUMB' => $pos_pics + $end_thumbnails, 'L_KB' => $LANG['unit_kilobytes'], 'L_INFORMATIONS' => $LANG['informations'], 'L_NAME' => $LANG['name'], 'L_POSTOR' => $LANG['postor'], 'L_VIEWS' => $LANG['views'], 'L_ADD_ON' => $LANG['add_on'], 'L_DIMENSION' => $LANG['dimension'], 'L_SIZE' => $LANG['size'], 'L_NOTE' => $LANG['note'], 'L_COM' => $LANG['com'], 'L_EDIT' => $LANG['edit'], 'L_APROB_IMG' => $info_pics['aprob'] == 1 ? $LANG['unaprob'] : $LANG['aprob'], 'L_THUMBNAILS' => $LANG['thumbnails'], 'U_DEL' => url('.php?del=' . $info_pics['id'] . '&token=' . $Session->get_token() . '&cat=' . $g_idcat, '-' . $g_idcat . '.php?token=' . $Session->get_token() . '&del=' . $info_pics['id']), 'U_MOVE' => url('.php?id=' . $info_pics['id'] . '&token=' . $Session->get_token() . '&move=\' + this.options[this.selectedIndex].value', '-0-' . $info_pics['id'] . '.php?token=' . $Session->get_token() . '&move=\' + this.options[this.selectedIndex].value'), 'U_PREVIOUS' => $pos_pics > 0 ? '<a href="gallery' . url('.php?cat=' . $g_idcat . '&id=' . $id_previous, '-' . $g_idcat . '-' . $id_previous . '.php') . '#pics_max"><img src="../templates/' . get_utheme() . '/images/left.png" alt="" class="valign_middle" /></a> <a href="gallery' . url('.php?cat=' . $g_idcat . '&id=' . $id_previous, '-' . $g_idcat . '-' . $id_previous . '.php') . '#pics_max">' . $LANG['previous'] . '</a>' : '', 'U_NEXT' => $pos_pics < $i - 1 ? '<a href="gallery' . url('.php?cat=' . $g_idcat . '&id=' . $id_next, '-' . $g_idcat . '-' . $id_next . '.php') . '#pics_max">' . $LANG['next'] . '</a> <a href="gallery' . url('.php?cat=' . $g_idcat . '&id=' . $id_next, '-' . $g_idcat . '-' . $id_next . '.php') . '#pics_max"><img src="../templates/' . get_utheme() . '/images/right.png" alt="" class="valign_middle" /></a>' : '', 'U_LEFT_THUMBNAILS' => $pos_pics - $start_thumbnails > 0 ? '<span id="display_left"><a href="javascript:display_thumbnails(\'left\')"><img src="../templates/' . get_utheme() . '/images/left.png" class="valign_middle" alt="" /></a></span>' : '<span id="display_left"></span>', 'U_RIGHT_THUMBNAILS' => $pos_pics - $start_thumbnails <= $i - 1 - $nbr_column_pics ? '<span id="display_right"><a href="javascript:display_thumbnails(\'right\')"><img src="../templates/' . get_utheme() . '/images/right.png" class="valign_middle" alt="" /></a></span>' : '<span id="display_right"></span>'));
$i = 0;
foreach ($array_pics as $pics) {
if ($i >= $pos_pics - $start_thumbnails && $i <= $pos_pics + $end_thumbnails) {
$Template->assign_block_vars('list_preview_pics', array('PICS' => $pics));
}
$i++;
}
if (isset($_GET['com'])) {
$Template->assign_vars(array('COMMENTS' => display_comments('gallery', $g_idpics, url('gallery.php?cat=' . $g_idcat . '&id=' . $g_idpics . '&com=%s', 'gallery-' . $g_idcat . '-' . $g_idpics . '.php?com=%s'))));
}
}
} else {
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('C_GALLERY_MODO' => $is_modo ? true : false, 'PAGINATION_PICS' => $Pagination->display('gallery' . url('.php?pp=%d&cat=' . $g_idcat, '-' . $g_idcat . '+' . $rewrite_title . '.php?pp=%d'), $nbr_pics, 'pp', $CONFIG_GALLERY['nbr_pics_max'], 3), 'L_EDIT' => $LANG['edit'], 'L_VIEW' => $LANG['view'], 'L_VIEWS' => $LANG['views']));
示例7: list
case 'gif':
case 'bmp':
list($width_source, $height_source) = @getimagesize('../upload/' . $row['path']);
$size_img = ' (' . $width_source . 'x' . $height_source . ')';
$width_source = !empty($width_source) ? $width_source + 30 : 0;
$height_source = !empty($height_source) ? $height_source + 30 : 0;
$bbcode = '[img]/upload/' . $row['path'] . '[/img]';
$link = '<a class="com" href="javascript:popup_upload(\'' . $row['id'] . '\', ' . $width_source . ', ' . $height_source . ', \'yes\')">';
break;
case 'mp3':
$bbcode = '[sound]/upload/' . $row['path'] . '[/sound]';
$link = '<a class="com" href="javascript:popup_upload(\'' . $row['id'] . '\', 220, 10, \'no\')">';
break;
default:
$bbcode = '[url=/upload/' . $row['path'] . ']' . $row['name'] . '[/url]';
$link = '<a class="com" href="../upload/' . $row['path'] . '">';
}
$Template->assign_block_vars('files', array('ID' => $row['id'], 'IMG' => '<img src="../templates/' . get_utheme() . '/images/upload/' . $get_img_mimetype['img'] . '" alt="" />', 'URL' => $link, 'NAME' => $name_cut, 'RENAME_FILE' => '<span id="fihref' . $row['id'] . '"><a href="javascript:display_rename_file(\'' . $row['id'] . '\', \'' . addslashes($row['name']) . '\', \'' . addslashes($name_cut) . '\');" title="' . $LANG['edit'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" alt="" style="vertical-align:middle;" /></a></span>', 'FILETYPE' => $get_img_mimetype['filetype'] . $size_img, 'BBCODE' => '<input size="25" type="text" class="text" onclick="select_div(\'text_' . $row['id'] . '\');" id="text_' . $row['id'] . '" style="margin-top:2px;cursor:pointer;" value="' . $bbcode . '" />', 'SIZE' => $row['size'] > 1024 ? number_round($row['size'] / 1024, 2) . ' ' . $LANG['unit_megabytes'] : number_round($row['size'], 0) . ' ' . $LANG['unit_kilobytes'], 'DATE' => gmdate_format('date_format', $row['timestamp']), 'LOGIN' => '<a href="../member/member.php?id=' . $row['user_id'] . '">' . $row['login'] . '</a>', 'U_MOVE' => '.php?movefi=' . $row['id'] . '&f=' . $folder . '&fm=' . $row['user_id']));
$total_folder_size += $row['size'];
$total_files++;
}
$Sql->query_close($result);
}
$total_size = $Sql->query("SELECT SUM(size) FROM " . PREFIX . "upload", __LINE__, __FILE__);
$Template->assign_vars(array('TOTAL_SIZE' => $total_size > 1024 ? number_round($total_size / 1024, 2) . ' ' . $LANG['unit_megabytes'] : number_round($total_size, 0) . ' ' . $LANG['unit_kilobytes'], 'TOTAL_FOLDER_SIZE' => $total_folder_size > 1024 ? number_round($total_folder_size / 1024, 2) . ' ' . $LANG['unit_megabytes'] : number_round($total_folder_size, 0) . ' ' . $LANG['unit_kilobytes'], 'TOTAL_FOLDERS' => $total_directories, 'TOTAL_FILES' => $total_files));
if ($total_directories == 0 && $total_files == 0 && (!empty($folder) || !empty($show_member))) {
$Template->assign_vars(array('C_EMPTY_FOLDER' => true, 'L_EMPTY_FOLDER' => $LANG['empty_folder']));
}
$Template->pparse('admin_files_management');
}
require_once '../admin/admin_footer.php';
示例8: ceil
}
$img_announce .= $row['type'] == '1' ? '_post' : '';
$img_announce .= $row['type'] == '2' ? '_top' : '';
$img_announce .= $row['status'] == '0' && $row['type'] == '0' ? '_lock' : '';
if (!empty($row['last_view_id'])) {
$last_msg_id = $row['last_view_id'];
$last_page = 'idm=' . $row['last_view_id'] . '&';
$last_page_rewrite = '-0-' . $row['last_view_id'];
} else {
$last_msg_id = $row['last_msg_id'];
$last_page = ceil($row['nbr_msg'] / $CONFIG_FORUM['pagination_msg']);
$last_page_rewrite = $last_page > 1 ? '-' . $last_page : '';
$last_page = $last_page > 1 ? 'pt=' . $last_page . '&' : '';
}
$rewrited_title = $CONFIG['rewrite'] == 1 ? '+' . url_encode_rewrite($row['title']) : '';
$last_msg = '<a href="topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . $rewrited_title . '.php') . '#m' . $last_msg_id . '" title=""><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a>' . ' ' . $LANG['on'] . ' ' . gmdate_format('date_format', $row['last_timestamp']) . '<br /> ' . $LANG['by'] . ' ' . (!empty($row['last_login']) ? '<a class="small_link" href="../member/member' . url('.php?id=' . $row['last_user_id'], '-' . $row['last_user_id'] . '.php') . '">' . wordwrap_html($row['last_login'], 13) . '</a>' : '<em>' . $LANG['guest'] . '</em>');
$new_ancre = '<a href="topic' . url('.php?' . $last_page . 'id=' . $row['id'], '-' . $row['id'] . $last_page_rewrite . $rewrited_title . '.php') . '#m' . $last_msg_id . '" title=""><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a>';
$Template->assign_block_vars('topics', array('C_IMG_POLL' => !empty($row['question']), 'C_IMG_TRACK' => !empty($row['idtrack']), 'C_DISPLAY_MSG' => $CONFIG_FORUM['activ_display_msg'] && $CONFIG_FORUM['icon_activ_display_msg'] && $row['display_msg'], 'C_HOT_TOPIC' => $row['type'] == '0' && $row['status'] != '0' && $row['nbr_msg'] > $CONFIG_FORUM['pagination_msg'], 'IMG_ANNOUNCE' => $img_announce, 'ANCRE' => $new_ancre, 'TYPE' => $type[$row['type']], 'TITLE' => ucfirst($row['title']), 'AUTHOR' => !empty($row['login']) ? '<a href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '" class="small_link">' . $row['login'] . '</a>' : '<em>' . $LANG['guest'] . '</em>', 'DESC' => $row['subtitle'], 'PAGINATION_TOPICS' => $Pagination->display('topic' . url('.php?id=' . $row['id'] . '&pt=%d', '-' . $row['id'] . '-%d.php'), $row['nbr_msg'], 'pt', $CONFIG_FORUM['pagination_msg'], 2, 10, false), 'MSG' => $row['nbr_msg'] - 1, 'VUS' => $row['nbr_views'], 'U_TOPIC_VARS' => url('.php?id=' . $row['id'], '-' . $row['id'] . $rewrited_title . '.php'), 'U_LAST_MSG' => $last_msg, 'L_DISPLAY_MSG' => $CONFIG_FORUM['activ_display_msg'] && $row['display_msg'] ? $CONFIG_FORUM['display_msg'] : ''));
}
$Sql->query_close($result);
$nbr_topics = $Sql->query("SELECT COUNT(*)\n\tFROM " . PREFIX . "forum_view v\n\tLEFT JOIN " . PREFIX . "forum_topics t ON t.id = v.idtopic\n\tWHERE t.last_timestamp >= '" . $max_time . "' AND v.user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__);
if ($nbr_topics == 0) {
$Template->assign_vars(array('C_NO_TOPICS' => true, 'L_NO_TOPICS' => '0 ' . $LANG['no_last_read']));
}
$Template->assign_vars(array('FORUM_NAME' => $CONFIG_FORUM['forum_name'], 'SID' => SID, 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'PAGINATION' => $Pagination->display('lastread' . url('.php?p=%d'), $nbr_topics, 'p', $CONFIG_FORUM['pagination_topic'], 3), 'LANG' => get_ulang(), 'U_CHANGE_CAT' => 'unread.php' . SID . '&token=' . $Session->get_token(), 'U_ONCHANGE' => url(".php?id=' + this.options[this.selectedIndex].value + '", "-' + this.options[this.selectedIndex].value + '.php"), 'U_ONCHANGE_CAT' => url("index.php?id=' + this.options[this.selectedIndex].value + '", "cat-' + this.options[this.selectedIndex].value + '.php"), 'U_FORUM_CAT' => '<a href="../forum/lastread.php' . SID . '">' . $LANG['show_last_read'] . '</a>', 'U_POST_NEW_SUBJECT' => '', 'L_FORUM_INDEX' => $LANG['forum_index'], 'L_FORUM' => $LANG['forum'], 'L_AUTHOR' => $LANG['author'], 'L_TOPIC' => $nbr_topics > 1 ? $LANG['topic_s'] : $LANG['topic'], 'L_MESSAGE' => $LANG['replies'], 'L_ANSWERS' => $LANG['answers'], 'L_VIEW' => $LANG['views'], 'L_LAST_MESSAGE' => $LANG['last_message']));
list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script = '/forum/lastread.php'");
$Template->assign_vars(array('TOTAL_ONLINE' => $total_online, 'USERS_ONLINE' => $total_online - $total_visit == 0 ? '<em>' . $LANG['no_member_online'] . '</em>' : $users_list, 'ADMIN' => $total_admin, 'MODO' => $total_modo, 'MEMBER' => $total_member, 'GUEST' => $total_visit, 'SELECT_CAT' => forum_list_cat(0, 0), 'L_USER' => $total_online > 1 ? $LANG['user_s'] : $LANG['user'], 'L_ADMIN' => $total_admin > 1 ? $LANG['admin_s'] : $LANG['admin'], 'L_MODO' => $total_modo > 1 ? $LANG['modo_s'] : $LANG['modo'], 'L_MEMBER' => $total_member > 1 ? $LANG['member_s'] : $LANG['member'], 'L_GUEST' => $total_visit > 1 ? $LANG['guest_s'] : $LANG['guest'], 'L_AND' => $LANG['and'], 'L_ONLINE' => strtolower($LANG['online'])));
$Template->pparse('forum_topics');
} else {
redirect(HOST . DIR . '/forum/index.php' . SID2);
}
示例9: redirect
} else {
redirect(HOST . SCRIPT . url('?add=1&error=incomplete', '', '&') . '#errorh');
}
} else {
redirect(HOST . SCRIPT . url('?add=1&error=invalid_date', '', '&') . '#errorh');
}
} else {
$Template->set_filenames(array('calendar' => 'calendar/calendar.tpl'));
$time = gmdate_format('YmdHi');
$year = substr($time, 0, 4);
$month = substr($time, 4, 2);
$day = substr($time, 6, 2);
$hour = substr($time, 8, 2);
$min = substr($time, 10, 2);
$array_l_month = array($LANG['january'], $LANG['february'], $LANG['march'], $LANG['april'], $LANG['may'], $LANG['june'], $LANG['july'], $LANG['august'], $LANG['september'], $LANG['october'], $LANG['november'], $LANG['december']);
$Template->assign_vars(array('C_CALENDAR_FORM' => true, 'KERNEL_EDITOR' => display_editor(), 'UPDATE' => url('?add=1&token=' . $Session->get_token()), 'DATE' => gmdate_format('date_format_short'), 'DAY_DATE' => $day, 'MONTH_DATE' => $month, 'YEAR_DATE' => $year, 'HOUR' => $hour, 'MIN' => $min, 'CONTENTS' => '', 'TITLE' => '', 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_EDIT_EVENT' => $LANG['add_event'], 'L_DATE_CALENDAR' => $LANG['date_calendar'], 'L_ON' => $LANG['on'], 'L_AT' => stripslashes($LANG['at']), 'L_TITLE' => $LANG['title'], 'L_ACTION' => $LANG['action'], 'L_SUBMIT' => $LANG['submit'], 'L_RESET' => $LANG['reset']));
$get_error = retrieve(GET, 'error', '');
switch ($get_error) {
case 'invalid_date':
$errstr = $LANG['e_invalid_date'];
break;
case 'incomplete':
$errstr = $LANG['e_incomplete'];
break;
default:
$errstr = '';
}
if (!empty($errstr)) {
$Errorh->handler($errstr, E_USER_NOTICE);
}
$Template->pparse('calendar');
示例10: import
$Template->set_filenames(array('admin_poll_management' => 'poll/admin_poll_management.tpl'));
$nbr_poll = $Sql->count_table('poll', __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('PAGINATION' => $Pagination->display('admin_poll.php?p=%d', $nbr_poll, 'p', 20, 3), 'LANG' => get_ulang(), 'L_CONFIRM_ERASE_POOL' => $LANG['confirm_del_poll'], 'L_POLL_MANAGEMENT' => $LANG['poll_management'], 'L_POLL_ADD' => $LANG['poll_add'], 'L_POLL_CONFIG' => $LANG['poll_config'], 'L_REQUIRE' => $LANG['require'], 'L_QUESTION' => $LANG['question'], 'L_POLLS' => $LANG['polls'], 'L_DATE' => $LANG['date'], 'L_ARCHIVED' => $LANG['archived'], 'L_PSEUDO' => $LANG['pseudo'], 'L_APROB' => $LANG['aprob'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete'], 'L_SHOW' => $LANG['show']));
$result = $Sql->query_while("SELECT p.id, p.question, p.archive, p.timestamp, p.visible, p.start, p.end, m.login \n\tFROM " . PREFIX . "poll p\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON p.user_id = m.user_id\t\n\tORDER BY p.timestamp DESC \n\t" . $Sql->limit($Pagination->get_first_msg(20, 'p'), 20), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
if ($row['visible'] == 2) {
$aprob = $LANG['waiting'];
} elseif ($row['visible'] == 1) {
$aprob = $LANG['yes'];
} else {
$aprob = $LANG['no'];
}
$archive = $row['archive'] == 1 ? $LANG['yes'] : $LANG['no'];
$question = strlen($row['question']) > 45 ? substr($row['question'], 0, 45) . '...' : $row['question'];
$visible = '';
if ($row['start'] > 0) {
$visible .= gmdate_format('date_format_short', $row['start']);
}
if ($row['end'] > 0 && $row['start'] > 0) {
$visible .= ' ' . strtolower($LANG['until']) . ' ' . gmdate_format('date_format_short', $row['end']);
} elseif ($row['end'] > 0) {
$visible .= $LANG['until'] . ' ' . gmdate_format('date_format_short', $row['end']);
}
$Template->assign_block_vars('questions', array('QUESTIONS' => $question, 'IDPOLL' => $row['id'], 'PSEUDO' => !empty($row['login']) ? $row['login'] : $LANG['guest'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'ARCHIVES' => $archive, 'APROBATION' => $aprob, 'VISIBLE' => !empty($visible) ? '(' . $visible . ')' : ''));
}
$Sql->query_close($result);
$Template->pparse('admin_poll_management');
}
require_once '../admin/admin_footer.php';
示例11: foreach
$array_js .= 'array_pics[' . $i . '][\'path\'] = \'' . $row['path'] . "';\n";
$i++;
}
$Sql->query_close($result);
if ($thumbnails_before < $nbr_pics_display_before) {
$end_thumbnails += $nbr_pics_display_before - $thumbnails_before;
}
if ($thumbnails_after < $nbr_pics_display_after) {
$start_thumbnails += $nbr_pics_display_after - $thumbnails_after;
}
$Template->assign_vars(array('ARRAY_JS' => $array_js, 'NBR_PICS' => $i - 1, 'MAX_START' => $i - 1 - $nbr_column_pics, 'START_THUMB' => $pos_pics - $start_thumbnails > 0 ? $pos_pics - $start_thumbnails : 0, 'END_THUMB' => $pos_pics + $end_thumbnails, 'L_INFORMATIONS' => $LANG['informations'], 'L_NAME' => $LANG['name'], 'L_POSTOR' => $LANG['postor'], 'L_VIEWS' => $LANG['views'], 'L_ADD_ON' => $LANG['add_on'], 'L_DIMENSION' => $LANG['dimension'], 'L_SIZE' => $LANG['size'], 'L_EDIT' => $LANG['edit'], 'L_APROB_IMG' => $info_pics['aprob'] == 1 ? $LANG['unaprob'] : $LANG['aprob'], 'L_THUMBNAILS' => $LANG['thumbnails']));
$cat_list = '';
foreach ($array_cat_list as $key_cat => $option_value) {
$cat_list .= $key_cat == $info_pics['idcat'] ? sprintf($option_value, 'selected="selected"') : sprintf($option_value, '');
}
$Template->assign_block_vars('pics.pics_max', array('ID' => $info_pics['id'], 'IMG' => '<img src="show_pics.php?id=' . $idpics . '&cat=' . $idcat . '" alt="" / >', 'NAME' => '<span id="fi_' . $info_pics['id'] . '">' . $info_pics['name'] . '</span> <span id="fi' . $info_pics['id'] . '"></span>', 'POSTOR' => '<a class="com" href="../member/member' . url('.php?id=' . $info_pics['user_id'], '-' . $info_pics['user_id'] . '.php') . '">' . $info_pics['login'] . '</a>', 'DATE' => gmdate_format('date_format_short', $info_pics['timestamp']), 'VIEWS' => $info_pics['views'] + 1, 'DIMENSION' => $info_pics['width'] . ' x ' . $info_pics['height'], 'SIZE' => number_round($info_pics['weight'] / 1024, 1), 'COLSPAN' => $CONFIG_GALLERY['nbr_column'] + 2, 'CAT' => $cat_list, 'RENAME' => addslashes($info_pics['name']), 'RENAME_CUT' => addslashes($info_pics['name']), 'IMG_APROB' => $info_pics['aprob'] == 1 ? 'unvisible.png' : 'visible.png', 'U_DEL' => 'php?del=' . $info_pics['id'] . '&cat=' . $idcat . '&token=' . $Session->get_token(), 'U_MOVE' => '.php?id=' . $info_pics['id'] . '&token=' . $Session->get_token() . '&move=\' + this.options[this.selectedIndex].value', 'U_PREVIOUS' => $pos_pics > 0 ? '<a href="admin_gallery.php?cat=' . $idcat . '&id=' . $id_previous . '#pics_max"><img src="../templates/' . get_utheme() . '/images/left.png" alt="" class="valign_middle" /></a> <a href="admin_gallery.php?cat=' . $idcat . '&id=' . $id_previous . '#pics_max">' . $LANG['previous'] . '</a>' : '', 'U_NEXT' => $pos_pics < $i - 1 ? '<a href="admin_gallery.php?cat=' . $idcat . '&id=' . $id_next . '#pics_max">' . $LANG['next'] . '</a> <a href="admin_gallery.php?cat=' . $idcat . '&id=' . $id_next . '#pics_max"><img src="../templates/' . get_utheme() . '/images/right.png" alt="" class="valign_middle" /></a>' : '', 'U_LEFT_THUMBNAILS' => $pos_pics - $start_thumbnails > 0 ? '<span id="display_left"><a href="javascript:display_thumbnails(\'left\')"><img src="../templates/' . get_utheme() . '/images/left.png" class="valign_middle" alt="" /></a></span>' : '<span id="display_left"></span>', 'U_RIGHT_THUMBNAILS' => $pos_pics - $start_thumbnails <= $i - 1 - $nbr_column_pics ? '<span id="display_right"><a href="javascript:display_thumbnails(\'right\')"><img src="../templates/' . get_utheme() . '/images/right.png" class="valign_middle" alt="" /></a></span>' : '<span id="display_right"></span>'));
$i = 0;
foreach ($array_pics as $pics) {
if ($i >= $pos_pics - $start_thumbnails && $i <= $pos_pics + $end_thumbnails) {
$Template->assign_block_vars('pics.pics_max.list_preview_pics', array('PICS' => $pics));
}
$i++;
}
}
} else {
$j = 0;
$result = $Sql->query_while("SELECT g.id, g.idcat, g.name, g.path, g.timestamp, g.aprob, g.width, g.height, m.login, m.user_id\n\t\t\tFROM " . PREFIX . "gallery g\n\t\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = g.user_id\n\t\t\tWHERE g.idcat = '" . $idcat . "' \n\t\t\tORDER BY g.timestamp \n\t\t\t" . $Sql->limit($Pagination->get_first_msg($CONFIG_GALLERY['nbr_pics_max'], 'pp'), $CONFIG_GALLERY['nbr_pics_max']), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
if (!file_exists('pics/thumbnails/' . $row['path'])) {
$Gallery->Resize_pics('pics/' . $row['path']);
}
示例12: strpos
$selected = $row['id'] == $idcat ? 'selected="selected"' : '';
$categories .= '<option value="' . $row['id'] . '" ' . $selected . '>' . $margin . ' ' . $row['name'] . '</option>';
$i++;
}
$Sql->query_close($result);
$img_direct_path = strpos($icon, '/') !== false;
$image_list = '<option value=""' . ($img_direct_path ? ' selected="selected"' : '') . '>--</option>';
import('io/filesystem/folder');
$image_list = '<option value="">--</option>';
$image_folder_path = new Folder('./');
foreach ($image_folder_path->get_files('`\\.(png|jpg|bmp|gif|jpeg|tiff)$`i') as $images) {
$image = $images->get_name();
$selected = $image == $icon ? ' selected="selected"' : '';
$image_list .= '<option value="' . $image . '"' . ($img_direct_path ? '' : $selected) . '>' . $image . '</option>';
}
$Template->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'TITLE' => $title, 'CATEGORIES' => $categories, 'CONTENTS' => $contents_preview, 'IMG_PATH' => $img_direct_path ? $icon : '', 'IMG_ICON' => !empty($icon) ? '<img src="' . $icon . '" alt="" class="valign_middle" />' : '', 'IMG_LIST' => $image_list, 'CURRENT_DATE' => $current_date, 'START' => !empty($start) && $visible == 2 ? $start : '', 'END' => !empty($end) && $visible == 2 ? $end : '', 'HOUR' => $hour, 'MIN' => $min, 'DAY_RELEASE_S' => !empty($start_timestamp) ? gmdate_format('d', $start_timestamp) : '', 'MONTH_RELEASE_S' => !empty($start_timestamp) ? gmdate_format('m', $start_timestamp) : '', 'YEAR_RELEASE_S' => !empty($start_timestamp) ? gmdate_format('Y', $start_timestamp) : '', 'DAY_RELEASE_E' => !empty($end_timestamp) ? gmdate_format('d', $end_timestamp) : '', 'MONTH_RELEASE_E' => !empty($end_timestamp) ? gmdate_format('m', $end_timestamp) : '', 'YEAR_RELEASE_E' => !empty($end_timestamp) ? gmdate_format('Y', $end_timestamp) : '', 'DAY_DATE' => !empty($current_date_timestamp) ? gmdate_format('d', $current_date_timestamp) : '', 'MONTH_DATE' => !empty($current_date_timestamp) ? gmdate_format('m', $current_date_timestamp) : '', 'YEAR_DATE' => !empty($current_date_timestamp) ? gmdate_format('Y', $current_date_timestamp) : '', 'VISIBLE_WAITING' => $visible == 2 ? 'checked="checked"' : '', 'VISIBLE_ENABLED' => $visible == 1 ? 'checked="checked"' : '', 'VISIBLE_UNAPROB' => $visible == 0 ? 'checked="checked"' : '', 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_REQUIRE_CAT' => $LANG['require_cat'], 'L_PREVIEW' => $LANG['preview'], 'L_COM' => $LANG['com'], 'L_WRITTEN_BY' => $LANG['written_by'], 'L_ON' => $LANG['on'], 'L_ARTICLES_MANAGEMENT' => $LANG['articles_management'], 'L_ARTICLES_ADD' => $LANG['articles_add'], 'L_ARTICLES_CAT' => $LANG['cat_management'], 'L_ARTICLES_CONFIG' => $LANG['articles_config'], 'L_ARTICLES_CAT_ADD' => $LANG['articles_cats_add'], 'L_REQUIRE' => $LANG['require'], 'L_CATEGORY' => $LANG['category'], 'L_TITLE' => $LANG['title'], 'L_ARTICLE_ICON' => $LANG['article_icon'], 'L_OR_DIRECT_PATH' => $LANG['or_direct_path'], 'L_UNTIL' => $LANG['until'], 'L_RELEASE_DATE' => $LANG['release_date'], 'L_IMMEDIATE' => $LANG['immediate'], 'L_UNAPROB' => $LANG['unaprob'], 'L_ARTICLES_DATE' => $LANG['articles_date'], 'L_TEXT' => $LANG['content'], 'L_EXPLAIN_PAGE' => $LANG['explain_page'], 'L_SUBMIT' => $LANG['submit'], 'L_RESET' => $LANG['reset']));
$Template->pparse('admin_articles_add');
} else {
$Template->set_filenames(array('admin_articles_add' => 'articles/admin_articles_add.tpl'));
$user_pseudo = !empty($user_pseudo) ? $user_pseudo : '';
$i = 0;
$categories = '<option value="0">' . $LANG['root'] . '</option>';
$result = $Sql->query_while("SELECT id, level, name \n\tFROM " . PREFIX . "articles_cats\n\tORDER BY id_left", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$margin = $row['level'] > 0 ? str_repeat('--------', $row['level']) : '--';
$categories .= '<option value="' . $row['id'] . '">' . $margin . ' ' . $row['name'] . '</option>';
$i++;
}
$Sql->query_close($result);
$image_list = '<option value="" selected="selected">--</option>';
import('io/filesystem/folder');
示例13: get_home_page
function get_home_page()
{
global $Sql, $idartcat, $User, $Cache, $Bread_crumb, $Errorh, $CAT_ARTICLES, $CONFIG_ARTICLES, $LANG;
require_once '../articles/articles_begin.php';
$tpl = new Template('articles/articles_cat.tpl');
if ($idartcat > 0) {
if (!isset($CAT_ARTICLES[$idartcat]) || $CAT_ARTICLES[$idartcat]['aprob'] == 0) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
}
$cat_links = '';
foreach ($CAT_ARTICLES as $id => $array_info_cat) {
if ($CAT_ARTICLES[$idartcat]['id_left'] >= $array_info_cat['id_left'] && $CAT_ARTICLES[$idartcat]['id_right'] <= $array_info_cat['id_right'] && $array_info_cat['level'] <= $CAT_ARTICLES[$idartcat]['level']) {
$cat_links .= ' <a href="articles' . url('.php?cat=' . $id, '-' . $id . '.php') . '">' . $array_info_cat['name'] . '</a> »';
}
}
$clause_cat = " WHERE ac.id_left > '" . $CAT_ARTICLES[$idartcat]['id_left'] . "' AND ac.id_right < '" . $CAT_ARTICLES[$idartcat]['id_right'] . "' AND ac.level = '" . ($CAT_ARTICLES[$idartcat]['level'] + 1) . "' AND ac.aprob = 1";
} else {
$cat_links = '';
$clause_cat = " WHERE ac.level = '0' AND ac.aprob = 1";
}
if (!isset($CAT_ARTICLES[$idartcat]) || !$User->check_auth($CAT_ARTICLES[$idartcat]['auth'], READ_CAT_ARTICLES)) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
}
$nbr_articles = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "articles WHERE visible = 1 AND idcat = '" . $idartcat . "'", __LINE__, __FILE__);
$total_cat = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "articles_cats ac " . $clause_cat, __LINE__, __FILE__);
$rewrite_title = url_encode_rewrite($CAT_ARTICLES[$idartcat]['name']);
$nbr_column_cats = $total_cat > $CONFIG_ARTICLES['nbr_column'] ? $CONFIG_ARTICLES['nbr_column'] : $total_cat;
$nbr_column_cats = !empty($nbr_column_cats) ? $nbr_column_cats : 1;
$column_width_cats = floor(100 / $nbr_column_cats);
$is_admin = $User->check_level(ADMIN_LEVEL) ? true : false;
$tpl->assign_vars(array('IDCAT' => $idartcat, 'C_IS_ADMIN' => $is_admin, 'COLUMN_WIDTH_CAT' => $column_width_cats, 'ADD_ARTICLES' => $is_admin ? (!empty($idartcat) ? '» ' : '') . '<a href="../articles/admin_articles_add.php"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/add.png" alt="" class="valign_middle" /></a>' : '', 'L_ARTICLES' => $LANG['articles'], 'L_DATE' => $LANG['date'], 'L_VIEW' => $LANG['views'], 'L_NOTE' => $LANG['note'], 'L_COM' => $LANG['com'], 'L_TOTAL_ARTICLE' => $nbr_articles > 0 ? sprintf($LANG['nbr_articles_info'], $nbr_articles) : '', 'L_NO_ARTICLES' => $nbr_articles == 0 ? $LANG['none_article'] : '', 'L_ARTICLES_INDEX' => $LANG['title_articles'], 'L_CATEGORIES' => $CAT_ARTICLES[$idartcat]['level'] >= 0 ? $LANG['sub_categories'] : $LANG['categories'], 'U_ARTICLES_CAT_LINKS' => trim($cat_links, ' »'), 'U_ARTICLES_ALPHA_TOP' => url('.php?sort=alpha&mode=desc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=alpha&mode=desc'), 'U_ARTICLES_ALPHA_BOTTOM' => url('.php?sort=alpha&mode=asc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=alpha&mode=asc'), 'U_ARTICLES_DATE_TOP' => url('.php?sort=date&mode=desc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=date&mode=desc'), 'U_ARTICLES_DATE_BOTTOM' => url('.php?sort=date&mode=asc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=date&mode=asc'), 'U_ARTICLES_VIEW_TOP' => url('.php?sort=view&mode=desc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=view&mode=desc'), 'U_ARTICLES_VIEW_BOTTOM' => url('.php?sort=view&mode=asc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=view&mode=asc'), 'U_ARTICLES_NOTE_TOP' => url('.php?sort=note&mode=desc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=note&mode=desc'), 'U_ARTICLES_NOTE_BOTTOM' => url('.php?sort=note&mode=asc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=note&mode=asc'), 'U_ARTICLES_COM_TOP' => url('.php?sort=com&mode=desc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=com&mode=desc'), 'U_ARTICLES_COM_BOTTOM' => url('.php?sort=com&mode=asc&cat=' . $idartcat, '-' . $idartcat . '+' . $rewrite_title . '.php?sort=com&mode=asc')));
$get_sort = retrieve(GET, 'sort', '');
switch ($get_sort) {
case 'alpha':
$sort = 'title';
break;
case 'date':
$sort = 'timestamp';
break;
case 'view':
$sort = 'views';
break;
case 'note':
$sort = 'note/' . $CONFIG_ARTICLES['note_max'];
break;
case 'com':
$sort = 'nbr_com';
break;
default:
$sort = 'timestamp';
}
$get_mode = retrieve(GET, 'mode', '');
$mode = $get_mode == 'asc' ? 'ASC' : 'DESC';
$unget = !empty($get_sort) && !empty($mode) ? '?sort=' . $get_sort . '&mode=' . $get_mode : '';
import('util/pagination');
$Pagination = new Pagination();
$unauth_cats_sql = array();
foreach ($CAT_ARTICLES as $id => $key) {
if (!$User->check_auth($CAT_ARTICLES[$id]['auth'], READ_CAT_ARTICLES)) {
$unauth_cats_sql[] = $id;
}
}
$nbr_unauth_cats = count($unauth_cats_sql);
$clause_unauth_cats = $nbr_unauth_cats > 0 ? " AND ac.id NOT IN (" . implode(', ', $unauth_cats_sql) . ")" : '';
##### Catégories disponibles #####
if ($total_cat > 0) {
$tpl->assign_vars(array('C_ARTICLES_CAT' => true, 'PAGINATION_CAT' => $Pagination->display('articles' . url('.php' . (!empty($unget) ? $unget . '&' : '?') . 'cat=' . $idartcat . '&pcat=%d', '-' . $idartcat . '-0+' . $rewrite_title . '.php?pcat=%d' . $unget), $total_cat, 'pcat', $CONFIG_ARTICLES['nbr_cat_max'], 3)));
$i = 0;
$result = $Sql->query_while("SELECT ac.id, ac.name, ac.contents, ac.icon, ac.nbr_articles_visible AS nbr_articles\n\t\t\tFROM " . PREFIX . "articles_cats ac\n\t\t\t" . $clause_cat . $clause_unauth_cats . "\n\t\t\tORDER BY ac.id_left\n\t\t\t" . $Sql->limit($Pagination->get_first_msg($CONFIG_ARTICLES['nbr_cat_max'], 'pcat'), $CONFIG_ARTICLES['nbr_cat_max']), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$tpl->assign_block_vars('cat_list', array('IDCAT' => $row['id'], 'CAT' => $row['name'], 'DESC' => $row['contents'], 'ICON_CAT' => !empty($row['icon']) ? '<a href="articles' . url('.php?cat=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php') . '"><img src="' . $row['icon'] . '" alt="" class="valign_middle" /></a><br />' : '', 'EDIT' => $is_admin ? '<a href="admin_articles_cat.php?id=' . $row['id'] . '"><img class="valign_middle" src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" alt="" /></a>' : '', 'L_NBR_ARTICLES' => sprintf($LANG['nbr_articles_info'], $row['nbr_articles']), 'U_CAT' => url('.php?cat=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php')));
}
$Sql->query_close($result);
}
##### Affichage des articles #####
if ($nbr_articles > 0) {
$tpl->assign_vars(array('C_ARTICLES_LINK' => true, 'PAGINATION' => $Pagination->display('articles' . url('.php' . (!empty($unget) ? $unget . '&' : '?') . 'cat=' . $idartcat . '&p=%d', '-' . $idartcat . '-0-%d+' . $rewrite_title . '.php' . $unget), $nbr_articles, 'p', $CONFIG_ARTICLES['nbr_articles_max'], 3), 'CAT' => $CAT_ARTICLES[$idartcat]['name']));
import('content/note');
$result = $Sql->query_while("SELECT id, title, icon, timestamp, views, note, nbrnote, nbr_com\n\t\t\tFROM " . PREFIX . "articles\n\t\t\tWHERE visible = 1 AND idcat = '" . $idartcat . "'\n\t\t\tORDER BY " . $sort . " " . $mode . $Sql->limit($Pagination->get_first_msg($CONFIG_ARTICLES['nbr_articles_max'], 'p'), $CONFIG_ARTICLES['nbr_articles_max']), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$fichier = strlen($row['title']) > 45 ? substr(html_entity_decode($row['title'], ENT_COMPAT, 'ISO-8859-1'), 0, 45) . '...' : $row['title'];
$tpl->assign_block_vars('articles', array('NAME' => $row['title'], 'ICON' => !empty($row['icon']) ? '<a href="articles' . url('.php?id=' . $row['id'] . '&cat=' . $idartcat, '-' . $idartcat . '-' . $row['id'] . '+' . url_encode_rewrite($fichier) . '.php') . '"><img src="' . $row['icon'] . '" alt="" class="valign_middle" /></a>' : '', 'CAT' => $CAT_ARTICLES[$idartcat]['name'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'COMPT' => $row['views'], 'NOTE' => $row['nbrnote'] > 0 ? Note::display_img($row['note'], $CONFIG_ARTICLES['note_max'], 5) : '<em>' . $LANG['no_note'] . '</em>', 'COM' => $row['nbr_com'], 'U_ARTICLES_LINK' => url('.php?id=' . $row['id'] . '&cat=' . $idartcat, '-' . $idartcat . '-' . $row['id'] . '+' . url_encode_rewrite($fichier) . '.php')));
}
$Sql->query_close($result);
}
return $tpl->parse(TRUE);
}
示例14: elseif
} elseif ($row['user_sex'] == 2) {
$user_sex = $LANG['sex'] . ': <img src="../templates/' . get_utheme() . '/images/woman.png" alt="" /><br />';
} else {
$user_sex = '';
}
if (!empty($row['user_local'])) {
$user_local = $LANG['place'] . ': ' . (strlen($row['user_local']) > 15 ? substr_html($row['user_local'], 0, 15) . '...<br />' : $row['user_local'] . '<br />');
} else {
$user_local = '';
}
if ($row['user_msg'] >= 1) {
$user_msg = '<a href="../forum/membermsg' . url('.php?id=' . $row['user_id'], '') . '" class="small_link">' . $LANG['message_s'] . '</a>: ' . $row['user_msg'];
} else {
$user_msg = !$is_guest ? '<a href="../forum/membermsg' . url('.php?id=' . $row['user_id'], '') . '" class="small_link">' . $LANG['message'] . '</a>: 0' : $LANG['message'] . ': 0';
}
$Template->assign_block_vars('msg', array('ID' => $row['id'], 'CLASS_COLOR' => $j % 2 == 0 ? '' : 2, 'FORUM_ONLINE_STATUT_USER' => !empty($row['connect']) ? 'online' : 'offline', 'FORUM_USER_LOGIN' => wordwrap_html($row['login'], 13), 'FORUM_MSG_DATE' => $LANG['on'] . ' ' . gmdate_format('date_format', $row['timestamp']), 'FORUM_MSG_CONTENTS' => second_parse($row['contents']), 'FORUM_USER_EDITOR_LOGIN' => $row['login_edit'], 'FORUM_USER_EDITOR_DATE' => gmdate_format('date_format', $row['timestamp_edit']), 'USER_RANK' => $row['user_warning'] < '100' || time() - $row['user_ban'] < 0 ? $user_rank : $LANG['banned'], 'USER_IMG_ASSOC' => $user_assoc_img, 'USER_AVATAR' => $user_avatar, 'USER_GROUP' => $user_groups, 'USER_DATE' => !$is_guest ? $LANG['registered_on'] . ': ' . gmdate_format('date_format_short', $row['registered']) : '', 'USER_SEX' => $user_sex, 'USER_MSG' => !$is_guest ? $user_msg : '', 'USER_LOCAL' => $user_local, 'USER_MAIL' => !empty($row['user_mail']) && $row['user_show_mail'] == '1' ? '<a href="mailto:' . $row['user_mail'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/email.png" alt="' . $row['user_mail'] . '" title="' . $row['user_mail'] . '" /></a>' : '', 'USER_MSN' => !empty($row['user_msn']) ? '<a href="mailto:' . $row['user_msn'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/msn.png" alt="' . $row['user_msn'] . '" title="' . $row['user_msn'] . '" /></a>' : '', 'USER_YAHOO' => !empty($row['user_yahoo']) ? '<a href="mailto:' . $row['user_yahoo'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/yahoo.png" alt="' . $row['user_yahoo'] . '" title="' . $row['user_yahoo'] . '" /></a>' : '', 'USER_SIGN' => !empty($row['user_sign']) ? '____________________<br />' . second_parse($row['user_sign']) : '', 'USER_WEB' => !empty($row['user_web']) ? '<a href="' . $row['user_web'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/user_web.png" alt="' . $row['user_web'] . '" title="' . $row['user_web'] . '" /></a>' : '', 'USER_WARNING' => $row['user_warning'], 'L_FORUM_QUOTE_LAST_MSG' => $quote_last_msg == 1 && $i == 0 ? $LANG['forum_quote_last_msg'] : '', 'C_FORUM_USER_LOGIN' => !empty($row['login']) ? true : false, 'C_FORUM_MSG_EDIT' => $edit, 'C_FORUM_MSG_DEL' => $del, 'C_FORUM_MSG_DEL_MSG' => !$first_message ? true : false, 'C_FORUM_MSG_CUT' => $cut, 'C_FORUM_USER_EDITOR' => $row['timestamp_edit'] > 0 && $CONFIG_FORUM['edit_mark'] == '1', 'C_FORUM_USER_EDITOR_LOGIN' => !empty($row['login_edit']) ? true : false, 'C_FORUM_MODERATOR' => $moderator, 'U_FORUM_USER_LOGIN' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_FORUM_MSG_EDIT' => url('.php?new=msg&idm=' . $row['id'] . '&id=' . $topic['idcat'] . '&idt=' . $id_get), 'U_FORUM_USER_EDITOR_LOGIN' => url('.php?id=' . $row['user_id_edit'], '-' . $row['user_id_edit'] . '.php'), 'U_FORUM_MSG_DEL' => url('.php?del=1&idm=' . $row['id'] . '&token=' . $Session->get_token()), 'U_FORUM_WARNING' => url('.php?action=warning&id=' . $row['user_id']), 'U_FORUM_PUNISHEMENT' => url('.php?action=punish&id=' . $row['user_id']), 'U_FORUM_MSG_CUT' => url('.php?idm=' . $row['id']), 'U_VARS_ANCRE' => url('.php?id=' . $id_get . (!empty($page) ? '&pt=' . $page : ''), '-' . $id_get . (!empty($page) ? '-' . $page : '') . $rewrited_title . '.php'), 'U_VARS_QUOTE' => url('.php?quote=' . $row['id'] . '&id=' . $id_get . (!empty($page) ? '&pt=' . $page : ''), '-' . $id_get . (!empty($page) ? '-' . $page : '-0') . '-0-' . $row['id'] . $rewrited_title . '.php'), 'USER_PM' => !$is_guest ? '<a href="../member/pm' . url('.php?pm=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/pm.png" alt="pm" /></a>' : ''));
if (!empty($row['trackid'])) {
$track = $row['track'] ? true : false;
$track_pm = $row['trackpm'] ? true : false;
$track_mail = $row['trackmail'] ? true : false;
}
$j++;
$i++;
}
$Sql->query_close($result);
list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script = '/forum/topic.php' AND s.session_script_get LIKE '%id=" . $id_get . "%'");
$Template->assign_vars(array('TOTAL_ONLINE' => $total_online, 'USERS_ONLINE' => $total_online - $total_visit == 0 ? '<em>' . $LANG['no_member_online'] . '</em>' : $users_list, 'ADMIN' => $total_admin, 'MODO' => $total_modo, 'MEMBER' => $total_member, 'GUEST' => $total_visit, 'SELECT_CAT' => forum_list_cat($topic['idcat'], $CAT_FORUM[$topic['idcat']]['level']), 'U_SUSCRIBE' => $track === false ? url('.php?t=' . $id_get) : url('.php?ut=' . $id_get), 'U_SUSCRIBE_PM' => url('.php?token=' . $Session->get_token() . '&' . ($track_pm ? 'utp' : 'tp') . '=' . $id_get), 'U_SUSCRIBE_MAIL' => url('.php?token=' . $Session->get_token() . '&' . ($track_mail ? 'utm' : 'tm') . '=' . $id_get), 'IS_TRACK' => $track ? 'true' : 'false', 'IS_TRACK_PM' => $track_pm ? 'true' : 'false', 'IS_TRACK_MAIL' => $track_mail ? 'true' : 'false', 'IS_CHANGE' => $topic['display_msg'] ? 'true' : 'false', 'U_ALERT' => url('.php?id=' . $id_get), 'L_TRACK_DEFAULT' => $track === false ? $LANG['track_topic'] : $LANG['untrack_topic'], 'L_SUSCRIBE_DEFAULT' => $track_mail === false ? $LANG['track_topic_mail'] : $LANG['untrack_topic_mail'], 'L_SUSCRIBE_PM_DEFAULT' => $track_pm === false ? $LANG['track_topic_pm'] : $LANG['untrack_topic_pm'], 'L_TRACK' => $LANG['track_topic'], 'L_UNTRACK' => $LANG['untrack_topic'], 'L_SUSCRIBE_PM' => $LANG['track_topic_pm'], 'L_UNSUSCRIBE_PM' => $LANG['untrack_topic_pm'], 'L_SUSCRIBE' => $LANG['track_topic_mail'], 'L_UNSUSCRIBE' => $LANG['untrack_topic_mail'], 'L_ALERT' => $LANG['alert_topic'], 'L_USER' => $total_online > 1 ? $LANG['user_s'] : $LANG['user'], 'L_ADMIN' => $total_admin > 1 ? $LANG['admin_s'] : $LANG['admin'], 'L_MODO' => $total_modo > 1 ? $LANG['modo_s'] : $LANG['modo'], 'L_MEMBER' => $total_member > 1 ? $LANG['member_s'] : $LANG['member'], 'L_GUEST' => $total_visit > 1 ? $LANG['guest_s'] : $LANG['guest'], 'L_AND' => $LANG['and'], 'L_ONLINE' => strtolower($LANG['online'])));
$contents = '';
if (!empty($quote_get)) {
$quote_msg = $Sql->query_array(PREFIX . 'forum_msg', 'user_id', 'contents', "WHERE id = '" . $quote_get . "'", __LINE__, __FILE__);
$pseudo = $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $quote_msg['user_id'] . "'", __LINE__, __FILE__);
示例15: define
<?php
require_once '../kernel/begin.php';
require_once '../forum/forum_begin.php';
require_once '../forum/forum_tools.php';
$Bread_crumb->add($CONFIG_FORUM['forum_name'], 'index.php' . SID);
$Bread_crumb->add($LANG['stats'], '');
define('TITLE', $LANG['title_forum'] . ' - ' . $LANG['stats']);
require_once '../kernel/header.php';
$Template->set_filenames(array('forum_stats' => 'forum/forum_stats.tpl', 'forum_top' => 'forum/forum_top.tpl', 'forum_bottom' => 'forum/forum_bottom.tpl'));
$total_day = number_round((time() - $CONFIG['start']) / (3600 * 24), 0);
$timestamp_today = @mktime(0, 0, 1, gmdate_format('m'), gmdate_format('d'), gmdate_format('y'));
$sum = $Sql->query_array(PREFIX . "forum_cats", "SUM(nbr_topic) as total_topics", "SUM(nbr_msg) as total_msg", "WHERE level <> 0 AND level < 2 AND aprob = 1", __LINE__, __FILE__);
$total_day = max(1, $total_day);
$nbr_topics_day = number_round($sum['total_topics'] / $total_day, 1);
$nbr_msg_day = number_round($sum['total_msg'] / $total_day, 1);
$nbr_topics_today = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "forum_topics t\nJOIN " . PREFIX . "forum_msg m ON m.id = t.first_msg_id\nWHERE m.timestamp > '" . $timestamp_today . "'", __LINE__, __FILE__);
$nbr_msg_today = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "forum_msg WHERE timestamp > '" . $timestamp_today . "'", __LINE__, __FILE__);
$Template->assign_vars(array('FORUM_NAME' => $CONFIG_FORUM['forum_name'], 'SID' => SID, 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'NBR_TOPICS' => $sum['total_topics'], 'NBR_MSG' => $sum['total_msg'], 'NBR_TOPICS_DAY' => $nbr_topics_day, 'NBR_MSG_DAY' => $nbr_msg_day, 'NBR_TOPICS_TODAY' => $nbr_topics_today, 'NBR_MSG_TODAY' => $nbr_msg_today, 'L_FORUM_INDEX' => $LANG['forum_index'], 'L_FORUM' => $LANG['forum'], 'L_STATS' => $LANG['stats'], 'L_NBR_TOPICS' => $sum['total_topics'] > 1 ? $LANG['topic_s'] : $LANG['topic'], 'L_NBR_MSG' => $sum['total_msg'] > 1 ? $LANG['message_s'] : $LANG['message'], 'L_NBR_TOPICS_DAY' => $LANG['nbr_topics_day'], 'L_NBR_MSG_DAY' => $LANG['nbr_msg_day'], 'L_NBR_TOPICS_TODAY' => $LANG['nbr_topics_today'], 'L_NBR_MSG_TODAY' => $LANG['nbr_msg_today'], 'L_LAST_MSG' => $LANG['forum_last_msg'], 'L_POPULAR' => $LANG['forum_popular'], 'L_ANSWERS' => $LANG['forum_nbr_answers']));
$auth_cats = '';
if (is_array($CAT_FORUM)) {
foreach ($CAT_FORUM as $idcat => $key) {
if (!$User->check_auth($CAT_FORUM[$idcat]['auth'], READ_CAT_FORUM)) {
$auth_cats .= $idcat . ',';
}
}
$auth_cats = !empty($auth_cats) ? " AND c.id NOT IN (" . trim($auth_cats, ',') . ")" : '';
}
$result = $Sql->query_while("SELECT t.id, t.title, c.id as cid, c.auth\nFROM " . PREFIX . "forum_topics t\nLEFT JOIN " . PREFIX . "forum_cats c ON c.id = t.idcat\nWHERE c.level != 0 AND c.aprob = 1 " . $auth_cats . "\nORDER BY t.last_timestamp DESC\n" . $Sql->limit(0, 10), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('last_msg', array('U_TOPIC_ID' => url('.php?id=' . $row['id'], '-' . $row['id'] . '.php'), 'TITLE' => $row['title']));