UBB.Dev
Posted By: poil Show Moderators on wwwthreads.php - 04/06/2001 10:08 PM
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
Posted By: The Team Re: Show Moderators on wwwthreads.php - 04/09/2001 11:15 PM
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


Posted By: The Team Re: Show Moderators on wwwthreads.php - 04/10/2001 7:51 AM
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
Posted By: The Team Re: Show Moderators on wwwthreads.php - 04/13/2001 4:07 PM
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

Posted By: poil Re: Show Moderators on wwwthreads.php - 04/13/2001 8:32 PM
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
Posted By: poil Re: Show Moderators on wwwthreads.php - 04/13/2001 8:34 PM
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
Posted By: The Team Re: Show Moderators on wwwthreads.php - 04/14/2001 12:15 AM
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

Posted By: caymuc Re: send to a friend - 04/24/2001 7:55 PM
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.

Posted By: poil Re: send to a friend - 04/24/2001 8:22 PM
print thread addon
http://www.wwwthreads.com/php/showthreaded.php?Board=phpcustomizing&Number=28114

[:red]--------------
http://extremeforums.org
Posted By: caymuc Re: send to a friend - 04/24/2001 9:02 PM
GREAT - Thank you Poil !

Carl

----------
http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')
Posted By: The Team Re: send to a friend - 04/26/2001 10:59 PM
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

Posted By: The Team Re: send to a friend - 04/26/2001 11:23 PM
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



Posted By: luke01 Re: Show Moderators on wwwthreads.php - 09/03/2001 6:08 PM
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
Posted By: luke01 Re: Show Moderators on wwwthreads.php - 09/04/2001 9:29 AM
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
Posted By: dannylin Re: Show Moderators on wwwthreads.php - 09/04/2001 9:47 AM
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.

Attached File
41120-wwwthreads.php  (35 downloads)
Posted By: luke01 Re: Show Moderators on wwwthreads.php - 09/04/2001 9:57 AM
it works perfectly THANKS A LOT!!!!!
you saved my life!!! it was driving me nuts!
thanks a lot
luke01
© UBB.Developers