| View previous topic :: View next topic |
| Author |
Message |
nintemos
 newbie
Member No.: 89 Joined: 05 Nov 2006 Posts: 7
|
Posted: Sun Nov 05, 2006 12:11 pm Post subject: Need help... |
|
|
aight... i've tryed the tutorial on how to integrate phpBB topic in index, it works perfectly exept for one part. It put topics in order of their creation, what i would like to get of it, its to show the topic in order with the last post.
Thats what i got right now.
| Code: |
<a href="forums/viewtopic.php?t=<? echo($row['topic_id']); ?>"><? echo($row['topic_title']); ?> |
is it supose to be something like that ...
| Code: |
<a href="forums/viewtopic.php?t=<? echo($row['topic_id']); ?>"><? echo($row['topic_title']);
ord('post_id'); ?> |
Thx for help. |
|
| Back to top |
|
 |
rc69
 Site Admin

Member No.: 1 Joined: 05 Aug 2004 Posts: 152
|
Posted: Sun Nov 05, 2006 6:22 pm Post subject: |
|
|
To order by the last post, and display the topics that were last posted in as opposed to the most recent topic will take a little bit, as i would have to change the SQL... and it's been so long that i'll have to work a little bit to get that to work.
But right now, you know that the ord() function isn't for mySQL, but for ASCII? It returns the ASCII integer value of a character... _________________ Current user reading this: Anonymous
Mind the gap. |
|
| Back to top |
|
 |
nintemos
 newbie
Member No.: 89 Joined: 05 Nov 2006 Posts: 7
|
Posted: Sun Nov 05, 2006 8:05 pm Post subject: |
|
|
well im not that good in coding... well i suck all i can do its test by editing and such ... if you could help me on that  |
|
| Back to top |
|
 |
rc69
 Site Admin

Member No.: 1 Joined: 05 Aug 2004 Posts: 152
|
Posted: Mon Nov 06, 2006 5:34 am Post subject: |
|
|
Sure, just gimme a day or two. I don't exactly have free time right now so if you don't here from me by tuesday night, then make sure i haven't forgot  _________________ Current user reading this: Anonymous
Mind the gap. |
|
| Back to top |
|
 |
nintemos
 newbie
Member No.: 89 Joined: 05 Nov 2006 Posts: 7
|
Posted: Mon Nov 06, 2006 3:26 pm Post subject: |
|
|
aight and thx man  |
|
| Back to top |
|
 |
rc69
 Site Admin

Member No.: 1 Joined: 05 Aug 2004 Posts: 152
|
Posted: Wed Nov 08, 2006 4:00 am Post subject: |
|
|
Well, i honestly have had time to sit down and test anything. But i did manage to take a look at the script. If i understand you right, simply changing the query to order by post_id should work how you want it to.
i.e.
| Code: |
SELECT DISTINCT t.topic_id, t.topic_title, t.topic_replies, u.user_id, u.username, s.post_text
FROM phpbb_posts p, phpbb_topics t, phpbb_users u, phpbb_posts_text s
WHERE p.topic_id = t.topic_id AND t.topic_poster = u.user_id AND t.topic_first_post_id = s.post_id AND t.forum_id != 6 AND u.user_id != -1
ORDER BY p.post_id DESC LIMIT 10 |
_________________ Current user reading this: Anonymous
Mind the gap. |
|
| Back to top |
|
 |
nintemos
 newbie
Member No.: 89 Joined: 05 Nov 2006 Posts: 7
|
Posted: Wed Nov 08, 2006 2:29 pm Post subject: |
|
|
Hummm well you've make it without testing right ? anyway i found how to do it. You were close enought tought
| Code: |
SELECT DISTINCT t.topic_id, t.topic_title, t.topic_replies, u.user_id, u.username, s.post_text
FROM phpbb_posts p, phpbb_topics t, phpbb_users u, phpbb_posts_text s
WHERE p.topic_id = t.topic_id AND t.topic_poster = u.user_id AND t.topic_first_post_id = s.post_id AND t.forum_id != 6 AND u.user_id != -1
ORDER BY [b]t.topic_last_post_id[/b] DESC LIMIT 10 |
it works like a charme thx.
Wandering now if theres a way to not shown the topics where you need access to view it... like topics set as private and such will not be shown in the list. If its possible and if you got time to help me... Thx again man:D |
|
| Back to top |
|
 |
rc69
 Site Admin

Member No.: 1 Joined: 05 Aug 2004 Posts: 152
|
Posted: Wed Nov 08, 2006 10:41 pm Post subject: |
|
|
Well, i never knew you could set individual topics to private, but if you read the tutorial, you can not select topics that are in a private board.
| Quote: |
To keep a forum secret (i.e. a mods only forum) find, AND t.forum_id != 1
and change 1 to the forums id (according to your database). To select a specific forum (i.e. news forum)
find AND t.forum_id != 1, and change it to t.forum_id = 1 (where 1 = the forums id) |
_________________ Current user reading this: Anonymous
Mind the gap. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|