Esempio n. 1
0
/**
 * nv_loadDirList()
 *
 * @return void
 */
function nv_loadUploadDirList($return = true)
{
    $allow_upload_dir = array('images', NV_UPLOADS_DIR);
    $dirlistCache = NV_ROOTDIR . "/" . NV_FILES_DIR . "/dcache/dirlist-" . md5(implode($allow_upload_dir));
    $real_dirlist = array();
    foreach ($allow_upload_dir as $dir) {
        $real_dirlist = nv_listUploadDir($dir, $real_dirlist);
    }
    ksort($real_dirlist);
    file_put_contents($dirlistCache, serialize($real_dirlist));
    if ($return) {
        return $real_dirlist;
    }
}
Esempio n. 2
0
     } else {
         $content_sitemap = 'Sitemap: ' . NV_MY_DOMAIN . NV_BASE_SITEURL . 'index.php/SitemapIndex' . $global_config['rewrite_endurl'];
     }
     $contents = str_replace('Sitemap: http://yousite.com/?nv=SitemapIndex', $content_sitemap, $contents);
     file_put_contents(NV_ROOTDIR . '/robots.txt', $contents, LOCK_EX);
 }
 define('NV_IS_MODADMIN', true);
 $module_name = 'upload';
 $lang_global['mod_upload'] = 'upload';
 $global_config['upload_logo'] = '';
 define('NV_UPLOAD_GLOBALTABLE', $db_config['prefix'] . '_upload');
 define('SYSTEM_UPLOADS_DIR', NV_UPLOADS_DIR);
 require_once NV_ROOTDIR . '/' . NV_ADMINDIR . '/upload/functions.php';
 $real_dirlist = array();
 foreach ($allow_upload_dir as $dir) {
     $real_dirlist = nv_listUploadDir($dir, $real_dirlist);
 }
 foreach ($real_dirlist as $dirname) {
     try {
         $array_dirname[$dirname] = $db->insert_id("INSERT INTO " . NV_UPLOAD_GLOBALTABLE . "_dir (dirname, time, thumb_type, thumb_width, thumb_height, thumb_quality) VALUES ('" . $dirname . "', '0', '0', '0', '0', '0')", "did");
     } catch (PDOException $e) {
         trigger_error($e->getMessage());
     }
 }
 // Data Counter
 $db->query("INSERT INTO " . $db_config['prefix'] . "_counter VALUES ('c_time', 'start', 0, 0, 0)");
 $db->query("INSERT INTO " . $db_config['prefix'] . "_counter VALUES ('c_time', 'last', 0, 0, 0)");
 $db->query("INSERT INTO " . $db_config['prefix'] . "_counter VALUES ('total', 'hits', 0, 0, 0)");
 $year = date('Y');
 for ($i = 0; $i < 9; $i++) {
     $db->query("INSERT INTO " . $db_config['prefix'] . "_counter VALUES ('year', '" . $year . "', 0, 0, 0)");
Esempio n. 3
0
/**
 * nv_listUploadDir()
 *
 * @param mixed $dir
 * @param mixed $real_dirlist
 * @return
 */
function nv_listUploadDir($dir, $real_dirlist = array())
{
    $real_dirlist[] = $dir;
    if (($dh = @opendir(NV_ROOTDIR . '/' . $dir)) !== false) {
        while (false !== ($subdir = readdir($dh))) {
            if (preg_match('/^[a-zA-Z0-9\\-\\_]+$/', $subdir)) {
                if (is_dir(NV_ROOTDIR . '/' . $dir . '/' . $subdir)) {
                    $real_dirlist = nv_listUploadDir($dir . '/' . $subdir, $real_dirlist);
                }
            }
        }
        closedir($dh);
    }
    return $real_dirlist;
}