Random pic block (i want it to search from multiple folders)

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Random pic block (i want it to search from multiple folders)
WaRpeD
CZ Newbie
WaRpeD has been a member for over 19 year's 19 Year Member
canada.gif
Gender: Male
Status: Offline
Joined: Jan 30, 2005
0.00 posts per day
Posts: 6
Points: 464
   
High guys, i have a random pic block and it works just fine but i want it to show pics from multiple folders instead of just one here's the code any idea's would be greatly appreciated.

<?php
$content="";
if (eregi("block-RandomPics.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
// $whereimgs has to be in the Domain (like localhost area)
// or put ../ in front of folder name
$whereimgs = "modules/coppermine/albums/userpics/10001";
mt_srand((double)microtime()*1000000);
$imgs = dir($whereimgs);
while ($file = $imgs->read()) {
if (eregi("gif", $file) || eregi("jpg", $file)) {
$imglist .= "$file ";
}
}
closedir($imgs->handle);
$imglist = explode(" ", $imglist);
$a = sizeof($imglist)-2;
$random = mt_rand(0, $a);
$image = $imglist[$random];
$asin = explode(".", $image);
$content = "";
$content .= "<center><a href=\"PicShow.php?show=".$whereimgs."/$image\">";
$content .= "<img src=\"".$whereimgs."/$image\" border=\"0\"
width=\"120\" alt=\"\"><br><br>";
?>



Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.04 posts per day
Posts: 8089
Points: 494,430
   
Whats the PicShow.php? I could muster up something but it wouldn't use any external file.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Random pic block (i want it to search from multiple fold
WaRpeD
CZ Newbie
WaRpeD has been a member for over 19 year's 19 Year Member
canada.gif
Gender: Male
Status: Offline
Joined: Jan 30, 2005
0.00 posts per day
Posts: 6
Points: 464
   
Thanks for the reply and the picshow.php is

<?php
if (!isset($mainfile)) { include("mainfile.php"); }
$index = 0;
include("header.php");
OpenTable();
$sl = $show;
echo "
<center><h3><a href=\"javascript:history.back()\">Go back!<br><br>
<img src=$sl border=\"2\" width=\"200\"></a></h3>
</center>";
closetable();
include("footer.php");
?>



Back to top Reply with quote
#4   re: Random pic block (i want it to search from multiple fold
WaRpeD
CZ Newbie
WaRpeD has been a member for over 19 year's 19 Year Member
canada.gif
Gender: Male
Status: Offline
Joined: Jan 30, 2005
0.00 posts per day
Posts: 6
Points: 464
   
Any help Telli would be greatly appreciated. I just want it to search.. say from like 5 folders of coppermine, the code it self works i don't want to use your brain too hard hehe, but just a simple fix to have it search diff user folders also, Thanks Telli. icon_biggrin.gif



Back to top Reply with quote
#5   re: Random pic block (i want it to search from multiple fold
WaRpeD
CZ Newbie
WaRpeD has been a member for over 19 year's 19 Year Member
canada.gif
Gender: Male
Status: Offline
Joined: Jan 30, 2005
0.00 posts per day
Posts: 6
Points: 464
   
Again any help would be greatly appreciated, seeing that so many people are looking at this thread probably wondering the same question.



Back to top Reply with quote
#6   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.04 posts per day
Posts: 8089
Points: 494,430
   
See if this does the trick...



Attached Files
Random_Image.zip (2.55 KB, Downloaded: 5242 Time(s))



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#7   Re: re: Random pic block (i want it to search from multiple
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.04 posts per day
Posts: 8089
Points: 494,430
   


Originally posted by WaRpeD @ Sat Feb 26, 2005 11:02 pm:

Again any help would be greatly appreciated, seeing that so many people are looking at this thread probably wondering the same question.



No response yet? icon_rolleyes.gif




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#8   re: Random pic block (i want it to search from multiple fold
WaRpeD
CZ Newbie
WaRpeD has been a member for over 19 year's 19 Year Member
canada.gif
Gender: Male
Status: Offline
Joined: Jan 30, 2005
0.00 posts per day
Posts: 6
Points: 464
   
Sorry been really busy lately, but thanks alot will try now. icon_biggrin.gif



Back to top Reply with quote
#9   re: Random pic block (i want it to search from multiple fold
WaRpeD
CZ Newbie
WaRpeD has been a member for over 19 year's 19 Year Member
canada.gif
Gender: Male
Status: Offline
Joined: Jan 30, 2005
0.00 posts per day
Posts: 6
Points: 464
   
Yes it works flawlessly! Thank you Telli!!!



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum