Support Forums

Header Changer v3.0.15 - v3.1.5

This is a discussion on Header Changer v3.0.15 - v3.1.5 within the Templates, HTML, CSS, and Design Help forums, part of the General category; In "http://www.68classifieds.com/forums/showthread.php?t=401", Lhotch wrote: {foreach from=$breadcrumb item=section} {/foreach} {if $section==""} <!-- // Header // --> <div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/header.gif" width="633" ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 10-11-2006, 12:45 PM   #1
Junior Member
 
Join Date: Oct 2006
Location: Dallas, Texas
Posts: 16
Rep Power: 18
MSeven is on a distinguished road
Default Header Changer v3.0.15 - v3.1.5

In "http://www.68classifieds.com/forums/showthread.php?t=401",
Lhotch wrote:
Quote:
{foreach from=$breadcrumb item=section}
{/foreach}
{if $section==""}
<!-- // Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/header.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
<!-- // Header // -->
{else}
<!-- // Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/{$section}.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
<!-- // Header // -->
{/if}
{assign var=section value=""}
The above, is a modification to change the header, for each category page, in v3.0.15.
And it Worked, up to v3.1.4.

Problem: From v3.1.4, to 3.1.5, the breadcrumb var, in the functions.php file, changed so that this code no longer works.

Question: "How do I modify the code above to work with v3.1.5?"
(note: have tried {$section|strip}.gif, to no avail.)
__________________
M7
v.3.1.5 Developer

Last edited by MSeven; 10-11-2006 at 12:50 PM.
MSeven is offline   Reply With Quote
Old 10-11-2006, 01:39 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,493
Rep Power: 132
Eric Barnes is just really nice Eric Barnes is just really nice
Default

How about changing it to this:
HTML Code:
{if $smarty.get.sec==""}
<!-- // Header // -->
 <div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/header.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
        <!-- // Header // -->
{else}
<!-- // Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/{$section}.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
        <!-- // Header // -->
{/if}
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 10-11-2006, 02:27 PM   #3
Junior Member
 
Join Date: Oct 2006
Location: Dallas, Texas
Posts: 16
Rep Power: 18
MSeven is on a distinguished road
Default

Quote:
Originally Posted by suzkaw
How about changing it to this:
HTML Code:
{if $smarty.get.sec==""}
<!-- // Header // -->
 <div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/header.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
        <!-- // Header // -->
{else}
<!-- // Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/{$section}.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
        <!-- // Header // -->
{/if}
Checking... seems to display the same "header.gif", no matter which page you are viewing. Will need to do some more testing but, just to make sure I'm on the right track, "how should I name the $section.gif, that it would then be calling?" The same as the category name? i.e. "cars.gif"?
__________________
M7
v.3.1.5 Developer
MSeven is offline   Reply With Quote
Old 10-11-2006, 03:19 PM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,338
Rep Power: 132
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

I beleive the problem is somewhere along the line the last peice of the breadcrumb was made into a link where in the past it wasnt. The original code from your post should still work you just need to strip the tags from the final variable, something like this...

PHP Code:
{foreach from=$breadcrumb item=section}
{/foreach}
{if 
$section==""}
<!-- 
// Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/header.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
<!-- 
// Header // -->
{else}
<!-- 
// Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/{$section|strip_tags}.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
<!-- 
// Header // -->
{/if}
{
assign var=section value=""
Notice where the $section variable is used for the name I use the built in smarty function to strip html tags which should leave you with just the name of the category and it should work again.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 10-11-2006, 04:11 PM   #5
Junior Member
 
Join Date: Oct 2006
Location: Dallas, Texas
Posts: 16
Rep Power: 18
MSeven is on a distinguished road
Default

Quote:
Originally Posted by Lhotch
Notice where the $section variable is used for the name I use the built in smarty function to strip html tags which should leave you with just the name of the category and it should work again.
Acknowledge the notice. But nope, it didn't work. Will run some more test, but, just so you'll know exactly what the new "functions.php" file is doing to the $breadcrumb variable; it is changing it from this:
Quote:
(functions.php v3.0.15)

{$breadcrumb}
Array (2)
0 => <a href='category.php?type=34' class=...
1 => Camper_Trailers
to this:

Quote:
(functions.php v3.1.5)

{$breadcrumb}
Array (1)
0 => <a href='category.php?type=34' class=...
Hope that helps. If not, I can send you the the code change to the $breadcrumb var in the functions.php file v3.1.5, along with the $breadcrumb coding from v3.1.4, so that you can compare the two.


Otherwise I guess, I will need to know if the change to the $breadcrumb was for security reasons? or for function reasons? so that I will then know how much further I should persue this. Meaning; "if the $breadcrumb change is not Critical to anything, then I may keep the 3.1.4version, if I knew what I would be losing by not using the 3.1.5version.

(Naturally I would prefer to use the new version, but...)
__________________
M7
v.3.1.5 Developer
MSeven is offline   Reply With Quote
Old 10-11-2006, 04:31 PM   #6
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,493
Rep Power: 132
Eric Barnes is just really nice Eric Barnes is just really nice
Default

This is going from memory but I believe the breadcrumb was changed so it would display the full category path and the last one is clickable where before the last one was just text.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 10-11-2006, 04:41 PM   #7
curmudgeon
 
Join Date: Mar 2006
Posts: 5,338
Rep Power: 132
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 MSeven
Acknowledge the notice. But nope, it didn't work.
Ok, try this.....

PHP Code:
{foreach name=outer item=section from=$breadcrumb}
{foreach 
item=item from=$section}
{
assign var=section value=$item|strip_tags}
{/foreach}
{/foreach}
{if 
$section==""}
<!-- 
// Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/header.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
<!-- 
// Header // -->
{else}
<!-- 
// Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/{$item}.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
<!-- 
// Header // -->
{/if}
{
assign var=item value=""
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 10-11-2006, 06:12 PM   #8
Junior Member
 
Join Date: Oct 2006
Location: Dallas, Texas
Posts: 16
Rep Power: 18
MSeven is on a distinguished road
Default

Quote:
Originally Posted by suzkaw
This is going from memory but I believe the breadcrumb was changed so it would display the full category path and the last one is clickable where before the last one was just text.
Thanks Eric! And it appears that your memory has not failed you. As in deed when I compare old to new, the last one does become clickable. And I figure, this was done so that, if you were viewing a listing, you could return to, or go to, the category in which the listing, is listed. (trying desparately to keep this from becoming confusing)

But again, Thanks for the info as it will help. I Love your script by the way. I find it's structure and design to be "Firefox" quality. (Hoping that means as much to you as it does me.) Par Excellence!!!
__________________
M7
v.3.1.5 Developer
MSeven is offline   Reply With Quote
Old 10-11-2006, 06:29 PM   #9
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,493
Rep Power: 132
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Thanks for the compliments! It does mean a lot.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 10-11-2006, 06:48 PM   #10
Junior Member
 
Join Date: Oct 2006
Location: Dallas, Texas
Posts: 16
Rep Power: 18
MSeven is on a distinguished road
Default

Quote:
Originally Posted by Lhotch
Ok, try this.....

PHP Code:
{foreach name=outer item=section from=$breadcrumb}
{foreach 
item=item from=$section}
{
assign var=section value=$item|strip_tags}
{/foreach}
{/foreach}
{if 
$section==""}
<!-- 
// Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/header.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
<!-- 
// Header // -->
{else}
<!-- 
// Header // -->
<div id="header"><a href="index.php"><img src="templates/{$smarty.const.MAIN_TEMPLATE}/images/{$item}.gif" width="633" height="93" border="0" alt="{$title}" /></a></div>
<!-- 
// Header // -->
{/if}
{
assign var=item value=""

Larry, will take me awhile to integrate and check this out and I didn't want to leave you hanging. The initial test was a dud. But will keep trying, and see if I can find out why. Will let you know ASAP, (probably tomorrow), but as I said, I didn't want to leave you hanging in the meantime.

p.s. Thanks Larry! I knew you would come to the rescue.
And if I may blow some smoke your way, ...I have read many of your post and find your explanations to be clear and concise, detailed yet specific. And you show a willingness to help that makes a person feel as though everything is gonna be ok. Glad your on the 68 team.
__________________
M7
v.3.1.5 Developer
MSeven is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header on Featured Ads lbrown13 Templates, HTML, CSS, and Design Help 10 05-23-2006 05:09 PM
Header V3.0.15 newone Templates, HTML, CSS, and Design Help 17 05-05-2006 10:44 AM


All times are GMT -4. The time now is 01:03 AM.


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