Support Forums

Check Box Extra Field Layout ...

This is a discussion on Check Box Extra Field Layout ... within the Technical Support forums, part of the Technical Support Forums category; I've added a checkbox extra field under categories. I have quite a few selections to choose from under that extra ...


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 07-20-2009, 10:32 AM   #1
Senior Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 219
Rep Power: 11
MrGForce is on a distinguished road
Default Check Box Extra Field Layout ...

I've added a checkbox extra field under categories.

I have quite a few selections to choose from under that extra field, and would like those check boxes to line up horizontally, and wrap, instead of vertically, as it stretches the page down to much when putting in a new listing and also when searching.

Can this be done? And if so, what file(s) would I need to edit?

Thanks.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline  
Old 07-20-2009, 10:47 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,347
Rep Power: 133
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Extra fields are passed as an array to the template. In the default template the array is looped over and the fields displayed with the following.

Code:
{foreach from=$extrafields item=extras}
			<tr>
				<td><strong>{$extras.title}:</strong></td>
				<td>
					{if isset($extras.value)}
					  {foreach key=key item=item from=$extras.value}
						{$item|nl2br}<br />
						{foreachelse}
						{$extras.value}
					  {/foreach}
					 {/if}
				</td>
			</tr>
			{/foreach}
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 07-20-2009, 11:12 AM   #3
Senior Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 219
Rep Power: 11
MrGForce is on a distinguished road
Default

Thanks for the reply Larry.

Thought if I took out the <br /> code from the viewlistings.tpl file it would fix the problem, but it didn't. I even went in and deleted the compiled templates using the mainenance module.

Any suggestions, or will it simply not work no matter what I do?
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline  
Old 07-20-2009, 11:15 AM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,347
Rep Power: 133
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

You may need to remove the nl2br section of the item variable...

{$item|nl2br}

Keep in mind that handles ALL of the variables. So if you have some text extra fields in addition to checkbox fields and gtenerically remove the break for all then they will ALL run horizontal.

So you may need to ad logic in there to see what extra field is actually being processed.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 07-20-2009, 11:38 AM   #5
Senior Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 219
Rep Power: 11
MrGForce is on a distinguished road
Default

Did your suggestion Larry and it's still the same. I went and did the maintenance thing again to make sure.

When you go in and check the source code of the search page and the step3 checkout page, which display these extra fields, it still shows a <br /> after each check box code line.

Could this be something in the ajax.php file?
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline  
Old 07-20-2009, 11:58 AM   #6
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,071
Rep Power: 61
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by MrGForce
Could this be something in the ajax.php file?
Yep, that's exactly where it comes from. Line#295
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and 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 07-20-2009, 12:51 PM   #7
Senior Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 219
Rep Power: 11
MrGForce is on a distinguished road
Default

Hey Mike;

Thanks. That worked for the search function just fine, but the step3 still shows the check boxes on individual lines. Step3 simply asks for the {$extra_listing_fields} which seems like it would be getting it's info from the same place as the search, but somehow it's not.

Any other ideas?
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline  
Old 07-20-2009, 01:38 PM   #8
Senior Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 219
Rep Power: 11
MrGForce is on a distinguished road
Default

Hey Guys;

Using your ideas, I found that there is actually another file that controls how some of the extra fields are displayed, depending on what file is displaying them.

As I mentioned in the previous post, the ajax.php file fixed the search function. Thanks Mike.

So I got to searching the program files and found that there was another place that had the same function as the ajax file. That file was .....

/includes/classes/kernal/Listings.php

That file actually had two(2) places in it where it gives the <br /> code for the extra fields.

$optdata.="<input type=\"checkbox\" name=\"opt".$row['fID']."[]\" value=\"".$opt['optValue']."\"".$checked." />".$opt['optValue']."<br />\n";

I removed the <br /> code and everything works just fine.

Thanks again guys for all your help. I really do appreciate it.

.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline  
Old 07-20-2009, 04:24 PM   #9
curmudgeon
 
Join Date: Mar 2006
Posts: 5,347
Rep Power: 133
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 MrGForce
Hey Guys;

Using your ideas, I found that there is actually another file that controls how some of the extra fields are displayed, depending on what file is displaying them.

As I mentioned in the previous post, the ajax.php file fixed the search function. Thanks Mike.

So I got to searching the program files and found that there was another place that had the same function as the ajax file. That file was .....

/includes/classes/kernal/Listings.php

That file actually had two(2) places in it where it gives the <br /> code for the extra fields.

$optdata.="<input type=\"checkbox\" name=\"opt".$row['fID']."[]\" value=\"".$opt['optValue']."\"".$checked." />".$opt['optValue']."<br />\n";

I removed the <br /> code and everything works just fine.

Thanks again guys for all your help. I really do appreciate it.

.
And there in lies part of the problem. I assumed you were talking about in the viewlisting.tpl template. Not the search of step3 of checkout.

The more accurate and complete the question the more accurate and complete the answer.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 07-20-2009, 08:41 PM   #10
Senior Member
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 219
Rep Power: 11
MrGForce is on a distinguished road
Default

FYI

in the first post I did mention exactly what I wanted ......

.....when putting in a new listing and also when searching. .....

and in all actuality, the ajax file should have been the only file in question, as Mike stated, but it wasn't this time for some reason.

I always try to make sure I ask for EXACTLY what I'm trying to accomplish, and I do appreciate all the help the forum provides. It's one of the main reasons I decided to purchase the product. Sorry i didn't specifically mention the step3 file. I'll be more specific next time.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Extra Field Eric Barnes Modification Release 4 11-28-2008 05:39 PM
Change format in "date field" extra field topbidz Technical Support 2 05-01-2008 08:38 PM


All times are GMT -4. The time now is 07:17 AM.


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