Java controlled image and text change in php
Posted: Fri Aug 27, 2004 9:33 am
feyd | Please use
===============================================
Any help appreciated
Thanks.
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I have been utilizing OR real estate software (php). There is a small problem with the image swap in that with every image uploaded, you can attach a caption with a description, the image will change, but can't get the text to change.
Is there anyone who could solve this problem?
This is the code:
===============================================Code: Select all
function renderListingsMainImageJava($listingID)
{
// shows the main image
global $conn, $lang, $config, $style;
// grab the images
$listingID = make_db_extra_safe($listingID);
$sql = "SELECT ID, caption, description, file_name FROM " . $config['table_prefix'] . "listingsImages WHERE (listing_id = $listingID) ORDER BY rank LIMIT 0,1";
$recordSet = $conn->Execute($sql);
if ($recordSet === false)
{
log_error($sql);
}
$num_images = $recordSet->RecordCount();
if ($num_images > 0)
{
while (!$recordSet->EOF)
{
$file_name = make_db_unsafe ($recordSet->fields['file_name']);
$caption = make_db_unsafe ($recordSet->fields['caption']);
$description = make_db_unsafe ($recordSet->fields['description']);
echo "<center><img src="$config[listings_view_images_path]/$file_name" width="440" name="main"></center>";
if ($description == "")
{
$description = 'Listing #'.$file_name.'';
}
echo "<b>$description</b><br><br>";
$recordSet->MoveNext();
} // end while
} // end if ($num_images > 0)
} // end function renderListingsMainImageJava
function renderListingsImagesJava($listingID)
{
// shows the images connected to a given image
global $conn, $lang, $config, $style;
// grab the images
$listingID = make_db_extra_safe($listingID);
$sql = "SELECT ID, caption, description, file_name, thumb_file_name FROM " . $config['table_prefix'] . "listingsImages WHERE (listing_id = $listingID) ORDER BY rank";
$recordSet = $conn->Execute($sql);
if ($recordSet === false)
{
log_error($sql);
}
$num_images = $recordSet->RecordCount();
if ($num_images > 0)
{
echo "<td width="$style[image_column_width]" valign="top" class="row_main" align="center">";
while (!$recordSet->EOF)
{
$caption = make_db_unsafe ($recordSet->fields['caption']);
$description = make_db_unsafe ($recordSet->fields['description']);
$thumb_file_name = make_db_unsafe ($recordSet->fields['thumb_file_name']);
$file_name = make_db_unsafe ($recordSet->fields['file_name']);
$imageID = make_db_unsafe ($recordSet->fields['ID']);
// gotta grab the image size
$imagedata = GetImageSize("$config[listings_upload_path]/$thumb_file_name");
$imagewidth = $imagedata[0];
$imageheight = $imagedata[1];
$shrinkage = $config['thumbnail_width']/$imagewidth;
$displaywidth = $imagewidth * $shrinkage;
$displayheight = $imageheight * $shrinkage;
echo "<a href="javascript:void imgchange('$file_name');" onmouseover="imgchange('$file_name');" onmouseover="imgchange('$description');" onclick="this.blur();"> ";
echo "<img src="$config[listings_view_images_path]/$thumb_file_name" height="$displayheight" width="$displaywidth" alt="$caption"></a><br>";
echo "<b>$caption</b><br><br>";
$recordSet->MoveNext();
} // end while
echo "</td>";
} // end if ($num_images > 0)
} // end function renderListingsImagesJavaAny help appreciated
Thanks.
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]