TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,055
  • Total Topics: 21,337
  • Online today: 572
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

syntax error?

Started by dimdom, November 01, 2008, 04:03:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dimdom

I use this code in a php block to show pictures from my Coppermine gallery to front page:

// Gallery Coppermine script by P.J.Lawrence (October 2008)
// Using...
// Enlargeit Script (http://enlargeit.timos-welt.de/english/index.php)
// CpmFetch http://cpmfetch.fistfullofcode.com/
//
// Notes..
// Ensure that the variable enl_gifpath in enlargeit.js  points to the correct directory


$CoppermineWebPath = 'path/';  // Web path to Coppermine Gallery
$EnlargeitWebPath = 'path/';       // Web path to Highslide java code
$cpmfetchPath = 'path/'; // System Path to CPMFetch

if ($_GET['rows']) {
$Rows=$_GET['rows'];
}
else {
$Rows=1;
}
if ($_GET['cols']) {
$Cols=$_GET['cols'];
}
else {
$Cols = 6;
}
if ($_GET['album']) {
$Album=$_GET['album'];
}

include  $cpmfetchPath."cpmfetch.php";
echo '<script type="text/javascript" src="',$EnlargeitWebPath,'path"></script>';

echo "<center>";
$objCpm = new cpm("path");
$option = array(
'linkstyle' =>'image" target="_blank" onclick="return false;',
'linktemplate'=> '{{pFilename}}" id="{{pFilename}}',
'imagestyle'  =>'set1" onclick="enlarge(this);',
'alttag' => '{{pFilename}}" id="{{pPid}}" longdesc="'.$CoppermineWebPath.'../gallerysmf/albums/{{pFilepath}}{{pFilename}}',
'tablestyle' => 'windowbg" width="180" bordercolor="#0099ff" border="0" height="100"',
'cellstyle' => 'windowbg windowbg_hover" valign="middle" align="center');

if ($Album) {
$objCpm->cpm_viewLastAddedMediaFromAlbum($Rows,$Cols,$Album,$option);
}
else {
$objCpm->cpm_viewLastAddedMedia($Rows,$Cols,$option);
}
$objCpm->cpm_close();
echo '</center>';
?>


Everything is working fine but in the error log i get these messages...

QuoteUndefined variable: Album
Ἀρχεῖο: /home/xxx/public_html/xxxx/Themes/default/TPortal.template.php (eval?)
Line: 43

Undefined variable: album
Ἀρχεῖο: /home/xxx/public_html/xxxx/Themes/default/TPortal.template.php (eval?)
Line: 26

Undefined variable: cols
Ἀρχεῖο: /home/xxx/public_html/xxxx/Themes/default/TPortal.template.php (eval?)
Line: 20

Undefined variable: rows
Ἀρχεῖο: /home/xxx/public_html/xxxx/Themes/default/TPortal.template.php (eval?)
Line: 14


So I guess that I have something wrong is this part of the above code:

   if ($_GET['rows']) {
$Rows=$_GET['rows'];
}
else {
$Rows=1;
}
if ($_GET['cols']) {
$Cols=$_GET['cols'];
}
else {
$Cols = 6;
}
if ($_GET['album']) {
$Album=$_GET['album'];
}




I use Greek utf-8 for my forum. Any ideas to get rid of these error messages in error log?


JPDeni


if (isset($_GET['rows'])) {
$Rows=$_GET['rows'];
}
else {
$Rows=1;
}
if (isset($_GET['cols'])) {
$Cols=$_GET['cols'];
}
else {
$Cols = 6;
}
if (isset($_GET['album'])) {
$Album=$_GET['album'];
}


You'll also need to change


if ($Album) {


to

if (isset($Album)) {


dimdom

It worked.

Thank you very much. :)

This website is proudly hosted on Crocweb Cloud Website Hosting.