You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 48 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Want to sort Recent Topics by Last Post [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
thareb
Nuke Soldier
Nuke Soldier


Joined: Feb 04, 2005
Posts: 18


PostPosted: Wed Dec 28, 2005 6:07 am Reply with quoteBack to top

Right now the Recent Topics block sorts the most recent topics by the time the topic was started (topic_time) in the php code from what I can tell. I've been on other sites where this block keeps the original title of the post, but sorts the titles in the block by the last post time (not the original topic time). In other words isf someone posts a reply to a topic that is 3 or 4 down on the list in the block, the block bumps that title up to the top, so you know which topic has been replied to most recently - not when it was originally posted.

I've played around with the code and tried replacing topic_time with last_post_time and last_post but this does nothing but FUBAR the block and I'm lost. Sad

Here's the code. Any suggestions?

http://www.se7ensamurai.com

Quote:
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com) */
/* http://phpnuke.org */
/* */
/* This is a 2 min hack of the old forum block to work with the phpBB2 */
/* port. */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/

if (eregi("block-Forums.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

global $prefix, $db, $sitename;

$result = $db->sql_query("SELECT forum_id, topic_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_time DESC LIMIT 50");



while ($row = $db->sql_fetchrow($result)) {
$forum_id = intval($row['forum_id']);
$topic_id = intval($row['topic_id']);
$topic_title = $row['topic_title'];
$row2 = $db->sql_fetchrow($db->sql_query("SELECT auth_view, auth_read FROM ".$prefix."_bbforums WHERE forum_id='$forum_id'"));
$auth_view = intval($row2['auth_view']);
$auth_read = intval($row2['auth_read']);
if (($auth_view < 2) OR ($auth_read < 2)) {
$content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\" align=\"center\">&nbsp;<a href=\"modules.php?name=Forums&amp;file=viewtopic&amp;t=$topic_id\">$topic_title</a><br><br>";
}
}



?>
Find all posts by tharebView user's profileSend private message
astalavistabd
Captain
Captain


Joined: Dec 19, 2004
Posts: 663

Location: Canada

PostPosted: Wed Dec 28, 2005 7:49 am Reply with quoteBack to top

did you try to ascending the topic_time ? Smile

Code:

$result = $db->sql_query("SELECT forum_id, topic_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_time ASC LIMIT 50");

_________________
Free PHPNuke Themes, PHPNuke Modules, PHPNuke Blocks (No Registration Required)
Find all posts by astalavistabdView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN MessengerICQ Number
thareb
Nuke Soldier
Nuke Soldier


Joined: Feb 04, 2005
Posts: 18


PostPosted: Wed Dec 28, 2005 8:25 am Reply with quoteBack to top

All that seemed to do was reverse it. It showed the oldest topic posted first, then second oldest etc... posting a reply to any of the topics did nothing to change their position in the list.

What I'm looking for is something that will show the newest posts descending. So if someone hits a replies to a topic, that topic title gets bumped to the top of the list.
Find all posts by tharebView user's profileSend private message
thareb
Nuke Soldier
Nuke Soldier


Joined: Feb 04, 2005
Posts: 18


PostPosted: Wed Dec 28, 2005 8:28 am Reply with quoteBack to top

Right now for instance the top ten topics in my list are:

Quote:
Battlegrounds

Blackfathom Deeps

7S Excel Bank Spreadsheet

Merry Christmas/Joyeux Noel!

Guild bank cash flow analysis

ANNOUNCEMENT: NEW BANKERS

Aaarrghhh!!

Who is Kaminori?

Mel Gibson hiding in the Apocalypto trailer

For the Horde!


So for instance if someone replies to the "Guild bank cash flow analysis" topic in the forums the block should then read:

Quote:
Guild bank cash flow analysis

Battlegrounds

Blackfathom Deeps

7S Excel Bank Spreadsheet

Merry Christmas/Joyeux Noel!

ANNOUNCEMENT: NEW BANKERS

Aaarrghhh!!

Who is Kaminori?

Mel Gibson hiding in the Apocalypto trailer

For the Horde!
Find all posts by tharebView user's profileSend private message
thareb
Nuke Soldier
Nuke Soldier


Joined: Feb 04, 2005
Posts: 18


PostPosted: Wed Dec 28, 2005 9:02 am Reply with quoteBack to top

Okay I found this mod that does exactly what I want - but it scrolls. It's called Scrolling Forums Block 10.

Anyone know of a block that does what this one does without the scrolling?
Find all posts by tharebView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.178 Seconds - 284 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::