Extensions
Auto-hide of View All Photos panel
When there are no photos of the item being sold, the View All Photos panel on the top right of the
Classified Details Template 1 and Auction Details Template 1 have the following changes:
- Link to hw_geo_utils.js JavaScript file added to bottom of the HTML block.
- ID attribute of hw_allphotos added to top table used for top right photo panel (immediately below PICTURE BOX comment).
- ID attribute of hw_leadpicture added to container for [[LEADPICTURE]] table cell.
The hw_geo_utils JavaScript contains a DHTML function to hide the hw_allphotos table if the hw_leadpicture cell has no innerHTML (ie, doesn’t contain an img tag).
Video
One video of an item to be sold can be referenced by a link to a YouTube URL. (Or any other URL, realistically.) This is added using an Optional Field (Optional Field 10) to store the URL, and then modifying the PHP controlling the display of Optional Field 10 so that it displays as a link.
To make this work, the browse_display_ad.php page was edited in DreamWeaver as follows.
- Line 941 modified to insert an [a] tag with a href of the entered optional field 10, preceded by “http://www.youtube.com/watch?v=”, with a target of “youtube”.
- Line 941 also modified to change the link text to an image of the video, by using the entered optional field 10 in the [img] src, preceded by “http://sjc-static6.sjc.youtube.com/vi/”, and followed by “/2.jpg”.
Further, added an If statement (if ($this->browsing_configuration->USE_OPTIONAL_FIELD_10)) around the display of the YouTube video, so that if a video reference is not included, the YouTube not found panel won’t display.
Help
The following Help idea was abandoned in favour of Context Sensitive Help.
To provide some user assistance, particularly for the video link, a help button was added to appear adjacent to the field name. This was implemented through changes to the PHP page (browse_display_ad.php) used to display the item details, and other file changes, as follows:
A new JavaScript file, hw_ua.js, copied by FTP to the site. This JavaScript file contains the routines to show and hide the user assistance [div].Reference to the hw_ua.js file added to Basic Page Template - 1. The code is [script type=”text/javascript” language=”JavaScript” src=”hw_ua.js” mce_src=”hw_ua.js” /].Added a div (used to hold the user assistance) to the bottom of the Basic Page Template -1 code. The key parts of the code are:
[div id=”hw_ua” style=”visibility:hidden;position:absolute;z-index:1;”][table][tr][td][p id=”hw_uatext”][/p][/td][/tr][/table][/div]
Such Help could be added to many other parts of the site, too. However, this will impact the ease of updating the site to a new set of GeoClass-supplied templates and modules.
Home Page Redirection
When the user logged in using the Sign In tab, the Home Page was presented after success. This should have been the My Account Details page. To fix this, the index.php page was changed as follows.
- Line 1650 was changed to include_once(”classes/user_management_home.php”);
Storing and Retrieving User Name through Cookies
The username entered on the FrontPage and on the Login page is now stored in a cookie, and redisplayed next time the page is displayed. The cookie is set to expire on 16 December 2007.
The changes included:
- Modifying hw_geo_utils.js with two new routines: saveUser() and getCookie().
- A [script src=] line was added to the Login Page template and the Home Page template.
- On the Login Page template, the following load and unload events were added to the body tag:
- {body onload=”document.forms[document.forms.length-1].elements[0].value=get_cookie(’username’);” onunload=”saveUser();”}