The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
This should be easy for someone who knows some php...
Well, at my site, I currently run a gallery, I can't even call it a script, but it works. Code:
<?
if(isset($page)){
if(is_file('/home/xxx/php/'.$page.'.php')) {
include('/home/xxx/php/'.$page.'.php');
$file=$page.'.php';
}
elseif(is_file('/home/xxx/php/'.$page)) {
include('/home/xxx/php/'.$page);
$file=$page;
}
else {
echo "<font face=verdana size=1><b>Page \"$page\" is invalid.";
}
}
else {
include('/home/xxx/php/1.php');
$file='home';
}
?>
What I wanted to do was add vB3's template system to it, but I couldnt get it to work. Would anyone kindly help me integrate the footer/header from vB3? I tried reading a guide posted here, but the way my "gallery" works gives me a hard time to make it work
|
|
#2
|
||||
|
||||
|
Here's what I have at the top of my chat.php file, if this will help.
PHP Code:
PHP Code:
|
|
#3
|
||||
|
||||
|
Quote:
|
|
#4
|
||||
|
||||
|
Quote:
Code:
<?
error_reporting(E_ALL & ~E_NOTICE);
require_once('./global.php');
define('THIS_SCRIPT', 'gallery');
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('gallery_main') . '");');
if(isset($page)){
if(is_file('/home/xxx/php/'.$page.'.php')) {
include('/home/xxx/php/'.$page.'.php');
$file=$page.'.php';
}
elseif(is_file('/home/xxx/php/'.$page)) {
include('/home/xxx/php/'.$page);
$file=$page;
}
else {
echo "<font face=verdana size=1><b>Page \"$page\" is invalid.";
}
}
else {
include('/home/xxx/php/1.php');
$file='home';
}
?>
Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
$headinclude
</head>
<body>
$header
$navbar
|
|
#5
|
||||
|
||||
|
This is what you need to have it as:
PHP Code:
PHP Code:
|
|
#6
|
||||
|
||||
|
Quote:
What it does is call a php file with the image thumbnails and links from another folder (say /php/1.php), and then loads the content of it. Then if you click on a link (gallery.php?page=2), it will call 2.php and load the next 25 images. I know its primitive, but its been working fine for over a year now :P Thats whats keeping me from adding the code to the templates, because I have 10 php files, for a total of 250 images. |
|
#7
|
||||
|
||||
|
Quote:
PHP Code:
How hard can adding header/footer be >_< |
|
#8
|
||||
|
||||
|
Ok, I misunderstood you before. I thought you said you WANTED the pictures to show up before the header. Sorry about that. With your original script, use this:
PHP Code:
PHP Code:
|
|
#9
|
||||
|
||||
|
Quote:
|
|
#10
|
||||
|
||||
|
This is harder then I thought. Is there any other way to add the header/footer to a php file?
Arg. |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|