PDA

View Full Version : MOD - Listingview Main Image w/ Java Change



Mick
10-27-2003, 03:28 PM
Classification: Single file drop-in mod -or- User self install with file editing instructions

MOD Name: Listingview Main Image w/ Java Change
Author: Mick`
MOD Description: This adds the large main image to the listingview page with the added functionality of changing the main image when the thumbnails are clicked on. Versions for the default layout with the thumbnails in a vertical column to the left of the main image and a new layout with the thumbnails in horizontal rows under the main image are included in this file.

Demo: http://virtualrealty.dnyed.com

MOD Version: 091003
Installation Level: Easy
Installation Time: ~ 1 minute

Ditto
06-02-2004, 12:15 PM
THANK YOU!!!

I'm new to OR but not to scripts in general. You just saved me tons of work.

:D

rudi
06-03-2004, 05:56 AM
Need some help to get the description of the pictures to be displayed under the pictures when the pictures change when clicked on.

Any help much apriciated.

janc
06-03-2004, 12:08 PM
discription of the pictures to be displayed under the pictures

add

description
in the sql statement on line 82 somewhere between select and from,
add

$description = make_db_unsafe ($recordSet->fields['description']);
on line 100 and place

echo "<b>$description</b><br><br>";
at line 111
This wil put the description under the thumbnails. (i hope)
succes

rudi
06-04-2004, 07:05 AM
I wanted the description text to go under the big main image and change when the big image changes to the description that goes with the image.

Thanks anyway,

I will try to do it (no success yet)

Anybody, any help much appreciated.

RealtyOne
06-06-2004, 10:49 PM
Script failed -Removed

relic_120
06-07-2004, 12:05 AM
This is my first post ever on open-realty.org, so first of all: THANK YOU SOOO MUCH!!

Okay, I download this mod and modified the code using RealtyOne's post, the only problem is that it is only giving me the description of the first picture. I've just barely got this going and its all on my home comp so i can't show the page.
The "feature" that I'm using is the Example Listing: White House. No matter which image I click to view the description under the main/big picture is:


This property has six floors, 132 rooms, 35 bathrooms, 147 windows, 412 doors, 12 chimneys, 8 staircases, and 3 elevators.

which is the description of 1_white-house.jpg. I'm new to php but a novice C and Java programmer, but I couldn't figure out what went wrong. Thanks for your help in advance, and thx for the mod!

-Relic_120

RealtyOne
06-07-2004, 01:48 AM
Thanx for the bug report.
I will look at this and repost.
the code was untested and actually just used the sample code given in a previous post :)

Edit:
After looking at Mick`s code i notice that the main imagejava function actually does nothing and could easily be done without it is used only to display the initial image after that it is never used again. This is why the script returned the same text for all images since that function is only used for one image.
Really this is something for Mick as it would be major modification to his mod which he may not be happy about others doing. I will leave this a day or two and see if he works something out first.


Edit: i have posted a new mod that does what you want but it may not suit you since it does not use the java system to swap the image etc. you can find it here http://www.open-realty.org/phpBB2/viewtopic.php?t=3647

digires
06-17-2004, 08:40 PM
Is there a simple way to have the image swap out when the mouse cursor moves over the image instead of clicking the image?

**Update**

I answered my own question:
in renderListingsImagesJava change:

echo "<a href=\"javascript&#58;imgchange&#40;'$file_name'&#41;\"> ";

to this:

echo "<a href=\"\" onMouseOver=\"imgchange&#40;'$file_name'&#41;\"> ";

John

Will
06-25-2004, 02:26 PM
The mouseover change made by digires above works but if a user clicks on the thumbs it links back to your baseurl(homepage).

Does anyone know how to stop that from happening?

php-dawg
07-14-2004, 01:42 PM
See this post: http://www.open-realty.org/support/showthread.php?t=1185, just replace this:

echo "<a href=\"\" onMouseOver=\"imgchange('$file_name')\"> ";

with this:

echo "<a href=\"javascript:void imgchange('$file_name');\" onmouseover=\"imgchange('$file_name');\" onclick=\"this.blur();\"> ";

Will
07-27-2004, 01:23 PM
Hello all,

I am allowing agents to upload three agent images. Displayed on userview page. What would be involved in adapting this mod to work there? Is is simply changing the queries to retrieve image info from userImages table instead of listingImages table? Any help would be greatly appreciated, as I have blown up the page three times attempting this. I had backed up the files so it was OK, but Im puzzled by this.

Thanks for any help you can offer.
Will

Will
07-30-2004, 01:30 PM
Whatever I did to be placed on the ignore list. I am very sorry. Some help adapting Main Image w/ Java Change to userview.php would indebt me to someone.

Thanks all,
Will

Mick
07-30-2004, 01:55 PM
nobody has placed you on any sort of ignore, if you don't get an answer to your request either it's been overlooked or, nobody that has seen it wants to do that work for you.

That being said, adapting this to the userview shouldn't be too difficult since the images tables are very similar. I'm not taking on any mod projects right now as I'm rather busy with 2 client sites I'm working on and trying to adapt some of my mods to the upcoming OR 2.0.

If this is something that you absolutely cannot do on your own then you may try posting this request in the "work" forum and offering somebody some monatary consideration for their time.

RealEstate
07-30-2004, 02:32 PM
Will,

I'm not completely sure what you're asking but is this what your're looking for?
http://open-realty.org/demo/userview.php?user=5

RealEstate

Will
07-30-2004, 04:55 PM
All,
Just joking about the ignore. Bad joke I guess. I just figured someone would have allready done this. I haven't had any luck searching the board though. I will keep trying to make this work. I will post if sucessful.

RealEstate, that is close. But what I'm after is the same look, and functionality as Mick's mod, but on the userview.php page.

I understand everyone is busy,and I appreciate all the help I have recieved here. :)

SkeletinCrew
08-04-2004, 11:37 AM
Will, I was trying to do the exact same thing. I installed Mick's img swap and came to the conclusion that his idea was better for me...and less work. My line of thinking was, why click again when I could render the same images on the listingview page. Hope this helps!
--Mark

erenger
08-17-2004, 05:02 AM
Hi,

Rudi already asked this but no reply so far. But maybe somebody has solved his question by now. What I'm looking for is a way to show the description of the image that is shown. I use the onmouseover option. So I would like to put a description below the large image and the description to change as soon as the mouse goes over another image.

Is that possible?

Cheers,
Eduard

brooksh
09-08-2004, 01:11 AM
I cannot get the nophoto.gif to display if no photo is available.

<?php echo "<SCRIPT Language=\"JAVASCRIPT\"> function imgchange(name){if(document.images){document.main. src = \"$config[listings_view_images_path]/\" + name; } else { document.main.src = \"images/nophoto.gif\"; }}</SCRIPT>";

?>

It doesn't show anything without a photo. Does anyone know how to get the nophoto.gif to display?

webfeatus
09-19-2004, 09:03 PM
Was the issue of this mod being able to display the captions and/or images under the swapped (large) image adressed somewhere in this post or in another thread?

rudi
09-23-2004, 06:03 AM
As Mick did not have the time yet to change this mod, I made this temporary solution that will displays all the description of all images under the main image.


--------------------------------INSTRUCTIONS--------------------------------------------------------------------------------------------------------------------

1) make a new folder (folder used here is new_files) in OR root folder.


2) Save the code below (below END INSTRUCTIONS) as img_description_all.php in folder new_files.


3) On page listingview.php under: include("$config[template_path]/user_top.html");

Insert the following: include("new_files/img_description_all.php");


4) On page listingview.php replace the following code with the code in step 5

<?php renderListingsMainImageJava($listingID) ?><BR>
<?php rendervtourlink($listingID) ?><BR></td>
</tr>
<tr>


5)

<?php renderListingsMainImageJava($listingID) ?><BR></tr>
<tr>
<?php rendervtourlink($listingID) ?></tr>
<td> <tr><td align="left" width="100%">
<?php renderListingsDescriptionAll($listingID) ?></td> </tr>
<tr>



----------------------------END INSTRUCTIONS---------------------------------------------------------------------------------------------------------



<?php
function renderListingsDescriptionAll($listingID)
{
// shows the description connected to a given image


global $conn, $lang, $config, $style;
// grab the description
$listingID = make_db_extra_safe($listingID);
$sql = "SELECT ID, caption, file_name, thumb_file_name, description FROM " . $config['table_prefix'] "listingsImages WHERE (listing_id = $listingID) ORDER BY rank";
$recordSet = $conn->Execute($sql);
if ($recordSet === false)
{
log_error($sql);
}



$num_images = $recordSet->RecordCount();
if ($num_images > 0)
{
while (!$recordSet->EOF)
{
$thumb_file_name = make_db_unsafe ($recordSet->fields['thumb_file_name']);
$file_name = make_db_unsafe ($recordSet->fields['file_name']);
$imageID = make_db_unsafe ($recordSet->fields['ID']);
$caption = make_db_unsafe ($recordSet->fields['caption']);
$description = make_db_unsafe ($recordSet->fields['description']);



if ($caption == "")
$recordSet->MoveNext();



elseif ($caption != "")
echo "<b>$caption:&nbsp;</b>";
echo "$description<br>";



$recordSet->MoveNext();
}
}
}// end function renderListingsDescriptionAll
?>

jntcomputers
10-01-2004, 09:36 PM
Can you change it to have a next & previous button instead of thumbnails?

Mick
10-01-2004, 09:47 PM
There is already a mod that does that.. search for Slideshow and that'll be it

jntcomputers
10-01-2004, 09:51 PM
I found the one by wobblyboy and it doesn't work. I don't think it is complete. I am at a loss...

sheanichole
10-28-2004, 10:06 PM
Here is my install of this mod:
http://www.tuckerhouseofrealty.com/listingview.php?listingID=2

I love it, however, how do I get it to be horizontal thumbnails beneath the main pic, like this site: http://www.southpadreislandlistings.com/listingview.php?listingID=26

Thanks for your help!

Mick
10-29-2004, 12:27 AM
use the lisingview.php file from the horizontal rows directory in the zip.

sheanichole
10-29-2004, 12:48 AM
Thanks, I'll try that!

TroyM
02-25-2005, 07:30 PM
Rudi,

Thank you for the explanation...How can I make those changes on OR 2..
I could not find the listingview.php..Then I checked inc files..listing.inc but I could not find the line I need to change...


Thanks

Troy M

Mick
02-25-2005, 07:48 PM
this is a mod for 1.x not 2.0....

file structure and code is much different for 2.0

OR2 is already setup to use listingview templates that are selectable from the config...

I'm not going to get into how to edit the current templates to make changes as.. I really don't get why everybody is so quick to edit a alpha version of software under development.. if you make changes to an alpha software.. you now have an unsupported and possibly unupgradable version of the software or at the very least will have a software that you will need to make your changes to over and over again every time a new dev version is released or when the final version is released

TroyM
02-26-2005, 12:36 AM
Micky,

Thank you for your explanation...It was very helpful...I do not want to waste my time and others...

Thanks
Troy M



this is a mod for 1.x not 2.0....

file structure and code is much different for 2.0

OR2 is already setup to use listingview templates that are selectable from the config...

I'm not going to get into how to edit the current templates to make changes as.. I really don't get why everybody is so quick to edit a alpha version of software under development.. if you make changes to an alpha software.. you now have an unsupported and possibly unupgradable version of the software or at the very least will have a software that you will need to make your changes to over and over again every time a new dev version is released or when the final version is released