Monthly Archives: September 2009

Archive

Changing HEADER_IMAGE_WIDTH and HEADER_IMAGE_HEIGHT in worpress 3.3 header

I see <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> in my themename/header.php file. How do i changed HEADER_IMAGE_WIDTH and/or HEADER_IMAGE_HEIGHT?? Continue reading

Category: WordPress

How to remove html { margin-top: 28px !important; } from wordpress header

To remove html { margin-top: 28px !important; } from wordpress header go to /wp-includes/admin-bar.php and edit around line 672 (in WordPress 3.3)

Alternatly you can add a remove_action filter in you active theme/functions.php file like this, as this is a part of _admin_bar_bump_cb function which is defined in above mentioned file: Continue reading

“Warning: session_start() [function.session-start]: open(/tmp…”, a possible fix for oscommerce

For the following warning in oscommerce installation:

Warning: session_start() [function.session-start]: open(/tmp\sess_5616cfa91211a8ef5ee94d09d21f7eb5, O_RDWR) failed: No such file or directory (2) in C:\wamp\www\catalog\includes\functions\sessions.php on line 67

As a solution they will suggest you to create a tmp folder in your root folder.. Continue reading

Conditional order by sorting using two fields in MySQL

Here’s the scenario.

I have two fields in my “listings” table with help of which i wanted to sort (order by) results. First field is “activation_date”. It is the activation date of a listing. Second one is “featured” which stores featured tag for a listing in a value of 1 or 0. Continue reading

How to check radio button on page load with jQuery

For example you have a set of radio buttons created dynamically with some web language like PHP and you expected one of them selected or checked on most of the times. If, none of them was checked somehow, you would want jQuery to get one of checked on page load. Here’s the quick solution to this condition. Continue reading

Creating a new php functionality page in iLister, the business classifieds system

Here’s the step by step guide to create a new functionality page in iLister.

Let’s say we wanted to create a new small enquiry form at the http://www.yoursite.com/contact_us. For this to make happen we will create a new ContactUs handler to process the form values and will place it under miscellaneous. Following are the steps required. Continue reading

Category: PHP

To check in a smarty template if it was the last page of the page results

Here’s a method to check in a smarty template if it was the last page of page results.

{if $listings.current_page gte ($listings.total / $results_per_page)|ceil}
    True
{else}
    False
{/if}

where $listings.current_page is the current page user is on, $listings.total is the number of totals results and $results_per_page is the number of listings or rows that are displayed on each page. “gte” is >= operator and |ceil as the mathematical modifier which returns next lowest integer.