mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Got bored so added print topic output view
git-svn-id: file:///svn/phpbb/trunk@3071 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
70e6af55a8
commit
44af262312
4 changed files with 127 additions and 37 deletions
|
@ -217,6 +217,7 @@ $lang = array_merge($lang, array(
|
|||
'View_topic' => 'View topic',
|
||||
'Guest' => 'Guest',
|
||||
'POST_SUBJECT' => 'Post subject',
|
||||
'PRINT_TOPIC' => 'Printable version',
|
||||
'View_next_topic' => 'View next topic',
|
||||
'View_previous_topic' => 'View previous topic',
|
||||
'Submit_vote' => 'Submit Vote',
|
||||
|
|
|
@ -19,7 +19,12 @@
|
|||
|
||||
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
|
||||
<tr align="right">
|
||||
<td class="catHead" colspan="2" height="28"><span class="nav"><a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a> </span></td>
|
||||
<td class="catHead" colspan="2" height="28"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td><span class="nav"> <a class="nav" href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}">{L_PRINT_TOPIC}</a></span></td>
|
||||
<td align="right"><span class="nav"><a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a> </span></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<!-- IF S_HAS_POLL_OPTIONS -->
|
||||
<tr>
|
||||
|
@ -144,7 +149,7 @@
|
|||
|
||||
<table width="100%" cellspacing="2" border="0" align="center">
|
||||
<tr>
|
||||
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}<!-- IF S_SELECT_RATING --><br /><form method="post" action="{S_TOPIC_ACTION}">{L_RATE_TOPIC}: {S_SELECT_RATING} <input class="liteoption" type="submit" value="{L_GO}" name="sort" /></form><!-- ENDIF --></span></td>
|
||||
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}</span></td>
|
||||
<td align="right" valign="top" nowrap="nowrap"><!-- INCLUDE jumpbox.html --><span class="gensmall">{S_AUTH_LIST}<!-- IF S_TOPIC_MOD --><form method="post" action="{S_MOD_ACTION}">{L_QUICK_MOD}: {S_TOPIC_MOD} <input class="liteoption" type="submit" value="{L_GO}" /></form><!-- ENDIF --></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
111
phpBB/templates/subSilver/viewtopic_print.html
Normal file
111
phpBB/templates/subSilver/viewtopic_print.html
Normal file
|
@ -0,0 +1,111 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html dir="{S_CONTENT_DIRECTION}">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<title>{SITENAME} :: {PAGE_TITLE}</title>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {
|
||||
font-family: Verdana,serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
td {
|
||||
font-family: Verdana,serif;
|
||||
font-size: 10pt;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
.code, .quote {
|
||||
font-size: smaller;
|
||||
border: black solid 1px;
|
||||
}
|
||||
|
||||
.forum {
|
||||
font-family: Arial,Helvetica,sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 18pt;
|
||||
}
|
||||
|
||||
.topic {
|
||||
font-family: Arial,Helvetica,sans-serif;
|
||||
font-size: 14pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.gensmall {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
hr {
|
||||
color: #888888;
|
||||
height: 3px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
hr.sep {
|
||||
color: #AAAAAA;
|
||||
height: 1px;
|
||||
border-style: dashed;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" align="center"><span class="Forum">{SITENAME}</span><br /><span class="gensmall">{U_FORUM}</a></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="Topic">{TOPIC_TITLE}</span><br /><span class="gensmall">{U_TOPIC}</a></span></td>
|
||||
<td align="right" valign="bottom"><span class="gensmall">{PAGE_NUMBER}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- BEGIN postrow -->
|
||||
|
||||
<hr width="85%" />
|
||||
|
||||
<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td width="10%" nowrap="nowrap">{L_AUTHOR}: </td>
|
||||
<td><b>{postrow.POSTER_NAME}</b> [ {postrow.POST_DATE} ]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="10%" nowrap="nowrap">{L_POST_SUBJECT}: </td>
|
||||
<td><b>{postrow.POST_SUBJECT}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><hr class="sep" />{postrow.MESSAGE}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END postrow -->
|
||||
|
||||
<hr width="85%" />
|
||||
<!--
|
||||
We request you retain the full copyright notice below including the link to www.phpbb.com.
|
||||
This not only gives respect to the large amount of time given freely by the developers
|
||||
but also helps build interest, traffic and use of phpBB2. If you (honestly) cannot retain
|
||||
the full copyright we ask you at least leave in place the "Powered by phpBB {PHPBB_VERSION}"
|
||||
line, with phpBB linked to www.phpbb.com. If you refuse to include even this then support on
|
||||
our forums may be affected.
|
||||
|
||||
The phpBB Group : 2002
|
||||
// -->
|
||||
<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td><span class="gensmall">{PAGE_NUMBER}</span></td>
|
||||
<td align="right"><span class="gensmall">{S_TIMEZONE}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center"><span class="gensmall">Powered by phpBB {PHPBB_VERSION} © 2002 phpBB Group<br />http://www.phpbb.com/</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -42,7 +42,7 @@ $user->start();
|
|||
// Find topic id if user requested a newer or older topic
|
||||
if (isset($_GET['view']) && empty($post_id))
|
||||
{
|
||||
if ($_GET['view'] == 'newest')
|
||||
if ($_GET['view'] == 'newest' || $_GET['view'] == 'latest')
|
||||
{
|
||||
if ($user->session_id)
|
||||
{
|
||||
|
@ -95,38 +95,6 @@ if (isset($_GET['view']) && empty($post_id))
|
|||
}
|
||||
}
|
||||
|
||||
if ($user->data['user_id'] != ANONYMOUS)
|
||||
{
|
||||
if (isset($_POST['rating']))
|
||||
{
|
||||
$sql = "SELECT rating
|
||||
FROM " . TOPICS_RATINGS_TABLE . "
|
||||
WHERE topic_id = $topic_id
|
||||
AND user_id = " . $user->data['user_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$rating = ($row = $db->sql_fetchrow($result)) ? $row['rating'] : '';
|
||||
|
||||
if (empty($_POST['rating_value']) && $rating != '')
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_rating = intval($_POST['rating']);
|
||||
|
||||
$sql = ($rating != '') ? "UPDATE " . TOPICS_RATING_TABLE . " SET rating = $new_rating WHERE user_id = " . $user->data['user_id'] . " AND topic_id = $topic_id" : "INSERT INTO " . TOPICS_RATING_TABLE . " (topic_id, user_id, rating) VALUES ($topic_id, " . $user->data['user_id'] . ", $new_rating)";
|
||||
}
|
||||
}
|
||||
else if (isset($_POST['castvote']))
|
||||
{
|
||||
if (!isset($_POST['vote_id']))
|
||||
{
|
||||
trigger_error($user->lang['No_vote']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Look at this query ... perhaps a re-think? Perhaps store topic ids rather
|
||||
// than last/first post ids and have a redirect at the top of this page
|
||||
// for latest post, newest post for a given topic_id?
|
||||
|
@ -415,6 +383,8 @@ $template->assign_block_vars('navlinks', array(
|
|||
$forum_moderators = array();
|
||||
get_moderators($forum_moderators, $forum_id);
|
||||
|
||||
$server_path = (($config['cookie_secure']) ? 'https://' : 'http://' ) . trim($config['server_name']) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/') . trim($config['script_path']) . '/';
|
||||
|
||||
// Send vars to template
|
||||
$template->assign_vars(array(
|
||||
'FORUM_ID' => $forum_id,
|
||||
|
@ -423,7 +393,7 @@ $template->assign_vars(array(
|
|||
'TOPIC_ID' => $topic_id,
|
||||
'TOPIC_TITLE' => $topic_title,
|
||||
'PAGINATION' => $pagination,
|
||||
'PAGE_NUMBER' => sprintf($user->lang['Page_of'], (floor($start / $config['posts_per_page']) + 1), ceil($topic_replies / $config['posts_per_page'])),
|
||||
'PAGE_NUMBER' => on_page($topic_replies, $config['posts_per_page'], $start),
|
||||
'MOD_CP' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? sprintf($user->lang['MCP'], '<a href="modcp.' . $phpEx . $SID . '&f=' . $forum_id . '">', '</a>') : '',
|
||||
'MODERATORS' => (sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : $user->lang['None'],
|
||||
|
||||
|
@ -460,9 +430,12 @@ $template->assign_vars(array(
|
|||
'S_WATCH_TOPIC' => $s_watching_topic,
|
||||
|
||||
'U_VIEW_TOPIC' => "viewtopic.$phpEx$SID&t=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=" . $_GET['highlight'],
|
||||
'U_TOPIC' => $server_path . 'viewtopic.' . $phpEx . '?t=' . $topic_id,
|
||||
'U_FORUM' => $server_path,
|
||||
'U_VIEW_FORUM' => $view_forum_url,
|
||||
'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url,
|
||||
'U_VIEW_NEWER_TOPIC' => $view_next_topic_url,
|
||||
'U_PRINT_TOPIC' => "viewtopic.$phpEx$SID&t=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=" . $_GET['highlight'] . "&view=print",
|
||||
'U_POST_NEW_TOPIC' => $new_topic_url,
|
||||
'U_POST_REPLY_TOPIC' => $reply_topic_url)
|
||||
);
|
||||
|
@ -926,7 +899,7 @@ $page_title = $user->lang['View_topic'] .' - ' . $topic_title;
|
|||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'viewtopic_body.html')
|
||||
'body' => (isset($_GET['view']) && $_GET['view'] == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html')
|
||||
);
|
||||
make_jumpbox('viewforum.'.$phpEx, $forum_id);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue