If I understand you correctly than adding "<!-- IF not (topicrow.S_TOPIC_TYPE_SWITCH and PREVIOUS_PAGE) -->" to the part of viewforum_body.html that displays announcements and topics should work.
If you scroll down to "BEGIN topicrow" in viewforum_body.html you should make it look something like this:
<!-- IF not topicrow.S_TOPIC_TYPE_SWITCH and not topicrow.S_FIRST_ROW --> </ul> <span class="corners-bottom"><span></span></span></div> </div> <!-- ENDIF -->
<!-- IF not (topicrow.S_TOPIC_TYPE_SWITCH and PREVIOUS_PAGE) -->
<!-- IF topicrow.S_FIRST_ROW or not topicrow.S_TOPIC_TYPE_SWITCH --> <div class="forumbg<!-- IF topicrow.S_TOPIC_TYPE_SWITCH --> announcement<!-- ENDIF -->"> <div class="inner"><span class="corners-top"><span></span></span> <ul class="topiclist"> <li class="header"> <dl class="icon"> <dt><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and topicrow.S_TOPIC_TYPE gt 1 -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></dt> <dd class="posts">{L_REPLIES}</dd> <dd class="views">{L_VIEWS}</dd> <dd class="lastpost"><span>{L_LAST_POST}</span></dd> </dl> </li> </ul> <ul class="topiclist topics"> <!-- ENDIF -->
<li class="row<!-- IF topicrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_POST_ANNOUNCE --> announce<!-- ENDIF --><!-- IF topicrow.S_POST_STICKY --> sticky<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->"> <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;"> <dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br /> <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF --> <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} </dt> <dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd> <dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd> <dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{topicrow.LAST_POST_TIME}</span> </dd> </dl> </li>
Konomios, Thank you for the tip. The "PREVIOUS_PAGE" in template IF statement is nice. But even the template showing announcements and normal topic together, the announcements showing up again in every page. Looks like viewforum.php dont count announcements in the $start var.
It won't do you any good to bump the topic within a minute of your last post. You need to allow at least 8 hours of time to pass before bumping; have to give people a chance to respond.
Ok, I've had another look at this and I'm pretty sure that what I posted should work. I took the normal, unmodified, prosilver style added in the "<!-- IF not (topicrow.S_TOPIC_TYPE_SWITCH and PREVIOUS_PAGE) -->" line and then I added the "<!-- ENDIF -->" line just before "<!-- BEGINELSE -->". Here is my entire viewforum_body.html:
<!-- INCLUDE overall_header.html --> <!-- IF U_MCP --><p>[ <a href="{U_MCP}">{L_MCP}</a> ]</p><!-- ENDIF --> <h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
<!-- IF FORUM_DESC or MODERATORS or U_MCP --> <p> <!-- NOTE: remove the style="display: none" when you want to have the forum description on the forum body --> <!-- IF FORUM_DESC --><span style="display: none">{FORUM_DESC}<br /></span><!-- ENDIF --> <!-- IF MODERATORS --><strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}<!-- ENDIF --> </p> <!-- ENDIF -->
<!-- IF S_FORUM_RULES --> <div class="rules"> <div class="inner"><span class="corners-top"><span></span></span>
<!-- IF S_HAS_SUBFORUM --> <!-- IF not S_IS_BOT and U_MARK_FORUMS --> <ul class="linklist"> <li class="rightside"><a href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a></li> </ul> <!-- ENDIF --> <!-- INCLUDE forumlist_body.html --> <!-- ENDIF -->
<!-- IF S_DISPLAY_POST_INFO or PAGINATION or TOTAL_POSTS or TOTAL_TOPICS --> <div class="topic-actions" <!-- IF S_HAS_SUBFORUM -->style="margin-top: 2em;"<!-- ENDIF -->>
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO --> <div class="buttons"> <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->"><a href="{U_POST_NEW_TOPIC}" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"><span></span><!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF --></a></div> </div> <!-- ENDIF -->
<!-- IF not topicrow.S_TOPIC_TYPE_SWITCH and not topicrow.S_FIRST_ROW and not PREVIOUS_PAGE --> </ul> <span class="corners-bottom"><span></span></span></div> </div> <!-- ENDIF -->
<!-- IF not (topicrow.S_TOPIC_TYPE_SWITCH and PREVIOUS_PAGE) --> <!-- IF topicrow.S_FIRST_ROW or not topicrow.S_TOPIC_TYPE_SWITCH --> <div class="forumbg<!-- IF topicrow.S_TOPIC_TYPE_SWITCH --> announcement<!-- ENDIF -->"> <div class="inner"><span class="corners-top"><span></span></span> <ul class="topiclist"> <li class="header"> <dl class="icon"> <dt><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and topicrow.S_TOPIC_TYPE gt 1 -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></dt> <dd class="posts">{L_REPLIES}</dd> <dd class="views">{L_VIEWS}</dd> <dd class="lastpost"><span>{L_LAST_POST}</span></dd> </dl> </li> </ul> <ul class="topiclist topics"> <!-- ENDIF -->
<li class="row<!-- IF topicrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_POST_ANNOUNCE --> announce<!-- ENDIF --><!-- IF topicrow.S_POST_STICKY --> sticky<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->"> <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;"> <dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF --> <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br /> <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF --> <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME} </dt> <dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd> <dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd> <dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{topicrow.LAST_POST_TIME}</span> </dd> </dl> </li>
<!-- IF S_SELECT_SORT_DAYS and not S_DISPLAY_ACTIVE --> <form method="post" action="{S_FORUM_ACTION}"> <fieldset class="display-options"> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <!-- IF not S_IS_BOT --> <label>{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label> <!-- ENDIF --> </fieldset> </form> <hr /> <!-- ENDIF -->
<!-- IF .topicrow and not S_DISPLAY_ACTIVE --> <div class="topic-actions"> <!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO --> <div class="buttons"> <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"><a href="{U_POST_NEW_TOPIC}"><span></span><!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF --></a></div> </div> <!-- ENDIF -->
<!-- IF PAGINATION or TOTAL_POSTS or TOTAL_TOPICS --> <div class="pagination"> <!-- IF TOTAL_TOPICS and not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> <!-- IF TOTAL_POSTS and not NEWEST_USER --> {TOTAL_POSTS}<!-- ELSEIF TOTAL_TOPICS and not NEWEST_USER --> {TOTAL_TOPICS}<!-- ENDIF --> <!-- IF TOTAL_USERS -->{TOTAL_USERS}<!-- ENDIF --> <!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --> </div> <!-- ENDIF --> </div> <!-- ENDIF -->
<!-- INCLUDE jumpbox.html -->
<!-- IF S_DISPLAY_ONLINE_LIST --> <h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3> <p>{LOGGED_IN_USER_LIST}</p> <!-- ENDIF -->
<!-- IF S_DISPLAY_POST_INFO --> <h3>{L_FORUM_PERMISSIONS}</h3> <p><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></p> <!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
It seems to work for me. When I go to page 2 the announcements (both global and local) disappear. Remember that you may have to refresh the template (go to ACP > Styles > Templates then click refresh for your style). If that isn't the problem then try making a new template using prosilver and copy all of the above code into viewforum_body.html and see if that works.
Konomios, Thanks for your help I try to use your code, the first page is ok, loading announces, stickies and normal topics, but the second page (and next ones) just display one topic.
Anyway, i try another approach editing only the viewtopic.php and leave templates files (viewtopic_body.html) as original. After alot of wrong results I found one "weird' solution for my request.
Removing ' . POST_ANNOUNCE . ', from SQL, the script will load only normal topics.
if ($forum_data['forum_type']== FORUM_POST) { // Add one IF to choose the proper SQL and hide announcements for the viewforum paginations if ($start > 0)// the request var of viewforum pages { $sql = $db->sql_build_query('SELECT', array( 'SELECT'=> $sql_array['SELECT'], 'FROM'=> $sql_array['FROM'], 'LEFT_JOIN'=> $sql_array['LEFT_JOIN'],
'WHERE'=>'t.forum_id IN ('. $forum_id .', 0) AND t.topic_type IN ('. POST_GLOBAL .')', 'ORDER_BY'=>'t.topic_time DESC', )); } else { // The original SQL to load and display announces when the user reading the first viewforum page // Obtain announcements ... removed sort ordering, sort by time in all cases $sql = $db->sql_build_query('SELECT', array( 'SELECT'=> $sql_array['SELECT'], 'FROM'=> $sql_array['FROM'], 'LEFT_JOIN'=> $sql_array['LEFT_JOIN'],
'WHERE'=>'t.forum_id IN ('. $forum_id .', 0) AND t.topic_type IN ('. POST_ANNOUNCE .', '. POST_GLOBAL .')',
if ($forum_data['forum_type']== FORUM_POST) { // Add one IF to choose the proper SQL and hide announcements for the viewforum paginations if ($start > 0)// the request var of viewforum pages { $sql = $db->sql_build_query('SELECT', array( 'SELECT'=> $sql_array['SELECT'], 'FROM'=> $sql_array['FROM'], 'LEFT_JOIN'=> $sql_array['LEFT_JOIN'],
'WHERE'=>'t.forum_id IN ('. $forum_id .', 0) AND t.topic_type IN ('. POST_GLOBAL .')', 'ORDER_BY'=>'t.topic_time DESC', )); } else { // The original SQL to load and display announces when the user reading the first viewforum page // Obtain announcements ... removed sort ordering, sort by time in all cases $sql = $db->sql_build_query('SELECT', array( 'SELECT'=> $sql_array['SELECT'], 'FROM'=> $sql_array['FROM'], 'LEFT_JOIN'=> $sql_array['LEFT_JOIN'],
'WHERE'=>'t.forum_id IN ('. $forum_id .', 0) AND t.topic_type IN ('. POST_ANNOUNCE .', '. POST_GLOBAL .')',