Go Back   PHP Link Directory Forum > PHP Link Directory (phpLD) > Mods and contribution Discussion > Mods (Free)

Mods (Free) Free Mods for PhpLD.

Closed Thread
 
topic widgets
Old 04-22-2008   #1
msolution
Supporter
 
msolution's Avatar
 
Join Date: Jun 2007
Posts: 140
Default [MOD]Limit the number of Free (nofollow) Submissions/ day/ Month - Dir.vc (msolution)

Mod Title: Limit the number of Free (nofollow) Submissions/ day

Last Updated: 2007-09-24

Supported by Mod Developer: Yes

Where to Download: http://www.dir.vc/free-phpld-mods/

Support Via This Thread or Download Site: This Thread

Compatible With: phpLD 2.1.2, phpLD 3.x



This Mod allows you to Limit the number of Free (nofollow) Submissions in a day! Putting tab on the Pending Queue!
__________________
Congratulations to the Winner Linkernel.com
.
of the Dir.vc: Web Directory Competition
msolution is offline  
Old 04-26-2008   #2
itsagaz
Supporter
 
Join Date: Mar 2008
Posts: 21
Default

Hi,
This is just what I have been looking for.
I have just downloaded this and you say it is tested on v3.2 but will it also function on v3.3.x ? I would like to know before I start to implement this.
Thanks
www.directorysnap.com
itsagaz is offline  
Old 05-10-2008   #3
diehard
 
diehard's Avatar
 
Join Date: May 2008
Location: California
Posts: 21
Default

Hello, How do I edit the code to allow 50 Free links per day? Ive tried playing with it, to no avail. ANy help is great.


require_once 'init.php';

$free_submit_date = date("Y-m-d", time());
$free_submit_date2 = date("Y-m-d", mktime(0,0,0,date("m"), date("d")+1, date("Y")));

$disable_free = '';
$disable_free_text = '';
$monthly_limit_reached = false;



$limit_what = " `NOFOLLOW` = '1' ";

//install the mod if not installed//
// ---------------------------------
if(!defined ('_FREE_SUBMISSIONS_DATE'))
$rs = $db->Execute("INSERT INTO `{$tables['config']['name']}` SET `ID`='_FREE_SUBMISSIONS_DATE', `VALUE`='".$free_submit_date."'");

if(!defined ('_FREE_SUBMISSIONS_LIMIT'))
$rs = $db->Execute("INSERT INTO `{$tables['config']['name']}` SET `ID`='_FREE_SUBMISSIONS_LIMIT', `VALUE`='5'");

if(!defined ('_FREE_SUBMISSIONS_MONTH_LIMIT'))
$rs = $db->Execute("INSERT INTO `{$tables['config']['name']}` SET `ID`='_FREE_SUBMISSIONS_MONTH_LIMIT', `VALUE`='99'");
// ---------------------------------


// if it is not disabled//
if (defined ('_FREE_SUBMISSIONS_MONTH_LIMIT') && _FREE_SUBMISSIONS_MONTH_LIMIT != 0){
// free submissions this month//
$this_month_start = date("Y-m-d", mktime(0,0,0,date("m"), 1, date("Y")));
$this_month_end = date("Y-m-d", mktime(0,0,0,date("m")+1, 1, date("Y")));
$this_month_where = " `DATE_ADDED` between '".$this_month_start."' and '".$this_month_end."' ";
$FREE_SUBMISSIONS_MONTH = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE ".$this_month_where." AND {$limit_what}");

if($FREE_SUBMISSIONS_MONTH > _FREE_SUBMISSIONS_MONTH_LIMIT ){

// disable the radio button as limit has been reached//
$disable_free = ' disabled="disabled" ';
$disable_free_text = '<br /><font size="1">Free listings are restricted to '._FREE_SUBMISSIONS_MONTH_LIMIT.' per <b>month</b>,<br /><b>Feel free to choose other types of listings, or check back tomorrow! </b></font>';
$monthly_limit_reached = true;
}
}

//free submissions today!//
// if it is not disabled, and monthly limit has not been reached! //
if ( defined ('_FREE_SUBMISSIONS_LIMIT') && _FREE_SUBMISSIONS_LIMIT != 0 && !$monthly_limit_reached ) {

if( $free_submit_date == strtotime(_FREE_SUBMISSIONS_DATE) ) {

// its a new day, update the date//
$db->Execute("UPDATE `{$tables['config']['name']}` SET `VALUE` = '".$free_submit_date2."' WHERE `ID` = '_FREE_SUBMISSIONS_DATE'");

} else {

// free submissions today//
$FREE_SUBMISSIONS_TODAY = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE AND {$limit_what}");
if($FREE_SUBMISSIONS_TODAY >= _FREE_SUBMISSIONS_LIMIT ){

// disable the radio button as limit has been reached//
$disable_free = ' disabled="disabled" ';
$disable_free_text = '<br /><font size="1">Free listings are restricted to '._FREE_SUBMISSIONS_LIMIT.' per day<br /><b>Feel free to choose other types of listings, or check back tomorrow! </b></font>';
}
}
}
$tpl->assign('disable_free', $disable_free);
$tpl->assign('disable_free_text', $disable_free_text);
diehard is offline  
Old 05-11-2008   #4
msolution
Supporter
 
msolution's Avatar
 
Join Date: Jun 2007
Posts: 140
Default

that would be in the admin panel, please goto settings
__________________
Congratulations to the Winner Linkernel.com
.
of the Dir.vc: Web Directory Competition
msolution is offline  
Closed Thread

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
topic widgets



All times are GMT +1. The time now is 05:35 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.