vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   I am new to php still...need help to further expand my knowledge. (https://vborg.vbsupport.ru/showthread.php?t=41449)

DrkFusion 07-24-2002 02:02 AM

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

Xenon 07-24-2002 10:11 AM

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 ')."\");");

DrkFusion 07-24-2002 01:46 PM

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

DrkFusion 07-24-2002 01:48 PM

...

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)

Xenon 07-24-2002 01:50 PM

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

Xenon 07-24-2002 01:54 PM

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

DrkFusion 07-24-2002 01:55 PM

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

Drk

Xenon 07-24-2002 02:02 PM

hmm, explainig is really hard ;)

just have a look at some of the vb-files and see how dooutput is used ;)

DrkFusion 07-24-2002 04:45 PM

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

*hopes its not a train*

Drk


All times are GMT. The time now is 10:18 AM.

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.01079 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete