» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 73
0 members and 73 guests
No Members online
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Rimonabant - combat obesity and smoking at the same time
Football Betting - best nfl betting promotions at sportsbook.com.
Poker Chips - Clay and composite poker chips for home games.

Register Now! Contact Us

About this Page
This is a discussion on need help with a random image in a block within the Purged Topics forums, part of the NM Staff category; Hi, I have a block that displays a random image from a folder and i resently changed my webhosting and ...



Go Back   Nukemods Forum » NM Staff » Purged Topics

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-20-2003, 01:19 AM
Junior Member
 
Join Date: Mar 2003
Posts: 18
need help with a random image in a block
Hi,
I have a block that displays a random image from a folder and i resently changed my webhosting and the new webhost creates some folder called _vti_cnf inside my image folder and my code doesnt check for images it just displays a random file , folder or image in the folder its checks... so I get an error in my block if it picks the _vti_cnf folder.. I need to set my code up to check if its an image before it picks it .. ive deleted this vti_cnf folder 10 times and it just keeps on recreating itself ...I just don't know how to set up the code to check for an image LOL
thanks for any help you can give me
Code:
if (eregi("block-RandomPic.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}
$kataloog = 'MAPS-PICS/BF/ACTION';
$i = 0;
$kat = opendir ($kataloog);
	while ($f = readdir($kat))
	{	if ($f != '.' && $f != '..') 
		{$nimed[$i++] = $f;}
	}
closedir ($kat);
srand((double)microtime()*1000000);
$nimi = $kataloog.'/'.$nimed[rand(0,sizeof($nimed)-1)];
$suurus = GetImageSize ($nimi);


$content = "<table align=center width=\"142\" height=\"150\" Font=\"Verdana\" fontsize=\"0\">";
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2003, 01:30 AM
Junior Member
 
Join Date: Apr 2003
Posts: 18
:!:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-21-2003, 05:17 AM
Junior Member
 
Join Date: Mar 2003
Posts: 18
I have no idea what front page is LOL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-22-2003, 11:42 AM
Junior Member
 
Join Date: Mar 2003
Posts: 18
this is my first attempt at making an if then statement in php
is this the proper way to make one??
Code:
if ($nimi == 'MAPS-PICS/BF/ACTION/_vti_cnf')
{$content .= "
<center><a href=\"MAPS-PICS/BF/GCS0074.jpg\"target=\"_blank\"><img src=\"MAPS-PICS/BF/GCS0074.jpg\" width=\"130\" height=\"125\" border=\"0\" alt=\"Click to Enlarge\">
</center></a>";}
else
{$content .= "
<center><a href=\"$nimi\"target=\"_blank\"><img src=\"$nimi\" width=\"130\" height=\"125\" border=\"0\" alt=\"Click to Enlarge\">
</center></a>";}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-24-2003, 09:06 PM
Junior Member
 
Join Date: Apr 2003
Location: Backwoods, USA
Posts: 29
Send a message via ICQ to Mike Send a message via AIM to Mike Send a message via MSN to Mike
ah i see youre having the same problem..dont ya hate those little red x's.. :x its got nothing to do with frontpage.. the block is fixed to pick up random images inside of a folder called random.. well like he said theres a folder the server automatically creates inside each folder called vti_cnf or something like that..and at random times it pics up that folder thinking its an image and hence thats when we get the red x.. im sure its a simple fix either a code or something to do in our servers..i havent figured it out either :cry: any help would be greatly appreciated.. Im using PHPNuke 6.0 Random image block. http://hsk.uzipp.com

Code:
if (eregi("block-RandomPic.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}



# Directory goes here relative to script
$folder = 'images/random';
# Directory should contain only images, else you can add some more filtering
$i = 0;
$in = opendir ($folder);
	while ($x = readdir($in))
	{	if ($x != '.' && $x != '..') # Directory should contain only images, else you can add some more filtering
		{$imaged[$i++] = $x;}
	}
closedir ($in);
srand((double)microtime()*1000000);
$image = $folder.'/'.$imaged[rand(0,sizeof($imaged)-1)];

$content .= "<table align=\"center\" border=\"1\" cellpadding=\"6\" cellspacing=\"6\" style=\"border-collapse: collapse\" bgcolor=\"#fffff0\" bordercolor=\"#111111\" width=\"138\" height=\"100\">";
$content .= "<tr><td align=\"center\"><a href=\"http://hsk.uzipp.com/optiplex.html\" target=\"_blank\"><img src=\"$image\" alt=\"Click Image\">";
$content .= "<align=\"left\"><a href=\"http://www.lvoncall.com\" title=\"Random Pic ver 2.0\" target=\"_blank\">.</a></tr></td></table>";
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-24-2003, 10:09 PM
Senior Member
 
Join Date: Sep 2002
Posts: 2,905
You guys may want to contact your webhost about that file. I have seen that on other webhosts as well and always wondered what it was.
Tell them it is conflicting with one of your php scripts. They may be able to turn it off.

mikem
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-30-2003, 11:14 PM
Junior Member
 
Join Date: Mar 2003
Posts: 18
I did contact my provider and that folder is created when you up load an image.. He didn't turn it off so I added an if else statement that finally got rid of the red x that appeared occasionally
Code:
$content .= "<tr><td>";
if ($nimi == 'MAPS-PICS/RF/ACTION/_vti_cnf')
{$content .= "
<center><a href=\"MAPS-PICS/RF/ACTION/0616_screen076.jpg\"target=\"_blank\"><img src=\"MAPS-PICS/RF/ACTION/0616_screen076.jpg\" width=\"125\" height=\"115\" border=\"0\" alt=\"Click to Enlarge\">
</center></a>";}
else
{$content .= "
<center><a href=\"$nimi\"target=\"_blank\"><img src=\"$nimi\" width=\"125\" height=\"115\" border=\"0\" alt=\"Click to Enlarge\">
</center></a>";}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Quote Block lt_s7orm Nuke 7.x - Blocks 2 03-18-2005 09:10 AM
where do i get a random image download block? SureFire Purged Topics 3 08-10-2003 01:37 AM
Random Picture Block freeby Site design 1 07-13-2003 02:47 AM
Help with random member block telli Nuke 6.5 to 6.9 - Blocks 0 06-19-2003 01:43 AM
random picture block samson Purged Topics 2 12-02-2002 09:38 PM


All times are GMT -5. The time now is 12:01 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31