1
wishdragon
Random pic slideshow code

Anyone know of a site out there with a html generator for a random screenshot slide show? Basically meaning each time a user goes to the page tha has the slide show it will start the slide with a random shot?

2
Bassman
Re: Random pic slideshow code
  • 2005/4/1 3:29

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


Not sure if this is what you want, but take a look at this, i've used the script before and it works fine.

3
wishdragon
Re: Random pic slideshow code

unless im not understanding that rifght it looks like thats more or a random rotating pic or something. Basiaclly what I am saying is just html code to place in a block that will produce a screen shot slide show. in the slide show code you will have to enter the urls of where the images are stored. when ever a user goes to the page that block is stored on it will make the slide show begin, but each time it begins it will be with a random screen, instead of same one everytime.

but i may be reading the one you posted incorrectly, ill look more at it.

4
wishdragon
Re: Random pic slideshow code

ok i think i read it wrong, thought it was saying it rotates the images or something, looks like it may work like i want. ill have to look more at it since all i wanted was just some basic html insert, this may be better but ill have to see. thx for the post :)

5
davidthomas1
Re: Random pic slideshow code

The myalbum module has a random picture block. You can choose the category to display from. You can also choose the image display size and rotation time.

If you just upload your slideshow photos to a myalbum category, the block will rotate and display them for you.

6
wishdragon
Re: Random pic slideshow code

for some reason myalbum never installs right for me. always says it is but never works always get a internal error.

7
davidthomas1
Re: Random pic slideshow code

I meant to say myalbum-p, they're different right? (myalbum and myalbum-p)

In any case, the problem may be caused by the .htaccess files in myalbum-p folders. You should delete them before uploading and installing the module.

Alternatively, you could use a FTP program or CPanel File Manager to delete the .htaccess files yourself after install.

That should work.

8
wishdragon
Re: Random pic slideshow code
  • 2005/4/3 22:00

  • wishdragon

  • Just popping in

  • Posts: 44

  • Since: 2005/1/13


Hmm, myalbum-p is working fine since i deleted that file you mentioned, buit i cannot see anywhere how to make it run a slide show.

9
davidthomas1
Re: Random pic slideshow code

You have to make the block visible. Admin>System>Blocks

The block's name is : Pic Up Photo (odd name)

you can edit it's settings to choose category, width etc...

hope it helps,

D.

10
bordacs
Re: Random pic slideshow code
  • 2006/2/14 17:11

  • bordacs

  • Just popping in

  • Posts: 27

  • Since: 2003/2/4 1


It doesn't work for me.
No slideshow regardless of the interval.
I looked at the code and I didn't find the cycling routine so it seems that this is unfinished yet.
Anybody have an idea to implement this feature?
Here it is:

function b_myalbum_rphoto_show( $options )
{
global $xoopsDB ;

// For myAlbum-P < 2.70
if( strncmp( $options[0] , 'myalbum' , 7 ) != 0 ) {
$photos_num = intval( $options[1] ) ;
$box_size = intval( $options[0] ) ;
$mydirname = 'myalbum' ;
} else {
$photos_num = intval( $options[2] ) ;
$box_size = intval( $options[1] ) ;
$mydirname = $options[0] ;
}
$cat_limitation = empty( $options[3] ) ? 0 : intval( $options[3] ) ;
$cat_limit_recursive = empty( $options[4] ) ? 0 : 1 ;
$cycle = empty( $options[5] ) ? 60 : intval( $options[5] ) ;
$cols = empty( $options[6] ) ? 1 : intval( $options[6] ) ;

include( XOOPS_ROOT_PATH."/modules/$mydirname/include/read_configs.php" ) ;

// Category limitation
if( $cat_limitation ) {
if( $cat_limit_recursive ) {
include_once( XOOPS_ROOT_PATH."/class/xoopstree.php" ) ;
$cattree = new XoopsTree( $table_cat , "cid" , "pid" ) ;
$children = $cattree->getAllChildId( $cat_limitation ) ;
$whr_cat = "cid IN (" ;
foreach( $children as $child ) {
$whr_cat .= "$child," ;
}
$whr_cat .= "$cat_limitation)" ;
} else {
$whr_cat = "cid='$cat_limitation'" ;
}
} else {
$whr_cat = '1' ;
}

// WHERE clause for ext
// $whr_ext = "ext IN ('" . implode( "','" , $myalbum_normal_exts ) . "')" ;
$whr_ext = "1" ;

$block = array() ;
$myts =& MyTextSanitizer::getInstance() ;

// Get number of photo
$result = $xoopsDB->query( "SELECT count(lid) FROM $table_photos WHERE status>0 AND $whr_cat AND $whr_ext" ) ;
list( $numrows ) = $xoopsDB->fetchRow( $result ) ;
if( $numrows < 1 ) return $block ;

if( $numrows <= $photos_num ) {
$result = $xoopsDB->query( "SELECT lid , cid , title , ext , res_x , res_y , submitter , status , date AS unixtime , hits , rating , votes , comments FROM $table_photos WHERE status>0 AND $whr_cat AND $whr_ext" ) ;
} else {
$result = $xoopsDB->query( "SELECT lid FROM $table_photos WHERE status>0 AND $whr_cat AND $whr_ext" ) ;
$lids = array() ;
$sel_lids = array() ;
while( list( $lid ) = $xoopsDB->fetchRow( $result ) ) $lids[] = $lid ;
srand( intval( time() / $cycle ) * $cycle ) ;
$sel_lids = array_rand( $lids , $photos_num ) ;
if( is_array( $sel_lids ) ) {
$whr_lid = '' ;
foreach( $sel_lids as $key ) $whr_lid .= $lids[ $key ] . "," ;
$whr_lid = substr( $whr_lid , 0 , -1 ) ;
} else {
$whr_lid = $lids[ $sel_lids ] ;
}
$result = $xoopsDB->query( "SELECT lid , cid , title , ext , res_x , res_y , submitter , status , date AS unixtime , hits , rating , votes , comments FROM $table_photos WHERE status>0 AND lid IN ($whr_lid)" ) ;
}

$count = 1 ;
while( $photo = $xoopsDB->fetchArray( $result ) ) {
$photo['title'] = $myts->makeTboxData4Show( $photo['title'] ) ;
$photo['suffix'] = $photo['hits'] > 1 ? 'hits' : 'hit' ;
$photo['date'] = formatTimestamp( $photo['unixtime'] , 's' ) ;
$photo['thumbs_url'] = $thumbs_url ;

if( in_array( strtolower( $photo['ext'] ) , $myalbum_normal_exts ) ) {
// width&height attirbs for <img>
if( $box_size <= 0 ) {
$photo['img_attribs'] = "" ;
} else {
// list( $width , $height , $type ) = getimagesize( "$thumbs_dir/{$photo['lid']}.{$photo['ext']}" ) ;
list( $width , $height , $type ) = getimagesize( "$photos_dir/{$photo['lid']}.{$photo['ext']}" ) ;
if( $width > $box_size || $height > $box_size ) {
if( $width > $height ) $photo['img_attribs'] = "width='$box_size'" ;
else $photo['img_attribs'] = "height='$box_size'" ;
} else {
$photo['img_attribs'] = "" ;
}
}
} else {
$photo['ext'] = 'gif' ;
$photo['img_attribs'] = '' ;
}

$block['photo'][$count++] = $photo ;
}
$block['mod_url'] = $mod_url ;
$block['cols'] = $cols ;

return $block ;
}

Login

Username:
Password:

Lost Password? Register now!

Who's Online

57 user(s) are online (28 user(s) are browsing Support Forums)


Members: 0


Guests: 57


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits