Gallery mod SP1.31 Beta 2 Hello Yabbers, this mod integrates a gallery in the YaBB-board. **** Installation **** ( - uninstall BETA 1 ) - files : english.lng , Admin.pl , AdminEdit.pl , Display.pl , Profile.pl , SubList.pl , Subs.pl - apply the mod. - set the perl-path at the first line in GALLERY.PL and copy it in your /Sources folder , chmod 777 ! - copy the 2 empty files GALLERYALB.TXT and GALLERYPUB.TXT in your /Members folder , chmod them 666 ! - upload all GIFs in your /YaBBImages folder. - make a album folder for example : public_html/Gallery/ , chmod 777 ! - to setup the gallery : fill-in the gallery-fields in "FORUM PREFERENCES AND SETTINGS" in the Admin Center and the "GALLERY MEMBER SETTINGS" - maybe you have to change some chmods if it doesn't work... **** Upgrades **** - create/rename/delete/publish album - upload/rename/delete fotos/zip/tar - public albums - individual description,view - caption ( you can use html-tags ) - profil-link and post-link - support frontpage-pages !!! thumbnailmaker doesn't work !!! **** Explanations **** - PROFILE- and POSTLINK shows only PUBLISHED ALBUMS from member. - if GUESTACCESS is enabled and access for a user is disabled , then the USER CAN ACCESS AS GUEST. - GUEST can access on PUBLIC ALBUMS. - RIGHTS : ACCESS - rename album, rename fotos, edit info UPLOAD - all without publish PUBLISH - publish MODERATOR - all and access to all albums - ACCESS is necessary for the 3 other RIGHTS - UPLOAD max 5 fotos + 1 zip at once. General limits can be set in admin-center. - UPLOAD THUMBNAILS FIRST, then the fotos, because if you reach limit you cannot upload more. - if you uploaded the Fotos and enabled the thumbnail, but didn't uploaded thumbnails then you will see placeholders. so you have to disable thumbnail or upload them to see the fotos. - in EDIT INFO you only can set PERSONAL SETTINGS if admin allowed. **** Testboard **** http://www.archiboard.de/TESTBOARD/cgi-bin/yabb/YaBB.pl login: test pw: test login: test2 pw: test2 **** Credits **** Versions for SP1.1 and SP1.31 are available. Big Thanx to Brain Brian, caliman, Dam Yankee, delrick, DocRST, Gilles, Ikari-Kun, Javvy, Jazhawk, LoonyPandora, Michael Prager, Mr God Sir [Christer], mzbeanz, Panther, Parham, Poltergeist, qersys, tenl, T-Master, WeBRecka[ZG], Wiehemeier, Xonder for help and testing. On this way i can give a little bit back to the YaBB-community ;-) Please help me to develop this mod. **** Copyright by Le Trong Hoang **** Use of this code is not allowed outside the copyright holder's intentions. I spent a month of work, some days over 5 hours to create that mod, so please be fair. This mod can use for non-commercial YaBB-boards. Use on commercial boards is forbidden until I give permission . Changing code or implement it in another mod or program is forbidden until I give permission. This mod can use by hackers to shot your webserver ! I will not stand responsible for any damage done to your server via this script. Le Trong Hoang http://www.archiboard.de english.lng if($MenuType == 1) { ### Gallery mod Beta 2 #### $galltxt{'1'} = "Gallery Settings"; $galltxt{'2'} = "Enable gallery"; $galltxt{'3'} = "Absolute Directory to gallery ('/home/yourdomain/yabb/public_html/Gallery')"; $galltxt{'4'} = "Relative Directory to gallery ('../../public_html/Gallery')"; $galltxt{'5'} = "Enable guest-access"; $galltxt{'6'} = "Enable post-link"; $galltxt{'7'} = "Enable profile-link"; $galltxt{'8'} = "Enable personal settings"; $galltxt{'9'} = "Standards"; $galltxt{'10'} = "Enable description"; $galltxt{'11'} = "Description"; $galltxt{'12'} = "Enable artist"; $galltxt{'13'} = "Artist"; $galltxt{'14'} = "Enable caption"; $galltxt{'15'} = "Enable personal view"; $galltxt{'16'} = "Height of fotos"; $galltxt{'17'} = "[pixels] (blank = show originals size)"; $galltxt{'18'} = "Columns of fotos"; $galltxt{'19'} = "Enable thumbnails (disable = show originals)"; $galltxt{'20'} = "Names of thumbnails start with"; $galltxt{'21'} = "Height of thumbnails for thumbnailmaker"; $galltxt{'22'} = "Enable zip / tar"; $galltxt{'23'} = "Upload limits"; $galltxt{'24'} = "Max albums"; $galltxt{'25'} = "Max album fotos"; $galltxt{'26'} = "Max album size [bytes]"; $galltxt{'27'} = "Max gallery fotos"; $galltxt{'28'} = "Max gallery size [bytes]"; $galltxt{'29'} = "Gallery Member Settings"; $galltxt{'30'} = "Member"; $galltxt{'31'} = "Codes"; $galltxt{'32'} = "Access"; $galltxt{'33'} = "Upload"; $galltxt{'34'} = "Publish"; $galltxt{'35'} = "Moderator"; $galltxt{'36'} = "All"; $galltxt{'37'} = "Public albums"; $galltxt{'38'} = "Gallery"; $galltxt{'39'} = "Create album"; $galltxt{'40'} = "Rename"; $galltxt{'41'} = "Delete"; $galltxt{'42'} = "Upload fotos"; $galltxt{'43'} = "Thumbnails"; $galltxt{'44'} = "Edit info"; $galltxt{'45'} = "Albums"; $galltxt{'46'} = "Privat album"; $galltxt{'47'} = "Published album"; $galltxt{'48'} = "Public album"; $galltxt{'49'} = "Enabled"; $galltxt{'50'} = "Disabled"; $galltxt{'51'} = "Albumname :"; $galltxt{'52'} = "Do you really want rename"; $galltxt{'53'} = " to "; $galltxt{'54'} = "Do you really want delete"; $galltxt{'55'} = "Do you really want "; $galltxt{'56'} = "Unpublish"; $galltxt{'57'} = "Album"; $galltxt{'58'} = "Fotos"; $galltxt{'59'} = "Size"; $galltxt{'60'} = "Limits"; $galltxt{'61'} = "Contents"; $galltxt{'62'} = "Select files"; $galltxt{'63'} = "zip / tar"; $galltxt{'66'} = "Personal Settings"; $galltxt{'67'} = "Admin Settings"; $galltxt{'68'} = "[blank]"; $galltxt{'69'} = "Save"; $galltxt{'70'} = "Captions"; $galltxt{'71'} = "Can't create a new album, because name already exist or contains unallowed signs or ending !
Please try with another name."; $galltxt{'72'} = "Can't rename, because name already exist or contains unallowed signs or ending !
Please try with another name."; $galltxt{'73'} = "Upload thumbnails first. They have to start with : "; $galltxt{'74'} = "Can't write : "; $galltxt{'75'} = "Can't create a new album, because reached limit."; $galltxt{'76'} = "Can't upload, because reached limit.";
$img{'website_sm'} = qq~$txt{'515'}~; $img{'gallery'} = qq~$galltxt{'38'}~; $img{'website_sm'} = qq~$txt{'515'}~; $img{'gallery'} = qq~$galltxt{'38'}~; Sources/Admin.pl - $txt{'764'}
- $galltxt{'29'}
Sources/AdminEdit.pl sub SetReserve { sub SetGallery { &is_admin; $yymain .= qq~
~; fopen(LIST, "$memberdir/memberlist.txt"); fopen(GALLERY, "$memberdir/gallerymb.txt"); @member = ; @galinfo = ; chomp(@member); chomp(@galinfo); fclose(LIST); fclose(GALLERY); my @mbnamesx; my @mbcodesx; my @mbaccx; my @mbuplx; my @mbpubx; my @mbmodx; my @mbnames; my @mbcodes; my @mbacc; my @mbupl; my @mbpub; my @mbmod; foreach(@galinfo) { my @Mb=split(/ /,$_); push(@mbnamesx,$Mb[0]); push(@mbcodesx,$Mb[1]); my @Mbrights=split(//,$Mb[2]); push(@mbaccx,$Mbrights[0]); push(@mbuplx,$Mbrights[1]); push(@mbpubx,$Mbrights[2]); push(@mbmodx,$Mbrights[3]); } my @newmember=@member; my $jn=join(" ",@mbnamesx); my $count=0; foreach(@member) { if(index($jn,$_) >= 0) { splice(@newmember,$count,1); } else { $count++; } } push(@mbnamesx,@newmember); my @galmb; my @mbsort=sort(@mbnamesx); my $mbnum=@mbsort; my $mbnumb=@mbnamesx; for(my $i=0;$i<=$mbnum;$i++) { for(my $j=0;$j<=$mbnumb;$j++) { if($mbsort[$i] eq $mbnamesx[$j]) { push(@galmb,"$mbnamesx[$j] $mbcodesx[$j] $mbaccx[$j]$mbuplx[$j]$mbpubx[$j]$mbmodx[$j]"); } } } splice(@galmb,$mbnum); foreach(@galmb) { my @Mb=split(/ /,$_); push(@mbnames,$Mb[0]); if($Mb[1]) { push(@mbcodes,$Mb[1]); } else { my $random=int rand(99999999); $random=sprintf ("%08d", $random); push(@mbcodes,$random); } my @Mbrights=split(//,$Mb[2]); push(@mbacc,$Mbrights[0]); push(@mbupl,$Mbrights[1]); push(@mbpub,$Mbrights[2]); push(@mbmod,$Mbrights[3]); } $yymain .= qq~ ~; $yymain .= qq~~; $count=0; foreach(@mbnames) { $yymain .= qq~~; $count++; } $yymain .= qq~
$galltxt{'29'}
$galltxt{'30'} $galltxt{'31'} $galltxt{'32'} $galltxt{'33'} $galltxt{'34'} $galltxt{'35'}
$galltxt{'36'}

~; &template; exit; } sub SetGallery2 { &is_admin; my @mbname=split(/, /,$FORM{'name'}); my @mbcode=split(/, /,$FORM{'code'}); my @mbacc; my @mbupl; my @mbpub; my @mbmod; my @acc=split(/, /,$FORM{'access'}); foreach(@acc) { $mbacc[$_]="1"; } my @upl=split(/, /,$FORM{'upload'}); foreach(@upl) { $mbupl[$_]="1"; } my @pub=split(/, /,$FORM{'publish'}); foreach(@pub) { $mbpub[$_]="1"; } my @mod=split(/, /,$FORM{'moderator'}); foreach(@mod) { $mbmod[$_]="1"; } my @Mbinfo; my $mbnum=@mbname; for(my $i=0;$i<=$mbnum;$i++) { if(!$mbacc[$i]) { $mbacc[$i]="0" } if(!$mbupl[$i]) { $mbupl[$i]="0" } if(!$mbpub[$i]) { $mbpub[$i]="0" } if(!$mbmod[$i]) { $mbmod[$i]="0" } $Mbinfo[$i]="$mbname[$i] $mbcode[$i] $mbacc[$i]$mbupl[$i]$mbpub[$i]$mbmod[$i]\n"; } if(!$mbname[$mbnum]) { splice(@Mbinfo,$mbnum); } fopen(FILE, ">$memberdir/gallerymb.txt"); print FILE @Mbinfo; fclose(FILE); $yySetLocation = qq~$cgi;action=admin~; &redirectexit; }
if ($timeselected == 6) { $tsl6 = " selected" } elsif ($timeselected == 5) { $tsl5 = " selected" } elsif ($timeselected == 4) { $tsl4 = " selected" } elsif ($timeselected == 3) { $tsl3 = " selected" } elsif ($timeselected == 2) { $tsl2 = " selected" } else { $tsl1 = " selected" } if ($allowgal) { $allowgalchecked = "checked" } if ($allowgst) { $allowgstchecked = "checked" } if ($allowpstlnk) { $allowpstlnkchecked = "checked" } if ($allowprolnk) { $allowprolnkchecked = "checked" } if ($allowset) { $allowsetchecked = "checked" } if ($ad_descrip_on) { $ad_descrip_onchecked = "checked" } if ($ad_fotograf_on) { $ad_fotograf_onchecked = "checked" } if ($ad_caption_on) { $ad_caption_onchecked = "checked" } if ($ad_view_on) { $ad_view_onchecked = "checked" } if ($ad_thumbs_on) { $ad_thumbs_onchecked = "checked" } if ($ad_zip_on) { $ad_zip_onchecked = "checked" }
$galltxt{'1'} $galltxt{'2'} $galltxt{'3'} $galltxt{'4'} $galltxt{'5'} $galltxt{'6'} $galltxt{'7'} $galltxt{'8'} $galltxt{'9'} $galltxt{'10'} $galltxt{'11'} $galltxt{'12'} $galltxt{'13'} $galltxt{'14'} $galltxt{'15'} $galltxt{'16'} $galltxt{'17'} $galltxt{'18'} $galltxt{'19'} $galltxt{'20'} $galltxt{'21'} $galltxt{'22'} $galltxt{'23'} $galltxt{'24'} $galltxt{'25'} $galltxt{'26'} $galltxt{'27'} $galltxt{'28'}
# Set as 0 or 1 if box was checked or not push(@onoff, "allowgal", "allowgst", "allowpstlnk", "allowprolnk", "allowset", "ad_descrip_on", "ad_fotograf_on", "ad_caption_on", "ad_view_on", "ad_thumbs_on", "ad_zip_on"); # Set as 0 or 1 if box was checked or not $allowgal = $FORM{'allowgal'} ? 1 : 0; $allowgst = $FORM{'allowgst'} ? 1 : 0; $allowpstlnk = $FORM{'allowpstlnk'} ? 1 : 0; $allowprolnk = $FORM{'allowprolnk'} ? 1 : 0; $allowset = $FORM{'allowset'} ? 1 : 0; $ad_descrip_on = $FORM{'ad_descrip_on'} ? 1 : 0; $ad_fotograf_on = $FORM{'ad_fotograf_on'} ? 1 : 0; $ad_caption_on = $FORM{'ad_caption_on'} ? 1 : 0; $ad_view_on = $FORM{'ad_view_on'} ? 1 : 0; $ad_thumbs_on = $FORM{'ad_thumbs_on'} ? 1 : 0; $ad_zip_on = $FORM{'ad_zip_on'} ? 1 : 0; $timeoffset = $FORM{'timeoffset'} || 0; $galleryabs = $FORM{'galleryabs'} || "$boardurl/Gallery"; $galleryrel = $FORM{'galleryrel'} || "$boarddir/Gallery"; $ad_descrip = $FORM{'ad_descrip'} || ""; $ad_fotograf = $FORM{'ad_fotograf'} || ""; $ad_ft_height = $FORM{'ad_ft_height'} || ""; $ad_ft_col = $FORM{'ad_ft_col'} || 4; $ad_th_name = $FORM{'ad_th_name'} || "th_"; $ad_th_height = $FORM{'ad_th_height'} || 150; $maxalbum = $FORM{'maxalbum'} || ""; $maxfoto = $FORM{'maxfoto'} || ""; $maxsize = $FORM{'maxsize'} || ""; $maxgalfoto = $FORM{'maxgalfoto'} || ""; $maxgalsize = $FORM{'maxgalsize'} || ""; ########## Feature Settings ########## ########## Gallery Settings ########## \$allowgal = "$allowgal"; # enable gallery \$galleryabs = "$galleryabs"; # /home/yourserverid/yourdomain/yabb/public_html/Album \$galleryrel = "$galleryrel"; # ../../public_html/Album \$allowgst = "$allowgst"; # enable guestaccess \$allowpstlnk = "$allowpstlnk"; # enable postlink \$allowprolnk = "$allowprolnk"; # enable profilelink \$allowset = "$allowset"; # enable personal settings \$ad_descrip_on = "$ad_descrip_on"; # enable description \$ad_descrip = "$ad_descrip"; # description \$ad_fotograf_on = "$ad_fotograf_on"; # enable fotograf \$ad_fotograf = "$ad_fotograf"; # fotograf \$ad_caption_on = "$ad_caption_on"; # enable caption \$ad_view_on = "$ad_view_on"; # enable personal view \$ad_ft_height = "$ad_ft_height"; # height of fotos \$ad_ft_col = "$ad_ft_col"; # column of fotos \$ad_thumbs_on = "$ad_thumbs_on"; # enable thumbnails \$ad_th_name = "$ad_th_name"; # names of thumbnails start with \$ad_th_height = "$ad_th_height"; # height of thumbnails \$ad_zip_on = "$ad_zip_on"; # enable zip / tar \$maxalbum = "$maxalbum"; # max albums limit \$maxfoto = "$maxfoto"; # max album foto limit \$maxsize = "$maxsize"; # max album size limit \$maxgalfoto = "$maxgalfoto"; # max gallery foto limit \$maxgalsize = "$maxgalsize"; # max gallery size limit Sources/Display.pl $sendm = qq~$menusep$img{'message_sm'}~; if($allowpstlnk) { my $uname=lc($musername); $sendm .= qq~ $galltxt{'37'}~; } Sources/Profile.pl $memsettings[3] $memsettings[3]~; if($allowprolnk) { my $uname=lc($INFO{'username'}); $yymain .= qq~$galltxt{'38'}:$galltxt{'37'}~; } $yymain .= qq~ Sources/SubList.pl %director=( 'setgallery',"AdminEdit.pl&SetGallery", 'setgallery2',"AdminEdit.pl&SetGallery2", 'gallery',"Gallery.pl&Gallery", 'albcrt',"Gallery.pl&albcrt", 'albren',"Gallery.pl&albren", 'albdel',"Gallery.pl&albdel", 'albpub',"Gallery.pl&albpub", 'fotoupl',"Gallery.pl&fotoupl", 'fotoren',"Gallery.pl&fotoren", 'fotodel',"Gallery.pl&fotodel", 'editinfo',"Gallery.pl&editinfo", 'caption',"Gallery.pl&caption", Sources/Subs.pl if($settings[7] eq 'Administrator') { $yymenu .= qq~$menusep$img{'admin'}~; } if($allowgal) { $yymenu .= qq~$menusep$img{'gallery'}~; } if ($ENV{REQUEST_METHOD} eq 'POST') { if ($ENV{CONTENT_TYPE} =~ /multipart\/form-data/) { require CGI; import CGI qw(:standard); my $query = new CGI; my $avatar = $query->param('umafile'); my $tmpfile = $query->tmpFileName($avatar); local( $/, *TMP ); open(TMP,"$tmpfile"); my $filedata = ; close(TMP); open(TMP2,">$umauploaddir/$avatar"); print TMP2 $filedata; close(TMP2); } else { read(STDIN, my $input, $ENV{CONTENT_LENGTH}); split_string(\$input, \%FORM) } } if ($ENV{REQUEST_METHOD} eq 'POST') { if ($ENV{CONTENT_TYPE} =~ /multipart\/form-data/){ require CGI; import CGI qw(:standard); my $query = new CGI; my $avatar = $query->param('umafile'); my $tmpfile = $query->tmpFileName($avatar); local( $/, *TMP ); open(TMP,"$tmpfile"); my $filedata = ; close(TMP); open(TMP2,">$umauploaddir/$avatar"); print TMP2 $filedata; close(TMP2); my $zipfile = $query->param('uplzip'); my $tmpfile = $query->tmpFileName($zipfile); local( $/, *TMP ); open(TMP,"$tmpfile"); my $filedata = ; close(TMP); open(TMP2,">$memberdir/$zipfile"); print TMP2 $filedata; close(TMP2); for(my $x=1;$x<=5;$x++) { $feld = "uplfoto".$x; my $file = $query->param($feld); my $tpfl = $query->tmpFileName($file); local( $/, *TMP ); open(TMP,"$tpfl"); my $filedata = ; close(TMP); open(TMP2,">$memberdir/$file"); print TMP2 $filedata; close(TMP2); } } else { read(STDIN, my $input, $ENV{CONTENT_LENGTH}); split_string(\$input, \%FORM) } }