PDA

View Full Version : Thread Time Variables


ShadowTech
07-11-2001, 11:05 PM
I have tried searching this forum for the answer.. but have come up empty.. so I am sorry if this has already been asked.

I am trying to get the date and time to show under the "Thread Starter" column in the threads listing.. but I cannot figure out the right variable to display the thread creation date and the creation time. Would this be pulled from the original post in the thread or what?

I have tried looking thru all the vB templates and cannot seem to find anything like $thread[postdate] $thread[posttime] .. I hope someone understands what I am trying to do and can help me.

Thanks.

fury
09-22-2001, 08:58 AM
I'd like to know this too.

Admin
09-22-2001, 09:07 AM
In forumdisplay.php add this code:
$thread[startdate]=vbdate($dateformat,$thread[dateline]);
$thread[starttime]=vbdate($timeformat,$thread[dateline]);
right before
$thread[lastreplydate]=vbdate($dateformat,$thread[lastpost]);
$thread[lastreplytime]=vbdate($timeformat,$thread[lastpost]);
Now you should be able to use $thread[startdate] and $thread[starttime] in the templates.

fury
09-22-2001, 08:38 PM
There are two instances of the code you said to find. Add before both instances?

fury
09-22-2001, 08:52 PM
Nevermind, I added it before both instances and it works great

Thanks :)

Admin
09-23-2001, 09:07 AM
Sorry about that. :o One is for the open threads, and the second is for the closed.

hacker
10-03-2001, 12:54 PM
Originally posted by FireFly
In forumdisplay.php add this code:
$thread[startdate]=vbdate($dateformat,$thread[dateline]);
$thread[starttime]=vbdate($timeformat,$thread[dateline]);
right before
$thread[lastreplydate]=vbdate($dateformat,$thread[lastpost]);
$thread[lastreplytime]=vbdate($timeformat,$thread[lastpost]);
Now you should be able to use $thread[startdate] and $thread[starttime] in the templates.

Could you show me which template and where to place the code?

Admin
10-03-2001, 12:59 PM
In the forumdisplaybit template, or any of the templates used inside it.

ShadowTech
03-20-2002, 09:37 AM
hate to bring this back up.. but this doesn't appear to work on 2.2.4 .. what would need changed in order for it to work on the new build?

Muellmann
08-19-2006, 01:26 PM
I tried all but cannot make it. I have 3.60. I found in the forumdisplay.php not this code mentioned above. Maybe any other File is needed to be edited with 3.60? Any Help would be much appreciated!

Snatch
08-21-2006, 07:22 AM
First, jo must creat a new "Plugin"

Plugin Attitudes:
Produkt - vBulletin
(Hook) - threadbit_process
Titel - your choise
PHP-Code:
if ($thread['dateline'])
{
$thread['creationdate'] = vbdate($vbulletin->options['dateformat'], $thread['dateline'], true);
$thread['creationtime'] = vbdate($vbulletin->options['timeformat'], $thread['dateline']);
}
else
{
$thread['creationdate'] = '';
$thread['creationtime'] = '';
}

Than save the Plugin.

Now search in template "threadbit":

<if condition="$show['guestuser']">
$thread[postusername]
<else />

Below add:

<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]', '_self')">Von $thread[postusername] : $thread[creationdate] um $thread[creationtime] Uhr</span>
</if>
</div>


GreeTz
Snatch

chetcarson
08-30-2006, 03:26 PM
Snatch thats great.

Big Thanks!

Using 3.6.0

I added the plugin as you indicated, however in the threadbit template I found this code already exists:

<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]', '_self')">$thread[postusername]</span>

Adding $thread[creationdate] and $thread[creationtime] after the closing span is all that was needed there.

It looks like this:

<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]', '_self')">$thread[postusername]</span> $thread[creationdate] $thread[creationtime]