vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Thread Start date/time (https://vborg.vbsupport.ru/showthread.php?t=18219)

nuno 05-25-2001 10:00 PM

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 05-26-2001 03:28 PM

What does this hack do and where can we see an example of it?

h4p3 05-26-2001 03:41 PM

It displays you when the thread was started.

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

nuno 05-26-2001 03:55 PM


Rosevalley 05-26-2001 09:11 PM

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 05-26-2001 09:36 PM

Great hack :), install it with ease!

JJR512 05-27-2001 08:33 AM

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!)
PHP Code:

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

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

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

Save and upload the file.

Next, edit the forumdisplaybit template. Look for:
PHP Code:

<normalfont>$thread[postedby]</normalfont

...and replace it with this:
PHP Code:

<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:
Code:

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/forumdi...p?s=&forumid=1

JJR512 05-27-2001 08:37 AM

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". :)

webhost 06-03-2001 01:13 PM

Thanks For the hack, worked great!

Joey

ethank 06-03-2001 04:41 PM

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 06-03-2001 05:36 PM

ethank, that's not the case with my board. Which version of the hack did you use, mine or nuno's?

zarkov 06-03-2001 10:33 PM

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 06-04-2001 01:37 AM

thanks a lot /\/uno !!!

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

are very pleased...

:)

hacker 10-03-2001 02:37 PM

Quote:

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 10-03-2001 11:26 PM

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 10-04-2001 03:09 AM

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 10-04-2001 03:12 AM

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/foru...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 10-04-2001 03:15 AM

Quote:

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 10-04-2001 03:23 AM

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 10-04-2001 03:59 AM

In "forumdisplaybit" template :

PHP Code:

$thread[firstpostdate$thread[firstposttime

Replace with:

PHP Code:

$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:
PHP Code:

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

Replace with:
PHP Code:

      $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 10-04-2001 05:00 AM

THANK YOU THANK YOU THANK YOU! It worked and now the site is mroe consistent looking!

YourHostSucks 10-04-2001 05:05 AM

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 10-19-2001 04:51 PM

Thanks, very usefull hack!
Is it possible to use it in "View New Posts" and in "Search - Show results as threads" ?

2 X Viverridae 08-14-2002 12:59 PM

I have installed this hack - but am still wondering...

Quote:

Originally posted by julius
Thanks, very usefull hack!
Is it possible to use it in "View New Posts" and in "Search - Show results as threads" ?


Mr. X 08-20-2002 05:51 AM

Does this hack work at all for 2.2.6? I got the username showing up but no date at all on top, just a blank. The code I edit in the php file is around 597-598, and I stick the:

Code:

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

On top of those 2 lines, in the middle, or under it? I've tried all 3 and no date is showing up.

Mr. X 08-20-2002 11:44 PM

bump

2 X Viverridae 08-21-2002 07:49 PM

@ Mr. X

I have JJR512's version working on 2.2.6 with no problems whatsoever. According to his instructions, you are looking only for the second instance of this code...
PHP Code:

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

and add this after the second instance...
PHP Code:

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

Hope this helped.

EDIT: I think you have the first instance of the code, not the second - my first instance of the code to find is around line 575, and the second around 655 - while our files are obviously different, your location of around 597 or so seems likely that you've inserted the code in the wrong spot. :D

Mr. X 08-22-2002 07:34 AM

Still not working. The first instance of the code shows up at line 524 and 525 respectively. The 2nd instance shows up at 598 and 599 respectively. I posted the hack right after line 599, but it still doesnt show up. I've also reverted the forumdisplaybit back to the original and put in the code but it also doesnt show up (no date).

2 X Viverridae 08-22-2002 05:08 PM

It's always the 'simple' ones that end up being a pain, eh.

It's a little hard to tell exactly what you are seeing when you say 'no date' shows up - do you mean that it displays just like it did before?

It should show...
DD-DD-DD TT:TT AM/PM
by Thread-Starter

Now - does it show the word 'by' prior to thread starter? Or, does it just show the name? Knowing this will tell us if there is an error in the forumdisplaybit template, or if the problem is somewhere else.

The relvant portion of my forumdisplay.php looks like this...
PHP Code:

      if ($wordwrap!=0) {
        
$thread[title]=dowordwrap($thread[title]);
      }

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

      
$thread[gotonew]=''

If you reverted your forumdisplay bit template, then changed...
PHP Code:

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

to this...
PHP Code:

<td bgcolor="{ secondaltcolor}" width="30%" align="right" nowrap><smallfont>$thread[firstpostdate] <font color="{ timecolor}">$thread[firstposttime]</font><br>by <b>$thread[postedby]</b></smallfont></td

That should be all there is to it.

(Removing the space after the {'s in { secondaltcolor} and { timecolor} of course)

If you are still having problems, maybe a small screen shot?

Mr. X 08-22-2002 06:23 PM

Ok. I've attached a preview of how it looks. Just the date is missing.

Here is what that code looks like in my forumdisplay.php (without hack applied). These are from lines 595 to 604:

PHP Code:

if ($wordwrap!=0) {
        
$thread[title]=dowordwrap($thread[title]);
      }

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

      
$thread[gotonew]=''

I've pasted the 2 lines of code right after the 2nd instance, on line 601-602 respectively.

Here is what my forumdisplaybit template looks like:

Code:

<tr align="center">
        <td bgcolor="#F1F1F1"><img src="https://vborg.vbsupport.ru/greentek/$thread[newoldhot].gif" border="0" alt=""></td>
        <td bgcolor="#DFDFDF">$thread[icon]</td>
        <td bgcolor="#F1F1F1" align="left" width="70%" onMouseOver="this.style.backgroundColor='#EBECEA'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#F1F1F1';" onClick="window.location.href='showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]'"><normalfont>$thread[gotonew] $paperclip$thread[movedprefix]$thread[typeprefix]<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a></normalfont> <smallfont>$thread[pagenav]</smallfont></td>
        <td bgcolor="#DFDFDF" width="30%" valign="middle" align="right" nowrap><smallfont>$thread[postdate] $thread[posttime]<br>by <b>$thread[postedby]</b></smallfont></td>
        <td bgcolor="#F1F1F1"><normalfont><a href="javascript:who($thread[threadid])">$thread[replycount]</a></normalfont></td>
        <td bgcolor="#DFDFDF"><normalfont>$thread[views]</normalfont></td>
        $threadrating
        <td bgcolor="$backcolor">
                <table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink"><tr align="right">
                        <td nowrap><smallfont>$thread[lastreplydate] <font color="#006000">$thread[lastreplytime]</font><br>
                        by <a href="member.php?action=getinfo&find=lastposter&threadid=$thread[threadid]"><b>$thread[lastposter]</b></a></smallfont></td>
                        <td nowrap>&nbsp;<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&threadid=$thread[threadid]"><img src="https://vborg.vbsupport.ru/greentek/lastpost.gif" border="0" alt="Go to last post"></a></td>
                </tr></table>
        </td>
</tr>


2 X Viverridae 08-22-2002 06:57 PM

In your template you have 'postdate' and 'posttime' instead of 'firstpostdate' and 'firstposttime'

In the 5th line of your template, try changing...

<smallfont>$thread[postdate] $thread[posttime]<br>

to

<smallfont>$thread[firstpostdate] $thread[firstposttime]<br>

Hope this get's it!

Mr. X 08-23-2002 04:44 AM

Its working now. The template was weird. For some reason, my on/off graphics were linked to:

Code:

<td bgcolor="#F1F1F1"><img src="https://vborg.vbsupport.ru/greentek/$thread[newoldhot].gif" border="0" alt=""></td>
I saw the new style Im working and notice its using the same green buttons here. I freaked out at my co-designer, I thought he ripped them, but he said he didnt even touch the template. Im confused how the hell that got in there. Well I reverted back to the original template and added your code and it works great now. Just gotta reapply that CSS rollover code.

Perhaps I copied the URL by mistake and pasted in there, but I dont ever recall (certainly not today at least) wanting the URL to the new/off buttons, so I wonder wtf happened?

Well anyway thanks for all the help!

2 X Viverridae 08-23-2002 07:31 AM

LOL - don't rip on yer poor co-desingner - it's the way VB handles replacement varialbles, even in code - it's happened to all of us!

Just be careful when copying code directly from the site - if it says { imagesfolder} (without the space after the {) it will give you the local reference path to it...

Glad it's working for you now - it's a great little hack!

PS - for clarity the following are the same except for the space following the {... In both cases I typed in the word imagesfolder and imagesfolder - in the first case the {} brackets are around the statement, in the second, I left a leading space after the first { - and here is the result - the absolute local path to this installations 'imagesfolder' shows up in the first case!! Welcome to the world of replacement variables...

https://vborg.vbsupport.ru/greentek
{ imagesfolder}

In both cases, I typed in imagesfolder - but in the first example, I left no spaces between { and the name. vBulletin then parses it as the path to the local 'imagesfolder' (which is https://vborg.vbsupport.ru/greentek) - which is what happened to you. This can be annoying at times, but one of the things you have to watch for! :D

Try it for yourself and see...

Audionuts 09-20-2002 01:57 PM

cool, nice little hack


All times are GMT. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01563 seconds
  • Memory Usage 1,865KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (14)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (34)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete