PATH:
home
/
sudairsocs
/
www
/
forum_ancien
/
Sources
<?php /** * Simple Machines Forum (SMF) * * @package SMF * @author Simple Machines http://www.simplemachines.org * @copyright 2011 Simple Machines * @license http://www.simplemachines.org/about/smf/license.php BSD * * @version 2.0 */ if (!defined('SMF')) die('Hacking attempt...'); /* This file contains just one function that formats a topic to be printer friendly. void PrintTopic() - is called to format a topic to be printer friendly. - must be called with a topic specified. - uses the Printpage (main sub template.) template. - uses the print_above/print_below later without the main layer. - is accessed via ?action=printpage. */ function PrintTopic() { global $topic, $txt, $scripturl, $context, $user_info; global $board_info, $smcFunc, $modSettings; // Redirect to the boardindex if no valid topic id is provided. if (empty($topic)) redirectexit(); // Whatever happens don't index this. $context['robot_no_index'] = true; // Get the topic starter information. $request = $smcFunc['db_query']('', ' SELECT m.poster_time, IFNULL(mem.real_name, m.poster_name) AS poster_name FROM {db_prefix}messages AS m LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member) WHERE m.id_topic = {int:current_topic} ORDER BY m.id_msg LIMIT 1', array( 'current_topic' => $topic, ) ); // Redirect to the boardindex if no valid topic id is provided. if ($smcFunc['db_num_rows']($request) == 0) redirectexit(); $row = $smcFunc['db_fetch_assoc']($request); $smcFunc['db_free_result']($request); // Lets "output" all that info. loadTemplate('Printpage'); $context['template_layers'] = array('print'); $context['board_name'] = $board_info['name']; $context['category_name'] = $board_info['cat']['name']; $context['poster_name'] = $row['poster_name']; $context['post_time'] = timeformat($row['poster_time'], false); $context['parent_boards'] = array(); foreach ($board_info['parent_boards'] as $parent) $context['parent_boards'][] = $parent['name']; // Split the topics up so we can print them. $request = $smcFunc['db_query']('', ' SELECT subject, poster_time, body, IFNULL(mem.real_name, poster_name) AS poster_name FROM {db_prefix}messages AS m LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member) WHERE m.id_topic = {int:current_topic}' . ($modSettings['postmod_active'] && !allowedTo('approve_posts') ? ' AND (m.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR m.id_member = {int:current_member}') . ')' : '') . ' ORDER BY m.id_msg', array( 'current_topic' => $topic, 'is_approved' => 1, 'current_member' => $user_info['id'], ) ); $context['posts'] = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) { // Censor the subject and message. censorText($row['subject']); censorText($row['body']); $context['posts'][] = array( 'subject' => $row['subject'], 'member' => $row['poster_name'], 'time' => timeformat($row['poster_time'], false), 'timestamp' => forum_time(true, $row['poster_time']), 'body' => parse_bbc($row['body'], 'print'), ); if (!isset($context['topic_subject'])) $context['topic_subject'] = $row['subject']; } $smcFunc['db_free_result']($request); // Set a canonical URL for this page. $context['canonical_url'] = $scripturl . '?topic=' . $topic . '.0'; } ?>
[+]
..
[-] DbSearch-sqlite.php
[edit]
[-] ManagePosts.php
[edit]
[-] Subs-Db-sqlite.php
[edit]
[-] PostModeration.php
[edit]
[-] Subs-BoardIndex.php
[edit]
[-] Packages.php
[edit]
[-] ManageSmileys.php
[edit]
[-] Subs-Aeva-Generated-Sites.php
[edit]
[-] Poll.php
[edit]
[-] ModerationCenter.php
[edit]
[-] ManageSearch.php
[edit]
[-] MoveTopic.php
[edit]
[-] ManagePaid.php
[edit]
[-] Subs-Admin.php
[edit]
[-] Profile-View.php
[edit]
[-] LockTopic.php
[edit]
[-] RepairBoards.php
[edit]
[-] Post.php
[edit]
[-] Subs-Aeva-Sites.php
[edit]
[-] Subs-MessageIndex.php
[edit]
[-] DbPackages-sqlite.php
[edit]
[-] ManageScheduledTasks.php
[edit]
[+]
downloads
[-] Subs-Categories.php
[edit]
[-] DbExtra-sqlite.php
[edit]
[-] Subs-Menu.php
[edit]
[-] SearchAPI-Standard.php
[edit]
[-] Notify.php
[edit]
[-] Register.php
[edit]
[-] Subs-Compat.php
[edit]
[-] Who.php
[edit]
[-] ManageServer.php
[edit]
[-] PersonalMessage.php
[edit]
[-] Karma.php
[edit]
[-] DbExtra-mysql.php
[edit]
[-] Profile-Actions.php
[edit]
[-] DbSearch-postgresql.php
[edit]
[-] ManageSettings.php
[edit]
[-] ManageErrors.php
[edit]
[-] Modlog.php
[edit]
[-] Subs-Membergroups.php
[edit]
[-] ManageAttachments.php
[edit]
[-] Groups.php
[edit]
[-] Profile-Modify.php
[edit]
[-] SendTopic.php
[edit]
[-] Subs-SimpleColorizer.php
[edit]
[-] DbExtra-postgresql.php
[edit]
[-] Load.php
[edit]
[-] ManageCalendar.php
[edit]
[-] BoardIndex.php
[edit]
[-] Subs-Members.php
[edit]
[-] Subs-Post.php
[edit]
[-] Printpage.php
[edit]
[-] ManageBoards.php
[edit]
[-] RemoveTopic.php
[edit]
[-] index.php
[edit]
[-] Subs-Package.php
[edit]
[-] DumpDatabase.php
[edit]
[-] Themes.php
[edit]
[-] QueryString.php
[edit]
[-] ManageBans.php
[edit]
[-] Calendar.php
[edit]
[-] Subs-Db-postgresql.php
[edit]
[-] ManageRegistration.php
[edit]
[-] Stats.php
[edit]
[-] DbPackages-mysql.php
[edit]
[-] Subs-Calendar.php
[edit]
[-] Subs-Graphics.php
[edit]
[-] DbPackages-postgresql.php
[edit]
[-] Security.php
[edit]
[-] SplitTopics.php
[edit]
[-] SearchAPI-Custom.php
[edit]
[-] ScheduledTasks.php
[edit]
[-] Subs-Aeva.php
[edit]
[-] News.php
[edit]
[-] Subs-Aeva-Admin.php
[edit]
[-] Display.php
[edit]
[-] ManageMembers.php
[edit]
[-] Subs-Db-mysql.php
[edit]
[-] PackageGet.php
[edit]
[-] Class-Package.php
[edit]
[-] Subs-Charset.php
[edit]
[-] Xml.php
[edit]
[-] ManageMaintenance.php
[edit]
[-] Admin.php
[edit]
[-] Subs-OpenID.php
[edit]
[-] Search.php
[edit]
[-] Profile.php
[edit]
[-] Subs.php
[edit]
[-] Subs-Sound.php
[edit]
[-] Class-CurlFetchWeb.php
[edit]
[-] Reports.php
[edit]
[-] Subs-List.php
[edit]
[-] Subscriptions-PayPal.php
[edit]
[-] Subs-Aeva-Custom-Example.php
[edit]
[-] ManageNews.php
[edit]
[-] Memberlist.php
[edit]
[-] Subs-Recent.php
[edit]
[-] SearchAPI-Fulltext.php
[edit]
[-] Class-Graphics.php
[edit]
[-] MessageIndex.php
[edit]
[-] ViewQuery.php
[edit]
[-] ManageSearchEngines.php
[edit]
[-] ManageMail.php
[edit]
[-] DbSearch-mysql.php
[edit]
[-] Subs-MembersOnline.php
[edit]
[-] Help.php
[edit]
[-] Subs-Auth.php
[edit]
[-] passwdBoard.php
[edit]
[-] Subs-Boards.php
[edit]
[-] ManagePermissions.php
[edit]
[-] Reminder.php
[edit]
[-] Errors.php
[edit]
[-] LogInOut.php
[edit]
[-] Subs-Editor.php
[edit]
[-] Recent.php
[edit]
[-] ManageMembergroups.php
[edit]