SunQuest
           FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old April 22nd, 2004, 07:50 PM
vadertech vadertech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 vadertech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 47 sec
Reputation Power: 0
remote ftp gallery

I have pictures that are on a ftp server and I want to know if there is a way for my webserver to connect to my ftp server and display the pictures in a table. I would like to just have a gallery that pulled from a certain directory on the ftp server.

I don't want to copy the pictures to my webserver because of space issue. Is there a script that will achieve this?

Reply With Quote
  #2  
Old April 22nd, 2004, 08:57 PM
edman007's Avatar
edman007 edman007 is offline
Trapped on the forums...help
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Aug 2003
Location: /Users/edman007
Posts: 4,617 edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)edman007 User rank is Major General (70000 - 90000 Reputation Level)  Folding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate FolderFolding Points: 67263 Folding Title: Intermediate Folder
Time spent in forums: 1 Month 3 Weeks 3 Days 4 h 34 m 24 sec
Reputation Power: 787
Send a message via AIM to edman007
you should be able to make a seperate file that gets the image, here s an example if you aready have the file names

PHP Code:
<?php
//$safe_file_names could be an array of all the paths to the images on the ftp server, use it for security reasons

if (in_array($_GET['img'], $safe_file_names)){
$img file_get_contents('ftp://pass:username@ftpserver.com'.$_GET['img']);
echo 
$img;
} else {
echo 
'INVALID IMAGE NAME';
}
?>


it would be faster to have all the image names in a database, but if you want to read the names then use ftp_nlist(); and the other ftp functions to do that

Reply With Quote
  #3  
Old April 22nd, 2004, 08:59 PM
terminal's Avatar
terminal terminal is offline
nx
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: USA
Posts: 626 terminal Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 28 m 37 sec
Reputation Power: 0
Send a message via AIM to terminal
yes, there is a way to do this..check my sample out:
http://terminal.x5788.net/ig.php

it pulls everything out from
http://terminal.x5788.net/img/
and displays it in a table $r cells across
(i must admit though, it looks sorta crappy cuz it took me about 10 seconds to do, so dont criticize pleaz!:P)

if this is sorta what you want, just say so, and ill give you my source code

-xn

Reply With Quote
  #4  
Old April 22nd, 2004, 10:39 PM
vadertech vadertech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 vadertech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 47 sec
Reputation Power: 0
Quote:
Originally Posted by terminal
yes, there is a way to do this..check my sample out:
http://terminal.x5788.net/ig.php

if this is sorta what you want, just say so, and ill give you my source code

-xn


Yes that is basically what im looking for. I would like something with thumbnails. I dont need anything fancy. Just a way to check screenshots over the web from a gaming server.

Reply With Quote
  #5  
Old April 22nd, 2004, 10:59 PM
terminal's Avatar
terminal terminal is offline
nx
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: USA
Posts: 626 terminal Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 28 m 37 sec
Reputation Power: 0
Send a message via AIM to terminal
ok, heres the code:
PHP Code:
<?
/* the following variables must be set: */
$host 'host_name';
$user 'user_name';
$password 'password';
$idir '/path/to/imgs';
$ipath '/home/user'/* include path */
$wa 'http://www.mywebsite.com';
$r 5/* number of images per row */

/* end of config */

if (isset($_GET['src']))
{
include 
$_GET['src'];
exit;
}
else
{
?>
<html>
<head>
<title>
Image Gallery
</title>
</head>
<body>
<h1>Image Gallery</h1>
<?

$c_id 
ftp_connect($host21) or die("Couldn't connect to $host");

if (@
ftp_login($c_id$user$password)) 
{
echo 
"Connected as $user@$host\n";

else 
{
echo 
"Couldn't connect as $user\n";
exit;
}
ftp_chdir($c_id$idir);
?>
<table style="border: 1px solid #000000;">
<tr>
<?
$list 
ftp_nlist($c_idftp_pwd($c_id));
for (
$c 1$c <= count($list); $c++)
{
$i $c 1;
if (!
preg_match('/^\.+$/'$list[$i]))

if (
$i $r == 2)
{
echo 
'
</tr>
<tr>
<td style="border: 1px solid #000000;">
<a href="' 
$wa '/' $idir '"><img border="0" src="' $wa '/ig.php?src=' $ipath ftp_pwd($c_id) . '/' $list[$i] . '" alt="' $list[$i] . '" /></a>
</td>
'
;
}
else
{
echo 
'
<td style="border: 1px solid #000000;">
<a href="' 
$wa '/' $idir '"><img border="0" src="' $wa '/ig.php?src=' $ipath ftp_pwd($c_id) . '/' $list[$i] . '" alt="' $list[$i] . '" /></a>
</td>
'
;
}
}
}
?>
</tr>
</table>
</body>
</html>
<?
}
?>

this codes sorta messy, but i think ill be able to clean it up sometime if more people requested it. you just need to set the 7 variables at the top and then youre set.

tell me if you find any bugs in it pleaz

-xn

Reply With Quote
  #6  
Old April 22nd, 2004, 11:20 PM
vadertech vadertech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 vadertech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 47 sec
Reputation Power: 0
it is pulling the files but isn't displaying images. The ftp server is windows. Would the ipath be c:/directory/path?

Also one more thing. I have .htm files in the same directory with the images and I won't be able to move them. How could I tell it to just display *.png files?

http://www.isdp.net/ig.php

Thanks alot!

Last edited by vadertech : April 23rd, 2004 at 12:12 AM.

Reply With Quote
  #7  
Old April 23rd, 2004, 12:41 AM
vadertech vadertech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 vadertech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 47 sec
Reputation Power: 0
i have 100's of pictures to display. Maybe im better off with a gallery that uses a database.

Reply With Quote
  #8  
Old May 1st, 2004, 11:25 AM
terminal's Avatar
terminal terminal is offline
nx
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: USA
Posts: 626 terminal Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 28 m 37 sec
Reputation Power: 0
Send a message via AIM to terminal
yeah...you would be much better of using a database or simply some sort of array due to speed problems....maybe i can find some way to do this for you..

Reply With Quote
  #9  
Old May 3rd, 2004, 05:47 PM
vadertech vadertech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 vadertech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 47 sec
Reputation Power: 0
that would be great.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > remote ftp gallery


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway