vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Changing from HTML to PHP (https://vborg.vbsupport.ru/showthread.php?t=215330)

820Media 06-04-2009 02:53 PM

Changing from HTML to PHP
 
Hey there,

I run a gaming website as u know hence my name, and there is hardly any reviews on there because i was thinking what happend if i changed the side menu? i would have to do that to all the cheat pages etc.

So is there a way i can get the sidebar into PHP so i just update say 'sidebar.php' and it updates all the sidebar etc.

And also the cheats and reviews are like this :

(cod4) /review_cod4.html along those lines can i get it like review.php=cod4 or something like that?

Thank You

KTBleeding 06-04-2009 03:20 PM

Short answer: Of course you can do all that, but it takes a lot of time.

Converting from a static site to a dynamic one can be extremely time consuming. Especially if you aren't sure where to start. If you do it one time ( to make just the sidebar dynamic ) you may as well do it right that one time, and make it all dynamic. Separate the header, navigation, footer, etc. Either way you'll still have to edit every single file on the site to be both php, and include the necessary files.

Judging from your questions, you seem pretty novice to any of this stuff. If that is the case, I suggest recreating your site with Drupal, Expression Engine, or (maybe) Wordpress. They're all cms frameworks, and they offer a pretty good jump start to beginners.

820Media 06-04-2009 03:42 PM

I dont want to use wordpress or a CMS for that matter because i found this templates on 4templates.com and brought it because it suited every need.

Do you have or know any tutorial which will could aid in me doing this, i know i would have to do the whole thing but in the future it will shorten time..

KTBleeding 06-04-2009 04:09 PM

I guess I'm confused. Converting a template to a cms is very simple.. regardless of where it's from?

To simply change the sidebar as an include, all you really need to know are include() and require(). They're pretty much identical, except for the way they handle errors.

Example:
PHP Code:

include(sidebar.php); 

Simple as that, really. Just remember that every .html will need to become .php in order to work. If you want to keep your page ranking and url structure the same, use .htaccess to rewrite .php to .html. You'll keep your .html extension, but the page will actually be parsed with php.

820Media 06-04-2009 04:29 PM

Okay,

Im testing this out on jetgaming.org/indexphp.php

Ive got sidebar.php and copied the HTML text and tables from it into there and put include sidebar.php and its working perfect when i edit sidebar..so i know that done.

Things to do now:

Top nav bar

Cheats and reviews like review.php=cod4 (can you do that) (and how)

Sidebar 2 (Review)

Sidebar 3 (latest cheats)

side bar 4 (review list, right)

Sidebar 5 (cheat list , right)

sidebar 6 (video review, right)

Search box
-----

Okay ive done a couple now

and ive just purely posted the HTML into a PHP file, will i need <html> at the top and / at the bottom? because its working fine now. (without)

KTBleeding 06-04-2009 04:41 PM

You're going to need a pretty basic database structure for reviews / cheats / etc.. though for a game site, I imagine you'll want a database table for games, then another table for reviews, and another for cheats (etc). Then join them all together. It's pretty simple stuff when it comes down to it, but there's an obvious learning curve. You'd pretty much be writing your own custom stuff.

Once you have a database, you can pull it all with reviews.php / cheats.php / etc.

If you want a full custom system, you should probably look at MVC frameworks. Such as: CodeIgniter, or CakePHP. Those two seem to be the best documented and easy to learn.

820Media 06-04-2009 10:11 PM

Erm okay..

I really dont understand Cake and they dont have any tutorials on what im looking for or either im wording it wrong.

I have searched google loads but if someone could please find a good tutorial on how to do this:

cheats.php?=cod4 (would go to a call of duty 4 cheat page)

review.php?=cod4 (would go to a review of call of duty 4)

or review.php?game=cod4

etc etc

nnStaff 06-04-2009 10:56 PM

You do not need to add <html> or any body elements to the file, no. PHP includes will take their cue from the body that they're embedded into, put only the markup you need as if it were already part of the main page.


All times are GMT. The time now is 07:08 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.01407 seconds
  • Memory Usage 1,731KB
  • 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
  • (8)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