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

Reply
 
Thread Tools Display Modes
  #21  
Old 05-20-2009, 09:04 AM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks everyone.

I found an old mod yesterday and started having a play around with it. I managed to update it slightly using javascript code from the intertnet, but then had to stop when features such as the one below stopped working and I couldnt get my head around the code to resolve it.

PHP Code:
if ($vbulletin->userinfo[lastactivity] > AND $vbulletin->userinfo[lastactivity] > mktime (date("H")-$vbulletin->options[dynamic_pop_freq], date("i"), date("s"), date("m"), date("d"), date("Y")))     //popup once in every XX hours 
I went to the library yesterday, but had no php/sql books in, so I got "Javascript for the World Wide Web"

Ive been trying to find out the best php/sql book to get. Ive had a search around and this book seems to come highly recommended. "Build you own database driven website using PHP and MySQL by Kevin Yank" Even one the coders of vbulletin was reading it back in 2002, so cant be that bad!

Just wondered if anyone else had any recommendations that helped them along and managed to code mods for vbulletin after.

One more quick question, once you have a basic understanding of php and mysql, is it difficult combining it with vbulletin?
Reply With Quote
  #22  
Old 05-20-2009, 09:37 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by powerful_rogue View Post
One more quick question, once you have a basic understanding of php and mysql, is it difficult combining it with vbulletin?
To be honest, vBulletin requires more than a basic understanding of PHP, as the techniques it uses are not simple to understand. For example, most (if not all) learners are taught about using echo whenever they want to send output. In vBulletin, all the required information is generated and gathered before being passed off to templates, then outputted.

This is one of the many "differences" to "basic" PHP.
Reply With Quote
  #23  
Old 05-20-2009, 10:52 AM
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Location: .:: Ireland ::.
Posts: 1,306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by powerful_rogue View Post
PHP Code:
if ($vbulletin->userinfo[lastactivity] > AND $vbulletin->userinfo[lastactivity] > mktime (date("H")-$vbulletin->options[dynamic_pop_freq], date("i"), date("s"), date("m"), date("d"), date("Y")))     //popup once in every XX hours 
Split the code up into differant parts.

if ($vbulletin->userinfo['lastactivity] > 0

is like saying If the users last activity is greater than 0 seconds

AND $vbulletin->userinfo['lastactivity'] > mktime (...............))

and the users activity is greater than the result of mktime()
then...

If your not sure what the mktime function does, look it up on php.net

Its great to see you have a big interest in coding
Just remember not to give up and keep things simple.
Reply With Quote
  #24  
Old 05-22-2009, 01:57 PM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
To be honest, vBulletin requires more than a basic understanding of PHP, as the techniques it uses are not simple to understand. For example, most (if not all) learners are taught about using echo whenever they want to send output. In vBulletin, all the required information is generated and gathered before being passed off to templates, then outputted.

This is one of the many "differences" to "basic" PHP.
Apart from various articles on this forum, are you aware of any guides, documents from vbulletin which you would recommend reading to assist in learning how vbulletin works?

Quote:
Originally Posted by EnIgMa1234 View Post
Split the code up into differant parts.

if ($vbulletin->userinfo['lastactivity] > 0

is like saying If the users last activity is greater than 0 seconds

AND $vbulletin->userinfo['lastactivity'] > mktime (...............))

and the users activity is greater than the result of mktime()
then...

If your not sure what the mktime function does, look it up on php.net

Its great to see you have a big interest in coding
Just remember not to give up and keep things simple.
Thank you
Its amazing the amount of ideas you come up with and then think "Thats too difficult at this stage" so your spot on with the "Keep it simple"

Im currently working my way through the javascript book. Some parts seem simple, other parts I have to keep reading over and over. Once I feel confident with that im then going to move onto php/mysql.

I'll get there one day!
Reply With Quote
  #25  
Old 05-22-2009, 03:18 PM
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Location: .:: Ireland ::.
Posts: 1,306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by powerful_rogue View Post
Apart from various articles on this forum, are you aware of any guides, documents from vbulletin which you would recommend reading to assist in learning how vbulletin works?



Thank you
Its amazing the amount of ideas you come up with and then think "Thats too difficult at this stage" so your spot on with the "Keep it simple"

Im currently working my way through the javascript book. Some parts seem simple, other parts I have to keep reading over and over. Once I feel confident with that im then going to move onto php/mysql.

I'll get there one day!
I'd start with PHP first if I was you. You'll use it most when creating mods. In most php tutorials, it teaches you SQL too (which is very easy).
Reply With Quote
  #26  
Old 05-22-2009, 03:28 PM
powerful_rogue powerful_rogue is offline
 
Join Date: Jan 2007
Location: Kent
Posts: 603
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Too late now! Javascript was the only book they had in the library when I went down! I must say im glad I got it. Im about half way through and got a grasp on most things. Ive got a week off so going to start having a play around with a simple banner mod I thought of.

THIS is the book im thinking of ordering, had some good reviews from what I can see. Did you start learning via books or did you learn everything online?

I must also say thank you. Its nice to see a coder reading through this section and helping out people who are just starting.
Reply With Quote
  #27  
Old 05-22-2009, 03:46 PM
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Location: .:: Ireland ::.
Posts: 1,306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by powerful_rogue View Post
Too late now! Javascript was the only book they had in the library when I went down! I must say im glad I got it. Im about half way through and got a grasp on most things. Ive got a week off so going to start having a play around with a simple banner mod I thought of.

THIS is the book im thinking of ordering, had some good reviews from what I can see. Did you start learning via books or did you learn everything online?

I must also say thank you. Its nice to see a coder reading through this section and helping out people who are just starting.
I just used online tutorials and look at other peoples code when I was starting out.

http://www.w3schools.com is a great site.

Go through the PHP tutorial there then create a test file and test a few functions.
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 08:51 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.05335 seconds
  • Memory Usage 2,250KB
  • 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
  • (2)bbcode_php
  • (6)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
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete