Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2010, 10:41 PM
dfc005 dfc005 is offline
 
Join Date: Mar 2008
Posts: 198
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Using query_read to get birthday

I'm trying to use query_read to get a users birthday to display it to them in a custom page. But for some reason, it's always blank when it's returned.

I tried using birthday_search as well, it also comes back blank.

Any ideas?
Reply With Quote
  #2  
Old 10-31-2010, 11:28 PM
HyperActiv HyperActiv is offline
 
Join Date: Mar 2009
Location: Israel
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried:

PHP Code:

$db
->query("
                SELECT user.birthday
                FROM " 
TABLE_PREFIX "user
"
); 
Reply With Quote
  #3  
Old 10-31-2010, 11:36 PM
dfc005 dfc005 is offline
 
Join Date: Mar 2008
Posts: 198
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup. Returns one row but that row has no value for birthday.....
Reply With Quote
  #4  
Old 10-31-2010, 11:56 PM
JamesC70 JamesC70 is offline
 
Join Date: Jun 2007
Posts: 219
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're already including the vBulletin framework in your custom page, then $userinfo[birthday] will contain the user's birthdate.
Reply With Quote
  #5  
Old 11-01-2010, 12:06 AM
dfc005 dfc005 is offline
 
Join Date: Mar 2008
Posts: 198
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I assume as much but it's not returning anything either.

When I do a print_r on userinfo, I get the following....

Code:
Array ( [userid] => 8 [field7] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [usergroupid] => 6 [membergroupids] => [displaygroupid] => 6 [username] => DFC005 [password] => 123456789 [passworddate] => 1274396424 [email] => email@email.com [styleid] => 1 [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => 2 [showbirthday] => 2 [usertitle] => Administrator [customtitle] => 0 [joindate] => 1272349434 [daysprune] => 0 [lastvisit] => 1288045810 [lastactivity] => 1288045810 [lastpost] => 1273533161 [lastpostid] => 0 [geoip_location] => au [posts] => 1 [reputation] => 10 [reputationlevelid] => 1 [timezoneoffset] => [pmpopup] => 0 [avatarid] => 0 [avatarrevision] => 0 [profilepicrevision] => 0 [sigpicrevision] => 0 [options] => 11536471 
[birthday] => [birthday_search] => 0000-00-00 
[maxposts] => -1 [startofweek] => 1 [ipaddress] => [referrerid] => 0 [languageid] => 0 [emailstamp] => 0 [threadedmode] => 0 [autosubscribe] => -1 [pmtotal] => 0 [pmunread] => 0 [salt] => 7YAl3H0'O6@-J'8Yss3sYYa{@m|Pw_ [ipoints] => 0 [infractions] => 0 [warnings] => 0 [infractiongroupids] => [infractiongroupid] => 0 [adminoptions] => 0 [profilevisits] => 2 [friendcount] => 0 [friendreqcount] => 0 [vmunreadcount] => 0 [vmmoderatedcount] => 0 [socgroupinvitecount] => 0 [socgroupreqcount] => 0 [pcunreadcount] => 0 [pcmoderatedcount] => 0 [gmmoderatedcount] => 0 [saved_languageid] => 0 [lang_options] => 1 [lang_code] => en [lang_charset] => ISO-8859-1 [lang_locale] => [lang_imagesoverride] => [lang_dateoverride] => [lang_timeoverride] => [lang_registereddateoverride] => [lang_calformat1override] => [lang_calformat2override] => [lang_logdateoverride] => [lang_decimalsep] => . [lang_thousandsep] => , [showsignatures] => 1 [showavatars] => 1 [showimages] => 1 [coppauser] => 0 [adminemail] => 1 [showvcard] => 0 [dstauto] => 1 [dstonoff] => 0 [showemail] => 0 [invisible] => 0 [showreputation] => 0 [receivepm] => 1 [emailonpm] => 0 [hasaccessmask] => 0 [postorder] => 0 [receivepmbuddies] => 0 [noactivationmails] => 0 [pmboxwarning] => 0 [showusercss] => 1 [receivefriendemailrequest] => 1 [vm_enable] => 1 [vm_contactonly] => 0 [pmdefaultsavecopy] => 0 [adminavatar] => 0 [adminprofilepic] => 0 [urlusername] => Mute [musername] => Mute [displaygrouptitle] => Administrators [displayusertitle] => Administrator [realstyleid] => 0 [securitytoken_raw] => dd4f3f7f40f585aff41cea7cb0587c942f0a5e25 [securitytoken] => 1288573456-8e7af88a0331421eeb754fe2dd1e963e6a737d8b [logouthash] => 1288573456-8e7af88a0331421eeb754fe2dd1e963e6a737d8b [tzoffset] => [lastvisitdate] => 10-25-2010 10:30 PM [permissions] => Array ( [usergroupid] => 6 [title] => Administrators [description] => [usertitle] => Administrator [passwordexpires] => 180 [passwordhistory] => 360 [pmquota] => 50 [pmsendmax] => 5 [opentag] => [closetag] => [canoverride] => 0 [ispublicgroup] => 0 [forumpermissions] => 16777215 [pmpermissions] => 7 [calendarpermissions] => 63 [wolpermissions] => 31 [adminpermissions] => 3 [genericpermissions] => 2147483583 [genericpermissions2] => 1 [genericoptions] => 55 [signaturepermissions] => 237567 [visitormessagepermissions] => 63 [attachlimit] => 0 [avatarmaxwidth] => 80 [avatarmaxheight] => 80 [avatarmaxsize] => 20000 [profilepicmaxwidth] => 100 [profilepicmaxheight] => 100 [profilepicmaxsize] => 65535 [sigpicmaxwidth] => 500 [sigpicmaxheight] => 100 [sigpicmaxsize] => 10000 [sigmaximages] => 0 [sigmaxsizebbcode] => 7 [sigmaxchars] => 0 [sigmaxrawchars] => 0 [sigmaxlines] => 0 [usercsspermissions] => 63 [albumpermissions] => 255 [albumpicmaxwidth] => 600 [albumpicmaxheight] => 600 [albumpicmaxsize] => 100000 [albummaxpics] => 100 [albummaxsize] => 0 [socialgrouppermissions] => 65535 [pmthrottlequantity] => 0 [groupiconmaxsize] => 65535 [maximumsocialgroups] => 5 ) [forumpermissions] => Array ( [1] => 16777215 [2] => 16777215 ) [attachmentextensions] => bmp doc gif jpe jpeg jpg pdf png psd txt zip [attachmentpermissions] => Array ( [bmp] => Array ( [permissions] => 1 [size] => 20000 [height] => 280 [width] => 620 ) [doc] => Array ( [permissions] => 1 [size] => 20000 [height] => 0 [width] => 0 ) [gif] => Array ( [permissions] => 1 [size] => 20000 [height] => 280 [width] => 620 ) [jpe] => Array ( [permissions] => 1 [size] => 20000 [height] => 280 [width] => 620 ) [jpeg] => Array ( [permissions] => 1 [size] => 20000 [height] => 280 [width] => 620 ) [jpg] => Array ( [permissions] => 1 [size] => 100000 [height] => 0 [width] => 0 ) [pdf] => Array ( [permissions] => 1 [size] => 20000 [height] => 0 [width] => 0 ) [png] => Array ( [permissions] => 1 [size] => 20000 [height] => 280 [width] => 620 ) [psd] => Array ( [permissions] => 1 [size] => 20000 [height] => 0 [width] => 0 ) [txt] => Array ( [permissions] => 1 [size] => 20000 [height] => 0 [width] => 0 ) [zip] => Array ( [permissions] => 1 [size] => 100000 [height] => 0 [width] => 0 ) ) [reallanguageid] => 0 )
Both birthday and birthday_search are blank. Is this a vB setting some where?
Reply With Quote
  #6  
Old 11-01-2010, 12:23 AM
JamesC70 JamesC70 is offline
 
Join Date: Jun 2007
Posts: 219
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you testing with an account that's unalterable (per your config file)?

The only account in my database with no birthdate and a birthday_search of 0000-00-00 is my admin account, user #1.

If you look in your database through phpMyAdmin or similar, what's in the birthdate field for user #8?
Reply With Quote
  #7  
Old 11-01-2010, 12:31 AM
dfc005 dfc005 is offline
 
Join Date: Mar 2008
Posts: 198
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's an admin account and it's unalterable but it certainly has a birthdate and birthday_search as I've checked the table using phpMyAdmin.

--------------- Added [DATE]1288576002[/DATE] at [TIME]1288576002[/TIME] ---------------

Tried accessing a different userid which isn't an admin and isn't locked and it has the same problem.

--------------- Added [DATE]1288586885[/DATE] at [TIME]1288586885[/TIME] ---------------

OK, after further testing, it seems to only be a problem on my development server. No idea how to fix it though.
Reply With Quote
  #8  
Old 11-01-2010, 11:24 AM
HyperActiv HyperActiv is offline
 
Join Date: Mar 2009
Location: Israel
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dfc005 View Post
Yup. Returns one row but that row has no value for birthday.....
What do you mean row has no value for birthday?

In some of the cases you'll need to use PHP function
PHP Code:
date(); 
to get logical date, and not the unix time.
Reply With Quote
  #9  
Old 11-01-2010, 08:03 PM
dfc005 dfc005 is offline
 
Join Date: Mar 2008
Posts: 198
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The row was simply blank, no value. Not sure why it wasn't working on my development server but I reinstalled a fresh copy of vBulletin and it all seems to be fine now.
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 06:35 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.04335 seconds
  • Memory Usage 2,253KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete