function rdir($path='.', $typearr=array('php', 'png')){ //返回指定目录的文件(子目录也是文件,一切皆文件)数组 $files = scandir($path); //var_dump($files); for($i=0; $i<count($files); $i++){ //因为文件标识中有‘.’和'..'表示路径应过滤 if($files[$i] != '.' && $files[$i] != '..'){ $newfile = $path . DIRECTORY_SEPARATOR. $files[$i]; //遍历目录 if(is_dir($newfile)){ rdir($newfile); } }else{ //取后缀,以'.'分割数组 $ftype = explode('.', $files[$i]); for($j=0; $j<count($typearr); $j++){ //分别匹配类型数组 if(strcasecmp(end($ftype), $typearr[$j])==0){ echo $files[$i].'<br />'; } } } } }
function rdir($path=".", $typearr=array('php','png')){ //返回指定目录的文件(子目录也是文件,一切皆文件)数组 $files = scandir($path); /* echo '<pre>'; print_r($files); echo '</pre>'; */ //定义全局变量 防止递归存储时候覆盖数据 global $arr; global $a; for($i=0;$i<count($files);$i++){ //因为文件标识中有'.'和'..'表示路径应过滤 if($files[$i] != "." && $files[$i] != ".."){ $newfile = $path . DIRECTORY_SEPARATOR . $files[$i];//拼接目标文件夹的路径 //①遍历子目录 if(is_dir($newfile)){ //②并递归 rdir($newfile); }else{ //取后缀,以'.'分割为数组 $ftype = explode(".",$files[$i]); for($j=0;$j<count($typearr);$j++){ //分别匹配类型数组 //用strcasecmp不区分大小写的比较 if(strcasecmp(end($ftype),$typearr[$j])==0){ //array_push($arr,$files[$i]); //用数组下标累进形式,防止数据递归被覆盖 $a++; $arr[$a]=$files[$i]; } } } } } return $arr; }
function rdir($path) { if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (is_file($path . $file)) { if ($file == 'del_ad.php') { continue; } del_ad($path . $file); } if (is_dir($path . $file)) { $path_tmp = $path . $file . '/'; rdir($path_tmp); } } } closedir($handle); } }
<?php } elseif (!$edition) { ?> <p style="text-align: center;"><br/>Only registered users and NC members can comment.<br/> <a href="<?php echo rurl(); ?> /register.php">Register here.</a><br/></p> <?php } ?> </div><!-- /comments --> </div><!-- /main --> </div><!-- /content--> <div id="footer"><?php include rdir() . '/includes/footer.inc.php'; ?> </div> <!-- /footer --> </div><!-- /container --> </div><!-- /wrapper --> <!-- Load javascript timers to update page --> <script>StartUp(<?php if (!empty($arrUser) && $arrUser['type'] != 'user') { echo '1'; } ?> )</script> </body> </html>
<script language="javascript" type="text/javascript" src="<?php echo rurl(); ?> /admin/js/datetimepicker_css.js"></script> <script type="text/javascript" src="<?php echo rurl(); ?> /js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <?php include rdir() . '/admin/includes/tinyMceFull.inc.php'; ?> <?php include rdir() . '/admin/includes/fancy.inc.php'; ?> <script type="text/javascript"> function ChangeOwner(formid) { <!-- Pass the post ownership to another admin/editor --> <!-- But first get confirmation --> var x=document.getElementById("Owner") //easy reference var i=x.selectedIndex var username=x.options[i].text var id=x.value var answer = confirm("Pass ownership to " + username + "?") if (answer) { // Change } else {
<p><?php echo $e; ?> </p> <?php } ?> </div> <?php } ?> <!-- /errors --> <div><!-- sidepanel include --> <?php include rdir() . '/includes/sidepanel.inc.php'; ?> </div> </div><!-- /"sidepanel" --> <div id="main"> <?php if (!empty($request) && $request == 'sent') { ?> <div style="background: url('css/art/white10.png'); padding: 1em;"> <h1>PASSWORD RESET REQUEST ACCEPTED</h1> <p>Check you email. We have sent you your username and instructions about reseting your password at <?php
include $_SERVER['DOCUMENT_ROOT'] . '/includes/head.inc.php'; ?> </head> <!-- Load javascript timers to update page --> <body onload='StartUp(<?php if (!empty($arrUser) && $arrUser['type'] != 'user') { echo '1'; } ?> )'> <div id="wrapper"> <div id="container"> <div id="header"><?php include rdir() . '/includes/header.inc.php'; ?> </div><!-- /header --> <div id="menu"> <?php include 'includes/menu.inc.php'; ?> <?php include 'includes/userlog.inc.php'; ?> </div> <div id="content"> <div id="sidepanel">
<?php session_start(); require_once '../admin/config.php'; require_once '../admin/functions.php'; require_once rdir() . '/admin/connect.php'; require_once rdir() . '/admin/isUser.php'; // db connection $dbConn = connect_db(); if (!empty($_SESSION['NC_user']) && !empty($_SESSION['NC_password'])) { $arrUser = isUser($_SESSION['NC_user'], $_SESSION['NC_password'], $dbConn); } // Number of comments to show $n = 10; if (empty($arrUser) || !empty($arrUser) && $arrUser['type'] == 'user') { // Get the Last Comments of public posts posts. $q = "SELECT idComment, comments.userId, postId, content, comments.date, username, title FROM comments INNER JOIN posts ON postId = idPost INNER JOIN users ON comments.userId = users.idUser WHERE posts.postFor = 'all' ORDER BY comments.date DESC LIMIT 0,{$n}"; } else { // Members, friends and admins can see all... $q = "SELECT idComment, comments.userId, postId, content, comments.date, username, title FROM comments INNER JOIN posts ON postId = idPost INNER JOIN users ON comments.userId = users.idUser ORDER BY comments.date DESC LIMIT 0,{$n}"; } if ($r = mysql_query($q, $dbConn)) { while ($commentrow = mysql_fetch_array($r)) { extract(strip_slashes_arr($commentrow), EXTR_PREFIX_ALL, "lastc"); $lastc_pic = get_user_pic($lastc_userId, 24); $lastc_title = '<a href="' . rurl() . '/post/' . $lastc_postId . '/' . friendly_str($lastc_title) . '">' . $lastc_title . '</a>'; $lastc_content = cut_string($lastc_content, 60); $lastc_content = '<a class="acomm" href="' . rurl() . '/post/' . $lastc_postId . '/' . friendly_str($lastc_title) . '#comm_' . $lastc_idComment . '">' . $lastc_content . '</a>'; echo '<div class="comment">'; echo '<p><img class="userpic" src="' . $lastc_pic . '" alt="' . $lastc_username . '" title="' . $lastc_username . '"/>'; echo '<strong>' . ' ' . $lastc_username . '</strong>, on ' . $lastc_title . ' says: ';
require_once $_SERVER['DOCUMENT_ROOT'] . '/admin/isUser.php'; // db connection $dbConn = connect_db(); // Is user connected? if (!empty($_SESSION['NC_user']) && !empty($_SESSION['NC_password'])) { $arrUser = isUser($_SESSION['NC_user'], $_SESSION['NC_password'], $dbConn); } else { go_home(); } // ONLY ADMINS, MEMBERS AND FRIENDS ARE ALLOWED. if (!empty($arrUser) && $arrUser['type'] == 'user') { go_home(); } // If the user is sending a message... if (!empty($_POST['message_post'])) { include rdir() . '/messages/send.php'; } elseif ($_SERVER['REQUEST_METHOD'] == 'GET') { //else try to GET recepient if (!empty($_GET['to'])) { $write_to = $_GET['to']; } // if trying to reply, get source message if (!empty($_GET['reply']) && isset($arrUser)) { $idMessage = $_GET['reply']; $idUser = $arrUser['idUser']; $q = "SELECT messages.from, subject, message, time FROM messages\n\t\t\t WHERE idMessage='{$idMessage}' AND messages.to='{$idUser}'\n\t\t\t LIMIT 1"; $r = mysql_query($q, $dbConn); if (mysql_num_rows($r) == 1) { $row = mysql_fetch_array($r); $write_to = $row['from']; $subject = 'RE: ' . $row['subject'];
// Erase tempdir if (is_dir($dirTmpUser)) { delete_dir($dirTmpUser); } header("Location: image-manager.php?dirImgs={$dirImgs}&imgs={$imgs}"); } // page info $location = rurl() . $_SERVER['REQUEST_URI']; $page_title = "NC image manager"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <?php include rdir() . '/edit/includes/head.inc.php'; ?> <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/scriptaculous.js" type="text/javascript"></script> <script src="<?php echo rurl(); ?> /js/cropper/cropper.js" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> <?php if (!empty($_POST['uploadSummary'])) { ?> var laX = 120; var laY = 64; var minX = 120; var minY = 64; <?php
imagedestroy($img); // Erase tempdir if (is_dir($dirTmpUser)) { delete_dir($dirTmpUser); } header("Location: image-manager.php?dirImgs={$dirImgs}&imgs={$imgs}"); } // page info $location = rurl() . $_SERVER['REQUEST_URI']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <?php include rdir() . '/admin/includes/head.inc.php'; ?> <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/scriptaculous.js" type="text/javascript"></script> <script src="<?php echo rurl(); ?> /js/cropper/cropper.js" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> <?php if (!empty($_POST['uploadSummary'])) { ?> var laX = 120; var laY = 64; var minX = 120; var minY = 64; <?php
<meta name="Distribution" content="Global"/> <meta name="Robots" content="All"/> <link rel="shortcut icon" href="<?php echo rurl(); ?> /favicon.ico"/> <!-- STYLE --> <link href='http://fonts.googleapis.com/css?family=Orbitron:400,500,700,900|Aldrich|Gochi+Hand' rel='stylesheet' type='text/css'/> <link rel="stylesheet" type="text/css" href="css/default.css"/> <link rel="stylesheet" type="text/css" href="css/style.css"/> <!-- /style --> <!-- Fancy --> <?php include rdir() . '/includes/fancy.inc.php'; ?> <!-- /Fancy --> <!-- timers & auto-updates --> <script language="javascript" type="text/javascript" src="/js/ajax-general.js"></script> <!-- /timers & auto-updates --> <!-- ANALYTICS --> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-27511799-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';