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

PHP nv_is_url函数代码示例

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

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



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

示例1: main

function main($albums)
{
    global $module_info, $global_config, $module_file, $db, $lang_module, $lang_global, $module_name, $my_head;
    $xtpl = new XTemplate("main.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $xtpl->assign('IMGP', NV_BASE_SITEURL . "themes/" . $module_info['template'] . "/images/" . $module_file . "/");
    $xtpl->assign('LANG', $lang_module);
    foreach ($albums as $album) {
        $xtpl->assign('TITLE_ALBUM', $album['name']);
        $xtpl->assign('NUM_PHOTO', $album['num_photo']);
        $xtpl->assign('NUM_VIEW', $album['num_view']);
        $url_link = NV_BASE_SITEURL . "?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $album['alias'];
        $xtpl->assign('URL_AB', $url_link);
        $xtpl->assign('AB_DES', $album['description']);
        if (!empty($album['listimg'])) {
            foreach ($album['listimg'] as $listimg) {
                if (!nv_is_url($listimg['thumb_name']) && $listimg['thumb_name'] != "") {
                    $listimg['thumb_name'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name . "/" . $listimg['thumb_name'];
                    $listimg['path'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name . $listimg['path'];
                } else {
                    $listimg['thumb_name'] = NV_BASE_SITEURL . "themes/" . $global_config['site_theme'] . "/images/" . $module_name . "/no_image.gif";
                }
                $xtpl->assign('NAME', $listimg['name']);
                $xtpl->assign('URL_VID', NV_BASE_SITEURL . "?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $album['alias'] . "/" . $listimg['alias'] . "/" . $listimg['pictureid'] . "");
                $xtpl->assign('VID_VIEW', $listimg['num_view']);
                $xtpl->assign('DES', $listimg['description']);
                $xtpl->parse('main.alb.vid');
            }
        } else {
            $xtpl->assign('NONE', "no image");
        }
        $xtpl->parse('main.alb');
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:35,代码来源:theme.php


示例2: nv_news_block_newscenter

 function nv_news_block_newscenter($block_config)
 {
     global $module_data, $module_name, $module_file, $global_array_cat, $global_config, $lang_module, $db, $module_config, $module_info;
     $module_name = 'news';
     $module_data = 'news';
     $xtpl = new XTemplate('block_newscenter.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/blocks');
     $xtpl->assign('lang', $lang_module);
     $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
     $db->sqlreset()->select('id, catid, publtime, title, alias, hometext, homeimgthumb, homeimgfile')->from(NV_PREFIXLANG . '_' . $module_data . '_rows')->where('status= 1')->order('publtime DESC')->limit(5);
     $list = nv_db_cache($db->sql(), 'id', $module_name);
     $i = 1;
     foreach ($list as $row) {
         $row['publtime'] = nv_date('m/d/Y', $row['publtime']);
         $row['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $global_array_cat[$row['catid']]['alias'] . '/' . $row['alias'] . '-' . $row['id'] . $global_config['rewrite_exturl'];
         $row['title0'] = nv_clean60(strip_tags($row['title']), $i == 1 ? 50 : 30);
         $row['hometext'] = nv_clean60(strip_tags($row['hometext']), 260);
         $image = NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . $row['homeimgfile'];
         if ($row['homeimgfile'] != '' and file_exists($image)) {
             if ($i == 1) {
                 $width = 570;
                 $height = 490;
             } else {
                 $width = 270;
                 $height = 230;
             }
             $row['imgsource'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_name . '/' . $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';
                     $_image = new image($image, NV_MAX_WIDTH, NV_MAX_HEIGHT);
                     $_image->cropFromCenter($width, $height);
                     $_image->save(NV_ROOTDIR . '/' . NV_TEMP_DIR, $basename);
                     if (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $basename)) {
                         $row['imgsource'] = NV_BASE_SITEURL . NV_TEMP_DIR . '/' . $basename;
                     }
                 }
             }
         } elseif (nv_is_url($row['homeimgfile'])) {
             $row['imgsource'] = $row['homeimgfile'];
         } elseif (!empty($module_config[$module_name]['show_no_image'])) {
             $row['imgsource'] = NV_BASE_SITEURL . $module_config[$module_name]['show_no_image'];
         } else {
             $row['imgsource'] = NV_BASE_SITEURL . 'themes/' . $global_config['site_theme'] . '/images/no-image.png';
         }
         $xtpl->assign('main' . $i, $row);
         ++$i;
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:hongoctrien,项目名称:themes-newszine,代码行数:55,代码来源:global.block_newscenter.php


示例3: nv_news_block_news

 function nv_news_block_news($block_config, $mod_data)
 {
     global $module_array_cat, $module_info, $db, $module_config;
     $module = $block_config['module'];
     $blockwidth = $module_config[$module]['blockwidth'];
     $array_block_news = array();
     $cache_file = NV_LANG_DATA . "_" . $module . "_block_news_" . NV_CACHE_PREFIX . ".cache";
     if (($cache = nv_get_cache($cache_file)) != false) {
         $array_block_news = unserialize($cache);
     } else {
         $numrow = isset($block_config['numrow']) ? $block_config['numrow'] : 20;
         $sql = "SELECT id, catid, publtime, exptime, title, alias, homeimgthumb, homeimgfile FROM `" . NV_PREFIXLANG . "_" . $mod_data . "_rows` WHERE `status`= 1 ORDER BY `publtime` DESC LIMIT 0 , " . $numrow;
         $result = $db->sql_query($sql);
         while (list($id, $catid, $publtime, $exptime, $title, $alias, $homeimgthumb, $homeimgfile) = $db->sql_fetchrow($result)) {
             $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module . "&" . NV_OP_VARIABLE . "=" . $module_array_cat[$catid]['alias'] . "/" . $alias . "-" . $id;
             if (!empty($homeimgthumb)) {
                 $array_img = explode("|", $homeimgthumb);
             } else {
                 $array_img = array("", "");
             }
             if ($array_img[0] != "" and file_exists(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module . '/' . $array_img[0])) {
                 $imgurl = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module . '/' . $array_img[0];
             } elseif (nv_is_url($homeimgfile)) {
                 $imgurl = $homeimgfile;
             } elseif ($homeimgfile != "" and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module . '/' . $homeimgfile)) {
                 $imgurl = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module . '/' . $homeimgfile;
             } else {
                 $imgurl = "";
             }
             $array_block_news[] = array('id' => $id, 'title' => $title, 'link' => $link, 'imgurl' => $imgurl, 'width' => $blockwidth);
         }
         $cache = serialize($array_block_news);
         nv_set_cache($cache_file, $cache);
     }
     if (file_exists(NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/news/block_news.tpl")) {
         $block_theme = $module_info['template'];
     } else {
         $block_theme = "default";
     }
     $xtpl = new XTemplate("block_news.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/modules/news/");
     $a = 1;
     foreach ($array_block_news as $array_news) {
         $xtpl->assign('blocknews', $array_news);
         if (!empty($array_news['imgurl'])) {
             $xtpl->parse('main.newloop.imgblock');
         }
         $xtpl->parse('main.newloop');
         $xtpl->assign('BACKGROUND', $a % 2 ? 'bg ' : '');
         ++$a;
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:atarubi,项目名称:nuke-viet,代码行数:53,代码来源:module.block_news.php


示例4: nv_block_data_config_rss_submit

 /**
  * nv_block_data_config_rss_submit()
  *
  * @param mixed $module
  * @param mixed $lang_block
  * @return
  *
  */
 function nv_block_data_config_rss_submit($module, $lang_block)
 {
     global $nv_Request;
     $return = array();
     $return['error'] = array();
     $return['config'] = array();
     $return['config']['url'] = $nv_Request->get_title('config_url', 'post', '', 0);
     $return['config']['number'] = $nv_Request->get_int('config_number', 'post', 0);
     $return['config']['isdescription'] = $nv_Request->get_int('config_isdescription', 'post', 0);
     $return['config']['ishtml'] = $nv_Request->get_int('config_ishtml', 'post', 0);
     $return['config']['ispubdate'] = $nv_Request->get_int('config_ispubdate', 'post', 0);
     $return['config']['istarget'] = $nv_Request->get_int('config_istarget', 'post', 0);
     $return['config']['title_length'] = $nv_Request->get_int('config_title_length', 'post', 0);
     if (!nv_is_url($return['config']['url'])) {
         $return['error'][] = $lang_block['error_url'];
     }
     return $return;
 }
开发者ID:nukeplus,项目名称:nuke,代码行数:26,代码来源:global.rss.php


示例5: view

function view($albumimg, $ialbum, $list_pages)
{
    global $module_info, $global_config, $module_file, $db, $lang_module, $lang_global, $module_name;
    $xtpl = new XTemplate("view.tpl", NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/" . $module_file);
    $i = 0;
    $num_per_rows = 4;
    $xtpl->assign('AL_NAME', $ialbum['name']);
    $xtpl->assign('NUM_PHOTO', $ialbum['num_photo']);
    $xtpl->assign('NUM_VIEW', $ialbum['num_view']);
    $xtpl->assign('NV_BASE_SITE', NV_BASE_SITEURL);
    $xtpl->assign('DES_AL', $ialbum['description']);
    while ($i < count($albumimg)) {
        for ($j = 0; $j < $num_per_rows; $j++) {
            $album = $albumimg[$i];
            $i++;
            if (!nv_is_url($album['path']) && $album['thumb_name'] != "") {
                $album['thumb_name'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name . "/" . $album['thumb_name'];
                $album['path'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name . $album['path'];
            } else {
                $album['thumb_name'] = NV_BASE_SITEURL . "themes/" . $global_config['site_theme'] . "/images/" . $module_name . "/no_image.gif";
                $album['path'] = NV_BASE_SITEURL . "themes/" . $global_config['site_theme'] . "/images/" . $module_name . "/no_image.gif";
            }
            $xtpl->assign('SRC', $album['thumb_name']);
            $xtpl->assign('SRC_LAGE', $album['path']);
            $xtpl->assign('DES', $album['description']);
            $xtpl->assign('NAME', $album['name']);
            //			$xtpl->assign('NUM_VIEW', $album['numview']);
            $xtpl->parse('main.row.album.img');
            $xtpl->parse('main.row.album');
            if ($i >= count($albumimg)) {
                break;
            }
        }
        $xtpl->parse('main.row');
    }
    $xtpl->assign('PAGES', $list_pages);
    if (!empty($list_pages)) {
        $xtpl->parse('main.pages');
    }
    $xtpl->parse('main');
    return $xtpl->text('main');
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:42,代码来源:theme.php


示例6: nv_block_news_groups

 function nv_block_news_groups($block_config)
 {
     global $module_array_cat, $module_info, $site_mods;
     $module = $block_config['module'];
     $sql = "SELECT t1.id, t1.catid, t1.title, t1.alias, t1.homeimgfile, t1.homeimgthumb,t1.hometext,t1.publtime FROM `" . NV_PREFIXLANG . "_" . $site_mods[$module]['module_data'] . "_rows` as t1 INNER JOIN `" . NV_PREFIXLANG . "_" . $site_mods[$module]['module_data'] . "_block` AS t2 ON t1.id = t2.id WHERE t2.bid= " . $block_config['blockid'] . " AND t1.status= 1 ORDER BY t2.weight ASC LIMIT 0 , " . $block_config['numrow'];
     $list = nv_db_cache($sql, '', $module);
     $i = 1;
     if (!empty($list)) {
         if (file_exists(NV_ROOTDIR . "/themes/" . $module_info['template'] . "/modules/news/block_groups.tpl")) {
             $block_theme = $module_info['template'];
         } else {
             $block_theme = "default";
         }
         $xtpl = new XTemplate("block_groups.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/modules/news");
         foreach ($list as $l) {
             $l['link'] = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module . "&amp;" . NV_OP_VARIABLE . "=" . $module_array_cat[$l['catid']]['alias'] . "/" . $l['alias'] . "-" . $l['id'];
             $l['thumb'] = "";
             if (!empty($l['homeimgthumb'])) {
                 $array_img = array();
                 $array_img = explode("|", $l['homeimgthumb']);
                 if ($array_img[0] != "" and file_exists(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module . '/' . $array_img[0])) {
                     $imgurl = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module . '/' . $array_img[0];
                     $l['thumb'] = $imgurl;
                 }
             } elseif (nv_is_url($l['homeimgfile'])) {
                 $l['thumb'] = $l['homeimgfile'];
             }
             $xtpl->assign('ROW', $l);
             if (!empty($l['thumb'])) {
                 $xtpl->parse('main.loop.img');
             }
             $xtpl->assign('bg', ++$i % 2 ? "bg" : "");
             $xtpl->parse('main.loop');
         }
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
 }
开发者ID:atarubi,项目名称:nuke-viet,代码行数:38,代码来源:global.block_groups.php


示例7: creat_thumbs

 function creat_thumbs($id, $homeimgfile, $module_name, $width = 200, $height = 150)
 {
     if ($width >= $height) {
         $rate = $width / $height;
     } else {
         $rate = $height / $width;
     }
     $image = NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . $homeimgfile;
     if ($homeimgfile != '' and file_exists($image)) {
         $imgsource = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_name . '/' . $homeimgfile;
         $imginfo = nv_is_image($image);
         $basename = $module_name . $width . 'x' . $height . '-' . $id . '-' . md5_file($image) . '.' . $imginfo['ext'];
         if (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $basename)) {
             $imgsource = NV_BASE_SITEURL . NV_TEMP_DIR . '/' . $basename;
         } else {
             require_once NV_ROOTDIR . '/includes/class/image.class.php';
             $_image = new image($image, NV_MAX_WIDTH, NV_MAX_HEIGHT);
             if ($imginfo['width'] <= $imginfo['height']) {
                 $_image->resizeXY($width, 0);
             } elseif ($imginfo['width'] / $imginfo['height'] < $rate) {
                 $_image->resizeXY($width, 0);
             } elseif ($imginfo['width'] / $imginfo['height'] >= $rate) {
                 $_image->resizeXY(0, $height);
             }
             $_image->cropFromCenter($width, $height);
             $_image->save(NV_ROOTDIR . '/' . NV_TEMP_DIR, $basename);
             if (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $basename)) {
                 $imgsource = NV_BASE_SITEURL . NV_TEMP_DIR . '/' . $basename;
             }
         }
     } elseif (nv_is_url($homeimgfile)) {
         $imgsource = $homeimgfile;
     } else {
         $imgsource = '';
     }
     return $imgsource;
 }
开发者ID:hoangvtien,项目名称:nukeviet_tab_catid,代码行数:37,代码来源:global.block_tab_catid.php


示例8: photos_thumbs

 function photos_thumbs($id, $file, $module_upload, $width = 270, $height = 210, $quality = 90)
 {
     if ($width >= $height) {
         $rate = $width / $height;
     } else {
         $rate = $height / $width;
     }
     $image = NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/images/' . $file;
     if ($file != '' and file_exists($image)) {
         $imgsource = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/images/' . $file;
         $imginfo = nv_is_image($image);
         $basename = $module_upload . '_' . $width . 'x' . $height . '-' . $id . '-' . md5_file($image) . '.' . $imginfo['ext'];
         if (file_exists(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename)) {
             $imgsource = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename;
         } else {
             $_image = new image($image, NV_MAX_WIDTH, NV_MAX_HEIGHT);
             if ($imginfo['width'] <= $imginfo['height']) {
                 $_image->resizeXY($width, 0);
             } elseif ($imginfo['width'] / $imginfo['height'] < $rate) {
                 $_image->resizeXY($width, 0);
             } elseif ($imginfo['width'] / $imginfo['height'] >= $rate) {
                 $_image->resizeXY(0, $height);
             }
             $_image->cropFromCenter($width, $height);
             $_image->save(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/', $basename, $quality);
             if (file_exists(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename)) {
                 $imgsource = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/thumbs/' . $basename;
             }
         }
     } elseif (nv_is_url($file)) {
         $imgsource = $file;
     } else {
         $imgsource = '';
     }
     return $imgsource;
 }
开发者ID:hoangvtien,项目名称:module-photos,代码行数:36,代码来源:global.block_album_new.php


示例9: rawurldecode

    }
    $url = rawurldecode($url);
    if ($is_myurl) {
        $url = substr($url, strlen(NV_BASE_SITEURL));
        $url = NV_ROOTDIR . '/' . $url;
        if (!file_exists($url)) {
            die($lang_module['file_checkUrl_error']);
        }
    } else {
        $url = trim($url);
        $url = nv_nl2br($url, '<br />');
        $url = explode('<br />', $url);
        $url = array_map('trim', $url);
        foreach ($url as $l) {
            if (!empty($l)) {
                if (!nv_is_url($l)) {
                    die($lang_module['file_checkUrl_error']);
                }
                if (!nv_check_url($l)) {
                    die($lang_module['file_checkUrl_error']);
                }
            }
        }
    }
    die($lang_module['file_checkUrl_ok']);
}
// Download file
if ($nv_Request->isset_request('fdownload', 'get')) {
    $file = $nv_Request->get_string('fdownload', 'get', '');
    if (!empty($file)) {
        $file = substr($file, strlen(NV_BASE_SITEURL));
开发者ID:htuyen1994,项目名称:module-download,代码行数:31,代码来源:admin.functions.php


示例10: nv_get_firstimage

            }
        }
        // Xu ly anh minh hoa
        $rowcontent['homeimgthumb'] = 0;
        if (empty($rowcontent['homeimgfile']) and ($rowcontent['imgposition'] == 1 or $rowcontent['imgposition'] == 2)) {
            $rowcontent['homeimgfile'] = nv_get_firstimage($rowcontent['bodyhtml']);
        }
        if (!nv_is_url($rowcontent['homeimgfile']) and nv_is_file($rowcontent['homeimgfile'], NV_UPLOADS_DIR . '/' . $module_upload) === true) {
            $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/');
            $rowcontent['homeimgfile'] = substr($rowcontent['homeimgfile'], $lu);
            if (file_exists(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module_upload . '/' . $rowcontent['homeimgfile'])) {
                $rowcontent['homeimgthumb'] = 1;
            } else {
                $rowcontent['homeimgthumb'] = 2;
            }
        } elseif (nv_is_url($rowcontent['homeimgfile'])) {
            $rowcontent['homeimgthumb'] = 3;
        } else {
            $rowcontent['homeimgfile'] = '';
        }
        if ($rowcontent['id'] == 0) {
            if (!defined('NV_IS_SPADMIN') and intval($rowcontent['publtime']) < NV_CURRENTTIME) {
                $rowcontent['publtime'] = NV_CURRENTTIME;
            }
            if ($rowcontent['status'] == 1 and $rowcontent['publtime'] > NV_CURRENTTIME) {
                $rowcontent['status'] = 2;
            }
            $sql = 'INSERT INTO ' . NV_PREFIXLANG . '_' . $module_data . '_rows
				(catid, listcatid, topicid, admin_id, author, sourceid, addtime, edittime, status, publtime, exptime, archive, title, alias, hometext, homeimgfile, homeimgalt, homeimgthumb, inhome, allowed_comm, allowed_rating, hitstotal, hitscm, total_rating, click_rating) VALUES
				 (' . intval($rowcontent['catid']) . ',
				 :listcatid,
开发者ID:hongoctrien,项目名称:nukeviet,代码行数:31,代码来源:content.php


示例11: filter_text_input

 $_user['gender'] = filter_text_input('gender', 'post', '', 1, 1);
 $_user['website'] = filter_text_input('website', 'post', '');
 $_user['location'] = filter_text_input('location', 'post', '', 1);
 $_user['yim'] = filter_text_input('yim', 'post', '', 1, 100);
 $_user['telephone'] = filter_text_input('telephone', 'post', '', 1, 100);
 $_user['fax'] = filter_text_input('fax', 'post', '', 1, 100);
 $_user['mobile'] = filter_text_input('mobile', 'post', '', 1, 100);
 $_user['view_mail'] = $nv_Request->get_int('view_mail', 'post', 0);
 $_user['sig'] = filter_text_textarea('sig', '', NV_ALLOWED_HTML_TAGS);
 $_user['birthday'] = filter_text_input('birthday', 'post', '', 1, 10);
 $_user['in_groups'] = $nv_Request->get_typed_array('group', 'post', 'int');
 if (!empty($_user['website'])) {
     if (!preg_match("#^(http|https|ftp|gopher)\\:\\/\\/#", $_user['website'])) {
         $_user['website'] = "http://" . $_user['website'];
     }
     if (!nv_is_url($_user['website'])) {
         $_user['website'] = "";
     }
 }
 if (($error_username = nv_check_valid_login($_user['username'], NV_UNICKMAX, NV_UNICKMIN)) != "") {
     $error = $error_username;
 } elseif ($_user['username'] != $db->fixdb($_user['username'])) {
     $error = sprintf($lang_module['account_deny_name'], '<strong>' . $_user['username'] . '</strong>');
 } elseif (($error_xemail = nv_check_valid_email($_user['email'])) != "") {
     $error = $error_xemail;
 } elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `md5username`=" . $db->dbescape(md5($_user['username'])))) != 0) {
     $error = $lang_module['edit_error_username_exist'];
 } elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `email`=" . $db->dbescape($_user['email']))) != 0) {
     $error = $lang_module['edit_error_email_exist'];
 } elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`=" . $db->dbescape($_user['email']))) != 0) {
     $error = $lang_module['edit_error_email_exist'];
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:user_add.php


示例12: elseif

    $rowcat['description'] = $description;
} elseif ($id > 0) {
    $query = $db->sql_query("SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `id`=" . $id . "");
    $rowcat = $db->sql_fetchrow($query);
    if ($rowcat['id'] > 0) {
        $page_title = $lang_module['weblink_edit_link'];
    }
}
if (empty($rowcat['id'])) {
    $page_title = $lang_module['weblink_add_link'];
}
$rowcat['description'] = defined('NV_EDITOR') ? nv_editor_br2nl($rowcat['description']) : nv_br2nl($rowcat['description']);
// dung de lay data tu CSDL
$rowcat['description'] = nv_htmlspecialchars($rowcat['description']);
// dung de dua vao editor
if (!empty($rowcat['urlimg']) and !nv_is_url($rowcat['urlimg'])) {
    $rowcat['urlimg'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $rowcat['urlimg'];
}
if (defined('NV_EDITOR')) {
    require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
$contents = "";
if ($error != "") {
    $contents .= "<div class=\"quote\" style=\"width:780px;\">\n";
    $contents .= "<blockquote class=\"error\"><span>" . $error . "</span></blockquote>\n";
    $contents .= "</div>\n";
    $contents .= "<div class=\"clear\"></div>\n";
}
$contents .= "<div id=\"list_mods\">";
$contents .= "<form action=\"" . NV_BASE_ADMINURL . "index.php\" method=\"post\">";
// post header parameter
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:content.php


示例13: substr

    if (!preg_match("/^([0-9]+)\$/", $array['sysGoogleAuthor'])) {
        $array['sysGoogleAuthor'] = '';
    }
    if (!preg_match("/^([0-9]+)\$/", $array['sysFbAppID'])) {
        $array['sysFbAppID'] = '';
    }
    if (!preg_match("/^([0-9]+)\$/", $array['sysFbAdminID'])) {
        $array['sysFbAdminID'] = '';
    }
    if (!empty($array['sysDefaultImage'])) {
        if (preg_match("/^\\//i", $array['sysDefaultImage'])) {
            $array['sysDefaultImage'] = substr($array['sysDefaultImage'], strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name));
            if (!is_file(NV_UPLOADS_REAL_DIR . '/' . $module_name . $array['sysDefaultImage'])) {
                $array['sysDefaultImage'] = '';
            }
        } elseif (!nv_is_url($array['sysDefaultImage'])) {
            $array['sysDefaultImage'] = '';
        }
    }
    foreach ($array as $config_name => $config_value) {
        $sql = "REPLACE INTO " . $BL->table_prefix . "_config VALUES (" . $db->quote($config_name) . "," . $db->quote($config_value) . ")";
        $db->query($sql);
    }
    nv_del_moduleCache($module_name);
    Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op);
    die;
}
$xtpl = new XTemplate("config-structured-data.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('GLANG', $lang_global);
$xtpl->assign('UPLOADS_PATH', NV_UPLOADS_DIR . '/' . $module_name);
开发者ID:hoangvtien,项目名称:blog,代码行数:31,代码来源:config-structured-data.php


示例14: nv_substr

 $data['id'] = $nv_Request->get_int('id', 'post', 0);
 $data['title'] = nv_substr($nv_Request->get_title('title', 'post', ''), 0, 255);
 $data['description'] = $nv_Request->get_editor('description', '', NV_ALLOWED_HTML_TAGS);
 $data['link'] = nv_substr($nv_Request->get_string('link', 'post', ''), 0, 255);
 $data['target'] = nv_substr($nv_Request->get_title('target', 'post', ''), 0, 10);
 $data['image'] = nv_substr($nv_Request->get_title('image', 'post', ''), 0, 255);
 $data['status'] = $nv_Request->get_int('status', 'post', 0) == 0 ? 0 : 1;
 $data['exptime'] = $nv_Request->get_int('exptime', 'post', 0);
 if (empty($data['title'])) {
     $error[] = array('name' => 'title', 'value' => $lang_module['content_title_error']);
 }
 if (!empty($data['link'])) {
     if (!preg_match("/\\:\\/\\//i", $data['link'])) {
         $data['link'] = 'http://' . $data['link'];
     }
     if (!nv_is_url($data['link'])) {
         $error[] = array('name' => 'link', 'value' => $lang_module['content_link_error']);
     }
 }
 // Prosess image
 if (is_file(NV_DOCUMENT_ROOT . $data['image'])) {
     $data['image'] = substr($data['image'], strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/'));
 } else {
     $data['image'] = '';
 }
 // Prosess time
 $data['start_time'] = $data['status'] ? NV_CURRENTTIME : 0;
 $data['end_time'] = $data['exptime'] ? $data['start_time'] + $data['exptime'] * 3600 : 0;
 if (empty($error)) {
     if ($data['id']) {
         $sql = 'UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_rows SET 
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:manager.php


示例15: elseif

     }
 } elseif (nv_is_url($rowcontent['homeimgfile'])) {
     $rowcontent['homeimgthumb'] = 3;
 } else {
     $rowcontent['homeimgfile'] = '';
 }
 // Xu ly Video link
 $rowcontent['vid_type'] = 0;
 if (!nv_is_url($rowcontent['vid_path']) and is_file(NV_DOCUMENT_ROOT . $rowcontent['vid_path'])) {
     $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/vid/');
     $rowcontent['vid_path'] = substr($rowcontent['vid_path'], $lu);
     if (file_exists(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/vid/' . $rowcontent['vid_path'])) {
         $rowcontent['vid_type'] = 1;
         //is uploaded file
     }
 } elseif (nv_is_url($rowcontent['vid_path'])) {
     if (is_youtube($rowcontent['vid_path'])) {
         $rowcontent['vid_type'] = 2;
         //is Youtube
     } elseif (is_picasa($rowcontent['vid_path'])) {
         $rowcontent['vid_type'] = 3;
         //is Picasa
     } elseif (is_facebook($rowcontent['vid_path'])) {
         $rowcontent['vid_type'] = 4;
         //is Facebook
     } else {
         $rowcontent['vid_type'] = 5;
         //hotlink from other site
     }
 } else {
     $rowcontent['vid_path'] = '';
开发者ID:webvangvn,项目名称:nv4_module_videos,代码行数:31,代码来源:content.php


示例16: array_unique

     $array['linkdirect'] = array_unique($array['linkdirect']);
 }
 $stmt = $db->prepare('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE title= :title ');
 $stmt->bindParam(':title', $array['title'], PDO::PARAM_STR);
 $stmt->execute();
 $is_exists = $stmt->fetchColumn();
 if (empty($array['title'])) {
     $is_error = true;
     $error = $lang_module['file_error_title'];
 } elseif ($is_exists) {
     $is_error = true;
     $error = $lang_module['file_title_exists'];
 } elseif (!empty($array['author_email']) and ($check_valid_email = nv_check_valid_email($array['author_email'])) != '') {
     $is_error = true;
     $error = $check_valid_email;
 } elseif (!empty($array['author_url']) and !nv_is_url($array['author_url'])) {
     $is_error = true;
     $error = $lang_module['file_error_author_url'];
 } elseif (empty($array['fileupload']) and empty($array['linkdirect']) and empty($array['fileupload2'])) {
     $is_error = true;
     $error = $lang_module['file_error_fileupload'];
 } else {
     $alias = change_alias($array['title']);
     $array['introtext'] = nv_nl2br($array['introtext'], '<br />');
     if ($row['user_id']) {
         $array['user_name'] = $row['user_name'];
     }
     if (!empty($array['fileupload2'])) {
         $array['fileupload'] = $array['fileupload2'];
     } elseif (!empty($array['fileupload'])) {
         $fileupload = $array['fileupload'];
开发者ID:ThinhNguyenVB,项目名称:module-download,代码行数:31,代码来源:filequeue.php


示例17: nv_news_block_news

 function nv_news_block_news($block_config, $mod_data)
 {
     global $module_array_cat, $module_info, $db, $module_config, $global_config;
     $module = 'news';
     $blockwidth = $module_config[$module]['blockwidth'];
     $show_no_image = $module_config[$module]['show_no_image'];
     $numrow = isset($block_config['numrow']) ? $block_config['numrow'] : 20;
     $cache_file = NV_LANG_DATA . '__block_news_' . $numrow . '_' . NV_CACHE_PREFIX . '.cache';
     if (($cache = nv_get_cache($module, $cache_file)) != false) {
         $array_block_news = unserialize($cache);
     } else {
         $array_block_news = array();
         $db->sqlreset()->select('id, catid, publtime, exptime, title, alias, homeimgthumb, homeimgfile, hometext')->from(NV_PREFIXLANG . '_' . $mod_data . '_rows')->where('status= 1')->order('publtime DESC')->limit($numrow);
         $result = $db->query($db->sql());
         while (list($id, $catid, $publtime, $exptime, $title, $alias, $homeimgthumb, $homeimgfile, $hometext) = $result->fetch(3)) {
             $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module . '&amp;' . NV_OP_VARIABLE . '=' . $module_array_cat[$catid]['alias'] . '/' . $alias . '-' . $id . $global_config['rewrite_exturl'];
             $array_block_news[] = array('id' => $id, 'title' => $title, 'link' => $link, 'homeimgfile' => $homeimgfile, 'width' => $blockwidth, 'hometext' => $hometext);
         }
         $cache = serialize($array_block_news);
         nv_set_cache($module, $cache_file, $cache);
     }
     if (file_exists(NV_ROOTDIR . '/themes/' . $module_info['template'] . '/blocks/block_news.tpl')) {
         $block_theme = $module_info['template'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('block_news.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/blocks/');
     $i = 1;
     foreach ($array_block_news as $array_news) {
         $array_news['hometext'] = nv_clean60($array_news['hometext'], 20);
         $image = NV_UPLOADS_REAL_DIR . '/' . $module . '/' . $array_news['homeimgfile'];
         if ($array_news['homeimgfile'] != '' and file_exists($image)) {
             if ($i == 1) {
                 $width = 370;
                 $height = 150;
             } else {
                 $width = 170;
                 $height = 115;
             }
             $array_news['imgurl'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_name . '/' . $array_news['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)) {
                     $array_news['imgurl'] = NV_BASE_SITEURL . NV_TEMP_DIR . '/' . $basename;
                 } else {
                     require_once NV_ROOTDIR . '/includes/class/image.class.php';
                     $_image = new image($image, NV_MAX_WIDTH, NV_MAX_HEIGHT);
                     $_image->cropFromCenter($width, $height);
                     $_image->save(NV_ROOTDIR . '/' . NV_TEMP_DIR, $basename);
                     if (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $basename)) {
                         $array_news['imgurl'] = NV_BASE_SITEURL . NV_TEMP_DIR . '/' . $basename;
                     }
                 }
             }
         } elseif (nv_is_url($array_news['homeimgfile'])) {
             $array_news['imgurl'] = $array_news['homeimgfile'];
         } elseif (!empty($module_config[$module_name]['show_no_image'])) {
             $array_news['imgurl'] = NV_BASE_SITEURL . $module_config[$module_name]['show_no_image'];
         } else {
             $array_news['imgurl'] = NV_BASE_SITEURL . 'themes/' . $global_config['site_theme'] . '/images/no-image.png';
         }
         $xtpl->assign('blocknews', $array_news);
         if ($i == 1) {
             $xtpl->parse('main.news_main');
         } else {
             $array_news['title0'] = nv_clean60($array_news['title'], 40);
             $xtpl->assign('blocknews', $array_news);
             $xtpl->assign('FL', $i % 2 != 0 ? 'right' : 'left');
             $xtpl->parse('main.newsloop');
         }
         $i++;
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
开发者ID:hongoctrien,项目名称:themes-newszine,代码行数:77,代码来源:global.block_news.php


示例18: array

    $stmt = $db->prepare("SELECT * FROM " . $db_config['prefix'] . "_" . $module_data . "_payment WHERE payment= :payment");
    $stmt->bindParam(':payment', $payment, PDO::PARAM_STR);
    $stmt->execute();
    $data_pay = $stmt->fetch();
}
if ($nv_Request->isset_request('saveconfigpaymentedit', 'post')) {
    $payment = $nv_Request->get_title('payment', 'post', '', 0);
    $paymentname = $nv_Request->get_title('paymentname', 'post', '', 0);
    $domain = $nv_Request->get_title('domain', 'post', '', 0);
    $images_button = $nv_Request->get_title('images_button', 'post', '', 0);
    $active = $nv_Request->get_int('active', 'post', 0);
    $array_config = $nv_Request->get_array('config', 'post', array());
    if (!nv_is_url($images_button) and file_exists(NV_DOCUMENT_ROOT . $images_button)) {
        $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/');
        $images_button = substr($images_button, $lu);
    } elseif (!nv_is_url($images_button)) {
        $images_button = '';
    }
    $stmt = $db->prepare("UPDATE " . $db_config['prefix'] . "_" . $module_data . "_payment SET paymentname = :paymentname, domain = :domain, active=" . $active . ", config = '" . nv_base64_encode(serialize($array_config)) . "',images_button= :images_button WHERE payment = :payment");
    $stmt->bindParam(':paymentname', $paymentname, PDO::PARAM_STR);
    $stmt->bindParam(':domain', $domain, PDO::PARAM_STR);
    $stmt->bindParam(':images_button', $images_button, PDO::PARAM_STR);
    $stmt->bindParam(':payment', $payment, PDO::PARAM_STR);
    $stmt->execute();
    nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_product', "edit " . $paymentname, $admin_info['userid']);
    nv_del_moduleCache($module_name);
    Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op);
}
$xtpl = new XTemplate("payport.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file);
$xtpl->assign('LANG', $lang_module);
$a = 0;
开发者ID:hoangvtien,项目名称:module-shops,代码行数:31,代码来源:payport.php


示例19: while

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nv_md5safe函数代码示例发布时间:2022-05-15
下一篇:
PHP nv_is_image函数代码示例发布时间: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