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 02-10-2008, 02:44 PM
Loanmanken's Avatar
Loanmanken Loanmanken is offline
 
Join Date: Dec 2007
Location: North Carolina
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Join Date Plugin

I have been snooping around in vb file trying to find a way to make a users join date information display on the showgroups page and I found a code in the member.php file and decided to try that in a plugin. It worked...well sort of, it does not display the correct date any ideas? I have even tried including the class_postbit.php in the showgroups.php file...which did not work. If it matters the hook location is in "showgroups_user"....

code used in meet_our_staff_joindate plugin

Code:
// JOIN DATE 
$userinfo['datejoined'] = vbdate($vbulletin->options['dateformat'], $userinfo['joindate']);
$jointime = (TIMENOW - $userinfo['joindate']) / 86400; 
// End Join Date
Attached Images
File Type: jpg showgroup.jpg (55.2 KB, 0 views)
Reply With Quote
  #2  
Old 02-10-2008, 06:11 PM
Loanmanken's Avatar
Loanmanken Loanmanken is offline
 
Join Date: Dec 2007
Location: North Carolina
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump^^
Reply With Quote
  #3  
Old 02-10-2008, 06:29 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You got code from member.php then included class_postbit.php?! lol

Have you looked in showgroups.php around the area where the showgroups_user hook is evaluated?

You will notice that the variable $user is used instead of $userinfo...maybe that will solve your problem
Reply With Quote
  #4  
Old 02-10-2008, 06:32 PM
Loanmanken's Avatar
Loanmanken Loanmanken is offline
 
Join Date: Dec 2007
Location: North Carolina
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bangs head against wall! I will go try out your suggesstions now, brb. Thank you again!

Edit: Yeah I have everything in order, I even tried to include the class_postbit.php file again...

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

Okay now I am trying a different code in my plugin:

Code:
$userinfo[parsed_stamp] = vbdate('l dS \of F Y h:i:s A', $userinfo['joindate']);
But I am still getting January 1, 1970! How do I get the plugin to pull the user's joindate from the database? Is there a query I need to add to the plugin?
Reply With Quote
  #5  
Old 02-11-2008, 07:33 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Re-read the last line of my previous post and don't PM me please, just be patient.
Reply With Quote
  #6  
Old 02-11-2008, 07:37 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thus is all I use in the 2 hooks to get it for Admins and Mods:

Code:
$user['datejoined'] = vbdate($vbulletin->options['dateformat'], $user['joindate'], true);  

I've been using this same code since 3.5.4 and it still works fine in 3.7.0 beta 4. You had it right in the first post except for the missing true.

I got the location code if you need that, too.
Reply With Quote
  #7  
Old 02-11-2008, 02:02 PM
Loanmanken's Avatar
Loanmanken Loanmanken is offline
 
Join Date: Dec 2007
Location: North Carolina
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
Re-read the last line of my previous post and don't PM me please, just be patient.
Okay thank you for your help and sorry it won't happen again, was just stressed out that this small amount of code was getting the best of me I guess. Somehow I missed the last line of your post...I don't know how I managed to do that.

Quote:
Originally Posted by Boofo View Post
Thus is all I use in the 2 hooks to get it for Admins and Mods:

Code:
$user['datejoined'] = vbdate($vbulletin->options['dateformat'], $user['joindate'], true);  

I've been using this same code since 3.5.4 and it still works fine in 3.7.0 beta 4. You had it right in the first post except for the missing true.

I got the location code if you need that, too.
Thanks Boofo I will try this right away, now I see what Opserty was trying to tell me before.

Sweet thanks guys now it works! Although I did have to make two plugins because vb won't let me use two hook locations for one plugin but whatever I got it working now.

Code:
$user['datejoined'] = vbdate('l dS \of F Y h:i:s A', $user['joindate'], true);  
$jointime = (TIMENOW - $userinfo['joindate']) / 86400;
Attached Images
File Type: jpg showgroup.jpg (54.3 KB, 0 views)
Reply With Quote
  #8  
Old 02-11-2008, 02:30 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That one line is all you need. Put it in the admin and mod hooks for showgroups and you are all set. Now, if you want the user's location, that takes a little more code in 3.7.0. They chopped some stuff out of the showgroups file. I'm still trying to fiogure out a way to get the Usergroup descriptions in there. The code I used to use isn't in showgroups.php anymore.

Yes, they use $user all through there. I figured you would have caught that with all the stuff you have done with it, but it can get frustrating when something doesn't work. You get to the point you will try almost anything. Been there, still doing that.
Reply With Quote
  #9  
Old 02-11-2008, 02:42 PM
Loanmanken's Avatar
Loanmanken Loanmanken is offline
 
Join Date: Dec 2007
Location: North Carolina
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lol that one line gave me a headache for four hours yesterday, I even took a nap after a while to think it was something so simple it is funny and embarrassing all at the same time. I am dreading having to update my board to 3.7.x I just hope that jelsoft will not change too much more around.
Reply With Quote
  #10  
Old 02-11-2008, 03:11 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That line has been using since at least 3.5.4. I had to get used to the true back then and it drove me nuts at first. But it makes things a lot easier once you get used to it. I don't think it is just vb you need to worry about as much as PHP itself is changing. Actually, I like the code for 3.7 better in some ways and not so much in others. Its a giant leap forward from 3.5.4. A lot of things are easier if you can just find out where they hid the damned things.
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 10:57 AM.


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.10571 seconds
  • Memory Usage 2,277KB
  • Queries Executed 12 (?)
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
  • (5)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete