mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Fixed some links, added 'Goto Page:' link in viewforum.
git-svn-id: file:///svn/phpbb/trunk@99 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f276636450
commit
b829bfa2a5
4 changed files with 66 additions and 37 deletions
|
@ -15,7 +15,7 @@
|
||||||
<!-- BEGIN topicrow -->
|
<!-- BEGIN topicrow -->
|
||||||
<tr bgcolor="#DDDDDD" class="tablebody">
|
<tr bgcolor="#DDDDDD" class="tablebody">
|
||||||
<td width="5%" align="center" valign="middle">{FOLDER}</td>
|
<td width="5%" align="center" valign="middle">{FOLDER}</td>
|
||||||
<td><a href="viewtopic.{PHPEX}?{POST_TOPIC_URL}={TOPIC_ID}&{REPLIES}">{TOPIC_TITLE}</a></td>
|
<td><a href="viewtopic.{PHPEX}?{POST_TOPIC_URL}={TOPIC_ID}&{REPLIES}">{TOPIC_TITLE}</a>{GOTO_PAGE}</td>
|
||||||
<td width="5%" align="center" valign="middle">{REPLIES}</td>
|
<td width="5%" align="center" valign="middle">{REPLIES}</td>
|
||||||
<td width="10%" align="center" valign="middle">{TOPIC_POSTER}</td>
|
<td width="10%" align="center" valign="middle">{TOPIC_POSTER}</td>
|
||||||
<td width="5%" align="center" valign="middle">{VIEWS}</td>
|
<td width="5%" align="center" valign="middle">{VIEWS}</td>
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
<td>
|
<td>
|
||||||
<table border="0" width="100%" cellpadding="3" cellspacing="1">
|
<table border="0" width="100%" cellpadding="3" cellspacing="1">
|
||||||
<tr><td wdith="90%" class="tablebody" bgcolor="#CCCCCC">This topic is {PAGES} long. {PAGINATION}</td>
|
<tr><td wdith="90%" class="tablebody" bgcolor="#CCCCCC">This topic is {PAGES} long. {PAGINATION}</td>
|
||||||
<td width="5%" class="tableheader" align="center"><a href="viewtopic.{PHPEX}?forum_id={FORUM_ID}&topic_id={TOPIC_ID}&view=older"><img src="images/prev.gif" alt="View previous topic" border="0"></a></td>
|
<td width="5%" class="tableheader" align="center"><a href="viewtopic.{PHPEX}?t={TOPIC_ID}&view=older"><img src="images/prev.gif" alt="View previous topic" border="0"></a></td>
|
||||||
<td width="5%" class="tableheader" align="center"><a href="viewtopic.{PHPEX}?forum_id={FORUM_ID}&topic_id={TOPIC_ID}&view=newer"><img src="images/next.gif" alt="View next topic" border="0"></a></td>
|
<td width="5%" class="tableheader" align="center"><a href="viewtopic.{PHPEX}?t={TOPIC_ID}&view=newer"><img src="images/next.gif" alt="View next topic" border="0"></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -103,16 +103,46 @@ if($total_topics)
|
||||||
$topic_title = stripslashes($topic_rowset[$x]["topic_title"]);
|
$topic_title = stripslashes($topic_rowset[$x]["topic_title"]);
|
||||||
$topic_id = $topic_rowset[$x]["topic_id"];
|
$topic_id = $topic_rowset[$x]["topic_id"];
|
||||||
$replies = $topic_rowset[$x]["topic_replies"];
|
$replies = $topic_rowset[$x]["topic_replies"];
|
||||||
|
if($replies > $posts_per_page)
|
||||||
|
{
|
||||||
|
$goto_page = " (<img src=\"images/posticon.gif\">$l_gotopage: ";
|
||||||
|
$times = 1;
|
||||||
|
for($i = 0; $i < ($replies + 1); $i += $posts_per_page)
|
||||||
|
{
|
||||||
|
if($times > 4)
|
||||||
|
{
|
||||||
|
if(($i + $posts_per_page) >= ($replies + 1))
|
||||||
|
{
|
||||||
|
$goto_page.=" ... <a href=\"viewtopic.$phpEx?".POST_TOPIC_URL."=".$topic_id."&start=$i\">$times</a>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if($times != 1)
|
||||||
|
{
|
||||||
|
$goto_page.= ", ";
|
||||||
|
}
|
||||||
|
$goto_page.= "<a href=\"viewtopic.$phpEx?".POST_TOPIC_URL."=".$topic_id."&start=$i\">$times</a>";
|
||||||
|
}
|
||||||
|
$times++;
|
||||||
|
}
|
||||||
|
$goto_page.= ")";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$goto_page = "";
|
||||||
|
}
|
||||||
$topic_poster = stripslashes($topic_rowset[$x]["username"]);
|
$topic_poster = stripslashes($topic_rowset[$x]["username"]);
|
||||||
$views = $topic_rowset[$x]["topic_views"];
|
$views = $topic_rowset[$x]["topic_views"];
|
||||||
$last_post_time = date($date_format, $topic_rowset[$x]["post_time"]);
|
$last_post_time = date($date_format, $topic_rowset[$x]["post_time"]);
|
||||||
$last_post_user = $topic_rowset[$x]["user2"];
|
$last_post_user = $topic_rowset[$x]["user2"];
|
||||||
$folder_img = "<img src=\"images/folder.gif\">";
|
$folder_img = "<img src=\"images/folder.gif\">";
|
||||||
$template->set_var(array("FORUM_ID" => $forum_id,
|
$template->set_var(array("FORUM_ID" => $forum_id,
|
||||||
"POST_TOPIC_URL" => POST_TOPIC_URL,
|
"POST_TOPIC_URL" => POST_TOPIC_URL,
|
||||||
"TOPIC_ID" => $topic_id,
|
"TOPIC_ID" => $topic_id,
|
||||||
"FOLDER" => $folder_img,
|
"FOLDER" => $folder_img,
|
||||||
"TOPIC_POSTER" => "<a href=\"profile.$phpEx?mode=viewprofile?user_id=".$topic_rowset[$x]["user_id"]."\">".$topic_poster."</a>",
|
"TOPIC_POSTER" => "<a href=\"profile.$phpEx?mode=viewprofile?user_id=".$topic_rowset[$x]["user_id"]."\">".$topic_poster."</a>",
|
||||||
|
"GOTO_PAGE" => $goto_page,
|
||||||
"REPLIES" => $replies,
|
"REPLIES" => $replies,
|
||||||
"TOPIC_TITLE" => $topic_title,
|
"TOPIC_TITLE" => $topic_title,
|
||||||
"VIEWS" => $views,
|
"VIEWS" => $views,
|
||||||
|
|
|
@ -23,9 +23,6 @@
|
||||||
include('extension.inc');
|
include('extension.inc');
|
||||||
include('common.'.$phpEx);
|
include('common.'.$phpEx);
|
||||||
|
|
||||||
$page_title = "View Topic - $topic_title";
|
|
||||||
$topic_title = stripslashes($topic_info[0]["topic_title"]);
|
|
||||||
|
|
||||||
if(!isset($HTTP_GET_VARS['topic'])) // For backward compatibility
|
if(!isset($HTTP_GET_VARS['topic'])) // For backward compatibility
|
||||||
{
|
{
|
||||||
$topic_id = $HTTP_GET_VARS[POST_TOPIC_URL];
|
$topic_id = $HTTP_GET_VARS[POST_TOPIC_URL];
|
||||||
|
@ -59,7 +56,7 @@ if(!$total_rows = $db->sql_numrows($result))
|
||||||
error_die($db, GENERAL_ERROR, "The forum you selected does not exist. Please go back and try again.");
|
error_die($db, GENERAL_ERROR, "The forum you selected does not exist. Please go back and try again.");
|
||||||
}
|
}
|
||||||
$forum_row = $db->sql_fetchrowset($result);
|
$forum_row = $db->sql_fetchrowset($result);
|
||||||
|
$topic_title = $forum_row[0]["topic_title"];
|
||||||
$forum_id = $forum_row[0]["forum_id"];
|
$forum_id = $forum_row[0]["forum_id"];
|
||||||
$forum_name = stripslashes($forum_row[0]["forum_name"]);
|
$forum_name = stripslashes($forum_row[0]["forum_name"]);
|
||||||
for($x = 0; $x < $total_rows; $x++)
|
for($x = 0; $x < $total_rows; $x++)
|
||||||
|
@ -76,7 +73,9 @@ for($x = 0; $x < $total_rows; $x++)
|
||||||
// Add checking for private forums here
|
// Add checking for private forums here
|
||||||
//
|
//
|
||||||
|
|
||||||
$total_replies = $topic_info[0]["topic_replies"] + 1;
|
$total_replies = $forum_row[0]["topic_replies"] + 1;
|
||||||
|
|
||||||
|
$page_title = "View Topic - $topic_title";
|
||||||
$pagetype = "viewtopic";
|
$pagetype = "viewtopic";
|
||||||
include('includes/page_header.'.$phpEx);
|
include('includes/page_header.'.$phpEx);
|
||||||
|
|
||||||
|
@ -171,30 +170,30 @@ for($x = 0; $x < $total_posts; $x++)
|
||||||
$message = eregi_replace("\[addsig]$", "<BR>_________________<BR>" . stripslashes($postrow[$x]["user_sig"]), $message);
|
$message = eregi_replace("\[addsig]$", "<BR>_________________<BR>" . stripslashes($postrow[$x]["user_sig"]), $message);
|
||||||
|
|
||||||
$template->set_var(array("TOPIC_TITLE" => $topic_title,
|
$template->set_var(array("TOPIC_TITLE" => $topic_title,
|
||||||
"L_POSTED" => $l_posted,
|
"L_POSTED" => $l_posted,
|
||||||
"L_JOINED" => $l_joined,
|
"L_JOINED" => $l_joined,
|
||||||
"POSTER_NAME" => $poster,
|
"POSTER_NAME" => $poster,
|
||||||
"POSTER_RANK" => $poster_rank,
|
"POSTER_RANK" => $poster_rank,
|
||||||
"RANK_IMAGE" => $rank_image,
|
"RANK_IMAGE" => $rank_image,
|
||||||
"ROW_COLOR" => $color,
|
"ROW_COLOR" => $color,
|
||||||
"POSTER_JOINED" => $poster_joined,
|
"POSTER_JOINED" => $poster_joined,
|
||||||
"POSTER_POSTS" => $poster_posts,
|
"POSTER_POSTS" => $poster_posts,
|
||||||
"POSTER_FROM" => $poster_from,
|
"POSTER_FROM" => $poster_from,
|
||||||
"POST_DATE" => $post_date,
|
"POST_DATE" => $post_date,
|
||||||
"MESSAGE" => $message,
|
"MESSAGE" => $message,
|
||||||
"PROFILE_IMG" => $profile_img,
|
"PROFILE_IMG" => $profile_img,
|
||||||
"EMAIL_IMG" => $email_img,
|
"EMAIL_IMG" => $email_img,
|
||||||
"WWW_IMG" => $www_img,
|
"WWW_IMG" => $www_img,
|
||||||
"ICQ_STATUS_IMG" => $icq_status_img,
|
"ICQ_STATUS_IMG" => $icq_status_img,
|
||||||
"ICQ_ADD_IMG" => $icq_add_img,
|
"ICQ_ADD_IMG" => $icq_add_img,
|
||||||
"AIM_IMG" => $aim_img,
|
"AIM_IMG" => $aim_img,
|
||||||
"MSN_IMG" => $msn_img,
|
"MSN_IMG" => $msn_img,
|
||||||
"YIM_IMG" => $yim_img,
|
"YIM_IMG" => $yim_img,
|
||||||
"EDIT_IMG" => $edit_img,
|
"EDIT_IMG" => $edit_img,
|
||||||
"QUOTE_IMG" => $quote_img,
|
"QUOTE_IMG" => $quote_img,
|
||||||
"PMSG_IMG" => $pmsg_img,
|
"PMSG_IMG" => $pmsg_img,
|
||||||
"IP_IMG" => $ip_img,
|
"IP_IMG" => $ip_img,
|
||||||
"DELPOST_IMG" => $delpost_img));
|
"DELPOST_IMG" => $delpost_img));
|
||||||
$template->parse("posts", "postrow", true);
|
$template->parse("posts", "postrow", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +212,7 @@ if($total_replies > $posts_per_page)
|
||||||
$last_page = $start - $posts_per_page;
|
$last_page = $start - $posts_per_page;
|
||||||
if($start > 0)
|
if($start > 0)
|
||||||
{
|
{
|
||||||
$pagination .= "<a href=\"$PHP_SELF?topic_id=$topic_id&forum_id=$forum_id&start=$last_page\">$l_prevpage</a> ";
|
$pagination .= "<a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&forum_id=$forum_id&start=$last_page\">$l_prevpage</a> ";
|
||||||
}
|
}
|
||||||
|
|
||||||
for($x = 0; $x < $total_replies; $x += $posts_per_page)
|
for($x = 0; $x < $total_replies; $x += $posts_per_page)
|
||||||
|
@ -232,7 +231,7 @@ if($total_replies > $posts_per_page)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pagination .= "<a href=\"$PHP_SELF?topic_id=$topic_id&forum_id=$forum_id&start=$x\">$times</a>";
|
$pagination .= "<a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&forum_id=$forum_id&start=$x\">$times</a>";
|
||||||
}
|
}
|
||||||
$times++;
|
$times++;
|
||||||
}
|
}
|
||||||
|
@ -240,7 +239,7 @@ if($total_replies > $posts_per_page)
|
||||||
if(($start + $posts_per_page) < $total_replies)
|
if(($start + $posts_per_page) < $total_replies)
|
||||||
{
|
{
|
||||||
$next_page = $start + $posts_per_page;
|
$next_page = $start + $posts_per_page;
|
||||||
$pagination .= " <a href=\"$PHP_SELF?topic_id=$topic_id&forum_id=$forum_id&start=$next_page\">$l_nextpage</a>";
|
$pagination .= " <a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&forum_id=$forum_id&start=$next_page\">$l_nextpage</a>";
|
||||||
}
|
}
|
||||||
$pagination .= " )";
|
$pagination .= " )";
|
||||||
}
|
}
|
||||||
|
@ -249,7 +248,7 @@ else
|
||||||
$pages = "1 page";
|
$pages = "1 page";
|
||||||
}
|
}
|
||||||
$template->set_var(array("PAGES" => $pages,
|
$template->set_var(array("PAGES" => $pages,
|
||||||
"PAGINATION" => $pagination));
|
"PAGINATION" => $pagination));
|
||||||
|
|
||||||
$template->pparse("output", array("posts", "body"));
|
$template->pparse("output", array("posts", "body"));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue