• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP nv_user_in_groups函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中nv_user_in_groups函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_user_in_groups函数的具体用法?PHP nv_user_in_groups怎么用?PHP nv_user_in_groups使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了nv_user_in_groups函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: nv_list_cats

/**
 * nv_list_cats()
 * 
 * @param bool $is_link
 * @param bool $is_parentlink
 * @return
 */
function nv_list_cats($is_link = false, $is_parentlink = true)
{
    global $db, $module_data, $module_name, $module_info;
    $sql = "SELECT * FROM " . NV_PREFIXLANG . "_" . $module_data . "_categories WHERE status=1 ORDER BY parentid,weight ASC";
    $result = $db->query($sql);
    $list = array();
    while ($row = $result->fetch()) {
        if (nv_user_in_groups($row['groups_view'])) {
            $list[$row['id']] = array('id' => (int) $row['id'], 'title' => $row['title'], 'alias' => $row['alias'], 'description' => $row['description'], 'parentid' => (int) $row['parentid'], 'subcats' => array(), 'keywords' => $row['keywords']);
        }
    }
    $list2 = array();
    if (!empty($list)) {
        foreach ($list as $row) {
            if (!$row['parentid'] or isset($list[$row['parentid']])) {
                $list2[$row['id']] = $list[$row['id']];
                $list2[$row['id']]['name'] = $list[$row['id']]['title'];
                if ($is_link) {
                    $list2[$row['id']]['name'] = "<a href=\"" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=" . $list2[$row['id']]['alias'] . "\">" . $list2[$row['id']]['name'] . "</a>";
                }
                if ($row['parentid']) {
                    $list2[$row['parentid']]['subcats'][] = $row['id'];
                    $list2[$row['id']]['name'] = nv_setcats($row['parentid'], $list, $list2[$row['id']]['name'], $is_parentlink);
                }
                if ($is_parentlink) {
                    $list2[$row['id']]['name'] = "<a href=\"" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "\">" . $module_info['custom_title'] . "</a> &raquo; " . $list2[$row['id']]['name'];
                }
            }
        }
    }
    return $list2;
}
开发者ID:hongoctrien,项目名称:module-faq,代码行数:39,代码来源:functions.php


示例2: check_upload3

function check_upload3()
{
    global $data_config, $user_info, $op, $module_name;
    if ($data_config['who_upload'] == 0) {
        return true;
    } elseif ($data_config['who_upload'] == 1) {
        if (!defined('NV_IS_USER')) {
            return false;
        } else {
            return true;
        }
    } elseif ($data_config['who_upload'] == 2) {
        if (!defined('NV_IS_ADMIN')) {
            return false;
        } else {
            return true;
        }
    } elseif ($data_config['who_upload'] == 3) {
        if (!defined('NV_IS_USER')) {
            return false;
        } elseif (empty($data_config['groups_view'])) {
            return false;
        } else {
            if (nv_user_in_groups($data_config['groups_view'])) {
                return true;
            } else {
                return false;
            }
        }
    }
}
开发者ID:ngoctu2008,项目名称:nv4_module_laws,代码行数:31,代码来源:global.block_uplaws.php


示例3: nv_mod_down_config

 function nv_mod_down_config($module)
 {
     global $site_mods, $module_info;
     $sql = 'SELECT config_name,config_value FROM ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_file'] . '_config';
     $list = nv_db_cache($sql, '', $module);
     $download_config = array();
     foreach ($list as $values) {
         $download_config[$values['config_name']] = $values['config_value'];
     }
     $download_config['upload_filetype'] = !empty($download_config['upload_filetype']) ? explode(',', $download_config['upload_filetype']) : array();
     if (!empty($download_config['upload_filetype'])) {
         $download_config['upload_filetype'] = array_map('trim', $download_config['upload_filetype']);
     }
     if (empty($download_config['upload_filetype'])) {
         $download_config['is_upload'] = 0;
     }
     if ($download_config['is_addfile']) {
         $download_config['is_addfile_allow'] = nv_user_in_groups($download_config['groups_addfile']);
     } else {
         $download_config['is_addfile_allow'] = false;
     }
     if ($download_config['is_addfile_allow'] and $download_config['is_upload']) {
         $download_config['is_upload_allow'] = nv_user_in_groups($download_config['groups_upload']);
     } else {
         $download_config['is_upload_allow'] = false;
     }
     return $download_config;
 }
开发者ID:lzhao18,项目名称:nukeviet,代码行数:28,代码来源:global.upload.php


示例4: nv_mod_down_config

 function nv_mod_down_config($module)
 {
     global $site_mods, $module_info, $nv_Cache;
     $_mod_table = defined('SYS_DOWNLOAD_TABLE') ? SYS_DOWNLOAD_TABLE : NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'];
     $sql = 'SELECT config_name,config_value FROM ' . $_mod_table . '_config';
     $list = $nv_Cache->db($sql, '', $module);
     $download_config = array();
     foreach ($list as $values) {
         $download_config[$values['config_name']] = $values['config_value'];
     }
     $download_config['upload_filetype'] = !empty($download_config['upload_filetype']) ? explode(',', $download_config['upload_filetype']) : array();
     if (!empty($download_config['upload_filetype'])) {
         $download_config['upload_filetype'] = array_map('trim', $download_config['upload_filetype']);
     }
     if ($download_config['is_addfile']) {
         $download_config['is_addfile_allow'] = nv_user_in_groups($download_config['groups_addfile']);
     } else {
         $download_config['is_addfile_allow'] = false;
     }
     if ($download_config['is_addfile_allow']) {
         $download_config['is_upload_allow'] = nv_user_in_groups($download_config['groups_upload']);
     } else {
         $download_config['is_upload_allow'] = false;
     }
     return $download_config;
 }
开发者ID:nukeviet,项目名称:module-download,代码行数:26,代码来源:global.upload.php


示例5: nv_mod_down_config

/**
 * nv_mod_down_config()
 *
 * @return
 */
function nv_mod_down_config()
{
    global $module_name, $module_name, $nv_Cache;
    $sql = 'SELECT config_name,config_value FROM ' . NV_MOD_TABLE . '_config';
    $list = $nv_Cache->db($sql, '', $module_name);
    $download_config = array();
    foreach ($list as $values) {
        $download_config[$values['config_name']] = $values['config_value'];
    }
    $download_config['upload_filetype'] = !empty($download_config['upload_filetype']) ? explode(',', $download_config['upload_filetype']) : array();
    if (!empty($download_config['upload_filetype'])) {
        $download_config['upload_filetype'] = array_map('trim', $download_config['upload_filetype']);
    }
    if ($download_config['is_addfile']) {
        $download_config['is_addfile_allow'] = nv_user_in_groups($download_config['groups_addfile']);
    } else {
        $download_config['is_addfile_allow'] = false;
    }
    if ($download_config['is_addfile_allow']) {
        $download_config['is_upload_allow'] = nv_user_in_groups($download_config['groups_upload']);
    } else {
        $download_config['is_upload_allow'] = false;
    }
    return $download_config;
}
开发者ID:htuyen1994,项目名称:module-download,代码行数:30,代码来源:functions.php


示例6: nv_menu_blocks

/**
 * nv_menu_blocks()
 *
 * Ham xu ly chinh cho block
 *
 * @param mixed $block_config
 * @return
 */
function nv_menu_blocks($block_config)
{
    global $db, $global_config, $my_head;
    $list_cats = array();
    $sql = 'SELECT id, parentid, title, link, icon, note, subitem, groups_view, module_name, op, target, css, active_type FROM ' . NV_PREFIXLANG . '_menu_rows WHERE status=1 AND mid = ' . $block_config['menuid'] . ' ORDER BY weight ASC';
    $list = nv_db_cache($sql, '', $block_config['module']);
    foreach ($list as $row) {
        if (nv_user_in_groups($row['groups_view'])) {
            switch ($row['target']) {
                case 1:
                    $row['target'] = '';
                    break;
                case 3:
                    $row['target'] = ' onclick="window.open(this.href,\'targetWindow\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,\');return false;"';
                    break;
                default:
                    $row['target'] = ' onclick="this.target=\'_blank\'"';
            }
            if (!empty($row['icon']) and file_exists(NV_UPLOADS_REAL_DIR . '/menu/' . $row['icon'])) {
                $row['icon'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/menu/' . $row['icon'];
            } else {
                $row['icon'] = '';
            }
            $list_cats[$row['id']] = array('id' => $row['id'], 'parentid' => $row['parentid'], 'subcats' => $row['subitem'], 'title' => $row['title'], 'title_trim' => nv_clean60($row['title'], $block_config['title_length']), 'target' => $row['target'], 'note' => empty($row['note']) ? $row['title'] : $row['note'], 'link' => nv_url_rewrite(nv_unhtmlspecialchars($row['link']), true), 'icon' => $row['icon'], 'html_class' => $row['css'], 'current' => nv_menu_check_current($row['link'], (int) $row['active_type']));
        }
    }
    if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/menu/' . $block_config['block_name'] . '.tpl')) {
        $block_theme = $global_config['module_theme'];
    } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/modules/menu/' . $block_config['block_name'] . '.tpl')) {
        $block_theme = $global_config['site_theme'];
    } else {
        $block_theme = 'default';
    }
    $xtpl = new XTemplate($block_config['block_name'] . '.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/menu');
    $xtpl->assign('BLOCK_THEME', $block_theme);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    foreach ($list_cats as $cat) {
        if (empty($cat['parentid'])) {
            $cat['class'] = nv_menu_blocks_active($cat);
            $xtpl->assign('CAT1', $cat);
            if (!empty($cat['icon'])) {
                $xtpl->parse('main.loopcat1.icon');
            }
            if (!empty($cat['subcats'])) {
                $html_content = nv_smenu_blocks($block_config['block_name'], $list_cats, $cat['subcats']);
                $xtpl->assign('HTML_CONTENT', $html_content);
                if ($html_content != '') {
                    $xtpl->parse('main.loopcat1.cat2');
                    $xtpl->parse('main.loopcat1.expand');
                }
            }
            $xtpl->parse('main.loopcat1');
        }
    }
    $xtpl->assign('MENUID', $block_config['bid']);
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:66,代码来源:menu_blocks.php


示例7: nv_block_voting_select

 function nv_block_voting_select($block_config, $global_array_cat)
 {
     global $module_info, $global_config, $db, $site_mods, $module_name, $my_head, $client_info;
     $module = $block_config['module'];
     $mod_data = $site_mods[$module]['module_data'];
     $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 (isset($list[$block_config['vid']])) {
         $current_voting = $list[$block_config['vid']];
         if ($current_voting['publ_time'] <= NV_CURRENTTIME and nv_user_in_groups($current_voting['groups_view'])) {
             $sql = "SELECT id, vid, title, url FROM " . NV_PREFIXLANG . "_" . $site_mods['voting']['module_data'] . "_rows WHERE vid = " . $block_config['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 (!defined('SHADOWBOX')) {
                 $my_head .= "<link rel=\"Stylesheet\" href=\"" . NV_BASE_SITEURL . "js/shadowbox/shadowbox.css\" />\n";
                 $my_head .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "js/shadowbox/shadowbox.js\"></script>\n";
                 $my_head .= "<script type=\"text/javascript\">Shadowbox.init();</script>";
                 define('SHADOWBOX', true);
             }
             $my_head .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . "modules/" . $site_mods['voting']['module_file'] . "/js/user.js\"></script>\n";
             $action = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=voting";
             $voting_array = array('checkss' => md5($current_voting['vid'] . $client_info['session_id'] . $global_config['sitekey']), 'accept' => $current_voting['acceptcm'], 'errsm' => $current_voting['acceptcm'] > 1 ? sprintf($lang_module['voting_warning_all'], $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');
                 }
             }
             if (!defined('MODAL_LOADED')) {
                 $xtpl->parse('main.modal_loaded');
                 define('MODAL_LOADED', true);
             }
             $xtpl->parse('main');
             return $xtpl->text('main');
         }
     }
 }
开发者ID:lzhao18,项目名称:nukeviet,代码行数:54,代码来源:global.voting.php


示例8: nv_sdown_cats

 /**
  * nv_sdown_cats()
  *
  * @param mixed $module_data
  * @return
  */
 function nv_sdown_cats($_mod_table)
 {
     global $db;
     $sql = 'SELECT id, title, alias, groups_view FROM ' . $_mod_table . '_categories WHERE status=1';
     $result = $db->query($sql);
     $list = array();
     while ($row = $result->fetch()) {
         if (nv_user_in_groups($row['groups_view'])) {
             $list[$row['id']] = array('id' => $row['id'], 'title' => $row['title'], 'alias' => $row['alias']);
         }
     }
     return $list;
 }
开发者ID:htuyen1994,项目名称:module-download,代码行数:19,代码来源:search.php


示例9: nv_faq_list_cats

/**
 * nv_faq_list_cats()
 * 
 * @param mixed $module_data
 * @return
 */
function nv_faq_list_cats($module_data)
{
    global $db;
    $sql = "SELECT id, title, alias, groups_view FROM " . NV_PREFIXLANG . "_" . $module_data . "_categories WHERE status=1";
    $result = $db->query($sql);
    $list = array();
    while ($row = $result->fetch()) {
        if (nv_user_in_groups($row['groups_view'])) {
            $list[$row['id']] = array('id' => (int) $row['id'], 'title' => $row['title'], 'alias' => $row['alias']);
        }
    }
    return $list;
}
开发者ID:hongoctrien,项目名称:module-faq,代码行数:19,代码来源:search.php


示例10: nv_bdown_news

 function nv_bdown_news($block_config)
 {
     global $db, $module_info, $site_mods, $global_config, $nv_Cache;
     $module = $block_config['module'];
     $file = $site_mods[$module]['module_file'];
     // Lay thong tin phan quyen
     $sql = 'SELECT id, alias, groups_view FROM ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_categories WHERE status=1';
     $_tmp = $nv_Cache->db($sql, 'id', $module);
     $list_cat = array();
     if ($_tmp) {
         foreach ($_tmp as $row) {
             if (nv_user_in_groups($row['groups_view'])) {
                 $list_cat[$row['id']] = $row['alias'];
             }
         }
     }
     unset($_tmp, $sql);
     if ($list_cat) {
         $db->sqlreset()->select('id, catid, title, alias, updatetime')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'])->where('status AND catid IN (' . implode(',', array_keys($list_cat)) . ')')->order('updatetime DESC')->limit($block_config['numrow']);
         $list = $nv_Cache->db($db->sql(), 'id', $module);
         if (!empty($list)) {
             if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $file . '/block_new_files.tpl')) {
                 $block_theme = $global_config['module_theme'];
             } else {
                 $block_theme = 'default';
             }
             $xtpl = new XTemplate('block_new_files.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/' . $file);
             $xtpl->assign('CONFIG', $block_config);
             foreach ($list as $row) {
                 $row['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module . '&amp;' . NV_OP_VARIABLE . '=' . $list_cat[$row['catid']] . '/' . $row['alias'] . $global_config['rewrite_exturl'];
                 $row['updatetime'] = nv_date('d/m/Y', $row['updatetime']);
                 $row['stitle'] = nv_clean60($row['title'], $block_config['title_length']);
                 $xtpl->assign('ROW', $row);
                 if ($block_config['img_bullet']) {
                     $xtpl->parse('main.loop.bullet');
                 }
                 $xtpl->parse('main.loop');
             }
             $xtpl->parse('main');
             return $xtpl->text('main');
         }
     }
 }
开发者ID:NukeVlad,项目名称:module-download,代码行数:43,代码来源:global.new_files.php


示例11: nv_download_content

/**
 * nv_download_content
 *
 * @param mixed $data_content
 * @param mixed $linktab
 * @return
 */
function nv_download_content($data_content)
{
    global $module_info, $lang_module, $lang_global, $module_name, $module_data, $module_file, $pro_config, $op;
    $xtpl = new XTemplate('download_content.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('proid', $data_content['id']);
    if (!empty($data_content['files'])) {
        $login = 0;
        foreach ($data_content['files'] as $files) {
            if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/images/' . $module_file . '/icon_files/' . $files['extension'] . '.png')) {
                $files['extension_icon'] = NV_BASE_SITEURL . 'themes/' . $module_info['template'] . '/images/' . $module_file . '/icon_files/' . $files['extension'] . '.png';
            } else {
                $files['extension_icon'] = NV_BASE_SITEURL . 'themes/' . $module_info['template'] . '/images/' . $module_file . '/icon_files/document.png';
            }
            $xtpl->assign('FILES', $files);
            if ($files['download_groups'] == '-1') {
                $files['download_groups'] = $pro_config['download_groups'];
            }
            if (!nv_user_in_groups($files['download_groups'])) {
                $xtpl->assign('NOTE', $lang_module['download_file_no']);
                $xtpl->parse('main.files_content.loop.disabled');
            } else {
                $xtpl->assign('NOTE', $lang_module['download_file']);
            }
            $xtpl->parse('main.files_content.loop');
        }
        if ($login > 0) {
            $link_login = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=users&amp;' . NV_OP_VARIABLE . '=login&amp;nv_redirect=' . nv_redirect_encrypt($client_info['selfurl'] . '#' . $linktab);
            $xtpl->assign('DOWNLOAD_LOGIN', '<a title="' . $lang_global['loginsubmit'] . '" href="' . $link_login . '">' . $lang_module['download_login'] . '</a>');
            $xtpl->parse('main.form_login');
        }
        $xtpl->parse('main.files_content');
        $xtpl->parse('main');
        return $xtpl->text('main');
    }
}
开发者ID:nukeplus,项目名称:shops,代码行数:43,代码来源:theme.php


示例12: header

 if ($checkss != md5($vid . NV_CHECK_SESSION) or $vid <= 0 or $lid == '') {
     header('location:' . $global_config['site_url']);
     exit;
 }
 $sql = 'SELECT vid, question, acceptcm, groups_view, publ_time, exp_time FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE act=1';
 $list = $nv_Cache->db($sql, 'vid', 'voting');
 if (empty($list) or !isset($list[$vid])) {
     header('location:' . $global_config['site_url']);
     exit;
 }
 $row = $list[$vid];
 if ((int) $row['exp_time'] < 0 or (int) $row['exp_time'] > 0 and $row['exp_time'] < NV_CURRENTTIME) {
     header('location:' . $global_config['site_url']);
     exit;
 }
 if (!nv_user_in_groups($row['groups_view'])) {
     header('location:' . $global_config['site_url']);
     exit;
 }
 $difftimeout = 3600;
 $dir = NV_ROOTDIR . '/' . NV_LOGS_DIR . '/voting_logs';
 $log_fileext = preg_match('/[a-z]+/i', NV_LOGS_EXT) ? NV_LOGS_EXT : 'log';
 $pattern = '/^(.*)\\.' . $log_fileext . '$/i';
 $logs = nv_scandir($dir, $pattern);
 if (!empty($logs)) {
     foreach ($logs as $file) {
         $vtime = filemtime($dir . '/' . $file);
         if (!$vtime or $vtime <= NV_CURRENTTIME - $difftimeout) {
             @unlink($dir . '/' . $file);
         }
     }
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:main.php


示例13: die

if (empty($filename) or !isset($session_files['fileupload'][$filename])) {
    die('Wrong URL');
}
if (!file_exists($session_files['fileupload'][$filename]['src'])) {
    die('Wrong URL');
}
if (!isset($session_files['fileupload'][$filename]['id'])) {
    die('Wrong URL');
}
$upload_dir = 'files';
$is_zip = false;
$is_resume = false;
$max_speed = 0;
$filepdf = $nv_Request->get_int('filepdf', 'get', 0);
if ($filepdf == 1) {
    if (!nv_user_in_groups($row['groups_onlineview']) or !nv_user_in_groups($list_cats[$row['catid']]['groups_onlineview'])) {
        die('Wrong URL');
    }
    $download_config = nv_mod_down_config();
    $file_url = '';
    $file_src = $session_files['fileupload'][$filename]['src'];
    if ($download_config['pdf_handler'] == 'filetmp') {
        $file_src_new = NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . NV_TEMPNAM_PREFIX . md5($file_src) . '.' . nv_getextension($file_src);
        if (file_exists($file_src_new) or nv_copyfile($file_src, $file_src_new)) {
            $file_url = NV_MY_DOMAIN . NV_BASE_SITEURL . substr($file_src_new, strlen(NV_ROOTDIR . '/'));
        }
    } elseif ($download_config['pdf_handler'] == 'base64') {
        $file_url = 'data:application/pdf;base64,' . base64_encode(file_get_contents($file_src));
    } else {
        $file_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=down&filepdf=2&filename=' . $filename;
    }
开发者ID:htuyen1994,项目名称:module-download,代码行数:31,代码来源:down.php


示例14: nv_create_submenu

                nv_create_submenu();
            }
            // Ket noi voi cac op cua module de thuc hien
            if ($is_mobile and file_exists(NV_ROOTDIR . '/modules/' . $module_file . '/mobile/' . $op_file . '.php')) {
                require NV_ROOTDIR . '/modules/' . $module_file . '/mobile/' . $op_file . '.php';
            } else {
                require NV_ROOTDIR . '/modules/' . $module_file . '/funcs/' . $op_file . '.php';
            }
            exit;
        } elseif (isset($module_info['funcs']['main'])) {
            $sth = $db->prepare('UPDATE ' . NV_MODULES_TABLE . ' SET act=2 WHERE title= :title');
            $sth->bindParam(':title', $module_name, PDO::PARAM_STR);
            $sth->execute();
            nv_insert_notification('modules', 'auto_deactive_module', array('custom_title' => $site_mods[$module_name]['custom_title']));
            nv_del_moduleCache('modules');
        }
    } elseif (isset($sys_mods[$module_name])) {
        $groups_view = (string) $sys_mods[$module_name]['groups_view'];
        if (!defined('NV_IS_USER') and $groups_view == 4) {
            // Login users
            Header('Location: ' . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=users&' . NV_OP_VARIABLE . '=login&nv_redirect=' . nv_base64_encode($client_info['selfurl']));
            die;
        } elseif (!defined('NV_IS_ADMIN') and ($groups_view == '2' or $groups_view == '1')) {
            // Exit
            nv_info_die($lang_global['error_404_title'], $lang_global['site_info'], $lang_global['module_for_admin']);
        } elseif (defined('NV_IS_USER') and !nv_user_in_groups($groups_view)) {
            nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['error_404_content']);
        }
    }
}
nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['error_404_content']);
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:index.php


示例15: nv_block_voting

 /**
  * nv_block_voting()
  *
  * @return
  */
 function nv_block_voting()
 {
     global $nv_Cache, $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_Cache->db($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_Cache->delMod('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_Cache->db($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 . '&amp;' . 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;
 }
开发者ID:nukeplus,项目名称:nuke,代码行数:74,代码来源:global.voting_random.php


示例16: die

 * @Copyright (C) 2015 VINADES.,JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate Sun, 21 Jun 2015 00:23:50 GMT
 */
if (!defined('NV_IS_MOD_EVENT')) {
    die('Stop!!!');
}
$key_words = $module_info['keywords'];
$array_data = array();
$_sql = 'SELECT * FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE status=1 AND alias=' . $db->quote($alias_url);
$array_data = $db->query($_sql)->fetch();
if (empty($array_data)) {
    Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true));
    die;
}
if (nv_user_in_groups($global_array_event_cat[$catid]['groups_view']) and nv_user_in_groups($array_data['groups_view'])) {
    if (!empty($array_data['homeimgfile']) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/' . $array_data['homeimgfile'])) {
        $array_data['homeimgfile'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $array_data['homeimgfile'];
    } else {
        $array_data['homeimgfile'] = NV_BASE_SITEURL . 'themes/' . $global_config['site_theme'] . '/images/no_image.gif';
    }
    //metatag image facebook
    $meta_property['og:image'] = NV_MY_DOMAIN . $array_data['homeimgfile'];
    $contents = nv_theme_event_detail($array_data);
    $page_title = $array_data['title'];
    if (!empty($array_data['keywords'])) {
        $key_words = $array_data['keywords'];
    }
} else {
    $nv_redirect = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name, true);
    redict_link($lang_module['detail_no_permission'], $lang_module['redirect_to_back'], $nv_redirect);
开发者ID:hoangvtien,项目名称:module-event,代码行数:31,代码来源:detail.php


示例17: nv_ImageInfo

$img = NV_UPLOADS_DIR . $row['fileimage'];
$row['fileimage'] = nv_ImageInfo(NV_ROOTDIR . '/' . $img, 300, true, NV_ROOTDIR . '/' . NV_TEMP_DIR);
$dfile = $nv_Request->get_string('dfile', 'session', '');
$dfile = !empty($dfile) ? unserialize($dfile) : array();
if (!in_array($row['id'], $dfile)) {
    $dfile[] = $row['id'];
    $dfile = serialize($dfile);
    $nv_Request->set_Session('dfile', $dfile);
    $sql = 'UPDATE ' . NV_PREFIXLANG . '_' . $module_data . ' SET view_hits=view_hits+1 WHERE id=' . $row['id'];
    $db->query($sql);
    ++$row['view_hits'];
}
// comment
if (isset($site_mods['comment']) and isset($module_config[$module_name]['activecomm'])) {
    define('NV_COMM_ID', $row['id']);
    define('NV_COMM_ALLOWED', nv_user_in_groups($row['groups_comment']));
    // Kiem tra quyen dang binh luan
    $allowed = $module_config[$module_name]['allowed_comm'];
    if ($allowed == '-1') {
        // Quyen han dang binh luan theo bai viet
        $allowed = defined('NV_COMM_ALLOWED') ? NV_COMM_ALLOWED : $module_config[$module_name]['setcomm'];
    }
    define('NV_PER_PAGE_COMMENT', 5);
    //per_page_comment
    require_once NV_ROOTDIR . '/modules/comment/comment.php';
    $area = defined('NV_COMM_AREA') ? NV_COMM_AREA : 0;
    $checkss = md5($module_name . '-' . $area . '-' . NV_COMM_ID . '-' . $allowed . '-' . NV_CACHE_PREFIX);
    //get url comment
    $url_info = parse_url($client_info['selfurl']);
    $content_comment = nv_comment_module($module_name, $checkss, $area, NV_COMM_ID, $allowed, 1);
} else {
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:viewfile.php


示例18: array

$cache_file = '';
if (!defined('NV_IS_MODADMIN') and $page < 5) {
    $cache_file = NV_LANG_DATA . '_' . $module_info['template'] . '_' . $op . '_' . $page . '_' . NV_CACHE_PREFIX . '.cache';
    if (($cache = nv_get_cache($module_name, $cache_file)) != false) {
        $contents = $cache;
    }
}
if (empty($contents)) {
    $array_data = array();
    $base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name;
    $db->sqlreset()->select('COUNT(*)')->from(NV_PREFIXLANG . '_' . $module_data)->where('status=1');
    $all_page = $db->query($db->sql())->fetchColumn();
    $db->select('*')->order('id DESC')->limit($per_page)->offset(($page - 1) * $per_page);
    $_query = $db->query($db->sql());
    while ($row = $_query->fetch()) {
        if (!nv_user_in_groups($global_array_event_cat[$row['catid']]['groups_view']) or !nv_user_in_groups($row['groups_view'])) {
            continue;
        }
        $image = NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/' . $row['homeimgfile'];
        if ($row['homeimgfile'] != '' and file_exists($image)) {
            $width = 175;
            $height = 150;
            $row['imgsource'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $row['homeimgfile'];
            $imginfo = nv_is_image($image);
            $basename = basename($image);
            if ($imginfo['width'] > $width or $imginfo['height'] > $height) {
                $basename = preg_replace('/(.*)(\\.[a-zA-Z]+)$/', $module_name . '_' . $row['id'] . '_\\1_' . $width . '-' . $height . '\\2', $basename);
                if (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $basename)) {
                    $row['imgsource'] = NV_BASE_SITEURL . NV_TEMP_DIR . '/' . $basename;
                } else {
                    require_once NV_ROOTDIR . '/includes/class/image.class.php';
开发者ID:hoangvtien,项目名称:module-event,代码行数:31,代码来源:main.php


示例19: die

/**
 * @Project PHOTOS 4.x
 * @Author KENNY NGUYEN ([email protected]) 
 * @Copyright (C) 2015 tradacongnghe.com. All rights reserved
 * @Based on NukeViet CMS 
 * @License GNU/GPL version 2 or any later version
 * @Createdate  Fri, 18 Sep 2015 11:52:59 GMT
 */
if (!defined('NV_IS_MOD_PHOTO')) {
    die('Stop!!!');
}
$contents = '';
$date_added = 0;
$per_page = $module_config[$module_name]['per_page_photo'];
// kiem tra tu cach xem album
if (nv_user_in_groups($global_photo_cat[$category_id]['groups_view'])) {
    // truy van lay thong tin album
    $query = $db->query('SELECT a.*, r.file, r.thumb FROM ' . TABLE_PHOTO_NAME . '_album a 
						LEFT JOIN  ' . TABLE_PHOTO_NAME . '_rows r ON ( a.album_id = r.album_id )
						WHERE a.status= 1 AND r.defaults = 1 AND a.album_id = ' . $album_id);
    $album = $query->fetch();
    if ($album['album_id'] > 0) {
        if (defined('NV_IS_MODADMIN') or $album['status'] == 1) {
            // cap nhat luot xem
            $time_set = $nv_Request->get_int($module_data . '_' . $op . '_' . $album['album_id'], 'session');
            if (empty($time_set)) {
                $nv_Request->set_Session($module_data . '_' . $op . '_' . $album['album_id'], NV_CURRENTTIME);
                $db->query('UPDATE ' . TABLE_PHOTO_NAME . '_album SET viewed=viewed+1 WHERE album_id=' . $album['album_id']);
            }
            if ($alias_url == $album['alias']) {
                $date_added = intval($album['date_added']);
开发者ID:hongoctrien,项目名称:module_photos,代码行数:31,代码来源:detail_album.php


示例20: die

<?php

/**
 * @Project NUKEVIET 4.x
 * @Author VINADES.,JSC ([email protected])
 * @Copyright (C) 2010 - 2014 VINADES.,JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate Sun, 08 Apr 2012 00:00:00 GMT
 */
if (!defined('NV_IS_MOD_USER')) {
    die('Stop!!!');
}
$page_title = $module_info['funcs'][$op]['func_custom_name'];
$key_wo 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nvl函数代码示例发布时间:2022-05-15
下一篇:
PHP nv_url_rewrite函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap