vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   php help, 2 conflicts (https://vborg.vbsupport.ru/showthread.php?t=209412)

ViciousCode 03-25-2009 03:53 PM

php help, 2 conflicts
 
Hello, I need help with this!

If i add this code on top.
PHP Code:

<?php
$curdir 
getcwd ();
chdir('forums');
require_once(
'global.php');
chdir ($curdir);
?>

then this code wont work, the pages/content wont change, please help

PHP Code:

<?php

//Include page header
include('header.php');

//Get the page variable
$page $_GET['page'];

//Our switch statement to get the right content
switch($page) {
case 
"home"//For each page of content just add a case block
$content "home.php"//The file with the page contents. DO not include the header and footer HTML in these files it is already added.
break; //Stop the case block, if you do not have this you will get an error.

case "news":
$content "news.php";
break;

case 
"biography":
$content "about-atb.php";
break;

case 
"album":
$content "album.php";
break;

case 
"media":
$content "media.php";
break;

case 
"interact":
$content "interact.php";
break;

case 
"contact":
$content "contact.php";
break;

case 
"blog":
$content "blog.php";
break;


default: 
//If the variable didn't match any of the above cases do this.
$content "home.php";
break;
}

//Include the selected content.
include($content);

//Include page footer
include('footer.php');

?>


Lynne 03-25-2009 04:13 PM

See these threads on how to create a new page in vb - How to create your own vBulletin-powered page! (uses vB templates) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc.

ViciousCode 03-25-2009 05:22 PM

im trying to integrate the forum into the website.

thats why im using the content switch to change the content.

Marco van Herwaarden 03-26-2009 10:28 AM

Use the vB input cleaner to access variables like $_GET[page].


All times are GMT. The time now is 05:03 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.01745 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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