Previous Thread
Next Thread
Print Thread
Rate Thread
#257190 08/20/2003 2:52 PM
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Tweaking the query a bit, I change the format of the Current Threads. It now shows the threads which have been replied to most recently, the subject and how long ago since the reply was posted.

http://www.viperalley.com/summary.php?Cat=

If anyone likes it, I'll post the simple changes.

Sponsored Links
gailg #257191 08/21/2003 8:57 AM
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Groovy idea! And you might as well post the changes, because you know you're going to get swamped with posts!

eslmix #257192 08/21/2003 11:06 AM
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
:lol: true.

Well, the changes are not too difficult - adds a LEFT JOIN to the query to get some additional info. One thing I did notice is the "new" threads dont have the username appearing, so am looking into how to do that without adding another query. For now I just post new threads without a username and nobody notices.

gailg #257193 10/20/2003 8:01 PM
Joined: Aug 2003
Posts: 160
ST Offline
Junior Member
Junior Member
Offline
Joined: Aug 2003
Posts: 160
ahem...

Exactly where are the "simple changes?"

I have searched Low but not high yet.. Hoped you could save me some time...

Last edited by ST; 10/20/2003 8:03 PM.
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Well, here's what I use:

Code
<?<br /><br />if ( $LastCacheTime == 0 || !$CurrentThreadsData ) {<br />   $boardq2 = str_replace("B_", "p.B_", $boardquery);<br />    <br />   $query = "<br />		SELECT p.B_Number,p.B_Posted,p.B_Last_Post,p.B_Subject,p.B_Main,p.B_Replies,p.B_Counter,p.B_Board,u.U_UserName,b.Bo_Title<br />		FROM  {$config['tbprefix']}Posts AS p<br />		LEFT JOIN {$config['tbprefix']}Boards AS b ON b.Bo_Keyword = p.B_Board<br />		LEFT JOIN {$config['tbprefix']}Users AS u ON u.U_Number = p.B_LastPosterId<br />		WHERE p.B_Number = p.B_Main<br />        AND (p.B_Sticky = 0 OR p.B_Sticky IS NULL)<br />        $boardq2<br />		ORDER BY p.B_Last_Post DESC<br />		LIMIT $totalcurrentthreads<br />   ";<br /><br />	$sth = $dbh -> do_query($query);<br /><br />	$c = 0;<br />    $curtime = $html -> get_date();	<br />	<br />	$myString = "$tbopen<tr><td align=\"center\" class=\"tdheader\">{$pal_CurrentThreads[0]}</td></tr><tr><td align=\"left\" valign=\"top\" class=\"lighttable\"><table width=\"100%\">";<br />	while ( list($palNumber,$palPosted,$palLast,$palSubject,$palMain,$palReplies,$palCounter,$palKeyword,$palPoster,$palBoTitle) = $dbh -> fetch_array($sth)) {<br />		$c++;<br />		$timepast = round(($curtime - $palLast)/60);<br />		if ( $timepast > 1 ) $timepast = "$timepast minutes ago";<br />		elseif ( $timepast == 1 ) $timepast = "$timepast minute ago";<br />		else  $timepast = "just now";<br />	<br />	    if ( !empty($palPoster) ) $palPoster = " by $palPoster";	<br />		if ( strlen($palSubject) > 30 ) $palSubject = substr($palSubject,0,30) . "...";<br />		<br />		$myString .= "<tr><td align=\"left\" valign=\"top\" class=\"lighttable\">$spacer</td><td align=\"left\" valign=\"top\" class=\"lighttable\"><font class=\"small\">$palBoTitle: <a href=\"{$config['phpurl']}/showflat.php/Cat/$Cat/Board/$palKeyword/Number/$palNumber\">$palSubject</a>$palPoster ($timepast)</font></td></tr>";<br />	}<br />	if ($c < 1) {$myString .= "<tr><td class=\"lighttable\">{$pal_CurrentThreads[1]}</td></tr>";}<br />	<br />	$myString .= "</table></td></tr>$tbclose<br />";<br />	$CurrentThreadsStorageString = $myString;<br />	$dbh -> finish_sth($sth);<br />}<br />else {<br />	$myString = $CurrentThreadsData;<br />	$CurrentThreadsStorageString = $CurrentThreadsData;<br />}<br /><br />echo $myString;<br />?>


But you should be warned ahead of time, this can be a hog. I finally set up a cronjob to rebuild my cache every 5 minutes because my summary page was taking 2-3 seconds to generate.

You can give it a try, but I dont know if I can recommend it.

Sponsored Links
gailg #257195 01/05/2004 11:25 PM
Joined: Aug 2003
Posts: 160
ST Offline
Junior Member
Junior Member
Offline
Joined: Aug 2003
Posts: 160
I copied the code precisely as entered there. It works great, until the link within is clicked to go to the referring topic. It then says "No input file specified."

I compared the link referrences in the old current threads to what you had psoted and saw a discrepancy. Your mod made the link look like "http://www.mysite.net/bomberjackets/showflat.php/Cat//Board/unearth/Number/10829"

where the old current threads made the link: "http://www.mysite.net/ashes/showflat.php?Cat=&Board=UBB1&Number=11025"

I highlighted the parts I think are causing the problem as all the other links on my site look like the second example.

I played around with it a but but cannot seem to remedy it. Any advice would be appreciated.

Joined: Aug 2003
Posts: 160
ST Offline
Junior Member
Junior Member
Offline
Joined: Aug 2003
Posts: 160
OK... I figured it out.. sorry for the premature venting... now I have another error to discuss.... I will psot it elsewhere...

Again, thanks.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)