This topic is locked

Images & Thumbnails

5/24/2007 3:59:07 PM
PHPRunner General questions
M
michaelmac author

Hi..
I just found the forum where I can add a topix. I have been a real pain to support, and I apologize to all of them. I will post my questions here. I am a real newbie to this template stuff, but I do love RHPR.
I just learned how to add images & thumbnails. I want to know when I list or view them, if there is no image in the table for that record, how to keep it blank or not show any image. Any suggestions?
Thank you
Mike

J
Jane 5/25/2007

Mike,
to remove broken image set up Image field as Custom on the "View as" settings dialog on the Visual Editor tab and add your code in it.

Here is a sample:

global $data;

if ($value!="")

$value = "<img border=0 src=\"TableName_imager.php?field=ImageField&key1=".$data["ImageID"]."\">";

else

$value="no image";

M
michaelmac author 5/25/2007

Mike,

to remove broken image set up Image field as Custom on the "View as" settings dialog on the Visual Editor tab and add your code in it.

Here is a sample:


That works GREAT Jane. Thank You. I do have another issue you along this same line. I think I know what to do, but wanted to ask before trying it. I have TWO image fields. One for the image itself, and the other is the thumbnail. Well if there is no image when I show the thumbnail in the LIST and there is no IMAGE, I get a broken link image, if I go to the VIEW and there exists an IMAGE, I get a broken link image. Am I suppose to check key1 for my view and key 2 for my list or do I need to check the ImageID...?? Since I did not know what variables were named, I was unsure. Thank you in advance for you invaluable help..
<img border=0 src=\"TableName_imager.php?field=ImageField&key1=".$data["ImageID"]."\">";
Mike

M
michaelmac author 5/25/2007

Mike,

to remove broken image set up Image field as Custom on the "View as" settings dialog on the Visual Editor tab and add your code in it.

Here is a sample:


Hi Jane
I have a better picture of what I am doing, but still some issues.
here is my code in the titles_list.php with the field named thumbnail I set when I clicked on the Image and selected "Custom". I inserted the following code:
global $data;

if ($value!="")

$value = "<img border=0 src=\"titles_imager.php?field=ImageField&key2=".$data["ImageID"]."\">";

else

$value="no image";
I tried key1 and key2.. neither would work, but the "no image" text did, so that is working. Any ideas what I am doing wrong
here is the snippet I am using in the titles_view.php with the field name image I set when I clicked on the Image and selected "Custom". I inserted the following code
global $data;

if ($value!="")

$value = "<img border=0 src=\"TableName_imager.php?field=ImageField&key1=".$data["ImageID"]."\">";

else

$value="no image";
I get the image, but when there is no image in the blob, I get a broken link icon and do not get "no image"..
I am glad to get one working, but what am I doing wrong?
As always
I thank you
Mike

J
Jane 5/28/2007

Please publish your project on Demo Account and post link to your pages here or send it to [email=support@xlinesoft.com]support@xlinesoft.com[/email].

I'll find what's wrong with your project inspecting it at Demo account site.