phpLD Mods Blog

Automatic Time Stamping for Link Expiration Dates in phpLD

February 27th, 2008 ~ No Comments

In the phpLD directory script you have the ability to add links for defined time periods. They can be set standard in the administration panel as unlimited in which the link is permanent and never expires and also for selectable time periods of 30 days, 90 days, 180 days and 1 year. Upon expiration the links are set as inactive.

With the standard setup of php Link Directory, the expiry date is not automatically set, so the site administrator has to manually add the link expiration date in the admin panel when approving the link submission. This can sometimes be forgotten or possibly done with an improper date.With the following expiry date code directory administrators can now automate the process and have the proper expiration date automatically set for them no matter what their link settings are. For instance if you are setting links for a period of 1 year then all links submitted will be stamped with an expiry date of 365 days. If your settings are for unlimited (permanent) links then there will be no expiration date stamped as the link will never expire.

We have provided basic code and instructions for you below so it will be easy for you to modify your directory for the automatic time stamping of links that will automatically add the expiry date in your phpLD administration panel. In the version 3.2 we have added in a featured year setting to give you an example of how to modify the code for additional custom link types if you have any.Please make sure that you use the proper code for the version of phpLD that you are running. We have provided version 3.2 and then below that we provide the standard code for version 3.3.

Feel free to use this code on any directories that you own. If you find the code useful to your directory then of course we would appreciate a link back to our site: http://phplinkdirectorymods.com or if you like, any donations will be much appreciated and could be sent by PayPal and help with the further releasing of other helpful mods for the php Link Directory script.
For donation information please visit our site and use the donation button on our home page. 

 

Version 3.2 Expiry Date Automatic Time stamping Mod
1.     Open your submit.php file.
2.     Find the following:   
$data['LAST_CHECKED']   = gmdate (’Y-m-d H:i:s’);  
$data['DATE_ADDED']     = gmdate (’Y-m-d H:i:s’);  
$data['DATE_MODIFIED']  = gmdate (’Y-m-d H:i:s’);    
3. Below that - Add the following code below and save:  

/////////BELOW LINES EXPIRY DATE STAMP by: http://phplinkdirectorymods.com 


if (PAY_ENABLE == ‘1′ && FTR_ENABLE == 1 && $_POST['LINK_TYPE'] == ‘featuredyear’)  
{  
$data['EXPIRY_DATE']  = date(”Y-m-d”,time()+31536000); 

elseif (PAY_ENABLE == ‘1′ && PAY_UM == ‘1′) 
{
$data['EXPIRY_DATE']  = date(”Y-m-d”,time()+2592000); 
}
elseif (PAY_ENABLE == ‘1′ && PAY_UM == ‘2′)
{
$data['EXPIRY_DATE']  = date(”Y-m-d H:i:s”,time()+7776000); 
}
elseif (PAY_ENABLE == ‘1′ && PAY_UM == ‘3′)  
{
$data['EXPIRY_DATE']  = date(”Y-m-d”,time()+15552000); 
}
elseif (PAY_ENABLE == ‘1′ && PAY_UM == ‘4′)
{
$data['EXPIRY_DATE']  = date(”Y-m-d”,time()+31536000); 
}
else   $data['EXPIRY_DATE']  = ‘NULL’;  

 

////////////END EXPIRY DATE TIMESTAMP for phpLD v3.2 

 


Version 3.3 Expiry Date Automatic Time stamping Mod
1.     Open your submit.php file.
2.     Find the following:   
$data['LAST_CHECKED']   = gmdate (’Y-m-d H:i:s’);  
$data['DATE_ADDED']     = gmdate (’Y-m-d H:i:s’);  
$data['DATE_MODIFIED']  = gmdate (’Y-m-d H:i:s’);
3.     Below that - Add the following code below and save:  

 

/////////BELOW LINES EXPIRY DATE STAMP by: http://phplinkdirectorymods.com

if (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘featured’ && PAY_UMF == ‘5′)
{
$data['EXPIRY_DATE'] = ‘NULL’;
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘featured’ && PAY_UMF == ‘2′)
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+7776000);
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘featured’ && PAY_UMF == ‘3′)
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+15552000);
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘featured’ && PAY_UMF == ‘4′)
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+31536000);
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘normal’ && PAY_UMN == ‘5′)
{
$data['EXPIRY_DATE'] = ‘NULL’;
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘normal’ && PAY_UMN == ‘2′ )
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+7776000);
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘normal’ && PAY_UMN == ‘3′)
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+15552000);
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘normal’ && PAY_UMN == ‘4′)
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+31536000);
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘reciprocal’ && PAY_UMR == ‘5′)
{
$data['EXPIRY_DATE'] = ‘NULL’;
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘reciprocal’ && PAY_UMR == ‘2′ )
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+7776000);
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘reciprocal’ && PAY_UMR == ‘3′)
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+15552000);
}
elseif (PAY_ENABLE == ‘1′ && $_POST['LINK_TYPE'] == ‘reciprocal’ && PAY_UMR == ‘4′)
{
$data['EXPIRY_DATE'] = date(”Y-m-d”,time()+31536000);
}
else
$data['EXPIRY_DATE'] = ‘NULL’;

//////////END EXPIRY DATE  


Your php Link Directory should now be set to correctly and automatically add the link expiration date if it is suppose to have one.

We release this mod in the hopes that it will be helpful to fellow directory owners and operators of the phpLD directory script.Again if you find this useful and would like to add a link to our website or give a donation it would be appreciated. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blinkbits
  • blogmarks
  • Bumpzee
  • Furl
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb

Tags: phpLD Code Additions ~ phpLD Important Fixes

0 responses so far

  • There are no comments yet...You can be the first by filling out the form below.

You must log in to post a comment.


Right Menu

Todays Photo
DSC00058

DSC00058

 

February 2008
M T W T F S S
« Nov    
 123
45678910
11121314151617
18192021222324
2526272829