Файл: adultscript-2.0.3-pro/files/admin/modules/link/components/config.php
Строк: 68
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_Admin_link_config
{
public function __construct()
{
}
public function render()
{
// $lcfg = array(
// 'order' => 'link_id',
// 'backlink_check' => 1,
// 'pagerank_min' => 0,
// 'cheat_check' => 1,
// 'referer_limit' => 1,
// 'widgets' => array(
// 'left' => 1,
// 'right' => 1,
// 'footer' => 1
// )
// );
$errors = array();
$messages = array();
if (isset($_POST['submit-config'])) {
$filter = VF::factory('filter');
$order = $filter->get('order');
$add_page = (int) trim($_POST['add_page']);
$backlink_check = (int) trim($_POST['backlink_check']);
$pagerank_min = (int) trim($_POST['pagerank_min']);
$cheat_check = (int) trim($_POST['cheat_check']);
$referer_limit = (int) trim($_POST['referer_limit']);
$frontpage = (int) trim($_POST['frontpage']);
$cron_check = (int) trim($_POST['cron_check']);
$ncfg = array(
'order' => $order,
'add_page' => $add_page,
'backlink_check' => $backlink_check,
'pagerank_min' => $pagerank_min,
'cheat_check' => $cheat_check,
'referer_limit' => $referer_limit,
'cron_check' => $cron_check,
'frontpage' => $frontpage
);
$db = VF::factory('database');
$db->query("UPDATE #__module
SET config = '".$db->escape(serialize($ncfg))."',
config_cache = '".$db->escape(serialize($ncfg))."'
WHERE name = 'link'
LIMIT 1");
VF::cache_set('link', $ncfg, 'module');
$messages[] = 'Link module configuration updated!';
}
$lcfg = VF::cfg('module.link', TRUE, TRUE);
$tpl = VF::factory('template');
$tpl->menu = 'link';
$tpl->submenu = 'link_config';
$tpl->meta_title = 'Admin::Link::Config';
$tpl->errors = $errors;
$tpl->messages = $messages;
$tpl->lcfg = $lcfg;
$tpl->load(array('header', 'link_config', 'footer'));
$tpl->display();
}
}