本文整理汇总了PHP中Comments::com_display_link方法的典型用法代码示例。如果您正苦于以下问题:PHP Comments::com_display_link方法的具体用法?PHP Comments::com_display_link怎么用?PHP Comments::com_display_link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Comments
的用法示例。
在下文中一共展示了Comments::com_display_link方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: url
$edit = ' <a href="calendar' . url('.php?edit=1&id=' . $row['id']) . '" title="' . $LANG['edit'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" class="valign_middle" /></a>';
$del = ' <a href="calendar' . url('.php?delete=1&id=' . $row['id'] . '&token=' . $Session->get_token()) . '" title="' . $LANG['delete'] . '" onclick="javascript:return Confirm_del();"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/delete.png" class="valign_middle" alt="" /></a>';
$java = '<script type="text/javascript">
<!--
function Confirm_del() {
return confirm("' . $LANG['alert_delete_msg'] . '");
}
-->
</script>';
} else {
$edit = '';
$del = '';
$java = '';
}
import('content/comments');
$Template->assign_block_vars('action', array('DATE' => gmdate_format('date_format', $row['timestamp']), 'TITLE' => $row['title'], 'CONTENTS' => second_parse($row['contents']), 'LOGIN' => '<a class="com" href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . $row['login'] . '</a>', 'COM' => Comments::com_display_link($row['nbr_com'], '../calendar/calendar' . url('.php?d=' . $day . '&m=' . $month . '&y=' . $year . '&e=' . $row['id'] . '&com=0', '-' . $day . '-' . $month . '-' . $year . '-' . $row['id'] . '.php?com=0'), $row['id'], 'calendar'), 'EDIT' => $edit, 'DEL' => $del, 'L_ON' => $LANG['on']));
$check_action = true;
}
$Sql->query_close($result);
if (!isset($check_action)) {
$Template->assign_block_vars('action', array('TITLE' => ' ', 'LOGIN' => '', 'DATE' => gmdate_format('date_format_short', mktime(0, 0, 0, $month, $day, $year)), 'CONTENTS' => '<p style="text-align:center;">' . $LANG['no_current_action'] . '</p>'));
}
$Template->assign_vars(array('JAVA' => $java, 'L_ON' => $LANG['on']));
}
if (isset($_GET['com'])) {
$Template->assign_vars(array('COMMENTS' => display_comments('calendar', $get_event, url('calendar.php?d=' . $day . '&m=' . $month . '&y=' . $year . '&e=' . $get_event . '&com=%s', 'calendar-' . $day . '-' . $month . '-' . $year . '-' . $get_event . '.php?com=%s'))));
}
$Template->pparse('calendar');
} elseif (!empty($id)) {
if (!$User->check_level(ADMIN_LEVEL)) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
示例2: Confirm
$Errorh->handler('e_unexist_link_web', E_USER_REDIRECT);
}
if ($User->check_level(ADMIN_LEVEL)) {
$java = "<script language='JavaScript' type='text/javascript'>\n\t\t<!--\n\t\tfunction Confirm() {\n\t\treturn confirm('" . $LANG['delete_link'] . "');\n\t\t}\n\t\t-->\n\t\t</script>";
$edit = ' <a href="../web/admin_web' . url('.php?id=' . $web['id']) . '" title="' . $LANG['edit'] . '"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/edit.png" class="valign_middle" /></a>';
$del = ' <a href="../web/admin_web.php?delete=1&id=' . $web['id'] . '&token=' . $Session->get_token() . '" title="' . $LANG['delete'] . '" onclick="javascript:return Confirm();"><img src="../templates/' . get_utheme() . '/images/' . get_ulang() . '/delete.png" class="valign_middle" /></a>';
} else {
$edit = '';
$del = '';
$java = '';
}
$Template->assign_vars(array('JAVA' => $java, 'EDIT' => $edit, 'DEL' => $del));
import('content/note');
$Note = new Note('web', $idweb, url('web.php?cat=' . $idcat . '&id=' . $idweb, 'web-' . $idcat . '-' . $idweb . '.php'), $CONFIG_WEB['note_max'], '', NOTE_DISPLAY_NOTE);
import('content/comments');
$Template->assign_vars(array('C_DISPLAY_WEB' => true, 'MODULE_DATA_PATH' => $Template->get_module_data_path('web'), 'IDWEB' => $web['id'], 'NAME' => $web['title'], 'CONTENTS' => second_parse($web['contents']), 'URL' => $web['url'], 'CAT' => $CAT_WEB[$idcat]['name'], 'DATE' => gmdate_format('date_format_short', $web['timestamp']), 'COMPT' => $web['compt'], 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'COM' => Comments::com_display_link($web['nbr_com'], '../web/web' . url('.php?cat=' . $idcat . '&id=' . $idweb . '&com=0', '-' . $idcat . '-' . $idweb . '.php?com=0'), $idweb, 'web'), 'KERNEL_NOTATION' => $Note->display_form(), 'U_WEB_CAT' => url('.php?cat=' . $idcat, '-' . $idcat . '.php'), 'L_DESC' => $LANG['description'], 'L_CAT' => $LANG['category'], 'L_DATE' => $LANG['date'], 'L_TIMES' => $LANG['n_time'], 'L_VIEWS' => $LANG['views']));
if (isset($_GET['com'])) {
$Template->assign_vars(array('COMMENTS' => display_comments('web', $idweb, url('web.php?cat=' . $idcat . '&id=' . $idweb . '&com=%s', 'web-' . $idcat . '-' . $idweb . '.php?com=%s'))));
}
$Template->pparse('web');
} elseif (!empty($idcat) && empty($idweb)) {
$Template->set_filenames(array('web' => 'web/web.tpl'));
if (!$User->check_level($CAT_WEB[$idcat]['secure'])) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
}
$nbr_web = $Sql->query("SELECT COUNT(*) as compt \n\tFROM " . PREFIX . "web \n\tWHERE aprob = 1 AND idcat = '" . $idcat . "'", __LINE__, __FILE__);
$Template->assign_vars(array('C_WEB_LINK' => true, 'C_IS_ADMIN' => $User->check_level(ADMIN_LEVEL), 'CAT_NAME' => $CAT_WEB[$idcat]['name'], 'NO_CAT' => $nbr_web == 0 ? $LANG['none_link'] : '', 'MAX_NOTE' => $CONFIG_WEB['note_max'], 'L_LINK' => $LANG['link'], 'L_DATE' => $LANG['date'], 'L_VIEW' => $LANG['views'], 'L_NOTE' => $LANG['note'], 'L_COM' => $LANG['com'], 'U_WEB_ALPHA_TOP' => url('.php?sort=alpha&mode=desc&cat=' . $idcat, '-' . $idcat . '.php?sort=alpha&mode=desc'), 'U_WEB_ALPHA_BOTTOM' => url('.php?sort=alpha&mode=asc&cat=' . $idcat, '-' . $idcat . '.php?sort=alpha&mode=asc'), 'U_WEB_DATE_TOP' => url('.php?sort=date&mode=desc&cat=' . $idcat, '-' . $idcat . '.php?sort=date&mode=desc'), 'U_WEB_DATE_BOTTOM' => url('.php?sort=date&mode=asc&cat=' . $idcat, '-' . $idcat . '.php?sort=date&mode=asc'), 'U_WEB_VIEW_TOP' => url('.php?sort=view&mode=desc&cat=' . $idcat, '-' . $idcat . '.php?sort=view&mode=desc'), 'U_WEB_VIEW_BOTTOM' => url('.php?sort=view&mode=asc&cat=' . $idcat, '-' . $idcat . '.php?sort=view&mode=asc'), 'U_WEB_NOTE_TOP' => url('.php?sort=note&mode=desc&cat=' . $idcat, '-' . $idcat . '.php?sort=note&mode=desc'), 'U_WEB_NOTE_BOTTOM' => url('.php?sort=note&mode=asc&cat=' . $idcat, '-' . $idcat . '.php?sort=note&mode=asc'), 'U_WEB_COM_TOP' => url('.php?sort=com&mode=desc&cat=' . $idcat, '-' . $idcat . '.php?sort=com&mode=desc'), 'U_WEB_COM_BOTTOM' => url('.php?sort=com&mode=asc&cat=' . $idcat, '-' . $idcat . '.php?sort=com&mode=asc')));
$get_sort = retrieve(GET, 'sort', '');
switch ($get_sort) {
case 'alpha':
$sort = 'title';
示例3: elseif
} 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'))));
}
示例4: url
}
if ($CONFIG_GALLERY['display_pics'] == 3) {
$display_link = HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&cat=' . $row['idcat']) . '" rel="lightbox[1]" onmousedown="increment_view(' . $row['id'] . ');" title="' . str_replace('"', '', stripslashes($row['name']));
$display_name = HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&cat=' . $row['idcat']) . '" rel="lightbox[2]" onmousedown="increment_view(' . $row['id'] . ');" title="' . str_replace('"', '', stripslashes($row['name']));
} elseif ($CONFIG_GALLERY['display_pics'] == 2) {
$display_name = $display_link = 'javascript:increment_view(' . $row['id'] . ');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) {
$display_name = $display_link = 'javascript:increment_view(' . $row['id'] . ');display_pics(' . $row['id'] . ', \'' . HOST . DIR . '/gallery/show_pics' . url('.php?id=' . $row['id'] . '&cat=' . $row['idcat']) . '\')';
} else {
$display_name = $display_link = url('gallery.php?cat=' . $row['idcat'] . '&id=' . $row['id'], 'gallery-' . $row['idcat'] . '-' . $row['id'] . '.php') . '#pics_max';
}
$cat_list = '';
foreach ($array_cat_list as $key_cat => $option_value) {
$cat_list .= $key_cat == $row['idcat'] ? sprintf($option_value, 'selected="selected"') : sprintf($option_value, '');
}
$activ_note = $CONFIG_GALLERY['activ_note'] == 1 && $is_connected;
if ($activ_note) {
$Note = new Note('gallery', $row['id'], url('.php?cat=' . $row['idcat'] . '&id=' . $row['id'], '-' . $row['idcat'] . '-' . $row['id'] . '.php'), $CONFIG_GALLERY['note_max'], '', NOTE_NODISPLAY_NBRNOTES | NOTE_DISPLAY_BLOCK);
}
$html_protected_name = strprotect($row['name'], HTML_PROTECT, ADDSLASHES_FORCE);
$Template->assign_block_vars('pics_list', array('ID' => $row['id'], 'APROB' => $row['aprob'], 'IMG' => '<img src="pics/thumbnails/' . $row['path'] . '" alt="' . str_replace('"', '', stripslashes($row['name'])) . '" class="gallery_image" />', 'PATH' => $row['path'], 'NAME' => $CONFIG_GALLERY['activ_title'] == 1 ? '<a class="small_link" href="' . $display_name . '"><span id="fi_' . $row['id'] . '">' . wordwrap_html(stripslashes($row['name']), 22, ' ') . '</span></a> <span id="fi' . $row['id'] . '"></span>' : '<span id="fi_' . $row['id'] . '"></span></a> <span id="fi' . $row['id'] . '"></span>', 'POSTOR' => $CONFIG_GALLERY['activ_user'] == 1 ? '<br />' . $LANG['by'] . (!empty($row['login']) ? ' <a class="small_link" href="../member/member' . url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php') . '">' . $row['login'] . '</a>' : ' ' . $LANG['guest']) : '', 'VIEWS' => $CONFIG_GALLERY['activ_view'] == 1 ? '<br /><span id="gv' . $row['id'] . '">' . $row['views'] . '</span> <span id="gvl' . $row['id'] . '">' . ($row['views'] > 1 ? $LANG['views'] : $LANG['view']) . '</span>' : '', 'COM' => $CONFIG_GALLERY['activ_com'] == 1 ? '<br />' . Comments::com_display_link($row['nbr_com'], '../gallery/gallery' . url('.php?cat=' . $row['idcat'] . '&id=' . $row['id'] . '&com=0', '-' . $row['idcat'] . '-' . $row['id'] . '.php?com=0'), $row['id'], 'gallery') : '', 'KERNEL_NOTATION' => $activ_note ? $Note->display_form() : '', 'CAT' => $cat_list, 'RENAME' => $html_protected_name, 'RENAME_CUT' => $html_protected_name, 'IMG_APROB' => get_ulang() . '/' . ($row['aprob'] == 1 ? 'unvisible.png' : 'visible.png'), 'OPEN_TR' => is_int($j++ / $nbr_column_pics) ? '<tr>' : '', 'CLOSE_TR' => is_int($j / $nbr_column_pics) ? '</tr>' : '', 'L_APROB_IMG' => $row['aprob'] == 1 ? $LANG['unaprob'] : $LANG['aprob'], 'U_DEL' => url('.php?del=' . $row['id'] . '&token=' . $Session->get_token() . '&cat=' . $g_idcat, '-' . $g_idcat . '.php?token=' . $Session->get_token() . '&del=' . $row['id']), 'U_MOVE' => url('.php?id=' . $row['id'] . '&token=' . $Session->get_token() . '&move=\' + this.options[this.selectedIndex].value', '-0-' . $row['id'] . '.php?token=' . $Session->get_token() . '&move=\' + this.options[this.selectedIndex].value'), 'U_DISPLAY' => $display_link));
}
$Sql->query_close($result);
while (!is_int($j / $nbr_column_pics)) {
$Template->assign_block_vars('end_table', array('TD_END' => '<td style="margin:15px 0px;width:' . $column_width_pics . '%"> </td>', 'TR_END' => is_int(++$j / $nbr_column_pics) ? '</tr>' : ''));
}
}
}
$Template->pparse('gallery');
}
require_once '../kernel/footer.php';
示例5: str_replace
$sort = 'note';
$selected_fields['note'] = ' selected="selected"';
break;
default:
$sort = 'timestamp';
$selected_fields['date'] = ' selected="selected"';
}
$mode = $get_mode == 'asc' ? 'ASC' : 'DESC';
if ($mode == 'ASC') {
$selected_fields['asc'] = ' selected="selected"';
} else {
$selected_fields['desc'] = ' selected="selected"';
}
$unget = !empty($get_sort) && !empty($mode) ? '?sort=' . $get_sort . '&mode=' . $get_mode : '';
$Template->assign_vars(array('L_FILE' => $DOWNLOAD_LANG['file'], 'L_ALPHA' => $DOWNLOAD_LANG['sort_alpha'], 'L_SIZE' => $LANG['size'], 'L_DATE' => $LANG['date'], 'L_DOWNLOAD' => $DOWNLOAD_LANG['download'], 'L_POPULARITY' => $DOWNLOAD_LANG['popularity'], 'L_DESC' => $LANG['desc'], 'L_ASC' => $LANG['asc'], 'L_NOTE' => $LANG['note'], 'L_ORDER_BY' => $DOWNLOAD_LANG['order_by'], 'L_CONFIRM_DELETE_FILE' => str_replace('\'', '\\\'', $DOWNLOAD_LANG['confirm_delete_file']), 'SELECTED_ALPHA' => $selected_fields['alpha'], 'SELECTED_SIZE' => $selected_fields['size'], 'SELECTED_DATE' => $selected_fields['date'], 'SELECTED_HITS' => $selected_fields['hits'], 'SELECTED_NOTE' => $selected_fields['note'], 'SELECTED_ASC' => $selected_fields['asc'], 'SELECTED_DESC' => $selected_fields['desc']));
import('util/pagination');
$Pagination = new Pagination();
import('content/note');
import('content/comments');
$Template->assign_vars(array('PAGINATION' => $Pagination->display(url('download.php' . (!empty($unget) ? $unget . '&' : '?') . 'cat=' . $category_id . '&p=%d', 'category-' . $category_id . '-%d.php' . $unget), $nbr_files, 'p', $CONFIG_DOWNLOAD['nbr_file_max'], 3), 'C_FILES' => true, 'TARGET_ON_CHANGE_ORDER' => $CONFIG['rewrite'] ? 'category-' . $category_id . '.php?' : 'download.php?cat=' . $category_id . '&'));
$result = $Sql->query_while("SELECT id, title, timestamp, size, count, note, nbrnote, nbr_com, image, short_contents\n\t\tFROM " . PREFIX . "download\n\t\tWHERE visible = 1 AND approved = 1 AND idcat = '" . $category_id . "'\n\t\tORDER BY " . $sort . " " . $mode . $Sql->limit($Pagination->get_first_msg($CONFIG_DOWNLOAD['nbr_file_max'], 'p'), $CONFIG_DOWNLOAD['nbr_file_max']), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('file', array('NAME' => $row['title'], 'IMG_NAME' => str_replace('"', '\\"', $row['title']), 'C_DESCRIPTION' => !empty($row['short_contents']), 'DESCRIPTION' => second_parse($row['short_contents']), 'DATE' => sprintf($DOWNLOAD_LANG['add_on_date'], gmdate_format('date_format_short', $row['timestamp'])), 'COUNT_DL' => sprintf($DOWNLOAD_LANG['downloaded_n_times'], $row['count']), 'NOTE' => $row['nbrnote'] > 0 ? Note::display_img($row['note'], $CONFIG_DOWNLOAD['note_max'], 5) : '<em>' . $LANG['no_note'] . '</em>', 'SIZE' => $row['size'] >= 1 ? number_round($row['size'], 1) . ' ' . $LANG['unit_megabytes'] : number_round($row['size'], 1) * 1024 . ' ' . $LANG['unit_kilobytes'], 'C_IMG' => !empty($row['image']), 'IMG' => $row['image'], 'U_DOWNLOAD_LINK' => url('download.php?id=' . $row['id'], 'download-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'), 'U_ADMIN_EDIT_FILE' => url('management.php?edit=' . $row['id']), 'U_ADMIN_DELETE_FILE' => url('management.php?del=' . $row['id'] . '&token=' . $Session->get_token()), 'U_COM_LINK' => Comments::com_display_link($row['nbr_com'], '../download/download' . url('.php?id=' . $row['id'] . '&com=0', '-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php?com=0'), $row['id'], 'download')));
}
$Sql->query_close($result);
} else {
$Template->assign_vars(array('L_NO_FILE_THIS_CATEGORY' => $DOWNLOAD_LANG['none_download'], 'C_NO_FILE' => true));
}
$Template->pparse('download');
}
require_once '../kernel/footer.php';
示例6: preg_split
}
$array_contents = preg_split('`\\[page\\].+\\[/page\\](.*)`Us', $articles['contents'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
preg_match_all('`\\[page\\]([^[]+)\\[/page\\]`U', $articles['contents'], $array_page);
$page_list = '<option value="1">' . $LANG['select_page'] . '</option>';
$page_list .= '<option value="1"></option>';
$i = 1;
foreach ($array_page[1] as $page_name) {
$selected = $i == $page ? 'selected="selected"' : '';
$page_list .= '<option value="' . $i++ . '"' . $selected . '>' . $page_name . '</option>';
}
$nbr_page = count($array_page[1]);
$nbr_page = !empty($nbr_page) ? $nbr_page : 1;
import('content/note');
$Note = new Note('articles', $idart, url('articles.php?cat=' . $idartcat . '&id=' . $idart, 'articles-' . $idartcat . '-' . $idart . '.php'), $CONFIG_ARTICLES['note_max'], '', NOTE_DISPLAY_NOTE);
import('content/comments');
$Template->assign_vars(array('C_IS_ADMIN' => $User->check_level(ADMIN_LEVEL), 'C_DISPLAY_ARTICLE' => true, 'IDART' => $articles['id'], 'IDCAT' => $idartcat, 'NAME' => $articles['title'], 'PSEUDO' => $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $articles['user_id'] . "'", __LINE__, __FILE__), 'CONTENTS' => isset($array_contents[$page]) ? second_parse($array_contents[$page]) : '', 'CAT' => $CAT_ARTICLES[$idartcat]['name'], 'DATE' => gmdate_format('date_format_short', $articles['timestamp']), 'PAGES_LIST' => $page_list, 'PAGINATION_ARTICLES' => $Pagination->display('articles' . url('.php?cat=' . $idartcat . '&id=' . $idart . '&p=%d', '-' . $idartcat . '-' . $idart . '-%d+' . url_encode_rewrite($articles['title']) . '.php'), $nbr_page, 'p', 1, 3, 11, NO_PREVIOUS_NEXT_LINKS), 'PAGE_NAME' => isset($array_page[1][$page - 1]) && $array_page[1][$page - 1] != ' ' ? $array_page[1][$page - 1] : '', 'PAGE_PREVIOUS_ARTICLES' => $page > 1 && $page <= $nbr_page && $nbr_page > 1 ? '<a href="' . url('articles.php?cat=' . $idartcat . '&id=' . $idart . '&p=' . ($page - 1), 'articles-' . $idartcat . '-' . $idart . '-' . ($page - 1) . '+' . url_encode_rewrite($articles['title']) . '.php') . '">« ' . $LANG['previous_page'] . '</a><br />' . $array_page[1][$page - 2] : '', 'PAGE_NEXT_ARTICLES' => $page > 0 && $page < $nbr_page && $nbr_page > 1 ? '<a href="' . url('articles.php?cat=' . $idartcat . '&id=' . $idart . '&p=' . ($page + 1), 'articles-' . $idartcat . '-' . $idart . '-' . ($page + 1) . '+' . url_encode_rewrite($articles['title']) . '.php') . '">' . $LANG['next_page'] . ' »</a><br />' . $array_page[1][$page] : '', 'COM' => Comments::com_display_link($articles['nbr_com'], '../articles/articles' . url('.php?cat=' . $idartcat . '&id=' . $idart . '&com=0', '-' . $idartcat . '-' . $idart . '+' . url_encode_rewrite($articles['title']) . '.php?com=0'), $articles['id'], 'articles'), 'KERNEL_NOTATION' => $Note->display_form(), 'U_USER_ID' => url('.php?id=' . $articles['user_id'], '-' . $articles['user_id'] . '.php'), 'U_ONCHANGE_ARTICLE' => "'" . url('articles.php?cat=' . $idartcat . '&id=' . $idart . '&p=\' + this.options[this.selectedIndex].value', 'articles-' . $idartcat . '-' . $idart . '-\'+ this.options[this.selectedIndex].value + \'+' . url_encode_rewrite($articles['title']) . '.php' . "'"), 'U_PRINT_ARTICLE' => url('print.php?id=' . $idart), 'L_ALERT_DELETE_ARTICLE' => $LANG['alert_delete_article'], 'L_SUMMARY' => $LANG['summary'], 'L_DELETE' => $LANG['delete'], 'L_EDIT' => $LANG['edit'], 'L_SUBMIT' => $LANG['submit'], 'L_WRITTEN' => $LANG['written_by'], 'L_ON' => $LANG['on'], 'L_PRINTABLE_VERSION' => $LANG['printable_version']));
if (isset($_GET['com'])) {
$Template->assign_vars(array('COMMENTS' => display_comments('articles', $idart, url('articles.php?cat=' . $idartcat . '&id=' . $idart . '&com=%s', 'articles-' . $idartcat . '-' . $idart . '.php?com=%s'))));
}
$Template->pparse('articles');
} else {
import('modules/modules_discovery_service');
$modulesLoader = new ModulesDiscoveryService();
$module_name = 'articles';
$module = $modulesLoader->get_module($module_name);
if ($module->has_functionality('get_home_page')) {
echo $module->functionality('get_home_page');
} 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;
示例7: get_home_page
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);
}
示例8: elseif
$Sql->query_close($result);
} else {
$Template->assign_vars(array('L_NO_FILE_THIS_CATEGORY' => $MEDIA_LANG['none_media'], 'C_NO_FILE' => true));
}
} elseif ($id_media > 0) {
$result = $Sql->query_while("SELECT v.*, mb.login, mb.level\tFROM " . PREFIX . "media AS v LEFT JOIN " . DB_TABLE_MEMBER . " AS mb ON v.iduser = mb.user_id\tWHERE id = '" . $id_media . "'", __LINE__, __FILE__);
$media = $Sql->fetch_assoc($result);
$Sql->query_close($result);
if (empty($media) || ($media['infos'] & MEDIA_STATUS_UNVISIBLE) !== 0) {
$Errorh->handler('e_unexist_media', E_USER_REDIRECT);
exit;
} elseif (!$User->check_auth($MEDIA_CATS[$media['idcat']]['auth'], MEDIA_AUTH_READ)) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
exit;
}
bread_crumb($media['idcat']);
$Bread_crumb->add($media['name'], url('media.php?id=' . $id_media, 'media-' . $id_media . '-' . $media['idcat'] . '+' . url_encode_rewrite($media['name']) . '.php'));
define('TITLE', $media['name']);
require_once '../kernel/header.php';
$Sql->query_inject("UPDATE " . LOW_PRIORITY . " " . PREFIX . "media SET counter = counter + 1 WHERE id = " . $id_media, __LINE__, __FILE__);
import('content/note');
$Note = new Note('media', $id_media, url('media.php?id=' . $id_media, 'media-' . $id_media . '-' . $media['idcat'] . '+' . url_encode_rewrite($media['name']) . '.php'), $MEDIA_CONFIG['note_max'], '', NOTE_NODISPLAY_NBRNOTES);
import('content/comments');
$Template->assign_vars(array('C_DISPLAY_MEDIA' => true, 'C_MODO' => $User->check_level(MODO_LEVEL), 'MODULE_DATA_PATH' => $Template->get_module_data_path('media'), 'ID_MEDIA' => $id_media, 'NAME' => $media['name'], 'CONTENTS' => second_parse($media['contents']), 'COUNT' => $media['counter'], 'THEME' => $CONFIG['theme'], 'KERNEL_NOTATION' => $Note->display_form(), 'HITS' => (int) $media['counter'] + 1 > 1 ? sprintf($MEDIA_LANG['n_times'], (int) $media['counter'] + 1) : sprintf($MEDIA_LANG['n_time'], (int) $media['counter'] + 1), 'NUM_NOTES' => (int) $media['nbrnote'] > 1 ? sprintf($MEDIA_LANG['num_notes'], (int) $media['nbrnote']) : sprintf($MEDIA_LANG['num_note'], (int) $media['nbrnote']), 'LANG' => $CONFIG['lang'], 'U_COM' => Comments::com_display_link($media['nbr_com'], '../media/media' . url('.php?id=' . $id_media . '&com=0', '-' . $id_media . '-' . $media['idcat'] . '+' . url_encode_rewrite($media['name']) . '.php?com=0'), $id_media, 'media'), 'L_DATE' => $LANG['date'], 'L_SIZE' => $LANG['size'], 'L_MEDIA_INFOS' => $MEDIA_LANG['media_infos'], 'DATE' => gmdate_format('date_format', $media['timestamp']), 'URL' => $media['url'], 'MIME' => $media['mime_type'], 'WIDTH' => $media['width'], 'HEIGHT' => $media['height'], 'HEIGHT_P' => $media['height'] + 50, 'L_VIEWED' => $LANG['view'], 'L_BY' => $LANG['by'], 'BY' => !empty($media['login']) ? sprintf($MEDIA_LANG['media_added'], $media['login'], '../member/member' . url('.php?id=' . $media['iduser'], '-' . $media['iduser'] . '.php'), $level[$media['level']]) : $LANG['guest'], 'L_CONFIRM_DELETE_MEDIA' => str_replace('\'', '\\\'', $MEDIA_LANG['confirm_delete_media']), 'U_UNVISIBLE_MEDIA' => url('media_action.php?unvisible=' . $id_media . '&token=' . $Session->get_token()), 'U_EDIT_MEDIA' => url('media_action.php?edit=' . $id_media), 'U_DELETE_MEDIA' => url('media_action.php?del=' . $id_media . '&token=' . $Session->get_token()), 'U_POPUP_MEDIA' => url('media_popup.php?id=' . $id_media), 'C_DISPLAY' => ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_DATE) !== 0 || ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_USER) !== 0 || ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_COUNT) !== 0 || ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_NOTE) !== 0, 'A_COM' => ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_COM) !== 0, 'A_NOTE' => ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_NOTE) !== 0, 'A_USER' => ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_USER) !== 0, 'A_COUNTER' => ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_COUNT) !== 0, 'A_DATE' => ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_DATE) !== 0, 'A_DESC' => ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_DESC) !== 0, 'L_CONFIRM_DELETE_FILE' => str_replace('\'', '\\\'', $MEDIA_LANG['confirm_delete_media'])));
$Template->set_filenames(array('media_format' => empty($mime_type_tpl[$media['mime_type']]) ? 'media/format/media_other.tpl' : 'media/' . $mime_type_tpl[$media['mime_type']]));
if (isset($_GET['com']) && ($MEDIA_CATS[$media['idcat']]['active'] & MEDIA_DV_COM + MEDIA_DL_COM) !== 0) {
$Template->assign_vars(array('COMMENTS' => display_comments('media', $id_media, url('media.php?id=' . $id_media . '&com=%s', 'media-' . $id_media . '-' . $media['idcat'] . '+' . url_encode_rewrite($media['name']) . '.php?com=%s'))));
}
}
$Template->pparse('media');
require_once '../kernel/footer.php';