/**
  * Finds a Page record based on it's path.
  * 
  * @param string $path      path/to/page
  * @param bool $all         flag for returning all status types
  * @return mixed            Page object or false
  */
 public static function findByPath($path, $all = false)
 {
     $path = trim($path, '/');
     $has_behavior = false;
     // adding the home root
     $slugs = array_merge(array(''), explode_path($path));
     $url = '';
     $page = new stdClass();
     $page->id = 0;
     $parent = false;
     foreach ($slugs as $slug) {
         $url = ltrim($url . '/' . $slug, '/');
         $page = self::findBySlug($slug, $parent, $all);
         if ($page instanceof Page) {
             // check for behavior
             if ($page->behavior_id != '') {
                 // add an instance of the behavior with the name of the behavior
                 $params = explode_path(substr($path, strlen($url)));
                 $page->{$page->behavior_id} = Behavior::load($page->behavior_id, $page, $params);
                 return $page;
             }
         } else {
             break;
         }
         $parent = $page;
     }
     // foreach
     return $page;
 }
/**
 * Alias for explode_path, this function should no longer be used.
 * 
 * @deprecated
 * @see  explode_path()
 */
function explode_uri($uri)
{
    return explode_path($uri);
}
Example #3
0
)</a>
	| <a href="?dj" class="icon idjmode">DJ</a>
	| <a href="?help" class="icon ihelp">ABOUT/HELP</a>
	| <a href="?logout" class="icon ilogout">LOGOUT</a>
</div>

<?php 
if (isset($_GET['help'])) {
    ?>
<h1>About/Help</h1><?php 
    readfile($bonus_dir . '/help.html');
    die;
}
if (!isset($_GET['search'])) {
    echo '<title>' . $title . ': ' . unxss($dir) . '</title>';
    echo '<a href="?" style="color: black;"><h1 style="float: left;">' . $title . '</h1></a><h2 style="clear: left; display: inline; float: left;">Index of: ' . explode_path($dir) . '</h2>';
} else {
    echo '<title>' . $title . ': ' . unxss($_GET['search']) . '</title>';
    echo '<a href="?" style="color: black;"><h1 style="float: left;">' . $title . '</h1></a><h2 style="clear: left; display: inline; float: left;">Searching for: ' . unxss($_GET['search']) . '</h2>';
    ?>

<?php 
}
?>
<span style="float: right;">
	<form action="?" method="GET" align="right" style="display: inline;">
		<input type="hidden" name="download" value="" />
		<input type="number" min="1" name="random" value="<?php 
echo $default_random_count;
?>
" style="width:4em;" title="how many randomly selected tracks should be in