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; }
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; }
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(); }
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();
$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';
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']));
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';
} $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); }
} 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');
$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';
$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']); }
$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');
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); }
} 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__);
<?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']));
$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(); $Template->assign_vars(array('PAGINATION' => $Pagination->display('web' . url('.php' . (!empty($unget) ? $unget . '&' : '?') . 'cat=' . $idcat . '&p=%d', '-' . $idcat . '-0-%d.php' . (!empty($unget) ? '?' . $unget : '')), $nbr_web, 'p', $CONFIG_WEB['nbr_web_max'], 3))); import('content/note'); $result = $Sql->query_while("SELECT id, title, timestamp, compt, note, nbrnote, nbr_com\n\tFROM " . PREFIX . "web\n\tWHERE aprob = 1 AND idcat = '" . $idcat . "'\n\tORDER BY " . $sort . " " . $mode . $Sql->limit($Pagination->get_first_msg($CONFIG_WEB['nbr_web_max'], 'p'), $CONFIG_WEB['nbr_web_max']), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { $row['title'] = strlen($row['title']) > 45 ? substr(html_entity_decode($row['title'], ENT_COMPAT, 'ISO-8859-1'), 0, 45) . '...' : $row['title']; $Template->assign_block_vars('web', array('NAME' => $row['title'], 'CAT' => $CAT_WEB[$idcat]['name'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'COMPT' => $row['compt'], 'NOTE' => $row['nbrnote'] > 0 ? Note::display_img($row['note'], $CONFIG_WEB['note_max']) : '<em>' . $LANG['no_note'] . '</em>', 'COM' => $row['nbr_com'], 'U_WEB_LINK' => url('.php?cat=' . $idcat . '&id=' . $row['id'], '-' . $idcat . '-' . $row['id'] . '.php'))); } $Sql->query_close($result); $Template->pparse('web'); } else { $Template->set_filenames(array('web' => 'web/web.tpl')); $total_link = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "web_cat wc\n\tLEFT JOIN " . PREFIX . "web w ON w.idcat = wc.id\n\tWHERE w.aprob = 1 AND wc.aprob = 1 AND wc.secure <= '" . $User->get_attribute('level') . "'", __LINE__, __FILE__); $total_cat = $Sql->query("SELECT COUNT(*) as compt FROM " . PREFIX . "web_cat WHERE aprob = 1 AND secure <= '" . $User->get_attribute('level') . "'", __LINE__, __FILE__); import('util/pagination'); $Pagination = new Pagination(); $CONFIG_WEB['nbr_column'] = $total_cat > $CONFIG_WEB['nbr_column'] ? $CONFIG_WEB['nbr_column'] : $total_cat; $CONFIG_WEB['nbr_column'] = !empty($CONFIG_WEB['nbr_column']) ? $CONFIG_WEB['nbr_column'] : 1; $Template->assign_vars(array('C_WEB_CAT' => true, 'C_IS_ADMIN' => $User->check_level(ADMIN_LEVEL), 'PAGINATION' => $Pagination->display('web' . url('.php?p=%d', '-0-0-%d.php'), $total_cat, 'p', $CONFIG_WEB['nbr_cat_max'], 3), 'TOTAL_FILE' => $total_link, 'L_CATEGORIES' => $LANG['categories'], 'L_PROPOSE_LINK' => $LANG['propose_link'], 'L_HOW_LINK' => $LANG['how_link'], 'U_WEB_ADD' => url('.php?web=true'))); $column_width = floor(100 / $CONFIG_WEB['nbr_column']); $result = $Sql->query_while("SELECT aw.id, aw.name, aw.contents, aw.icon, COUNT(w.id) as count\n\tFROM " . PREFIX . "web_cat aw\n\tLEFT JOIN " . PREFIX . "web w ON w.idcat = aw.id AND w.aprob = 1\n\tWHERE aw.aprob = 1 AND aw.secure <= '" . $User->get_attribute('level') . "'\n\tGROUP BY aw.id\n\tORDER BY aw.class\n\t" . $Sql->limit($Pagination->get_first_msg($CONFIG_WEB['nbr_cat_max'], 'p'), $CONFIG_WEB['nbr_cat_max']), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) {
if (!empty($row['last_topic_id'])) { 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')) > 20 ? substr_html($last_topic_title, 0, 20) . '...' : $last_topic_title; $row['login'] = !empty($row['login']) ? $row['login'] : $LANG['guest']; $last = '<a href="topic' . url('.php?id=' . $row['tid'], '-' . $row['tid'] . '+' . url_encode_rewrite($row['title']) . '.php') . '" class="small_link">' . $last_topic_title . '</a><br /> <a href="topic' . url('.php?' . $last_page . 'id=' . $row['tid'], '-' . $row['tid'] . $last_page_rewrite . '+' . url_encode_rewrite($row['title']) . '.php') . '#m' . $last_msg_id . '"><img src="../templates/' . get_utheme() . '/images/ancre.png" alt="" /></a> ' . $LANG['on'] . ' ' . gmdate_format('date_format', $row['last_timestamp']) . '<br />' . $LANG['by'] . ' ' . ($row['last_user_id'] != '-1' ? '<a href="../member/member' . url('.php?id=' . $row['last_user_id'], '-' . $row['last_user_id'] . '.php') . '" class="small_link">' . $row['login'] . '</a>' : '<em>' . $LANG['guest'] . '</em>'); } else { $row['last_timestamp'] = ''; $last = '<br />' . $LANG['no_message'] . '<br /><br />'; } $img_announce = 'announce'; if (!$is_guest) { if ($row['last_view_id'] != $row['last_msg_id'] && $row['last_timestamp'] >= $max_time_msg) { $img_announce = 'new_' . $img_announce; } } $img_announce .= $row['status'] == '0' ? '_lock' : ''; $total_topic += $row['nbr_topic']; $total_msg += $row['nbr_msg']; $Template->assign_block_vars('forums_list.subcats', array('IMG_ANNOUNCE' => $img_announce, 'NAME' => $row['name'], 'DESC' => second_parse($row['subname']), 'SUBFORUMS' => !empty($subforums) && !empty($row['subname']) ? '<br />' . $subforums : $subforums, 'NBR_TOPIC' => $row['nbr_topic'], 'NBR_MSG' => $row['nbr_msg'], 'U_FORUM_URL' => $row['url'], 'U_FORUM_VARS' => url('.php?id=' . $row['cid'], '-' . $row['cid'] . '+' . url_encode_rewrite($row['name']) . '.php'), 'U_LAST_TOPIC' => $last)); }
$sort = 'user_aprob'; 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 : ''; $Template->assign_vars(array('PAGINATION' => $Pagination->display('admin_members.php?p=%d' . $unget, $nbr_membre, 'p', 25, 3), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'KERNEL_EDITOR' => display_editor(), 'L_REQUIRE_MAIL' => $LANG['require_mail'], 'L_REQUIRE_PASS' => $LANG['require_pass'], 'L_REQUIRE_RANK' => $LANG['require_rank'], 'L_REQUIRE_LOGIN' => $LANG['require_pseudo'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_CONFIRM_DEL_USER' => $LANG['confirm_del_member'], 'L_CONFIRM_DEL_ADMIN' => $LANG['confirm_del_admin'], 'L_CONTENTS' => $LANG['content'], 'L_SUBMIT' => $LANG['submit'], 'L_UPDATE' => $LANG['update'], 'L_USERS_MANAGEMENT' => $LANG['members_management'], 'L_USERS_ADD' => $LANG['members_add'], 'L_USERS_CONFIG' => $LANG['members_config'], 'L_USERS_PUNISHMENT' => $LANG['members_punishment'], 'L_PSEUDO' => $LANG['pseudo'], 'L_PASSWORD' => $LANG['password'], 'L_MAIL' => $LANG['mail'], 'L_RANK' => $LANG['rank'], 'L_APROB' => $LANG['aprob'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_SEARCH_USER' => $LANG['search_member'], 'L_JOKER' => $LANG['joker'], 'L_SEARCH' => $LANG['search'], 'L_WEBSITE' => $LANG['website'], 'L_REGISTERED' => $LANG['registered'], 'L_DELETE' => $LANG['delete'])); $result = $Sql->query_while("SELECT login, user_id, user_mail, timestamp, user_web, level, user_aprob\n\tFROM " . DB_TABLE_MEMBER . " \n\tORDER BY " . $sort . " " . $mode . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { switch ($row['level']) { case 0: $rank = $LANG['member']; break; case 1: $rank = $LANG['modo']; break; case 2: $rank = $LANG['admin']; break; default: 0; } $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>' : ''; $Template->assign_block_vars('member', array('IDMBR' => $row['user_id'], 'NAME' => $row['login'], 'RANK' => $rank, 'MAIL' => $row['user_mail'], 'WEB' => $user_web, 'LEVEL' => $row['level'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'APROB' => $row['user_aprob'] == 0 ? $LANG['no'] : $LANG['yes'])); } $Sql->query_close($result); $Template->pparse('admin_members_management'); } require_once '../admin/admin_footer.php';
$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']); $month_day = $array_month[$month - 1]; $Template->assign_vars(array('FIELD' => $field, 'INPUT_FIELD' => $input_field, 'LYEAR' => $lyear, 'MONTH' => $month, 'YEAR' => $year, 'U_PREVIOUS' => $month == 1 ? 'input_field=' . $input_field . '&field=' . $field . $lyear . '&d=' . $day . '&m=12&y=' . ($year - 1) : 'input_field=' . $input_field . '&input_field=' . $input_field . '&field=' . $field . $lyear . '&d=1&m=' . ($month - 1) . '&y=' . $year, 'U_NEXT' => $month == 12 ? 'input_field=' . $input_field . '&field=' . $field . $lyear . '&d=' . $day . '&m=1&y=' . ($year + 1) : 'input_field=' . $input_field . '&field=' . $field . $lyear . '&d=1&m=' . ($month + 1) . '&y=' . $year)); for ($i = 1; $i <= 12; $i++) { $selected = $month == $i ? 'selected="selected"' : ''; $Template->assign_block_vars('month', array('MONTH' => '<option value="' . $i . '" ' . $selected . '>' . htmlentities($array_l_month[$i - 1], ENT_COMPAT, 'ISO-8859-1') . '</option>')); } for ($i = 1900; $i <= 2037; $i++) { $selected = $year == $i ? 'selected="selected"' : ''; $Template->assign_block_vars('year', array('YEAR' => '<option value="' . $i . '" ' . $selected . '>' . $i . '</option>')); } $array_l_days = array($LANG['monday'], $LANG['tuesday'], $LANG['wenesday'], $LANG['thursday'], $LANG['friday'], $LANG['saturday'], $LANG['sunday']); foreach ($array_l_days as $l_day) { $Template->assign_block_vars('day', array('L_DAY' => '<td style="width:25px;border-top:1px solid black;border-bottom:1px solid black"><span class="text_small">' . $l_day . '</span></td>')); } $first_day = @gmdate_format('w', @mktime(1, 0, 0, $month, 1, $year)); if ($first_day == 0) { $first_day = 7; } $format = ''; $array_date = explode('/', $LANG['date_format_short']); for ($i = 0; $i < 3; $i++) { switch ($array_date[$i]) { case 'd': $format .= "%1\$s"; break; case 'm': $format .= "%2\$s"; break; case 'y': $format .= "%3\$s";
$select .= '<option value="' . 10 * $j . '">' . 10 * $j . '%</option>'; } } $Template->assign_vars(array('C_FORUM_USER_INFO' => true, 'KERNEL_EDITOR' => display_editor('action_contents'), 'ALTERNATIVE_PM' => str_replace('%level%', $member['user_warning'], $LANG['user_warning_level_changed']), 'LOGIN' => '<a href="../member/member' . url('.php?id=' . $id_get, '-' . $id_get . '.php') . '">' . $member['login'] . '</a>', 'INFO' => $LANG['user_warning_level'] . ': ' . $member['user_warning'] . '%', 'SELECT' => $select, 'REPLACE_VALUE' => 'contents = contents.replace(regex, \' \' + replace_value + \'%\');' . "\n" . 'document.getElementById(\'action_info\').innerHTML = \'' . addslashes($LANG['user_warning_level']) . ': \' + replace_value + \'%\';', 'REGEX' => '/ [0-9]+%/', 'U_ACTION_INFO' => url('.php?action=warning&id=' . $id_get . '&token=' . $Session->get_token()), 'U_PM' => url('.php?pm=' . $id_get, '-' . $id_get . '.php'), 'L_ALTERNATIVE_PM' => $LANG['user_alternative_pm'], 'L_INFO_EXPLAIN' => $LANG['user_warning_explain'], 'L_PM' => $LANG['user_contact_pm'], 'L_INFO' => $LANG['user_warning_level'], 'L_PM' => $LANG['user_contact_pm'], 'L_CHANGE_INFO' => $LANG['change_user_warning'])); } } elseif (retrieve(GET, 'del_h', false) && $User->check_level(ADMIN_LEVEL)) { $Sql->query_inject("DELETE FROM " . PREFIX . "forum_history"); redirect(HOST . DIR . '/forum/moderation_forum' . url('.php', '', '&')); } else { $get_more = retrieve(GET, 'more', 0); $Template->assign_vars(array('C_FORUM_MODO_MAIN' => true, 'U_ACTION_HISTORY' => url('.php?del_h=1&token=' . $Session->get_token()), 'U_MORE_ACTION' => !empty($get_more) ? url('.php?more=' . ($get_more + 100)) : url('.php?more=100'))); if ($User->check_level(ADMIN_LEVEL)) { $Template->assign_vars(array('C_FORUM_ADMIN' => true)); } $Template->assign_vars(array('SID' => SID, 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'L_DEL_HISTORY' => $LANG['alert_history'], 'L_MODERATION_PANEL' => $LANG['moderation_panel'], 'L_MODERATION_FORUM' => $LANG['moderation_forum'], 'L_FORUM' => $LANG['forum'], 'L_USERS_PUNISHMENT' => $LANG['punishment_management'], 'L_ALERT_MANAGEMENT' => $LANG['alert_management'], 'L_USERS_MANAGEMENT' => $LANG['warning_management'], 'L_HISTORY' => $LANG['history'], 'L_MODO' => $LANG['modo'], 'L_ACTION' => $LANG['action'], 'L_USER_CONCERN' => $LANG['history_member_concern'], 'L_DATE' => $LANG['date'], 'L_DELETE' => $LANG['delete'], 'L_MORE_ACTION' => $LANG['more_action'])); $end = !empty($get_more) ? $get_more : 15; $i = 0; $result = $Sql->query_while("SELECT h.action, h.user_id, h.user_id_action, h.url, h.timestamp, m.login, m2.login as member\n\tFROM " . PREFIX . "forum_history h\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = h.user_id\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m2 ON m2.user_id = h.user_id_action\n\tORDER BY h.timestamp DESC\n\t" . $Sql->limit(0, $end), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { $Template->assign_block_vars('action_list', array('LOGIN' => !empty($row['login']) ? $row['login'] : $LANG['guest'], 'DATE' => gmdate_format('date_format', $row['timestamp']), 'U_ACTION' => !empty($row['url']) ? '<a href="../forum/' . $row['url'] . '">' . $LANG[$row['action']] . '</a>' : $LANG[$row['action']], 'U_USER_ID' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_USER_CONCERN' => !empty($row['user_id_action']) ? '<a href="../member/member' . url('.php?id=' . $row['user_id_action'], '-' . $row['user_id_action'] . '.php') . '">' . $row['member'] . '</a>' : '-')); $i++; } $Sql->query_close($result); if ($i == 0) { $Template->assign_vars(array('C_FORUM_NO_ACTION' => true, 'L_NO_ACTION' => $LANG['no_action'])); } } list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script = '/forum/moderation_forum.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']), 'L_FORUM_INDEX' => $LANG['forum_index'], '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"))); $Template->pparse('forum_moderation_panel'); include '../kernel/footer.php';
<?php require_once '../admin/admin_begin.php'; load_module_lang('download'); define('TITLE', $LANG['administration']); require_once '../admin/admin_header.php'; $Cache->load('download'); $Template->set_filenames(array('admin_download_management' => 'download/admin_download_management.tpl')); $nbr_dl = $Sql->count_table('download', __LINE__, __FILE__); import('util/pagination'); $Pagination = new Pagination(); $Template->assign_vars(array('THEME' => get_utheme(), 'LANG' => get_ulang(), 'PAGINATION' => $Pagination->display('admin_download.php?p=%d', $nbr_dl, 'p', 25, 3), 'L_DEL_ENTRY' => $LANG['del_entry'], 'L_DOWNLOAD_ADD' => $DOWNLOAD_LANG['download_add'], 'L_DOWNLOAD_MANAGEMENT' => $DOWNLOAD_LANG['download_management'], 'L_DOWNLOAD_CAT' => $LANG['cat_management'], 'L_DOWNLOAD_CONFIG' => $DOWNLOAD_LANG['download_config'], 'L_CATEGORY' => $LANG['category'], 'L_SIZE' => $LANG['size'], 'L_TITLE' => $LANG['title'], 'L_APROB' => $LANG['aprob'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete'], 'L_DATE' => $LANG['date'], 'L_CONFIRM_DELETE' => str_replace('\'', '\\\'', $DOWNLOAD_LANG['confirm_delete_file']))); $result = $Sql->query_while("SELECT id, idcat, title, timestamp, approved, start, end, size\nFROM " . PREFIX . "download\nORDER BY timestamp DESC \n" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { if ($row['approved'] == 1) { $aprob = $LANG['yes']; } else { $aprob = $LANG['no']; } $title =& $row['title']; $title = strlen($title) > 45 ? substr($title, 0, 45) . '...' : $title; $Template->assign_block_vars('list', array('TITLE' => $title, 'IDCAT' => $row['idcat'], 'CAT' => $row['idcat'] > 0 ? $DOWNLOAD_CATS[$row['idcat']]['name'] : $LANG['root'], 'PSEUDO' => !empty($row['login']) ? $row['login'] : $LANG['guest'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'SIZE' => $row['size'] >= 1 ? number_round($row['size'], 1) . ' ' . $LANG['unit_megabytes'] : number_round($row['size'] * 2524, 1) . ' ' . $LANG['unit_kilobytes'], 'APROBATION' => $aprob, 'U_FILE' => url('download.php?id=' . $row['id'], 'download-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'), 'U_EDIT_FILE' => url('management.php?edit=' . $row['id']), 'U_DEL_FILE' => url('management.php?del=' . $row['id'] . '&token=' . $Session->get_token()))); } $Sql->query_close($result); include_once 'admin_download_menu.php'; $Template->pparse('admin_download_management'); require_once '../admin/admin_footer.php';
function display($integrated_in_environment = INTEGRATED_IN_ENVIRONMENT, $Template = false, $page_path_to_root = '') { global $Cache, $User, $Errorh, $Sql, $LANG, $CONFIG, $CONFIG_USER, $CONFIG_COM, $_array_rank, $_array_groups_auth, $Session; if ($integrated_in_environment) { $idcom_get = retrieve(GET, 'com', 0); $idcom_post = retrieve(POST, 'idcom', 0); $idcom = $idcom_post > 0 ? $idcom_post : $idcom_get; $this->set_arg($idcom); } $vars_simple = sprintf($this->vars, 0); $delcom = retrieve(GET, 'delcom', 0); $editcom = retrieve(GET, 'editcom', 0); $updatecom = retrieve(GET, 'updatecom', false); $path_redirect = $this->path . sprintf(str_replace('&', '&', $this->vars), 0) . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : ''); if (!is_object($Template) || strtolower(get_class($Template)) != 'template') { $Template = new Template('framework/content/com.tpl'); } if ($this->is_loaded()) { $Cache->load('com'); import('util/captcha'); $captcha = new Captcha(); $captcha->set_difficulty($CONFIG_COM['com_verif_code_difficulty']); ###########################Insertion############################## if (retrieve(POST, 'valid_com', false) && !$updatecom) { if ($User->get_attribute('user_readonly') > time()) { $Errorh->handler('e_auth', E_USER_REDIRECT); } $login = retrieve(POST, 'login', ''); $contents = retrieve(POST, 'contents', '', TSTRING_UNCHANGE); if (!empty($login) && !empty($contents)) { if ($this->lock_com >= 1 && !$User->check_level(MODO_LEVEL)) { redirect($path_redirect); } if ($User->check_level($CONFIG_COM['com_auth'])) { $check_time = $User->get_attribute('user_id') !== -1 && $CONFIG['anti_flood'] == 1 ? $Sql->query("SELECT MAX(timestamp) as timestamp FROM " . DB_TABLE_COM . " WHERE user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__) : ''; if (!empty($check_time) && !$User->check_max_value(AUTH_FLOOD)) { if ($check_time >= time() - $CONFIG['delay_flood']) { redirect($path_redirect . '&errorh=flood#errorh'); } } if ($CONFIG_COM['com_verif_code'] && !$captcha->is_valid()) { redirect($path_redirect . '&errorh=verif#errorh'); } $contents = strparse($contents, $CONFIG_COM['forbidden_tags']); if (!check_nbr_links($login, 0)) { redirect($path_redirect . '&errorh=l_pseudo#errorh'); } if (!check_nbr_links($contents, $CONFIG_COM['max_link'])) { redirect($path_redirect . '&errorh=l_flood#errorh'); } $last_idcom = $this->add($contents, $login); redirect($path_redirect . '#m' . $last_idcom); } else { redirect($path_redirect . '&errorh=auth#errorh'); } } else { redirect($path_redirect . '&errorh=incomplete#errorh'); } } elseif ($updatecom || $delcom > 0 || $editcom > 0) { if ($User->get_attribute('user_readonly') > time()) { $Errorh->handler('e_auth', E_USER_REDIRECT); } $row = $Sql->query_array(DB_TABLE_COM, '*', "WHERE idcom = '" . $this->idcom . "' AND idprov = '" . $this->idprov . "' AND script = '" . $this->script . "'", __LINE__, __FILE__); $row['user_id'] = (int) $row['user_id']; if ($this->idcom != 0 && ($User->check_level(MODO_LEVEL) || $row['user_id'] === $User->get_attribute('user_id') && $User->get_attribute('user_id') !== -1)) { if ($delcom > 0) { $Session->csrf_get_protect(); $lastid_com = $this->del(); $lastid_com = !empty($lastid_com) ? '#m' . $lastid_com : ''; redirect($path_redirect . $lastid_com); } elseif ($editcom > 0) { $Template->assign_vars(array('CURRENT_PAGE_COM' => $integrated_in_environment, 'POPUP_PAGE_COM' => !$integrated_in_environment, 'AUTH_POST_COM' => true)); if ($row['user_id'] !== -1) { $Template->assign_vars(array('C_HIDDEN_COM' => true, 'LOGIN' => $User->get_attribute('login'))); } else { $Template->assign_vars(array('C_VISIBLE_COM' => true, 'LOGIN' => $row['login'])); } $Template->assign_vars(array('IDPROV' => $row['idprov'], 'IDCOM' => $row['idcom'], 'SCRIPT' => $this->script, 'CONTENTS' => unparse($row['contents']), 'DATE' => gmdate_format('date_format', $row['timestamp']), 'THEME' => get_utheme(), 'KERNEL_EDITOR' => display_editor($this->script . 'contents', $CONFIG_COM['forbidden_tags']), 'L_LANGUAGE' => substr(get_ulang(), 0, 2), 'L_EDIT_COMMENT' => $LANG['edit_comment'], 'L_REQUIRE_LOGIN' => $LANG['require_pseudo'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_DELETE_MESSAGE' => $LANG['alert_delete_msg'], 'L_LOGIN' => $LANG['pseudo'], 'L_MESSAGE' => $LANG['message'], 'L_RESET' => $LANG['reset'], 'L_PREVIEW' => $LANG['preview'], 'L_PREVIEW' => $LANG['preview'], 'L_SUBMIT' => $LANG['update'], 'U_ACTION' => $this->path . sprintf($this->vars, $this->idcom) . '&token=' . $Session->get_token() . '&updatecom=1' . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : ''))); } elseif ($updatecom) { $contents = retrieve(POST, 'contents', '', TSTRING_UNCHANGE); $login = retrieve(POST, 'login', ''); if (!empty($contents) && !empty($login)) { $contents = strparse($contents, $CONFIG_COM['forbidden_tags']); if (!check_nbr_links($contents, $CONFIG_COM['max_link'])) { redirect($path_redirect . '&errorh=l_flood#errorh'); } $this->update($contents, $login); redirect($path_redirect . '#m' . $this->idcom); } else { redirect($path_redirect . '&errorh=incomplete#errorh'); } } else { redirect($path_redirect . '&errorh=incomplete#errorh'); } } else { $Errorh->handler('e_auth', E_USER_REDIRECT); } } elseif (isset($_GET['lock']) && $User->check_level(MODO_LEVEL)) { $Session->csrf_get_protect(); if ($User->check_level(MODO_LEVEL)) { $lock = retrieve(GET, 'lock', 0); $this->lock($lock); } redirect($path_redirect . '#anchor_' . $this->script); } else { ###########################Affichage############################## $get_quote = retrieve(GET, 'quote', 0); $contents = ''; if ($get_quote > 0) { $info_com = $Sql->query_array(DB_TABLE_COM, 'login', 'contents', "WHERE script = '" . $this->script . "' AND idprov = '" . $this->idprov . "' AND idcom = '" . $get_quote . "'", __LINE__, __FILE__); $contents = '[quote=' . $info_com['login'] . ']' . $info_com['contents'] . '[/quote]'; } import('util/pagination'); $pagination = new Pagination(); $Template->assign_vars(array('ERROR_HANDLER' => '', 'CURRENT_PAGE_COM' => $integrated_in_environment, 'POPUP_PAGE_COM' => !$integrated_in_environment)); if ($User->check_level(MODO_LEVEL)) { $Template->assign_vars(array('COM_LOCK' => true, 'IMG' => $this->lock_com >= 1 ? 'unlock' : 'lock', 'L_LOCK' => $this->lock_com >= 1 ? $LANG['unlock'] : $LANG['lock'], 'U_LOCK' => $this->path . ($this->lock_com >= 1 ? $vars_simple . '&lock=0&token=' . $Session->get_token() : $vars_simple . '&lock=1&token=' . $Session->get_token()) . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : ''))); } $get_error = !empty($_GET['errorh']) ? trim($_GET['errorh']) : ''; $errno = E_USER_NOTICE; switch ($get_error) { case 'auth': $errstr = $LANG['e_unauthorized']; $errno = E_USER_WARNING; break; case 'verif': $errstr = $LANG['e_incorrect_verif_code']; $errno = E_USER_WARNING; break; case 'l_flood': $errstr = sprintf($LANG['e_l_flood'], $CONFIG_COM['max_link']); break; case 'l_pseudo': $errstr = $LANG['e_link_pseudo']; break; case 'flood': $errstr = $LANG['e_flood']; break; case 'incomplete': $errstr = $LANG['e_incomplete']; break; default: $errstr = ''; } $Errorh->set_template($Template); if (!empty($errstr)) { $Template->assign_vars(array('ERROR_HANDLER' => $Errorh->display($errstr, E_USER_NOTICE))); } if (!$this->lock_com || $User->check_level(MODO_LEVEL)) { if ($captcha->is_available() && $CONFIG_COM['com_verif_code']) { $Template->assign_vars(array('C_VERIF_CODE' => true, 'VERIF_CODE' => $captcha->display_form(), 'L_REQUIRE_VERIF_CODE' => $captcha->js_require())); } if ($User->check_level($CONFIG_COM['com_auth'])) { $Template->assign_vars(array('AUTH_POST_COM' => true)); } else { $Template->assign_vars(array('ERROR_HANDLER' => $Errorh->display($LANG['e_unauthorized'], E_USER_NOTICE))); } if ($User->get_attribute('user_id') !== -1) { $Template->assign_vars(array('C_HIDDEN_COM' => true, 'LOGIN' => $User->get_attribute('login'))); } else { $Template->assign_vars(array('C_VISIBLE_COM' => true, 'LOGIN' => $LANG['guest'])); } } else { $Template->assign_vars(array('ERROR_HANDLER' => $Errorh->display($LANG['com_locked'], E_USER_NOTICE))); } $get_pos = strpos($_SERVER['QUERY_STRING'], '&pc'); if ($get_pos) { $get_page = substr($_SERVER['QUERY_STRING'], 0, $get_pos) . '&pc'; } else { $get_page = $_SERVER['QUERY_STRING'] . '&pc'; } $is_modo = $User->check_level(MODO_LEVEL); $Template->assign_vars(array('C_COM_DISPLAY' => $this->get_attribute('nbr_com') > 0 ? true : false, 'C_IS_MODERATOR' => $is_modo, 'PAGINATION_COM' => $pagination->display($this->path . $vars_simple . '&pc=%d#anchor_' . $this->script, $this->nbr_com, 'pc', $CONFIG_COM['com_max'], 3), 'LANG' => get_ulang(), 'IDCOM' => '', 'IDPROV' => $this->idprov, 'SCRIPT' => $this->script, 'PATH' => SCRIPT, 'UPDATE' => $integrated_in_environment == true ? SID : '', 'VAR' => $vars_simple, 'KERNEL_EDITOR' => display_editor($this->script . 'contents', $CONFIG_COM['forbidden_tags']), 'C_BBCODE_TINYMCE_MODE' => $User->get_attribute('user_editor') == 'tinymce', 'L_XML_LANGUAGE' => $LANG['xml_lang'], 'L_TITLE' => $CONFIG['com_popup'] == 0 || $integrated_in_environment === true ? $LANG['title_com'] : '', 'THEME' => get_utheme(), 'CONTENTS' => unparse($contents), 'L_REQUIRE_LOGIN' => $LANG['require_pseudo'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_VERIF_CODE' => $LANG['verif_code'], 'L_DELETE_MESSAGE' => $LANG['alert_delete_msg'], 'L_ADD_COMMENT' => $LANG['add_comment'], 'L_PUNISHMENT_MANAGEMENT' => $LANG['punishment_management'], 'L_WARNING_MANAGEMENT' => $LANG['warning_management'], 'L_LOGIN' => $LANG['pseudo'], 'L_MESSAGE' => $LANG['message'], 'L_QUOTE' => $LANG['quote'], 'L_RESET' => $LANG['reset'], 'L_PREVIEW' => $LANG['preview'], 'L_SUBMIT' => $LANG['submit'], 'U_ACTION' => $this->path . sprintf($this->vars, $this->idcom) . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '') . '&token=' . $Session->get_token())); $array_ranks = array(-1 => $LANG['guest'], 0 => $LANG['member'], 1 => $LANG['modo'], 2 => $LANG['admin']); $Cache->load('ranks'); $j = 0; $result = $Sql->query_while("SELECT c.idprov, c.idcom, c.login, c.timestamp, m.user_id, m.login as mlogin, m.level, m.user_mail, m.user_show_mail, m.timestamp AS registered, m.user_avatar, m.user_msg, m.user_local, m.user_web, m.user_sex, m.user_msn, m.user_yahoo, m.user_sign, m.user_warning, m.user_ban, m.user_groups, s.user_id AS connect, c.contents\n\t\t\t\tFROM " . DB_TABLE_COM . " c\n\t\t\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = c.user_id\n\t\t\t\tLEFT JOIN " . DB_TABLE_SESSIONS . " s ON s.user_id = c.user_id AND s.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\n\t\t\t\tWHERE c.script = '" . $this->script . "' AND c.idprov = '" . $this->idprov . "'\n\t\t\t\tGROUP BY c.idcom\n\t\t\t\tORDER BY c.timestamp DESC\n\t\t\t\t" . $Sql->limit($pagination->get_first_msg($CONFIG_COM['com_max'], 'pc'), $CONFIG_COM['com_max']), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { list($edit, $del) = array(false, false); $is_guest = empty($row['user_id']); if ($is_modo || $row['user_id'] == $User->get_attribute('user_id') && $User->get_attribute('user_id') !== -1) { list($edit, $del) = array(true, true); } if (!$is_guest) { $com_pseudo = '<a class="msg_link_pseudo" href="' . PATH_TO_ROOT . '/member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '" title="' . $row['mlogin'] . '"><span style="font-weight: bold;">' . wordwrap_html($row['mlogin'], 13) . '</span></a>'; } else { $com_pseudo = '<span style="font-style:italic;">' . (!empty($row['login']) ? wordwrap_html($row['login'], 13) : $LANG['guest']) . '</span>'; } $user_rank = $row['level'] === '0' ? $LANG['member'] : $LANG['guest']; $user_group = $user_rank; $user_rank_icon = ''; if ($row['level'] === '2') { $user_rank = $_array_rank[-2][0]; $user_group = $user_rank; $user_rank_icon = $_array_rank[-2][1]; } elseif ($row['level'] === '1') { $user_rank = $_array_rank[-1][0]; $user_group = $user_rank; $user_rank_icon = $_array_rank[-1][1]; } else { foreach ($_array_rank as $msg => $ranks_info) { if ($msg >= 0 && $msg <= $row['user_msg']) { $user_rank = $ranks_info[0]; $user_rank_icon = $ranks_info[1]; break; } } } $user_assoc_img = !empty($user_rank_icon) ? '<img src="' . PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/ranks/' . $user_rank_icon . '" alt="" />' : ''; if (!empty($row['user_groups']) && $_array_groups_auth) { $user_groups = ''; $array_user_groups = explode('|', $row['user_groups']); foreach ($_array_groups_auth as $idgroup => $array_group_info) { if (is_numeric(array_search($idgroup, $array_user_groups))) { $user_groups .= !empty($array_group_info['img']) ? '<img src="' . PATH_TO_ROOT . '/images/group/' . $array_group_info['img'] . '" alt="' . $array_group_info['name'] . '" title="' . $array_group_info['name'] . '"/><br />' : $LANG['group'] . ': ' . $array_group_info['name']; } } } else { $user_groups = $LANG['group'] . ': ' . $user_group; } $user_online = !empty($row['connect']) ? 'online' : 'offline'; if (empty($row['user_avatar'])) { $user_avatar = $CONFIG_USER['activ_avatar'] == '1' && !empty($CONFIG_USER['avatar_url']) ? '<img src="' . PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/' . $CONFIG_USER['avatar_url'] . '" alt="" />' : ''; } else { $user_avatar = '<img src="' . $row['user_avatar'] . '" alt="" />'; } $user_sex = ''; if ($row['user_sex'] == 1) { $user_sex = $LANG['sex'] . ': <img src="' . PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/man.png" alt="" /><br />'; } elseif ($row['user_sex'] == 2) { $user_sex = $LANG['sex'] . ': <img src="' . PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/woman.png" alt="" /><br />'; } $user_msg = $row['user_msg'] > 1 ? $LANG['message_s'] . ': ' . $row['user_msg'] : $LANG['message'] . ': ' . $row['user_msg']; if (!empty($row['user_local'])) { $user_local = $LANG['place'] . ': ' . $row['user_local']; $user_local = $user_local > 15 ? substr_html($user_local, 0, 15) . '...<br />' : $user_local . '<br />'; } else { $user_local = ''; } $contents = ucfirst(second_parse($row['contents'])); if (!$integrated_in_environment && !empty($page_path_to_root)) { $contents = str_replace('"' . $page_path_to_root . '/', '"' . PATH_TO_ROOT . '/', $contents); } $Template->assign_block_vars('com_list', array('ID' => $row['idcom'], 'CONTENTS' => $contents, 'DATE' => $LANG['on'] . ': ' . gmdate_format('date_format', $row['timestamp']), 'CLASS_COLOR' => $j % 2 == 0 ? '' : 2, 'USER_ONLINE' => '<img src="' . PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/' . $user_online . '.png" alt="" class="valign_middle" />', 'USER_PSEUDO' => $com_pseudo, '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="' . PATH_TO_ROOT . '/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="' . PATH_TO_ROOT . '/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="' . PATH_TO_ROOT . '/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="' . PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/' . get_ulang() . '/user_web.png" alt="' . $row['user_web'] . '" title="' . $row['user_yahoo'] . '" /></a>' : '', 'USER_WARNING' => !empty($row['user_warning']) ? $row['user_warning'] : '0', 'C_COM_MSG_EDIT' => $del, 'C_COM_MSG_DEL' => $edit, 'U_COM_EDIT' => $this->path . sprintf($this->vars, $row['idcom']) . '&editcom=1' . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '') . '#anchor_' . $this->script, 'U_COM_DEL' => $this->path . sprintf($this->vars, $row['idcom']) . '&token=' . $Session->get_token() . '&delcom=1' . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '') . '#anchor_' . $this->script, 'U_COM_WARNING' => $is_modo && !$is_guest ? PATH_TO_ROOT . '/member/moderation_panel' . url('.php?action=warning&id=' . $row['user_id'] . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '')) . '" title="' . $LANG['warning_management'] : '', 'U_COM_PUNISHEMENT' => $is_modo && !$is_guest ? PATH_TO_ROOT . '/member/moderation_panel' . url('.php?action=punish&id=' . $row['user_id'] . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '')) . '" title="' . $LANG['punishment_management'] : '', 'U_USER_PM' => !$is_guest ? '<a href="' . PATH_TO_ROOT . '/member/pm' . url('.php?pm=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '"><img src="' . PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/' . get_ulang() . '/pm.png" alt="" /></a>' : '', 'U_ANCHOR' => $this->path . $vars_simple . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '') . '#m' . $row['idcom'], 'U_QUOTE' => $this->path . sprintf($this->vars, $row['idcom']) . '&quote=' . $row['idcom'] . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '') . '#anchor_' . $this->script)); $j++; } $Sql->query_close($result); } return $Template->parse(TEMPLATE_STRING_MODE); } else { return 'error : class Comments loaded uncorrectly'; } }
} $User->set_user_lang(find_require_dir(PATH_TO_ROOT . '/lang/', $user_lang)); $LANG = array(); require_once PATH_TO_ROOT . '/lang/' . get_ulang() . '/main.php'; require_once PATH_TO_ROOT . '/lang/' . get_ulang() . '/errors.php'; $Cache->load('day'); if (gmdate_format('j', time(), TIMEZONE_SITE) != $_record_day && !empty($_record_day)) { import('io/filesystem/file'); $lock_file = new File(PATH_TO_ROOT . '/cache/changeday_lock'); if (!$lock_file->exists()) { $lock_file->write(''); $lock_file->flush(); } $lock_file->lock(false); $yesterday_timestamp = time() - 86400; if ((int) $Sql->query("\n\t SELECT COUNT(*)\n FROM " . DB_TABLE_STATS . "\n WHERE stats_year = '" . gmdate_format('Y', $yesterday_timestamp, TIMEZONE_SYSTEM) . "' AND\n stats_month = '" . gmdate_format('m', $yesterday_timestamp, TIMEZONE_SYSTEM) . "' AND\n stats_day = '" . gmdate_format('d', $yesterday_timestamp, TIMEZONE_SYSTEM) . "'", __LINE__, __FILE__) == 0) { $Cache->generate_file('day'); require_once PATH_TO_ROOT . '/kernel/changeday.php'; change_day(); } $lock_file->close(); } define('MODULE_NAME', get_module_name()); if (isset($MODULES[MODULE_NAME])) { if ($MODULES[MODULE_NAME]['activ'] == 0) { $Errorh->handler('e_unactivated_module', E_USER_REDIRECT); } else { if (!$User->check_auth($MODULES[MODULE_NAME]['auth'], ACCESS_MODULE)) { $Errorh->handler('e_auth', E_USER_REDIRECT); } }
function _error_log($errfile, $errline, $errno, $errstr, $archive) { if ($archive || $this->archive_all) { $errstr = $this->_clean_error_string($errstr); $error = gmdate_format('Y-m-d H:i:s', time(), TIMEZONE_SYSTEM) . "\n"; $error .= $errno . "\n"; $error .= $errstr . "\n"; $error .= basename($errfile) . "\n"; $error .= $errline . "\n"; $handle = @fopen(PATH_TO_ROOT . '/cache/error.log', 'a+'); @fwrite($handle, $error); @fclose($handle); return true; } return false; }
$table_structure = $backup->extract_table_structure(array($table)); if (!isset($backup->tables[$table])) { redirect(HOST . DIR . '/database/admin_database.php'); } foreach ($table_structure['fields'] as $fields_info) { $primary_key = false; foreach ($table_structure['index'] as $index_info) { if ($index_info['type'] == 'PRIMARY KEY' && in_array($fields_info['name'], explode(',', $index_info['fields']))) { $primary_key = true; break; } } $Template->assign_block_vars('field', array('FIELD_NAME' => $primary_key ? '<span style="text-decoration:underline">' . $fields_info['name'] . '<span>' : $fields_info['name'], 'FIELD_TYPE' => $fields_info['type'], 'FIELD_ATTRIBUTE' => $fields_info['attribute'], 'FIELD_NULL' => $fields_info['null'] ? '<strong>' . $LANG['yes'] . '</strong>' : $LANG['no'], 'FIELD_DEFAULT' => $fields_info['default'], 'FIELD_EXTRA' => $fields_info['extra'])); } foreach ($table_structure['index'] as $index_info) { $Template->assign_block_vars('index', array('INDEX_NAME' => $index_info['name'], 'INDEX_TYPE' => $index_info['type'], 'INDEX_FIELDS' => str_replace(',', '<br />', $index_info['fields']))); } $free = number_round($backup->tables[$table]['data_free'] / 1024, 1); $data = number_round($backup->tables[$table]['data_length'] / 1024, 1); $index = number_round($backup->tables[$table]['index_lenght'] / 1024, 1); $total = $index + $data; $l_total = $total > 1024 ? number_round($total / 1024, 1) . ' MB' : $total . ' kB'; $free = $free > 1024 ? number_round($free / 1024, 1) . ' MB' : $free . ' kB'; $data = $data > 1024 ? number_round($data / 1024, 1) . ' MB' : $data . ' kB'; $index = $index > 1024 ? number_round($index / 1024, 1) . ' MB' : $index . ' kB'; $Template->assign_vars(array('C_DATABASE_TABLE_STRUCTURE' => true, 'C_DATABASE_TABLE_DATA' => false, 'C_AUTOINDEX' => !empty($backup->tables[$table]['auto_increment']) ? true : false, 'TABLE_ENGINE' => $backup->tables[$table]['engine'], 'TABLE_ROW_FORMAT' => $backup->tables[$table]['row_format'], 'TABLE_ROWS' => $backup->tables[$table]['rows'], 'TABLE_DATA' => $data != 0 ? $data : '-', 'TABLE_INDEX' => $index != 0 ? $index : '-', 'TABLE_TOTAL_SIZE' => $total != 0 ? $l_total : '-', 'TABLE_FREE' => $free != 0 ? '<span style="color:red">' . $free . '</span>' : '-', 'TABLE_COLLATION' => $backup->tables[$table]['collation'], 'TABLE_AUTOINCREMENT' => $backup->tables[$table]['auto_increment'], 'TABLE_CREATION_DATE' => gmdate_format('date_format_long', strtotime($backup->tables[$table]['create_time'])), 'TABLE_LAST_UPDATE' => gmdate_format('date_format_long', strtotime($backup->tables[$table]['update_time'])), 'L_TABLE_FIELD' => $LANG['db_table_field'], 'L_TABLE_TYPE' => $LANG['type'], 'L_TABLE_ATTRIBUTE' => $LANG['db_table_attribute'], 'L_TABLE_NULL' => $LANG['db_table_null'], 'L_TABLE_DEFAULT' => $LANG['default'], 'L_TABLE_EXTRA' => $LANG['db_table_extra'], 'L_TABLE_NAME' => $LANG['db_table_name'], 'L_TABLE_ROWS' => $LANG['db_table_rows'], 'L_TABLE_ROWS_FORMAT' => $LANG['db_table_rows_format'], 'L_TABLE_ENGINE' => $LANG['db_table_engine'], 'L_TABLE_COLLATION' => $LANG['db_table_collation'], 'L_TABLE_DATA' => $LANG['db_table_data'], 'L_TABLE_TOTAL' => $LANG['total'], 'L_INDEX_NAME' => $LANG['name'], 'L_TABLE_INDEX' => $LANG['db_table_index'], 'L_TABLE_FREE' => $LANG['db_table_free'], 'L_STATISTICS' => $LANG['stats'], 'L_OPTIMIZE' => $LANG['db_optimize'], 'L_AUTOINCREMENT' => $LANG['db_autoincrement'], 'L_LAST_UPDATE' => $LANG['last_update'], 'L_CREATION_DATE' => $LANG['creation_date'], 'L_OPTIMIZE' => $LANG['db_optimize'], 'L_SIZE' => $LANG['size'])); } else { redirect(HOST . DIR . '/database/admin_database.php'); } $Template->pparse('admin_database_tools'); require_once '../admin/admin_footer.php';
if (is_numeric(array_search($idgroup, $array_user_groups))) { $user_groups .= !empty($array_group_info['img']) ? '<img src="../images/group/' . $array_group_info['img'] . '" alt="' . $array_group_info['name'] . '" title="' . $array_group_info['name'] . '"/><br />' : $LANG['group'] . ': ' . $array_group_info['name']; } } } else { $user_groups = $LANG['group'] . ': ' . $user_group; } $user_online = !empty($row['connect']) ? 'online' : 'offline'; if (empty($row['user_avatar'])) { $user_avatar = $CONFIG_USER['activ_avatar'] == '1' && !empty($CONFIG_USER['avatar_url']) ? '<img src="../templates/' . get_utheme() . '/images/' . $CONFIG_USER['avatar_url'] . '" alt="" />' : ''; } else { $user_avatar = '<img src="' . $row['user_avatar'] . '" alt="" />'; } $user_sex = ''; if ($row['user_sex'] == 1) { $user_sex = $LANG['sex'] . ': <img src="../templates/' . get_utheme() . '/images/man.png" alt="" /><br />'; } elseif ($row['user_sex'] == 2) { $user_sex = $LANG['sex'] . ': <img src="../templates/' . get_utheme() . '/images/woman.png" alt="" /><br />'; } $user_msg = $row['user_msg'] > 1 ? $LANG['message_s'] . ': ' . $row['user_msg'] : $LANG['message'] . ': ' . $row['user_msg']; if (!empty($row['user_local'])) { $user_local = $LANG['place'] . ': ' . $row['user_local']; $user_local = $user_local > 15 ? substr_html($user_local, 0, 15) . '...<br />' : $user_local . '<br />'; } else { $user_local = ''; } $row['path'] = preg_replace('`"e=[0-9]+`', '', $row['path']); $Template->assign_block_vars('com', array('ID' => $row['idcom'], 'CONTENTS' => ucfirst(second_parse($row['contents'])), 'COM_SCRIPT' => 'anchor_' . $row['script'], 'DATE' => $LANG['on'] . ': ' . gmdate_format('date_format', $row['timestamp']), 'USER_ONLINE' => '<img src="../templates/' . get_utheme() . '/images/' . $user_online . '.png" alt="" class="valign_middle" />', 'USER_PSEUDO' => $com_pseudo, '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_yahoo'] . '" /></a>' : '', 'U_PROV' => $row['path'], 'U_USER_PM' => '<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="" /></a>', 'U_EDIT_COM' => preg_replace('`com=[0-9]+`', 'com=' . $row['idcom'], $row['path']) . '&editcom=1', 'U_DEL_COM' => preg_replace('`com=[0-9]+`', 'com=' . $row['idcom'], $row['path']) . '&delcom=1')); } $Template->pparse('admin_com_management'); require_once '../admin/admin_footer.php';
function parse_search_result(&$result_data) { global $CONFIG, $LANG, $CONFIG_USER; load_module_lang('forum'); $tpl = new Template('forum/forum_generic_results.tpl'); $tpl->assign_vars(array('L_ON' => $LANG['on'], 'L_TOPIC' => $LANG['topic'])); $rewrited_title = $CONFIG['rewrite'] == 1 ? '+' . url_encode_rewrite($result_data['title']) : ''; $tpl->assign_vars(array('USER_ONLINE' => '<img src="' . PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/' . (!empty($result_data['connect']) && $result_data['user_id'] !== -1 ? 'online' : 'offline') . '.png" alt="" class="valign_middle" />', 'U_USER_PROFILE' => !empty($result_data['user_id']) ? PATH_TO_ROOT . '/member/member' . url('.php?id=' . $result_data['user_id'], '-' . $result_data['user_id'] . '.php') : '', 'USER_PSEUDO' => !empty($result_data['login']) ? wordwrap_html($result_data['login'], 13) : $LANG['guest'], 'U_TOPIC' => PATH_TO_ROOT . '/forum/topic' . url('.php?id=' . $result_data['topic_id'], '-' . $result_data['topic_id'] . $rewrited_title . '.php') . '#m' . $result_data['msg_id'], 'TITLE' => ucfirst($result_data['title']), 'DATE' => gmdate_format('d/m/y', $result_data['date']), 'CONTENTS' => second_parse($result_data['contents']), 'USER_AVATAR' => '<img src="' . ($CONFIG_USER['activ_avatar'] == '1' && !empty($result_data['avatar']) ? $result_data['avatar'] : PATH_TO_ROOT . '/templates/' . get_utheme() . '/images/' . $CONFIG_USER['avatar_url']) . '" alt="" />')); return $tpl->parse(TEMPLATE_STRING_MODE); }
} elseif (!$no_alert_on_error) { global $Errorh; $Errorh->handler('Le module <strong>' . $module_name . '</strong> n\'a pas de fonction get_home_page!', E_USER_ERROR, __LINE__, __FILE__); exit; } } elseif (!empty($idnews)) { if (empty($news['id'])) { $Errorh->handler('e_unexist_news', E_USER_REDIRECT); } import('content/comments'); import('content/syndication/feed'); $tpl_news = new Template('news/news.tpl'); $next_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id > '" . $idnews . "' " . $Sql->limit(0, 1), __LINE__, __FILE__); $previous_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id < '" . $idnews . "' ORDER BY id DESC " . $Sql->limit(0, 1), __LINE__, __FILE__); $tpl_news->assign_vars(array('C_IS_ADMIN' => $is_admin, 'C_NEWS_BLOCK' => true, 'C_NEWS_NAVIGATION_LINKS' => true, 'C_PREVIOUS_NEWS' => !empty($previous_news['id']), 'C_NEXT_NEWS' => !empty($next_news['id']), 'TOKEN' => $Session->get_token(), 'PREVIOUS_NEWS' => $previous_news['title'], 'NEXT_NEWS' => $next_news['title'], 'U_PREVIOUS_NEWS' => url('.php?id=' . $previous_news['id'], '-0-' . $previous_news['id'] . '+' . url_encode_rewrite($previous_news['title']) . '.php'), 'U_NEXT_NEWS' => url('.php?id=' . $next_news['id'], '-0-' . $next_news['id'] . '+' . url_encode_rewrite($next_news['title']) . '.php'), 'L_SYNDICATION' => $LANG['syndication'], 'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'], 'L_ON' => $LANG['on'], 'L_DELETE' => $LANG['delete'], 'L_EDIT' => $LANG['edit'])); $tpl_news->assign_block_vars('news', array('C_IMG' => !empty($news['img']), 'C_ICON' => !empty($news['icon']) && $CONFIG_NEWS['activ_icon'] == 1, 'ID' => $news['id'], 'IDCAT' => $news['idcat'], 'ICON' => second_parse_url($news['icon']), 'TITLE' => $news['title'], 'CONTENTS' => second_parse($news['contents']), 'EXTEND_CONTENTS' => second_parse($news['extend_contents']) . '<br /><br />', 'IMG' => second_parse_url($news['img']), 'IMG_DESC' => $news['alt'], 'PSEUDO' => $CONFIG_NEWS['display_author'] ? $news['login'] : '', 'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' . gmdate_format('date_format_short', $news['timestamp']) : '', 'U_COM' => $CONFIG_NEWS['activ_com'] == 1 ? Comments::com_display_link($news['nbr_com'], '../news/news' . url('.php?cat=0&id=' . $idnews . '&com=0', '-0-' . $idnews . '+' . url_encode_rewrite($news['title']) . '.php?com=0'), $idnews, 'news') : '', 'U_USER_ID' => url('.php?id=' . $news['user_id'], '-' . $news['user_id'] . '.php'), 'U_NEWS_LINK' => url('.php?id=' . $news['id'], '-0-' . $news['id'] . '+' . url_encode_rewrite($news['title']) . '.php'), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL))); } elseif (!empty($idcat)) { $tpl_news = new Template('news/news_cat.tpl'); $cat = $Sql->query_array(PREFIX . 'news_cat', 'id', 'name', 'icon', "WHERE id = '" . $idcat . "'", __LINE__, __FILE__); if (empty($cat['id'])) { $Errorh->handler('error_unexist_cat', E_USER_REDIRECT); } $tpl_news->assign_vars(array('C_IS_ADMIN' => $is_admin, 'C_NEWS_LINK' => true, 'CAT_NAME' => $cat['name'], 'IDCAT' => $cat['id'], 'L_EDIT' => $LANG['edit'], 'L_CATEGORY' => $LANG['category'])); $result = $Sql->query_while("SELECT n.id, n.title, n.nbr_com, nc.id AS idcat, nc.icon\n\tFROM " . PREFIX . "news n\n\tLEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat\n\tWHERE n.visible = 1 AND n.idcat = '" . $idcat . "'\n\tORDER BY n.timestamp DESC", __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { $tpl_news->assign_block_vars('list', array('ICON' => !empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1 ? '<a href="news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . '"><img class="valign_middle" src="' . $row['icon'] . '" alt="" /></a>' : '', 'TITLE' => $row['title'], 'COM' => $row['nbr_com'], 'U_NEWS' => 'news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'))); } } if (isset($_GET['com']) && $idnews > 0) { $tpl_news->assign_vars(array('COMMENTS' => display_comments('news', $idnews, url('news.php?id=' . $idnews . '&com=%s', 'news-0-' . $idnews . '.php?com=%s')))); }
$checked_normal = $type == 0 ? 'checked="ckecked"' : ''; $checked_postit = $type == 1 ? 'checked="ckecked"' : ''; $checked_annonce = $type == 2 ? 'checked="ckecked"' : ''; $nbr_poll_field = 0; for ($i = 0; $i < 20; $i++) { $answer = retrieve(POST, 'a' . $i, '', TSTRING_UNCHANGE); if (!empty($answer)) { $Template->assign_block_vars('answers_poll', array('ID' => $i, 'ANSWER' => $answer)); $nbr_poll_field++; } elseif ($i <= 5) { $Template->assign_block_vars('answers_poll', array('ID' => $i, 'ANSWER' => '')); $nbr_poll_field++; } } $poll_type = retrieve(POST, 'poll_type', 0); $Template->assign_vars(array('TITLE' => $title, 'DESC' => $subtitle, 'CONTENTS' => $contents, 'QUESTION' => $question, 'IDM' => $id_post_msg, 'DATE' => $LANG['on'] . ' ' . gmdate_format('date_format'), 'CONTENTS_PREVIEW' => second_parse(stripslashes(strparse($contents))), 'CHECKED_NORMAL' => $checked_normal, 'CHECKED_POSTIT' => $checked_postit, 'CHECKED_ANNONCE' => $checked_annonce, 'SELECTED_SIMPLE' => $poll_type == 0 ? 'checked="ckecked"' : '', 'SELECTED_MULTIPLE' => $poll_type == 1 ? 'checked="ckecked"' : '', 'NO_DISPLAY_POLL' => !empty($question) ? 'false' : 'true', 'NBR_POLL_FIELD' => $nbr_poll_field, 'C_FORUM_PREVIEW_MSG' => true, 'C_ADD_POLL_FIELD' => $nbr_poll_field <= 18 ? true : false, 'C_FORUM_POST_TYPE' => true, 'L_PREVIEW' => $LANG['preview'], 'L_TYPE' => '* ' . $LANG['type'], 'L_DEFAULT' => $LANG['default'], 'L_POST_IT' => $LANG['forum_postit'], 'L_ANOUNCE' => $LANG['forum_announce'])); } list($users_list, $total_admin, $total_modo, $total_member, $total_visit, $total_online) = forum_list_user_online("AND s.session_script LIKE '/forum/%'"); $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, '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_move'); } elseif (!empty($id_post_msg) && !empty($post_topic)) { $msg = $Sql->query_array(PREFIX . 'forum_msg', 'idtopic', 'user_id', 'timestamp', 'contents', "WHERE id = '" . $id_post_msg . "'", __LINE__, __FILE__); $topic = $Sql->query_array(PREFIX . 'forum_topics', 'idcat', 'title', 'last_user_id', 'last_msg_id', 'last_timestamp', "WHERE id = '" . $msg['idtopic'] . "'", __LINE__, __FILE__); $to = retrieve(POST, 'to', 0); if (!$User->check_auth($CAT_FORUM[$topic['idcat']]['auth'], EDIT_CAT_FORUM)) { $Errorh->handler('e_auth', E_USER_REDIRECT); } $id_first = $Sql->query("SELECT MIN(id) FROM " . PREFIX . "forum_msg WHERE idtopic = '" . $msg['idtopic'] . "'", __LINE__, __FILE__); if ($id_first == $id_post_msg) { $Errorh->handler('e_unable_cut_forum', E_USER_REDIRECT); }
if ($CONFIG['maintain'] != -1 && $CONFIG['maintain'] <= time()) { header('location: ' . get_start_page()); exit; } $Template->set_filenames(array('maintain' => 'member/maintain.tpl')); $array_time = array(0 => '-1', 1 => '0', 2 => '60', 3 => '300', 4 => '900', 5 => '1800', 6 => '3600', 7 => '7200', 8 => '86400', 9 => '172800', 10 => '604800'); $array_delay = array(0 => $LANG['unspecified'], 1 => '', 2 => '1 ' . $LANG['minute'], 3 => '5 ' . $LANG['minutes'], 4 => '15 ' . $LANG['minutes'], 5 => '30 ' . $LANG['minutes'], 6 => '1 ' . $LANG['hour'], 7 => '2 ' . $LANG['hours'], 8 => '1 ' . $LANG['day'], 9 => '2 ' . $LANG['days'], 10 => '1 ' . $LANG['week']); if ($CONFIG['maintain'] != -1) { $key = 0; $current_time = time(); for ($i = 10; $i >= 0; $i--) { $delay = $CONFIG['maintain'] - $current_time - $array_time[$i]; if ($delay >= $array_time[$i]) { $key = $i; break; } } $seconds = gmdate_format('s', $CONFIG['maintain'], TIMEZONE_SITE); $array_release = array(gmdate_format('Y', $CONFIG['maintain'], TIMEZONE_SITE), gmdate_format('n', $CONFIG['maintain'], TIMEZONE_SITE) - 1, gmdate_format('j', $CONFIG['maintain'], TIMEZONE_SITE), gmdate_format('G', $CONFIG['maintain'], TIMEZONE_SITE), gmdate_format('i', $CONFIG['maintain'], TIMEZONE_SITE), $seconds < 10 ? trim($seconds, 0) : $seconds); $seconds = gmdate_format('s', time(), TIMEZONE_SITE); $array_now = array(gmdate_format('Y', time(), TIMEZONE_SITE), gmdate_format('n', time(), TIMEZONE_SITE) - 1, gmdate_format('j', time(), TIMEZONE_SITE), gmdate_format('G', time(), TIMEZONE_SITE), gmdate_format('i', time(), TIMEZONE_SITE), $seconds < 10 ? trim($seconds, 0) : $seconds); } else { $key = -1; $array_release = array('0', '0', '0', '0', '0', '0'); $array_now = array('0', '0', '0', '0', '0', '0'); } $Template->assign_vars(array('SITE_NAME' => $CONFIG['site_name'], 'VERSION' => $CONFIG['version'], 'THEME' => get_utheme(), 'DELAY' => isset($array_delay[$key + 1]) ? $array_delay[$key + 1] : '0', 'MAINTAIN_NOW_FORMAT' => implode(',', $array_now), 'MAINTAIN_RELEASE_FORMAT' => implode(',', $array_release), 'U_INDEX' => !$User->check_level(ADMIN_LEVEL) ? '<a href="../admin/admin_index.php">' . $LANG['admin'] . '</a>' : '<a href="' . get_start_page() . '">' . $LANG['home'] . '</a>', 'L_XML_LANGUAGE' => $LANG['xml_lang'], 'L_MAINTAIN' => !empty($CONFIG['maintain_text']) ? second_parse($CONFIG['maintain_text']) : $LANG['maintain'], 'L_MAINTAIN_TITLE' => $LANG['title_maintain'], 'L_LOADING' => $LANG['loading'], 'L_DAYS' => $LANG['days'], 'L_HOURS' => $LANG['hours'], 'L_MIN' => $LANG['minutes'], 'L_SEC' => $LANG['seconds'], 'L_POWERED_BY' => $LANG['powered_by'], 'L_PHPBOOST_RIGHT' => $LANG['phpboost_right'], 'PHPBOOST_VERSION' => $CONFIG['version'])); if ($CONFIG['maintain_delay'] == 1 && $CONFIG['maintain'] != -1) { $Template->assign_vars(array('C_DISPLAY_DELAY' => true, 'DELAY' => isset($array_delay[$key + 1]) ? $array_delay[$key + 1] : '0', 'L_MAINTAIN_DELAY' => $LANG['maintain_delay'])); } $Template->pparse('maintain');