Go Back   68 Classifieds Forums > v4 Help & Support > v4 Modules / Modifications

v4 Modules / Modifications Information about modules and script modifications for v4. Questions here are beyond "typical" 68classifieds support and not supported by the 68classifieds team.

 
Thread Tools Display Modes
  #1  
Old 05-27-2008, 03:47 AM
crystal crystal is offline
Member
 
Join Date: Jun 2007
Posts: 40
Rep Power: 4
Thumbs up Mod: Favorites Image Fix

There are two issuses I found with the favorites heart image when viewing a listing. This fixes both.

- When a user adds a listing to their favorites, the text changes from "Add to favorites" to "Delete from favorites" but the heart image does not change. But wait... it is supposed to! The script comes stock with an image to replace the heart ("favorites_delete.gif") but the code does not use it.

- When a user is not logged in, there is no image at all. All other text has an icon, so the "login to save favorites" text is boring and looks like something is missing.

Here is my fix for both problems at once (using the default template):

1. Open templates/default/css/style.css
Find:
Code:
.favorites {
	background: url('../images/favorites.gif') left top no-repeat;
	padding: 0px 0 2px 20px;
	margin-left: 10px;
	height: 16px;
}
Add Under:
Code:
.delfavorites {
	background: url('../images/favorites_delete.gif') left top no-repeat;
	padding: 0px 0 2px 20px;
	margin-left: 10px;
	height: 16px;
}
2. Open templates/default/viewlisting/listingextras.tpl
-OR-
Open listingextras2.tpl if you are using the "short description view" setting (viewlisting2.tpl).

Find :
Code:
	<span class="favorites"><span id="response">
		{if $smarty.session.uid}
			{if $isFavorite==0}
				<a href="javascript:void(0);" onclick="saveFavorite({$smarty.session.uid}, {$view})">{$smarty.const.LANG_ADD_FAVORITES}</a>
			{else}
				<a href="javascript:void(0);" onclick="removeFavorite({$smarty.session.uid}, {$view})">{$smarty.const.LANG_DELETE_FROM_FAVORITES}</a>
			{/if}
		{else}
			<a href="login.php?goto={$goto}">{$smarty.const.LANG_PLEASE_LOGIN_FAVORITES}</a>
		{/if}
Replace with:
Code:
<span id="response">
		{if $smarty.session.uid}
			{if $isFavorite==0}
				<span class="favorites"><a href="javascript:void(0);" onclick="saveFavorite({$smarty.session.uid}, {$view})">{$smarty.const.LANG_ADD_FAVORITES}</a></span>
			{else}
				<span class="delfavorites"><a href="javascript:void(0);" onclick="removeFavorite({$smarty.session.uid}, {$view})">{$smarty.const.LANG_DELETE_FROM_FAVORITES}</a></span>
                                        {/if}
                            {else}
			<span class="favorites"><a href="login.php?goto={$goto}">{$smarty.const.LANG_PLEASE_LOGIN_FAVORITES}</a></span>
		{/if}
3. Make sure the "favorites_delete.gif" image is uploaded in your template /images folder. If you are using the default or purple template it is already there.

NOTE: I changed my LANG_PLEASE_LOGIN_FAVORITES text to "Login to save favorites" before I did this fix. You may need to make that change in the languages/english.php file if the default text is too long to have an icon text to it.

Hope this fix helps! It is minor and aesthetic but it makes a difference. Eric, feel free to add it in.
__________________
Crystal
v4.0.3 Dev

Last edited by crystal; 05-27-2008 at 02:50 PM. Reason: Correction to code
Reply With Quote
  #2  
Old 05-27-2008, 06:58 AM
seymourjames seymourjames is offline
Member
 
Join Date: Mar 2008
Posts: 63
Rep Power: 2
Default small corrrection

Couldnt' make this work unless I did this. An {/if} before the {else} is required.

<span class="delfavorites"><a href="javascript:void(0);" onclick="removeFavorite({$smarty.session.uid}, {$view})">{$smarty.const.LANG_DELETE_FROM_FAVORITE S}</a></span>
{/if}
{else}
Wanted to add that it is a nice little detail to add this. Thanks.

Last edited by seymourjames; 05-27-2008 at 11:59 AM.
Reply With Quote
  #3  
Old 05-27-2008, 01:28 PM
suzkaw suzkaw is offline
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 3,144
Rep Power: 72
Default

This was added to v4.0.3 and thanks for posting the fix.
__________________
Eric Barnes
68 Classifieds Developer
"If a wood chuck could chug beer how much beer could a wood chuck chug?"
Customer Area | Issue Tracker | Knowledge Base | User Manuals | Twittering
Reply With Quote
  #4  
Old 05-27-2008, 02:12 PM
seymourjames seymourjames is offline
Member
 
Join Date: Mar 2008
Posts: 63
Rep Power: 2
Default

Not problem. That now answers my question in your post of 4.03 what are the changes - I was trying to spot the changes in files that affect me where I have made changes - for me always in template (I may wish to use them) and in english.php (not sure you marked it as you usually do in the latter).
Reply With Quote
  #5  
Old 05-27-2008, 02:17 PM
suzkaw suzkaw is offline
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 3,144
Rep Power: 72
Default

The only change in English was the text change crystal added. Nothing major.
__________________
Eric Barnes
68 Classifieds Developer
"If a wood chuck could chug beer how much beer could a wood chuck chug?"
Customer Area | Issue Tracker | Knowledge Base | User Manuals | Twittering

Last edited by suzkaw; 05-27-2008 at 02:20 PM. Reason: Wrong Person. :(
Reply With Quote
  #6  
Old 05-27-2008, 02:59 PM
crystal crystal is offline
Member
 
Join Date: Jun 2007
Posts: 40
Rep Power: 4
Default

Quote:
Originally Posted by seymourjames View Post
Couldnt' make this work unless I did this. An {/if} before the {else} is required.

<span class="delfavorites"><a href="javascript:void(0);" onclick="removeFavorite({$smarty.session.uid}, {$view})">{$smarty.const.LANG_DELETE_FROM_FAVORITE S}</a></span>
{/if}
{else}
Wanted to add that it is a nice little detail to add this. Thanks.
Thanks, I have added that in to the code above. Mine requires the {/if} statement to work also. After I did this to my template, I applied the fix to the default template so I could post it (didn't test). Looks like that slipped through! Thanks for the correction.
__________________
Crystal
v4.0.3 Dev
Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image and Database Problems discguy v4 Questions & Support 7 04-24-2008 01:51 PM
Image upload blank screen problem (not file size related) larry1 v3.1 Questions & Support 1 10-12-2007 04:27 AM
Image upload PROBLEM! midoplaz v3.1 Questions & Support 6 07-30-2007 09:49 AM
Image Browse error CHRD v3.1 Questions & Support 1 02-16-2007 02:28 PM
Question regarding listing image popup sizing civ v3.1 Questions & Support 5 10-12-2006 05:47 AM


All times are GMT -4. The time now is 10:50 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.