i completely get more confused with each answer on this
and its not you mboyden
forgive me
im really good at HTML and some PHP
but for some reason i am completely NOT getting this at all so hear me out
i need to place this
<img src="<{php}> echo getRndImgURL('random'); <{/php}>" alt="" width="158" height="116" />
in my header at the location where i want the images to show up
the folder where the images are located is called
RANDOM
the location of this folder is right now inside a specific theme folder
"geometric_red"
Now just before the code above i post pasted, i need to place this code
<{php}>
function getRndImgURL($path) { // Display Random Image from File Path
$i = 0;
$dir = @opendir(XOOPS_ROOT_PATH.'/themes/random/'.$GLOBALS['xoopsConfig']['theme_set'].'/'.$path);
while ( false !== ($filename = readdir($dir)) ) {
if ( preg_match("/(.gif|.jpg|.png)$/", $filename) ) { // image filter
$images[$i] = $filename;
$i++;
}
}
closedir($dir);
mt_srand( (double)microtime() * 1000000 );
$choice = array_rand($images);
return XOOPS_URL.'/themes/random/'.$GLOBALS['xoopsConfig']['theme_set'].'/'.$path.'/'.$images[$choice];
}
<{/php}>
is this correct?
please see where the $dir is specified in the second code here.
Was i supposed to change it to match? or not.
Im looking at the code you pasted just now but im just no getting it
i have a code very similar to it and it works on another site ( not XOOPS ) that i administer for someone else.
its works and calls exactly the same way
create a subdirectory called " random "
in "random " place an index.php file with the code in it.
goto the page where you want to rotate images
call "index.php" using an "image source" function
the problem i am having doing that is
i cant for the life of me get my "theme.html" to call am image source in the header of this file