phplemon

AdQuick 2.7 - Ad Network & Ad Server Software

$69
+ Get BlogQuick Free

AdQuick allows you to run your own ad network similar to websites such as adengage.com and buysellads.com

AdQuick will allow you to bring together advertisers and publishers, and you the script owner will take a cut from every ad sold through your very own advertising network.

AdQuick can also be used as a stand alone Ad Server for your own advertising needs.


 

How To Only Allow Logged In Users To View Your New Pages.

 

If you have created a new page on your AdQuick website, using the AdQuick template system, as explained on this guide, www.phplemon.com/create-new-page.php - You will know that the new page is visible to anyone using your website.

It is possible to only allow logged in users to view these new pages with a simple line of code.

If you followed the guide at www.phplemon.com/create-new-page.php, you will know that the blank template for the new .php file looks like this,

 

<?php
include ("include/config.php");

$smarty->assign('right_panel', 'off');

//// ******* just change the name 'blank.tpl' as you need
$content = $smarty->fetch('blank.tpl');
//// ********************

$smarty->assign('content',$content);
$smarty->display('master_page.tpl');
?>

 

All you need to do is add this line of code,

if(!isset($_SESSION[uid])) { header("location: account.php"); exit(); }

So your new .php page should look like,

 

<?php
include ("include/config.php");
if(!isset($_SESSION[uid])) { header("location: account.php"); exit(); }

$smarty->assign('right_panel', 'off');

//// ******* just change the name 'blank.tpl' as you need
$content = $smarty->fetch('blank.tpl');
//// ********************

$smarty->assign('content',$content);
$smarty->display('master_page.tpl');
?>