CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 show a default image if none is present

Print topic Send  topic

Author Message
Pulp
Posted: 06/10/2003, 12:51 AM

Hello there...

I'm using CCS 2.0 and PHP+templates.

I'd like to show a default image if none is present. Actually the show image is
uploads/{img}
But if {img} has no value, i'd like to show defaults/{logo} instead.
How could CCS manage to do so ? Help !
Dark Master
Posted: 06/10/2003, 1:58 AM

The easiest way is to storing all your images paths in your database

image_name | image_column
-------------------------
dog | uploads/dog.gif
cat | uploads/cat.gif
snake | default/noimage.gif

Another way is adding some handle into your image control BeforeShow event
similar to code below

if( !$form_name->image_control->GetValue()
|| !file_exists($form_name->image_control->GetValue()) )
{
$employees->picture->SetValue("defaults/noimage.gif");
}

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.