This topic is locked
[SOLVED]

 Tumbnails on fly(RealEstate Project)

7/1/2008 3:13:44 PM
PHPRunner General questions
N
Nelson author

Hi!

There is a Tumbnail on fly function in already to use version of your PHPRunner projects(RealEstate)!

I wanted to use the project for my use...but the project is not flexible...and as soon as in the Datasource table,I change a thing..the whole thing don't function anymore!...
...and when a slight change is done to it for own use, the table lock itself and I am not able to manipulate the table after that!
Now my question is if you could give me the 1,2,3 of how to make the Photos to change like that when the mouse goes over them...or teach me how to change the realestate project to rich my needs!(for example I want to put my own add alternatives on the tables and still keep the Photo functions of it, which is the main goal of mine)
I thank you beforehand!
Nelson

N
Nelson author 7/2/2008

I'm Experimenting myself!..Please tell me where I went wrong!

This is what I did!
1.I created a simple table with six fields:3 for Photos(Photo1,Photo2,Photo3)

And three viwer fields as(vPhoto1,vPhoto2,vPhoto3)
2.In the Visual editor(PHPR)...I changerd the properties as the pic below




3.And I changed the properties of the vPhoto's fields as follow, I change the field to custom and I inserted the following code to each Vphoto fields :

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="";
4.I inserted a link from the RealEstate project which was:<IMG

id=imgMainPhoto

src="file:///D:/Documents%20and%20Settings/Administrat%F6r.SS777/Mina%20dokument/PHPRunnerProjects/Abia/tmp/{$row00firstphoto_value}">

I added this link in the Htm at the view page....
But still I've got this picture in the view page after uploading and saving an ad:



J
Jane 7/2/2008

Hi,
first you need to create table with three fileds and edit your SQL query on the Edit SQL query tab:

select Photo1,

Photo2,

Photo3.

Photo1 AS vPhoto1,

Photo2 AS vPhoto2,

Photo3 AS vPhoto3

from TableName



Also use photos instead of photos/ on the "Edit as" settings dialog on the Visual Editor tab.

Add ViewOnLoad event for this table. Use sample code from RealEstate template.

N
Nelson author 7/2/2008

Jane thanks alot for your reply and help!
I'm almost done I feel...but the code which I put in the 'view on load' is setting stop for the end result,
My Test table is this:

Table's name: TableName

field 1: ID

field 2: Photo1

field 3: Photo2

field 4: Photo3


I clicked on the custom code and inserted this code(view on load):

I copied changed and put this code in the 'view on load' in the events page(PHPR)!

global $conn,$smarty;

$rstt = db_fetch_array($pic);

$pic="";

if($rstt["Photo1"]!="")

$pic=$rstt["Photo1"];

else if($rstt["Photo2"]!="")

$pic=$rstt["Photo2"];

else if($rstt["Photo3"]!="")

$pic=$rstt["Photo3"];
if($pic=="")

$smarty->assign("row00firstphoto_value",htmlspecialchars("images\\no_image.gif"));

else

$smarty->assign("row00firstphoto_value",htmlspecialchars(AddLinkPrefix("Photo1",$pic)));



And I've got this error at the view page(picture below):




The whole code from the 'RealEstate project was this:

global $conn,$smarty;

$data = db_query("select tblresults.*, tblcooling.Cooling as strCooling, tblheating.Heating as strHeating, tbltype.Type as strType, tblstyle.Style as strStyle from tblresults left join tblcooling on tblcooling.CoolingID=tblresults.Cooling left join tblheating on HeatingID=tblresults.Heating left join tbltype on TypeID=tblresults.Type left join tblstyle on StyleID=tblresults.Style where PropertyID=".$_REQUEST["editid1"],$conn);

$rstt = db_fetch_array($data);
$smarty->assign("show_Type",$rstt["strType"]);

$smarty->assign("show_Style",$rstt["strStyle"]);

$smarty->assign("ch_Kitchen",$rstt["Kitchen"]);

$smarty->assign("ch_Living_Room",$rstt["Living_Room"]);

$smarty->assign("ch_Family_Room",$rstt["Family_Room"]);

$smarty->assign("ch_Rec_Room",$rstt["Rec_Room"]);

$smarty->assign("ch_Study_Room",$rstt["Study_Room"]);

$smarty->assign("ch_Sun_Room",$rstt["Sun_Room"]);

$smarty->assign("ch_Loft",$rstt["Loft"]);

$smarty->assign("ch_Amusement_Room",$rstt["Amusement_Room"]);

$smarty->assign("ch_Foyer",$rstt["Foyer"]);

$smarty->assign("ch_Office",$rstt["Office"]);

$smarty->assign("ch_Den",$rstt["Den"]);

$smarty->assign("ch_Dinning_Room",$rstt["Dinning_Room"]);

if(is_null($rstt["FullBaths"]))

$smarty->assign("ch_FullBaths",False);

else if($rstt["FullBaths"]==0)

$smarty->assign("ch_FullBaths",False);

else

$smarty->assign("ch_FullBaths",True);
if(is_null($rstt["3/4Baths"]))

$smarty->assign("ch_3_4Baths",False);

else if($rstt["3/4Baths"]==0)

$smarty->assign("ch_3_4Baths",False);

else

$smarty->assign("ch_3_4Baths",True);
if(is_null($rstt["1/2Baths"]))

$smarty->assign("ch_1_2Baths",False);

else if($rstt["1/2Baths"]==0)

$smarty->assign("ch_1_2Baths",False);

else

$smarty->assign("ch_1_2Baths",True);
if($rstt["Wood_Burning_Fireplace"]==0)

$smarty->assign("ch_Wood_Burning_Fireplace",False);

else

$smarty->assign("ch_Wood_Burning_Fireplace",True);
if($rstt["Gas_Burning_Fireplace"]==0)

$smarty->assign("ch_Gas_Burning_Fireplace",False);

else

$smarty->assign("ch_Gas_Burning_Fireplace",True);
if($rstt["Range"]==0)

$smarty->assign("ch_Range",False);

else

$smarty->assign("ch_Range",True);
if($rstt["Cooktop"]==0)

$smarty->assign("ch_Cooktop",False);

else

$smarty->assign("ch_Cooktop",True);
if($rstt["Dishwasher"]==0)

$smarty->assign("ch_Dishwasher",False);

else

$smarty->assign("ch_Dishwasher",True);
if($rstt["Disposal"]==0)

$smarty->assign("ch_Disposal",False);

else

$smarty->assign("ch_Disposal",True);
if($rstt["Dryer"]==0)

$smarty->assign("ch_Dryer",False);

else

$smarty->assign("ch_Dryer",True);
if($rstt["Exhaust_Fan/Hood"]==0)

$smarty->assign("ch_Exhaust_Fan_Hood",False);

else

$smarty->assign("ch_Exhaust_Fan_Hood",True);
if($rstt["Eat_In_Kitchen"]==0)

$smarty->assign("ch_Eat_In_Kitchen",False);

else

$smarty->assign("ch_Eat_In_Kitchen",True);
if($rstt["Kitchen/Dining_Room"]==0)

$smarty->assign("ch_Kitchen_Dining_Room",False);

else

$smarty->assign("ch_Kitchen_Dining_Room",True);
if($rstt["Separate/Formal_Dining_Room"]==0)

$smarty->assign("ch_Separate_Formal_Dining_Room",False);

else

$smarty->assign("ch_Separate_Formal_Dining_Room",True);
if($rstt["Microwave"]==0)

$smarty->assign("ch_Microwave",False);

else

$smarty->assign("ch_Microwave",True);
if($rstt["Refrigerator"]==0)

$smarty->assign("ch_Refrigerator",False);

else

$smarty->assign("ch_Refrigerator",True);
if($rstt["Wall_Oven"]==0)

$smarty->assign("ch_Wall_Oven",False);

else

$smarty->assign("ch_Wall_Oven",True);
if($rstt["Water_Softener"]==0)

$smarty->assign("ch_Water_Softener",False);

else

$smarty->assign("ch_Water_Softener",True);
if($rstt["Basement"]==0)

$smarty->assign("ch_Basement",False);

else

$smarty->assign("ch_Basement",True);
if($rstt["Finished_Basement"]==0)

$smarty->assign("ch_Finished_Basement",False);

else

$smarty->assign("ch_Finished_Basement",True);
if($rstt["Walkout"]==0)

$smarty->assign("ch_Walkout",False);

else

$smarty->assign("ch_Walkout",True);
if($rstt["Sum_Pump"]==0)

$smarty->assign("ch_Sum_Pump",False);

else

$smarty->assign("ch_Sum_Pump",True);
if($rstt["Drain_Tiled"]==0)

$smarty->assign("ch_Drain_Tiled",False);

else

$smarty->assign("ch_Drain_Tiled",True);
if($rstt["Daylight/Lookout_Windows"]==0)

$smarty->assign("ch_Daylight_Lookout_Windows",False);

else

$smarty->assign("ch_Daylight_Lookout_Windows",True);
if($rstt["Cooling"]==0)

$smarty->assign("ch_Cooling",False);

else

{

$smarty->assign("ch_Cooling",True);

$smarty->assign("show_Cooling",$rstt["strCooling"]);

}
if($rstt["Heating"]==0)

$smarty->assign("ch_Heating",False);

else

{

$smarty->assign("ch_Heating",True);

$smarty->assign("show_Heating",$rstt["strHeating"]);

}
if($rstt["Lot"]==0)

$smarty->assign("ch_Lot",False);

else

$smarty->assign("ch_Lot",True);
if(is_null($rstt["Lot_Dimension1"]))

$smarty->assign("ch_Lot_Dimension1",False);

else if($rstt["Lot_Dimension1"]==0)

$smarty->assign("ch_Lot_Dimension1",False);

else

$smarty->assign("ch_Lot_Dimension1",True);
if(is_null($rstt["Lot_Dimension2"]))

$smarty->assign("ch_Lot_Dimension2",False);

else if($rstt["Lot_Dimension2"]==0)

$smarty->assign("ch_Lot_Dimension2",False);

else

$smarty->assign("ch_Lot_Dimension2",True);
if(is_null($rstt["Lot_Dimension3"]))

$smarty->assign("ch_Lot_Dimension3",False);

else if($rstt["Lot_Dimension3"]==0)

$smarty->assign("ch_Lot_Dimension3",False);

else

$smarty->assign("ch_Lot_Dimension3",True);
if(is_null($rstt["Lot_Dimension4"]))

$smarty->assign("ch_Lot_Dimension4",False);

else if($rstt["Lot_Dimension4"]==0)

$smarty->assign("ch_Lot_Dimension4",False);

else

$smarty->assign("ch_Lot_Dimension4",True);
if(is_null($rstt["Lot_Dimension5"]))

$smarty->assign("ch_Lot_Dimension5",False);

else if($rstt["Lot_Dimension5"]==0)

$smarty->assign("ch_Lot_Dimension5",False);

else

$smarty->assign("ch_Lot_Dimension5",True);
if(is_null($rstt["Lot_Dimension6"]))

$smarty->assign("ch_Lot_Dimension6",False);

else if($rstt["Lot_Dimension6"]==0)

$smarty->assign("ch_Lot_Dimension6",False);

else

$smarty->assign("ch_Lot_Dimension6",True);
if(is_null($rstt["Lot_Dimension7"]))

$smarty->assign("ch_Lot_Dimension7",False);

else if($rstt["Lot_Dimension7"]==0)

$smarty->assign("ch_Lot_Dimension7",False);

else

$smarty->assign("ch_Lot_Dimension7",True);
if(is_null($rstt["Lot_Dimension8"]))

$smarty->assign("ch_Lot_Dimension8",False);

else if($rstt["Lot_Dimension8"]==0)

$smarty->assign("ch_Lot_Dimension8",False);

else

$smarty->assign("ch_Lot_Dimension8",True);
$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"];

else if($rstt["Photo5"]!="")

$pic=$rstt["Photo5"];

else if($rstt["Photo6"]!="")

$pic=$rstt["Photo6"];

else if($rstt["Photo7"]!="")

$pic=$rstt["Photo7"];

else if($rstt["Photo8"]!="")

$pic=$rstt["Photo8"];

else if($rstt["Photo9"]!="")

$pic=$rstt["Photo9"];
if($pic=="")

$smarty->assign("row00firstphoto_value",htmlspecialchars("images\\no_image.gif"));

else

$smarty->assign("row00firstphoto_value",htmlspecialchars(AddLinkPrefix("Photo1",$pic)));

J
Jane 7/3/2008

Hi,
here is the correct code:

global $conn,$smarty,$strTableName;

*if (@$_REQUEST["editid1"])

{

$data = db_query("select
from ".$strTableName." where ID=".$_REQUEST["editid1"],$conn);

$rstt = db_fetch_array($data);

...

...

$smarty->assign("row00firstphoto_value",htmlspecialchars(AddLinkPrefix("Photo1",$pic)));

}**

N
Nelson author 7/3/2008

Hi Jane!

Sorry to bother you again...but the pictures aren't changing when mouse goes over them, I write the whole code here again, maybe I wrote something wrong!

----------------------------------------------------------

Events(View On Load)

// Put your code here.

//** Custom code ****

global $conn,$smarty,$strTableName;

if (@$_REQUEST["editid1"])

{

$data = db_query("select * from ".$strTableName." where ID=".$_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"];

if($pic=="")

$smarty->assign("row00firstphoto_value",htmlspecialchars("images\\no_image.gif"));

else

$smarty->assign("row00firstphoto_value",htmlspecialchars(AddLinkPrefix("Photo1",$pic)));

}



----------------------------------------------------------------------------------------------------------
And the part which should show the bigger picture has this code:I copied it from (RealEstate Project) and changed the imgMainPhoto source

<TD rowSpan="40" vAlign="top"></TD<TD rowSpan="40"

vAlign="top"><IMG id=imgMainPhoto

src="http://www.newtin.net/test/{$row00firstphoto_value}"></TD>;


------------------------------------------------------------------------------------------------------------
And the code put in the VPhoto1 field for exampel;

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="";


----------------------------------------------------------------------------------------------------------------

This is what the view page looks like now!

The images stays like this all the time....and won't change...even when the mouse goes over them small pics

J
Jane 7/4/2008

Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

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