Esempio n. 1
0
 public function sayfaisle($gelen)
 {
     $dummy = '';
     while ($item = explode('[[ekle((', $gelen, 2)) {
         if (count($item) < 2) {
             $dummy .= $item[0];
             break;
         }
         $dummy .= $item[0];
         $item = explode('))]]', $item[1], 2);
         $dummy .= file_get_contents(getDir('index.php') . "yonetim/sablon/" . $item[0]);
         $gelen = $item[1];
     }
     $gelen = $dummy;
     while ($item = explode('[[', $gelen, 2)) {
         if (count($item) < 2) {
             echo $item[0];
             break;
         }
         echo $item[0];
         $item = explode(']]', $item[1], 2);
         $gelen = $item[1];
         $this->calistir($item[0]);
     }
 }
Esempio n. 2
0
function listFile(&$result, $path)
{
    if (!getDir($link, $path)) {
        return false;
    }
    while (($entry = readdir($link)) !== false) {
        if ($entry == "." || $entry == "..") {
            continue;
        }
        if (is_dir($path . '/' . $entry)) {
            // recherche des fichiers dans le sous-dossier suivant
            listFile($result, $path . '/' . $entry);
        } else {
            if (is_file($path . '/' . $entry)) {
                if (preg_match('/.*\\.avi$/', $entry)) {
                    $result[] = array($path . '/', $entry);
                }
            }
            continue;
        }
    }
    if (empty($result)) {
        return false;
    }
    return true;
}
Esempio n. 3
0
 public function listen(Dispatcher $events)
 {
     $events->listen(RegisterLocales::class, function (RegisterLocales $event) {
         function getDir($dir)
         {
             $dirArray[] = NULL;
             if (false != ($handle = opendir($dir))) {
                 $i = 0;
                 while (false !== ($file = readdir($handle))) {
                     if ($file != "." && $file != ".." && !strpos($file, ".")) {
                         $dirArray[$i] = $file;
                         $i++;
                     }
                 }
                 closedir($handle);
             }
             return $dirArray;
         }
         $extensions_enabled = app('Flarum\\Core\\Settings\\SettingsRepository')->get('extensions_enabled');
         $localePath = __DIR__ . '/../locale/';
         $arr = json_decode($extensions_enabled, true);
         if ($key = array_search('i18n', $arr)) {
             unset($arr[$key]);
         }
         foreach (getDir($localePath) as $v) {
             $coreYml = $localePath . $v . '/core.yml';
             $array = Yaml::parse(file_get_contents(__DIR__ . '/languagecodes.yml'));
             if (file_exists($coreYml)) {
                 preg_match('/\\/locale\\/(.*?)\\//i', $coreYml, $languagecodes);
                 $languagecodes = $languagecodes[1];
                 $languagename = $array[$languagecodes];
                 $event->manager->addLocale($languagecodes, $languagename);
                 $event->manager->addJsFile($languagecodes, $localePath . $languagecodes . '/core.js');
                 $event->manager->addConfig($languagecodes, $localePath . $languagecodes . '/core.php');
                 $event->addTranslations($languagecodes, $localePath . $languagecodes . '/core.yml');
                 foreach ($arr as $extensions) {
                     $localeYml = $localePath . $languagecodes . '/' . $extensions . '.yml';
                     $enYml = getcwd() . '/extensions/' . $extensions . '/locale/en.yml';
                     if (file_exists($localeYml)) {
                         $event->addTranslations($languagecodes, $localeYml);
                     } else {
                         if (file_exists($enYml)) {
                             $event->addTranslations($languagecodes, $enYml);
                         }
                     }
                 }
             }
         }
     });
 }
Esempio n. 4
0
 function getDir($dir)
 {
     $fileArr = array();
     $dp = opendir($dir);
     while (($file = readdir($dp)) != false) {
         if ($file != "." and $file != ".." and $file != "") {
             if (is_dir($dir . "/" . $file)) {
                 $fileArr = array_merge($fileArr, getDir($dir . "/" . $file));
                 $fileArr[] = $dir . "/" . $file;
             }
         }
     }
     closedir($dp);
     return $fileArr;
 }
Esempio n. 5
0
 public function set()
 {
     if ($_SESSION["wadmin"] && in_array(1, $this->group_json)) {
         $result = R("Api/Api/getsetting");
         $this->assign("info", $result);
         $themedir = getDir("./Application/Tpl/App");
         for ($i = 0; $i < count($themedir); $i++) {
             $theme[$i] = simplexml_load_file("./Application/Tpl/App" . $themedir[$i] . "/config.xml");
             if (isset($theme[$i])) {
                 $theme[$i]->dir = $themedir[$i];
             }
         }
         $this->assign("theme", $theme);
         $this->assign("settheme", $result["theme"]);
         $payresult = R("Api/Api/getalipay");
         $this->assign("alipay", $payresult);
         $buyday = 0;
         if (file_exists('./Public/Conf/buyday.php')) {
             require './Public/Conf/buyday.php';
         }
         $this->assign("buyday", $buyday);
         $result = M("Admin")->select();
         $group_des = array();
         $group_des[1] = '商城设置';
         $group_des[2] = '商品分类';
         $group_des[3] = '商品管理';
         $group_des[4] = '订单管理';
         $group_des[5] = '用户管理';
         $group_des[6] = '微信管理';
         $group_des[7] = '提现管理';
         foreach ($result as $key => $info) {
             if (file_exists("./Public/Conf/group_" . $info["username"] . ".php")) {
                 require "./Public/Conf/group_" . $info["username"] . ".php";
                 $group_json = json_decode($group_json);
             } else {
                 $group_json = array(1, 2, 3, 4, 5, 6, 7);
             }
             $group = '';
             foreach ($group_json as $json_info) {
                 $group .= $group_des[$json_info] . '|';
             }
             $result[$key]['group'] = $group;
         }
         $this->assign("result", $result);
         $this->display();
     }
 }
Esempio n. 6
0
function getAllFile($dir = '')
{
    def($dir, './');
    $output = array();
    foreach (getDir("dir: {$dir}, is_file:1, full:1") as $key => $val) {
        if (preg_match("/(addon|file|sfile|image)\$/i", $val)) {
            continue;
        }
        if (is_dir($val)) {
            $output = array_merge($output, getAllFile($val));
        } else {
            if (preg_match("/\\.(js|css|php|html|mini)\$/i", basename($val))) {
                $output[] = $val;
            }
        }
    }
    return $output;
}
Esempio n. 7
0
 public function set()
 {
     if ($_SESSION["wadmin"]) {
         $result = R("Api/Api/getsetting");
         $this->assign("info", $result);
         $themedir = getDir("./Application/Tpl/App");
         for ($i = 0; $i < count($themedir); $i++) {
             $theme[$i] = simplexml_load_file("./Application/Tpl/App" . $themedir[$i] . "/config.xml");
             if (isset($theme[$i])) {
                 $theme[$i]->dir = $themedir[$i];
             }
         }
         $this->assign("theme", $theme);
         $this->assign("settheme", $result["theme"]);
         $payresult = R("Api/Api/getalipay");
         $this->assign("alipay", $payresult);
         $this->display();
     }
 }
Esempio n. 8
0
function getDir($path, $filter, $recursive, &$result, $ignore)
{
    foreach (glob($path . '/*', GLOB_ONLYDIR) as $dir) {
        if ($dir == '.' | $dir == '..' | ignored($dir, $ignore)) {
            continue;
        }
        foreach (glob($dir . '/' . $filter) as $file) {
            if (ignored($file, $ignore)) {
                continue;
            }
            $f[] = slash(str_replace($_SERVER['DOCUMENT_ROOT'], '/', $file), false);
        }
        if (count($f) > 0) {
            $result[] = array('DIR' => slash(str_replace($_SERVER['DOCUMENT_ROOT'], '/', $dir)), 'FILES' => $f);
        }
        if ($recursive) {
            if (getDir($dir, $filter, $recursive, $result, $ignore) === false) {
                return false;
            }
        }
    }
    return true;
}
Esempio n. 9
0
function makeWeatherSidebar()
{
    global $forecast_api;
    global $weather_lat;
    global $weather_long;
    $forecastExcludes = '?exclude=flags';
    // Take a look at https://developer.forecast.io/docs/v2 to configure your weather information.
    $currentForecast = json_decode(file_get_contents('https://api.forecast.io/forecast/' . $forecast_api . '/' . $weather_lat . ',' . $weather_long . $forecastExcludes));
    $currentSummary = $currentForecast->currently->summary;
    $currentSummaryIcon = $currentForecast->currently->icon;
    $currentTemp = round($currentForecast->currently->temperature);
    $currentWindSpeed = round($currentForecast->currently->windSpeed);
    if ($currentWindSpeed > 0) {
        $currentWindBearing = $currentForecast->currently->windBearing;
    }
    $minutelySummary = $currentForecast->minutely->summary;
    $hourlySummary = $currentForecast->hourly->summary;
    $sunriseTime = $currentForecast->daily->data[0]->sunriseTime;
    $sunsetTime = $currentForecast->daily->data[0]->sunsetTime;
    if ($sunriseTime > time()) {
        $rises = 'Rises';
    } else {
        $rises = 'Rose';
    }
    if ($sunsetTime > time()) {
        $sets = 'Sets';
    } else {
        $sets = 'Set';
    }
    // If there are alerts, make the alerts variables
    if (isset($currentForecast->alerts)) {
        $alertTitle = $currentForecast->alerts[0]->title;
        $alertExpires = $currentForecast->alerts[0]->expires;
        $alertDescription = $currentForecast->alerts[0]->description;
        $alertUri = $currentForecast->alerts[0]->uri;
    }
    // Make the array for weather icons
    $weatherIcons = ['clear-day' => 'B', 'clear-night' => 'C', 'rain' => 'R', 'snow' => 'W', 'sleet' => 'X', 'wind' => 'F', 'fog' => 'L', 'cloudy' => 'N', 'partly-cloudy-day' => 'H', 'partly-cloudy-night' => 'I'];
    $weatherIcon = $weatherIcons[$currentSummaryIcon];
    // If there is a severe weather warning, display it
    //if (isset($currentForecast->alerts)) {
    //	echo '<div class="alert alert-warning alert-dismissable">';
    //	echo '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
    //	echo '<strong><a href="'.$alertUri.'" class="alert-link">'.$alertTitle.'</a></strong>';
    //	echo '</div>';
    //}
    echo '<ul class="list-inline" style="margin-bottom:-20px">';
    echo '<li><h1 data-icon="' . $weatherIcon . '" style="font-size:500%;margin:0px -10px 20px -5px"></h1></li>';
    echo '<li><ul class="list-unstyled">';
    echo '<li><h1 class="exoregular" style="margin:0px">' . $currentTemp . '°</h1></li>';
    echo '<li><h4 class="exoregular" style="margin:0px;padding-right:10px;width:80px">' . $currentSummary . '</h4></li>';
    echo '</ul></li>';
    echo '</ul>';
    if ($currentWindSpeed > 0) {
        $direction = getDir($currentWindBearing);
        echo '<h4 class="exoextralight" style="margin-top:0px">Wind: ' . $currentWindSpeed . ' mph from the ' . $direction . '</h4>';
    } else {
        echo '<h4 class="exoextralight" style="margin-top:0px">Wind: Calm</h4>';
    }
    echo '<h4 class="exoregular">Next Hour</h4>';
    echo '<h5 class="exoextralight" style="margin-top:10px">' . $minutelySummary . '</h5>';
    echo '<h4 class="exoregular">Next 24 Hours</h4>';
    echo '<h5 class="exoextralight" style="margin-top:10px">' . $hourlySummary . '</h5>';
    echo '<h4 class="exoregular">The Sun</h4>';
    echo '<h5 class="exoextralight" style="margin-top:10px">' . $rises . ' at ' . date('g:i A', $sunriseTime) . '</h5>';
    echo '<h5 class="exoextralight" style="margin-top:10px">' . $sets . ' at ' . date('g:i A', $sunsetTime) . '</h5>';
    echo '<p class="text-right no-link-color" style="margin-bottom:-10px"><small><a href="http://forecast.io/#/f/' . $weather_lat . ',' . $weather_long . '">Forecast.io</a></small></p> ';
}
Esempio n. 10
0
    $mp3file->getid3($filename);
    echo "<tr>";
    // album tag
    echo "<p><td><b>{$mp3file->album}</b></td>\n";
    // title tag
    echo "<td><a href=" . $rootMP3URL . "/" . htmlentities(str_replace(" ", "%20", $filename)) . ">" . str_replace("_", " ", $mp3file->title) . "</a></td>\n";
    // composer tag
    echo "<p><td><b>{$mp3file->artist}</b></td>\n";
    echo "<td><i>" . date("r", $filedate) . "</i></td>\n";
    echo "<td><i>" . filesize($filename) . " (bytes)</i></td>\n";
    echo "<p><td>{$mp3file->mime_type}</td>\n";
    print "</tr>\n";
    $maxFeed--;
}
print "</table>\n";
$dirArray = getDir(".", $sftypes);
// Get a list of the current directory
while (list($filename, $filedate) = each($dirArray) and $maxFeed > 0) {
    echo "<p>&nbsp;</p>\n";
}
echo "<p>&nbsp;</p>\n";
echo "<p>&nbsp;</p>\n";
// Functions and Classes
function stripJunk($text)
{
    // Strip non-text characters
    for ($c = 0; $c < strlen($text); $c++) {
        if (ord($text[$c]) >= 32 and ord($text[$c]) <= 122) {
            $outText .= $text[$c];
        }
    }
Esempio n. 11
0
    // create a photoset?
    print 'Create a photoset [y/N] ';
    if ('y' == substr(trim(fgets(STDIN)), 0, 1)) {
        $setName = basename($dir);
        print "Photos will be added to a new photoset named '{$setName}'.\n\n";
    } else {
        $setName = null;
        print "No photoset will be created.\n\n";
    }
    return $setName;
}
$api = getApi();
// the idea of this regular expression is that the camera file name
// starts with 3 or 4 characters, followed by 4 or 5 digits. if i've
// renamed it it would have a space, underscore or hyphen (that we'll
// ignore) and then any number of characters before ending with a period
// and then 3 character file extension.
$pattern = '/\\S{3,4}\\d{4,5}[ _-]?(.*)\\.\\S{3}/';
// the idea of this one is a two digit number, _ or - and then
// the name.jpg
#$pattern = '/\d{1,2}[ _-]?(.*)\.\S{3}/';
$dir = getDir();
// ... let the user know what we've figured out
$user = new Phlickr_AuthedUser($api);
$userName = $user->getName();
print "Uploading all the photos in '{$dir}' to {$userName}'s stream\n\n";
$batcher = new CommandlineBatchUploader($dir, $pattern, getSetName($dir));
$uploader = new Phlickr_Uploader($api);
$uploader->setTags(getTags());
$uploader->uploadBatch($batcher, new Phlickr_TextUi_UploaderListener());
exit(0);
Esempio n. 12
0
require_once 'Library/Parsedown/Parsedown.php';
/* ------------------------------------- 以下 为正式代码 --------------------------------------- */
if (isLogin()) {
    // 已登陆
    // 接收参数
    $class = htmlspecialchars($_GET['class']);
    $file = htmlspecialchars($_GET['file']);
    /* 获取目录数据 */
    if ($class) {
        $menus = getFile(__API__ . '/' . $class);
        if ($menus) {
            asort($menus);
        }
        $menus = $menus ?: $menus;
    } else {
        $directory = getDir(__API__);
        $menus = array();
        if ($directory) {
            asort($directory);
            foreach ($directory as $k => $v) {
                $file = getFile(__API__ . '/' . $v);
                $menus[$k]['num'] = count($file);
                $menus[$k]['name'] = $v;
            }
        } else {
            $menus = $directory;
        }
    }
    /* 读取解析文档内容 */
    if ($file) {
        $file_name = __API__ . '/' . $class . '/' . $file;
Esempio n. 13
0
<?php

require_once 'core/intit.php';
$link = new Link();
$db = DBContent::connect();
$allContent = $db->get('content');
?>
<!DOCTYPE html>
<html dir="<?php 
getDir();
?>
">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
        <meta charset="UTF-8">

        <title><?php 
__('multilingual php library');
?>
</title>

        <link href="assets/css/bootstrap.css" type="text/css" rel="stylesheet">
        <link href="assets/css/bootstrap.min.css" type="text/css" rel="stylesheet">
        <link href="assets/css/heroic-features.css" type="text/css" rel="stylesheet">
        <link href="assets/css/sweet-alert.css" type="text/css" rel="stylesheet">

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
Esempio n. 14
0
    function compile(url){\$.get('/index.php?r='+url, function (r){
        \$('#main').append('<p>compile <a href="/web/'+url+'.html">web/'+url+'.html</a>,success</p>')
        })}
    for (index in data){
        compile(data[index])
    }
    </script>

    </body>
    </html>

EOF;
}
if ($router == VIEW_LIST) {
    $files = getDir(PATH_VIEWS, 'html');
    $data = [];
    foreach ($files as $f) {
        $data[] = substr($f, 0, strpos($f, ".html"));
    }
    $data = json_encode($data);
    echo html($data);
} else {
    $file = PATH_VIEWS . $router . ".html";
    if (is_file($file)) {
        extract(loadConfig($file));
        ob_start();
        include $file;
        $content = template(ob_get_contents());
        ob_end_clean();
        $content = preg_replace("/---[\\d\\D]*?---/", '', $content, 1);
Esempio n. 15
0
function delete($setup)
{
    //Get the image ID
    $id = htmlentities($setup['imageId']);
    //Check the file extension to make sure that it's valid
    checkExtension($id);
    //Get the directory to get the images from
    $dir = getDir($setup);
    //Make sure that it is actually a directory
    checkImageDirectoryExists($dir);
    //Check to make sure that the image actually exists
    if (imageExists($dir . '/' . $id)) {
        //Delete the file
        unlink($dir . '/' . $id);
        echo json_encode(['success' => true, 'message' => 'Image successfully deleted.']);
        exit;
    } else {
        echo json_encode(['success' => false, 'message' => 'That image could not be found.']);
        exit;
    }
}
Esempio n. 16
0
        case 'delfile':
            unlink(FLGR_FILES . '/' . $_POST['name']);
            break;
        case 'upload':
            if (isset($_FILES["file"]["error"])) {
                // Create picture link
                if ($_FILES['file']['error'] != 4) {
                    // Save
                    move_uploaded_file($_FILES["file"]["tmp_name"], FLGR_FILES . '/' . $_FILES['file']['name']);
                    //chmod($path.'/'.$_FILES["file"]["name"], 0777);
                } else {
                    echo 'error upload';
                }
            } else {
                echo 'interface error';
            }
            break;
    }
}
// GET
$tpl = new KTemplate(FLGR_CMS_TEMPLATES . '/files.htm');
$aFiles = getDir(FLGR_FILES);
foreach ($aFiles as $v) {
    $tplFiles = $tpl->fetchBlock('Files');
    $tplFiles->assign('filename', $v);
    $tpl->assign('Files', $tplFiles);
    $tplFiles->reset();
}
// OUT
$_t->assign('BreadCrumbs', $BreadCrumbs->getBreadCrumbs());
$_t->assign('content', $tpl);
Esempio n. 17
0
                $dirArray[$i] = $file;
                $i++;
            }
        }
        //关闭句柄
        closedir($handle);
    }
    return $dirArray;
}
function getFile($dir)
{
    $fileArray[] = NULL;
    if (false != ($handle = opendir($dir))) {
        $i = 0;
        while (false !== ($file = readdir($handle))) {
            //去掉"“.”、“..”以及带“.xxx”后缀的文件
            if ($file != "." && $file != ".." && strpos($file, ".")) {
                $fileArray[$i] = "./imageroot/current/" . $file;
                if ($i == 100) {
                    break;
                }
                $i++;
            }
        }
        //关闭句柄
        closedir($handle);
    }
    return $fileArray;
}
var_dump(getDir("../"));
var_dump(getFile("../"));
Esempio n. 18
0
        } else {
            $error = "Fehler: Unbekannte Quelle angegeben<br>";
            echo create_footer("{$error}");
            exit(0);
        }
    }
}
if (!file_exists($dirSource)) {
    $error = "Das Verzeichnis {$dirSource} ist nicht vorhanden oder kein Zugriff m&ouml;glich<br>";
    echo create_footer("{$error}");
    exit(0);
}
echo "<br>Lese das Verzeichnis {$dirSource} ein!<br>";
$_SESSION[$target] = array();
$studentnr = 1;
getDir($dirSource, "MAINDIRECTORY", $target);
//Sort DATA
function compare_picfile($a, $b)
{
    return strcmp(strtolower($a["picfile"]), strtolower($b["picfile"]));
}
uasort($_SESSION[$target], "compare_picfile");
$_SESSION[$target . "_size"] = sizeof($_SESSION[$target]);
echo "<br>Gefundene Eintr&auml;ge: " . $_SESSION[$target . "_size"] . "<br>";
//preecho($_SESSION[$target]["sortbygeb"]);
echo "<br><a href='matching_index.php'> Zur&uuml;ck </a><br>";
$body = "<br>IP:" . $_SERVER["REMOTE_ADDR"] . "<br>";
echo create_footer("{$body}");
?>

Esempio n. 19
0
    print "</channel>\n</rss>\n";
    exit;
}
// Determine running mode to generate each podcast/ item listing
if ($remoteMedia) {
    //$remoteMedia = 1, new as of version .09i
    // Get override text names and dates files pointing to remote media
    $dirArray = getDir($overrideFolder, $overrideFileType);
    // sort the array by override bubDate or filedate if non
    $dirArray = sortByPubdate($dirArray);
    // Create the individual items/podcast tags
    remoteMedia($dirArray, $maxFeeds, $delim1, $sftypes, $overrideFileType, $aItemsEmpty, $rootMP3URL, $ownerEmailTAG, $timeAdjstMinus, $timeAdjstPlus, $keywordTAG, $imageItemTAG, $linkTAG, $enclosurePrefix, $imageUrlTAG, $imageTitleTAG);
} else {
    //$remoteMedia = 0, same logic as older version and ver i
    // process local media and any overrides
    $dirArray = getDir($mediaDir, $sftypes);
    // sort the array by override pubDate or filedate if non
    $dirArray = nonRemotesortByPubdate($dirArray, $delim1, $sftypes, $overrideFolder, $overrideFileType);
    // Create the individual items/podcast tags
    nonRemoteMedia($dirArray, $maxFeeds, $delim1, $sftypes, $overrideFileType, $aItemsEmpty, $rootMP3URL, $ownerEmailTAG, $timeAdjstMinus, $timeAdjstPlus, $keywordTAG, $imageItemTAG, $linkTAG, $overrideFolder, $imageUrlTAG, $imageTitleTAG);
}
// end remote or not
// channel close / rss close
print "</channel>\n</rss>\n";
/*
 * Functions and Classes
 */
// patch for dates returned with 1 digit day of month with leading space
function fixDate($filedate)
{
    if (strPos($filedate, '  ') !== FALSE) {
Esempio n. 20
0
    include 'closeDB.php';
}
function insertFile($filePath)
{
    include 'openDB.php';
    $key = hash('sha256', $filePath);
    $user = $_SESSION['user'];
    $insert = $db->prepare("insert into files (file, key, users) values ('{$filePath}', '{$key}', '{$user}')");
    $insert->execute();
    include 'closeDB.php';
}
session_start();
if (isset($_SESSION['user']) && isset($_POST['dir'])) {
    include 'config.php';
    include 'auth.php';
    $uploadDir = getDir($_POST['dir']);
    if (!auth('dir', $_SESSION['user'], $uploadDir)) {
        header('Location: /logout.php');
    }
    $errors = array();
    $file_name = $_FILES['uploadFile']['name'];
    $file_size = $_FILES['uploadFile']['size'];
    $file_tmp = $_FILES['uploadFile']['tmp_name'];
    $file_type = $_FILES['uploadFile']['type'];
    if ($file_size > $maxUploadSize) {
        $errors[] = "File is too large";
    }
    if (empty($errors) == true) {
        move_uploaded_file($file_tmp, $uploadDir . $file_name);
        insertFile($uploadDir . $file_name);
    }
Esempio n. 21
0
**  https://creativecommons.org/publicdomain/zero/1.0/
*/
include "yonetim/inc/sistem/functions.php";
if ($_POST['yorum']) {
    $mid = current($db->query("SELECT id FROM makaleler WHERE url = '{$_REQUEST['url']}'")->fetch_row());
    if ($mid) {
        $db->query("INSERT INTO yorumlar (mid, yorum, isim, eposta, web) VALUES(\n                {$mid},\n                '" . sql_filtre(htmlspecialchars(s_addslashes($_POST['yorum']))) . "',\n                '" . sql_filtre(htmlspecialchars(s_addslashes($_POST['isim']))) . "',\n                '" . sql_filtre(htmlspecialchars(s_addslashes($_POST['eposta']))) . "',\n                '" . sql_filtre(htmlspecialchars(s_addslashes($_POST['web']))) . "'\n            )");
    }
    header('location: ' . $site->sb['anadizin'] . $_REQUEST['url'] . '.html');
    return;
}
if ($_REQUEST['url']) {
    $site->makale($_REQUEST['url']);
    $dosya = getDir('index.php') . "yonetim/sablon/" . $site->url['sablon'];
} else {
    $dosya = getDir('index.php') . "yonetim/sablon/" . $anasayfasablon;
}
/* Log tutalım ileride lazım olur... */
$log_sayfa = 'anasayfa';
if ($_GET['ara']) {
    $log_sayfa = 'arama';
    $log_terim = $_GET['ara'];
}
if ($_GET['etiket']) {
    $log_sayfa = 'etiket';
    $log_terim = $_GET['etiket'];
}
$log_mid = $site->url['id'];
if ($log_mid) {
    $log_sayfa = 'makale';
    $log_terim = '';
Esempio n. 22
0
function getAppDir()
{
    $script = $_SERVER["SCRIPT_FILENAME"];
    return getDir($script);
}
Esempio n. 23
0
function makeBody()
{
    // The main body, contains either a file list or an edit form.
    $str = "";
    if (empty($_REQUEST['act'])) {
        // No action set - we show a list of files.
        $files = getFileList(getDir());
        if (!is_array($files)) {
            // List couldn't be fetched. Throw error.
            redirect("status=dirfail");
        } else {
            // Show list of files in a table.
            $str .= "<table id='filelist'>";
            $str .= "<thead><tr><th colspan=\"3\">File list</th>";
            $str .= "</tr></thead>";
            $str .= "<tbody>";
            if (count($files) <= 0) {
                $str .= "<tr><td colspan='3' class='error'>Directory is empty.</td></tr>";
            } else {
                $i = 0;
                $previous = $files[0]['type'];
                foreach ($files as $c) {
                    if ($c['writeable']) {
                        $class = "show writeable ";
                    } else {
                        $class = "";
                    }
                    if ($c['edit']) {
                        $class .= " edit ";
                    } else {
                        $class .= "";
                    }
                    if ($i % 2 != 0) {
                        $odd = "odd";
                    } else {
                        $odd = "";
                    }
                    if ($previous != $c['type']) {
                        // Insert seperator.
                        $odd .= " seperator ";
                    }
                    $previous = $c['type'];
                    $str .= "<tr class='{$c['type']} {$odd}'>";
                    if ($c['writeable'] && DISABLEFILEACTIONS == FALSE) {
                        $str .= "<td class='details'><span class='{$class}'>&loz;</span><span class='hide' style='display:none;'>&loz;</span></td>";
                    } else {
                        $str .= "<td class='details'>&nbsp;</td>";
                    }
                    if ($c['type'] == "file") {
                        $str .= "<td class='name'><a href=\"" . getDir() . "/{$c['name']}\">{$c['name']}</a></td><td class='size'>" . niceFileSize($c['size']);
                    } else {
                        $str .= "<td class='name'>" . makeLink($c['name'], "dir={$_REQUEST['dir']}/{$c['name']}", "Show files in this directory") . "</td><td class='size'>{$c['size']} files";
                    }
                    // $str .= "</td><td>".date(DATEFORMAT, $c['modified'])."</td></tr>";
                    $str .= "</td></tr>";
                    $i++;
                }
            }
            $str .= "</tbody><tfoot><tr><td colspan=\"3\">" . count($files) . " files and folders</td></tr></tfoot>";
            $str .= "</table>";
        }
    } elseif ($_REQUEST['act'] == "edit") {
        $_REQUEST['file'] = trim(stripslashes($_REQUEST['file']));
        $str = "<h2>Edit file: {$_REQUEST['file']}</h2>";
        // Check that file exists and that it's writeable.
        if (is_writeable(getDir() . "/" . $_REQUEST['file'])) {
            // Check that filetype is editable.
            if (checkforedit($_REQUEST['file'])) {
                // Get file contents.
                $filecontent = implode("", file(getDir() . "/{$_REQUEST["file"]}"));
                $filecontent = htmlentities($filecontent);
                if (CONVERTTABS == TRUE) {
                    $filecontent = str_replace("\t", "    ", $filecontent);
                }
                // Make form.
                $str .= '<form id="edit" action="' . getSelf() . '" method="post">
					<div>
						<textarea cols="76" rows="20" name="filecontent">' . $filecontent . '</textarea>
					</div>
					<div>
						<input type="hidden" name="file" value="' . $_REQUEST['file'] . '" />
						<input type="hidden" name="dir" value="' . $_REQUEST['dir'] . '" />
						<input type="hidden" name="act" value="savefile" />
						<input type="submit" value="Save file" name="submit" />
						<input type="submit" value="Cancel" name="submit" />
						<input type="checkbox" name="convertspaces" id="convertspaces" checked="checked" /> <label for="convertspaces">Convert spaces to tabs</label>
					</div>
				</form>';
            } else {
                $str .= '<p class="error">Cannot edit file. This file type is not editable.</p>';
            }
        } else {
            $str .= '<p class="error">Cannot edit file. It either does not exist or is not writeable.</p>';
        }
    }
    return $str;
}
Esempio n. 24
0
<?php

if (!$_SESSION['user']['id'] && end(explode('/', $_SERVER['URL'])) != 'login.php') {
    header('location: login.php');
}
if ($_POST && $_GET['sayfa']) {
    include getDir() . 'ilk/' . $_GET['sayfa'] . '.php';
}
Esempio n. 25
0
<?php

session_start();
error_reporting(0);
if (file_exists(getDir() . 'vtbilgi.php')) {
    include 'vtbilgi.php';
} else {
    header('location: yonetim/kur.php');
    return;
}
$slashkullan = TRUE;
$db = new mysqli($vt_bilgi['sunucu'], $vt_bilgi['kullanici'], $vt_bilgi['sifre'], $vt_bilgi['isim']) or die("Baglanilamadi");
$rs = $db->query("SELECT * FROM sitebilgi" . ($_SESSION['sid'] ? " WHERE id = " . $_SESSION['sid'] : "") . " ORDER BY aktif DESC, id LIMIT 1");
$sb = $rs->fetch_assoc();
$_SESSION['sid'] = $sb['id'];
$anasayfasablon = 'index' . (!$sb['aktif'] ? '-yapimasamasinda' : '') . '.html';
$satirsayi = 15;
// Yönetim Panelinde Liste Sayfalarında Sayfa Başına Kayıt Sayısı
date_default_timezone_set($sb['zamandilimi']);
Esempio n. 26
0
function getDir($dir, $dirname, $target)
{
    if (is_dir($dir)) {
        $directory = opendir($dir);
        while ($file = readdir($directory)) {
            if ($file != "." && $file != ".." && $file != "small") {
                if (is_dir("{$dir}/{$file}")) {
                    getDir("{$dir}/{$file}", $file, $target);
                } else {
                    if (imagetype($file) != "UNKNOWN" && $dirname != "small" && $dirname != "MAINDIRECTORY") {
                        $createTime = filemtime("{$dir}/{$file}");
                        filename2student($dirname, $file, $target, $createTime);
                    }
                }
            }
        }
        closedir($directory);
    }
}
Esempio n. 27
0
File: csv.php Progetto: reimht/lisa
}
header("Content-Type: text/html; charset=UTF-8");
$error = "";
//Prüfen ob maximal Alter übertragen wurde
$imgDateNewer = null;
if (isset($_POST["imgdate"])) {
    if (strlen($_POST["imgdate"]) >= 6) {
        $date_tmp = explode(".", $_POST["imgdate"]);
        if (sizeof($date_tmp == 3)) {
            $imgDateNewer = mktime(0, 0, 0, $date_tmp[1], $date_tmp[0], $date_tmp[2]);
        }
    }
}
//Daten der Schüler einlesen
ob_start();
getDir("../" . $_SESSION["settings"]["images_matching_lisa"], "MAINDIRECTORY", "lisa");
$student_data = lisaDirToStudentData($_SESSION["lisa"], $_SESSION["settings"]["images_matching_lisa"]);
ob_end_clean();
function lisaDirToStudentData(&$dirData, $imgbasepath)
{
    $student_data = array();
    if (is_array($dirData)) {
        foreach ($dirData as $data) {
            $student = array();
            $student["createTime"] = isset($data["createTime"]) ? $data["createTime"] : "";
            $student["given_name"] = isset($data["givenname"]) ? $data["givenname"] : "";
            $student["last_name"] = isset($data["lastname"]) ? $data["lastname"] : "";
            $student["birthday"] = (isset($data["birthday_year"]) and isset($data["birthday_month"]) and isset($data["birthday_day"])) ? $data["birthday_day"] . "." . $data["birthday_month"] . "." . $data["birthday_year"] : "";
            $student["class"] = isset($data["class"]) ? $data["class"] : "";
            $student["pic_small"] = isset($data["picfile"]) ? $imgbasepath . $data["picfile"] : "";
            $student["pic_big"] = isset($data["picfile"]) ? $imgbasepath . $data["picfile"] : "";
Esempio n. 28
0
}
?>
					</ul>
				</div><!-- fin contenu -->
			</nav>
		
		
			<div class="container">		
			
				<div class="col-sm-3">
					<div id="arborescence">
					
						<ul>
							<li class="racine"><a href="cours.php"><img alt="racine" src="themes/original/images/repertoire.png" />racine</a></li>
							<?php 
foreach (getDir(BASE) as $element) {
    ?>
								<li>
									<a href="cours.php?p=<?php 
    echo rawurlencode(BASE . "/" . $element['nom']);
    ?>
">
										<img alt="repertoire" src="themes/original/images/repertoire.png" />
										<span <?php 
    echo rawurlencode(BASE . "/" . $element['nom']) == rawurlencode($repertoire_courant) ? 'style="font-weight:bold"' : '';
    ?>
 title="<?php 
    echo normalizeString($element['nom']);
    ?>
"><?php 
    echo shortenString(normalizeString($element['nom']), 18);
Esempio n. 29
0
        }
        HTML_TreeNode::HTML_TreeNode($options, $events);
    }
}
$menu = new HTML_TreeMenu();
$filename = '';
if (isset($_GET) && isset($_GET['fileName'])) {
    $filename = $_GET['fileName'];
}
$filename = realpath($filename);
$pd = substr(PHP_OS, 0, 3) == 'WIN' ? '\\' : '/';
$test = $pd == '/' ? '/' : 'C:\\';
if (empty($filename) || $filename == $test) {
    $filename = $pd == '/' ? '/' : 'C:\\';
    $node = false;
    getDir($filename, $node);
} else {
    flush();
    //            if ($pd != '/') $pd = $pd.$pd;
    $anode = false;
    switchDirTree($filename, $anode);
    //            recurseDir($filename,$anode);
    $node = new HTML_TreeNode(array('text' => "Click to view " . addslashes($filename), 'link' => "", 'icon' => 'branchtop.gif'));
    $node->addItem($anode);
}
$menu->addItem($node);
if ('@WEB-DIR@' != '@' . 'WEB-DIR@') {
    $DHTMLmenu =& new HTML_TreeMenu_DHTML($menu, array('images' => '../HTML_TreeMenu-1.1.2/images'));
} else {
    $DHTMLmenu =& new HTML_TreeMenu_DHTML($menu, array('images' => str_replace('/docbuilder/file_dialog.php', '', $_SERVER['PHP_SELF']) . '/HTML_TreeMenu-1.1.2/images'));
}
Esempio n. 30
0
 /**
  * 管理备份数据
  *
  * @return array
  */
 public function dbmanages()
 {
     $this->display('Dbmanage/dbmanages.html', array("dblist" => array_filter(getDir(DBBACKUP_PATH))));
 }