CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 display variable number of photos

Print topic Send  topic

Author Message
mike
Posted: 10/15/2005, 5:02 PM

I have a page which displays a variable number of page

at the moment I have simply added

image1
image2
image3
....
image10

etc..

Problem is if there are only 2 images I get a "Place holder" showing
How can I avoid this.

(data for the image is stored on the record as a path)
ie.
image/picture/image1.jpg
image/picture/image2.jpg


Damian Hupfeld
Posted: 10/16/2005, 4:15 AM

Right-click on the image and select "Edit Image...", then set the "Extended
HTML" option.

global $grid;
// Write your own code here.
// Hide image if the database value for "pic" is blank
if ($grid->pic->GetValue() =="") $grid->pic->Visible = false;
if ($grid->pic->GetValue() !="") $grid->pic->Visible = true;


regards
Damian Hupfeld
http://www.nexthost.com.au/services.php
mike
Posted: 10/16/2005, 4:36 AM

Where do I place this ??
In the 'Code' view??

My page only has a record - no grid

Sorry just getting to learn CodeCharge and this is my very first practical
project
Damian Hupfeld
Posted: 10/16/2005, 5:47 PM

You need to have a grid and you would add custom code on before show (or
before show row?).
mike
Posted: 10/17/2005, 10:10 AM

I've tried this on EmpsDetail
from the EmplDir

The grid is called 'emps'

so global emps; etc

if ($emps->picture->GetValue() =="") $emps->picture->Visible = false;
if ($emps->picture->GetValue() !="") $emps->picture->Visible = true;

get an error saying
Fatal error: Call to a member function on a non-object in
/public_html/empldir/empsdetails_events.php on line 20
peterr


Posts: 5971
Posted: 10/17/2005, 10:45 AM

The same code works perfectly forme on that page.
In case you changed "global $emps" to "global emps" then that could be the problem. I'm also not sure what do you mean by "etc" since there is nothing else.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mike
Posted: 10/17/2005, 2:33 PM

Cracked it.... 'photo' should have been Photo

!!!

Thanks


"peterr" <peterr@forum.codecharge> wrote in message
news:54353e3453b151@news.codecharge.com...
> The same code works perfectly forme on that page.
> In case you changed "global $emps" to "global emps" then that could be the
> problem. I'm also not sure what do you mean by "etc" since there is
nothing
> else.
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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