function asdf_most_recent() { ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js" type="text/javascript"></script> <script type="text/javascript" src="<?php echo bloginfo('stylesheet_directory'); ?> /asdf_most_recent.js"></script> <div class="widget"> <div class="asdf_most_recent"> <div class="buttons"> <h1 class="articles widget-title">ARTIKEL</h1> <h1 class="widget-title">·</h1> <h1 class="comments widget-title">KOMMENTARE</h1> <h1 class="widget-title">·</h1> <h1 class="tweets widget-title">TWEETS</h1> </div> <div class="content"> <div class="articles"> <?php display_articles(); ?> </div> <div class="comments"> <?php display_comments(); ?> </div> <div class="tweets"> <?php display_tweets(); ?> </div> </div> </div> </div> <?php }
Both comments and pings are currently closed. <?php } edit_post_link('Edit this entry.', '', ''); ?> </small> </p> </div> </div> <?php display_comments(); ?> <?php } } else { ?> <p>Sorry, no attachments matched your criteria.</p> <?php } ?> <?php get_sidebar();
function display_comments($comments, $module, $user, $is_answer = false, $offset) { if (isset($_GET['answer']) && isint($_GET['answer'])) { $answer = $_GET['answer']; } else { $answer = 0; } foreach ($comments as $c) { ?> <div class="comment<?php echo $is_answer ? ' answer' : ''; ?> " id="comment-<?php echo $c->id; ?> "> <?php echo $is_answer ? '<a href="#comment-' . $c->id . '" class="fa fa-caret-right expander"></a>' : ''; ?> <div class="comment-text"> <a href="<?php echo site_url('user/' . $c->creator->id); ?> "><?php echo showname($c->creator); ?> </a> <span class="text"><?php echo htmlentities($c->comment); ?> </span> </div> <div class="comment-actions"> <?php echo dt_tm($c->date); ?> <?php if ($answer != $c->id) { ?> <a href="?answer=<?php echo $c->id; ?> #comment-<?php echo $c->id; ?> " data-comment-answer="<?php echo $c->id; ?> ">Answer</a> <?php } ?> <?php if (!isset($c->answers) && $c->count_answers > 0) { ?> <a href="?answers=<?php echo $c->id; ?> #comment-<?php echo $c->id; ?> " data-comment-answers="true" data-comment-reference="<?php echo $c->id; ?> " data-comment-action="next">Show answers (<?php echo $c->count_answers; ?> )</a> <?php } ?> <?php echo $c->ratings->display_small('comment-' . $c->id); ?> </div> <a class="user-image" href="<?php echo site_url('user/' . $c->creator->id); ?> "><img src="<?php echo avatar_image($c->creator->id); ?> " class="avatar" /></a> <?php echo ''; ?> <?php if (isset($c->answers)) { $is_this_answer_post = isset($_GET['answers']) && $_GET['answers'] == $c->id; if ($is_this_answer_post && $offset > 0) { ?> <a class="show-answers-button" data-comment-reference="<?php echo $c->id; ?> " data-comment-action="previous" href="?answers=<?php echo $c->id; ?> &end=<?php echo $_GET['end'] > 30 ? $_GET['end'] - 30 : 0; ?> ">Show <?php echo $offset > 30 ? 30 : $offset; ?> previous answers.</a> <?php } display_comments($c->answers, $module, $user, true, $offset); $remaining_answers = $c->count_answers - count($c->answers); if ($is_this_answer_post) { $remaining_answers -= $offset; } if ($remaining_answers > 0) { $next_answers = isset($_GET['end']) && $is_this_answer_post && isint($_GET['end']) ? $_GET['end'] + 30 : 30; ?> <a class="show-answers-button" data-comment-reference="<?php echo end($c->answers)->id; ?> " data-comment-action="next" href="?answers=<?php echo $c->id; ?> &end=<?php echo $next_answers; ?> ">Show <?php echo $remaining_answers > 30 ? 30 : $remaining_answers; ?> more answers.</a> <?php } } ?> <?php if ($answer == $c->id) { ?> <?php echo form_open(uri_string() . '?answers=' . $c->id . '#comment-' . $c->id, array('class' => 'create-answer')); ?> <?php echo form_hidden('duplicate-preventer', uniqid()); ?> <?php echo form_hidden('comment-answer-to', $c->id); ?> <div class="comments-wrapper"> <textarea name="comment" placeholder="<?php echo $user ? 'Your comment...' : 'You have to log in or create an account to comment.'; ?> "<?php echo $user ? 'autofocus' : ' disabled="disabled"'; ?> ></textarea> </div> <?php $submit_data = array('type' => 'submit', 'name' => 'comments-submit', 'value' => 'Submit comment'); if (!$user) { $submit_data['disabled'] = 'disabled'; } ?> <?php echo form_input($submit_data); ?> <?php echo form_close(); ?> <?php } ?> </div> <?php } }
/** * News Item Page Template * @param $info */ function render_news_item($info) { global $aidlink; $locale = fusion_get_locale(); $news_settings = get_settings('news'); $data = $info['news_item']; add_to_head("<link rel='stylesheet' href='" . INFUSIONS . "news/templates/css/news.css' type='text/css'>"); add_to_head("<link rel='stylesheet' href='" . INCLUDES . "jquery/colorbox/colorbox.css' type='text/css' media='screen' />"); add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/colorbox/jquery.colorbox.js'></script>"); add_to_footer('<script type="text/javascript"> $(document).ready(function() { $(".news-image-overlay").colorbox({ transition: "elasic", height:"100%", width:"100%", maxWidth:"98%", maxHeight:"98%", scrolling:false, overlayClose:true, close:false, photo:true, onComplete: function(result) { $("#colorbox").live("click", function(){ $(this).unbind("click"); $.fn.colorbox.close(); }); }, onLoad: function () { } }); }); </script>'); opentable($locale['news_0004']); echo render_breadcrumbs(); echo "<!--news_pre_readmore-->"; echo "<article class='news-item' style='display:block; width:100%; overflow:hidden;'>\n"; echo "<h2 class='text-center'>" . $data['news_subject'] . "</h2>\n"; echo "<div class='news_news text-dark m-t-20 m-b-20'>\n"; if ($data['news_image_src']) { echo "<a class='" . $data['news_ialign'] . " news-image-overlay' href='" . $data['news_image_src'] . "'>\n <img class='img-responsive' src='" . $data['news_image_src'] . "' alt='" . $data['news_subject'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; overflow:hidden;' /></a>"; } elseif (!empty($data['news_image']) && !empty($data['news_cat_image_src'])) { echo "<a class='" . $data['news_ialign'] . "' href='" . INFUSIONS . "news/news.php?cat_id=" . $data['news_cat_id'] . "'>\n <img class='img-responsive' src='" . IMAGES_NC . $data['news_cat_image_src'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; alt='" . $data['news_cat_name'] . "' />\n </a>"; } echo $data['news_news']; echo "</div>\n"; echo "<div class='news_extended text-dark m-t-20 m-b-20'>" . $data['news_extended'] . "</div>\n"; echo "<div style='clear:both;'></div>\n"; echo "<div class='well m-t-5 text-center'>\n"; echo "<span class='news-action m-r-10'><i class='fa fa-user'></i>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</span>\n"; echo "<span class='news-action m-r-10'><i class='fa fa-calendar'></i>" . showdate("newsdate", $data['news_datestamp']) . "</span>\n"; echo "<span class='news-action'><i class='fa fa-eye'></i><span class='text-dark m-r-10'>" . number_format($data['news_reads']) . "</span>\n</span>"; echo $data['news_allow_comments'] ? display_comments($data['news_comments'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#comments") : ''; echo $data['news_allow_ratings'] ? "<span class='m-r-10'>" . display_ratings($data['news_sum_rating'], $data['news_count_votes'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#ratings") . " </span>" : ''; echo "<a class='m-r-10' title='" . $locale['news_0002'] . "' href='" . BASEDIR . "print.php?type=N&item_id=" . $data['news_id'] . "'><i class='fa fa-print'></i></a>"; echo iADMIN && checkrights("N") ? "<a title='" . $locale['news_0003'] . "' href='" . INFUSIONS . "news/news_admin.php" . $aidlink . "&action=edit&section=news_form&news_id=" . $data['news_id'] . "' title='" . $locale['news_0003'] . "' />" . $locale['news_0003'] . "</a>\n" : ""; echo "</div>"; echo "<!--news_sub_readmore-->"; echo !isset($_GET['readmore']) && $data['news_ext'] == "y" ? "<div class='m-t-20'>\n<a href='" . INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "' class='button'>" . $locale['news_0001'] . "</a>\n</div>\n" : ""; if ($data['page_count'] > 0) { echo "<div class='text-center m-t-10'>\n" . makepagenav($_GET['rowstart'], 1, $data['page_count'], 3, INFUSIONS . "news/news.php?readmore=" . $_GET['readmore'] . "&") . "\n</div>\n"; } if ($data['news_allow_comments']) { echo "<hr />" . showcomments("N", DB_NEWS, "news_id", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n"; } if ($data['news_allow_ratings']) { echo "<hr />" . showratings("N", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n"; } echo "</article>\n"; closetable(); }
} $Template->assign_vars(array('TITLE' => $page_infos['title'], 'CONTENTS' => pages_second_parse($page_infos['contents']), 'COUNT_HITS' => $page_infos['count_hits'] ? sprintf($LANG['page_hits'], $page_infos['hits'] + 1) : ' ', 'PAGES_PATH' => $pages_data_path, 'L_LINKS' => $LANG['pages_links_list'])); $Template->pparse('page'); } elseif ((!empty($encoded_title) || $id_com > 0) && $num_rows == 0) { redirect(HOST . DIR . url('/pages/pages.php?error=e_page_not_found')); } elseif ($id_com > 0) { if ($page_infos['activ_com'] == 0) { redirect(HOST . DIR . '/pages/pages.php?error=e_unactiv_com'); } $special_auth = !empty($page_infos['auth']); $array_auth = unserialize($page_infos['auth']); if ($special_auth && !$User->check_auth($array_auth, READ_PAGE) || !$special_auth && !$User->check_auth($_PAGES_CONFIG['auth'], READ_PAGE) && ($special_auth && !$User->check_auth($array_auth, READ_COM)) || !$special_auth && !$User->check_auth($_PAGES_CONFIG['auth'], READ_COM)) { redirect(HOST . DIR . '/pages/pages.php?error=e_auth_com'); } $Template->set_filenames(array('com' => 'pages/com.tpl')); $Template->assign_vars(array('COMMENTS' => display_comments('pages', $id_com, url('pages.php?id=' . $id_com . '&com=%s')))); $Template->pparse('com'); } elseif (!empty($error)) { $Template->set_filenames(array('error' => 'pages/error.tpl')); $Template->assign_vars(array('L_TITLE' => $LANG['error'])); switch ($error) { case 'e_page_not_found': $Errorh->handler($LANG['pages_not_found'], E_USER_WARNING); break; case 'e_auth': $Errorh->handler($LANG['pages_error_auth_read'], E_USER_WARNING); break; case 'e_auth_com': $Errorh->handler($LANG['pages_error_auth_com'], E_USER_WARNING); break; case 'e_unactiv_com':
: <?php foreach ($post->keywords as $keyword) { ?> <span><?php echo anchor('blog/tagged/' . $keyword->name, $keyword->name, 'class="keyword"'); ?> </span> <?php } ?> </div> <?php } ?> </div> <div class="body"> <?php echo $post->body; ?> </div> </div> <?php if ($post->comments_enabled) { ?> <?php echo display_comments($post->id); }
<p class="article_date"><?php echo lang('news_posted_label'); ?> : <?php echo format_date($article->created_on); ?> </p> <?php if ($article->category->slug) { ?> <p class="article_category"> <?php echo lang('news_category_label'); ?> : <?php echo anchor('news/category/' . $article->category->slug, $article->category->title); ?> </p> <?php } ?> </div> <div class="article_body"> <?php echo stripslashes($article->body); ?> </div> </div> <?php echo display_comments($article->id);
<!-- Div containing the full sized image --> <div class="gallery_image_full"> <img src="<?php echo site_url('uploads/galleries/' . $gallery->slug . '/full/' . $gallery_image->filename . '.' . $gallery_image->extension); ?> " alt="<?php echo $gallery_image->title; ?> " /> </div> <?php if (!empty($gallery_image->description)) { ?> <!-- An image needs a description.. --> <div class="gallery_image_description"> <p><?php echo $gallery_image->description; ?> </p> </div> <?php } ?> </div> </div> <?php if ($gallery->enable_comments == 1) { ?> <?php echo display_comments($gallery_image->id, 'gallery-image'); }
$end_thumbnails += $nbr_pics_display_before - $thumbnails_before; } if ($thumbnails_after < $nbr_pics_display_after) { $start_thumbnails += $nbr_pics_display_after - $thumbnails_after; } $html_protected_name = strprotect($info_pics['name'], HTML_PROTECT, ADDSLASHES_FORCE); $Template->assign_vars(array('C_GALLERY_PICS_MAX' => true, 'C_GALLERY_PICS_MODO' => $is_modo ? true : false, 'ID' => $info_pics['id'], 'IMG_MAX' => '<img src="show_pics' . url('.php?id=' . $g_idpics . '&cat=' . $g_idcat) . '" alt="" />', 'NAME' => '<span id="fi_' . $info_pics['id'] . '">' . $info_pics['name'] . '</span> <span id="fi' . $info_pics['id'] . '"></span>', 'POSTOR' => '<a class="small_link" href="../member/member' . url('.php?id=' . $info_pics['user_id'], '-' . $info_pics['user_id'] . '.php') . '">' . $info_pics['login'] . '</a>', 'DATE' => gmdate_format('date_format_short', $info_pics['timestamp']), 'VIEWS' => $info_pics['views'] + 1, 'DIMENSION' => $info_pics['width'] . ' x ' . $info_pics['height'], 'SIZE' => number_round($info_pics['weight'] / 1024, 1), 'COM' => Comments::com_display_link($info_pics['nbr_com'], '../gallery/gallery' . url('.php?cat=' . $info_pics['idcat'] . '&id=' . $info_pics['id'] . '&com=0&sort=' . $g_sort, '-' . $info_pics['idcat'] . '-' . $info_pics['id'] . '.php?com=0&sort=' . $g_sort), $info_pics['id'], 'gallery'), 'KERNEL_NOTATION' => $activ_note ? $Note->display_form() : '', 'COLSPAN' => $CONFIG_GALLERY['nbr_column'] + 2, 'CAT' => $cat_list, 'RENAME' => $html_protected_name, 'RENAME_CUT' => $html_protected_name, 'IMG_APROB' => get_ulang() . '/' . ($info_pics['aprob'] == 1 ? 'unvisible.png' : 'visible.png'), 'ARRAY_JS' => $array_js, 'NBR_PICS' => $i - 1, 'MAX_START' => $i - 1 - $nbr_column_pics, 'START_THUMB' => $pos_pics - $start_thumbnails > 0 ? $pos_pics - $start_thumbnails : 0, 'END_THUMB' => $pos_pics + $end_thumbnails, 'L_KB' => $LANG['unit_kilobytes'], 'L_INFORMATIONS' => $LANG['informations'], 'L_NAME' => $LANG['name'], 'L_POSTOR' => $LANG['postor'], 'L_VIEWS' => $LANG['views'], 'L_ADD_ON' => $LANG['add_on'], 'L_DIMENSION' => $LANG['dimension'], 'L_SIZE' => $LANG['size'], 'L_NOTE' => $LANG['note'], 'L_COM' => $LANG['com'], 'L_EDIT' => $LANG['edit'], 'L_APROB_IMG' => $info_pics['aprob'] == 1 ? $LANG['unaprob'] : $LANG['aprob'], 'L_THUMBNAILS' => $LANG['thumbnails'], 'U_DEL' => url('.php?del=' . $info_pics['id'] . '&token=' . $Session->get_token() . '&cat=' . $g_idcat, '-' . $g_idcat . '.php?token=' . $Session->get_token() . '&del=' . $info_pics['id']), 'U_MOVE' => url('.php?id=' . $info_pics['id'] . '&token=' . $Session->get_token() . '&move=\' + this.options[this.selectedIndex].value', '-0-' . $info_pics['id'] . '.php?token=' . $Session->get_token() . '&move=\' + this.options[this.selectedIndex].value'), 'U_PREVIOUS' => $pos_pics > 0 ? '<a href="gallery' . url('.php?cat=' . $g_idcat . '&id=' . $id_previous, '-' . $g_idcat . '-' . $id_previous . '.php') . '#pics_max"><img src="../templates/' . get_utheme() . '/images/left.png" alt="" class="valign_middle" /></a> <a href="gallery' . url('.php?cat=' . $g_idcat . '&id=' . $id_previous, '-' . $g_idcat . '-' . $id_previous . '.php') . '#pics_max">' . $LANG['previous'] . '</a>' : '', 'U_NEXT' => $pos_pics < $i - 1 ? '<a href="gallery' . url('.php?cat=' . $g_idcat . '&id=' . $id_next, '-' . $g_idcat . '-' . $id_next . '.php') . '#pics_max">' . $LANG['next'] . '</a> <a href="gallery' . url('.php?cat=' . $g_idcat . '&id=' . $id_next, '-' . $g_idcat . '-' . $id_next . '.php') . '#pics_max"><img src="../templates/' . get_utheme() . '/images/right.png" alt="" class="valign_middle" /></a>' : '', 'U_LEFT_THUMBNAILS' => $pos_pics - $start_thumbnails > 0 ? '<span id="display_left"><a href="javascript:display_thumbnails(\'left\')"><img src="../templates/' . get_utheme() . '/images/left.png" class="valign_middle" alt="" /></a></span>' : '<span id="display_left"></span>', 'U_RIGHT_THUMBNAILS' => $pos_pics - $start_thumbnails <= $i - 1 - $nbr_column_pics ? '<span id="display_right"><a href="javascript:display_thumbnails(\'right\')"><img src="../templates/' . get_utheme() . '/images/right.png" class="valign_middle" alt="" /></a></span>' : '<span id="display_right"></span>')); $i = 0; foreach ($array_pics as $pics) { if ($i >= $pos_pics - $start_thumbnails && $i <= $pos_pics + $end_thumbnails) { $Template->assign_block_vars('list_preview_pics', array('PICS' => $pics)); } $i++; } if (isset($_GET['com'])) { $Template->assign_vars(array('COMMENTS' => display_comments('gallery', $g_idpics, url('gallery.php?cat=' . $g_idcat . '&id=' . $g_idpics . '&com=%s', 'gallery-' . $g_idcat . '-' . $g_idpics . '.php?com=%s')))); } } } else { import('util/pagination'); $Pagination = new Pagination(); $Template->assign_vars(array('C_GALLERY_MODO' => $is_modo ? true : false, 'PAGINATION_PICS' => $Pagination->display('gallery' . url('.php?pp=%d&cat=' . $g_idcat, '-' . $g_idcat . '+' . $rewrite_title . '.php?pp=%d'), $nbr_pics, 'pp', $CONFIG_GALLERY['nbr_pics_max'], 3), 'L_EDIT' => $LANG['edit'], 'L_VIEW' => $LANG['view'], 'L_VIEWS' => $LANG['views'])); import('content/note'); $is_connected = $User->check_level(MEMBER_LEVEL); $j = 0; $result = $Sql->query_while("SELECT g.id, g.idcat, g.name, g.path, g.timestamp, g.aprob, g.width, g.height, g.user_id, g.views, g.note, g.nbrnote, g.nbr_com, g.aprob, m.login\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 = '" . $g_idcat . "' AND g.aprob = 1\n\t\t\t" . $g_sql_sort . "\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']); } if ($CONFIG_GALLERY['display_pics'] == 3) {
if ($download_info['size'] > 1) { $size_tpl = $download_info['size'] . ' ' . $LANG['unit_megabytes']; } elseif ($download_info['size'] > 0) { $size_tpl = $download_info['size'] * 1024 . ' ' . $LANG['unit_kilobytes']; } else { $size_tpl = $DOWNLOAD_LANG['unknown_size']; } import('util/date'); $creation_date = new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $download_info['timestamp']); $release_date = new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $download_info['release_timestamp']); import('content/note'); $Note = new Note('download', $file_id, url('download.php?id=' . $file_id, 'category-' . $category_id . '-' . $file_id . '.php'), $CONFIG_DOWNLOAD['note_max'], '', NOTE_NODISPLAY_NBRNOTES); import('content/comments'); $Template->assign_vars(array('C_DISPLAY_DOWNLOAD' => true, 'C_IMG' => !empty($download_info['image']), 'C_EDIT_AUTH' => $auth_write, 'MODULE_DATA_PATH' => $Template->get_module_data_path('download'), 'ID_FILE' => $file_id, 'NAME' => $download_info['title'], 'CONTENTS' => second_parse($download_info['contents']), 'CREATION_DATE' => $creation_date->format(DATE_FORMAT_SHORT), 'RELEASE_DATE' => $release_date->get_timestamp() > 0 ? $release_date->format(DATE_FORMAT_SHORT) : $DOWNLOAD_LANG['unknown_date'], 'SIZE' => $size_tpl, 'COUNT' => $download_info['count'], 'THEME' => get_utheme(), 'KERNEL_NOTATION' => $Note->display_form(), 'HITS' => sprintf($DOWNLOAD_LANG['n_times'], (int) $download_info['count']), 'NUM_NOTES' => sprintf($DOWNLOAD_LANG['num_notes'], (int) $download_info['nbrnote']), 'U_IMG' => $download_info['image'], 'IMAGE_ALT' => str_replace('"', '\\"', $download_info['title']), 'LANG' => get_ulang(), 'U_COM' => Comments::com_display_link($download_info['nbr_com'], '../download/download' . url('.php?id=' . $file_id . '&com=0', '-' . $file_id . '+' . url_encode_rewrite($download_info['title']) . '.php?com=0'), $file_id, 'download'), 'L_DATE' => $LANG['date'], 'L_SIZE' => $LANG['size'], 'L_DOWNLOAD' => $DOWNLOAD_LANG['download'], 'L_DOWNLOAD_FILE' => $DOWNLOAD_LANG['download_file'], 'L_FILE_INFOS' => $DOWNLOAD_LANG['file_infos'], 'L_INSERTION_DATE' => $DOWNLOAD_LANG['insertion_date'], 'L_RELEASE_DATE' => $DOWNLOAD_LANG['last_update_date'], 'L_DOWNLOADED' => $DOWNLOAD_LANG['downloaded'], 'L_EDIT_FILE' => str_replace('"', '\\"', $DOWNLOAD_LANG['edit_file']), 'L_CONFIRM_DELETE_FILE' => str_replace('\'', '\\\'', $DOWNLOAD_LANG['confirm_delete_file']), 'L_DELETE_FILE' => str_replace('"', '\\"', $DOWNLOAD_LANG['delete_file']), 'U_EDIT_FILE' => url('management.php?edit=' . $file_id), 'U_DELETE_FILE' => url('management.php?del=' . $file_id . '&token=' . $Session->get_token()), 'U_DOWNLOAD_FILE' => url('count.php?id=' . $file_id, 'file-' . $file_id . '+' . url_encode_rewrite($download_info['title']) . '.php'))); if (isset($_GET['com'])) { $Template->assign_vars(array('COMMENTS' => display_comments('download', $file_id, url('download.php?id=' . $file_id . '&com=%s', 'download-' . $file_id . '.php?com=%s')))); } $Template->pparse('download'); } else { $Template->set_filenames(array('download' => 'download/download.tpl')); $Template->assign_vars(array('C_ADMIN' => $auth_write, 'C_DOWNLOAD_CAT' => true, 'C_ADD_FILE' => $auth_write || $auth_contribution, 'C_DESCRIPTION' => !empty($DOWNLOAD_CATS[$category_id]['contents']) || $category_id == 0 && !empty($CONFIG_DOWNLOAD['root_contents']), 'IDCAT' => $category_id, 'TITLE' => sprintf($DOWNLOAD_LANG['title_download'] . ($category_id > 0 ? ' - ' . $DOWNLOAD_CATS[$category_id]['name'] : '')), 'DESCRIPTION' => $category_id > 0 ? second_parse($DOWNLOAD_CATS[$category_id]['contents']) : second_parse($CONFIG_DOWNLOAD['root_contents']), 'L_ADD_FILE' => $DOWNLOAD_LANG['add_file'], 'U_ADMIN_CAT' => $category_id > 0 ? url('admin_download_cat.php?edit=' . $category_id) : url('admin_download_cat.php'), 'U_ADD_FILE' => url('management.php?new=1&idcat=' . $category_id))); $num_subcats = 0; foreach ($DOWNLOAD_CATS as $id => $value) { if ($id != 0 && $value['id_parent'] == $category_id) { $num_subcats++; } } if ($num_subcats > 0) { $Template->assign_vars(array('C_SUB_CATS' => true)); $i = 1; foreach ($DOWNLOAD_CATS as $id => $value) {
<!-- Page layout: <?php echo $page['layout']['title']; ?> --> <?php echo $page['layout']['body']; ?> <?php if ($page['comments_enabled']) { ?> <?php echo display_comments($page['id']); }
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; } }
</tr> <tr> <td valign="top">Comments </td> <td><textarea name="comments" cols="40" rows="5"><?php echo htmlspecialchars($defaults['comments']); ?> </textarea> </td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit Comments" /></td> </tr> </table> </form> <?php } if ($_POST) { $errors = validate_form($_POST); if ($errors) { echo "<p>Sorry, we are unable to process your submission because:</p><ul><li>", implode('</li><li>', $errors), "</li></ul>", "<p>Please correct your form below and re-submit it</p>"; display_form($_POST); } else { save_comment($_POST) or die("Sorry, our guestbook is out of order. Please try again later"); display_comments() or die("Sorry, our guestbook is out of order. Please try again later"); display_form($defaults); } } else { display_comments() or die("Sorry, our guestbook is out of order. Please try again later"); display_form($defaults); }
/** * Parse MVC Data output * @param array $data - dbarray of newsQuery() * @return array */ public static function get_NewsData(array $data) { $news_settings = self::get_news_settings(); if (!empty($data)) { $largeImg = ""; $news_subject = stripslashes($data['news_subject']); $imageSource = IMAGES_N . "news_default.jpg"; if ($data['news_cat_image']) { $imageSource = get_image("nc_" . $data['news_cat_name']); } if ($news_settings['news_image_frontpage'] == 0) { if ($data['news_image'] && file_exists(IMAGES_N . $data['news_image'])) { $imageSource = IMAGES_N . $data['news_image']; $largeImg = $imageSource; } if ($data['news_image_t2'] && file_exists(IMAGES_N_T . $data['news_image_t2'])) { $imageSource = IMAGES_N_T . $data['news_image_t2']; } if ($data['news_image_t1'] && file_exists(IMAGES_N_T . $data['news_image_t1'])) { $imageSource = IMAGES_N_T . $data['news_image_t1']; } } $image = "<img class='img-responsive' src='" . $imageSource . "' alt='" . $data['news_subject'] . "' />\n"; if (!empty($data['news_extended'])) { $news_image_link = $news_settings['news_image_link'] == 0 ? INFUSIONS . "news/news.php?cat_id=" . $data['news_cat'] : INFUSIONS . "news/news.php?readmore=" . $data['news_id']; $news_image = "<a class='img-link' href='{$news_image_link}'>{$image}</a>\n"; } else { $news_image = $image; } $news_cat_image = "<a href='" . ($news_settings['news_image_link'] == 0 ? "" . INFUSIONS . "news/news.php?cat_id=" . $data['news_cat'] : INFUSIONS . "news/news.php?readmore=" . $data['news_id']) . "'>"; if ($data['news_image_t2'] && $news_settings['news_image_frontpage'] == 0) { $news_cat_image .= $image . "</a>"; } elseif ($data['news_cat_image']) { $news_cat_image .= "<img src='" . get_image("nc_" . $data['news_cat_name']) . "' alt='" . $data['news_cat_name'] . "' class='img-responsive news-category' /></a>"; } $news_news = preg_replace("/<!?--\\s*pagebreak\\s*-->/i", "", $data['news_breaks'] == "y" ? nl2br(parse_textarea($data['news_news'])) : parse_textarea($data['news_news'])); $info = array("news_id" => $data['news_id'], 'news_subject' => $news_subject, "news_url" => INFUSIONS . 'news/news.php?readmore=' . $data['news_id'], "news_cat_url" => INFUSIONS . 'news/news.php?cat_id=' . $data['news_cat_id'], "news_image_url" => $news_settings['news_image_link'] == 0 ? INFUSIONS . "news/news.php?cat_id=" . $data['news_cat_id'] : INFUSIONS . "news/news.php?readmore=" . $data['news_id'], 'news_anchor' => "<a name='news_" . $data['news_id'] . "' id='news_" . $data['news_id'] . "'></a>", 'news_news' => $news_news, "news_keywords" => $data['news_keywords'], "user_id" => $data['user_id'], "user_name" => $data['user_name'], "user_status" => $data['user_status'], "user_avatar" => $data['user_avatar'], 'user_level' => $data['user_level'], "news_date" => $data['news_datestamp'], "news_cat_id" => $data['news_cat'], "news_cat_name" => !empty($data['news_cat_name']) ? $data['news_cat_name'] : fusion_get_locale('news_0006'), "news_cat_image" => $news_cat_image, "news_image" => $news_image, 'news_image_src' => $largeImg, "news_image_optimized" => $imageSource, "news_ext" => $data['news_extended'] ? "y" : "n", "news_reads" => $data['news_reads'], "news_comments" => $data['count_comment'], 'news_sum_rating' => $data['sum_rating'] ? $data['sum_rating'] : 0, 'news_count_votes' => $data['count_votes'], "news_allow_comments" => $data['news_allow_comments'], "news_display_comments" => $data['news_allow_comments'] ? display_comments($data['count_comment'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#comments", '', 2) : '', "news_allow_ratings" => $data['news_allow_ratings'], "news_display_ratings" => $data['news_allow_ratings'] ? display_ratings($data['sum_rating'], $data['count_votes'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#postrating", '', 2) : '', "news_sticky" => $data['news_sticky'], "print_link" => BASEDIR . "print.php?type=N&item_id=" . $data['news_id']); $info += $data; return (array) $info; } return array(); }
$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')))); } $tpl_news->parse(); require_once '../kernel/footer.php';
<?php include 'functions.php'; session_start(); check_valid_user(); $postid = $_GET['id']; $post = get_post_details($postid); do_html_header($post->title, array('ajax_functions.js')); display_entry($post); $comments = get_comments($postid); display_comments($comments); comments_post_form($postid); do_html_url('blog', 'Home'); do_html_footer();
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'; break; case 'date':
<h2><?php echo $album->title; ?> </h2> <p><?php echo $album->description; ?> </p> <a href="<?php echo image_path('photos/' . $album->id . '/' . $photo->filename); ?> " title="<?php echo $photo->caption; ?> " rel="modal"> <?php echo image('photos/' . $album->id . '/' . $photo->filename, '', array('alt' => $photo->caption, 'class' => 'photo')); ?> </a> <?php echo display_comments($photo->id);
?> </h3> </div> <!-- And the body --> <div class="gallery_body"> <p> <?php if (!empty($gallery->description)) { echo $gallery->description; } else { echo "No description has been added yet."; } ?> </p> </div> </div> <?php } ?> </div> <?php } ?> <div class="clear-both"></div> <?php if ($gallery->enable_comments == 1) { ?> <?php echo display_comments($gallery->id, 'gallery'); }
$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); } if ($delete) { $Sql->query_inject("DELETE FROM " . PREFIX . "calendar WHERE id = '" . $id . "'", __LINE__, __FILE__); $Sql->query_inject("DELETE FROM " . DB_TABLE_COM . " WHERE idprov = '" . $id . "' AND script = 'calendar'", __LINE__, __FILE__); redirect(HOST . SCRIPT . SID2); } elseif ($edit) { if (!empty($_POST['valid'])) { $contents = retrieve(POST, 'contents', '', TSTRING_PARSE); $title = retrieve(POST, 'title', ''); $date = retrieve(POST, 'date', '', TSTRING_UNCHANGE);
<a href="<?php echo site_url() . '/polls/results/' . $poll['slug']; ?> "><?php echo lang('polls.results'); ?> </a><br /> <?php echo lang('polls.total_votes'); ?> : <?php echo $poll['total_votes']; ?> <?php } else { ?> <p><?php echo lang('polls.no_options'); ?> </p> <?php } ?> <?php if ($comments_enabled) { ?> <?php echo display_comments($poll['id']); }
function main($action) { global $db, $cache, $config, $images, $user, $lang, $bbcode, $pafiledb_config, $template, $pafiledb_functions; @(include_once IP_ROOT_PATH . 'includes/bbcode.' . PHP_EXT); $cat_id = request_var('cat_id', 0); $file_id = request_var('file_id', 0); $action = request_var('action', ''); if ($file_id == 0 && $action != '') { $file_id_array = array(); $file_id_array = explode('=', $action); $file_id = $file_id_array[1]; } if (empty($file_id)) { message_die(GENERAL_MESSAGE, $lang['File_not_exist']); } // ======================================================= // file id is not set, give him/her a nice error message // ======================================================= $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_file) AS total_votes, u.user_id, u.username, u.user_active, u.user_color, COUNT(c.comments_id) as total_comments\n\t\t\tFROM " . PA_FILES_TABLE . " AS f\n\t\t\t\tLEFT JOIN " . PA_VOTES_TABLE . " AS r ON f.file_id = r.votes_file\n\t\t\t\tLEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id\n\t\t\t\tLEFT JOIN " . PA_COMMENTS_TABLE . " AS c ON f.file_id = c.file_id\n\t\t\tWHERE f.file_id = " . (int) $file_id . "\n\t\t\tAND f.file_approved = 1\n\t\t\tGROUP BY f.file_id "; $result = $db->sql_query($sql); //=================================================== // file doesn't exist' //=================================================== if (!($file_data = $db->sql_fetchrow($result))) { message_die(GENERAL_MESSAGE, $lang['File_not_exist']); } $db->sql_freeresult($result); //=================================================== // Pafiledb auth for viewing file //=================================================== if (!$this->auth[$file_data['file_catid']]['auth_view_file']) { if (!$user->data['session_logged_in']) { redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=dload.' . PHP_EXT . '&action=file&file_id=' . $file_id, true)); } $message = sprintf($lang['Sorry_auth_view'], $this->auth[$file_data['file_catid']]['auth_view_file_type']); message_die(GENERAL_MESSAGE, $message); } $this->generate_category_nav($file_data['file_catid']); $template->assign_vars(array('L_INDEX' => sprintf($lang['Forum_Index'], $config['sitename']), 'L_HOME' => $lang['Home'], 'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($config['default_dateformat'], time(), $config['board_timezone'])), 'U_INDEX_HOME' => append_sid(CMS_PAGE_HOME), 'U_DOWNLOAD_HOME' => append_sid('dload.' . PHP_EXT), 'FILE_NAME' => $file_data['file_name'], 'DOWNLOAD' => $pafiledb_config['settings_dbname'])); //=================================================== // Prepare file info to display them //=================================================== $file_time = create_date_ip($config['default_dateformat'], $file_data['file_time'], $config['board_timezone']); $file_last_download = $file_data['file_last'] ? create_date_ip($config['default_dateformat'], $file_data['file_last'], $config['board_timezone']) : $lang['never']; $file_update_time = $file_data['file_update_time'] ? create_date_ip($config['default_dateformat'], $file_data['file_update_time'], $config['board_timezone']) : $lang['never']; $file_author = trim($file_data['file_creator']); $file_version = trim($file_data['file_version']); $file_screenshot_url = trim($file_data['file_ssurl']); $file_website_url = trim($file_data['file_docsurl']); //$file_rating = ($file_data['rating'] != 0) ? round($file_data['rating'], 2) . ' / 10' : $lang['Not_rated']; //$file_rating2 = ($file_data['rating'] != 0) ? sprintf("%.1f", round(($file_data['rating']), 2)/2) : '0.0'; $file_rating2 = $file_data['rating'] != 0 ? sprintf("%.1f", round($file_data['rating'], 0) / 2) : '0.0'; $file_download_link = $file_data['file_license'] > 0 ? append_sid('dload.' . PHP_EXT . '?action=license&license_id=' . $file_data['file_license'] . '&file_id=' . $file_id) : append_sid('dload.' . PHP_EXT . '?action=download&file_id=' . $file_id); $file_size = $pafiledb_functions->get_file_size($file_id, $file_data); /* $file_poster = ($file_data['user_id'] != ANONYMOUS) ? '<a href="' . append_sid(CMS_PAGE_PROFILE.'?mode=viewprofile&' . POST_USERS_URL . '=' . $file_data['user_id']) . '">' : ''; $file_poster .= ($file_data['user_id'] != ANONYMOUS) ? $file_data['username'] : $lang['Guest']; $file_poster .= ($file_data['user_id'] != ANONYMOUS) ? '</a>' : ''; */ $file_poster = $file_data['user_id'] == ANONYMOUS ? $lang['Guest'] : colorize_username($file_data['user_id'], $file_data['username'], $file_data['user_color'], $file_data['user_active']); $bbcode->allow_html = $config['allow_html'] ? true : false; $bbcode->allow_bbcode = $config['allow_bbcode'] ? true : false; $bbcode->allow_smilies = $config['allow_smilies'] ? true : false; $file_long_desc = $bbcode->parse($file_data['file_longdesc']); $template->assign_vars(array('L_CLICK_HERE' => $lang['Click_here'], 'L_AUTHOR' => $lang['Creator'], 'L_VERSION' => $lang['Version'], 'L_SCREENSHOT' => $lang['Scrsht'], 'L_WEBSITE' => $lang['Docs'], 'L_FILE' => $lang['File'], 'L_EDIT' => $lang['Editfile'], 'L_DELETE' => $lang['Deletefile'], 'L_DESC' => $lang['Desc'], 'L_VOTES' => $lang['Votes'], 'L_DATE' => $lang['Date'], 'L_UPDATE_TIME' => $lang['Update_time'], 'L_LASTTDL' => $lang['Lastdl'], 'L_DLS' => $lang['Dls'], 'L_RATING' => $lang['DlRating'], 'L_SIZE' => $lang['File_size'], 'L_DOWNLOAD' => $lang['Downloadfile'], 'L_RATE' => $lang['Rate'], 'L_EMAIL' => $lang['Emailfile'], 'L_SUBMITED_BY' => $lang['Submiter'], 'SHOW_AUTHOR' => !empty($file_author) ? true : false, 'SHOW_VERSION' => !empty($file_version) ? true : false, 'SHOW_SCREENSHOT' => !empty($file_screenshot_url) ? true : false, 'SHOW_WEBSITE' => !empty($file_website_url) ? true : false, 'SS_AS_LINK' => $file_data['file_sshot_link'] ? true : false, 'FILE_NAME' => $file_data['file_name'], 'FILE_LONGDESC' => $file_long_desc, 'FILE_SUBMITED_BY' => $file_poster, 'FILE_AUTHOR' => $file_author, 'FILE_VERSION' => $file_version, 'FILE_SCREENSHOT' => $file_screenshot_url, 'FILE_WEBSITE' => $file_website_url, 'AUTH_EDIT' => $this->auth[$file_data['file_catid']]['auth_edit_file'] && $file_data['user_id'] == $user->data['user_id'] || $this->auth[$file_data['file_catid']]['auth_mod'] ? true : false, 'AUTH_DELETE' => $this->auth[$file_data['file_catid']]['auth_delete_file'] && $file_data['user_id'] == $user->data['user_id'] || $this->auth[$file_data['file_catid']]['auth_mod'] ? true : false, 'AUTH_DOWNLOAD' => $this->auth[$file_data['file_catid']]['auth_download'] ? true : false, 'AUTH_RATE' => $this->auth[$file_data['file_catid']]['auth_rate'] ? true : false, 'AUTH_EMAIL' => $this->auth[$file_data['file_catid']]['auth_email'] ? true : false, 'INCLUDE_COMMENTS' => $this->auth[$file_data['file_catid']]['auth_view_comment'] ? true : false, 'DELETE_IMG' => $images['icon_delpost'], 'EDIT_IMG' => $images['icon_edit'], 'DOWNLOAD_IMG' => $images['pa_download'], 'RATE_IMG' => $images['pa_rate'], 'EMAIL_IMG' => $images['pa_email'], 'FILE_VOTES' => $file_data['total_votes'], 'TIME' => $file_time, 'UPDATE_TIME' => $file_data['file_update_time'] != $file_data['file_time'] ? $file_update_time : $lang['never'], 'RATING' => $file_rating2, 'FILE_DLS' => intval($file_data['file_dls']), 'FILE_SIZE' => $file_size, 'LAST' => $file_last_download, 'U_DELETE' => append_sid('dload.' . PHP_EXT . '?action=user_upload&do=delete&file_id=' . $file_id), 'U_EDIT' => append_sid('dload.' . PHP_EXT . '?action=user_upload&file_id=' . $file_id), 'U_DOWNLOAD' => $file_download_link, 'U_RATE' => append_sid('dload.' . PHP_EXT . '?action=rate&file_id=' . $file_id), 'U_EMAIL' => append_sid('dload.' . PHP_EXT . '?action=email&file_id=' . $file_id))); $custom_fields = new custom_fields(); $custom_fields->custom_table = PA_CUSTOM_TABLE; $custom_fields->custom_data_table = PA_CUSTOM_DATA_TABLE; $custom_fields->init(); $custom_fields->display_data($file_id); if ($this->auth[$file_data['file_catid']]['auth_view_comment']) { include IP_ROOT_PATH . PA_FILE_DB_PATH . 'functions_comment.' . PHP_EXT; display_comments($file_data); } $this->display($lang['Download'], 'pa_file_body.tpl'); }
<?php echo $child->description; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> <?php if(!empty($photos)): ?> <ul id="photos"> <?php foreach ($photos as $photo):?> <li class="photo"> <a href="<?php echo image_path('photos/'.$album->id .'/' . $photo->filename); ?>" rel="modal"> <?php echo image('photos/' . $album->id . '/' . substr($photo->filename, 0, -4) . '_thumb' . substr($photo->filename, -4), '', array('alt' => $photo->caption));?> </a> </li> <?php endforeach; ?> </ul> <br class="clear-both" /> <?php echo $pagination['links']; ?> <?php echo display_comments($photo->id, 'photos-album'); ?> <?php else: ?> <p><?php echo lang('photo_albums.no_photos_in_album_error');?></p> <?php endif; ?>
<br style="clear: both;" /> <?php if ( ! empty($sub_galleries) ): ?> <h2><?php echo lang('galleries.sub-galleries_label'); ?></h2> <!-- Show all sub-galleries --> <div class="sub_galleries_container"> <?php foreach ($sub_galleries as $sub_gallery): ?> <div class="gallery clearfix"> <!-- Heading --> <div class="gallery_heading"> <?php if ( ! empty($sub_gallery->filename)) : ?> <a href="<?php echo site_url() . 'galleries/' . $sub_gallery->slug; ?>"> <?php echo img(array('src' => site_url() . 'files/thumb/' . $sub_gallery->file_id, 'alt' => $sub_gallery->title)); ?> </a> <?php endif; ?> <h3><?php echo anchor('galleries/' . $sub_gallery->slug, $sub_gallery->title); ?></h3> </div> <!-- And the body --> <div class="gallery_body"> <p> <?php echo ( ! empty($sub_gallery->description)) ? $sub_gallery->description : lang('galleries.no_gallery_description'); ?> </p> </div> </div> <?php endforeach; ?> </div> <?php endif; ?> <br style="clear: both;" /> <?php if ($gallery->enable_comments == 1): ?> <?php echo display_comments($gallery->id);?> <?php endif; ?>
<article class="page"> <?php echo $page->layout->body; ?> <?php if ($page->comments_enabled) { ?> <?php echo display_comments($page->id); ?> <?php } ?> </article>
} $Template->assign_vars(array('L_REDIRECTION_NAME' => $LANG['wiki_redirection_name'], 'L_REDIRECTION_ACTIONS' => $LANG['wiki_possible_actions'], 'REDIRECTION_DELETE' => $LANG['wiki_redirection_delete'], 'L_ALERT_DELETE_REDIRECTION' => str_replace('"', '\\"', $LANG['wiki_alert_delete_redirection']), 'L_CREATE_REDIRECTION' => $LANG['wiki_create_redirection'], 'U_CREATE_REDIRECTION' => url('property.php?create_redirection=' . $redirect))); } elseif ($create_redirection > 0) { $Template->assign_vars(array('L_REDIRECTION_NAME' => $LANG['wiki_redirection_name'])); $Template->assign_block_vars('create', array('L_TITLE' => sprintf($LANG['wiki_create_redirection_to_this'], $article_infos['title']), 'ID_ARTICLE' => $create_redirection)); $error = retrieve(GET, 'error', ''); if ($error == 'title_already_exists') { $errstr = $LANG['wiki_title_already_exists']; } else { $errstr = ''; } if (!empty($errstr)) { $Errorh->handler($errstr, E_USER_WARNING); } } elseif (isset($_GET['com']) && $idcom > 0) { $Template->assign_vars(array('C_COMMENTS' => true, 'COMMENTS' => display_comments('wiki_articles', $idcom, url('property.php?idcom=' . $idcom . '&com=%s'), 'wiki'))); } elseif ($del_article > 0) { if (empty($article_infos['title'])) { redirect(HOST . DIR . '/wiki/' . url('wiki.php')); } if ($article_infos['is_cat'] == 0) { redirect(HOST . DIR . '/wiki/' . url('wiki.php?title=' . $article_infos['encoded_title'], $article_infos['encoded_title'])); } else { $cats = array(); $cat_list = display_cat_explorer($article_infos['id_cat'], $cats); $cats = array_reverse($cats); if (array_key_exists(0, $cats)) { unset($cats[0]); } $current_cat = ''; $nbr_cats = count($cats);
$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';