Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-28-2000 Last Update: Never Installs: 0
 
No support by the author.

Does anyone know if the date/time a thread was originally posted is kept as a record in the thread info? If so, how can I call it and display it? I'd like to display it on the forumview page, right under the name of the thread starter. I know it probably involves editing the forumdisplaybit template, and I know where to stick it and how, I just need to know what.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-28-2000, 12:51 PM
Guest
 
Posts: n/a
Default

Each thread has a dateline field where the date and time stamp is stored.

In forumdisplay.php look for the line that starts with
Code:
$threads=$DB_site->query("SELECT
and add thread.dateline into the list of fields. i.e.
Code:
$threads=$DB_site->query("SELECT thread.dateline AS threadstart,
Leave the rest of the line as it is.

Then look for:
Code:
$lastreplytime=date($timeformat,$thread[lastpost]+(($timeoffset+$bbtimezoneoffset)*3600));
and after that add:
Code:
$threadstart=date($timeformat,$thread[threadstart]+(($timeoffset+$bbtimezoneoffset)*3600));
Then in your forumdisplaybit template add $threadstart where you want it to show at.

Just a note though. Make sure you back up first because I haven't tested this. Unless there is a syntax error it should work though.
Reply With Quote
  #3  
Old 12-28-2000, 04:42 PM
Guest
 
Posts: n/a
Default

Great! Works perfectly.

Only one thing: I wanted both the time and the date. Fortunately, I was able to figure that out based on looking at what you had me doing, and the other stuff around it.

The first part of your instructions, the part about thread.dateline, would remain unchanged.

The second part is where my modification comes in.

Instead of adding
Code:
$threadstart=date($timeformat,$thread[threadstart]+(($timeoffset+$bbtimezoneoffset)*3600));
I changed it to add
Code:
$threadstarttime=date($timeformat,$thread[threadstart]+(($timeoffset+$bbtimezoneoffset)*3600));
$threadstartdate=date($dateformat,$thread[threadstart]+(($timeoffset+$bbtimezoneoffset)*3600));
So now, there are two variables, $threadstarttime and $threadstartdate.

I put these in the forumdisplaybit template, in the same column as the thread starter. I changed the font from normalfont to smallfont, and put a linebreak in so the thread starter's name is on one line, and the date and time are on the second line. I also put in the font color tags so the time is a different color, like it is in the last post column (speaking of that column, I also put in a linebreak and switched it to smallfont, so both columns have the same look). The linebreaks are so these columns don't get too wide, which is esp. a problem for those with 800x600 displays, because it compresses the thread name column too much.

If you want to see the final result, look here: http://www.jjr512.com/bbs/forumdisplay.php?forumid=1
Reply With Quote
  #4  
Old 12-28-2000, 05:04 PM
Guest
 
Posts: n/a
Default

Looks good. I am glad you got it to work the way you wanted to.
Reply With Quote
  #5  
Old 12-29-2000, 07:11 AM
Guest
 
Posts: n/a
Default

I have noticed a rather odd problem.

For some threads, the start date in the forum list, that shows up from this hack, shows as some date in the year 1901. Now if you go in the thread itself and look at the post date of the first post, it is not 1901, but appears to be correct.

So far, I've only seen this happen a few times, and it looks like it's always with threads that were started in the UBB days. It doesn't seem to happen with any threads that were started after migrating to vB.

Any comments? Suggestions? Fix ideas?
Reply With Quote
  #6  
Old 12-29-2000, 07:15 AM
Guest
 
Posts: n/a
Default

And as someone just pointed out, the start date that you see in the forum view, as a result of this hack, for the threads started in UBB days are all the same: Dec. 13, 1901, at 3:45pm.

So to recap, all threads that were started in the UBB show up with a start date/time as Dec. 13 1901 3:45pm in the forum view, which is what the hack does. The actual date and time, in the actual thread, are correct.

Weird.
Reply With Quote
  #7  
Old 12-29-2000, 11:32 AM
Guest
 
Posts: n/a
Default

I dont really know. but I think a good reason will be Bug 2000
Reply With Quote
  #8  
Old 12-29-2000, 05:05 PM
Guest
 
Posts: n/a
Default

Since UBB stores all of its contents in HTML format, the import script has to try and interpret what it sees. If you changed the default date format to something the import script doesn't recognize then it will either

1. Interpret it wrong.
2. Not import a valid date which MySQL will not let be inserted into the database.
3. MySQL/PHP will convert the erroneous data into an integer and insert that which will give you false results.
4. PHP will insert a ZERO and is simply displaying the earliest date it know.
Reply With Quote
  #9  
Old 12-29-2000, 05:26 PM
Guest
 
Posts: n/a
Default

OK, well, I guess the thing I can't figure out is this.

I thought this hack got its data from the same source as displays the post date in the first post. If you open the thread and look at the first post, you will see that the date is correct. A correct date, in this case, is anything from or after May 17, 2000, which was when the BBS opened (in UBB form). But, out in the forum view, the date is always that 1901 date. If this hack gets its info from the same source, shouldn't the data be the same? Or is the hack mininterpreting the data, or is it getting it from a different source? In either case, could the hack be rewritten so that it either interprets the data correctly, or else gets it from the same source as the date that's displayed in the post itself?

Take a look: http://www.jjr512.com/bbs/forumdisplay.php?forumid=2

And set the view to longer than a month, if necessary, and go back to the oldest page. Look at all the thread start dates in the column that normally just has the thread starter's name. Then go into that thread and look at the post date for the first post. They should match; they don't. For any posts started after the vB migration, they do. This is why I'm confused.
Reply With Quote
  #10  
Old 12-29-2000, 05:32 PM
Guest
 
Posts: n/a
Default

You asked for thread start date which is different from the date that is saved for a post.

Each are different things. Every new thread creates not only a thread record but a post record. The thread record records information relating to the thread as a whole and is cross-referenced with the actual posts through the threadid.

Now without looking at your actual data stored in the database, I can be sure where the problem is. I believe the date can be modified to reflect the date of the first post as opposed to the thread date but I will have to look into it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07269 seconds
  • Memory Usage 2,270KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete