N
|
nix386 8/4/2008 |
I have no idea really but this might be something to look at. Hi, I have built a site with PHPRunner and everything on that site is working properly! The only issue is that when users don't upload any images, the view page looks something like the image below; The code for the pictures is: if (htmlspecialchars(AddLinkPrefix("Photo1",$data["vPhoto1"]))!="photos") { $value="<img"; $value.=" onmouseover=\"if(LoadMainPhoto != null) LoadMainPhoto('".htmlspecialchars(AddLinkPrefix("Photo1",$data["vPhoto1"]))."');\""; $value.=" width=150"; $value.=" border=0"; $value.=" src=\"".htmlspecialchars(AddLinkPrefix("Photo1",$data["vPhoto1"]))."\">"; } else $value=""; ------------------------------------------------------ and in the event..view on load the code is: global $conn,$smarty,$strTableName; if (@$_REQUEST["editid1"]) { $data = db_query("select * from ".$strTableName." where lagosID=".$_REQUEST["editid1"],$conn); $rstt = db_fetch_array($data); $pic=""; if($rstt["Photo1"]!="") $pic=$rstt["Photo1"]; else if($rstt["Photo2"]!="") $pic=$rstt["Photo2"]; else if($rstt["Photo3"]!="") $pic=$rstt["Photo3"]; else if($rstt["Photo4"]!="") $pic=$rstt["Photo4"]; if($pic=="") $smarty->assign("row00firstphoto_value",htmlspecialchars("images> no_image.gif")); else $smarty->assign("row00firstphoto_value",htmlspecialchars(AddLinkPrefix("Photo1",$pic))); } ------------------------------------------------------ Now I wanted to know how to hide fields when they are empty!..or how to hide this empty space behind no-image? Thanks in advance! Nelson |
J
|
Jane 8/4/2008 |
Hi, |
N
|
Nelson author 8/4/2008 |
I have no idea really but this might be something to look at. $smarty->assign("row00firstphoto_value",htmlspecialchars("images>no_image.gif")); also removing the width may make it look a little less odd...
|
N
|
Nelson author 8/4/2008 |
Hi, please make sure all uplaoded files are in the output/photo/ directory.
|
J
|
Jane 8/4/2008 |
Nelson, if (htmlspecialchars(AddLinkPrefix("Photo1",$data["vPhoto1"]))!="photos") { $value="<img"; $value.=" onmouseover=\"if(LoadMainPhoto != null) LoadMainPhoto('".htmlspecialchars(AddLinkPrefix("Photo1",$data["vPhoto1"]))."');\""; $value.=" width=150"; $value.=" border=0"; $value.=" src=\"".htmlspecialchars(AddLinkPrefix("Photo1",$data["vPhoto1"]))."\">"; } else $value=""; |
N
|
Nelson author 8/4/2008 |
Nelson, we use following code in the "View as" settings dialog --> Custom to hide empty images:
|
J
|
Jane 8/4/2008 |
It's difficult to tell you what's happening without seeing actual files. |
N
|
Nelson author 8/5/2008 |
Hi Jane! |