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
Prev Previous Post   Next Post Next
  #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
 

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:51 AM.


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