Page 1 of 1

Latest News 1st post not last

Posted: 15. April 2008 14:13
by spongeweb
Ive noticed that on phpbb3portal the latest news shows the first post from each topic (what I want)

Ive moved to board3 as its more supported and modified it a bit,

but my php isnt up to scratch yet, so how can I make news.php show the first post from every thread and not the last?


thanks and great work so far.

Re: Latest News 1st post not last

Posted: 17. April 2008 12:12
by spongeweb
anyone help please?

Re: Latest News 1st post not last

Posted: 19. April 2008 16:07
by Ice
Open portal/includes/functions.php

Find (Tip: There's 2, change them both.)

Code: Select all

			$user_link = 't.topic_last_poster_id = u.user_id';
			$post_link = 't.topic_last_post_id = p.post_id';
Replace with

Code: Select all

			$user_link = 't.topic_poster = u.user_id';
			$post_link = 't.topic_first_post_id = p.post_id';

Re: Latest News 1st post not last

Posted: 20. April 2008 13:52
by spongeweb
found the two lines, thanks,

it had no effect at all! which I find rather suprising, I purged cache and refreshed template??

Re: Latest News 1st post not last

Posted: 20. April 2008 15:12
by Ice
Are you sure you edited them then? Both, where it says 'news' and 'news_all'? 'cause that's all there is to order the posts. Have the news posts got replies at all?

Re: Latest News 1st post not last

Posted: 20. April 2008 16:20
by spongeweb
Yes, I editted both lines, it did make a change, but it didnt show the first posts, for some reason it still shows the last post, but from completely differnet threads lower down inthe forum...

most odd!

Re: Latest News 1st post not last

Posted: 20. April 2008 16:25
by spongeweb
and i re-ediited and I get this: (I only changes the last line the first time to experiment)

Code: Select all

SQL ERROR [ mysql4 ]

Unknown column 't.topic_poster_id' in 'on clause' [1054]
here is the code:

Code: Select all

				case "news":

					$topic_type = 't.topic_type = ' . POST_NORMAL;
					$str_where = 'AND (' . substr($str_where, 0, -4) . ')';
					$user_link = 't.topic_last_poster_id = u.user_id';
					$post_link = 't.topic_last_post_id = p.post_id';
					$topic_order = 't.topic_time DESC';

				break;
				case "news_all":

					$topic_type = '( t.topic_type != ' . POST_ANNOUNCE . ' ) AND ( t.topic_type != ' . POST_GLOBAL . ')';
					$str_where = 'AND (' . substr($str_where, 0, -4) . ')';
					$user_link = 't.topic_last_poster_id = u.user_id';
					$post_link = 't.topic_last_post_id = p.post_id';
					$topic_order = 't.topic_time DESC';

				break;
			}

Re: Latest News 1st post not last

Posted: 20. April 2008 23:30
by Ice
I apologise it should be

Code: Select all

$user_link = 't.topic_poster = u.user_id'; 

Re: Latest News 1st post not last

Posted: 21. April 2008 11:39
by spongeweb
Ok, Ill try this when I get home,

I have noticed, if I make a new topic it diesnt show in the portal anyway, surely it should do this straight away as its become the latest topic? is there a time lag for the information or something?

Re: Latest News 1st post not last

Posted: 23. April 2008 18:34
by spongeweb
No difference here :(

Re: Latest News 1st post not last

Posted: 23. April 2008 18:36
by Ice
Are you sure you refreshed your cache? Because that is all I changed on my portal.

Re: Latest News 1st post not last

Posted: 23. April 2008 18:52
by el_Vindicador
ok, i did the change and

it's works!!!

now: when i use the no-compact style for the News....

i see some bbcodes thats not works... like align or font

i use advance bbcode.

somre help¿

Re: Latest News 1st post not last

Posted: 23. April 2008 23:06
by spongeweb
100% code change, 100% refresh

no change... it doesnt even get the topics in the rught order!

http://www.websponge.net center block,


EDIT :oops: i MISSED A "_first" sorry......

Re: Latest News 1st post not last

Posted: 23. April 2008 23:28
by spongeweb
My bad, all works now, thankyou for your patience,

it doesnt pull them in right order though? some threads are lower downm even though they should be top.

but thanks again..

Re: Latest News 1st post not last

Posted: 24. April 2008 08:37
by Ice
What order would you want them pulled in, last posted or last replied?