Support Forums

Mod: Favorites Image Fix

This is a discussion on Mod: Favorites Image Fix within the Modules / Plugins / Modifications forums, part of the Developer Forums category; There are two issuses I found with the favorites heart image when viewing a listing. This fixes both. - When ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 05-27-2008, 04:47 AM   #1
Senior Member
 
Join Date: Jun 2007
Posts: 110
Rep Power: 13
crystal is on a distinguished road
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.8 Dev

Last edited by crystal; 05-27-2008 at 03:50 PM. Reason: Correction to code
crystal is offline   Reply With Quote
Old 05-27-2008, 07:58 AM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,233
Rep Power: 53
seymourjames has a spectacular aura about
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 12:59 PM.
seymourjames is offline   Reply With Quote
Old 05-27-2008, 02:28 PM   #3
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,315
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

This was added to v4.0.3 and thanks for posting the fix.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 05-27-2008, 03:12 PM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,233
Rep Power: 53
seymourjames has a spectacular aura about
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).
seymourjames is offline   Reply With Quote
Old 05-27-2008, 03:17 PM   #5
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,315
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

The only change in English was the text change crystal added. Nothing major.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules

Last edited by Eric Barnes; 05-27-2008 at 03:20 PM. Reason: Wrong Person. :(
Eric Barnes is offline   Reply With Quote
Old 05-27-2008, 03:59 PM   #6
Senior Member
 
Join Date: Jun 2007
Posts: 110
Rep Power: 13
crystal is on a distinguished road
Default

Quote:
Originally Posted by seymourjames
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.8 Dev
crystal is offline   Reply With Quote
Reply

Thread Tools
Display Modes


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


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


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