?
Path : /home/admin/domains/happytokorea.com/public_html_bk/happyezystyle/board/Sources/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/happyezystyle/board/Sources/Printpage.php |
<?php /********************************************************************************** * Printpage.php * *********************************************************************************** * SMF: Simple Machines Forum * * Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) * * =============================================================================== * * Software Version: SMF 2.0 RC1 * * Software by: Simple Machines (http://www.simplemachines.org) * * Copyright 2006-2009 by: Simple Machines LLC (http://www.simplemachines.org) * * 2001-2006 by: Lewis Media (http://www.lewismedia.com) * * Support, News, Updates at: http://www.simplemachines.org * *********************************************************************************** * This program is free software; you may redistribute it and/or modify it under * * the terms of the provided license as published by Simple Machines LLC. * * * * This program is distributed in the hope that it is and will be useful, but * * WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY * * or FITNESS FOR A PARTICULAR PURPOSE. * * * * See the "license.txt" file for details of the Simple Machines license. * * The latest version can always be found at http://www.simplemachines.org. * **********************************************************************************/ 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; global $board_info, $smcFunc; if (empty($topic)) fatal_lang_error('not_a_topic', false); // 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, ) ); if ($smcFunc['db_num_rows']($request) == 0) fatal_lang_error('no_board'); $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} ORDER BY m.id_msg', array( 'current_topic' => $topic, ) ); $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); } ?>