本文整理汇总了PHP中Pagination::get_first_msg方法的典型用法代码示例。如果您正苦于以下问题:PHP Pagination::get_first_msg方法的具体用法?PHP Pagination::get_first_msg怎么用?PHP Pagination::get_first_msg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pagination
的用法示例。
在下文中一共展示了Pagination::get_first_msg方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
$Sql->query_close($result);
if ($i == 0) {
$Errorh->handler($LANG['require_cat_create'], E_USER_WARNING);
}
$Template->assign_block_vars('news.preview', array('THEME' => get_utheme(), 'TITLE' => $title, 'CONTENTS' => second_parse(stripslashes($contents)), 'EXTEND_CONTENTS' => second_parse(stripslashes($extend_contents)), 'PSEUDO' => $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $user_id . "'", __LINE__, __FILE__), 'USER_ID' => url('.php?id=' . $user_id, '-' . $user_id . '.php'), 'IMG_PREVIEW' => $img_displays, 'IMG' => $img_displays, 'DATE' => gmdate_format('date_format_short')));
$Template->assign_vars(array('TOKEN' => $Session->get_token(), 'KERNEL_EDITOR' => display_editor(), 'KERNEL_EDITOR_EXTEND' => display_editor('extend_contents'), 'L_UNTIL' => $LANG['until'], '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_ON' => $LANG['on'], 'L_EDIT_NEWS' => $LANG['edit_news'], 'L_REQUIRE' => $LANG['require'], 'L_NEWS_MANAGEMENT' => $LANG['news_management'], 'L_ADD_NEWS' => $LANG['add_news'], 'L_CONFIG_NEWS' => $LANG['configuration_news'], 'L_CAT_NEWS' => $LANG['category_news'], 'L_TITLE' => $LANG['title'], 'L_CATEGORY' => $LANG['category'], 'L_TEXT' => $LANG['content'], 'L_EXTENDED_NEWS' => $LANG['extended_news'], 'L_RELEASE_DATE' => $LANG['release_date'], 'L_IMMEDIATE' => $LANG['immediate'], 'L_UNAPROB' => $LANG['unaprob'], 'L_NEWS_DATE' => $LANG['news_date'], 'L_UNIT_HOUR' => $LANG['unit_hour'], 'L_AT' => $LANG['at'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_IMG_MANAGEMENT' => $LANG['img_management'], 'L_PREVIEW_IMG' => $LANG['preview_image'], 'L_PREVIEW_IMG_EXPLAIN' => $LANG['preview_image_explain'], 'L_BB_UPLOAD' => $LANG['bb_upload'], 'L_IMG_LINK' => $LANG['img_link'], 'L_IMG_DESC' => $LANG['img_desc'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset']));
$Template->pparse('admin_news_management');
} else {
$Template->set_filenames(array('admin_news_management' => 'news/admin_news_management.tpl'));
$nbr_news = $Sql->count_table('news', __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('TOKEN' => $Session->get_token(), 'PAGINATION' => $Pagination->display('admin_news.php?p=%d', $nbr_news, 'p', 25, 3), 'LANG' => get_ulang(), 'THEME' => get_utheme(), 'L_CONFIRM_DEL_NEWS' => $LANG['confirm_del_news'], 'L_NEWS_MANAGEMENT' => $LANG['news_management'], 'L_ADD_NEWS' => $LANG['add_news'], 'L_CONFIG_NEWS' => $LANG['configuration_news'], 'L_CAT_NEWS' => $LANG['category_news'], 'L_CATEGORY' => $LANG['category'], 'L_TITLE' => $LANG['title'], 'L_PSEUDO' => $LANG['pseudo'], 'L_DATE' => $LANG['date'], 'L_APROB' => $LANG['aprob'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete']));
$Template->assign_block_vars('list', array());
$result = $Sql->query_while("SELECT nc.name, n.id, n.title, n.timestamp, n.visible, n.start, n.end, m.login\n\t\t\tFROM " . PREFIX . "news n\n\t\t\tLEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat\n\t\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = n.user_id\n\t\t\tORDER BY n.timestamp DESC \n\t\t\t" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
if ($row['visible'] && $row['start'] > time()) {
$aprob = $LANG['waiting'];
} elseif ($row['visible'] && $row['start'] < time() && ($row['end'] > time() || empty($row['end']))) {
$aprob = $LANG['yes'];
} else {
$aprob = $LANG['no'];
}
$title = html_entity_decode($row['title'], ENT_COMPAT, 'ISO-8859-1');
$title = strlen($title) > 45 ? substr($title, 0, 45) . '...' : $title;
$visible = '';
if ($row['start'] > 0) {
$visible .= gmdate_format('date_format', $row['start']);
}
if ($row['end'] > 0 && $row['start'] > 0) {
示例2: retrieve
$sort = 'login';
break;
case 'rank':
$sort = 'level';
break;
case 'aprob':
$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>' : '';
示例3: import
if (!empty($table) && $action == 'data') {
import('util/pagination');
$Pagination = new Pagination();
$table_structure = $backup->extract_table_structure(array($table));
$primary_key = '';
foreach ($table_structure['fields'] as $fields_info) {
$check_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 = $fields_info['name'];
break;
}
}
}
$nbr_lines = $Sql->query("SELECT COUNT(*) FROM " . $table, __LINE__, __FILE__);
$query = "SELECT * FROM " . $table . $Sql->limit($Pagination->get_first_msg(30, 'p'), 30);
$result = $Sql->query_while($query, __LINE__, __FILE__);
$i = 1;
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('line', array());
if ($i == 1) {
$Template->assign_block_vars('line.field', array('FIELD' => ' ', 'CLASS' => 'row1', 'STYLE' => ''));
foreach ($row as $field_name => $field_value) {
$Template->assign_block_vars('line.field', array('FIELD' => '<strong>' . $field_name . '</strong>', 'CLASS' => 'row1'));
}
$Template->assign_block_vars('line', array());
}
$j = 0;
foreach ($row as $field_name => $field_value) {
if ($j == 0 && !empty($primary_key)) {
$Template->assign_block_vars('line.field', array('FIELD' => '<a href="admin_database_tools.php?table=' . $table . '&field=' . $field_name . '&value=' . $field_value . '&action=update&token=' . $Session->get_token() . '" title="' . $LANG['update'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" alt="" class="valign_middle" /></a> <a href="admin_database_tools.php?table=' . $table . '&field=' . $field_name . '&value=' . $field_value . '&action=delete&token=' . $Session->get_token() . '" onclick="javascript:return Confirm_del_entry()" title="' . $LANG['delete'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/delete.png" alt="" class="valign_middle" /></a>', 'CLASS' => 'row1', 'STYLE' => ''));
示例4: Folder
$nbr_com = !empty($module) ? !empty($array_com[$module]) ? $array_com[$module] : 0 : $Sql->count_table('com', __LINE__, __FILE__);
$Template->assign_vars(array('THEME' => get_utheme(), 'LANG' => get_ulang(), 'PAGINATION_COM' => $Pagination->display('admin_com.php?pc=%d', $nbr_com, 'pc', $CONFIG_COM['com_max'], 3), 'L_DISPLAY_RECENT' => $LANG['display_recent_com'], 'L_DISPLAY_TOPIC_COM' => $LANG['display_topic_com'], 'L_CONFIRM_DELETE' => $LANG['alert_delete_msg'], 'L_EDIT' => $LANG['edit'], 'L_DELETE' => $LANG['delete'], 'L_COM' => $LANG['com'], 'L_COM_MANAGEMENT' => $LANG['com_management'], 'L_COM_CONFIG' => $LANG['com_config']));
import('io/filesystem/folder');
$folder_path = new Folder('../');
foreach ($folder_path->get_folders('`^[a-z0-9_ -]+$`i') as $modules) {
$modulef = $modules->get_name();
if (@file_exists('../' . $modulef . '/lang/' . get_ulang() . '/config.ini')) {
$info_module = load_ini_file('../' . $modulef . '/lang/', get_ulang());
if (isset($info_module['info']) && !empty($info_module['com'])) {
$Template->assign_block_vars('modules_com', array('MODULES' => $info_module['name'] . (isset($array_com[$info_module['com']]) ? ' (' . $array_com[$info_module['com']] . ')' : ' (0)'), 'U_MODULES' => $info_module['com']));
}
}
}
$Cache->load('ranks');
$cond = !empty($module) ? "WHERE script = '" . $module . "'" : '';
$result = $Sql->query_while("SELECT c.idprov, c.idcom, c.login, c.user_id, c.timestamp, c.script, c.path, 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\nFROM " . DB_TABLE_COM . " c\nLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = c.user_id\nLEFT JOIN " . DB_TABLE_SESSIONS . " s ON s.user_id = c.user_id AND s.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\n" . $cond . "\nGROUP BY c.idcom\nORDER BY c.timestamp DESC\n" . $Sql->limit($Pagination->get_first_msg($CONFIG_COM['com_max'], 'pc'), $CONFIG_COM['com_max']), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$row['user_id'] = (int) $row['user_id'];
$is_guest = $row['user_id'] === -1;
if (!$is_guest) {
$com_pseudo = '<a class="msg_link_pseudo" href="../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;
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') {
示例5: foreach
$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']);
}
$name_cut = strlen(html_entity_decode($row['name'], ENT_COMPAT, 'ISO-8859-1')) > 22 ? htmlentities(substr(html_entity_decode($row['name'], ENT_COMPAT, 'ISO-8859-1'), 0, 22), ENT_COMPAT, 'ISO-8859-1') . '...' : $row['name'];
$name = html_entity_decode($row['name'], ENT_COMPAT, 'ISO-8859-1');
$name = strlen($name) > 20 ? substr($name, 0, 20) . '...' : $name;
$tr_start = is_int($j / $nbr_column_pics) ? '<tr>' : '';
$j++;
$tr_end = is_int($j / $nbr_column_pics) ? '</tr>' : '';
if ($CONFIG_GALLERY['display_pics'] == 3) {
$display_link = HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&cat=' . $row['idcat']);
} elseif ($CONFIG_GALLERY['display_pics'] == 2) {
$display_link = 'javascript:display_pics_popup(\'' . HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&cat=' . $row['idcat']) . '\', \'' . $row['width'] . '\', \'' . $row['height'] . '\')';
} elseif ($CONFIG_GALLERY['display_pics'] == 1) {
示例6: import
$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)) {
$Template->assign_block_vars('cat_list', array('WIDTH' => $column_width, 'TOTAL' => $row['count'], 'CAT' => $row['name'], 'CONTENTS' => $row['contents'], 'U_IMG_CAT' => !empty($row['icon']) ? '<a href="../web/web' . url('.php?cat=' . $row['id'], '-' . $row['id'] . '.php') . '"><img src="' . $row['icon'] . '" alt="" /></a><br />' : '', 'U_WEB_CAT' => url('.php?cat=' . $row['id'], '-' . $row['id'] . '.php')));
}
$Sql->query_close($result);
$Template->pparse('web');
}
require_once '../kernel/footer.php';
示例7: Template
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);
}
示例8: retrieve
require_once '../kernel/header.php';
$view_msg = retrieve(GET, 'id', 0);
if (!empty($view_msg)) {
$Template->set_filenames(array('membermsg' => 'forum/forum_membermsg.tpl', 'forum_top' => 'forum/forum_top.tpl', 'forum_bottom' => 'forum/forum_bottom.tpl'));
import('util/pagination');
$Pagination = new Pagination();
$auth_cats = '';
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, ',') . ")" : '';
$nbr_msg = $Sql->query("SELECT COUNT(*)\n\tFROM " . PREFIX . "forum_msg msg\n\tLEFT JOIN " . PREFIX . "forum_topics t ON msg.idtopic = t.id\n\tJOIN " . PREFIX . "forum_cats c ON t.idcat = c.id AND c.aprob = 1" . $auth_cats . "\n\tWHERE msg.user_id = '" . $view_msg . "'", __LINE__, __FILE__);
$Template->assign_vars(array('SID' => SID, 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'FORUM_NAME' => $CONFIG_FORUM['forum_name'] . ' : ' . $LANG['show_member_msg'], 'PAGINATION' => $Pagination->display('membermsg' . url('.php?id=' . $view_msg . '&p=%d'), $nbr_msg, 'p', 10, 3), 'L_BACK' => $LANG['back'], 'L_VIEW_MSG_USER' => $LANG['show_member_msg'], 'L_FORUM_INDEX' => $LANG['forum_index'], 'U_FORUM_VIEW_MSG' => url('.php?id=' . $view_msg)));
$result = $Sql->query_while("SELECT msg.id, msg.user_id, msg.idtopic, msg.timestamp, msg.timestamp_edit, m.user_groups, t.title, t.status, t.idcat, c.name, m.login, 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, s.user_id AS connect, msg.contents\n\tFROM " . PREFIX . "forum_msg msg\n\tLEFT JOIN " . PREFIX . "forum_topics t ON msg.idtopic = t.id\n\tJOIN " . PREFIX . "forum_cats c ON t.idcat = c.id AND c.aprob = 1\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = '" . $view_msg . "'\n\tLEFT JOIN " . DB_TABLE_SESSIONS . " s ON s.user_id = msg.user_id AND s.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\n\tWHERE msg.user_id = '" . $view_msg . "'" . $auth_cats . "\n\tORDER BY msg.id DESC\n\t" . $Sql->limit($Pagination->get_first_msg(10, 'p'), 10), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$user_online = !empty($row['connect']) ? 'online' : 'offline';
$rewrited_cat_title = $CONFIG['rewrite'] == 1 ? '+' . url_encode_rewrite($row['name']) : '';
$rewrited_title = $CONFIG['rewrite'] == 1 ? '+' . url_encode_rewrite($row['title']) : '';
$edit_mark = $row['timestamp_edit'] > 0 && $CONFIG_FORUM['edit_mark'] == '0' ? '<br /><br /><br /><span style="padding: 10px;font-size:10px;font-style:italic;">' . $LANG['edit_by'] . ' <a class="edit_pseudo" href="../member/member' . url('.php?id=' . $row['user_id_edit'], '-' . $row['user_id_edit'] . '.php') . '">' . $row['login_edit'] . '</a> ' . $LANG['on'] . ' ' . gmdate_format('date_format', $row['timestamp_edit']) . '</span><br />' : '';
$Template->assign_block_vars('list', array('CONTENTS' => second_parse($row['contents']), 'DATE' => $LANG['on'] . ' ' . gmdate_format('date_format', $row['timestamp']), 'ID' => $row['id'], 'USER_ONLINE' => '<img src="../templates/' . get_utheme() . '/images/' . (!empty($row['connect']) ? 'online' : 'offline') . '.png" alt="" class="valign_middle" />', 'USER_PSEUDO' => !empty($row['login']) ? wordwrap(html_entity_decode($row['login'], ENT_COMPAT, 'ISO-8859-1'), 13, '<br />', 1) : $LANG['guest'], 'U_USER_ID' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_USER_ID' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_VARS_ANCRE' => url('.php?id=' . $row['idtopic'], '-' . $row['idtopic'] . $rewrited_title . '.php'), 'U_FORUM_CAT' => '<a class="forum_mbrmsg_links" href="../forum/forum' . url('.php?id=' . $row['idcat'], '-' . $row['idcat'] . $rewrited_cat_title . '.php') . '">' . $row['name'] . '</a>', 'U_TITLE_T' => '<a class="forum_mbrmsg_links" href="../forum/topic' . url('.php?id=' . $row['idtopic'], '-' . $row['idtopic'] . $rewrited_title . '.php') . '">' . ucfirst($row['title']) . '</a>'));
}
$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 LIKE '" . DIR . "/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('membermsg');
} else {
redirect(HOST . DIR . '/forum/index.php');
}
require_once '../kernel/footer.php';
示例9: retrieve
function get_home_page()
{
global $User, $Sql, $Cache, $Bread_crumb, $CONFIG_NEWS, $LANG, $Session;
require_once PATH_TO_ROOT . '/news/news_begin.php';
$show_archive = retrieve(GET, 'arch', false);
$is_admin = $User->check_level(ADMIN_LEVEL);
$tpl_news = new Template('news/news.tpl');
if ($CONFIG_NEWS['activ_edito'] == 1) {
$tpl_news->assign_vars(array('C_NEWS_EDITO' => true, 'CONTENTS' => second_parse($CONFIG_NEWS['edito']), 'TITLE' => $CONFIG_NEWS['edito_title']));
}
import('content/comments');
import('content/syndication/feed');
import('util/pagination');
$Pagination = new Pagination();
if ($CONFIG_NEWS['activ_pagin'] == '1') {
$show_pagin = $Pagination->display(PATH_TO_ROOT . '/news/news' . url('.php?p=%d', '-0-0-%d.php'), $CONFIG_NEWS['nbr_news'], 'p', $CONFIG_NEWS['pagination_news'], 3);
$first_msg = $Pagination->get_first_msg($CONFIG_NEWS['pagination_news'], 'p');
} elseif ($show_archive) {
$show_pagin = $Pagination->display(PATH_TO_ROOT . '/news/news' . url('.php?arch=1&p=%d', '-0-0-%d.php?arch=1'), $CONFIG_NEWS['nbr_news'] - $CONFIG_NEWS['pagination_news'], 'p', $CONFIG_NEWS['pagination_arch'], 3);
$first_msg = $CONFIG_NEWS['pagination_news'] + $Pagination->get_first_msg($CONFIG_NEWS['pagination_arch'], 'p');
$CONFIG_NEWS['pagination_news'] = $CONFIG_NEWS['pagination_arch'];
} else {
$show_pagin = $CONFIG_NEWS['nbr_news'] > $CONFIG_NEWS['pagination_news'] && $CONFIG_NEWS['nbr_news'] != 0 ? '<a href="' . PATH_TO_ROOT . '/news/news.php?arch=1" title="' . $LANG['display_archive'] . '">' . $LANG['display_archive'] . '</a>' : '';
$first_msg = 0;
}
$tpl_news->assign_vars(array('C_IS_ADMIN' => $is_admin, 'C_NEWS_NAVIGATION_LINKS' => false, 'L_SYNDICATION' => $LANG['syndication'], 'PAGINATION' => $show_pagin, 'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'], 'L_LAST_NEWS' => !$show_archive ? $LANG['last_news'] : $LANG['archive'], 'PATH_TO_ROOT' => TPL_PATH_TO_ROOT, 'THEME' => get_utheme(), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL)));
if ($CONFIG_NEWS['type'] == 1 && !$show_archive) {
$tpl_news->assign_vars(array('C_NEWS_BLOCK' => true));
$column = $CONFIG_NEWS['nbr_column'] > 1 ? true : false;
if ($column) {
$i = 0;
$CONFIG_NEWS['nbr_column'] = !empty($CONFIG_NEWS['nbr_column']) ? $CONFIG_NEWS['nbr_column'] : 1;
$column_width = floor(100 / $CONFIG_NEWS['nbr_column']);
$tpl_news->assign_vars(array('C_NEWS_BLOCK_COLUMN' => true, 'COLUMN_WIDTH' => $column_width));
}
$z = 0;
list($admin, $del) = array('', '');
$result = $Sql->query_while("SELECT n.contents, n.extend_contents, n.title, n.id, n.timestamp, n.user_id, n.img, n.alt, n.nbr_com, nc.id AS idcat, nc.icon, m.login\n\t\t\tFROM " . PREFIX . "news n\n\t\t\tLEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat\n\t\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = n.user_id\n\t\t\tWHERE '" . time() . "' >= n.start AND ('" . time() . "' <= n.end OR n.end = 0) AND n.visible = 1\n\t\t\tORDER BY n.timestamp DESC\n\t\t\t" . $Sql->limit($first_msg, $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$new_row = false;
if ($column) {
$new_row = $i % $CONFIG_NEWS['nbr_column'] == 0 && $i > 0;
$i++;
}
$tpl_news->assign_block_vars('news', array('C_IMG' => !empty($row['img']), 'C_ICON' => !empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1, 'C_NEWS_ROW' => $new_row, 'ID' => $row['id'], 'IDCAT' => $row['idcat'], 'ICON' => second_parse_url($row['icon']), 'TITLE' => $row['title'], 'CONTENTS' => second_parse($row['contents']), 'EXTEND_CONTENTS' => !empty($row['extend_contents']) ? '<a style="font-size:10px" href="' . PATH_TO_ROOT . '/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '.php') . '">[' . $LANG['extend_contents'] . ']</a><br /><br />' : '', 'IMG' => second_parse_url($row['img']), 'IMG_DESC' => $row['alt'], 'PSEUDO' => $CONFIG_NEWS['display_author'] ? $row['login'] : '', 'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' . gmdate_format('date_format_short', $row['timestamp']) : '', 'TOKEN' => $Session->get_token(), 'U_COM' => $CONFIG_NEWS['activ_com'] == 1 ? Comments::com_display_link($row['nbr_com'], PATH_TO_ROOT . '/news/news' . url('.php?cat=0&id=' . $row['id'] . '&com=0', '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php?com=0'), $row['id'], 'news') : '', 'NEW_ROW' => $new_row, 'U_USER_ID' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_NEWS_LINK' => url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL)));
$z++;
}
$Sql->query_close($result);
if ($z == 0) {
$tpl_news->assign_vars(array('C_NEWS_NO_AVAILABLE' => true, 'L_NO_NEWS_AVAILABLE' => $LANG['no_news_available']));
}
} else {
$tpl_news->assign_vars(array('C_NEWS_LINK' => true));
$column = $CONFIG_NEWS['nbr_column'] > 1 ? true : false;
if ($column) {
$i = 0;
$CONFIG_NEWS['nbr_column'] = !empty($CONFIG_NEWS['nbr_column']) ? $CONFIG_NEWS['nbr_column'] : 1;
$column_width = floor(100 / $CONFIG_NEWS['nbr_column']);
$tpl_news->assign_vars(array('C_NEWS_LINK_COLUMN' => true, 'COLUMN_WIDTH' => $column_width));
}
$result = $Sql->query_while("SELECT n.id, n.title, n.timestamp, nc.id AS idcat, nc.icon\n\t\t\tFROM " . PREFIX . "news n\n\t\t\tLEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat\n\t\t\tWHERE n.visible = 1\n\t\t\tORDER BY n.timestamp DESC\n\t\t\t" . $Sql->limit($first_msg, $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$new_row = false;
if ($column) {
$new_row = $i % $CONFIG_NEWS['nbr_column'] == 0 && $i > 0;
$i++;
}
$tpl_news->assign_block_vars('list', array('C_NEWS_ROW' => $new_row, 'ICON' => !empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1 ? '<a href="' . PATH_TO_ROOT . '/news/news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . '"><img class="valign_middle" src="' . $row['icon'] . '" alt="" /></a>' : '', 'DATE' => gmdate_format('date_format_tiny', $row['timestamp']), 'TITLE' => $row['title'], 'NEW_ROW' => $new_row, 'U_NEWS' => PATH_TO_ROOT . '/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php')));
}
$Sql->query_close($result);
}
return $tpl_news->parse(TRUE);
}
示例10: COUNT
<?php
require_once '../kernel/begin.php';
require_once '../online/online_begin.php';
require_once '../kernel/header.php';
$Template->set_filenames(array('online' => 'online/online.tpl'));
$nbr_member = $Sql->query("SELECT COUNT(*) FROM " . DB_TABLE_SESSIONS . " WHERE level <> -1 AND session_time > '" . (time() - $CONFIG['site_session_invit']) . "'", __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('PAGINATION' => $Pagination->display('online' . url('.php?p=%d'), $nbr_member, 'p', 25, 3), 'L_LOGIN' => $LANG['pseudo'], 'L_LOCATION' => $LANG['location'], 'L_LAST_UPDATE' => $LANG['last_update'], 'L_ONLINE' => $LANG['online']));
$result = $Sql->query_while("SELECT s.user_id, s.level, s.session_time, s.session_script, s.session_script_get, \ns.session_script_title, m.login\nFROM " . DB_TABLE_SESSIONS . " s\nJOIN " . DB_TABLE_MEMBER . " m ON (m.user_id = s.user_id)\nWHERE s.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\nORDER BY " . $CONFIG_ONLINE['display_order_online'] . "\n" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
switch ($row['level']) {
case 0:
$status = 'member';
break;
case 1:
$status = 'modo';
break;
case 2:
$status = 'admin';
break;
default:
$status = 'member';
}
$row['session_script_get'] = !empty($row['session_script_get']) ? '?' . $row['session_script_get'] : '';
$Template->assign_block_vars('users', array('USER' => !empty($row['login']) ? '<a href="' . HOST . '/member/member.php?id=' . $row['user_id'] . '" class="' . $status . '">' . $row['login'] . '</a>' : $LANG['guest'], 'LOCATION' => '<a href="' . HOST . DIR . $row['session_script'] . $row['session_script_get'] . '">' . stripslashes($row['session_script_title']) . '</a>', 'LAST_UPDATE' => gmdate_format('date_format_long', $row['session_time'])));
}
$Sql->query_close($result);
$Template->pparse('online');
require_once '../kernel/footer.php';
示例11: array
$Template->assign_block_vars('article', array('L_TITLE' => $LANG['wiki_history'] . ': <a href="' . $article_infos['encoded_title'] . '">' . $article_infos['title'] . '</a>'));
$general_auth = empty($article_infos['auth']) ? true : false;
$article_auth = !empty($article_infos['auth']) ? unserialize($article_infos['auth']) : array();
$restore_auth = (!$general_auth || $User->check_auth($_WIKI_CONFIG['auth'], WIKI_RESTORE_ARCHIVE)) && ($general_auth || $User->check_auth($article_auth, WIKI_RESTORE_ARCHIVE)) ? true : false;
$delete_auth = (!$general_auth || $User->check_auth($_WIKI_CONFIG['auth'], WIKI_DELETE_ARCHIVE)) && ($general_auth || $User->check_auth($article_auth, WIKI_DELETE_ARCHIVE)) ? true : false;
$result = $Sql->query_while("SELECT a.title, a.encoded_title, c.timestamp, c.id_contents, c.user_id, c.user_ip, m.login, c.id_article, c.activ\n\t\tFROM " . PREFIX . "wiki_contents c\n\t\tLEFT JOIN " . PREFIX . "wiki_articles a ON a.id = c.id_article\n\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = c.user_id\n\t\tWHERE c.id_article = '" . $id_article . "'\n\t\tORDER BY c.timestamp DESC", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$actions = $row['activ'] != 1 && $restore_auth ? '<a href="' . url('action.php?restore=' . $row['id_contents'] . '&token=' . $Session->get_token()) . '" title="' . $LANG['wiki_restore_version'] . '"><img src="templates/images/restore.png" alt="' . $LANG['wiki_restore_version'] . '" /></a> ' : '';
$actions .= $row['activ'] != 1 && $delete_auth ? '<a href="' . url('action.php?del_contents=' . $row['id_contents'] . '&token=' . $Session->get_token()) . '" title="' . $LANG['delete'] . '" onclick="javascript: return confirm(\'' . str_replace('\'', '\\\'', $LANG['wiki_confirm_delete_archive']) . '\');"><img src="' . $Template->get_module_data_path('wiki') . '/images/delete.png" alt="' . $LANG['delete'] . '" /></a>' : '';
$Template->assign_block_vars('article.list', array('TITLE' => $LANG['wiki_consult_article'], 'AUTHOR' => !empty($row['login']) ? '<a href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . $row['login'] . '</a>' : $row['user_ip'], 'DATE' => gmdate_format('date_format', $row['timestamp']), 'U_ARTICLE' => $row['activ'] == 1 ? url('wiki.php?title=' . $row['encoded_title'], $row['encoded_title']) : url('wiki.php?id_contents=' . $row['id_contents']), 'CURRENT_RELEASE' => $row['activ'] == 1 ? '(' . $LANG['wiki_current_version'] . ')' : '', 'ACTIONS' => !empty($actions) ? $actions : $LANG['wiki_no_possible_action']));
}
$Sql->query_close($result);
$Template->assign_vars(array('L_VERSIONS' => $LANG['wiki_version_list'], 'L_DATE' => $LANG['date'], 'L_AUTHOR' => $LANG['wiki_author'], 'L_ACTIONS' => $LANG['wiki_possible_actions']));
$Template->pparse('wiki_history');
} else {
$_WIKI_NBR_ARTICLES_A_PAGE_IN_HISTORY = 25;
$field = $field == 'title' ? 'title' : 'timestamp';
$order = $order == 'asc' ? 'asc' : 'desc';
$nbr_articles = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "wiki_articles WHERE redirect = '0'", __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$show_pagin = $Pagination->display(url('history.php?field=' . $field . '&order=' . $order . '&p=%d'), $nbr_articles, 'p', $_WIKI_NBR_ARTICLES_A_PAGE_IN_HISTORY, 3);
$Template->set_filenames(array('wiki_history' => 'wiki/history.tpl'));
$Template->assign_block_vars('index', array('L_HISTORY' => $LANG['wiki_history'], 'L_TITLE' => $LANG['wiki_article_title'], 'L_AUTHOR' => $LANG['wiki_author'], 'L_DATE' => $LANG['date'], 'ARROW_TOP_TITLE' => $field == 'title' && $order == 'asc' ? '' : '<a href="' . url('history.php?p=' . $Pagination->page . '&field=title&order=asc') . '"><img src="../templates/' . get_utheme() . '/images/top.png" alt="asc" /></a>', 'ARROW_BOTTOM_TITLE' => $field == 'title' && $order == 'desc' ? '' : '<a href="' . url('history.php?p=' . $Pagination->page . '&field=title&order=desc') . '"><img src="../templates/' . get_utheme() . '/images/bottom.png" alt="desc" /></a>', 'ARROW_TOP_DATE' => $field == 'timestamp' && $order == 'asc' ? '' : '<a href="' . url('history.php?p=' . $Pagination->page . '&field=timestamp&order=asc') . '"><img src="../templates/' . get_utheme() . '/images/top.png" alt="asc" /></a>', 'ARROW_BOTTOM_DATE' => $field == 'timestamp' && $order == 'desc' ? '' : '<a href="' . url('history.php?p=' . $Pagination->page . '&field=timestamp&order=desc') . '"><img src="../templates/' . get_utheme() . '/images/bottom.png" alt="desc" /></a>', 'PAGINATION' => $nbr_articles > $_WIKI_NBR_ARTICLES_A_PAGE_IN_HISTORY ? $show_pagin : ''));
$result = $Sql->query_while("SELECT a.title, a.encoded_title, c.timestamp, c.id_contents AS id, c.user_id, c.user_ip, m.login, c.id_article, c.activ, a.id_contents\n\t\tFROM " . PREFIX . "wiki_articles a\n\t\tLEFT JOIN " . PREFIX . "wiki_contents c ON c.id_contents = a.id_contents\n\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = c.user_id\n\t\tWHERE a.redirect = 0\n\t\tORDER BY " . ($field == 'title' ? 'a' : 'c') . "." . $field . " " . $order . "\n\t\t" . $Sql->limit($Pagination->get_first_msg($_WIKI_NBR_ARTICLES_A_PAGE_IN_HISTORY, 'p'), $_WIKI_NBR_ARTICLES_A_PAGE_IN_HISTORY), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('index.list', array('TITLE' => $row['title'], 'AUTHOR' => !empty($row['login']) ? '<a href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . $row['login'] . '</a>' : $row['user_ip'], 'DATE' => gmdate_format('date_format', $row['timestamp']), 'U_ARTICLE' => url('wiki.php?title=' . $row['encoded_title'], $row['encoded_title'])));
}
$Template->pparse('wiki_history');
}
require_once '../kernel/footer.php';
示例12: retrieve
$page = retrieve(GET, 'p', 0);
if (retrieve(POST, 'submit', false)) {
$FAQ_CONFIG['faq_name'] = stripslashes(retrieve(POST, 'faq_name', $FAQ_LANG['faq']));
$FAQ_CONFIG['num_cols'] = retrieve(POST, 'num_cols', 3);
$FAQ_CONFIG['display_block'] = !empty($_POST['display_mode']) && $_POST['display_mode'] == 'inline' ? false : true;
$FAQ_CONFIG['global_auth'] = Authorizations::build_auth_array_from_form(AUTH_READ, AUTH_WRITE);
$FAQ_CONFIG['root'] = $FAQ_CATS[0];
$Sql->query_inject("UPDATE " . DB_TABLE_CONFIGS . " SET value = '" . addslashes(serialize($FAQ_CONFIG)) . "' WHERE name = 'faq'", __LINE__, __FILE__);
$Cache->Generate_module_file('faq');
redirect(url('admin_faq.php', '', '&'));
}
if ($page > 0) {
$Template->set_filenames(array('admin_faq_questions' => 'faq/admin_faq_questions.tpl'));
import('util/pagination');
$Pagination = new Pagination();
$result = $Sql->query_while("SELECT q.id, q.question, q.timestamp, q.idcat, c.name\n\tFROM " . PREFIX . "faq q\n\tLEFT JOIN " . PREFIX . "faq_cats c ON c.id = q.idcat\n\tORDER BY q.timestamp DESC\n\t" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
$nbr_questions = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "faq", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('question', array('QUESTION' => $row['question'], 'CATEGORY' => !empty($row['idcat']) ? $row['name'] : $LANG['root'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'U_QUESTION' => url('faq.php?id=' . $row['idcat'] . '&question=' . $row['id'], 'faq-' . $row['idcat'] . '+' . url_encode_rewrite($row['name']) . '.php?question=' . $row['id']) . '#q' . $row['id'], 'U_CATEGORY' => !empty($row['idcat']) ? url('faq.php?id=' . $row['idcat'], 'faq-' . $row['idcat'] . '+' . url_encode_rewrite($row['name']) . '.php') : url('faq.php')));
}
$Template->assign_vars(array('PAGINATION' => $Pagination->display('admin_faq.php?p=%d', $nbr_questions, 'p', 25, 3), 'L_QUESTION' => $FAQ_LANG['question'], 'L_CATEGORY' => $FAQ_LANG['category'], 'L_DATE' => $LANG['date'], 'L_FAQ_MANAGEMENT' => $FAQ_LANG['faq_management'], 'L_CATS_MANAGEMENT' => $FAQ_LANG['cats_management'], 'L_CONFIG_MANAGEMENT' => $FAQ_LANG['faq_configuration'], 'L_QUESTIONS_LIST' => $FAQ_LANG['faq_questions_list'], 'L_ADD_QUESTION' => $FAQ_LANG['add_question'], 'L_ADD_CAT' => $FAQ_LANG['add_cat']));
$Template->pparse('admin_faq_questions');
} else {
$Template->set_filenames(array('admin_faq' => 'faq/admin_faq.tpl'));
$FAQ_CONFIG['global_auth'] = isset($FAQ_CONFIG['global_auth']) && is_array($FAQ_CONFIG['global_auth']) ? $FAQ_CONFIG['global_auth'] : array();
$FAQ_CONFIG['faq_name'] = !empty($FAQ_CONFIG['faq_name']) ? $FAQ_CONFIG['faq_name'] : '';
$FAQ_CONFIG['num_cols'] = isset($FAQ_CONFIG['num_cols']) ? $FAQ_CONFIG['num_cols'] : 4;
$FAQ_CONFIG['display_block'] = isset($FAQ_CONFIG['display_block']) ? $FAQ_CONFIG['display_block'] : true;
$Template->assign_vars(array('L_FAQ_MANAGEMENT' => $FAQ_LANG['faq_management'], 'L_CATS_MANAGEMENT' => $FAQ_LANG['cats_management'], 'L_CONFIG_MANAGEMENT' => $FAQ_LANG['faq_configuration'], 'L_QUESTIONS_LIST' => $FAQ_LANG['faq_questions_list'], 'L_ADD_QUESTION' => $FAQ_LANG['add_question'], 'L_ADD_CAT' => $FAQ_LANG['add_cat'], 'L_FAQ_NAME' => $FAQ_LANG['faq_name'], 'L_FAQ_NAME_EXPLAIN' => $FAQ_LANG['faq_name_explain'], 'L_NBR_COLS' => $FAQ_LANG['nbr_cols'], 'L_NBR_COLS_EXPLAIN' => $FAQ_LANG['nbr_cols_explain'], 'L_DISPLAY_MODE' => $FAQ_LANG['display_mode'], 'L_DISPLAY_MODE_EXPLAIN' => $FAQ_LANG['display_mode_admin_explain'], 'L_BLOCKS' => $FAQ_LANG['display_block'], 'L_INLINE' => $FAQ_LANG['display_inline'], 'L_AUTH' => $FAQ_LANG['general_auth'], 'L_AUTH_EXPLAIN' => $FAQ_LANG['general_auth_explain'], 'L_AUTH_READ' => $FAQ_LANG['read_auth'], 'L_AUTH_WRITE' => $FAQ_LANG['write_auth'], 'L_SUBMIT' => $LANG['submit'], 'AUTH_READ' => Authorizations::generate_select(AUTH_READ, $FAQ_CONFIG['global_auth']), 'AUTH_WRITE' => Authorizations::generate_select(AUTH_WRITE, $FAQ_CONFIG['global_auth']), 'FAQ_NAME' => $FAQ_CONFIG['faq_name'], 'NUM_COLS' => $FAQ_CONFIG['num_cols'], 'SELECTED_BLOCK' => $FAQ_CONFIG['display_block'] ? ' selected="selected"' : '', 'SELECTED_INLINE' => !$FAQ_CONFIG['display_block'] ? ' selected="selected"' : ''));
$Template->pparse('admin_faq');
}
示例13: array
$pm_max = $unlimited_pm ? $LANG['illimited'] : $limit_group;
$Template->assign_block_vars('convers', array('NBR_PM' => $pagination_pm, 'PM_POURCENT' => '<strong>' . $nbr_pm . '</strong> / <strong>' . $pm_max . '</strong>', 'PAGINATION' => $Pagination->display('pm' . url('.php?p=%d', '-0-0-%d.php'), $nbr_pm, 'p', $pagination_pm, 3), 'U_MARK_AS_READ' => '<a href="pm.php?read=1" class="small_link">' . $LANG['mark_pm_as_read'] . '</a>', 'U_USER_ACTION_PM' => url('.php?del_convers=1&p=' . $page . '&token=' . $Session->get_token()), 'U_USER_VIEW' => '<a href="' . url('member.php?id=' . $User->get_attribute('user_id') . '&view=1', 'member-' . $User->get_attribute('user_id') . '.php?view=1') . '">' . $LANG['member_area'] . '</a>', 'U_PM_BOX' => '<a href="pm.php' . SID . '">' . $LANG['pm_box'] . '</a>', 'U_POST_NEW_CONVERS' => '<a href="pm' . url('.php?post=1', '') . '" title="' . $LANG['post_new_convers'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/post.png" alt="' . $LANG['post_new_convers'] . '" title="' . $LANG['post_new_convers'] . '" class="valign_middle" /></a>'));
if ($nbr_pm == 0) {
$Template->assign_block_vars('convers.no_pm', array('L_NO_PM' => $LANG['no_pm']));
}
$nbr_waiting_pm = 0;
if (!$unlimited_pm && $nbr_pm > $limit_group) {
$nbr_waiting_pm = $nbr_pm - $limit_group;
if ($nbr_waiting_pm > 0) {
$Errorh->handler(sprintf($LANG['e_pm_full'], $nbr_waiting_pm), E_USER_WARNING);
}
}
$Template->assign_vars(array('THEME' => get_utheme(), 'L_REQUIRE_MESSAGE' => $LANG['require_text'], 'L_REQUIRE_TITLE' => $LANG['require_title'], 'L_DELETE_MESSAGE' => $LANG['alert_delete_msg'], 'L_PRIVATE_MSG' => $LANG['private_message'], 'L_PM_BOX' => $LANG['pm_box'], 'L_TITLE' => $LANG['title'], 'L_PARTICIPANTS' => $LANG['participants'], 'L_MESSAGE' => $LANG['replies'], 'L_LAST_MESSAGE' => $LANG['last_message'], 'L_STATUS' => $LANG['status'], 'L_DELETE' => $LANG['delete'], 'L_READ' => $LANG['read'], 'L_TRACK' => $LANG['pm_track'], 'L_NOT_READ' => $LANG['not_read']));
$i = 0;
$j = 0;
$result = $Sql->query_while("SELECT pm.id, pm.title, pm.user_id, pm.user_id_dest, pm.user_convers_status, pm.nbr_msg, pm.last_user_id, pm.last_msg_id, pm.last_timestamp, msg.view_status, m.login AS login, m1.login AS login_dest, m2.login AS last_login\n\tFROM " . DB_TABLE_PM_TOPIC . " pm\n\tLEFT JOIN " . DB_TABLE_PM_MSG . " msg ON msg.id = pm.last_msg_id\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = pm.user_id\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m1 ON m1.user_id = pm.user_id_dest\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m2 ON m2.user_id = pm.last_user_id\n\tWHERE\n\t(\n\t\t" . $User->get_attribute('user_id') . " IN (pm.user_id, pm.user_id_dest)\n\t)\n\tAND\n\t(\n\t\tpm.user_convers_status = 0\n\t\tOR\n\t\t(\n\t\t\t(pm.user_id_dest = '" . $User->get_attribute('user_id') . "' AND pm.user_convers_status = 1)\n\t\t\tOR\n\t\t\t(pm.user_id = '" . $User->get_attribute('user_id') . "' AND pm.user_convers_status = 2)\n\t\t)\n\t)\n\tORDER BY pm.last_timestamp DESC\n\t" . $Sql->limit($Pagination->get_first_msg($pagination_pm, 'p'), $pagination_pm), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
if ($row['user_id'] != -1) {
$j++;
if (!$unlimited_pm && $nbr_waiting_pm - $j >= 0) {
continue;
}
}
$view = false;
$track = false;
if ($row['last_user_id'] == $User->get_attribute('user_id')) {
$view = true;
if ($row['view_status'] === '0') {
$track = true;
}
} else {
示例14: import
}
$Sql->query_inject("UPDATE " . PREFIX . "articles SET" . $cat_clause . "title = '" . $title . "', contents = '" . str_replace('[page][/page]', '', $contents) . "', icon = '" . $icon . "', visible = '" . $visible . "', start = '" . $start_timestamp . "', end = '" . $end_timestamp . "', timestamp = '" . $timestamp . "' WHERE id = '" . $id_post . "'", __LINE__, __FILE__);
import('content/syndication/feed');
Feed::clear_cache('articles');
redirect(HOST . SCRIPT);
} else {
redirect(HOST . DIR . '/articles/admin_articles.php?id= ' . $id_post . '&error=incomplete#errorh');
}
} else {
$Template->set_filenames(array('admin_articles_management' => 'articles/admin_articles_management.tpl'));
$nbr_articles = $Sql->count_table('articles', __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('THEME' => get_utheme(), 'LANG' => get_ulang(), 'PAGINATION' => $Pagination->display('admin_articles.php?p=%d', $nbr_articles, 'p', 25, 3), 'CHEMIN' => SCRIPT, 'L_CONFIRM_DEL_ARTICLE' => $LANG['confirm_del_article'], '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_NAME' => $LANG['name'], 'L_TITLE' => $LANG['title'], 'L_CATEGORY' => $LANG['category'], 'L_PSEUDO' => $LANG['pseudo'], 'L_DATE' => $LANG['date'], 'L_APROB' => $LANG['aprob'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete'], 'L_SHOW' => $LANG['show']));
$Template->assign_block_vars('list', array());
$result = $Sql->query_while("SELECT a.id, a.idcat, a.title, a.timestamp, a.visible, a.start, a.end, ac.name, m.login \n\tFROM " . PREFIX . "articles a\n\tLEFT JOIN " . PREFIX . "articles_cats ac ON ac.id = a.idcat\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON a.user_id = m.user_id\n\tORDER BY a.timestamp DESC " . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __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'];
}
$title = strlen($row['title']) > 45 ? substr_html($row['title'], 0, 45) . '...' : $row['title'];
$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']);
示例15: redirect
}
} else {
redirect(HOST . SCRIPT);
}
$Template->pparse('admin_groups_management2');
} elseif ($add) {
$Template->set_filenames(array('admin_groups_management2' => 'admin/admin_groups_management2.tpl'));
$img_groups = '<option value="" selected="selected">--</option>';
import('io/filesystem/folder');
$img_groups = '<option value="">--</option>';
$image_folder_path = new Folder(PATH_TO_ROOT . '/images/group');
foreach ($image_folder_path->get_files('`\\.(png|jpg|bmp|gif)$`i') as $image) {
$file = $image->get_name();
$img_groups .= '<option value="' . $file . '">' . $file . '</option>';
}
$Template->assign_vars(array('THEME' => get_utheme(), 'LANG' => get_ulang(), 'IMG_GROUPS' => $img_groups, 'C_ADD_GROUP' => true, 'L_REQUIRE_PSEUDO' => $LANG['require_pseudo'], 'L_REQUIRE_NAME' => $LANG['require_name'], 'L_CONFIRM_DEL_USER_GROUP' => $LANG['confirm_del_member_group'], 'L_GROUPS_MANAGEMENT' => $LANG['groups_management'], 'L_ADD_GROUPS' => $LANG['groups_add'], 'L_REQUIRE' => $LANG['require'], 'L_UPLOAD_GROUPS' => $LANG['upload_group'], 'L_UPLOAD_FORMAT' => $LANG['upload_rank_format'], 'L_UPLOAD' => $LANG['upload'], 'L_NAME' => $LANG['name'], 'L_IMG_ASSOC_GROUP' => $LANG['img_assoc_group'], 'L_IMG_ASSOC_GROUP_EXPLAIN' => $LANG['img_assoc_group_explain'], 'L_AUTH_FLOOD' => $LANG['auth_flood'], 'L_PM_GROUP_LIMIT' => $LANG['pm_group_limit'], 'L_PM_GROUP_LIMIT_EXPLAIN' => $LANG['pm_group_limit_explain'], 'L_DATA_GROUP_LIMIT' => $LANG['data_group_limit'], 'L_DATA_GROUP_LIMIT_EXPLAIN' => $LANG['data_group_limit_explain'], 'L_COLOR_GROUP' => $LANG['color_group'], 'L_COLOR_GROUP_EXPLAIN' => $LANG['color_group_explain'], 'L_MB' => $LANG['unit_megabytes'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_ADD' => $LANG['add']));
$Template->pparse('admin_groups_management2');
} else {
$Template->set_filenames(array('admin_groups_management' => 'admin/admin_groups_management.tpl'));
$nbr_group = $Sql->count_table("group", __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('PAGINATION' => $Pagination->display('admin_groups.php?p=%d', $nbr_group, 'p', 25, 3), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'KERNEL_EDITOR' => display_editor(), 'L_CONFIRM_DEL_GROUP' => $LANG['confirm_del_group'], 'L_GROUPS_MANAGEMENT' => $LANG['groups_management'], 'L_ADD_GROUPS' => $LANG['groups_add'], 'L_NAME' => $LANG['name'], 'L_IMAGE' => $LANG['image'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete']));
$result = $Sql->query_while("SELECT id, name, img\n\tFROM " . DB_TABLE_GROUP . "\n\tORDER BY name\n\t" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('group', array('LINK' => url('.php?g=' . $row['id'], '-0.php?g=' . $row['id']), 'ID' => $row['id'], 'NAME' => $row['name'], 'IMAGE' => !empty($row['img']) ? '<img src="../images/group/' . $row['img'] . '" alt="" />' : ''));
}
$Sql->query_close($result);
$Template->pparse('admin_groups_management');
}
require_once '../admin/admin_footer.php';