Support Forums

extra_listing_fields in usermodifylisting.tpl - help

This is a discussion on extra_listing_fields in usermodifylisting.tpl - help within the Technical Support forums, part of the Technical Support Forums category; I need to call one extra field in $extra_listing_fields in usermodifylisting.tpl something like PHP Code:              {*  Extra Fields  *}             {foreach  ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 09-15-2008, 04:32 PM   #1
Senior Member
 
Join Date: Dec 2006
Posts: 110
Rep Power: 14
darek is on a distinguished road
Default extra_listing_fields in usermodifylisting.tpl - help

I need to call one extra field in $extra_listing_fields in usermodifylisting.tpl

something like
PHP Code:
            {* Extra Fields *}
            {foreach 
from=$extra_listing_fields item=extras}
            <
tr>
                <
td><strong>{$extras.title}:</strong></td>
                <
td>
                    {if isset(
$extras.value)}
                      {foreach 
key=key item=item from=$extras.value}
                        {
$item}<br />
                        {
foreachelse}
                        {
$extras.value}
                      {/foreach}
                     {/if}
                </
td>
            </
tr>
            {/foreach}
            {* 
End Extra Fields *} 
anyone would have an idea how to do it?

thanks
darek is offline  
Old 09-15-2008, 05:07 PM   #2
Coder
 
Join Date: Mar 2006
Posts: 4,692
Rep Power: 114
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

what do you mean "Call it"?
__________________
Larry
Lhotch is offline  
Old 09-16-2008, 04:16 AM   #3
Senior Member
 
Join Date: Dec 2006
Posts: 110
Rep Power: 14
darek is on a distinguished road
Default

Larry, thanks for your reply

well, I don't know how to name things

I added extra fields for google map
actually 3 of them
latitude
longitude
display: yes/no

now I need to display the map and be able to edit the above

the problem is that usermodifylisting.tpl uses $extra_listing_fields

I don't know how to get one particular thing like Latitude form $extra_listing_fields, I would like to do it via template file

is it possible?

the code should probably look like the one from my previous mail

thanks
darek is offline  
Old 09-16-2008, 09:11 AM   #4
Coder
 
Join Date: Mar 2006
Posts: 4,692
Rep Power: 114
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Just so I understand what you are doing, are you trying to display the google map on the page when the user modifies a listing? I assume the goal being that a user can edit their address and see the map while editing the listing.

The $extra_listing_fields is actually a PHP function that pulls the extra fields from the database and creates the html for the fields all at the same time and returns the fields, their existing values and the associated html all in the one variable.

The fields appear in the form with names line opt1, otp2 opt3 etc. You can try and grab the values from the html form or otherwise you would have to edit the $extra_listing_fields function to assign smarty variables.

On a related note, the google map module generates the map when the map address data is sent to google. So what this means is that even if you do get the data out and send it to the map it will generate the map based on the content of those fields when the page is loaded. If those values are changed the map wont automatically update unless that data is resubmitted to google which would require some sort of javascript.

Lastly, my module as its currently coded wont recognize the latitude longitude fields you created so even if you get past the above hurdles your going to have to modify the module code to actually use your latitude and longitude.

Quote:
Originally Posted by darek
the code should probably look like the one from my previous mail
Just an FYI, I am out of state for work all this week and dont have access to all of my e-mail acounts. I dont recall seeing an e-mail from you so if you sent after sunday morning and I havent replied then you must have sent it to an acount I wont have access to until this coming saturday.
__________________
Larry
Lhotch is offline  
Old 09-16-2008, 01:27 PM   #5
Senior Member
 
Join Date: Dec 2006
Posts: 110
Rep Power: 14
darek is on a distinguished road
Default

Larry, I didn't say it right - it should have been "in my previous post"

I did look at the map module - it is grate, but my customers may not want to give full address, but still want to have the map, in my v3.17 I do have a map, but I edided the php file too much, now I wont to try to get the data directly in smarty

does anyone have an idea how to do it?

thanks to all
darek is offline  
Old 09-16-2008, 06:40 PM   #6
Senior Member
 
Join Date: Dec 2006
Posts: 110
Rep Power: 14
darek is on a distinguished road
Default

Larry, I found another way!

I found 2 posts:
https://www.68classifieds.com/forums...edigree-2.html
https://www.68classifieds.com/forums...eparately.html

I added function
PHP Code:
function getListingFieldsN($id)
    {
        global 
$db;
        
$extra=array();
        
$sSQL "SELECT f.fID,sValue FROM ".PREFIX."products_fields AS p, `".PREFIX."fields` AS f WHERE p.pID='".$id."' AND p.fID=f.fID ORDER BY f.fOrder ASC";
        
$result=$db->query($sSQL);
        
$i=0;
        while (
$rs=$result->fetch()) 
        { 
etc 
from witch I removed
PHP Code:
AND f.fSeen='Y' 
I turned off all the fields so they can't be seen but I get them to work using the way from the above links

thanks for help!
darek is offline  
Closed Thread

Thread Tools
Display Modes



All times are GMT -4. The time now is 10:37 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0