First post on every page

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
ottom
Registered User
Posts: 30
Joined: Thu Apr 30, 2009 3:10 pm

Re: First post on every page

Post by ottom »

Thanks for the advise. If you know that it is there it is easier to find it. ...I haven't noticed the separate xml with template changing instructions (wrongly assuming that the checkboxes are stored in an array somehow, thus the absence of template changing instructions looked plausible to me). Never mind :lol:

Anyway, yet another new problem occurred since the checkbox is now visible: no matter what the state of it is, it takes only the default value specified in the code (first mod line in posting.php).

Discouraged by the previous thing to ask, I decided to take the challenge and to solve the problem myself. I have checked two times that all changed have been done as instructed in the mod-xml. Watching the values I have found out that the following fix helps in my case:

Code: Select all

FIND
$lock_post_checked	= (isset($post_lock)) ? $post_lock : $post_data['post_edit_locked'];

ADD AFTER
// $first_post_show_checked = (isset($post_data['topic_first_post_show'])) ? $post_data['topic_first_post_show'] : 0; // MOD: First post on every page

CHANGED TO
$first_post_show_checked = (isset($topic_first_post_show)) ? $topic_first_post_show : $post_data['topic_first_post_show']; // MOD: First post on every page
Is this a known issue that have been already reported? (Or is something messed up in my code?)
ottom
Registered User
Posts: 30
Joined: Thu Apr 30, 2009 3:10 pm

Re: First post on every page

Post by ottom »

Now, having invested more time in understanding the code I assume that this is an actual bug:

Source of $topic_first_post_show is $_POST

Source of $post_data['topic_first_post_show'] is the SQL-Table (or the initial value spec. in the code)

When we use the preview function, the code for updating the TOPICS_TABLE is not executed. The code mentioned in the previous post concerns the stats of the checkbox in the form, which is lost when using the preview function:

Original code:
$first_post_show_checked = (isset($post_data['topic_first_post_show'])) ? $post_data['topic_first_post_show'] : 0;
...does not regard the data transmitted in $_POST at all.

Improvement suggestion:
$first_post_show_checked = (isset($topic_first_post_show)) ? $topic_first_post_show : $post_data['topic_first_post_show'];
...this way we do regard the $_POST contents, since we do not save the data in the preview mode ($post_data['topic_first_post_show']) still holds the old value)

May you please validate my inquiries?
Thanks for your time and the mod, since it is a great start to understanding the code of posting.php.
rxu
Extensions Development Team
Posts: 3473
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: First post on every page

Post by rxu »

ottom
Thanks for your investigation. Actually, I never tested this MOD in preview mode accidentally.
I'll try to test your suggestion when get some spare time for this :)
User avatar
ThunderCrew
Registered User
Posts: 1438
Joined: Sat Jun 30, 2007 6:26 pm
Location: Ill, Usa
Contact:

Re: First post on every page

Post by ThunderCrew »

Hello I like this mod used it for a while now and just installed it on phpbb 3.0.5.
I am sure it has been discussed but if not here is what I had to do via instructions for posting.php

Find

// If the post need approval we will wait a lot longer.

the above is not in posting.php but I found this by searching for approval and this was the only area with approval so I used it as my placment and it works properly so here it is....

posting.php find

Code: Select all

// Check the permissions for post approval, as well as the queue trigger where users are put on approval with a post count lower than specified. Moderators are not affected.
then do the add before paste.

Sorry if it's been talked about already just thought id show what I had to do if it hadn't so far.
Ugg im a t0tal newb again ...... 2 years off cant remember jack ... time to get to it
rxu
Extensions Development Team
Posts: 3473
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: First post on every page

Post by rxu »

ThunderCrew
Thank you, this workaround is ok for phpBB ver.3.0.3 and higher.
seducerx
Registered User
Posts: 64
Joined: Thu May 14, 2009 7:00 am

Re: First post on every page

Post by seducerx »

I want to install this mod on my phpbb forum, which is a version 3.0.4.

In the very first post of this page, where one can download the mod, are all the necessary changes needed for this mod to run properly in phpbb version 3.0.4 or maybe even 3.0.5, already included in the installation folder of this mod? Because you guys seem to be talking about some file edits not included in the installation folder of the original mod download in this 12th page.

If the necessary changes are not included yet, what are the changes we need to make in addition to that already described in the installation folder that comes along with downloading this mod?

Thank you in advance for this great mod, and hope I get a prompt response as soon as possible.
Wanna get the woman that you want?

Join us at www.attraxionarts.com
rxu
Extensions Development Team
Posts: 3473
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: First post on every page

Post by rxu »

ver.1.2.2 is not edited to be installed on phpBB 3.0.5.
Please< read this post above.
mykee
Registered User
Posts: 271
Joined: Thu Jun 07, 2007 9:46 pm

Re: First post on every page

Post by mykee »

rxu wrote:
mykee wrote:I installed Post numbers 1.1.0c mod
Try this:

Code: Select all

OPEN
viewtopic.php

FIND
	$post_number = $i + $start;
	$post_number = $post_number + 1;
	$post_id = $postrow[$i]['post_id'];

REPLACE WITH
/**/

FIND
	$poster_id = $row['user_id'];

AFTER, ADD
	$post_id = $row['post_id']; 
	if ($topic_data['topic_first_post_show'] && ($start != 0)) 
	{ 
		$post_number = ($post_id == $topic_data['topic_first_post_id']) ? 1 : ($i + $start); 
	} 
	else 
	{ 
		$post_number = ($i + $start + 1); 
	}
I use this fix, but if user sort descending, post numbers not corrects, but ID is correct. :( How can I fix it? Have you a tip? :roll:
heinrich_k
Registered User
Posts: 221
Joined: Fri Jul 17, 2009 11:40 am

Re: First post on every page

Post by heinrich_k »

Is there a AutoMod compatible version for 3.0.5 ?
Or any adaption for 3.0.5 ?

Would be nice.
navin
Registered User
Posts: 6
Joined: Sat Jul 18, 2009 6:50 pm

Re: First post on every page

Post by navin »

Hi,
I managed to add and and get this working on my forum. (me so happy for that)

Still I'd love one more thing to do: I want to add a text that says "Original post" and right below you'll have the first post on page 2, or page 3 etc, leaving a space, let's say 20px in height, between the first post and the first post of the next page.

Do you get what I mean?

On page 1, it should all look normal. On page 2, you have the first post on the top, and right after that you have the first post of the second page. But I want to add text or color or space, to make it clear that the first post is from page 1, so it's clear to everyone that it's the starting post.

Now I don't exactly know which files to edit. I'd love to know that.

Thanks a lot.

If it's not clear what I mean, I can add screenshots.
rxu
Extensions Development Team
Posts: 3473
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: First post on every page

Post by rxu »

navin
I'm not sure, but perhaps this is the story you need ;)
navin
Registered User
Posts: 6
Joined: Sat Jul 18, 2009 6:50 pm

Re: First post on every page

Post by navin »

rxu wrote:
issjut wrote:Do you see a simple way to realize it now? Currently it's really difficult to differ the first Post from the others. This confused my users
Try the following code:

Code: Select all

OPEN
viewtopic.php

FIND
	'U_TOPIC'				=> "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id",

AFTER, ADD
	'S_TOPIC_FIRST_POST_SHOW'	=> ($topic_data['topic_first_post_show'] == 1) ? true : false,

OPEN
styles/prosilver/template/viewtopic_body.html

FIND
	<div id="p{postrow.POST_ID}" class="post

IN-LINE FIND
<!-- IF postrow.S_ROW_COUNT is odd -->

IN_LINE REPLACE
<!-- IF S_TOPIC_FIRST_POST_SHOW and postrow.S_ROW_COUNT eq 0 -->bg3<!-- ELSEIF postrow.S_ROW_COUNT is odd -->

FIND
	<hr class="divider" />

AFTER, ADD
	<!-- IF S_TOPIC_FIRST_POST_SHOW and postrow.S_ROW_COUNT eq 0 --><br /><br /><!-- ENDIF -->

OPEN
styles/subsilver/template/viewtopic_body.html

FIND
	<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->

REPLACE WITH
	<!-- IF S_TOPIC_FIRST_POST_SHOW and postrow.S_ROW_COUNT eq 0 --><tr class="row3"><!-- ELSEIF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->

FIND
	<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->

REPLACE WITH
	<!-- IF S_TOPIC_FIRST_POST_SHOW and postrow.S_ROW_COUNT eq 0 --><tr class="row3"><!-- ELSEIF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->

FIND
	<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->

REPLACE WITH
	<!-- IF S_TOPIC_FIRST_POST_SHOW and postrow.S_ROW_COUNT eq 0 --><tr class="row3"><!-- ELSEIF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->

FIND
<!-- END postrow -->

BEFORE, ADD
	<!-- IF S_TOPIC_FIRST_POST_SHOW and postrow.S_ROW_COUNT eq 0 --><br /><br /><!-- ENDIF -->
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
But I guess this is suitable for default posts sorting option only.
This was kinda the post I was looking for, however, I'm using a different template, called ca_black.
If I apply the changes in prosilver and subsilver, will it have effect on my theme?

I did the changes I could find in my ca_black theme, not all are there, but I don't see the changes online.

I can't find

Code: Select all

<!-- IF postrow.S_ROW_COUNT is odd -->
And also

Code: Select all

<hr class="divider" />
Below you can see the source code of my viewtopic_body.html

Code: Select all

<!-- INCLUDE overall_header.html -->
<!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
<h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
<!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body -->
<!-- IF FORUM_DESC --><p class="forum-desc" style="display: none;">{FORUM_DESC}</p><!-- ENDIF -->

<!-- IF MODERATORS or U_MCP -->
	<p>
		<!-- 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">
		{$CA_BLOCK_START}

		<!-- IF U_FORUM_RULES -->
			<a href="{U_FORUM_RULES}">{L_FORUM_RULES}</a>
		<!-- ELSE -->
			<strong>{L_FORUM_RULES}</strong><br />
			{FORUM_RULES}
		<!-- ENDIF -->

		{$CA_BLOCK_END}
	</div>
<!-- ENDIF -->

<div class="topic-actions">

	<div class="buttons">
	<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
		<div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->"><span></span><!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED_SHORT}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF --></a></div>
	<!-- ENDIF -->
	</div>

	<!-- IF S_DISPLAY_SEARCHBOX -->
		<div class="search-box">
			<form method="post" id="topic-search" action="{S_SEARCHBOX_ACTION}">
			<fieldset>
				<input class="inputbox search tiny"  type="text" name="keywords" id="search_keywords" size="20" value="{L_SEARCH_TOPIC}" onclick="if(this.value=='{LA_SEARCH_TOPIC}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_TOPIC}';" />
				<input class="button2" type="submit" value="{L_SEARCH}" />
				<input type="hidden" value="{TOPIC_ID}" name="t" />
				<input type="hidden" value="msgonly" name="sf" />
			</fieldset>
			</form>
		</div>
	<!-- ENDIF -->

	<!-- IF PAGINATION or TOTAL_POSTS -->
		<div class="pagination">
			<!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a> &bull; <!-- ENDIF -->{TOTAL_POSTS}
			<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
		</div>
	<!-- ENDIF -->

</div>
<div class="clear"></div>

<!-- IF S_HAS_POLL -->
	<form method="post" action="{S_POLL_ACTION}">

	<div class="panel" id="poll">
		{$CA_BLOCK_START}

		<div class="content">
			<p class="author">{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE -->{L_MAX_VOTES}<!-- ENDIF --></p>
			<h2>{POLL_QUESTION}</h2>

			<fieldset class="polls">
			<!-- BEGIN poll_option -->
				<dl class="poll-row<!-- IF poll_option.POLL_OPTION_VOTED --> voted<!-- ENDIF --><!-- IF poll_option.S_FIRST_ROW --> poll-first<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF -->>
					<dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt>
					<!-- IF S_CAN_VOTE --><dd style="width: auto;"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
					<!-- IF S_DISPLAY_RESULTS --><dd class="resultbar"><div class="pollbar" style="width:{poll_option.POLL_OPTION_PERCENT};">{poll_option.POLL_OPTION_RESULT}</div></dd>
					<dd><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd><!-- ENDIF -->
				</dl>
			<!-- END poll_option -->

			<!-- IF S_DISPLAY_RESULTS -->
				<dl class="poll-last">
					<dt>&nbsp;</dt>
					<dd class="resultbar">{L_TOTAL_VOTES} : {TOTAL_VOTES}</dd>
				</dl>
			<!-- ENDIF -->

			<!-- IF S_CAN_VOTE -->
				<dl class="poll-last">
					<dt>&nbsp;</dt>
					<dd class="resultbar"><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="button1" /></dd>
				</dl>
			<!-- ENDIF -->

			<!-- IF not S_DISPLAY_RESULTS -->
				<dl class="poll-last">
					<dt>&nbsp;</dt>
					<dd class="resultbar"><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></dd>
				</dl>
			<!-- ENDIF -->
			</fieldset>
		</div>

		{$CA_BLOCK_END}
		{S_FORM_TOKEN}
		{S_HIDDEN_FIELDS}
	</div>


	</form>
<!-- ENDIF -->

<!-- BEGIN postrow -->
	<!-- IF postrow.S_FIRST_UNREAD --><a id="unread"></a><!-- ENDIF -->
	<div id="p{postrow.POST_ID}" class="post<!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_IGNORE_POST --> online<!-- ENDIF -->">
		<!-- IF postrow.S_ROW_COUNT == 0 -->{$CA_POST_FIRST_START}<!-- ELSE -->{$CA_POST_START}<!-- ENDIF -->
		
		<!-- IF not postrow.S_IGNORE_POST -->
		<!-- DEFINE $CA_POPUP = '0' -->
		<!-- IF not S_IS_BOT -->
		    <!-- IF postrow.U_PM or postrow.U_EMAIL or postrow.U_WWW or postrow.U_MSN or postrow.U_ICQ or postrow.U_YIM or postrow.U_AIM or postrow.U_JABBER -->
		        <!-- DEFINE $CA_POPUP = '1' -->
            <!-- ENDIF -->
        <!-- ENDIF -->
        <div id="maximize{postrow.S_ROW_COUNT}" class="post-maximize" style="display: none;">
            <a href="javascript:void(0);" onclick="ca_post_maximize_all(); return false;"><span>>></span></a>
        </div>
        <div id="profilediv{postrow.S_ROW_COUNT}">
        {$CA_POST_PROFILE_START}
        <div class="postprofile" id="profile{postrow.S_ROW_COUNT}">
            <div id="minimize{postrow.S_ROW_COUNT}" class="post-minimize">
                <a href="javascript:void(0);" onclick="ca_post_minimize_all(); return false;"><span><<</span></a>
            </div>
            <div class="profile-top">
                <p class="profile-author">
                    <a class="profile-link" id="link{postrow.S_ROW_COUNT}" href="<!-- IF postrow.U_POST_AUTHOR -->{postrow.U_POST_AUTHOR}<!-- ELSE -->javascript:void(0);<!-- ENDIF -->"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR};"<!-- ENDIF -->>{postrow.POST_AUTHOR}</a>
                </p>
                <!-- IF $CA_POPUP -->
                    <div id="popup{postrow.S_ROW_COUNT}" class="profile-buttons">
                        <ul>
                            <li><a href="{postrow.U_POST_AUTHOR}">{L_READ_PROFILE}</a></li>
                            <!-- IF postrow.U_PM --><li class="pm-icon"><a href="{postrow.U_PM}" title="{L_PRIVATE_MESSAGE}"><span>{L_PRIVATE_MESSAGE}</span></a></li><!-- ENDIF -->
                            <!-- IF postrow.U_EMAIL --><li class="email-icon"><a href="{postrow.U_EMAIL}" title="{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}"><span>{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}</span></a></li><!-- ENDIF -->
                            <!-- IF postrow.U_WWW --><li class="web-icon"><a href="{postrow.U_WWW}" title="{L_VISIT_WEBSITE}: {postrow.U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF -->
                            <!-- IF postrow.U_MSN --><li class="msnm-icon"><a href="{postrow.U_MSN}" onclick="popup(this.href, 550, 320); return false;" title="{L_MSNM}"><span>{L_MSNM}</span></a></li><!-- ENDIF -->
                            <!-- IF postrow.U_ICQ --><li class="icq-icon"><a href="{postrow.U_ICQ}" onclick="popup(this.href, 550, 320); return false;" title="{L_ICQ}"><span>{L_ICQ}</span></a></li><!-- ENDIF -->
                            <!-- IF postrow.U_YIM --><li class="yahoo-icon"><a href="{postrow.U_YIM}" onclick="popup(this.href, 780, 550); return false;" title="{L_YIM}"><span>{L_YIM}</span></a></li><!-- ENDIF -->
                            <!-- IF postrow.U_AIM --><li class="aim-icon"><a href="{postrow.U_AIM}" onclick="popup(this.href, 550, 320); return false;" title="{L_AIM}"><span>{L_AIM}</span></a></li><!-- ENDIF -->
                            <!-- IF postrow.U_JABBER --><li class="jabber-icon"><a href="{postrow.U_JABBER}" onclick="popup(this.href, 550, 320); return false;" title="{L_JABBER}"><span>{L_JABBER}</span></a></li><!-- ENDIF -->
                        </ul>
                    </div>
                <!-- ENDIF -->
                <script type="text/javascript">
                // <![CDATA[
                    ca_popup_register('{postrow.S_ROW_COUNT}');
                // ]]>
                </script>
            </div>
            <!-- IF postrow.POSTER_AVATAR -->
            <div class="profile-avatar">
                {postrow.POSTER_AVATAR}
            </div>    
            <!-- ENDIF -->

			<!-- IF postrow.RANK_TITLE or postrow.RANK_IMG -->
			    <p class="profile-rank">
			        {postrow.RANK_TITLE}
			        <!-- IF postrow.RANK_TITLE and postrow.RANK_IMG --><br /><!-- ENDIF -->
			        {postrow.RANK_IMG}
			    </p>
            <!-- ENDIF -->

            <div class="profile-details">
                <!-- IF postrow.POSTER_POSTS != '' --><p><strong>{L_POSTS}:</strong> {postrow.POSTER_POSTS}</p><!-- ENDIF -->
                <!-- IF postrow.POSTER_JOINED --><p><strong>{L_JOINED}:</strong> {postrow.POSTER_JOINED}</p><!-- ENDIF -->
                <!-- IF postrow.POSTER_FROM --><p><strong>{L_LOCATION}:</strong> {postrow.POSTER_FROM}</p><!-- ENDIF -->
                <!-- IF postrow.S_PROFILE_FIELD1 -->
                    <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
                    <p><strong>{postrow.PROFILE_FIELD1_NAME}:</strong> {postrow.PROFILE_FIELD1_VALUE}</p>
                <!-- ENDIF -->
                <!-- BEGIN custom_fields -->
                    <p><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</p>
                <!-- END custom_fields -->
            </div>
		</div>
		{$CA_POST_PROFILE_END}
		</div>
		<!-- ELSE -->
		{$CA_POST_PROFILE_EMPTY}
    	<!-- ENDIF -->

        {$CA_POST_TEXT_START}
		<div class="postbody" id="body{postrow.S_ROW_COUNT}">
		    <div class="post-content">
			<!-- IF postrow.S_IGNORE_POST -->
				<div class="ignore">{postrow.L_IGNORE_POST}</div>
			<!-- ELSE -->

			<p class="author"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --> {postrow.POST_DATE} <!-- IF postrow.POST_AUTHOR_FULL --><span id="author{postrow.S_ROW_COUNT}" style="display: none;">{L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL}</span><!-- ENDIF --></p>

			<h3<!-- IF postrow.S_FIRST_ROW --> class="first"<!-- ENDIF -->><!-- IF postrow.POST_ICON_IMG --><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" /> <!-- ENDIF --><a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></h3>

			<!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
				<p class="rules">
					<!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><!-- ENDIF -->
					<!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
				</p>
			<!-- ENDIF -->

			<div class="content">{postrow.MESSAGE}</div>

			<!-- IF postrow.S_HAS_ATTACHMENTS -->
			    <div class="ca-bbcode"><div class="ca-bbcode2 ca-attachment">
				<dl class="attachbox">
					<dt>{L_ATTACHMENTS}</dt>
					<!-- BEGIN attachment -->
						<dd>{postrow.attachment.DISPLAY_ATTACHMENT}</dd>
					<!-- END attachment -->
				</dl>
				</div></div>
			<!-- ENDIF -->

			<!-- IF postrow.S_DISPLAY_NOTICE --><div class="rules">{L_DOWNLOAD_NOTICE}</div><!-- ENDIF -->
			<!-- IF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
				<div class="notice">{postrow.EDITED_MESSAGE}
					<!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}:</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF -->
				</div>
			<!-- ENDIF -->

			<!-- IF postrow.BUMPED_MESSAGE --><div class="notice">{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
			<!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF -->
            <!-- ENDIF -->
            </div>

		<!-- IF not S_IS_BOT -->
            <ul class="profile-icons">
        		<li class="top-icon"><a href="#top" class="top" title="{L_BACK_TO_TOP}"><span>{L_BACK_TO_TOP}</span></a></li>
                <!-- IF postrow.U_DELETE --><li class="delete-icon"><a href="{postrow.U_DELETE}" title="{L_DELETE_POST}"><span>{L_DELETE_POST}</span></a></li><!-- ENDIF -->
                <!-- IF postrow.U_REPORT --><li class="report-icon"><a href="{postrow.U_REPORT}" title="{L_REPORT_POST}"><span>{L_REPORT_POST}</span></a></li><!-- ENDIF -->
                <!-- IF postrow.U_WARN --><li class="warn-icon"><a href="{postrow.U_WARN}" title="{L_WARN_USER}"><span>{L_WARN_USER}</span></a></li><!-- ENDIF -->
                <!-- IF postrow.U_INFO --><li class="info-icon"><a href="{postrow.U_INFO}" title="{L_INFORMATION}"><span>{L_INFORMATION}</span></a></li><!-- ENDIF -->
                <!-- IF postrow.U_QUOTE --><li class="quote-icon"><a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}"><span>{L_REPLY_WITH_QUOTE}</span></a></li><!-- ENDIF -->
                <!-- IF postrow.U_EDIT --><li class="edit-icon"><a href="{postrow.U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li><!-- ENDIF -->
            </ul>
		<!-- ENDIF -->

            <div class="clear"></div>
		</div>

        {$CA_POST_TEXT_END}

		{$CA_POST_END}
	</div>

<!-- END postrow -->

<!-- IF S_NUM_POSTS > 1 or PREVIOUS_PAGE -->
	<form id="viewtopic" method="post" action="{S_TOPIC_ACTION}">

	<fieldset class="display-options" style="margin-top: 0; ">
		<!-- 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_POSTS}: {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 -->

<div class="topic-actions">
	<div class="buttons">
	<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
		<div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->"><span></span><!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED_SHORT}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF --></a></div>
	<!-- ENDIF -->
	</div>

	<!-- IF PAGINATION or TOTAL_POSTS -->
		<div class="pagination">
			{TOTAL_POSTS}
			<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
		</div>
	<!-- ENDIF -->
</div>

<!-- INCLUDE jumpbox.html -->

<!-- IF S_TOPIC_MOD -->
	<form method="post" action="{S_MOD_ACTION}">
	<fieldset class="quickmod">
		<label for="quick-mod-select">{L_QUICK_MOD}:</label> {S_TOPIC_MOD} <input type="submit" value="{L_GO}" class="button2" />
		{S_FORM_TOKEN}
	</fieldset>
	</form>
<!-- ENDIF -->

<!-- IF S_DISPLAY_ONLINE_LIST -->
    {$CA_PANEL_START}
	<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>
	{$CA_PANEL_END}
<!-- ENDIF -->

<!-- INCLUDE overall_footer.html -->
Any help, is much appreciated.
rxu
Extensions Development Team
Posts: 3473
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: First post on every page

Post by rxu »

Didn't test it, but to make additional distance try this (don't forget to backup the file before and purge the cache/refresh template after):

Code: Select all

OPEN
styles/ca_black/template/viewtopic_body.html

FIND
<!-- END postrow -->

BEFORE, ADD
   <!-- IF S_TOPIC_FIRST_POST_SHOW and postrow.S_ROW_COUNT == 0 --><br /><br /><!-- ENDIF -->
navin
Registered User
Posts: 6
Joined: Sat Jul 18, 2009 6:50 pm

Re: First post on every page

Post by navin »

I tried it, I'm getting:

Code: Select all

Parse error: syntax error, unexpected $end in /home/onlin196/public_html/phpbbtest/includes/template.php(187) : eval()'d code on line 244
rxu
Extensions Development Team
Posts: 3473
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: First post on every page

Post by rxu »

Fix the bug with wrong post edition information when the mod is switched on for a topic.

Code: Select all

OPEN
viewtopic.php

FIND
// First post on every page
// Show first post on every page if needed
if($topic_data['topic_first_post_show'] && ( $start != 0))
{
	$i = 0;
	$post_list[$i] = $topic_data['topic_first_post_id'] ;
	$i = ($store_reverse) ? $sql_limit : $i+1;
}

REPLACE WITH
// First post on every page
// Show first post on every page if needed
// For the case the user is trying to reach the first half of the topic
if ($topic_data['topic_first_post_show'] && ($start != 0))
{
	if (!$store_reverse)
	{
		$post_list[$i] = $topic_data['topic_first_post_id'];
	}
	$i++;
}

FIND
while ($row = $db->sql_fetchrow($result))
{
	$post_list[$i] = $row['post_id'];
	($store_reverse) ? $i-- : $i++;
}
$db->sql_freeresult($result);

AFTER, ADD
// First post on every page
// Show first post on every page if needed
// For the case the user is trying to reach the second half of the topic
if ($topic_data['topic_first_post_show'] && ($start != 0) && $store_reverse)
{
	$post_list[$i] = $topic_data['topic_first_post_id'];
}
Locked

Return to “[3.0.x] MOD Database Releases”