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


All times are GMT. The time now is 01:42 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.01816 seconds
  • Memory Usage 1,747KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete