vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I add a button/link that runs SQL Queries? (https://vborg.vbsupport.ru/showthread.php?t=68341)

Ocean 08-16-2004 09:40 PM

Quote:

Originally Posted by Colin F

oh of course :)

<snip>

That should do it.

Ah! Well, now the date is showing up in the correct format - there are only two problems remaining:


1. The date is showing up as 12-31-1969 (which is obviously not the correct date).

2. The time is missing.


<sheepish> :)

Colin F 08-17-2004 04:20 AM

for 2. change $vboptions[dateformat] to any time/dateformat you like.
See http://www.php.net/date for reference and be sure to enclose it with "'s

for 1. have a look in your database and tell me what value is saved in the whoviewedreset field of the thread you are trying this on.

Ocean 08-17-2004 12:13 PM

Quote:

Originally Posted by Colin F

for 2. change $vboptions[dateformat] to any time/dateformat you like.
See http://www.php.net/date for reference and be sure to enclose it with "'s

Done. I originally made a mistake with the syntax, but I figured out what I did wrong, and now the format is fine.

I'm now getting:


12/31/1969 - 07:00 pm


Quote:

Originally Posted by Colin F

for 1. have a look in your database and tell me what value is saved in the whoviewedreset field of the thread you are trying this on.

"1092748098"


When I reset the counter, the database value does change. After I read off the above value, I reset the counters again, and it changed to "1092748229". However, the date and time shown is exactly the same.


Edit:

Aha! Solved! The problem was that I had to change this:


$whoviewedreset = vbdate("m/d/Y - h:i a", '$thread[whoviewedreset]');

to this:

$whoviewedreset = vbdate("m/d/Y - h:i a", $thread[whoviewedreset]);


The ' characters around the $thread[whoviewedreset] variable was invalidating the value and returning zero.


So, now everything is working perfectly!



I can't thank you enough, Colin. I really appreciate all the time you put into this. And again, I apologize for making you do so much coding. :)


All times are GMT. The time now is 09:46 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.02880 seconds
  • Memory Usage 1,726KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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