UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store
 

Network Sites UGN Security, The GoNix Initiative, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
Sponsored Links
Latest Postings
The History Thread...
by Gremelin
09/18/14 12:42 PM
Doom 3
by Cyrez
09/11/14 11:58 PM
Latest Reviews
Topic Options
Rate This Topic
#18928 - 10/18/02 05:05 AM slideshow
Moffesto Offline
UGN Supporter

Registered: 04/22/02
Posts: 730
Loc: 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

Top
Sponsored Links
      
#18929 - 10/18/02 03:03 PM Re: slideshow
BackSlash Offline
UGN's Resident Homo

Registered: 03/16/02
Posts: 599
Loc: 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."

Top
#18930 - 10/18/02 03:56 PM Re: slideshow
ReverendNinjaSox Offline
Junior Member

Registered: 10/03/02
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.

Top
#18931 - 10/18/02 07:57 PM Re: slideshow
Le4rner Offline
UGN Supporter

Registered: 03/05/02
Posts: 562
My BBS uses a JavaScript to read the contents of a directory for smiles, and avantars
_________________________
http://promodtecnologies.com/rrfn

Top
#18932 - 10/20/02 10:09 PM Re: slideshow
Moffesto Offline
UGN Supporter

Registered: 04/22/02
Posts: 730
Loc: 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

Top
#18933 - 10/21/02 07:42 AM Re: slideshow
ReverendNinjaSox Offline
Junior Member

Registered: 10/03/02
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.

Top
#18934 - 10/21/02 07:22 PM Re: slideshow
Moffesto Offline
UGN Supporter

Registered: 04/22/02
Posts: 730
Loc: 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

Top
#18935 - 10/22/02 12:20 PM Re: slideshow
ReverendNinjaSox Offline
Junior Member

Registered: 10/03/02
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.

Top
#18936 - 10/22/02 05:33 PM Re: slideshow
Moffesto Offline
UGN Supporter

Registered: 04/22/02
Posts: 730
Loc: 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

Top
#18937 - 10/22/02 10:34 PM Re: slideshow
ReverendNinjaSox Offline
Junior Member

Registered: 10/03/02
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.

Top
#18938 - 10/22/02 11:07 PM Re: slideshow
Asteos Offline
Member

Registered: 03/04/02
Posts: 217
Loc: Nadia
lol @ .penis. We got comedian coders.
_________________________
=~ s/boredom/ studies/g

Top
#18939 - 10/23/02 08:40 PM Re: slideshow
Moffesto Offline
UGN Supporter

Registered: 04/22/02
Posts: 730
Loc: Kuntucky
sweet
_________________________
2 people can keep a secret as long as one is dead

Top
#18940 - 12/06/02 11:09 PM Re: slideshow
BlackSpider Offline
Junior Member

Registered: 09/23/02
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>

Top

Moderator:  §intå×, Gremelin 
Featured Member
Registered: 08/22/14
Posts: 1
Forum Stats
2148 Members
46 Forums
34735 Topics
69905 Posts

Max Online: 1567 @ 04/25/10 05:20 AM
Top Posters
UGN Security 27897
Gremelin 7193
§intå× 3255
SilentRage 1273
Ice 1146
pergesu 1136
Infinite 1041
jonconley 955
Girlie 908
unreal 860
Newest Members
Tim050, Gecko666, defghi795767, Devo60, ali
2148 Registered Users
Who's Online
0 registered (), 428 Guests and 281 Spiders online.
Key: Admin, Global Mod, Mod
Latest News


Donate
  Get Firefox!
Get FireFox!