close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic Folder Issue

Thread began 10/28/2010 12:51 pm by dmheltzel267059 | Last modified 11/05/2010 3:34 pm by Jason Byrnes | 13260 views | 12 replies |

dmheltzel267059

Dynamic Folder Issue

When I upload through the CMS I've created, the photo gallery dynamically creates a folder to upload to and store all photos associated with that gallery. I'm using Developer Toolbox to create thumbnails right now, which dynamically creates the folder "thumbnails" within the each gallery's folder: gallery/thumbnails/thumb.jpg, while the large image lies in the root: gallery/. When managing the galleries, I can delete one photo or the entire gallery, and both ways delete the associated thumbnail.

I like the image resizer thus far, but first glance, it looks like I can't set up in the same fashion as Developer Toolbox. I tried directing the cache folder to the dynamic folder by replacing "image_cache" with "assets/gallery/galleryname/" with "galleryname" an php echo statement:

<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "assets/gallery/<?php echo $row_rsGalleries['ID']; ?>/", "crop", "", false));
} // End Cached Resized Image: ImageCacheInstance_1288282423723
?>

Image resizer doesn't like this, plus when I do it the "image_cache" way, it creates a long path that seems redundant and doesn't just store it in the "image_cache" folder.

I can probably work around it but will be limited in maintaing it. If I delete a gallery/image, the cahced thumbnail will remain.

If there is a workaround, please let me know.

Sign in to reply to this post

Jason ByrnesWebAssist

the code should be:
[php]<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "assets/gallery/".$row_rsGalleries['ID']."/", "crop", "", false));
} // End Cached Resized Image: ImageCacheInstance_1288282423723
?>[php]

Sign in to reply to this post

dmheltzel267059

purchase ficsound

That works. Thanks for the catch. Still having the error message issue from the other post. If I delete the folders that are dynamically created to hold the thumbnails, I can refresh the browser and they show up. But, if I refresh again after that, I receive this:

Fatal error: Call to undefined function: scandir() in /home/content/d/m/h/dmheltzel/html/webassist/caching/CachedResize_Image.php on line 262

Sign in to reply to this post

Jason ByrnesWebAssist

my guess is that when you refresh the recordset does not have a result anymore.

can you send a copy of your page please so i can look at the entire code.

Sign in to reply to this post

dmheltzel267059

That shouldn't be the case. It is a general query that requires no filter. Below is the dynamic portion of the code:

<?php require_once( "webassist/caching/CachedResize_Image.php" ); ?>
<?php require_once('Connections/Celebrity.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_Celebrity, $Celebrity);
$query_rsGalleries = "SELECT * FROM tbl_gallerycategories ORDER BY CategoryName ASC";
$rsGalleries = mysql_query($query_rsGalleries, $Celebrity) or die(mysql_error());
$row_rsGalleries = mysql_fetch_assoc($rsGalleries);
$totalRows_rsGalleries = mysql_num_rows($rsGalleries);
?>


<div class="mediarow">
<?php do { ?>
<div class="mediaitem"><a href="GalleryDetail.php?Category=<?php echo $row_rsGalleries['ID']; ?>">
<?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1288294863327
ob_start();
?>
<img name="thumb" width="109" height="109" alt="<?php echo $row_rsGalleries['PhotoAlt']; ?>" class="mediaimage" src="assets/gallery/<?php echo $row_rsGalleries['ID']; ?>/<?php echo $row_rsGalleries['Photo']; ?>" />
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "assets/gallery/".$row_rsGalleries['ID']."/", "crop", "", false));
} // End Cached Resized Image: ImageCacheInstance_1288294863327
?>
</a></div>
<?php } while ($row_rsGalleries = mysql_fetch_assoc($rsGalleries)); ?>
</div>


<?php
mysql_free_result($rsGalleries);
?>

Sign in to reply to this post

dmheltzel267059

FYI...I took out the dynamic path to the image and made it static. I refreshed like in the other instances and I didn't receive the error message. So, the dynamic path is causing a problem?

Sign in to reply to this post

Jason ByrnesWebAssist

maybe try changing this line:
[php]echo(getCachedResizedImageHTML(ob_get_clean(), "assets/gallery/".$row_rsGalleries['ID']."/", "crop", "", false));[php]


to:

php:
echo(getCachedResizedImageHTML(ob_get_clean(), "assets/gallery/".($row_rsGalleries['ID']), "crop", "", false));




also what is your php server version?


and can you send a link where i can see the problem.

Sign in to reply to this post

dmheltzel267059

juesevett Adelbert

I tried your alteration to the code with same results.

PHP Version: PHP 4.x
Test link: Test.php

It shows the photo and gives me an error message. If I refresh it, the photo disappears and I get a different error message.

Code on Test.php:


<?php require_once( "webassist/caching/CachedResize_Image.php" ); ?>
<?php require_once('Connections/Celebrity.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_Celebrity, $Celebrity);
$query_rsGalleries = "SELECT * FROM tbl_gallerycategories ORDER BY CategoryName ASC";
$rsGalleries = mysql_query($query_rsGalleries, $Celebrity) or die(mysql_error());
$row_rsGalleries = mysql_fetch_assoc($rsGalleries);
$totalRows_rsGalleries = mysql_num_rows($rsGalleries);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<a href="GalleryDetail.php?Category=<?php echo $row_rsGalleries['ID']; ?>">
<?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1288705059835
ob_start();
?>
<img src="CelebrityRanch/assets/gallery/<?php echo $row_rsGalleries['ID']; ?>/<?php echo $row_rsGalleries['Photo']; ?>" alt="<?php echo $row_rsGalleries['PhotoAlt']; ?>" name="thumb" width="109" height="109" border="0" class="mediaimage" />
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "image_cache", "crop", "", false));
} // End Cached Resized Image: ImageCacheInstance_1288705059835
?>
</a>
</body>
</html>
<?php
mysql_free_result($rsGalleries);
?>

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

Sign in to reply to this post

dmheltzel267059

10-4, thanks for the help.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...