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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2010, 10:44 PM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default newbie with lots of newbie questions!

hello!

i been studing some basic php stuff and now im open to take the challenge to learn how does vbulletin works, so far i been checking random php files on vbulletin base files and some plugins from modifications, and i have the following questions which i havent been able to solve by myself:
  • what does this->registry->options[] means/contains? i know this-> its part of classes on php, but, im not sure how does the whole thing works on vbulletin
  • how does vbulletin->GPC and vbulletin->input->clean_array_gpc works? its the same as on vbulletin 3 documentation?
  • i need to use "Send PM" automatically functions, i have found a vbulletin 3 article on this but, i suppose its obsolete on vb4, i have tried to find how to do this by examinating private.php on vb4 and i havent had any luck, any suggestions?
  • is the $db-> fuction list is the same as vb3?

thanks in advance for your time and replies
Reply With Quote
  #2  
Old 01-26-2010, 11:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

- Hmmm, I'm not a php guru, but there are some functions that require you to use $this->registry->posts or $this->registry->options instead of just $posts or $vbulletin->options. The best thing to figure out which to use is to locate the hook you are wanting to use in the php code and see the syntax used right there.

- information regarding the input cleaner is still valid for vB4

- I don't know anything about the send PM article, sorry

- $db should all be the same. If you are writing code for the CMS however, the syntax will be a little different with a "vB::" in front of it.
Reply With Quote
  #3  
Old 01-27-2010, 02:41 AM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
- Hmmm, I'm not a php guru, but there are some functions that require you to use $this->registry->posts or $this->registry->options instead of just $posts or $vbulletin->options. The best thing to figure out which to use is to locate the hook you are wanting to use in the php code and see the syntax used right there.

- information regarding the input cleaner is still valid for vB4

- I don't know anything about the send PM article, sorry

- $db should all be the same. If you are writing code for the CMS however, the syntax will be a little different with a "vB::" in front of it.
hello Lynne!

thanks a lot for your answers now i hope someone else can help me with the PM bit, in the meanwhile ill check the rest of the stuff you commented, thanks again!
Reply With Quote
  #4  
Old 01-27-2010, 03:05 AM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried using that code? It seems as it should still work. If you have any specific questions regarding a error with that code you have posted feel to post with a specific question.

I can not start to help you when you have not even tried to use that code thus have no real question as of yet.
Reply With Quote
  #5  
Old 01-27-2010, 03:14 AM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BBR-APBT View Post
Have you tried using that code? It seems as it should still work. If you have any specific questions regarding a error with that code you have posted feel to post with a specific question.

I can not start to help you when you have not even tried to use that code thus have no real question as of yet.
thanks for your reply!

i just havent tried it because im not sure which part is the correct one but i suppose its time to start poking around, vbulletin its a *HUGE* script and its hard for a php green rookie like me to find the right direction, but ill start checking files and see what i can come up with thanks!
Reply With Quote
  #6  
Old 01-27-2010, 03:22 AM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would use plugins. If you want it to send a welcome message you would use a hook like register_addmember_complete. Then when the user finishes registering it would call up the code you just put in the plugin. So if you put that code for the private message in there it would send the message when they finished.

You should set up a test board so that it is on a password protected directory. This way you can do all your testing there and not worry about breaking your live site.
Reply With Quote
  #7  
Old 01-27-2010, 07:14 PM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BBR-APBT View Post
You would use plugins. If you want it to send a welcome message you would use a hook like register_addmember_complete. Then when the user finishes registering it would call up the code you just put in the plugin. So if you put that code for the private message in there it would send the message when they finished.

You should set up a test board so that it is on a password protected directory. This way you can do all your testing there and not worry about breaking your live site.

im running a test board already, i have done some other modifications, what exactly i want to do is to make a modification where the user receives a notification once he makes 50 posts, i have already the full code working in the right hook which is postbit_display_complete but, the only element im missing here is the function or class vbulletin uses to send a PM which i can run everytime a user hits the 50 post mark
Reply With Quote
  #8  
Old 01-27-2010, 07:16 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by White_Snake View Post
im running a test board already, i have done some other modifications, what exactly i want to do is to make a modification where the user receives a notification once he makes 50 posts, i have already the full code working in the right hook which is postbit_display_complete but, the only element im missing here is the function or class vbulletin uses to send a PM which i can run everytime a user hits the 50 post mark
That is what the code you linked to. That is what you need.
Reply With Quote
  #9  
Old 01-27-2010, 08:17 PM
White_Snake's Avatar
White_Snake White_Snake is offline
 
Join Date: Jul 2005
Location: Guadalajara Mexico
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BBR-APBT View Post
That is what the code you linked to. That is what you need.
i checked both classes on vb3 and vb4 and they are identical, im gonna play around with it for a while, thanks!

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

okay i tried it out and it works nicely except for one issue, the constant TIMENOW on vb3 is not working anymore on vb4 so i need to find its equivalent

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

nevermind the timenow issue, it was a mistake on my side, the issue im having is that the internal vbulletin arrays arent working in the plugin, this is my code:

PHP Code:
$pmdm =& datamanager_init('PM'$vbulletinERRTYPE_ARRAY); 
        
$pmdm->set('fromuserid'1); 
        
$pmdm->set('fromusername'Admin); 
        
$pmdm->set('title''congratulations'); 
        
$pmdm->set('message'"congratulations $vbulletin->userinfo['username'] you have made your 50th post, we're all so prod of you keep on posting"); 
        
$pmdm->set_recipients('$vbulletin->userinfo['username']'$permissions); 
        
$pmdm->set('dateline'TIMENOW); 
    
        
$pmdm->save(); 
if i directly write a username on the set_recipients instead of $vbulletin->userinfo['username'] the PM works perfectly, but if i use it, the PM is not sent, as well, if i use $vbulletin->userinfo['username'] in the message, i get: Array['username'] in the output instead of the nick of the user receiving the PM

thanks again for any help
Reply With Quote
  #10  
Old 01-27-2010, 11:45 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This line
Code:
        $pmdm->set_recipients('$vbulletin->userinfo['username']', $permissions);
would be
Code:
        $pmdm->set_recipients($vbulletin->userinfo['username'], $permissions);
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:17 PM.


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.05520 seconds
  • Memory Usage 2,277KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete