Support Forums

Old 12-18-2007, 01:26 AM   #1
Senior Member
 
SkGold's Avatar
 
Join Date: Mar 2006
Location: Best city in the World � Calgary, Canada
Posts: 468
Rep Power: 24
SkGold has a spectacular aura about
Default Limit # of free ads

Dose anybody tried to limit # of free ads with 3.1?
I am using 3.1.10 and trying to implement the code from this thread
I have only one listing package and also using drill mode.
I put the following code in Case 3 - usercheckout.php below $productid=(int)@$_REQUEST['productid'];
PHP Code:
//begin max free ads
$freeID '1';
if(
$productid==$freeID)
{
$totalAllowedFree '1';

$sSQL sprintf("SELECT oOwnerID FROM ".PREFIX."orders WHERE oOwnerID=%s AND oProductID=%s",
GetSQLValueString($userid"int"),
GetSQLValueString($freeID"int"));
$result=$db->query($sSQL);
$numrows $result->size();

if(
$numrows $totalAllowedFree)
{
    
//They have too many free ads redirect.
    
$location="usercheckout.php";
    
$class_tpl->assign('title',"Failure");
    
$class_tpl->assign('forward',FALSE);
    
$class_tpl->assign('location',$location);
    
$class_tpl->assign('msg'," You have exceeded the max free listings. <a href='".$location."'>Place an Ad</a>");
    
$class_tpl->assign('body','forward.tpl.php');
    
$class_tpl->display('layout.tpl.php');
    exit;
}
//end max free ads redirect
}//end max free ads 
But it doesn’t work. It is redirecting to the next step and allow to post more than one listing.

Any help really appreciated.
__________________
Thanks,
Sergey

Bargain Finder in Calgary, Alberta, Canada.
Calgary Business Directory V3.1.10 Dev - Calgary Classifieds V3.1.10 Dev - Calgary Real Estate V3.1.10 Dev - Calgary Used Cars V3.1.10 Dev - Calgary Rent V3.1.10 Dev - Calgary Dating V3.1.5 Dev

A website without well-done Internet Marketing and Search Engine Optimization is as good as non-existent.

Last edited by SkGold; 12-18-2007 at 10:44 AM.
SkGold is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free listing package number of ads limitation? z0rg v4 Questions & Support 3 02-25-2008 08:30 AM
Limit the number of "New Listing" displays (re-visited) brw9532 v3.1 Modules & Modifications 8 05-12-2007 09:10 PM
Way to limit # of free ads by users? TVAS v3.0 Questions & Support 1 07-07-2006 02:08 PM
Free Trial? Refund/Return policy? Cindy Pre Sales Questions 3 04-24-2006 09:12 PM


All times are GMT -4. The time now is 04:08 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0