Skip to main content

Posts

Showing posts from May, 2012

How to add labels on top of blogger posts

How to add labels or tags on top of blogger posts


To add label on top of Your blogger posts do the following steps:

Step1: Click on the edit template option

Step2: Go to edit HTML and check the expand widget option

Step3: find for the following code in the template source code

<b:include data='post' name='post'/>

Step4: copy and paste the following code snippet just above the above mentioned code



<!--tag code start-->
<font style='background:transparent url(http://3.bp.blogspot.com/_rKG-ziTSNUQ/TLeraxpOcoI/AAAAAAAABww/yVGb8J9bvJI/s1600/icon_tags.png) no-repeat scroll top left;padding-left:25px;font-size:14px;font-weight:bold'> <b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'><a expr:href='data:label.url + "?max-results=8"' rel='tag'><data:label.name/></a><!--<b:if cond='data:label.isLast != "true"'>|</b:if&g…

Php script for Listing files based on last modified time

Php script for Listing files based on last modified time

Here is the php script to list the files in a folder based on the modified date

Using the below script you can list files from older to latest or latest to oldest

<?php
// list from a given folder $folder="test/"; $files = glob( $folder."*.*" ); // to avoid hidden files
// Sort files by modified time, latest to oldest
array_multisort(array_map( 'filemtime', $files ),SORT_NUMERIC,SORT_DESC,$files);
// Use SORT_ASC in place of SORT_DESC for oldest to latest //array_multisort(array_map( 'filemtime', $files ),SORT_NUMERIC,SORT_ASC,$files);
// display the file names if(count($files)){
for( $i=0 ; $i < count($files) ; $i++ ){
echo(basename($files[$i])."   <a href='".$folder.$files[$i]."'>Link to the file</a><br>");
}
}
?>

Simple Slider show using Javascript - JS Slide show script

Simple Slider show using Javascript

The following script will populate the slider container control with the contents in the slider content js array in regular interval of time. Here You can pause the slider on mouse over and later resume the slider on mouseout events.

Sample Javascript code is given below:

Save the following script as  slider.js

//--------- CODE STARTS -------

var mbSlider=new Array();

arrSlide[0]= 'HTML Content in Slide1';

arrSlide[1]= 'HTML Content in Slide2';



var slide_count=arrSlide.length;
var slide_ind=0;
var slide_speed=5000;
var slide_int;

//function to fill slide content to the slider ctrl
function displaySlide( ){

 if( slide_ind == slide_count || slide_ind < 0 )
  slide_ind=0;

document.getElementById('slide_contents').innerHTML=arrSlide[slide_ind];
slide_ind ++;

}

//function to pause slide show
function pauseSlide(){
clearInterval(slide_int);
}

//function to continue slide show
function runSlide(){
slide_int = setInterval("displaySlide()", sli…

How to access favicon from a remote server with out hot linking?

Showing favicon from a remote server on Your website with out hot linking

As you know Hot linking is a crime of stealing bandwidth of one's server. Knowingly or unknowingly people may be doing this with out the knowledge that ,it is a CRIME. Site owner of the website from where you have linked an image is actually paying for displaying THEIR image on YOUR website as this process consumes a significant amount of bandwidth. To learn more about what is Bandwidth Stealing / Direct linking / Hot linking, please CLICK HERE.

With out directly linking a favicon of another site, you can you the google indexed images. To access the favicon of a particular website, you can view it by taking the below given link. Replace "REQUIRED_DOMAIN" with a valid domain name
http://www.google.com/s2/favicons?domain=REQUIRED_DOMAIN

How it works:

Example: http://www.google.com/s2/favicons?domain=example.com

In the HTML code place the below given tag to detch the favicon of naother site.
<link hr…

How to check remote file or image exists

Php scripts to check remote file exists.

Check files in same server

To check a file in the same server use file_exists(), this doesn't support remote files
file_exists — Checks whether a file or directory exists
example :

<?php if( file_exists("lib/class.php") ) echo "file present"; else echo "file not found "; ?>

The limitation of file_exists() is , it doesn't support remote files. To check for remote file you can use any of the following:

#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|


Check Remote Image

If you are checking for an image, You can use function getimagesize()

Unlike file_exists, this built-in function supports remote files. It will return an array that contains the image information (width, height, type..etc). So check the returned array to confirm the presense of image

<?php $arrImg = getimagesize("http://www.remoteserver.com/img.jpg"); if($arrImg[0]) { echo "Image information "; print_r($arrImg); } e…

How to access object values in Joomla session variable

How to access object values in Joomla session variable - $_SESSION['__default']

QUERY : in Joomla + i just echo 'ed the following
echo "
ses:
";print_r($_SESSION['__default']);echo "";

it outputed like this
:


Array
(
    [session.counter] => 34
    [session.timer.start] => 1336983808
    [session.timer.last] => 1336986596
    [session.timer.now] => 1336987030
    [session.client.browser] => Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0
    [registry] => JRegistry Object
        (
            [data:protected] => stdClass Object
                (
                    [com_users] => stdClass Object
                        (
                            [registration] => stdClass Object
                                (
                                    [data] => Array
                                        (
                                            [name] => Jack
                              …

Forced session time out in php - How to implement?

Forced session time out.

If you want to make sure that if a logged in user who is inactive on a web page for more than a specified time is forced to logout;

Here is the script to check for user inactivity and forced log out




session_start();

// set timeout period in 1200 seconds (20 minutes)
$inactive = 1200;

// check to see if $_SESSION['timeout'] is set
if(isset($_SESSION['timeout']) ) {
    $session_life = time() - $_SESSION['timeout'];
    if($session_life > $inactive)
        { session_destroy(); header("Location: logout.php"); }
}
$_SESSION['timeout'] = time();

// your page content comes here

?>


Try this and put your suggestions

Read How to increase php session expiry time

HOW TO INCREASE THE SESSION EXPIRY TIME IN PHP

HOW TO INCREASE THE SESSION EXPIRY TIME IN PHP

OPTIONS: (1) Editing the php.ini (2)Alter the session maximun life time through php script using ini_set()


Editing the PHP configuration file php.ini:

In order to change the session timeout, the change needs to be made in the PHP configuration file php.ini. In some distributions, this file is stored in /etc/php.ini. In Ubuntu and some other distributions, this file is stored in /etc/php5/apache2/php.ini. This setting is controlled by session.gc_maxlifetime. What this setting does is to control the session cleanup. After making any changes to this setting in the php.ini, make sure you restart apache to ensure that the version of PHP being used by Apache is updated with your configuration changes.




Editing the PHP configuration file steeing via php script

To find out what the default (file-based-sessions) session timeout value on the server is you can view it through a ini_get command:



    // Get the current Session Timeout Value
    $curren…

Earn Online through ZURKER - The Online Revenue Sharing Website

In 2007, The Winklevoss twins, the former classmates and business partners of Facebook founder Mark Zuckerberg, have decided to end their legal battle over whether the idea for the social networking site was stolen from them. They accepted a US supreme court 2008 settlement which gave them a mixture of $20m cash and Facebook stock which at the time was worth around $45m. So all together a $65m...according to 2008 money value. [Source : Guardian.co.uk]

ZURKER - The Online Revenue Sharing Project

In 2009 The Winklevoss twins Cameron Winklevoss and Tyler Winklevoss started a new project(ZURKER) and launched the beta version in dec 2011........

One can join it now and become a share holder of this website.

This rocking feature of share is added by them...

Currently there are thousands of member joining this web site in uk alone per day..

Totally free , new features than facebook and g+.....

....Join today and become share holder now from india .... dont use different country ip to join.…

Careerjet affiliate / partners Program - Best Tips for Affiliate marketing

If you have website or blogs related to Jobs, career etc , you can Earn online from Careerjet affiliate / partners Program. Use Careerjet publisher programme to embed on your website a JobBox, a SearchBox, a Search Form, RSS feed, text links, banners, logos or other features related to Careerjet.

Each time a visitor directed from your site clicks on a payable link on Careerjet, you receive a commission. You can customise everything from how the link looks on your website to what kind of jobs you feature, targeting the links to your users' interests.



Careerjet is a search engine that maps an extensive selection of job offerings by listing worldwide job vacancies in one database. You can use their widget to drive traffic to the original job listing website (company websites, recruitment agencies, newspapers, etc.) and earn revenue based on a pay per click principle and an auction system.

CJ is looking for web partners to join their Careerjet publisher programme.

How to become a Career…


Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog