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 07-24-2002, 02:02 AM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default I am new to php still...need help to further expand my knowledge.

I am farely new to php, in the short time, I have coded 2 scripts from ground up, 1 using databases, and the other using get functions.

They were pretty simple. I am trying to work on some stuff to integrate into vb, can someone help me with how I go about assiging templates to each action like ?action=create will use the table create_blah, and ?action=done will use done_blah, also

How to go about verifying user information, with this all cleared up, I am able to present to you some more hacks The 2 mods for vb which I have released in my life, are not really template integrated, due to my lack of knowledge of how it works. If someone can help me out here, I will be very glad, and appreciative.

Thank you
Drk
Reply With Quote
  #2  
Old 07-24-2002, 10:11 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can name your templates as you want to, there are no restrictions, i mean you can call template done_blah also if your $action=create.

normally you have to use this line of code for template including:
eval("\$varname = \"".gettemplate("templatename")."\";");

you must have required global.php to use this functions
after that line, you can use $varname in your output template. All variables are parsed in template templatename.

at the end of your code section you want to use an outputtemplate:
eval("dooutput(\"".gettemplate('outputtemplatename ')."\");");
Reply With Quote
  #3  
Old 07-24-2002, 01:46 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how about for mysql db information, would I use

require("./glopal.php");
or
include ("config.pjp");

I am guessing the db info is being included in global.php, but I was making a hack,and only included global.php, and it said db not found, or cannot connect etc.

Thanks again for helping me.

Drk
Reply With Quote
  #4  
Old 07-24-2002, 01:48 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

...

So the Varname can be used to assign tempaltes to each different break? and dooutput is used if/for...(kinda not clear on that part)
Reply With Quote
  #5  
Old 07-24-2002, 01:50 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you just must have this line in your file:
require("./global.php");

as you can see in globa.php:
PHP Code:
// ###################### Start init #######################

unset($dbservertype);
unset(
$debug);
//load config
require('./admin/config.php');
if (
$debug != 1) {
    unset(
$showqueries);
    unset(
$explain);
}

// init db **********************
// load db class
$dbservertype strtolower($dbservertype);
$dbclassname="./admin/db_$dbservertype.php"
all other needed files are included in global.php
Reply With Quote
  #6  
Old 07-24-2002, 01:54 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the dooutput part is just needed at the end of your code to make the final output.

you can have files which just use the dooutput section and no other template functions, but if you want to templatize your code more and more, you have to use the varname code too.
the varname code is neededd for let's say template in templates. The dooutput is needed to make the final output
Reply With Quote
  #7  
Old 07-24-2002, 01:55 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah thanks,
Ok, I think almost understand it, i still can't ge what dooutput is used for...:-/ srry

Drk
Reply With Quote
  #8  
Old 07-24-2002, 02:02 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, explainig is really hard

just have a look at some of the vb-files and see how dooutput is used
Reply With Quote
  #9  
Old 07-24-2002, 04:45 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, I am seeing the light at the end of the tunnel now, thanks

*hopes its not a train*

Drk
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 12:45 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.04121 seconds
  • Memory Usage 2,240KB
  • 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
  • (1)bbcode_php
  • (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_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