Your browser does not seem to support CSS. If images appear below, please disregard them.
It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a Donation to help aid in operating costs.
Previous Thread
Next Thread
Print Thread
Rate This Thread
#18928 - 10/18/02 09:05 AM slideshow  
Joined: Apr 2002
Posts: 730
Moffesto Offline
UGN Supporter
Moffesto  Offline
UGN Supporter

Joined: Apr 2002
Posts: 730
Kuntucky
is there a way to create a slideshow using all the pictures in a particular directory rather than specifying every picture name, etc. Like if u wanted to make a slideshow from the pictures in
http://www.moffesto.com/pictures/

or do u have to specify every lil file name. ext. etc. It would take a load off if i could do this .


2 people can keep a secret as long as one is dead
Sponsored Links
#18929 - 10/18/02 07:03 PM Re: slideshow  
Joined: Mar 2002
Posts: 599
BackSlash Offline
UGN's Resident Homo
BackSlash  Offline
UGN's Resident Homo

Joined: Mar 2002
Posts: 599
TN
i don't know if thats possible, but another way to save time could be to name all the images in numerical order 1,2,3, etc. and then use a loop in your code to load the image one and then add 1 to the variable so that when it loops back through the code it loads image 2....


"It's better to burn out, than to fade away."
#18930 - 10/18/02 07:56 PM Re: slideshow  
Joined: Oct 2002
Posts: 37
ReverendNinjaSox Offline
Junior Member
ReverendNinjaSox  Offline
Junior Member

Joined: Oct 2002
Posts: 37
Yep. Pretty simple. If you are using Perl that is. I don't know whether the other scripting languages are capable of it. All you need to do with Perl is just open the directory and read the contents from it. I can post examples of this if you want.

#18931 - 10/18/02 11:57 PM Re: slideshow  
Joined: Mar 2002
Posts: 562
Le4rner Offline
UGN Supporter
Le4rner  Offline
UGN Supporter

Joined: Mar 2002
Posts: 562
My BBS uses a JavaScript to read the contents of a directory for smiles, and avantars

#18932 - 10/21/02 02:09 AM Re: slideshow  
Joined: Apr 2002
Posts: 730
Moffesto Offline
UGN Supporter
Moffesto  Offline
UGN Supporter

Joined: Apr 2002
Posts: 730
Kuntucky
sure ninja dude, if it will help. I dunno shit about perl but if it will help my site ill read.


2 people can keep a secret as long as one is dead
Sponsored Links
#18933 - 10/21/02 11:42 AM Re: slideshow  
Joined: Oct 2002
Posts: 37
ReverendNinjaSox Offline
Junior Member
ReverendNinjaSox  Offline
Junior Member

Joined: Oct 2002
Posts: 37
Code:
my $directory = "/location/of/images";
my $file;
opendir(IMAGES, $directory) or die "Can't open $directory:\n";
while (defined($file = readdir IMAGES)) {
    print "<img src=" . $directory . $file . ">\n";
}
closedir(IMAGES);
That's how I'd do it.

#18934 - 10/21/02 11:22 PM Re: slideshow  
Joined: Apr 2002
Posts: 730
Moffesto Offline
UGN Supporter
Moffesto  Offline
UGN Supporter

Joined: Apr 2002
Posts: 730
Kuntucky
... and u can just insert that into the html or what? if so... the body? head?


2 people can keep a secret as long as one is dead
#18935 - 10/22/02 04:20 PM Re: slideshow  
Joined: Oct 2002
Posts: 37
ReverendNinjaSox Offline
Junior Member
ReverendNinjaSox  Offline
Junior Member

Joined: Oct 2002
Posts: 37
Nope. You can't insert Perl directly into HTML unless you are running ASP or SSI. You should create a seperate file containing that and then call it. If someone mentioned they know a way to do it using Javascript, I'd recommend doing it that way unless you really wanted to be creative about it. Then learn how I'd do it.

#18936 - 10/22/02 09:33 PM Re: slideshow  
Joined: Apr 2002
Posts: 730
Moffesto Offline
UGN Supporter
Moffesto  Offline
UGN Supporter

Joined: Apr 2002
Posts: 730
Kuntucky
what do i call the separate file? like whats the extension name i need to use?


2 people can keep a secret as long as one is dead
#18937 - 10/23/02 02:34 AM Re: slideshow  
Joined: Oct 2002
Posts: 37
ReverendNinjaSox Offline
Junior Member
ReverendNinjaSox  Offline
Junior Member

Joined: Oct 2002
Posts: 37
.penis if you own the webserver and can set that up. Otherwise call it .cgi and put it in a cgi-bin directory.

Sponsored Links
#18938 - 10/23/02 03:07 AM Re: slideshow  
Joined: Mar 2002
Posts: 217
Asteos Offline
Member
Asteos  Offline
Member

Joined: Mar 2002
Posts: 217
Nadia
lol @ .penis. We got comedian coders.


=~ s/boredom/ studies/g
#18939 - 10/24/02 12:40 AM Re: slideshow  
Joined: Apr 2002
Posts: 730
Moffesto Offline
UGN Supporter
Moffesto  Offline
UGN Supporter

Joined: Apr 2002
Posts: 730
Kuntucky
sweet


2 people can keep a secret as long as one is dead
#18940 - 12/07/02 04:09 AM Re: slideshow  
Joined: Sep 2002
Posts: 71
BlackSpider Offline
Junior Member
BlackSpider  Offline
Junior Member

Joined: Sep 2002
Posts: 71
Try this, I dunno if its exactlly what your looking for, but its a cool slide show...

Code:
<script language=JavaScript type=text/javascript>
<!--
// JavaScript
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

// Jump into frames
//if (self==top) { top.location.href="webdesign.html"; }

// Code for the DHTML animation
// Modified from original created by:
// http://www.sebchevrel.com - cheers Seb!
var topx=0;
var ttx=0;
var otopx=0;
var otopx2=0;
var px=0;
var opx=0;
var numItems=8;
var winW=0;
var contentW=0;
var HW=0;
var prjNum=0;
var projectNum=0;
var offsetW=180;
var scrDirection=0;
var showProject=0;
var viewNum=0;

function init() {
	startMouseCapture();
	winW=getwindowWidth();
	contentW=(numItems+1)*220;
	TW=1550-winW;
	HW=contentW;		// amount to scroll
	lastx=mouseX;		// last mouse coord, for movement detection
	leftX=250;			// left scroll hot zone
	rightX=550;			// right
	scrollm=80;			// minimum scroll (first)
	scrollM=-HW+750-220;// maximum scroll (last) 750:=winW
	px=120;				// initial position
	opx=0;				// last position
	vx=0;				// initial velocity def: -200
	minmove=5;			// minimum mouse movement to trigger scroll/stop (in pixels)
	speed=32;			// maximum scroll speed at edge (in pixels/frame) def: 128
	lastsign=0;
	// Let's rock!
	animate();
}		

function endProject() { // Returns back to the list
	MM_showHideLayers('instruct','','hide');
	MM_showHideLayers('overlay'+projectNum,'','hide');
	if (projectNum+2 <=numItems) {MM_showHideLayers('project'+(projectNum+2),'','show');}
	MM_showHideLayers('selectorback','','show');
	MM_showHideLayers('basePos','','show');
	MM_showHideLayers('selectorbar','','show');
	prjNum=0; projectNum=0;
	showProject=0;
	// if (viewNum==3) {location.reload();viewNum=0;} // Refresh page after 3 project views to stop slowdown bug
}

function viewProject(prjNum) { // View details of a particular project
	if (prjNum>0 & showProject==0) {
		projectNum=prjNum;
		if (px+(projectNum*220)>315) { scrDirection=670; }
		else if (px+(projectNum*220)<285) {scrDirection=130; }
		else {scrDirection=400;}
	}
	else { endProject(); }
	
}

function animate() {
	// Top image movements
	if (mouseX>offsetW) {
		txa=(winW*(mouseX-offsetW))/(winW-offsetW);
		tx=txa/winW * HW -160;		// menu target
		ttx2=txa/winW * TW;
	} else {
		tx=1/winW * HW -160;
		ttx2=1/winW * TW;
	}

	topx2=(otopx2-ttx2)/2;
	
	// **** Start project scroll ****
	if (showProject==0 ) {



	// Track mouse speed and last moving direction above threshold
	x=mouseX;
	if (projectNum>0) { x=scrDirection; } //Start moving to project
	dx=x-lastx; lastx=x;
	if (dx>0) { dxsign=-1; if (dx>minmove) lastsign=-1; }
	else if (dx<0) { dxsign=1; dx=-dx; if (dx>minmove) lastsign=1; }
	else dxsign=0;
	
	// Scroll Zones
	if (x<leftX)  {
		a=(leftX-x)/leftX;					// normalize scroll speed within zone
		if (lastsign==-1) vx*=0.6;			// if last move reverse direction, stop
		else if (lastsign==1) vx=a*speed;	// if last move forward, scroll at normalized speed
	}
	
	if (x>rightX) {
		a=(x-rightX)/leftX;
		if (lastsign==1) vx*=0.6;
		else if (lastsign==-1) vx=-a*speed;
	}
	
	// Apply speed and friction
	px+=vx;
	vx*=0.8;
	px=Math.round(px);

	// Boundaries Check
	if (px>scrollm) px=scrollm;
	else if (px< scrollM) px=scrollM;

	// Only move the layers if necessary				
	if (px!=opx) {
		txsel=Math.round(164-(px*0.089));
		Movelayer('selectorback',txsel,171);
		for (i=1; i<=numItems; i++) {
			tpx=px+(i-1)*220;
 			//MoveClippedLayer('project'+i,tpx-80,0);
			if ( (tpx>-220) && (tpx<720) ) { MM_showHideLayers('project'+i,'','show'); MoveClippedLayer('project'+i,tpx-80,0); }
			else MM_showHideLayers('project'+i,'','hide');
		}
	}
	opx=px;	
	}
	// end project scroll
	
	// Check to see whether at project #, if requested
	if (projectNum!=0 & showProject==0) {
		if (px+(projectNum*220)>285 & px+(projectNum*220)<315) {
			showProject=1;viewNum++;
			MM_showHideLayers('selectorback','','hide');
			MM_showHideLayers('selectorbar','','hide');
			MM_showHideLayers('basePos','','hide');
			MM_showHideLayers('overlay'+projectNum,'','show');
			MM_showHideLayers('instruct','','show');
			if (projectNum+2 <= numItems) {MM_showHideLayers('project'+(projectNum+2),'','hide');} // hide the project still showing
			srcDirection=0;
		}
	}
	
	// Set selector bar position
	sbx=(mouseX/winW)*67;
	if (sbx<12) sbx=12;
	if (sbx>67) sbx=67;
	
	if ( Math.abs(topx2-otopx)>1) {	Movelayer('topstrip',topx2,0);}
	Movelayer('selectorbar',txsel+sbx,172);
	// Movelayer('digits2',mouseX-2500,273);
	otopx2=topx2;
	setTimeout('animate()',30);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW &#0124;&#0124; innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>


Member Spotlight
Crime
Crime
SC, usa
Posts: 506
Joined: March 2002
Show All Member Profiles 
Forum Statistics
Forums45
Topics47,517
Posts82,687
Average Daily Posts7
Members2,159
Most Online1,567
Apr 25th, 2010
Latest Postings
Top Posters(All Time)
UGN Security 40,681
Gremelin 7,195
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Liked Users (All Time)
§intå× Likes: 1
Cold Sunn Likes: 1
Crime Likes: 1
Cyrez Likes: 1
Ghost Likes: 1
Gremelin Likes: 4
Ice Likes: 1
unreal Likes: 1
Top Liked Users (30 Days)
No Data Found
Powered by UBB.threads™ PHP Forum Software 7.6.0
(Snapshot build 20160902)