本文整理汇总了PHP中nv_del_moduleCache函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_del_moduleCache函数的具体用法?PHP nv_del_moduleCache怎么用?PHP nv_del_moduleCache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nv_del_moduleCache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nv_set_layout_site
function nv_set_layout_site()
{
global $db, $global_config;
$array_layout_func_data = array();
$fnsql = "SELECT `func_id`, `layout`, `theme` FROM `" . NV_PREFIXLANG . "_modthemes`";
$fnresult = $db->sql_query($fnsql);
while (list($func_id, $layout, $theme) = $db->sql_fetchrow($fnresult)) {
$array_layout_func_data[$theme][$func_id] = $layout;
}
$func_id_mods = array();
$sql = "SELECT `func_id`, `in_module` FROM `" . NV_MODFUNCS_TABLE . "` WHERE `show_func`='1' ORDER BY `in_module` ASC, `subweight` ASC";
$result = $db->sql_query($sql);
while (list($func_id, $in_module) = $db->sql_fetchrow($result)) {
$func_id_mods[$in_module][] = $func_id;
}
$sql = "SELECT title, theme FROM `" . NV_MODULES_TABLE . "` ORDER BY `weight` ASC";
$result = $db->sql_query($sql);
$is_delCache = false;
while (list($title, $theme) = $db->sql_fetchrow($result)) {
if (isset($func_id_mods[$title])) {
if (empty($theme)) {
$theme = $global_config['site_theme'];
}
foreach ($func_id_mods[$title] as $func_id) {
$layout = isset($array_layout_func_data[$theme][$func_id]) ? $array_layout_func_data[$theme][$func_id] : $array_layout_func_data[$theme][0];
$db->sql_query("UPDATE `" . NV_MODFUNCS_TABLE . "` SET `layout`=" . $db->dbescape($layout) . " WHERE `func_id`=" . $func_id . "");
$is_delCache = true;
}
}
}
if ($is_delCache) {
nv_del_moduleCache('modules');
}
}
示例2: nv_del_cat
/**
* nv_del_cat()
*
* @param mixed $catid
* @return
*/
function nv_del_cat($catid)
{
global $db, $module_name, $module_data, $admin_info;
$sql = 'SELECT parentid, title FROM ' . NV_PREFIXLANG . '_' . $module_data . '_categories WHERE id=' . $catid;
list($p, $title) = $db->query($sql)->fetch(3);
$sql = 'SELECT id, fileupload, fileimage FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE catid=' . $catid;
$result = $db->query($sql);
$ids = array();
while (list($id, $fileupload, $fileimage) = $result->fetch(3)) {
$ids[] = $id;
}
if (!empty($ids)) {
$ids = implode(',', $ids);
$sql = 'DELETE FROM ' . NV_PREFIXLANG . '_comment WHERE module=' . $db->quote($module_name) . ' AND id IN (' . $ids . ')';
$db->query($sql);
$sql = 'DELETE FROM ' . NV_PREFIXLANG . '_' . $module_data . '_report WHERE fid IN (' . $ids . ')';
$db->query($sql);
}
$sql = 'DELETE FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE catid=' . $catid;
$db->query($sql);
$sql = 'SELECT id FROM ' . NV_PREFIXLANG . '_' . $module_data . '_categories WHERE parentid=' . $catid;
$result = $db->query($sql);
while (list($id) = $result->fetch(3)) {
nv_del_cat($id);
}
$sql = 'DELETE FROM ' . NV_PREFIXLANG . '_' . $module_data . '_categories WHERE id=' . $catid;
$db->query($sql);
nv_del_moduleCache($module_name);
nv_insert_logs(NV_LANG_DATA, $module_data, 'Delete Category', $title, $admin_info['userid']);
}
示例3: nv_fix_subweight
function nv_fix_subweight($mod)
{
global $db;
$sql = "SELECT `func_id` FROM `" . NV_MODFUNCS_TABLE . "` WHERE `in_module`=" . $db->dbescape($mod) . " AND `show_func`='1' ORDER BY `subweight` ASC";
$result = $db->sql_query($sql);
$subweight = 0;
while ($row = $db->sql_fetchrow($result)) {
$subweight++;
$sql = "UPDATE `" . NV_MODFUNCS_TABLE . "` SET `subweight`=" . $subweight . " WHERE `func_id`=" . $row['func_id'];
$db->sql_query($sql);
nv_del_moduleCache('modules');
}
}
示例4: nv_set_status_module
/**
* nv_set_status_module()
*
* @return
*/
function nv_set_status_module()
{
global $db, $module_name, $module_data, $global_config;
$check_run_cronjobs = NV_ROOTDIR . '/' . NV_LOGS_DIR . '/data_logs/cronjobs_' . md5($module_data . 'nv_set_status_module' . $global_config['sitekey']) . '.txt';
$p = NV_CURRENTTIME - 300;
if (file_exists($check_run_cronjobs) and @filemtime($check_run_cronjobs) > $p) {
return;
}
file_put_contents($check_run_cronjobs, '');
//status_0 = "Cho duyet";
//status_1 = "Xuat ban";
//status_2 = "Hen gio dang";
//status_3= "Het han";
// Dang cai bai cho kich hoat theo thoi gian
$query = $db->query('SELECT id, listcatid FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows WHERE status=2 AND publtime < ' . NV_CURRENTTIME . ' ORDER BY publtime ASC');
while (list($id, $listcatid) = $query->fetch(3)) {
$array_catid = explode(',', $listcatid);
foreach ($array_catid as $catid_i) {
$catid_i = intval($catid_i);
if ($catid_i > 0) {
$db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_' . $catid_i . ' SET status=1 WHERE id=' . $id);
}
}
$db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_rows SET status=1 WHERE id=' . $id);
}
// Ngung hieu luc cac bai da het han
$query = $db->query('SELECT id, listcatid, archive FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows WHERE status=1 AND exptime > 0 AND exptime <= ' . NV_CURRENTTIME . ' ORDER BY exptime ASC');
while (list($id, $listcatid, $archive) = $query->fetch(3)) {
if (intval($archive) == 0) {
nv_del_content_module($id);
} else {
nv_archive_content_module($id, $listcatid);
}
}
// Tim kiem thoi gian chay lan ke tiep
$time_publtime = $db->query('SELECT min(publtime) FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows WHERE status=2 AND publtime > ' . NV_CURRENTTIME)->fetchColumn();
$time_exptime = $db->query('SELECT min(exptime) FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows WHERE status=1 AND exptime > ' . NV_CURRENTTIME)->fetchColumn();
$timecheckstatus = min($time_publtime, $time_exptime);
if (!$timecheckstatus) {
$timecheckstatus = max($time_publtime, $time_exptime);
}
$sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = '" . NV_LANG_DATA . "' AND module = :module_name AND config_name = 'timecheckstatus'");
$sth->bindValue(':module_name', $module_name, PDO::PARAM_STR);
$sth->bindValue(':config_value', intval($timecheckstatus), PDO::PARAM_STR);
$sth->execute();
nv_del_moduleCache('settings');
nv_del_moduleCache($module_name);
unlink($check_run_cronjobs);
clearstatcache();
}
示例5: nv_set_status_module
/**
* nv_set_status_module()
*
* @return
*/
function nv_set_status_module()
{
global $db, $module_name, $module_data, $global_config;
$check_run_cronjobs = NV_ROOTDIR . '/' . NV_LOGS_DIR . '/data_logs/cronjobs_' . md5($module_data . 'nv_set_status_module' . $global_config['sitekey']) . '.txt';
$p = NV_CURRENTTIME - 300;
if (file_exists($check_run_cronjobs) and @filemtime($check_run_cronjobs) > $p) {
return;
}
file_put_contents($check_run_cronjobs, '');
//status_0 = "Cho duyet";
//status_1 = "Xuat ban";
//status_2 = "Hen gio dang";
//status_3= "Het han";
// Dang cai bai cho kich hoat theo thoi gian
$query = $db->sql_query("SELECT `id`, `listcatid` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `status`=2 AND `publtime` < " . NV_CURRENTTIME . " ORDER BY `publtime` ASC");
while (list($id, $listcatid) = $db->sql_fetchrow($query)) {
$array_catid = explode(",", $listcatid);
foreach ($array_catid as $catid_i) {
$catid_i = intval($catid_i);
if ($catid_i > 0) {
$db->sql_query("UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_" . $catid_i . "` SET `status`='1' WHERE `id`=" . $id . "");
}
}
$db->sql_query("UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_rows` SET `status`='1' WHERE `id`=" . $id . "");
}
// Ngung hieu luc cac bai da het han
$query = $db->sql_query("SELECT `id`, `listcatid`, `archive` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `status`=1 AND `exptime` > 0 AND `exptime` <= " . NV_CURRENTTIME . " ORDER BY `exptime` ASC");
while (list($id, $listcatid, $archive) = $db->sql_fetchrow($query)) {
if (intval($archive) == 0) {
nv_del_content_module($id);
} else {
nv_archive_content_module($id, $listcatid);
}
}
// Tim kiem thoi gian chay lan ke tiep
list($time_publtime) = $db->sql_fetchrow($db->sql_query("SELECT min(publtime) FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `status`=2 AND `publtime` > " . NV_CURRENTTIME));
list($time_exptime) = $db->sql_fetchrow($db->sql_query("SELECT min(exptime) FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `status`=1 AND `exptime` > " . NV_CURRENTTIME));
$timecheckstatus = min($time_publtime, $time_exptime);
if (!$timecheckstatus) {
$timecheckstatus = max($time_publtime, $time_exptime);
}
$db->sql_query("REPLACE INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES('" . NV_LANG_DATA . "', " . $db->dbescape($module_name) . ", 'timecheckstatus', '" . intval($timecheckstatus) . "')");
nv_del_moduleCache('settings');
nv_del_moduleCache($module_name);
unlink($check_run_cronjobs);
clearstatcache();
}
示例6: die
* @Copyright (C) 2014 VINADES.,JSC. All rights reserved
* @License GNU/GPL version 2 or any later version
* @Createdate 2-10-2010 18:49
*/
if (!defined('NV_IS_FILE_ADMIN')) {
die('Stop!!!');
}
$payment = $nv_Request->get_string('oid', 'post', '');
$new_weight = $nv_Request->get_int('w', 'post', 0);
$content = "NO_" . $payment;
$table = $db_config['prefix'] . "_" . $module_data . "_payment";
$stmt = $db->prepare("SELECT payment, weight FROM " . $table . " WHERE payment= :payment");
$stmt->bindParam(':payment', $payment, PDO::PARAM_STR);
$stmt->execute();
list($payment, $weight_old) = $stmt->fetch(3);
if (!empty($payment)) {
$sql = "SELECT payment FROM " . $table . " WHERE weight = " . intval($new_weight);
$result = $db->query($sql);
$payment_swap = $result->fetchColumn();
$stmt = $db->prepare("UPDATE " . $table . " SET weight=" . $new_weight . " WHERE payment= :payment");
$stmt->bindParam(':payment', $payment, PDO::PARAM_STR);
$stmt->execute();
$stmt = $db->prepare("UPDATE " . $table . " SET weight=" . $weight_old . " WHERE payment= :payment");
$stmt->bindParam(':payment', $payment, PDO::PARAM_STR);
$stmt->execute();
$content = "OK_" . $payment;
nv_del_moduleCache($payment);
}
include NV_ROOTDIR . '/includes/header.php';
echo $content;
include NV_ROOTDIR . '/includes/footer.php';
示例7: nv_groups_list_pub
/**
* nv_groups_list_pub()
*
* @return
*/
function nv_groups_list_pub()
{
global $db;
$query = "SELECT `group_id`, `title`, `exp_time`, `public` FROM `" . NV_GROUPS_GLOBALTABLE . "` WHERE `act`=1 ORDER BY `weight`";
$list = nv_db_cache($query, '', 'users');
if (empty($list)) {
return array();
}
$groups = array();
$reload = array();
for ($i = 0, $count = sizeof($list); $i < $count; ++$i) {
if ($list[$i]['exp_time'] != 0 and $list[$i]['exp_time'] <= NV_CURRENTTIME) {
$reload[] = $list[$i]['group_id'];
} elseif ($list[$i]['public']) {
$groups[$list[$i]['group_id']] = $list[$i]['title'];
}
}
if ($reload) {
$sql = "UPDATE `" . NV_GROUPS_GLOBALTABLE . "` SET `act`='0' WHERE `group_id` IN (" . implode(",", $reload) . ")";
$db->sql_query($sql);
nv_del_moduleCache('users');
}
return $groups;
}
示例8: die
<?php
/**
* @Project NUKEVIET 3.x
* @Author VINADES.,JSC (contact@vinades.vn)
* @Copyright (C) 2012 VINADES.,JSC. All rights reserved
* @Createdate 2-10-2010 17:30
*/
if (!defined('NV_IS_FILE_MODULES')) {
die('Stop!!!');
}
$mod = filter_text_input('mod', 'post');
if (empty($mod) or !preg_match($global_config['check_module'], $mod)) {
die("NO_" . $mod);
}
$sql = "SELECT `submenu` FROM `" . NV_MODULES_TABLE . "` WHERE `title`=" . $db->dbescape($mod);
$result = $db->sql_query($sql);
$numrows = $db->sql_numrows($result);
if ($numrows != 1) {
die('NO_' . $mod);
}
$row = $db->sql_fetchrow($result);
$submenu = $row['submenu'] ? 0 : 1;
$sql = "UPDATE `" . NV_MODULES_TABLE . "` SET `submenu`=" . $submenu . " WHERE `title`=" . $db->dbescape($mod);
$db->sql_query($sql);
nv_del_moduleCache('modules');
include NV_ROOTDIR . "/includes/header.php";
echo 'OK_' . $mod;
include NV_ROOTDIR . "/includes/footer.php";
示例9: die
if (!$db->sql_query($sql)) {
die('NO_' . $modname);
}
}
}
}
// Xoa du lieu tai bang nv3_vi_blocks
$sql = "DELETE FROM `" . NV_BLOCKS_TABLE . "_weight` WHERE `bid` in (SELECT `bid` FROM `" . NV_BLOCKS_TABLE . "_groups` WHERE `module`=" . $db->dbescape($modname) . ")";
if (!$db->sql_query($sql)) {
die('NO_' . $modname);
}
$sql = "DELETE FROM `" . NV_BLOCKS_TABLE . "_groups` WHERE `module`=" . $db->dbescape($modname);
if (!$db->sql_query($sql)) {
die('NO_' . $modname);
}
nv_del_moduleCache("themes");
$sql = "DELETE FROM `" . NV_PREFIXLANG . "_modthemes` WHERE `func_id` IN (SELECT `func_id` FROM `" . NV_MODFUNCS_TABLE . "` WHERE `in_module`=" . $db->dbescape($modname) . ")";
if (!$db->sql_query($sql)) {
die('NO_' . $modname);
}
// Xoa du lieu tai bang nv3_vi_modfuncs
$sql = "DELETE FROM `" . NV_MODFUNCS_TABLE . "` WHERE `in_module`=" . $db->dbescape($modname);
if (!$db->sql_query($sql)) {
die('NO_' . $modname);
}
// Xoa du lieu tai bang nv3_vi_modules
$sql = "DELETE FROM `" . NV_MODULES_TABLE . "` WHERE `title`=" . $db->dbescape($modname);
if (!$db->sql_query($sql)) {
die('NO_' . $modname);
}
// Xoa du lieu tai bang nv3_config
示例10: while
$sth->bindParam(':theme', $theme, PDO::PARAM_STR);
$sth->bindParam(':position', $pos_new, PDO::PARAM_STR);
$sth->execute();
$weight = 0;
while (list($bid_i) = $sth->fetch(3)) {
++$weight;
$db->query('UPDATE ' . NV_BLOCKS_TABLE . '_groups SET weight=' . $weight . ' WHERE bid=' . $bid_i);
}
if ($weight) {
$func_id_old = $weight = 0;
$sth = $db->prepare('SELECT t1.bid, t1.func_id FROM ' . NV_BLOCKS_TABLE . '_weight t1 INNER JOIN ' . NV_BLOCKS_TABLE . '_groups t2 ON t1.bid = t2.bid WHERE t2.theme=:theme AND t2.position=:position ORDER BY t1.func_id ASC, t1.weight ASC');
$sth->bindParam(':theme', $theme, PDO::PARAM_STR);
$sth->bindParam(':position', $pos_new, PDO::PARAM_STR);
$sth->execute();
while (list($bid_i, $func_id_i) = $sth->fetch(3)) {
if ($func_id_i == $func_id_old) {
++$weight;
} else {
$weight = 1;
$func_id_old = $func_id_i;
}
$db->query('UPDATE ' . NV_BLOCKS_TABLE . '_weight SET weight=' . $weight . ' WHERE bid=' . $bid_i . ' AND func_id=' . $func_id_i);
}
}
nv_del_moduleCache('themes');
$db->query('OPTIMIZE TABLE ' . NV_BLOCKS_TABLE . '_groups');
$db->query('OPTIMIZE TABLE ' . NV_BLOCKS_TABLE . '_weight');
echo $lang_module['block_update_success'];
} else {
echo 'ERROR';
}
示例11: unset
$property['background_repeat'] = $nv_Request->get_title('block_heading_background_repeat', 'post', '');
$property['background_position'] = $nv_Request->get_title('block_heading_background_position', 'post', '');
$config_theme['block_heading'] = $property;
unset($property);
// General css
$config_theme['generalcss'] = nv_unhtmlspecialchars($nv_Request->get_textarea('generalcss', 'post', ''));
$config_value = serialize($config_theme);
if (isset($module_config['themes'][$selectthemes])) {
$sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value= :config_value WHERE config_name = :config_name AND lang = '" . NV_LANG_DATA . "' AND module='themes'");
} else {
$sth = $db->prepare("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . NV_LANG_DATA . "', 'themes', :config_name, :config_value)");
}
$sth->bindParam(':config_name', $selectthemes, PDO::PARAM_STR);
$sth->bindParam(':config_value', $config_value, PDO::PARAM_STR, strlen($config_value));
$sth->execute();
nv_del_moduleCache('settings');
if (file_exists(NV_ROOTDIR . "/" . SYSTEM_FILES_DIR . "/css/theme_" . $selectthemes . "_" . $global_config['idsite'] . ".css")) {
nv_deletefile(NV_ROOTDIR . "/" . SYSTEM_FILES_DIR . "/css/theme_" . $selectthemes . "_" . $global_config['idsite'] . ".css");
}
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&selectthemes=' . $selectthemes . '&rand=' . nv_genpass());
die;
} elseif (isset($module_config['themes'][$selectthemes])) {
$config_theme = unserialize($module_config['themes'][$selectthemes]);
} else {
require NV_ROOTDIR . '/themes/' . $selectthemes . '/config_default.php';
}
$xtpl = new XTemplate('config.tpl', NV_ROOTDIR . '/themes/' . $selectthemes . '/system/');
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('NV_LANG_VARIABLE', NV_LANG_VARIABLE);
$xtpl->assign('NV_LANG_DATA', NV_LANG_DATA);
$xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
示例12: nv_setup_block_module
/**
* nv_setup_block_module()
*
* @param mixed $mod
* @param integer $func_id
* @return
*/
function nv_setup_block_module($mod, $func_id = 0)
{
global $db;
if (empty($func_id)) {
//xoa du lieu tai bang blocks
$sth = $db->prepare('DELETE FROM ' . NV_BLOCKS_TABLE . '_weight WHERE bid in (SELECT bid FROM ' . NV_BLOCKS_TABLE . '_groups WHERE module= :module)');
$sth->bindParam(':module', $mod, PDO::PARAM_STR);
$sth->execute();
$sth = $db->prepare('DELETE FROM ' . NV_BLOCKS_TABLE . '_groups WHERE module= :module');
$sth->bindParam(':module', $mod, PDO::PARAM_STR);
$sth->execute();
$sth = $db->prepare('DELETE FROM ' . NV_BLOCKS_TABLE . '_weight WHERE func_id in (SELECT func_id FROM ' . NV_MODFUNCS_TABLE . ' WHERE in_module= :module)');
$sth->bindParam(':module', $mod, PDO::PARAM_STR);
$sth->execute();
}
$array_funcid = array();
$sth = $db->prepare('SELECT func_id FROM ' . NV_MODFUNCS_TABLE . ' WHERE show_func = 1 AND in_module= :module ORDER BY subweight ASC');
$sth->bindParam(':module', $mod, PDO::PARAM_STR);
$sth->execute();
while (list($func_id_i) = $sth->fetch(3)) {
if ($func_id == 0 or $func_id == $func_id_i) {
$array_funcid[] = $func_id_i;
}
}
$weight = 0;
$old_theme = $old_position = '';
$sql = 'SELECT bid, theme, position FROM ' . NV_BLOCKS_TABLE . '_groups WHERE all_func= 1 ORDER BY theme ASC, position ASC, weight ASC';
$result = $db->query($sql);
while ($row = $result->fetch()) {
if ($old_theme == $row['theme'] and $old_position == $row['position']) {
++$weight;
} else {
$weight = 1;
$old_theme = $row['theme'];
$old_position = $row['position'];
}
foreach ($array_funcid as $func_id) {
$db->query('INSERT INTO ' . NV_BLOCKS_TABLE . '_weight (bid, func_id, weight) VALUES (' . $row['bid'] . ', ' . $func_id . ', ' . $weight . ')');
}
}
nv_del_moduleCache('themes');
}
示例13: nv_block_voting
/**
* nv_block_voting()
*
* @return
*/
function nv_block_voting()
{
global $db, $my_footer, $site_mods, $global_config, $client_info;
$content = '';
if (!isset($site_mods['voting'])) {
return '';
}
$sql = 'SELECT vid, question, link, acceptcm, groups_view, publ_time, exp_time FROM ' . NV_PREFIXLANG . '_' . $site_mods['voting']['module_data'] . ' WHERE act=1';
$list = nv_db_cache($sql, 'vid', 'voting');
if (empty($list)) {
return '';
}
$allowed = array();
$is_update = array();
$a = 0;
foreach ($list as $row) {
if ($row['exp_time'] > 0 and $row['exp_time'] < NV_CURRENTTIME) {
$is_update[] = $row['vid'];
} elseif ($row['publ_time'] <= NV_CURRENTTIME and nv_user_in_groups($row['groups_view'])) {
$allowed[$a] = $row;
++$a;
}
}
if (!empty($is_update)) {
$is_update = implode(',', $is_update);
$sql = 'UPDATE ' . NV_PREFIXLANG . '_' . $site_mods['voting']['module_data'] . ' SET act=0 WHERE vid IN (' . $is_update . ')';
$db->query($sql);
nv_del_moduleCache('voting');
}
if ($allowed) {
--$a;
$rand = rand(0, $a);
$current_voting = $allowed[$rand];
$sql = 'SELECT id, vid, title, url FROM ' . NV_PREFIXLANG . '_' . $site_mods['voting']['module_data'] . '_rows WHERE vid = ' . $current_voting['vid'] . ' ORDER BY id ASC';
$list = nv_db_cache($sql, '', 'voting');
if (empty($list)) {
return '';
}
include NV_ROOTDIR . '/modules/' . $site_mods['voting']['module_file'] . '/language/' . NV_LANG_INTERFACE . '.php';
if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $site_mods['voting']['module_file'] . '/global.voting.tpl')) {
$block_theme = $global_config['module_theme'];
} elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/' . $site_mods['voting']['module_file'] . '/global.voting.tpl')) {
$block_theme = $global_config['site_theme'];
} else {
$block_theme = 'default';
}
if (file_exists(NV_ROOTDIR . '/themes/' . $block_theme . '/js/voting.js')) {
$my_footer .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "themes/" . $block_theme . "/js/voting.js\"></script>\n";
}
$action = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=voting';
$voting_array = array('checkss' => md5($current_voting['vid'] . $client_info['session_id'] . $global_config['sitekey']), 'accept' => (int) $current_voting['acceptcm'], 'errsm' => (int) $current_voting['acceptcm'] > 1 ? sprintf($lang_module['voting_warning_all'], (int) $current_voting['acceptcm']) : $lang_module['voting_warning_accept1'], 'vid' => $current_voting['vid'], 'question' => empty($current_voting['link']) ? $current_voting['question'] : '<a target="_blank" href="' . $current_voting['link'] . '">' . $current_voting['question'] . '</a>', 'action' => $action, 'langresult' => $lang_module['voting_result'], 'langsubmit' => $lang_module['voting_hits']);
$xtpl = new XTemplate('global.voting.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/' . $site_mods['voting']['module_file']);
$xtpl->assign('VOTING', $voting_array);
foreach ($list as $row) {
if (!empty($row['url'])) {
$row['title'] = '<a target="_blank" href="' . $row['url'] . '">' . $row['title'] . '</a>';
}
$xtpl->assign('RESULT', $row);
if ((int) $current_voting['acceptcm'] > 1) {
$xtpl->parse('main.resultn');
} else {
$xtpl->parse('main.result1');
}
}
$xtpl->parse('main');
$content = $xtpl->text('main');
}
return $content;
}
示例14: nv_setup_block_module
/**
* nv_setup_block_module()
*
* @param mixed $mod
* @param integer $func_id
* @return
*/
function nv_setup_block_module($mod, $func_id = 0)
{
global $db;
if (empty($func_id)) {
//xoa du lieu tai bang blocks
$db->sql_query("DELETE FROM `" . NV_BLOCKS_TABLE . "_weight` WHERE `bid` in (SELECT `bid` FROM `" . NV_BLOCKS_TABLE . "_groups` WHERE `module`=" . $db->dbescape($mod) . ")");
$db->sql_query("DELETE FROM `" . NV_BLOCKS_TABLE . "_groups` WHERE `module`=" . $db->dbescape($mod));
$db->sql_query("DELETE FROM `" . NV_BLOCKS_TABLE . "_weight` WHERE `func_id` in (SELECT `func_id` FROM `" . NV_MODFUNCS_TABLE . "` WHERE `in_module`=" . $db->dbescape($mod) . ")");
}
$array_funcid = array();
$func_result = $db->sql_query("SELECT `func_id` FROM `" . NV_MODFUNCS_TABLE . "` WHERE `show_func` = '1' AND `in_module`=" . $db->dbescape($mod) . " ORDER BY `subweight` ASC");
while (list($func_id_i) = $db->sql_fetchrow($func_result)) {
if ($func_id == 0 or $func_id == $func_id_i) {
$array_funcid[] = $func_id_i;
}
}
$weight = 0;
$old_theme = $old_position = "";
$sql = "SELECT `bid`, `theme`, `position` FROM `" . NV_BLOCKS_TABLE . "_groups` WHERE `all_func`='1' ORDER BY `theme` ASC, `position` ASC, `weight` ASC";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
if ($old_theme == $row['theme'] and $old_position == $row['position']) {
++$weight;
} else {
$weight = 1;
$old_theme = $row['theme'];
$old_position = $row['position'];
}
foreach ($array_funcid as $func_id) {
$db->sql_query("INSERT INTO `" . NV_BLOCKS_TABLE . "_weight` (`bid`, `func_id`, `weight`) VALUES ('" . $row['bid'] . "', '" . $func_id . "', '" . $weight . "')");
}
}
nv_del_moduleCache("themes");
}
示例15: del_cache
/**
* nv_mod_blog::del_cache()
*
* @param mixed $module_name
* @return
*/
private function del_cache($module_name)
{
return nv_del_moduleCache($module_name);
}