Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 06-04-2009, 02:53 PM
820Media 820Media is offline
 
Join Date: Feb 2009
Location: England - Manchester
Posts: 231
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 06-04-2009, 03:20 PM
KTBleeding's Avatar
KTBleeding KTBleeding is offline
 
Join Date: Feb 2004
Location: Tooele, UT
Posts: 756
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 06-04-2009, 03:42 PM
820Media 820Media is offline
 
Join Date: Feb 2009
Location: England - Manchester
Posts: 231
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #4  
Old 06-04-2009, 04:09 PM
KTBleeding's Avatar
KTBleeding KTBleeding is offline
 
Join Date: Feb 2004
Location: Tooele, UT
Posts: 756
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-04-2009, 04:29 PM
820Media 820Media is offline
 
Join Date: Feb 2009
Location: England - Manchester
Posts: 231
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #6  
Old 06-04-2009, 04:41 PM
KTBleeding's Avatar
KTBleeding KTBleeding is offline
 
Join Date: Feb 2004
Location: Tooele, UT
Posts: 756
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 06-04-2009, 10:11 PM
820Media 820Media is offline
 
Join Date: Feb 2009
Location: England - Manchester
Posts: 231
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 06-04-2009, 10:56 PM
nnStaff nnStaff is offline
 
Join Date: May 2009
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:11 PM.


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.03961 seconds
  • Memory Usage 2,223KB
  • 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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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