Exemple #1
0
function readAllDirs($dirName, &$readCtr, &$mainArray, $searchExt = "false", $displayProgress = "false")
{
    global $audio_types, $video_types;
    // Let's up the max_execution_time
    ini_set('max_execution_time', '600');
    // Let's look at the directory we are in
    if (is_dir($dirName)) {
        $d = dir($dirName);
        while ($entry = $d->read()) {
            // Let's make sure we are seeing real directories
            if ($entry == "." || $entry == "..") {
                continue;
            }
            // Now let's see if we are looking at a directory or not
            if (filetype($dirName . "/" . $entry) != "file") {
                // Ok, that was a dir, so let's move to the next directory down
                readAllDirs($dirName . "/" . $entry, $readCtr, $mainArray, $searchExt, $displayProgress);
            } else {
                // Let's see if they wanted status
                if ($displayProgress == "true") {
                    if ($readCtr % 50 == 0) {
                        echo '.';
                        flushDisplay();
                    }
                }
                // Let's see if we want to search a specfic extension or not
                if ($searchExt == "false") {
                    // Ok, we found files, let's make sure they are audio or video files
                    if (preg_match("/\\.({$audio_types})\$/i", $entry) or preg_match("/\\.({$video_types})\$/i", $entry)) {
                        $mainArray[$readCtr] = $dirName . "/" . $entry;
                        $readCtr++;
                    }
                } else {
                    if (stristr($entry, $searchExt) or $searchExt == "true") {
                        $mainArray[$readCtr] = $dirName . "/" . $entry;
                        $readCtr++;
                    }
                }
            }
        }
        // Now let's close the directory
        $d->close();
        // Now let's sort that array
        @sort($mainArray);
    }
    // Ok, let's return the data
    return $mainArray;
}
Exemple #2
0
<?php

if (!defined(JZ_SECURE_ACCESS)) {
    die('Security breach detected.');
}
/**
* Adds the selected node to the featured list
* 
* @author Ross Carlson
* @version 01/19/05
* @since 01/19/05
* @param $node The node that we are viewing
*/
global $node;
// First let's display the top of the page and open the main block
$this->displayPageTop("", word("Adding to featured") . "<br>" . $node->getName());
$this->openBlock();
// Now let's add this puppy
$node->addFeatured();
// Let's display status
echo "<br>" . word("Add complete!");
// Now let's close out
$this->closeBlock();
flushDisplay();
sleep(3);
$this->closeWindow(true);
Exemple #3
0
    /**
     * Displays the top of the page for the popup window
     * 
     * @author Ross Carlson
     * @version 01/18/05
     * @since 01/18/05
     * @param $bg_color a hex value for the background color, IF we want one
     * @param $headerTitle The title for the page
     */
    function displayPageTop($bg_color = "", $headerTitle = "", $js = true)
    {
        global $row_colors, $web_root, $root_dir, $skin, $cms_mode, $cms_type, $cur_theme, $css;
        $display = new jzDisplay();
        //handleSetTheme();
        // AJAX:
        $display->handleAJAX();
        // Let's include the javascript
        if ($js) {
            echo '<script type="text/javascript" src="' . $root_dir . '/lib/jinzora.js"></script>' . "\n";
            echo '<script type="text/javascript" src="' . $root_dir . '/lib/overlib.js"></script>';
            echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>';
        }
        // Let's start our page
        echo '<title>Jinzora</title>' . "\n";
        // Let's output the Jinzora style sheet
        //include_once($css);
        echo '<link rel="stylesheet" title="' . $skin . '" type="text/css" media="screen" href="' . $css . '">' . "\n";
        // Now let's see if they wanted a different background color
        if ($bg_color != "") {
            echo '<span style="font-size:0px">.</span><body marginwidth=0 marginheight=0 style="margin: 0px" style="background-color:' . $bg_color . '">' . "\n";
        }
        // Now let's output the CMS style sheet, if necessary
        if ($cms_mode != "false") {
            switch ($cms_type) {
                case "postnuke":
                case "phpnuke":
                case "cpgnuke":
                case "mdpro":
                    echo '<LINK REL="StyleSheet" HREF="' . $_SESSION['cms-style'] . '" TYPE="text/css">';
                    // Now let's get the data we need from the session var
                    $cArr = explode("|", urldecode($_SESSION['cms-theme-data']));
                    echo "<style type=\"text/css\">" . ".jz_row1 { background-color:" . $cArr[0] . "; }" . ".jz_row2 { background-color:" . $cArr[1] . "; }" . ".and_head1 { background-color:" . $cArr[0] . "; }" . ".and_head2 { background-color:" . $cArr[1] . "; }" . "</style>";
                    break;
                case "mambo":
                    echo '<LINK REL="StyleSheet" HREF="' . $_SESSION['cms-style'] . '" TYPE="text/css">' . "\n";
                    $row_colors = array('sectiontableentry2', 'tabheading');
                    break;
            }
        }
        if (stristr($skin, "/")) {
            $img_path = $root_dir . "/" . $skin;
        } else {
            $img_path = $root_dir . "/style/" . $skin;
        }
        // Now let's show the page title
        if ($headerTitle != "") {
            ?>
			<table width="100%" cellpadding="3" cellspacing="0" border="0"><tr><td>
			<table width="100%" cellpadding="3" cellspacing="0" border="0">
				<tr>
					<td width="6" height="6" style="background: url(<?php 
            echo $img_path;
            ?>
/inner-block-top-left.gif); background-repeat:no-repeat"></td>
					<td width="99%" height="6" style="background: url(<?php 
            echo $img_path;
            ?>
/inner-block-top-middle.gif);"></td>
					<td width="6" height="6" style="background: url(<?php 
            echo $img_path;
            ?>
/inner-block-top-right.gif); background-repeat:no-repeat"></td>
				</tr>
				<tr>
					<td width="6" style="background: url(<?php 
            echo $img_path;
            ?>
/inner-block-left.gif); background-repeat:repeat"></td>
					<td width="99%">
						<table width="100%" cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td width="100%">
									<font size="1" color="<?php 
            echo jz_font_color;
            ?>
">
										<strong><?php 
            echo $headerTitle;
            ?>
</strong>
									</font>
								</td>
								<td align="right"><a href="javascript:window.close();"><?php 
            echo word('Close');
            ?>
</a></td>
							</tr>
						</table>
					</td>
					<td width="6" style="background: url(<?php 
            echo $img_path;
            ?>
/inner-block-right.gif); background-repeat:repeat"></td>
				</tr>
				<tr>
					<td width="6" height="6" style="background: url(<?php 
            echo $img_path;
            ?>
/inner-block-bottom-left.gif); background-repeat:no-repeat"></td>
					<td width="99%" height="6" style="background: url(<?php 
            echo $img_path;
            ?>
/inner-block-bottom-middle.gif);"></td>
					<td width="6" height="6" style="background: url(<?php 
            echo $img_path;
            ?>
/inner-block-bottom-right.gif); background-repeat:no-repeat"></td>
				</tr>
			</table>
			</td></tr></table>
			<?php 
        }
        flushDisplay();
    }