function filesystem_listdirectories($dominio)
{
    if (file_exists(_CFG_APACHE_DOCUMENTROOT . $dominio)) {
        $handle = GetDirArray(_CFG_APACHE_DOCUMENTROOT . $dominio);
        $array_modules = array();
        while (list($key, $file) = each($handle)) {
            if ($file != "." && $file != "..") {
                if (is_dir(_CFG_APACHE_DOCUMENTROOT . $dominio . "/" . $file)) {
                    $array_modules[] = $file;
                }
            }
        }
    }
    return $array_modules;
}
function awstats_listdomains()
{
    $handle = GetDirArray(_CFG_AWSTATS_CONF);
    $array_modules = array();
    while (list($key, $file) = each($handle)) {
        if ($file != "." && $file != "..") {
            if (!is_dir(_CFG_AWSTATS_CONF . $file)) {
                if (substr($file, -5) == ".conf") {
                    if (substr($file, strlen("awstats."), -5) != "") {
                        $array_modules[] = substr($file, strlen("awstats."), -5);
                    }
                }
            }
        }
    }
    return $array_modules;
}
Example #3
0
    }
    //Clean up and sort
    closedir($handle);
    sort($retVal);
    return $retVal;
}
?>
<h3>Description</h3>
The LNPD and associated files are intended to allow communication of a program hosted on a Linux PC with a legOS program on an RCX. 
<h3>Documentation</h3>
Documentation for LNPD is unfortunately sparse. Your best bets are to read the README files below, and to poke around the archives at <a href="http://www.lugnet.com/robotics/rcx/legos/">lugnet.com</a> before asking questions in that forum.  
<h3>LNPD-related files</h3>
The file listing below is auto-generated, showing the current list of files in this directory. To get more information about them, try the links above or download them yourself.
 
<?php 
$array = GetDirArray("./");
echo "<ul>\n";
for ($i = 0; $array[$i]; $i++) {
    if ($array[$i] == "." || $array[$i] == ".." || stristr($array[$i], "index.php")) {
        continue;
    }
    echo "<li><a href=\"{$array[$i]}\">{$array[$i]}</a>\n";
}
echo "</ul>\n";
?>
</BODY>
</HTML>



Example #4
0
function GetDirArray($spath, &$data, &$cnt, $stripc = 0)
{
    $flist = array();
    $flistcnt = 0;
    if ($handle = opendir($spath)) {
        while (false !== ($file = readdir($handle))) {
            $flist[$flistcnt++] = $file;
        }
        closedir($handle);
        if ($flistcnt > 0) {
            for ($i = 0; $i < $flistcnt; $i++) {
                $val = $flist[$i];
                if ($val != '.' && $val != '..') {
                    if ($cnt % 100 == 0) {
                        updateup_status($cnt);
                    }
                    if (is_dir($spath . $val)) {
                        if (is_link($spath . $val) && !FOLLOWSYMLINKS) {
                            continue;
                        }
                        GetDirArray($spath . $val . '/', $data, $cnt, $stripc);
                    } else {
                        if (file_type($val) != -1) {
                            $data[] = substr($spath . $val, $stripc);
                            $cnt++;
                        }
                    }
                }
            }
        }
    }
}
Example #5
0
#!/usr/local/bin/php
<?php 
include "/usr/local/baifox/panel/admin_panel/config/main_config.php";
require _CFG_INTERFACE_LIBRERIA;
require_once _CFG_INTERFACE_DIRMODULES . "mod_xmlconfig/include_funciones.php";
define(MYSQLDIR, "/var/lib/mysql/");
function xmlbase_add($dbase)
{
    //Crea la configuracion en el XML
    $conf = new patConfiguration();
    $conf->setConfigDir(_CFG_XML_CONFIG_DIR);
    $conf->parseConfigFile(_CFG_XML_BASEDATOS, a);
    $NEW_ID = xmlconfig_generaid(_CFG_XML_BASEDATOS);
    $conf->setConfigValue($NEW_ID, array("ID" => $NEW_ID, "DOMINIO" => "", "DATABASE" => $dbase, "USUARIO" => $dbase, "PASSWORD" => "", "ESTADO" => 1), "array");
    $conf->writeConfigFile(_CFG_XML_BASEDATOS, "xml", array("mode" => "pretty"));
    //Fin fichero configuracion XML
}
$handle = GetDirArray(MYSQLDIR);
while (list($key, $file) = each($handle)) {
    if ($file != "." && $file != "..") {
        echo "\nBase de datos encontrada: {$file}";
        if (is_dir(MYSQLDIR . $file)) {
            echo "\nAƱadiendo base de datos: {$file}";
            xmlbase_add($file);
        }
    }
}
Example #6
0
        }
        //if
    }
    // while
    closedir($dir);
}
echo "</td></tr></table>";
CloseTable();
echo "<br />";
//END IMAGEFILE
OpenTable();
echo "<table border=0 width=95%>";
echo "<tr><td colspan=2><center><h3>" . _CC_TITLE_DEL . "</h3></center></td></tr>";
echo "<tr><td colspan=2><center><font color=red><h4>" . _CC_WARN . "</h4></font></center></td></tr>";
echo "<tr><td width=50% valign=top><h4>" . _CC_SOURCE . "</h4><table>";
GetDirArray();
echo "</table></td><td width=50% valign=top><h4>" . _CC_IMAGE . "</h4><table>";
GetDirArray2();
echo "</table></td></tr></table>";
CloseTable();
echo "<br />";
fc_footer();
xoops_cp_footer();
#######################################################################################################
function GetDirArray()
{
    //Load Directory Into Array
    $path1 = './../content/';
    $handle = opendir($path1);
    $retVal = array();
    while ($file1 = readdir($handle)) {
Example #7
0
function modules_array($directorio)
{
    $handle = GetDirArray($directorio);
    $array_modules = array();
    while (list($key, $file) = each($handle)) {
        if ($file != "." && $file != "..") {
            if (is_dir($directorio . $file)) {
                if (substr($file, 0, 3) == "mod") {
                    $array_modules[] = substr($file, 4);
                }
            }
        }
    }
    return $array_modules;
}
function apache_subdomains($dominio)
{
    $handle = GetDirArray(_CFG_APACHE_CONF);
    $array_modules = array();
    $x = 0;
    while (list($key, $file) = each($handle)) {
        if ($file != "." && $file != "..") {
            if (!is_dir(_CFG_APACHE_CONF . $file)) {
                if (substr($file, -5) == "_conf") {
                    if (strpos(trim($file), "." . $dominio) !== false) {
                        if (trim(substr($file, -5)) != "") {
                            $subdominio = trim(substr($file, 0, -5));
                            $array_modules[$x]["dominio"] = $subdominio;
                            $array_modules[$x]["directorio"] = substr($subdominio, 0, strpos($subdominio, "."));
                            $x++;
                        }
                    }
                }
            }
        }
    }
    return $array_modules;
}
Example #9
0
function makeXMLplaylist($theDir, $recursive = false)
{
    global $WIMPY_PATH, $wimpyApp, $defaultVisualBaseName, $defaultVisualExt;
    $sPath = utf8_decode(rawurldecode($theDir));
    if ($recursive) {
        $AdirList['files'] = GetDirArrayRecursive($sPath);
        $AdirList['dirs'] = array();
    } else {
        $AdirList = GetDirArray($sPath);
    }
    $playlistCoverart = cleanForFlash(lookForVisual($sPath . slash . $defaultVisualBaseName . "." . $defaultVisualExt));
    $retval = '<playlist image="' . $playlistCoverart . '">' . newline;
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    // Directory
    $Adirs = array();
    if (sizeof($AdirList['dirs']) > 0) {
        for ($i = 0; $i < sizeof($AdirList['dirs']); $i++) {
            $tempName = $AdirList['dirs'][$i];
            $path_info = path_parts($tempName);
            $Aitem = array();
            $Aitem['filename'] = filepath2url($tempName);
            $Aitem['date'] = date("Y-m-d H:i:s", filemtime($tempName));
            // Image:
            $visualfilenameA = $tempName . slash . $defaultVisualBaseName . "." . $defaultVisualExt;
            if (@is_file($visualfilenameA)) {
                $visualFound = filepath2url($visualfilenameA);
            } else {
                $visualFound = "";
            }
            $Aitem['image'] = $visualFound;
            $infoFound = lookForInfo($tempName . slash . "folder.info");
            if ($infoFound != false) {
                $retval .= '<item>' . newline;
                $retval .= '<filename>' . $Aitem['filename'] . '</filename>' . newline;
                $retval .= $infoFound;
                $retval .= '<image>' . $Aitem['image'] . '</image>' . newline;
                $retval .= '<date>' . $Aitem['date'] . '</date>' . newline;
                $retval .= '<filekind>dir</filekind>' . newline;
                $retval .= "</item>" . newline;
            } else {
                $Aitem['artist'] = "";
                $Aitem['title'] = $path_info['filename'];
                $Aitem['album'] = "";
                $Aitem['seconds'] = "";
                $Aitem['link'] = "";
                $Aitem['description'] = "";
                // Write item XML
                $retval .= '<item>' . newline;
                $retval .= returnXMLkeys($Aitem);
                $retval .= "<filekind>dir</filekind>" . newline;
                $retval .= "</item>" . newline;
            }
        }
    }
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////
    // Files
    $Afiles = array();
    if (sizeof($AdirList['files']) > 0) {
        for ($i = 0; $i < sizeof($AdirList['files']); $i++) {
            $tempName = $AdirList['files'][$i];
            $path_info = path_parts($tempName);
            $Aitem = array();
            // Filename
            //
            $Aitem['filename'] = filepath2url($tempName);
            $Aitem['date'] = date("Y-m-d H:i:s", filemtime($tempName));
            $Aitem['image'] = lookForVisual($path_info['basepath'] . slash . $path_info['basename'] . "." . $defaultVisualExt);
            $infoFound = lookForInfo($path_info['basepath'] . slash . $path_info['basename'] . ".info");
            if ($infoFound != false) {
                $retval .= '<item>' . newline;
                $retval .= '<filename>' . $Aitem['filename'] . '</filename>' . newline;
                $retval .= $infoFound;
                $retval .= '<date>' . $Aitem['date'] . '</date>' . newline;
                $retval .= '<image>' . $Aitem['image'] . '</image>' . newline;
                $retval .= '<filekind>' . strtolower($path_info['ext']) . '</filekind>' . newline;
                $retval .= "</item>" . newline;
            } else {
                if (strtolower($path_info['ext']) == "mp3") {
                    $Aid3 = getID3info4me($tempName);
                } else {
                    $Aid3 = array();
                }
                // Basic ID3 info:
                $Aitem['artist'] = @$Aid3['artist'];
                $Aitem['title'] = @$Aid3['title'] ? @$Aid3['title'] : $path_info['basename'];
                $Aitem['album'] = @$Aid3['album'];
                $Aitem['seconds'] = @$Aid3['seconds'];
                // URL Link
                //
                // [comment] = id3v1
                // [commentS] = id3v2
                //
                // See if comments contain a URL:
                if (@substr($Aid3['comment'], 0, 4) == "http") {
                    $Aitem['link'] = @$Aid3['comment'];
                }
                // Replace ID3v1 with ID3v2
                if (@substr($Aid3['comments'], 0, 4) == "http") {
                    $Aitem['link'] = @$Aid3['comments'];
                }
                // Comments and URL link
                //
                // [comment] = id3v1
                // [commentS] = id3v2
                //
                if (@substr(@$Aid3['comment'], 0, 4) != "http" && strlen(@$Aid3['comment']) > 0) {
                    $Aitem['description'] = @$Aid3['comment'];
                }
                // Replace ID3v1 with ID3v2
                if (@substr(@$Aid3['comments'], 0, 4) == "http" && strlen(@$Aid3['comments']) > 0) {
                    $Aitem['description'] = @$Aid3['comments'];
                }
                // Image
                //
                $retval .= '<item>' . newline;
                $retval .= returnXMLkeys($Aitem);
                $retval .= '<filekind>' . strtolower($path_info['ext']) . '</filekind>' . newline;
                $retval .= "</item>" . newline;
            }
        }
    }
    $retval .= "</playlist>" . newline;
    @clearstatcache();
    return $retval;
}