Hello, I am getting an error on line 126 in this code. In Dreamweaver, there is no errors and GoDaddy claims it's the code.
The server is PHP 5
Thanks!
<?php
function gallerythumbfeatured_install_addon() {
$current_version = "1";
global $conn, $config;
require_once($config['basepath'].'/include/misc.inc.php');
$misc = new Misc();
//Check Current Installed Version
$sql = 'SELECT addons_version FROM '.$config['table_prefix_no_lang'].'addons WHERE addons_name = \'gallerythumbfeatured\'';
$recordSet = $conn->Execute($sql);
$version = $recordSet->fields[0];
if ($version == '') {
// Preform a new install. Create any needed databases etc, and insert version number into addon table.
$sql = 'INSERT INTO '.$config['table_prefix_no_lang'].'addons (addons_version, addons_name) VALUES (\'' . $current_version . '\',\'gallerythumbfeatured\')';
$recordSet = $conn->Execute($sql);
return TRUE;
} elseif ($version != $current_version) {
//Preform Updates to database based on previous installed version.
switch($version) {
case '0':
break;
} // switch
return TRUE;
}
return FALSE;
}
function gallerythumbfeatured_show_admin_icons()
{
}
function gallerythumbfeatured_load_template()
{
$template_array = array('addon_gallerythumbfeatured_show');
return $template_array;
}
function gallerythumbfeatured_run_action_user_template()
{
}
function gallerythumbfeatured_run_action_admin_template()
{
}
function gallerythumbfeatured_run_template_user_fields($tag = '')
{
switch ($tag) {
case 'addon_gallerythumbfeatured_show':
$data = gallerythumbfeatured_display_slideshow();
break;
default:
$data = '';
break;
} // End switch ($_GET['action'])
return $data;
}
function gallerythumbfeatured_display_slideshow()
{
global $config, $conn, $lang, $jscript, $listingID, $db_type;
require_once($config['basepath'] . '/include/misc.inc.php');
require_once($config['basepath'] . '/addons/gallerythumbfeatured/fconfig.php');
$imagepath = "".$config['baseurl']."/images/listing_photos/";
$imageback = "".$config['baseurl']."/addons/gallerythumbfeatured/images/".$imageback_thumb_f."";
$onRollOver = "".$config['baseurl']."/addons/gallerythumbfeatured/sounds/".$onRollOver_thumb_f."";
$onClick = "".$config['baseurl']."/addons/gallerythumbfeatured/sounds/".$oClick_thumb_f."";
$misc = new misc();
$check_limit = "0";
// GRAB RANDOM LISTING ID
if ($db_type == 'mysql') {
$rand = 'RAND()';
} else {
$rand = 'RANDOM()';
}
//**** Write XML File ****//
$xml.='<gallery>'."\r\n";
$xml.='<settings>'."\r\n";
$xml.='<imagesFolder>'.$imagepath.'</imagesFolder>'."\r\n";
$xml.='<bgImage alpha="'.$balpha.'" source="'.$imageback.'"/>'."\r\n";
$xml.='<image align="'.$Ialign.'" cornerRadius="'.$ICR.'" scaleMode="'.$scaleMode.'" transitionEffect="'.$ITF.'" useShadow="'.$IuseShadow.'"/>'."\r\n";
$xml.='<thumbnail width="'.$thumbwidth.'" height="'.$thumbheight.'" cornerRadius="'.$cornerradius.'" alpha="'.$alpha.'" outlineColor="'.$OC.'" outlineColorOnRollOver="'.$OCR.'" outlineColorOnClick="'.$OCC.'" useShadow="'.$TuseShadow.'" usePreview="'.$TusePreview.'"/>'."\r\n";
$xml.='<thumbBar scrollSpeed="'.$scrollSpeed.'" position="'.$position.'"/>'."\r\n";
$xml.='<preview alpha="'.$Palpha.'" width="'.$pwidth.'" height="'.$pheight.'" outlineColor="'.$POC.'" useShadow="'.$PuseShadow.'" cornerRadius="'.$PCR.'"/>'."\r\n";
$xml.='<caption position="bottom" bgAlpha="30" color="0xFFFFFF" bgColor="0x000000" fontName="Verdana" fontSize="12"/>'."\r\n";
$xml.='<slideshow start="'.$auto.'" delay="'.$delay.'" loop="'.$loop.'" stopAutoOnClick="'.$SOC.'"/>'."\r\n";
$xml.='<preloader alpha="'.$palpha.'" usePreloader="'.$usePreloader.'" />'."\r\n";
$xml.='<buttons fullScreenButton="'.$FSB.'" navigationButtons="'.$NB.'" slideshowButton="'.$SB.'" />'."\r\n";
$xml.='<sounds onRollOver="'.$onRollOver.'" onClick="'.$onClick.'" />'."\r\n";
$xml.='</settings>'."\r\n";
$xml.='<items>'."\r\n";
$sql = "SELECT listingsdb_id FROM " . $config['table_prefix_no_lang'] . "classlistingsdb ORDER BY RAND()";
$recordSet = $conn->Execute($sql);
while (!$recordSet->EOF) {
if($quantity > $check_limit) {
$listingID = $recordSet->fields['listingsdb_id'];
// CHECK IF THIS LISTING ID IS SET AS FEATURED, IS ACTIVE AND NOT EXPIRED - ALSO GRAB LISTING TITLE
if ($config['use_expiration'] === "1") {
$sql2 = "SELECT listingsdb_title, listingsdb_featured FROM " . $config['table_prefix'] . "listingsdb WHERE (listingsdb_id = $listingID AND listingsdb_active = 'yes' AND listingsdb_expiration > " . $conn->DBDate(time()) . ")";
} else {
$sql2 = "SELECT listingsdb_title, listingsdb_featured FROM " . $config['table_prefix'] . "listingsdb WHERE (listingsdb_id = $listingID AND listingsdb_active = 'yes')";
}
$recordSet2 = $conn->Execute($sql2);
$listingTITLE = $recordSet2->fields['listingsdb_title'];
$featuredYES = $recordSet2->fields['listingsdb_featured'];
$slideid = $recordSet2->fields['listingsdb_id'];
if($featuredYES == 'yes') {
// IF IT IS SET AS FEATURED > CONTINUE
$check_limit++;
$sql2 = "SELECT listingsimages_caption, listingsimages_description, listingsdb_id, listingsimages_file_name, listingsimages_thumb_file_name FROM " . $config['table_prefix'] . "listingsimages WHERE listingsdb_id = $listingID ORDER BY listingsimages_rank";
$rs=$conn->Execute($sql2);
$num_images = $rs->RecordCount();
$file_name = $misc->make_db_unsafe ($rs->fields['listingsimages_file_name']);
$description = $misc->make_db_unsafe ($rs->fields['listingsimages_description']);
$listing_id = $misc->make_db_unsafe ($rs->fields['listingsdb_id']);
$file_id = $misc->make_db_unsafe ($rs->fields['listingsfiles_id']);
if ($file_name == "")
{
$file_name = "nophoto.jpg";
$xml.='<item source="' . $file_name . '" description="' . $description . '" link="index.php?action=listingview&listingID=' . $listingID . ' " target="_parent"/>'."\r\n";
}else{
$xml.='<item source="' . $file_name . '" description="' . $description . '" link="index.php?action=listingview&listingID=' . $listing_id . ' " target="_parent"/>'."\r\n";
}
}
}
$recordSet->MoveNext();
}
$xml.='</items>'."\r\n";
$xml.='</gallery>';
$out = fopen($config['basepath']."/addons/gallerythumbfeatured/xml/gallery.xml", "w");
fwrite($out, $xml, strlen($xml));
fclose($out);
$display .= '
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'.$mwidth.'" height="'.$mheight.'" id="FlashGallery" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="'.$FullScreen.'" />
<param name="quality" value="'.$quality.'" />
<param name="bgcolor" value="'.$bgcolor.'" />
<param name="flashVars" value="XMLFile='.$config['baseurl'].'/addons/gallerythumbfeatured/xml/gallery.xml" />
<param name="movie" value="'.$config['baseurl'].'/addons/gallerythumbfeatured/featuredflash.swf" />
<param name="wmode" value="opaque" />
<embed src="'.$config['baseurl'].'/addons/gallerythumbfeatured/featuredflash.swf" wmode="opaque" quality="'.$quality.'" bgcolor="'.$bgcolor.'" width="'.$mwidth.'" height="'.$mheight.'" flashVars="XMLFile='.$config['baseurl'].'/addons/gallerythumbfeatured/xml/gallery.xml" name="FlashGallery" align="middle" allowScriptAccess="sameDomain" allowFullScreen="'.$FullScreen.'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>';
return $display;
}
?>