Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
this hack is much better because there is less queries on the wwwthreads.php page than on postlist.php. you can see an example of this at http://www.extremeforums.org/wwwthreads2.php.

open up wwwthreads.php and find the line:

echo "</td>
<td class="tdheader" align=center>
$lang[THREAD_TEXT]
</td>
<td class="tdheader" align=center>
$lang[POSTS_TEXT]
</td>
<td class="tdheader" align=center>
$lang[LAST_POST]
</td>
</tr>
";


and change it so it looks like this:

echo "</td>
<td class="tdheader" align=center>
$lang[THREAD_TEXT]
</td>
<td class="tdheader" align=center>
$lang[POSTS_TEXT]
</td>
<td class="tdheader" align=center>
$lang[LAST_POST]
</td>
<td class="tdheader" align=center>
Moderators
</td>
</tr>
";


Then find the line that looks like this:


echo "
</td><td width="15%" nowrap class="posttime">
$time</td></tr>";
}
$dbh -> finish_sth($boards);

// -----------------------------------------------------
// This closes out the table we opened for the category


and change it so it looks like this:

echo "
</td><td width="15%" nowrap class="posttime">
$time</td><td width="15%" nowrap class="posttime">
";
$moderators = "";
$query = "
SELECT Mod_Username
FROM w3t_Moderators
WHERE Mod_Board = '$Board_q'
";
$sth = $dbh -> do_query($query);
$total = $dbh -> total_rows($sth);
for ($i = 0; $i < $total; $i++) {
list($moder) = $dbh -> fetch_array($sth);
$moder = "<a href="$config[phpurl]/showprofile.php?Cat=$Cat&User=$moder&Board=$Board">$moder</a>";
$moderators .= " $moder,";
}

$moderators = preg_replace("/,$/","",$moderators);
$dbh -> finish_sth($sth);
echo "$moderators";


echo "</td></tr>";
}
$dbh -> finish_sth($boards);

// -----------------------------------------------------
// This closes out the table we opened for the category

booya....

[:red]--------------
http://extremeforums.org

Sponsored Links
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
You are still hitting the database for each board, which is kinda expensive. How about doing it like this:


// --------------------------------------------------------------------
// Get all the moderators and store them in a hash
//
$query = "SELECT Mod_Board, Mod_Username
FROM w3t_Moderators
";
$moderators = $dbh -> do_query($query);
// ----------------------------
// Cycle through the moderators
while ( $row = $dbh -> fetch_array($moderators)) {
$ModBoard = $row[0];
$ModUserName = $row[1];
$moderatorHash[$ModBoard][$ModUserName] = true;

}


//-- Then, down below, in the big for while (before the "This closes out the table we opened for the category:" comment

//----- MODERATOR SECTION -----//
echo "<td width="10%" class="forumtitle">";

if (is_array($moderatorHash[$Keyword]))
{
$i = 0;
foreach ($moderatorHash[$Keyword] as $key => $value) {
$i++;
if ($i > 1){
echo ", ";
}
echo "<A HREF="$config[phpurl]/showprofile.php?User=" . urlencode($key) . "&what=wwwthreads">$key</A>";
}
}
else
{
echo " - ";
}
echo "</tr>";

}

It works really well, prints a "-" if there is no moderator for that forum, and links each moderator to their profile.

I'll post a link to where we are doing this later in the week.

-F



Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Replace these three lines...

$ModBoard = $row[0];
$ModUserName = $row[1];
$moderatorHash[$ModBoard][$ModUserName] = true;


Reason being... look at your moderators table... I remember in mine (when my forums were up...) that some people had moderator but no board name or sometimes there were board names and no moderator. This is just a little safety net if that framentation happens to others...


if($row[0] != "" && $row[1] != "") $moderatorHash[$row[0]][$row[1]] = true;


Same disclaimer applies to this as has applied to all my other hacks I posted tonight... I don't have access to a functioning forums to test these hacks out on currently..

And what's up with the pre tags? I can put infinity line feeds after the closing pre tag but it puts my next line right up against the last line in the pre tags.... It makes reading code ANNOYING.... Using the PHP version of these msg boards BTW.



Doug
http://www.netherworldrpg.net

Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
I said when we went public I'd add a link to our site, so here it is: http://64.77.102.249/php/wwwthreads.php We are running this hack as well as a few others, such as the printer friendly version and a quick "email a link to a friend" hack I did. I'm sure you guys will also notice that we disabled a lot WWWThreads functionality, such as the private messaging, who's online, etc. Our users are coming from Ubb (yuck), so we didn't want to hit them w/ a million cool new features at once wink. We'll probably add some of the other WWWThreads features back in down the road... -F


Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
man it looks good.
i was just going to comment on the footer.
how bout doing someething like this
--------------------------------------------------
|   banner            | Contact Us | MacFixIt  |
--------------------------------------------------
   Copyright mumbo jumbo

but damn it looks good....i am going to go back to those forums now for sure...

[:red]--------------
http://extremeforums.org

Sponsored Links
Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
also i don't think ubb kids know that they can change there names, so it might be a good idea to put some text below the username field like "You can type in any name above. Or you can Register for free and get email updates on your post." from first view it seem ethere is a lot of anonymous posts....but you might not be allowing anonymous postings in the futrue....sa'll good..

[:red]--------------
http://extremeforums.org

Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Good advice. Yes, it is going to take some of the UBB users a little while to get used it, but most of the folks are very pleased w/ it. And many people have commented on how much faster it is than UBB (good work, Scream). Of course, there are one or two curmudgeons complaining that they hate it, but you'll have that any time to change something people are used to... -F


Anonymous #209772 04/24/2001 12:55 PM
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Hi Frman,

your "Send this link to a friend" and "Print" is so extremely cool!!!"

Would you mind to sharing that code with us?

By the way: You also seem to access this board with a Mac and IE5. Have you noticed that, if you preview a post first, all paragraph tags are forgotten and the post appears in a single paragraph (that only can be fixed by editing the message again.) I wonder what your fellow mac users on your say to that....
I had not been able to track that behaviour down. Have you a fix for that on your board, by chance?

Thanks a lot,

Carl

----------
http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')

Edited by caymuc on 04/24/01 12:59 PM.


Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262

vent #209774 04/24/2001 2:02 PM
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
GREAT - Thank you Poil !

Carl

----------
http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')

Sponsored Links
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Hey-

Sorry, been a few days since I've checked these. Yeah, the print hack was one I got off here, and the send to the friend is kind of a mess, but I'll see if I can package it up and post it somewhere for you.

And yeah, I think there has been some weirdness on the Mac... I haven't had a chance to nail exactly what it is though.

-F


vent #209776 04/26/2001 4:23 PM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Hey Poil-

One comment on the placement for adding the print link that you advise in http://www.wwwthreads.com/php/showthreaded.php?Board=phpcustomizing&Number=28114: By wrapping it in the if($edit == "on") block, you are making the print button only show up to logged in users. If that is what you want to do, cool, but I placed it right above the edit block so that everyone can see it. Just depends on which way you like it :)

-F




Joined: May 2001
Posts: 43
User
User
Offline
Joined: May 2001
Posts: 43
I am sorry, I have tried to install this hack but there was nothing to do, I think I am making mistakes but I am not sure where...can you please have a look at my wwwthreads.php here and please tell me what am I doing wrong? I think I am copyng the hack in the wrong part of the document but I am not sure...
http://www.flashtribute.com/wwwthreads.txt

Please help,
thanks a lot
Luke01


Joined: May 2001
Posts: 43
User
User
Offline
Joined: May 2001
Posts: 43
This is the error I get:
Parse error: parse error in /home/htdocs/hostdk/flashtribute/www/foros/wwwthreads.php on line 398

and there is no way I understand what is wrong with it....
It is driving me crazy...
please help
thanks
Luke01


Joined: Apr 2001
Posts: 50
Journeyman
Journeyman
Offline
Joined: Apr 2001
Posts: 50
Hi there.

You have some } & { and HTML tags misplaced.
line 360 should be $time</td>
line 383 should be echo "</td></tr>";

and I thought you should modify your line 360 to looked like this:

$time</td>[:red]<td width="10%" nowrap class="forumdescript" align=center>Moderater</td>

The red tags was I suggested to add on your line 360.

Attached was a modified version of your wwwthreads.php.
Hope this helps.
Attachments
41120-wwwthreads.php (0 Bytes, 35 downloads)

Joined: May 2001
Posts: 43
User
User
Offline
Joined: May 2001
Posts: 43
it works perfectly THANKS A LOT!!!!!
you saved my life!!! it was driving me nuts!
thanks a lot
luke01



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
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
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)