Support Forums

Where does {$extra_listing_fields} come from?

This is a discussion on Where does {$extra_listing_fields} come from? within the Technical Support forums, part of the Technical Support Forums category; Hi, I have a huge amount of extra fields, and when posting it can be confusing because they are so ...


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 05-04-2009, 07:34 AM   #1
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 906
Rep Power: 24
bowers01 is on a distinguished road
Default Where does {$extra_listing_fields} come from?

Hi,
I have a huge amount of extra fields, and when posting it can be confusing because they are so close together.
I want to use this
Code:
onMouseOver="this.bgColor = '#C0C0C0'"
    onMouseOut ="this.bgColor = '#FFFFFF'"
but in step3.tpl just has {$extra_listing_fields}, where does this come from? how do i edit it?
Cheers,
Nick
__________________
Nick Bowers
68c v4.09 Developer Custom Template
bowers01 is offline  
Old 05-04-2009, 09:24 AM   #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

Quote:
Originally Posted by bowers01
Hi,
I have a huge amount of extra fields, and when posting it can be confusing because they are so close together.
I want to use this
Code:
onMouseOver="this.bgColor = '#C0C0C0'"
    onMouseOut ="this.bgColor = '#FFFFFF'"
but in step3.tpl just has {$extra_listing_fields}, where does this come from? how do i edit it?
Cheers,
Nick
If you follow your own advice.....

http://www.68classifieds.com/forums/...title-tag.html

you will see the script where checkout originates and if you take a second to look at that file it will show you the exact path to each of the checkout files. As luck would have it they have similar names to the steps in checkout...ie step3.php.


Look in step3.php and you see the extra fields being returned from a function in the Lisings file....

$class_tpl->assign('extra_listing_fields', $Listings->extra_listing_fields($category));

Look in Listings.php for the function name extra_listing_fields and you will have the function that collects the extra field data from the database and builds the html to display it.
__________________
Larry
Lhotch is offline  
Old 05-07-2009, 08:17 AM   #3
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 906
Rep Power: 24
bowers01 is on a distinguished road
Default

Hi,
Thanks for the reply.
If i search in listings.php i can find function extra_listing_fields($section) is this where you are talkign about? if so there are different sections where it makes a table.

1.
Code:
if($row['fType']=="P")
2.
Code:
if($row['fType']=="D" && $row['fRange']=="N")
3.
Code:
elseif($row['fType']=="D" && $row['fRange']=="Y")
4.
Code:
elseif($row['fType']=="C")
5 and the rest
Code:
elseif($row['fType']=="B")
elseif($row['fType']=="S")
elseif($row['fType']=="M")
elseif($row['fType']=="F")
Which one should i be changing?
Thanks for the help,
Nick
__________________
Nick Bowers
68c v4.09 Developer Custom Template
bowers01 is offline  
Old 05-07-2009, 09:14 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

Quote:
Originally Posted by bowers01
If i search in listings.php i can find function extra_listing_fields($section) is this where you are talkign about? if so there are different sections where it makes a table.
Yep, there are different sections because there are different extra field types (ie text fields, date fields, check boxes etc).

Quote:
Originally Posted by bowers01
Which one should i be changing?
You change the ones that create the content for your extra field types. You didnt share that details so I cant be much more specific.
__________________
Larry
Lhotch is offline  
Old 05-07-2009, 09:41 AM   #5
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 906
Rep Power: 24
bowers01 is on a distinguished road
Default

Ok, I found which one does it for a single line text box and the code is as follows:
Code:
$optdata.="<tr><td align='left' class='formleft'><label for=\"opt".$row['fID']."\">".$star ." ". $row['fName'].":</label></td><td align='left' class='formright'><input type=\"text\" id=\"opt".$row['fID']."\" name=\"opt".$row['fID']."\" value=\"".$defaultValue."\" /></td></tr>\n";
If i add it like this
Code:
$optdata.="<tr onMouseOver="this.bgColor = '#C0C0C0'" onMouseOut ="this.bgColor = '#FFFFFF'"><td align='left' class='formleft'><label for=\"opt"
i get this error
Quote:
Parse error: parse error in C:\wamp\www\includes\classes\kernel\Listings.php on line 1814
How should the code look? i have no idea what im doing with php.

Thanks for the help.
Nick
__________________
Nick Bowers
68c v4.09 Developer Custom Template
bowers01 is offline  
Old 05-07-2009, 09:58 AM   #6
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

Quote:
Originally Posted by bowers01
How should the code look? i have no idea what im doing with php.
Just like in html, javaswcript or CSS, single and double quotes along with other characters represent the start and end of certain types of data.

In php if you are simply assigning plain text to variable you enclose it in either single or double quotes...ie

$myvariable = "this is the data inside the variable";

If you notice in your quotes line you have all sorts of single and double quotes and you also seem to be missing the semicolon which indicated the end of the line for php.
__________________
Larry
Lhotch is offline  
Old 05-08-2009, 04:57 AM   #7
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 906
Rep Power: 24
bowers01 is on a distinguished road
Default

Quote:
Originally Posted by Lhotch
$myvariable = "this is the data inside the variable";
If i have it like this
Code:
$optdata.="<tr onMouseOver=this.bgColor = '#C0C0C0'; onMouseOut =this.bgColor = '#FFFFFF';>
Where it does not have the two " it does not work but it does not have an error

It needs to be like this
Code:
$optdata.="<tr onMouseOver="this.bgColor = '#C0C0C0'"; onMouseOut ="this.bgColor = '#FFFFFF'">
but when its like that it errors.

How else can i do it?

Cheers
__________________
Nick Bowers
68c v4.09 Developer Custom Template
bowers01 is offline  
Old 05-08-2009, 08:01 AM   #8
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,716
Rep Power: 50
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

It looks like you are missing the final " at the end after the >"
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.5)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline  
Old 05-08-2009, 08:37 AM   #9
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 906
Rep Power: 24
bowers01 is on a distinguished road
Default

Quote:
Originally Posted by Mike-N-Tosh
It looks like you are missing the final " at the end after the >"
Thanks for the reply, but i just didnt copy the rest of it.
The whole line looks like this:
Code:
$optdata.="<tr onMouseOver="this.bgColor = '#C0C0C0'"; onMouseOut ="this.bgColor = '#FFFFFF'"><td nowrap=\"nowrap\" valign=\"top\" width=\"5%\">".$star ." <label for=\"opt".$row['fID']."\">". $row['fName'].":</label></td><td align='left' class='formright'><input type=\"text\" name=\"opt".$row['fID']."\" id=\"opt".$row['fID']."\" value=\"".$defaultValue."\" /></td></tr>\n";
Cheers,
Nick
__________________
Nick Bowers
68c v4.09 Developer Custom Template
bowers01 is offline  
Old 05-08-2009, 09:17 AM   #10
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

in php you can surround strings with double or single quotes and if you have quotes within quotes they need to be escaped.

Your best bet, so as not to mess up the JS, is use single quotes around the whole string, then escape double quotes within the string.

Try googling for "php escaping quotes in string" and/or "javascript in php".

This has all been covered adnauseum on the net.
__________________
Larry
Lhotch is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
extra_listing_fields in usermodifylisting.tpl - help darek Technical Support 5 09-16-2008 06:40 PM


All times are GMT -4. The time now is 12:37 AM.


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