|
|
#1 |
|
Senior Member
Join Date: Dec 2006
Posts: 105
Rep Power: 13 ![]() |
ok, the story begun when I decided to use google maps in my 68c. The maps work, I managed to put maps in viewlisting and both admins. However it would be nice to have one map with all the markers in the index.php. So the first thing what I did is to try to get all the listings in the index.php This may be done by 2 ways (similar) either toplistings.php or searchresults.php has to be placed in the index.php
So I placed this code from toplistings.php in the index.php: (I gave the sample but had to delete it as the message was too long) This will return exactly the same data as this: http://www.68classifieds.com/example/toplistings.php but it will show all the other data that is in the index.php OK, my google maps use extra fields with ID=2 for Latitude and ID=3 for Longitude to have control over Latitude and Longitude in the viewlisting.php I did this: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
However with PHP Code:
PHP Code:
My final code looks like this: PHP Code:
I think the code for extra fields should look like this: PHP Code:
(I had to shorten the code) Can anyone help me with this? Last edited by darek; 04-05-2007 at 02:19 AM. |
|
|
|
|
|
#2 |
|
Moderator
|
You need to include your extra fields inside of the while like the images are being done:
PHP Code:
__________________
John Snyder PHP Developer |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2006
Posts: 105
Rep Power: 13 ![]() |
Yeah, I new that but I got an error from the image, but I solved it bu changing the name of $result to $Vresult, so the code looks like this now:
PHP Code:
any idea how to make it change???? maybe the template should be changed? I still use the same PHP Code:
|
|
|
|
|
|
#4 |
|
Moderator
|
You shouldn't need to mess around with looping the fields outside of the results.
Modify your code to look like this: Replace this: PHP Code:
PHP Code:
Code:
{foreach from=$xFields item=item}
$item.fID
$item.title
$item.value
{foreachelse}
something else
{/foreach}
__________________
John Snyder PHP Developer |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Dec 2006
Posts: 105
Rep Power: 13 ![]() |
I saw this code in custom-fields-showlisting.zip, however mine was taken from original 3.15 version, Eric wrote it, and it nearly works perfect, the only thing is that it displays extras from one listing in all serched listings
I did try your code, doesn't work when I change PHP Code:
PHP Code:
PHP Code:
PHP Code:
- so it almost work fine, almost... would you have some more ideas? |
|
|
|
|
|
#6 |
|
Moderator
|
Ok, this works but you will need to test for specific field names to ensure your data pads for listings that don't have a value for each specific field.
I created two fields, test1 and test2: PHP Code:
PHP Code:
Code:
$xfSQL = "SELECT f.fID, f.fName, sValue FROM " . PREFIX . "products_fields AS p, `" . PREFIX . "fields` AS f WHERE p.pID='" . $row['id'] . "' AND f.fSeen='Y' AND p.fID=f.fID AND f.fID=1 ORDER BY f.fOrder ASC"; ...fID = 1 $row['field1'] = ...
__________________
John Snyder PHP Developer |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Dec 2006
Posts: 105
Rep Power: 13 ![]() |
John, THANK YOU VERY MUCH!!!
and I mean it. Ispent probably 30 or 40 hours trying to get the data from array in the first page. Not only your last post solved the problem but also made it all work!! I lost hope I could do it myself. Thank you once more. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|