UBB.Dev
Posted By: Aglavalin Last Post By v1.0 - 09/23/2002 9:39 AM
Mod Name / Version - Last Post By v1.0

Description - Adds the post title and user name for the last post in the forum to the ubbthreads.php 'Last Post' column.

Example - http://www.newoutriders.org/ubbthreads/ubbthreads.php

Pre-requisites - none

Author - AllanAyers

Files Altered - ubbthreads.php, ubbthreads.tmpl

Database Altered - no

New Files - None

Credits: Aglavalin for typing it up, ask me for help, not Allan.

Note: This is an easy hack. Can cause excessive SQL calls, be warned on a busy server or UBBT with a large database! Works fine on 6.1 with the moderator column removed already. Otherwise you will need to modify the code to work with the moderator column still in.


This will probably work with 6.0.x, but I have not tested it myself. Perhaps Allan knows, as he wrote this code...

Attached File
57146-LastPostBy_1.0.txt  (124 downloads)
Posted By: AllenAyres Re: Last Post By v1.0 - 09/23/2002 5:44 PM
Thanks Aglavin Actually philipp from ntcompatible.com wrote it
Posted By: Aglavalin Re: Last Post By v1.0 - 09/23/2002 7:18 PM
Now ya tell me!
Posted By: msula Re: Last Post By v1.0 - 09/24/2002 6:23 AM
Hmm.. just tried it on mine (6.1) and the moderator column was just a bunch of black cells. Something didn't work right
Posted By: Aglavalin Re: Last Post By v1.0 - 09/24/2002 6:57 AM
Oh I bet that is because I removed the moderator column from my site, and I copied that code from my tmpl file, the one with no mod column anymore. Guess I should fix this hack then...
Posted By: msula Re: Last Post By v1.0 - 09/24/2002 2:47 PM
Thanks, I had assumed that was the cause, but I was too tired to try and add that in myself
Posted By: JoshPet Re: Last Post By v1.0 - 10/05/2002 4:46 AM
Thanks!

I've always wanted this..... but never found it.

Thought I'd seen it recently. Added it tonight... my users think it's a feature of 6.1.1. They like.
Posted By: Elkom Re: Last Post By v1.0 - 10/28/2002 10:14 AM
sorry Please,

can someone help me with the mitake of the mod collum? i´m not able to do that by myself. I have the same problen with the black mod collum. If it´s possible, i want a normal mod collum and the last post by!

Thanks for helping

y board is here
Posted By: Aglavalin Re: Last Post By v1.0 - 10/28/2002 9:22 PM
This hack was written with the moderator column removed already, so either remove the mod column, or alter the code to make it work on one more column. I'm off working on a big site for the last serveral weeks, so I have not been doing anything ubb related...
Posted By: Lerosia Re: Last Post By v1.0 - 11/02/2002 1:57 PM
Hi

I just added this hack and it seems you can see the last post by: in the Main Index..but all of the forums are still the same

OR was this just made for the main index?


Lerosia
Posted By: JoshPet Re: Last Post By v1.0 - 11/02/2002 5:21 PM
There is a different "Last Post by" hack in the Finished Mods forum (posted by Just Dave) that will update the info on the postlist.php screen.

This one just does the Main Index (the ubbthreads.php file).
Posted By: Lerosia Re: Last Post By v1.0 - 11/03/2002 3:18 AM
Ahhh...

Again, gracias


Lerosia
Posted By: caspe7_dup1 Re: Last Post By v1.0 - 11/03/2002 8:15 AM
Thanks. I really like this. there are some more things I wanted it to do. For example, have a link to the user profile.

[]http://www.prowrestlingforum.com/lastreply.jpg[/]

What I've done:
- Added "In:" and "by"
- Link to the users profile

I don't know if anyones done this.. oh well. here goes.

After you installed it, find in the ubbthreads.tmpl:
code:

<font class="small">
 <a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board={$forum[$c][$f]['Keyword']}&Number=$lastnumber&Main=$lastmain#Post$lastnumber" title="$lsubject">$lsubject</a>
($luser)
</font>


Replace:
code:

<font class="small">
 In: <a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board={$forum[$c][$f]['Keyword']}&Number=$lastnumber&Main=$lastmain#Post$lastnumber" title="$lsubject">$lsubject</a>
<br />By: <a href="{$config['phpurl']}/showprofile.php?Cat=&User=$luser" title="$luser's Profile">$luser</a>
</font> [/]

Posted By: JoshPet Re: Last Post By v1.0 - 11/03/2002 8:36 AM
Excellent Idea. Thanks.
Posted By: Elkom Re: Last Post By v1.0 - 11/04/2002 10:19 PM
Realy Cool

Thanks a lot
Posted By: Hal9000 Re: Last Post By v1.0 - 11/05/2002 11:33 PM
Try this in order to work both (moderator column and be aligned)

echo <<<UBBTPRINT
<tr class="darktable">
<td valign="top" width="1%">
<img src="{$config['images']}/{$forum[$c][$f]['boardfolder']}" alt="" />
</td>
<td width="60%">
<font class="forumtitle">
<a href="{$config['phpurl']}/postlist.php?Cat=$Cat&Board={$forum[$c][$f]['Keyword']}">
{$forumimage}{$forum[$c][$f]['Title']}
</a>
</font>
<br />
<table cellpadding="0" cellspacing="0">
<tr>
<td>

</td>
<td width="17%" class="forumdescript">
{$forum[$c][$f]['Description']}
</td>
</tr>
</table>
</td>
<td width="6%" align="center" class="threadtotal" nowrap="nowrap">
{$forum[$c][$f]['Threads']}
{$forum[$c][$f]['showthreads']}
</td>
<td width="6%" align="center" class="posttotal" nowrap="nowrap">
{$forum[$c][$f]['Total']}
{$forum[$c][$f]['showposts']}
{$forum[$c][$f]['showna']}
</td>
<td width="25%" nowrap="nowrap" class="posttime">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="18" valign="bottom"> <img src="{$config['images']}/icons/$licon" align="middle" border="0" alt="" />  </td>
<td valign="bottom">
<font class="small">
 <a href="{$config['phpurl']}/showflat.php?Cat=$Cat&Board={$forum[$c][$f]['Keyword']}&Number=$lastnumber&Main=$lastmain#Post$lastnumber" title="$lsubject">$lsubject</a>
($luser)
</font>
</td></tr>

<tr><td width="18" valign="bottom"> </td>
<td valign="bottom">
<font class="small">$date
<font class="posttime">$datetime[1] $datetime[2]</font></font>
</td></tr></table>
</td>

<td width="10%" class="modcolumn" align="center">
{$forum[$c][$f]['modlist']}
</td>
</tr>

UBBTPRINT;
} //UBBTREMARK
echo <<<UBBTPRINT
<!-- END OF FORUM LOOP -->
</table>
</td>
</tr>
</table>
UBBTPRINT;
} //UBBTREMARK
echo <<<UBBTPRINT
<!-- END CATEGORY LOOP -->


Just replace it in the ubbthreads.tmpl
Posted By: Jacob Re: Last Post By v1.0 - 11/06/2002 1:26 AM
Sometimes I get a broken image (the icon) when I don't incude one (when I use a quick reply box, or don't include on in my post)
© UBB.Developers