PDA

View Full Version : Thread created date -- partially working


Christine
07-20-2005, 01:15 AM
Hrm.

This is not displaying on current threads, nor threads that I start, so I thought it was just not working -- BUT -- I just tested the Reported Post Creates Thread hack and it worked on that. When I report a post, it creates the thread and puts the date in place like it should.

Bizarre.

All this needs to do is display the thread creation date from thread.dateline on FORUMDISPLAY.

Can anyone tell me what I am missing here -- perhaps using the wrong hook?

<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
<plugin active="1" product="vBulletin">
<title>Thread Created Date</title>
<hookname>threadbit_display</hookname>
<phpcode><![CDATA[$threadcreated = vbdate($vbulletin->options['dateformat'], $thread[dateline]) . ' ' . vbdate($vbulletin->options['timeformat'], $thread[dateline]);
]]></phpcode>
</plugin>
</plugins>

Marco van Herwaarden
07-20-2005, 06:44 AM
Just a wild guess, but you might not have access to the $vbulletin->options['dateformat'] in this function. Check if that is filled.

Christine
07-20-2005, 09:41 PM
Well, from what I can see it appears to be. It is called in the query as thread.dateline, which was the same as in the identical query for this in 3.0.x -- no changes to the code other than the naming conventions (forumdisplay.php) for this routine.

I even tried just hacking it to be what is working in 3.0.x, same file, same function, same location -- same code above as I am using in 3.0.x (less the naming convention change). This is in the spot directly before the hook I am trying to use.

Am I missing something quite elementary here?

<~~ struggling a bit more with the 3.5 code than I did migrating from 2.x to 3.0

Christine
07-24-2005, 12:29 AM
Double checked.

It is definitely in the function -- it is used by the announcement date. :/

Christine
07-28-2005, 09:45 PM
Right concept, wrong hook (https://vborg.vbsupport.ru/showthread.php?t=93074).

<~~ still learning. :)

Dontom
12-28-2005, 11:38 AM
Did anyone get this working?
Thanks

Grendel
01-05-2006, 03:56 PM
Yep.

Plugin-Titel: name it what you want, e.g. Thread Start Date
Hook: threadbit_process
Plugin-Code:
if ($thread['dateline'])
{
$thread['creationdate'] = vbdate($vbulletin->options['dateformat'], $thread['dateline'], 1);
$thread['creationtime'] = vbdate($vbulletin->options['timeformat'], $thread['dateline']);
}

Template-Change in threadbit (whereever you want to show up the date) add:
$thread[creationdate]

That's taken from: https://vborg.vbsupport.ru/showthread.php?t=93074

Dontom
01-06-2006, 03:17 AM
Hi - it works perfect, why don't you release it as a hack?
Danke
Thomas

Grendel
01-07-2006, 07:31 PM
That's only a part of the bigger hack of kirby, so it's none of my work. Won't be fair to release this as a hack.