[RFC|Rejected] Add New Post to postrow array

These RFCs were either rejected or have been replaced by an alternative proposal. They will not be included in phpBB.
Post Reply
User avatar
jsebean
Registered User
Posts: 165
Joined: Wed Nov 17, 2010 1:40 am
Location: Atlantic Canada

[RFC|Rejected] Add New Post to postrow array

Post by jsebean »

I am working on a new forum and wanted to style the first post differently in the theme. Sadly, there is no way I can use

Code: Select all

<!-- IF postrow.S_FIRST_POST -->
, the solution I did was add this line of code to viewtopic.php before

Code: Select all

'POST_AUTHOR_FULL'
put

Code: Select all

'S_FIRST_POST' => $topic_data['topic_first_post_id'] == $row['post_id'] ? true : false,
It appears to work. It would be nice to have something like this included into the core. I'm not sure if the method I chose is the proper way, but it works :lol:

It would be great to have for people wanting to put something like a topic specific button there (for example, a facebook like button) or in my case, I'm making a style that looks like a blog, where the first post has a different layout compared to the rest of the posts which will be laid out like comments. There is

Code: Select all

S_FIRST_ROW
but that wouldn't work for me in this case.
-Jonah

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Add New Post to postrow array

Post by callumacrae »

Code: Select all

<!-- IF postrow.POST_NUMBER == 1 -->
Something like that
Made by developers, for developers!
My blog

User avatar
jsebean
Registered User
Posts: 165
Joined: Wed Nov 17, 2010 1:40 am
Location: Atlantic Canada

Re: [RFC] Add New Post to postrow array

Post by jsebean »

callumacrae wrote:

Code: Select all

<!-- IF postrow.POST_NUMBER == 1 -->
Something like that
That would also be nice.
-Jonah

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Add New Post to postrow array

Post by imkingdavid »

jsebean wrote:
callumacrae wrote:

Code: Select all

<!-- IF postrow.POST_NUMBER == 1 -->
Something like that
That would also be nice.
That is currently doable. The POST_NUMBER variable is provided in viewtopic.php in the $postrow array definition as $i + $start + 1. As such, I don't think the S_FIRST_POST is needed.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
jsebean
Registered User
Posts: 165
Joined: Wed Nov 17, 2010 1:40 am
Location: Atlantic Canada

Re: [RFC] Add New Post to postrow array

Post by jsebean »

Oh is it, guess you learn something every day :P
-Jonah

Senky
Extension Customisations
Extension Customisations
Posts: 314
Joined: Thu Jul 16, 2009 4:41 pm

Re: [RFC] Add New Post to postrow array

Post by Senky »

Should me moved to Rejected RFCs I think...

Post Reply