Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

Random Photo Block Mod - Multiple Images
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Author Message
Lurking

Beginner
Beginner


Joined: Nov 03, 2003
Posts: 1

PostPosted: Tue Nov 04, 2003 2:44 pm    Post subject: Random Photo Block Mod - Multiple Images Reply with quote

I've taken the truly excellent NG-RandomImproved block and made a cheesy little mod to it, allowing multiple images from the gallery in the block.

It's not perfect, but it looks pretty good to me so far. See it at http://bruce.oec-sys.com and download it from there.

I'd love to see if someone can make it better. I also must say that the original block is terrific, and it was really nice to see something so easy to 'hack' into what I needed!

http://bruce.oec-sys.com [oec-sys.com]
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: Random Photo Block Mod - Multiple Images  

Back to top
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Tue Nov 04, 2003 2:52 pm    Post subject: Reply with quote

hey, that's a pretty sweet little mod you made Smile
i'll have to see what i can do with it, maybe making it similar to the updated album block (horizontal/vertical switch, number of thumbs, etc)...
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
achiral

Beginner
Beginner


Joined: Oct 29, 2003
Posts: 16

PostPosted: Tue Nov 04, 2003 3:07 pm    Post subject: Reply with quote

it would be really cool if you could incorporate the random photo and featured photo options into the one block
Back to top
Offline View user's profile Send private message
efurban

Beginner
Beginner


Joined: Nov 01, 2003
Posts: 5

PostPosted: Thu Nov 06, 2003 5:39 pm    Post subject: Reply with quote

it'll be really nice if the original block size can be kept. We can do the scrolling thing
for the multiple pics. Razz
I've seen it done somewhere before.
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Thu Nov 06, 2003 8:07 pm    Post subject: Reply with quote

i will definitely look into it Smile
i am out of town from about 5PM Eastern Time (US) tomorrow until Sunday evening and won't have access to my development servers. But I will start to work on it Monday.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
Aylwin

Novice
Novice


Joined: Sep 16, 2003
Posts: 27

PostPosted: Fri Nov 07, 2003 12:27 am    Post subject: Reply with quote

Bruce, your timing couldn't be better! Very Happy I absolutely love the random photo block and was just about to ask if anyone knew how to modify the block to display multiple photos. This is now fantastic! Very Happy

edit
I just tried to install it but I got the following error: Sad

Warning: rand() expects parameter 2 to be long, string given in /home/username/public_html/modules/gallery/random_support.php on line 236
ERROR: requested index [] out of bounds [9]
Fatal error: Call to a member function on a non-object in /home/username/public_html/modules/gallery/classes/Album.php on line 705

Help please?
edit
Back to top
Offline View user's profile Send private message Visit poster's website
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Fri Nov 07, 2003 1:23 am    Post subject: Reply with quote

i'm getting the same error as above...

http://getitindia.net (bottom right corner).

any ideas?
Back to top
Offline View user's profile Send private message
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Fri Nov 07, 2003 1:42 am    Post subject: Reply with quote

found on the gallery.menalto.com forums.

in random_support.php find this line:

Code:
$choose = rand(1, $count);

and replace it with
Code:
$choose = rand(1, (int) $count);


fyi
http://gallery.menalto.com/modules.php? ... ighlight=2


I just tried it and it works for me Very Happy
Back to top
Offline View user's profile Send private message
Aylwin

Novice
Novice


Joined: Sep 16, 2003
Posts: 27

PostPosted: Fri Nov 07, 2003 1:55 am    Post subject: Reply with quote

Steve, I wish I saw your post before trying to fix it myself. I don't know anything about PHP so I had to go about it the hard way. I've gotten it working now but I did it by modify my existing random_support.php file by trial and error. Embarassed

Well, as long as it works! Very Happy

By the way, what if I want 2 rows (e.g. 3 x 2)? Is that an easy mod?
Back to top
Offline View user's profile Send private message Visit poster's website
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Fri Nov 07, 2003 2:25 am    Post subject: Reply with quote

Stevesteve wrote: › found on the gallery.menalto.com forums.

in random_support.php find this line:

Code:
$choose = rand(1, $count);

and replace it with
Code:
$choose = rand(1, (int) $count);



Is slightly different but you should have looked in our FAQs - it's been there all the time!! Laughing

http://www.nukedgallery.net/faq-4-D.++E ... ges.html#6
_________________
"The only difference between me and a madman is that I'm not mad."
Back to top
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Fri Nov 07, 2003 3:26 am    Post subject: Reply with quote

Aylwin wrote: ›

By the way, what if I want 2 rows (e.g. 3 x 2)? Is that an easy mod?


Don't know i'm afraid, my php skills are best described as poor.... I want the exact same thing though (2 X 2), post here if you figure it out Laughing

Cheers,
Steve

p.s why would i check the faq, i need these little annoyances to complete my day Rolling Eyes .......
Back to top
Offline View user's profile Send private message
Aylwin

Novice
Novice


Joined: Sep 16, 2003
Posts: 27

PostPosted: Tue Nov 18, 2003 4:30 am    Post subject: Re: Random Photo Block Mod - Multiple Images Reply with quote

Steve, I figured it out! What a wonderful block this is! So easy to modify! Very Happy

It turns out, all I needed to do was copy/paste. Very Happy

Code: ›   else if ($selector=="MULTI"){
   $content="<table width=100% align=center><tr>";
   for ($npix=1;$npix<=$pixcount;$npix++){
     list($album, $index) = get_random_photo_id();
     $content .= multi_photo($album, $index,0);
   }
   $content .= "</tr></table>";
   $content .= "<br><table width=100% align=center><tr>";
   for ($npix=1;$npix<=$pixcount;$npix++){
     list($album, $index) = get_random_photo_id();
     $content .= multi_photo($album, $index,0);
   }
   $content .= "</tr></table>";
  }


As you can see it's simple copy paste. My only additional input was the <br>. I'm so proud of myself! Very Happy Don't laugh! I hardly know anything about PHP so this is quite an accomplishment for me. Embarassed

Now if I can just figure out how to make 3 rows...? Rolling Eyes Wink
Back to top
Offline View user's profile Send private message Visit poster's website
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Tue Nov 18, 2003 11:17 pm    Post subject: Reply with quote

how easy was that!

Don't know how to make three rows but i know how to do four......
Back to top
Offline View user's profile Send private message
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Mon Dec 08, 2003 9:51 pm    Post subject: Reply with quote

any ideas how to exclude a certain album from appearing in the random block? I have some photos that are not for kiddies so would prefer they were not shown in the block BUT still accessable via the gallery.

Cheers,
Steve
Back to top
Offline View user's profile Send private message
Stevesteve

Beginner
Beginner


Joined: Sep 09, 2003
Posts: 13

PostPosted: Mon Dec 08, 2003 10:07 pm    Post subject: Reply with quote

answered my own question...block only show pics viewable by EVERYONE, so just forced users to login to see that album.
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Blocks View previous topicPrinter friendly versionView next topic
Goto page 1, 2  Next

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSEO Search Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaCheap Web Design

6th year online! 2003-2009
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia