Announcement

Collapse
No announcement yet.

Want to add date/time of ORIGINAL post in thread views

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dennis Olson
    replied
    Template change in THREADBIT template:

    Add the BOLD code:

    Code:
    <span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]')">$thread[postusername] [b]<font size="-3" color="#556B2F">&nbsp;&nbsp;&nbsp;&nbsp;($thread[datelinedate] at $thread[datelinetime])</font>[/b]</span>
    The reason I didn't create a CLASS for the font size & color was that I was experimenting, and when I got it to work, some crisis or other got my attention, and I never went back and made it pretty. Feel free to change as you see fit.

    Leave a comment:


  • ZanexGt
    replied
    Dennis,

    Thank you very much for posting the code above. It seemes to work perfectly on my board. I am having a problem with the formatting of the dateline.

    I would like my datelines to show up like yours,

    Posted by: Maher (09-15-2004 at 10:04 AM)

    Instead, they show up like this on my board.

    Username @ 09-15-2004 10:04 AM

    I just can't figure out how to get both of the parenthesis working correctly. Any help is greatly appreciated.

    Leave a comment:


  • Dennis Olson
    replied
    Here's the answer (I'm only putting this here for my own reference later):

    Find this in search.php:
    Code:
    $dataQuery = "
    	 SELECT $previewfield
    			 thread.threadid, thread.threadid AS postid, thread.title AS threadtitle, thread.iconid AS threadiconid,
    			 thread.replycount, IF(thread.views=0, thread.replycount+1, thread.views) as views, thread.sticky,
    And add this directly below it:
    Code:
    thread.dateline,

    Leave a comment:


  • Jake Bunce
    replied
    search.php likely uses different code to build the thread bits. So you would need to add the date code to the code for the search results as well.

    I recommend you post on www.vbulletin.org for help with this.

    Leave a comment:


  • Dennis Olson
    replied
    It doesn't work for SEARCH however. I attempted to define the vars in functions_search.php' and then in 'search.php', but was unable to produce a meaningful value. (Whatever is going on in SEARCH is leaving the vars defind as null/zero, so I get the formatted date for 1969. )

    What am I missing?

    Leave a comment:


  • Dennis Olson
    replied
    [ECON] Investors choose to ignore warnings
    Posted by: Maher (09-15-2004 at 10:04 AM)

    Done. Thanks for the information everyone.

    Leave a comment:


  • Dennis Olson
    replied
    Crud. Thanks....

    Leave a comment:


  • Boxy
    replied
    I'm not aware there is a way of doing this through templates. One way or the other I think the code would need to be modified.

    Leave a comment:


  • Dennis Olson
    replied
    I see. Is there ANY way to achieve the desired result WITHOUT code-mods? I would VERY much rather do the job through templates. I know what code to modify, and what to add, but don't want to, if at all possible.

    Thoughts...?

    Leave a comment:


  • Boxy
    replied
    Originally posted by Dennis Olson
    Okay, in Threadbit, I've added the following at the beginning of the template:

    Code:
    $thread[datelinedate] = vbdate($vboptions[dateformat], $thread[dateline]);
    $thread[datelinetime] = vbdate($vboptions[timeformat], $thread[dateline]);
    Adding PHP to the templates isn't going to work. The templates will only parse html. You will need to modify the code in order to achieve this. Try asking over at vBulletin.org

    Leave a comment:


  • Dennis Olson
    replied
    bump for the day shift

    Leave a comment:


  • Dennis Olson
    replied
    Okay, in Threadbit, I've added the following at the beginning of the template:

    Code:
     $thread[datelinedate] = vbdate($vboptions[dateformat], $thread[dateline]);
      $thread[datelinetime] = vbdate($vboptions[timeformat], $thread[dateline]);
    I've also added the following code:

    after -

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

    Code:
       $thread[datelinedate]:$thread[datelinetime]
    But it gives me just ":" after the member name, with no data. I even attempted to put it inside the SPAN syntax, but the symptoms are the same. Can someone please tell me what I'm doing wrong?

    Thanks!

    Leave a comment:


  • Dennis Olson
    replied
    Thanks! Great start....

    Leave a comment:


  • Jake Bunce
    replied
    The variable for the timestamp that can be used in the threadbit template is $thread[dateline]. This variable would need to be used in the following PHP code within the files, like this:

    Code:
    // PARSE DATE AND TIME
    $thread[datelinedate] = vbdate($vboptions[dateformat], $thread[dateline]);
    $thread[datelinetime] = vbdate($vboptions[timeformat], $thread[dateline]);
    Then you will be able to use the two variables on the left in the templates.

    Leave a comment:


  • Dennis Olson
    replied
    I understand. But you guys do that in your individual posts. All I need to know is what to look for (code-wise) and in what template to look for it. I can take it from there.

    Leave a comment:

Loading...
Working...
X