Archive for the ‘Tips & Tricks’ Category
How To - Add a ThickBox Photo Gallery
We get a lot of users who want to add JavaScript image galleys to the viewlisting template file and in this post I will step out how to add ThickBox from http://jquery.com/demo/thickbox/.
Read more…
RSS Management with FeedBurner
In a previous blog article we wrote about how to Use RSS to stay in contact. This is a great way of getting return visitors to your site. One big drawback with RSS is it is hard to track how many subscribers and how often the feed is actually used.
A great service now owned by Google is FeedBurner. With FeedBurner you can enter your rss feed and it will create a new link that allows you to advertise. When people signup for this feed it gives you feed tracking, statistics, and more ways for visitors to subscribe.
You can also burn different feeds so you can have a main feed, certain categories, or any other option you can imagine.
Stepping into Smarty - Conditionals
Smarty Templates include a whole host of features and in the post I will go over some Smarty conditional statements. Conditionals are basically a way for you to selectively show certain things based on some value.
Lets say for instance that you only want to display advertising to people visiting your site that are not logged in. This way it would give people that take the extra time to register an incentive. So if we write this out it would look something like this: “If you are a guest then show ads”.
To convert this to a Smarty conditional then we could do this:
{if $smarty.session.userlevel == 5} put your ad code {/if}
What this does is check the users session and if the userlevel is 5 (which by default is the guest user group) then show your add code.
Now that we have the basics lets get into a more complex conditional statement. For this one lets say: “If you are logged in then display a greeting. If not then display a generic welcome message”.
This would be written as:
{if $smarty.session.username<>'' || $smarty.cookies.username<>""}
Welcome {$smarty.session.username}
{else}
Welcome to our site. Why not join?
{/if}
The first part says if they are logged in and the username is not blank then display “Welcome Name”. Next if that condition does not run then display the else. “Welcome to our site….”.
I hope this helps you better understand Smarty conditional statements.
References
Administration Refferer Check
Inside the administration of v4 we added a new check to prevent people from making post requests to your administration unless it comes from your domain name. This check was added as a security feature to prevent trying to bypass any forms. Although this was added for safety you can by pass it by adding this to the connections/classifieds.php file:
define('NO_REFERRER_CHECK', TRUE);
Best practices when moving your site
Have you ever wanted to move your site to a new domain or to a new hosting provider? If so or if you plan to in the future then I recommend visiting this Google Blog Post that is a best practices guide to moving your site.
Using Keyboard Shortcuts In Administration
One new feature added to the administration in 68 Classifieds v4 was access keys for navigation. Here is a list of the access keys currently available:
An access key or accesskey allows a computer user to immediately jump to a specific part of a web page via the keyboard.
- Alt + D - Dashboard
- Alt + H - Home
- Alt + F - Support Forums
- Alt + L - Listings
- Alt + O - Orders
- Alt + U - Users
- Alt + C - Categories
- Alt + P - Payment
- Alt + S - Settings
- Alt + M - Modules
From Wikipedia
In most web browsers, the user does this by pressing Alt (on PC) or Ctrl (on Mac) simultaneously with the appropriate character on the keyboard. In Opera, the user presses ⇧ Shift+Esc followed by the access key (without Alt). In Mozilla Firefox 2.0 the access key keyboard combination has changed to Alt + ⇧ Shift (still configurable via about:config), while in Amaya, the preferences allow the user the option of choosing Ctrl or Alt. In Konqueror on Linux, The Ctrl key is pressed and released, and then the access key is pressed.
Whilst Mozilla and Firefox will execute the corresponding links immediately on the press of the access key, IE will just focus on the link and require ↵ Enter to be pressed in order to activate the link. If multiple identical access keys are assigned within the same document, IE will tab through them on each keypress (IE will tab backwards if ⇧ Shift will be pressed as well). This way, links can be logically grouped in various access key rings for easier navigation. IE 4.0 did only support letters of the English alphabet as accesskeys. Firefox 2.0 will activate the last of a group of links assigned the same accesskey.









