<?php
/**
 * @version $Id: post.php v2.0 $
 * @package PBDigg
 * @copyright Copyright (C) 2007 - 2008 PBDigg.com. All Rights Reserved.
 * @license PBDigg is free software and use is subject to license terms
 */

define('PB_CSCRIPT', 'post');
require_once('include/common.inc.php');
require_once(PBDIGG_ROOT.'include/validate.func.php');

$OPTIONS = $post = '';

if (!$allowpost || (!$pb_ifpost && $customer['adminid'] != '1'))
{
	$jumpurl = ($customer['groupid'] == '6') ? 'member.php' : 'login.php?forward=post.php';
	redirect($u_message['post_nopermission'], $jumpurl);
}

if ($pb_reposttime)
{
	$pb_lastpost = (int)gCookie('pb_lastpost');
	if ($pb_lastpost && (($timestamp - $pb_lastpost) < $pb_reposttime))
	{
		showMsg($u_message['post_flood_limit']);
	}
}
require_once(loadLang('option'));

header('Cache-control: private, must-revalidate');

if (!$action)
{
	require_once(PBDIGG_ROOT.'include/postnew.inc.php');
}
elseif ($action == 'edit')
{
	require_once(PBDIGG_ROOT.'include/postedit.inc.php');
}

?>
