
<?php
$folder = (isset($folder)) ? $folder : 'assets/images';
$i = 0;
$imgDir = opendir ($folder);
while ( $file = readdir( $imgDir ) )
{
//checks that file is an image
$file_type = strrchr( $file, "." );
$is_image = eregi( "jpg|gif|png|jpeg",$file_type );
if ( $file != '.' && $file != '..' && $is_image && strpos($file, '.') !== 0 )
{ $images[$i++] = $file; }
}
closedir ($imgDir);
srand( (double) microtime()*1000000 );
$image_name = $folder . '/' . $images[rand( 0,sizeof( $images ) -1 )];
$imgSize = GetImageSize( $image_name );
//ends script if no images found
if ( $i == 0 )
die();
return( "<img src=\"" . $image_name . "\"" . $imgSize[3] . " alt=\"\" />\n" );
?>« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: opendir(random-image): failed to open dir: No such file or directory
Error type/ Nr.: Warning - 2
File: /data/htdocs/www.sentai.com/modx/manager/includes/document.parser.class.inc.php(748) : eval()’d code
Line: 5
Parser timing
MySQL: 0.0268 s (11 Requests)
PHP: 0.2388 s
Total: 0.2657 s
$folder = (isset($folder)) ? 'assets/images/'.$folder : 'assets/images';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>[(site_name)] - [*pagetitle*]</title>
<base href="[(site_url)]" />
<link rel="stylesheet" href="[(base_url)]assets//templates/sentai/css/modxmenu.css" type="text/css" media="screen" />
<link rel="stylesheet" href="[(base_url)]assets//templates/sentai/css/form.css" type="text/css" media="screen" />
<link rel="stylesheet" href="[(base_url)]assets//templates/sentai/css/modx.css" type="text/css" media="screen" />
<link rel="stylesheet" href="[(base_url)]assets//templates/sentai/css/print.css" type="text/css" media="print" />
<script src="[(base_url)]manager/media/script/scriptaculous/prototype.js" type="text/javascript"></script>
<script src="[(base_url)]manager/media/script/scriptaculous/scriptaculous.js" type="text/javascript"></script>
<script type="text/javascript" src="[(base_url)]assets//templates/js/sentai/moo.fx.js"></script>
<script src="[(base_url)]assets//templates/sentai/js/drop_down_menu.js" type="text/javascript"></script>
<script type="text/javascript">
image1 = new Image();
image1.src = "[(base_url)]assets//templates/sentai/images/array_332x28_roll.jpg";
function setActiveStyleSheet() {
new Effect.Appear('modxhost', {duration:0.5});
}</script>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="[(site_url)][~11~]" />
<link rel="stylesheet" href="[(base_url)]assets/templates/sentai/css/style.css" type="text/css" media="screen" />
</head>
<body>
<div id="container-page">
<div class="container-header">
<div class="searchf">
<form id="searchform" method="get" action=""><p>
Search: <input class="search" type="text" name="s" id="s" size="20"/></p>
</form>
</div>
<div class="logo"></div>
</div>
<div id="container-mainnav">
<div id="tabs">
<div id="ajaxmenu"> [[Wayfinder?startId=`0` &outerTpl=`mh.OuterTpl` &innerTpl=`mh.InnerTpl` &rowTpl=`mh.RowTpl` &innerRowTpl=`mh.InnerRowTpl` &firstClass=`first` &hereClass=``]] </div>
</div>
</div>
<div id="container-content">
<div id="content-pri">
<p><h1>[*longtitle*]</h1></p>
[*introtext*]
<p>[*content*]</p>
</div>
<!-- Start #sidebar -->
<div id="content-subnav">
<!-- <h2>News:</h2>
[[Ditto? &startID=`2` &summarize=`2` &total=`20` &commentschunk=`Comments` &tpl=`nl_sidebar` &showarch=`0` &truncLen=`100` &truncSplit=`0`]]
<div id="recentdocsctnr">
<h2>Most Recent:</h2>
<a name="recentdocs"></a>[[ListIndexer?LIn_root=0]] </div> -->
<p></p><br>
{{SubMenu-Sidebar}}
<p>{{Login-Sidebar}}</p>
<p>{{Support-Sidebar}}</p>
<p>{{Demo-Sidebar}}</p>
<p>{{Download-Sidebar}}</p>
</div>
<!-- End #sidebar -->
</div>
<div id="container-footer">
<div id="footer" align="center">Copyright © 2007 Sentai.com - All Rights Reserved</div>
</div>
</div>
</body>
</html>* {
margin: 0;
padding: 0;
}
html, body {
height: 100%; /* Required */
}
body {
color: #000000;
font: 11px Verdana, sans-serif;
text-align: center;
background:#8b8989;
background-image:url(../images/main_bg.gif);
background-repeat: repeat-x;
}
h1 {
font: bold 20px Arial, sans-serif;
color: #4d4d4d;
}
h2 {
padding: 1em 0 .2em 0;
font: bold 18px/1.5em Arial, sans-serif;
color: #4d4d4d;
}
h3 {
padding: 1em 0 .2em 0;
font: bold 16px/1.5em Arial, sans-serif;
color: #4d4d4d;
}
h3 {
padding: 1em 0 .2em 0;
font: bold 14px/1.5em Arial, sans-serif;
color: #4d4d4d;
}
h4 {
padding: 1em 0 .2em 0;
font: bold 12px/1.5em Verdana, sans-serif;
color: #4d4d4d;
}
p {
margin: 2em 0;
line-height: 1.5em;
}
a {
color: #666;
font-weight: bold;
text-decoration: none;
}
a:hover {
color: #999;
text-decoration: underline overline;
}
#container-page {
margin: 0 auto;
width: 938px;
background: #fff;
text-align: left;
position: relative;
min-height: 100%; /* For Modern Browsers */
height: auto !important; /* For Modern Browsers */
height: 100%; /* For IE */
}
.container-header {
color: #000;
width: 938px;
height: 95px;
margin: 0 auto;
padding: 0;
background-image:url(../images/header_bg.gif);
background-repeat: repeat-x;
}
.container-header .logo {
width: 192px;
height: 96px;
float: left;
margin-left: 1em;
margin-top: 0;
margin-bottom: 0;
background-image:url(../images/logo.gif);
background-repeat: no-repeat;
}
.container-header .searchf {
float: right;
margin-right: 1em;
margin-top: 1em;
margin-bottom: 1em;
clear: both;
}
.searchpad {
padding-top: 15px;
}
#container-mainnav {
width: 938px;
height: 196px;
margin: 0 auto;
padding: 0;
background-image:url(../images/menu_bg.gif);
background-repeat: no-repeat;
}
#container-content {
padding: 0 1em 40px 1em;
top: 362px;
}
#container-content:after {
clear: both;
display: block;
font: 1px/0px serif;
content: ".";
height: 0;
visibility: hidden;
}
#content-pri {
width: 80%;
float: right;
margin-top: 2em;
}
#content-subnav {
width: 160px;
height: 100px;
float: left;
margin-top: 1em;
margin-bottom: 1em;
background-image:url(../images/);
background-repeat: no-repeat;
}
#content-subnav ul,#content-subnav ul li {
list-style: none none;
}
#container-footer {
width: 100%;
background: #CCC;
position: absolute;
bottom: 0 !important;
bottom: -1px; /* For Certain IE widths */
height: 40px;
}
#footer {
padding: 0 1em;
line-height: 40px;
}
#tabs {
width:100%;
text-align:center;
background: url(icon/top.gif);
margin:0 0 0 0;
position:absolute;
z-index:500;
left: 0px;
top: 262px;
}
div.float {
float: right;
position: inherit;
z-index:2000;
margin-right: 9em;
margin-top: 9em;
}
div.float p {
text-align: center;
}
/* 1st Level Boxes */
.roundedcornr_box_818178 {
background: url(../images/roundedcornr_818178_tl.png) no-repeat top left;
}
.roundedcornr_top_818178 {
background: url(../images/roundedcornr_818178_tr.png) no-repeat top right;
}
.roundedcornr_bottom_818178 {
background: url(../images/roundedcornr_818178_bl.png) no-repeat bottom left;
}
.roundedcornr_bottom_818178 div {
background: url(../images/roundedcornr_818178_br.png) no-repeat bottom right;
}
.roundedcornr_content_818178 {
background: url(../images/roundedcornr_818178_r.png) top right repeat-y;
}
.roundedcornr_top_818178 div,.roundedcornr_top_818178,
.roundedcornr_bottom_818178 div, .roundedcornr_bottom_818178 {
width: 100%;
height: 15px;
font-size: 1px;
}
.roundedcornr_content_818178, .roundedcornr_bottom_818178 {
margin-top: 0px;
}
.roundedcornr_content_818178 { padding: 0 15px; }
/* 2nd level boxes */
.roundedcornr_box_563469 {
background: url(../images/roundedcornr_563469_tl.png) no-repeat top left;
}
.roundedcornr_top_563469 {
background: url(../images/roundedcornr_563469_tr.png) no-repeat top right;
}
.roundedcornr_bottom_563469 {
background: url(../images/roundedcornr_563469_bl.png) no-repeat bottom left;
}
.roundedcornr_bottom_563469 div {
background: url(../images/roundedcornr_563469_br.png) no-repeat bottom right;
}
.roundedcornr_content_563469 {
background: url(../images/roundedcornr_563469_r.png) top right repeat-y;
}
.roundedcornr_top_563469 div,.roundedcornr_top_563469,
.roundedcornr_bottom_563469 div, .roundedcornr_bottom_563469 {
width: 100%;
height: 15px;
font-size: 1px;
}
.roundedcornr_content_563469, .roundedcornr_bottom_563469 {
margin-top: 0px;
}
.roundedcornr_content_563469 { padding: 0 15px; }
#sidebox {
color: #797777;
font: 10px Verdana, sans-serif;
}
#subnav ul li {
background: url(../images/submenu_arrow.gif) left center no-repeat;
padding-left: 15px;
margin-bottom: 0px;
}