PDA

View Full Version : [RELEASE] Thread Start date/time



nuno
Sat 26th May '01, 1:15pm
Inspired in wluke's hack:

open forumdisplay.php

find code:

$threads=$DB_site->query("
SELECT $dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postus erid,
lastposter,thread.dateline,

replace it with:

$threads=$DB_site->query("
SELECT $dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postus erid,
lastposter,thread.dateline AS threadstart,

find code:(2x)

$thread[lastreplydate]=vbdate($dateformat,$thread[lastpost]);
$thread[lastreplytime]=vbdate($timeformat,$thread[lastpost]);

insert after it:

$thread[threadstartdate]=vbdate($dateformat,$thread[threadstart]);
$thread[threadstarttime]=vbdate($timeformat,$thread[threadstart]);

save and close forumdisplay.php

edit forumdisplaybit template

find:

<td bgcolor="{secondaltcolor}" width="30%" nowrap><normalfont>$thread[postedby]

replace it with:

<td bgcolor="{secondaltcolor}" width="30%" nowrap><smallfont>$thread[threadstartdate] <font color="{timecolor}">$thread[threadstarttime]</font><br> by $thread[postedby]</smallfont></td>

save it

done

RobAC
Sat 26th May '01, 1:28pm
What does this hack do and where can we see an example of it?

h4p3
Sat 26th May '01, 1:41pm
It displays you when the thread was started.

For example:
thread starter
nuno
on 05-26-2001 05:28 PM

nuno
Sat 26th May '01, 1:55pm

Rosevalley
Sat 26th May '01, 7:11pm
Nice hack man !!! its working great ! easy to install, i had it working in 3 minutes. nice !!!

My members are very happy now, tnx again.

RoseValleY

BluSmurf
Sat 26th May '01, 7:36pm
Great hack :), install it with ease!

JJR512
Sun 27th May '01, 6:33am
Odd. I've been doing the same thing all along, only my version is much simpler.

Here are my instructions for the same thing:

Find this code in forumdisplay.php: (NOTE: it appears TWICE. You are looking ONLY for the SECOND instance of this code!)

$thread[lastreplydate]=vbdate($dateformat,$thread[lastpost]);
$thread[lastreplytime]=vbdate($timeformat,$thread[lastpost]);

...and after the SECOND instance of the above code, add:

$thread[firstpostdate]=vbdate($dateformat,$thread[dateline]);
$thread[firstposttime]=vbdate($timeformat,$thread[dateline]);

Save and upload the file.

Next, edit the forumdisplaybit template. Look for:

<normalfont>$thread[postedby]</normalfont>
...and replace it with this:

<smallfont>$thread[firstpostdate] $thread[firstposttime]<br>by <b>$thread[postedby]</b></smallfont>
ALSO, in the opening <td> tag that this bit is in, you should add this:

align="right"
This alignment, along with the formatting in the replacement code, will give the thread start time and started by username the same appearance as in the column for the last reply time and last reply user. But you can feel free, of course, to give it your own desired style.

***
So you can see the differences between my version and nuno's version is that I get the thread start time and date from the dateline directly: "$timeformat,$thread[dateline]", whereas in nuno's version you have to edit a select query earlier in the code, and get the start time and date from the query results. It's just simpler this way, although obviously either way works. :)

Example: http://www.jjr512.com/forums/forumdisplay.php?s=&forumid=1

JJR512
Sun 27th May '01, 6:37am
I'd also like to add that in the forumdisplay_threadslist template, I changed Thread Starter to Thread Started, because with the new information in that column, the word "started" is more accurate. It follows more naturally: "Thread Started date by username", rather than "Thread Starter date by username". :)

express
Sun 3rd Jun '01, 11:13am
Thanks For the hack, worked great!



Joey

ethank
Sun 3rd Jun '01, 2:41pm
One issue that I can't figure out is why the username link is underlined in the "Thread Started" column, but not in the Last Post column. I followed the instructions to the letter! :)

Ethan

JJR512
Sun 3rd Jun '01, 3:36pm
ethank, that's not the case with my board. Which version of the hack did you use, mine or nuno's?

Zarkov
Sun 3rd Jun '01, 8:33pm
ethank, the thread starter was already "underlined" without this hack and the last post members name wasnt.

It has nothing to do with the hack m8, Although i cant see where the underline is comming from

west
Sun 3rd Jun '01, 11:37pm
thanks a lot /\/uno !!!

it was very simple and it works great and now my members

are very pleased...

:)

hacker
Wed 3rd Oct '01, 12:37pm
Originally posted by Zarkov
ethank, the thread starter was already "underlined" without this hack and the last post members name wasnt.

It has nothing to do with the hack m8, Although i cant see where the underline is comming from

I applied the hack, but the color of the time is not the same as in Last Post.

almighty one
Wed 3rd Oct '01, 9:26pm
just my opinion but wouldnt it look better if it had the posters name then the date and time? maybe it is easy to do i havent even tried to install it maybe ill do this and have the name appeare above time thanx for hack

hacker
Thu 4th Oct '01, 1:09am
While looks are subjective, I prefer a consistent look with the Last Post, inlcuding no undeline and red time in Thread Starter. Anyone know how to change them?

Thanks in advance.

YourHostSucks
Thu 4th Oct '01, 1:12am
Seems how we just launch the site last week, this is a nice feature I never thought of..

Thanks! Worked Great JJR...

almighty one, just re arrange stuff in "forumdisplaybit" template...

EX: http://forums.yourhostsucks.com/forumdisplay.php?&forumid=5

I removed by: and align=center.. not sure if I like it yet...
But the name on top is the way to go... *I think* ;)


If you would like the name on the front (last post) to be on top..

That is in "forumhome_lastpostby" template..

http://www.yourhostsucks.com

YourHostSucks
Thu 4th Oct '01, 1:15am
Originally posted by hacker
While looks are subjective, I prefer a consistent look with the Last Post, inlcuding no undeline and red time in Thread Starter. Anyone know how to change them?

Thanks in advance.

You want to remove the link to last poster profile,
and the post time?

hacker
Thu 4th Oct '01, 1:23am
No, I want the Thread Starter to look similar to Last Post, that is, the user name is not underlined and the time stamp is in red because the time stamp is also in read in Last Post.

YourHostSucks
Thu 4th Oct '01, 1:59am
In "forumdisplaybit" template :



$thread[firstpostdate] $thread[firstposttime]


Replace with:



$thread[firstpostdate] <font color="{ timecolor }">$thread[firstposttime]</font>


Note: Take the spaces out from around "timecolor"

Then I just got vBulletin a week or so ago.. So I am not sure why those links look different.. but you can remove the line by editing
forumdisplay.php

Around line 598 or so:

Find:


$thread['postedby'] = "<a href=\"member.php?action=getinfo&userid=$thread[postuserid]\">$thread[postusername]</a>";


Replace with:


$thread['postedby'] = "<a href=\"member.php?action=getinfo&userid=$thread[postuserid]\" style=\"text-decoration: none\">$thread[postusername]</a>";



...


If someone knows the proper "vBulletin" way to remove the line.. please post so.. ;)

hacker
Thu 4th Oct '01, 3:00am
THANK YOU THANK YOU THANK YOU! It worked and now the site is mroe consistent looking!

YourHostSucks
Thu 4th Oct '01, 3:05am
No Problem,, I am sure it is not the correct "vBulletin" way to do it.. (someone will prob fix my mistake)

But it works.. I modified it so all of mine are like that....

julius
Fri 19th Oct '01, 2:51pm
Thanks, very usefull hack!
Is it possible to use it in "View New Posts" and in "Search - Show results as threads" ?