View Full Version : Help in migrating a site to PHP from HTML
Crazy Pete
04-25-2003, 06:47 PM
Hey folks,
I did a search on this and couldn't find any relevant threads, and I apologize if this is in the wrong section so feel free to move it.
What I need help with basically is in how to go about converting my current static (HTML) website into a more dynamic PHP/MySQL-driven site.
My main problem right now is if I want to add anything to the site, for example any links to another site page off the main one, I have to update 20 pages instead of just inserting one line.
Basically I need to know how to get started in converting my site over to PHP and how much work is involved in it, along with any good resources you'd want to pass along. Thanks very much for any help!
On a side note, I would publish the URL here for people to get an idea of what I'm doing, but I can't right now because we're in the process of switching hosts, so it most likely wouldn't work.
gmarik
04-26-2003, 01:25 PM
You need a CMS solution. I'm working on one now. Need more info?
Crazy Pete
04-26-2003, 05:08 PM
Yes, that would rock! Thanks. :)
Crazy Pete
05-03-2003, 05:50 AM
Still looking for more info on this.
well if it helps, first divide you site into some main sections ie. left column, header, right column, main. then make the header, left and right column trhee different php pages, and then on index.php include them and wherever you want, then check to see what "action" equals (from the header [ex www.vbulletin.org?action=showthread] you get the idea) and if it equals anything besides "main.php" make it include that page
if this doesn't make sense tell me and i'll try to explain better :)
leviw
05-07-2003, 04:26 AM
I'm trying to use custom vbulletin templates on my forum.
I can go into forum/admin and make the new template, but what is the command to initialize it?
For instance, if I use code that has: $demotemplate in it, nothing will show because its just an unnamed variable, right?
I need to say something like: $demotemplate = (query or query to database where template is stored)
Thats what I'm really looking for, what query do I use to find info from the templates created in the forum/admin?
I think this would also solve Crazy Pete's problem, as it sounds like he wants to move his info to templates as well.
look through the vb code, it'll be something with eval(gemtemplate) etc...it'll have more than that, but it has that and the dooutput() stuff
leviw
05-07-2003, 01:19 PM
Like this?
eval( 'dooutput( "' . gettemplate( 'home' ) . '" );' );
There has to be more to it, right? Do I need to include the template name in the top of the page with all the others?
$templatesused = 'home,home_articlebit,home_articlelink,home_welcom eguest,home_welcomeuser,';
I tried just the eval and the eval with adding it in the templatesused but no luck. If possible could you show an example?
Thanks for your input, and I hope this helps Crazy Pete as well.
Crazy Pete
05-07-2003, 02:32 PM
Yeah, that would probably help me as well. Thanks, leviw. :)
Craigr
05-07-2003, 02:35 PM
You could also use Logician's webtemplates hack. It's very good for having a site integrated with vBulletin.
Craig
it's confusing, but you use the gettemplate thing, NOT the doouput to assign a whatever text is in the template to a variable, then when you do a dooutput all those templates you assigned to variables can be used in the final dooutput template
not sure if that makes sense, it is confusing till you get the hang of it
leviw
05-07-2003, 05:28 PM
Thanks for the suggestion, Logician's webtemplates hack is nice but you cant use templates from inside it, which pretty much makes it useless to me.
Sorry for being dense, but I'm still kinda confused on what exactly to use. Is this code correct, if I have a template made in forum/admin called demotemplate?
eval( '$demotemplate=( "' . gettemplate( 'demotemplate' ) . '" );' );
I ask because since php doesnt use templates per se, this is really just a creative use of variables and I think there must be some missing piece(s) here.
Could you post a full example for clarity, or if you dont know exactly I'll fiddle around with it tonight and see if I get lucky.
it goes like this
code
eval( '$demotemplate=( "' . gettemplate( 'demotemplate' ) . '" );' );
// any variables defined above can be used in this template
//the gettemplate is making $demotemplate equal everything inside the template
more code
eval( '$demotemplate1=( "' . gettemplate( 'demotemplate1' ) . '" );' );
//again anything defined above this can be used in the template, even if it was above the other gettemplate
eval( 'dooutput( "' . gettemplate( 'home' ) . '" );' );
//any variables defined above this ($demotemplate and $demotemplate1) can be used in this template
//but what happens here is that instead of having a variable equal this template you display the contents of this template to the user
got a better idea now? :D
leviw
05-08-2003, 02:19 AM
Perfect, worked like a charm! Thanks SO much for your help mr_e!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.