Hi,
Can anybody tell me why my php script wont run properly unless i put it in a page all on its own? Is it antisocial? Does it want to be alone? I have put it in a page with background and links to other pages, but it wont generate a large version of a thumbnail unless it has a page all to itself. here is the php coding i've used:
<td colspan="2" rowspan="3" width="760" >
<?php
/**
* Autogallery
* Urs Gehrig, <urs @circle.ch>
*
*/
// $Id: index.php,v 1.1 2002-10-07 23:50:02+02 urs_gehrig Exp urs_gehrig $
error_reporting (E_ALL ^ E_NOTICE);
require_once("i ntegratedtempla te.inc.php" ); // get this from pear.php.net or cvs.php.net
require_once("a utogallery.inc. php" ); // get this from circle.ch/scripts
// define to create the images index automatically or
// reading it from an index-file
define("GALLERY _SOURCE", "file");
if(GALLERY_SOUR CE == "file" )
{
/**
* define galleries from file; always start with an index of 1!
*/
$arr = file("./index.album");
function trim_array ($value, $key) {
global $arr, $multiple;
$i = 0;
foreach ($arr as $key => $val) {
// prevent adding empty lines to the selection menu
if(strlen(trim( $val)))
$multiple[++$i] = explode("#", $val);
}
}
array_walk($arr , 'trim_array');
} else
{
/**
* read image-folders of the format "YYYY-MM-DD". this is
* pretty cool if you upload images with forms and let generate
* php a folder on each "upload-day"
*/
$d = dir("./" );
while($entry=$d->read() ) {
if(stristr($ent ry, strftime("%Y") )) {
if(is_dir($entr y)) $multiple[++$index] = array("./cache", "./$entry", "./templates/frame.png", $entry );
}
}
}
// handle query-manipulations
if(!isset($_GET['g'])) $_GET['g']=1;
// get instance of autogallery
$ag = &new autogallery($mu ltiple[$_GET['g']][0], $multiple[$_GET['g']][1], $multiple[$_GET['g']][2] );
$ag->desc = "Page(s): ";
// handle the template file
$tpl = &new IntegratedTempl ate("./templates" );
$tpl->loadTemplatefi le("tpl.index.h tml", true, true);
$content = array(
// set rows and columns of images per page
"htm_conten t" => $ag->thumbnail_tabl e(3, 2, $multiple ),
// get the hosts address
"htm_host" => "http://" . $_SERVER['HTTP_HOST'] . (strlen($_SERVE R['PHP_SELF'] ) ? "" . str_replace(bas ename($_SERVER['PHP_SELF']), "", $_SERVER['PHP_SELF']) : "" ),
// set a title for the pop-up window
"htm_script " => $ag->show_jscript(" Autogallery Pop-Up Title"),
);
$tpl->setVariable($c ontent);
$tpl->show();
?>
</td>
hope you can help, thanks.
Diz