TinyPortal

Development => Block Codes => Topic started by: Thurnok on December 01, 2006, 09:32:24 AM

Title: [Block] SMF Gallery Random Picture
Post by: Thurnok on December 01, 2006, 09:32:24 AM
(Note: new features in red)

What it is:
This block displays random, newest, oldest, most/least viewed or commented picture(s) from your SMF Gallery mod inside a block of your choice.  Actually, it displays the thumbnail and links to the full picture.

Type of block:
This is a phpblock.  It can be any block/article position (left/right/center/front/article).  If you use it in a left/right block, you should set the columns to 1.  If you use a center/frontpage/article block, then set the columns to however many you want.

This block snippet can be used in multiple simultaneous blocks using the same or different configuration settings in each without issue.


Features:
Title: Re: [Block] SMF Gallery Random Picture
Post by: akulion on December 01, 2006, 11:10:23 AM
way out man!! now this is one heck of a well thought out and made block!! you rock! thanks :D
Title: Re: [Block] SMF Gallery Random Picture
Post by: whoesa on December 01, 2006, 11:17:38 AM
Wow great job done there! Thx a lot.  :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on December 02, 2006, 10:57:00 PM
Thanks guys...

Quick update - added capability to allow/disallow viewing based on allowedTo('smfgallery_view') permission.

So, you can either have it set so a user is required to have the View SMF Gallery permission in their membergroup, or you can allow members view the random pic (the thumbnail) even if they are not allowed to view the gallery.  They will not be able to view the full picture if that is the case, just the thumbnail in the Random Picture block.

Update in first post.
Title: Re: [Block] SMF Gallery Random Picture
Post by: ladybronwyn on December 10, 2006, 04:38:28 AM
this may be a stupid question.. but do i put this code in a php block or in the .php file itself?



i figured it out :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on December 10, 2006, 12:01:24 PM
AH!! Thank you Thurnok, works great on Dennis site :)

http://208.116.3.217/index.php
Title: Re: [Block] SMF Gallery Random Picture
Post by: Lum-chan on December 26, 2006, 10:18:50 PM
Nifty piece of code but one question: How do I get the size of the text the same as in other LeftBlocks?
Wat do I need to add/change and where as I'm a complete php noobie.

TIA

Lum-chan
Title: Re: [Block] SMF Gallery Random Picture
Post by: pinegr05 on December 27, 2006, 06:12:42 PM
Great code Thurnok! 

Could the code be altered to be shown on a front page block to fit the block instead of a thumbnail and fade in and out for each picture.

Once again this is a great block and a testament of the team here at Tinyportal in support of the community.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on December 27, 2006, 08:58:31 PM
New version in first post with a small update (no pun intended).

The new version now uses the "smalltext" class (of TP's) by default.  You can use either the "normaltext" or "smalltext" class by changing the new variable in the user config section: $gal_smalltext

$gal_smalltext = 1;  // use TP's "smalltext" class
$gal_smalltext = 0;  // use TP's "normaltext" class

@Lum-chan - get new code, copy/paste - done.

@pinegr05 - There is a slide show block that does something like that already.  It should be in the block code snippets here somewhere.
Title: Re: [Block] SMF Gallery Random Picture
Post by: pinegr05 on December 27, 2006, 09:02:38 PM
Thanks Thurnok.  I have been playing with the codes in the admin section and I have put the code in an article.  Makes for a neat team page.

Thanks again!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Lum-chan on December 27, 2006, 09:32:23 PM
Thanks Thurnok! Works like a charm now :up:
Title: Re: [Block] SMF Gallery Random Picture
Post by: bloodynightmare on December 27, 2006, 11:30:14 PM
does it work with coppermine? modifing the url /gallery/ with the url of the directory in which is installed cpm?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on December 27, 2006, 11:59:37 PM
No.  This directly accesses the database entries for the SMF Gallery Mod (written by vbgamer45).  It also uses SMF Gallery Mod's permission setup as well.  It will not work for Coppermine without completely rewriting it (for the most part).
Title: Re: [Block] SMF Gallery Random Picture
Post by: bloodynightmare on December 28, 2006, 12:05:53 AM
gasp...ok.. sob
Title: Re: [Block] SMF Gallery Random Picture
Post by: toyotaTRD on December 28, 2006, 08:18:25 AM
Thanks Thurnok! I just added it to my site, for a demo look here: http://www.oblivion.gr/forums/index.php
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on December 28, 2006, 09:36:33 PM
Looks good there.  Nice guild site.  :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: bluedevil on December 28, 2006, 11:38:47 PM
I love this mod. It really works well in my site. I have a another mod almost like this one but i had to upload pics manually to a folder. (is getting turned off).

Not anymore!!!! This mod rocks! Thanx Thurnok for this sweet mod!! You Rock!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on December 29, 2006, 12:07:26 AM
Looks like it was made special just for your site.  :)

Nice bike btw.
Title: Re: [Block] SMF Gallery Random Picture
Post by: bluedevil on December 29, 2006, 04:54:33 AM
Quote from: Thurnok on December 29, 2006, 12:07:26 AM
Looks like it was made special just for your site.  :)

Nice bike btw.

Thnx!
Title: Re: [Block] SMF Gallery Random Picture
Post by: toyotaTRD on December 29, 2006, 06:51:48 AM
Quote from: Thurnok on December 28, 2006, 09:36:33 PM
Looks good there.  Nice guild site.  :)

You're welcome :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: alhaudhie on January 07, 2007, 04:56:42 AM
how can i resize image with this script to put all the image in the same size at the block?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on January 07, 2007, 09:15:33 PM
The SMF Gallery Random Picture block doesn't do any sizing of the picture at all.  What you see is the thumbnail created by the SMF Gallery Mod itself.

So whatever the thumbnail size is, that's what is displayed.  The thumbnails are created by the SMF Gallery Mod and based on the original size of the picture.  I'm not sure what the maximum height/width of the thumbnail is, but it is beyond the control of the block itself.
Title: Re: [Block] SMF Gallery Random Picture
Post by: haxen on January 09, 2007, 03:01:57 AM
This is a really nice piece of coding, very clean. I implemented it at www.ps3hax.com
thanks.
Title: Re: [Block] SMF Gallery Random Picture
Post by: SteveW on January 22, 2007, 09:55:02 PM
Hello there!

I get a message "Error, no database found!" where the block would be.
The only bit I altered (because it was incorrect was path in my case was /gallery2


Any help appreciated thanks :)

EDIT : Bugger, thought this was for Gallery2, not SMF Gallery, ah welll  :-X  :(
Title: Re: [Block] SMF Gallery Random Picture
Post by: houston on January 26, 2007, 12:55:17 AM
Wonderful Mod. Thanks for putting it together for us.

O0
Title: Re: [Block] SMF Gallery Random Picture
Post by: Blanc on February 05, 2007, 01:17:36 PM
Quote from: houston on January 26, 2007, 12:55:17 AM
Wonderful Mod. Thanks for putting it together for us.

O0

Yup exactly, thx alot!  :up:
Title: Re: [Block] SMF Gallery Random Picture
Post by: EdwinK on February 25, 2007, 03:42:13 PM
Got it on my site as well. G6 told me to get this block code, so I did :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: vanguard on March 01, 2007, 08:51:48 AM
Great! Thanks!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Gourgi on March 01, 2007, 01:54:16 PM
beautiful snippet !!
thanks man ;)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on March 01, 2007, 07:28:22 PM
Glad you like it!  :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: osu searles on March 04, 2007, 10:24:50 PM
(This is the first block I have tried to create, so apologies in advance if this is user error.)

I receive the following error:
QuoteParse error: syntax error, unexpected $end in /Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 177

Thank you for any assistance.
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on March 04, 2007, 10:32:34 PM
If you copied the code in the first post and made a PHP block for it on your forum, you should not get an error.
Make sure you have pasted the entire code in a PHP block.
Title: Re: [Block] SMF Gallery Random Picture
Post by: osu searles on March 04, 2007, 10:37:26 PM
Thank you G6.

I happened to miss the final } which threw the whole thing off. 

DOH!
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on March 04, 2007, 10:38:18 PM
We have all done that one time or another.  :D
Glad you got it to work
Title: Re: [Block] SMF Gallery Random Picture
Post by: Craven on March 06, 2007, 01:01:06 AM
One problem I noticed was when you go to minimize the whole left block it seems to remove all the blocks but this one... Is there something in the Admin portion of the script that needs to be changed?  to see what I see. go here... www.dawnofannihilation.com/doa-forum
Login: test3
Password: 1234
Title: Re: [Block] SMF Gallery Random Picture
Post by: Gourgi on March 06, 2007, 05:38:18 PM
if i'm right this code is for not displaying specific categories of images gallery
// do not allow the following category numbers to be displayed
// example: $gal_disallowCats = "4,2,7" - don't show categories 2, 4, or 7
$gal_disallowCats = "";


what change should be done in the original code in order to display random images only from categories i want?

in fact i want to display only one category but i think the solution of displaying more than one preferred categories  will fit everybody's needs and will make this snippet just the best one !!  :laugh:
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on March 10, 2007, 10:38:58 AM
I'll add an option to only display certain categories this weekend.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on March 10, 2007, 10:42:25 AM
@Craven
I went to your site, and upshrinked left and right blocks.  Used Mozilla, FireFox, and IE - didn't see what you are reporting....

What browser/version are you using?
Title: Re: [Block] SMF Gallery Random Picture
Post by: baktasht on March 10, 2007, 02:52:06 PM
Wow, very nice. Works very well. GREAT JOB!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mannie on March 11, 2007, 06:30:26 PM
Can you also do a latest images block for smf gallery pro ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: vanguard on March 12, 2007, 09:31:29 AM
Just installed it and it works great!!!


Thank you!!!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on March 12, 2007, 07:52:11 PM
Quote from: Mannie on March 11, 2007, 06:30:26 PM
Can you also do a latest images block for smf gallery pro ?
I've already been thinking about modifying this block to allow the admin to select options for:
- latest x number of pix
- most viewed x number of pix
- most commented x number of pix
- top pic poster's x number of pix

also thinking about adding a slideshow option for the future...
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mannie on March 12, 2007, 07:58:13 PM
 :up:
That would be great, specially for my site
Title: Re: [Block] SMF Gallery Random Picture
Post by: vanguard on March 12, 2007, 08:00:06 PM
Mannie!!!!

:P
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mannie on March 12, 2007, 08:26:58 PM
Mr Gray!!
;D
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on March 28, 2007, 07:31:38 AM
Quickie update by request at my TPBlocks site:

Update 1.3
see code for info

Updated code in first post
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on March 28, 2007, 07:34:25 AM
This update will be good for you if you have many categories and only want random pics from 1 or a few categories.  Easier than putting alot of categories in the $disallowCats variable. Also prevents you from having to add more categories to the $disallowCats every time you create more SMF Gallery categories that you do not want random pics displayed from.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on April 12, 2007, 05:42:02 AM
Update 1.4
see code for info

Updated code in first post
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on April 12, 2007, 07:15:31 AM
Update 1.5
see code for info

Updated code in first post
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on April 12, 2007, 07:27:40 AM
Here's a screenshot of some sample uses...
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mannie on April 12, 2007, 09:28:33 AM
thanks will update my block ;)
Title: Re: [Block] SMF Gallery Random Picture
Post by: mrbean17 on April 12, 2007, 01:19:19 PM
Awesome, thank you!
Title: Re: [Block] SMF Gallery Random Picture
Post by: superQ on April 13, 2007, 05:21:51 AM
hmm? I have 4 photos in the gallery. I just installed the latest update on my site right block= gallery upload


www.therockpile.org

config says this

// use random, or most recent pics?
// 0 = random, 1 = most recent, 2 = most viewed, 3 = most commented
$gal_showtype = 0;
// sort :: 0 = Descending, 1 = Ascending
$gal_sort = 0;

yet it doesnt change pics.


the one in the right block down a little =random pic from 12/27 works right

The top one is set for random pic right. I know you added stuff. Do I need to change something else?

thanks.   Do I have to put the ones I want random in a special category?
Title: Re: [Block] SMF Gallery Random Picture
Post by: mrbean17 on April 13, 2007, 05:52:47 AM
The pictures do not randomly change ... seems I am stuck on the same 5 pictures.

I went back to an older version of your code (http://www.tinyportal.net/index.php?topic=15073.msg124980#msg124980) and it works fine.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Shadow on April 13, 2007, 06:23:48 AM
I have 6 Category's in my Galley and I would like the code to show from all the Categorys I have not one. 

Any ideas?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on April 13, 2007, 07:15:38 AM
Update 1.5.1
- FIX: Left out the random option when I added the other options - woops  ::)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on April 13, 2007, 07:21:01 AM
@Shadow Queen
You can use as many or as little categories you like for the block.  If you leave the $gal_disallowCats and the $gal_allowCats variables empty (the default) then it will take random/recent/viewed/commented pics from all categories.

If you only want a single, or a couple categories to display, use the $gal_allowCats variable to identify those.  If you want all except a single or couple of categories to display then use the $gal_disallowCats to identify the ones not to display.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on April 13, 2007, 10:53:25 AM
Update 1.5.2
- FIX: Couldn't display date unless member name was also displayed, can now display just the date option if desired

... can't believe no one mentioned this yet, probably in the code since first release..  :2funny:
Title: Re: [Block] SMF Gallery Random Picture
Post by: Shadow on April 14, 2007, 12:44:54 AM
I have to found that in the code?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on April 14, 2007, 01:18:51 AM
No you don't have to find it in the code, he updated the first post. :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Shadow on April 14, 2007, 04:36:26 AM
Thank's you for telling me Ich :)

Edited --

THe code work great so far :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: DerekTREK on April 17, 2007, 06:13:10 AM
Works good thank you sir.
Title: Re: [Block] SMF Gallery Random Picture
Post by: jpark on April 24, 2007, 05:51:23 PM
I'm sure I'm overlooking something simple (and I don't mind if someone points that out to me)  ;) but... how do I get this block to show up on the gallery page if the gallery url is: http://mysite.com/index.php?action=gallery.  I made the block centered and with 5 most recent pictures with 5 columns.  Now i'm trying to select the TP block settings so it just shows up on that url above but I can't find that selection among the drop-downs..  and http://mysite.com/gallery shows me the folder, not the gallery.  hmm.... can anyone help? :D
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on April 25, 2007, 07:54:25 PM
You can use this block to display a random pic (or pics) anywhere - your home page, or any other part of your SMF/TP site.

When you wish to display any TP block somewhere specifically, you use the:
Show for this action
(custom action name)

field of the block settings.  If the specific area (action) you wish to show the block on does not exist in the "pulldown" menu to the right, simply leave the pulldown set at -none- and manually enter the action code in the editbox that is just to the right of the pulldown.

In otherwords, enter gallery in the editbox that is to the far right on the Show for this action (custom action name) field in the block settings for your block.
Title: Re: [Block] SMF Gallery Random Picture
Post by: jpark on April 26, 2007, 02:35:26 AM
ahh... the custom action fixed it.  thanks for your help!
Title: Re: [Block] SMF Gallery Random Picture
Post by: ORGASMUS on April 28, 2007, 10:57:18 PM
Hmmmm..gallery installed and working good..but where i must to put this code??
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on April 29, 2007, 12:50:28 AM
In the first post he gives you all the info you need.

QuoteType of block:
This is a phpblock.

So, in a block is where you put the code.
Title: Re: [Block] SMF Gallery Random Picture
Post by: wilsy on April 29, 2007, 11:00:47 AM
Hi Thurnock,

This is the best way I can think of explaining this.

What I want to achive is that when you are viewing a members profile, you can see the first 20 (configurable) of that members gallery pics (thumbs) in a block on the profile, with a link to view all if more exist. If they have no gallery pics then the block would state this.

I can make the block appear with no problems by setting the action selection as =profile.

Is it possible to amend the code for this block and create a new block called 'SMF Gallery Pics in Profile' - that would be a cool block :)

Regards,

Wilsy.
Title: Re: [Block] SMF Gallery Random Picture
Post by: seleleth on May 02, 2007, 10:35:59 PM
Wow!!! Thanks for this mod, Thurnok.

I put up our site a few months ago with some basic Gallery block I found here, not knowing about this one.

Ever since then, I had been glaring at the pitiful thing every time I visited our site. I kept thinking, "Wouldn't it be cool if that block showed this and that..." Turns out I wasn't the only one! Your block is EXACTLY the kind of thing I was looking for. I wish I had found it first!

And thank you for making it so simple to follow, too. Even though I can generally dig deep into code and find ways to alter as necessary, it's SO much easier to just have a simple, obvious set of configuration variables right at the start. I'm sure it took you a lot of extra time to setup, but you've saved all of us a ton of time in return.

Here's my site, greatly enhanced by your work!

http://clan-ai.org
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 03, 2007, 05:48:02 AM
@seleleth - Welcome.  Glad you enjoy it.  :)

@Wilsy - I think I can add that pretty easily.  No time tonight.. maybe later this week or weekend.
Title: Re: [Block] SMF Gallery Random Picture
Post by: JimKarvo on May 03, 2007, 12:45:26 PM
Hello mates,

Can anyone help me, how I can add that block?

Tnx,
JimKarvo
Title: Re: [Block] SMF Gallery Random Picture
Post by: Gourgi on May 03, 2007, 12:58:32 PM
@JimKarvo
you have to put the code in a phpbox.

@Thurnok : Thanks for your masterpiece man :D and the latest updates including the categories i asked for.
Surely my favorite snippet , way too far from the second one !
Things like this make me stuck with TP
Thanks again  :up:
Title: Re: [Block] SMF Gallery Random Picture
Post by: JimKarvo on May 03, 2007, 01:00:14 PM
Αφέλεια μου

Tnx Gourgi! But first I have to upload some photos :-P
Title: Re: [Block] SMF Gallery Random Picture
Post by: JimKarvo on May 03, 2007, 01:10:04 PM
One question! How I can have up of 1 random photo in block?
Title: Re: [Block] SMF Gallery Random Picture
Post by: wilsy on May 03, 2007, 05:00:56 PM
@Thurnock - Thank you  :)

Regards,

Wilsy.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 04, 2007, 04:02:05 AM
@JimKarvo
Take a look inside the actual code.  You will find numerous configuration variables there that you can set as you desire.  I always recommend copying the code to your favorite text editor to actually "view" the code before putting it into the TP Block itself.  It's much easier to view it in your favorite editor than it is in the small "textarea" of the Admin Control Panel block manager.

If you look in the code, the area you are interested is all between the following sections:

/*
****************************************
****************************************
***    !! Admin Config Section !!    ***
****************************************
****************************************
*/

all the goodies for you to set are in here

/*
****************************************
****************************************
***  !! END Admin Config Section !!  ***
****************************************
****************************************
*/

Each variable is commented relatively well to tell you its purpose and options.  The one in particular you asked about is:
//   *****   LAYOUT OPTIONS   *****
// how many pictures do you want to show?
$gal_numpics = 1;

Simply change the number to the number of pictures you want displayed in your block.  You can also change how many columns you want your pictures displayed in via another variable in that section.  I'll let you try to find it now that I've explained it pretty well.

In fact, I recommend you play with all the various configuration variables so you can see what each does.   I suggest you open two browser windows (or Tabs) for your site pointing one to your admin control panel - in specific the TP Block Manager and your block, and the other the home page of your site (or wherever you are displaying the block).  Change a setting, save the block, then refresh the window that is displaying the block to see what it does.
Title: Re: [Block] SMF Gallery Random Picture
Post by: wilsy on May 08, 2007, 05:00:52 PM
Hi Thurnock,

Quote@Wilsy - I think I can add that pretty easily.  No time tonight.. maybe later this week or weekend.

Did you manage to take a look?  :)

Regards,

Wilsy.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 09, 2007, 08:31:35 AM
Didn't get a chance over the weekend, but did tonight.  Think you will pleasantly find what you are looking for in the first post.  ;)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 09, 2007, 08:34:40 AM
Update 1.6
- Added abililty to display pics for a member who's profile you are viewing.

Code in first post.  Don't forget to read the Profile Note in first post.  All features work the same (random, most/least, newest/oldest, numpics, numcolumns, etc) for this new Profile feature, but added a link to display all pics for the member in the block at bottom.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 09, 2007, 08:37:17 AM
For a demo of this new feature, go to my TP Blocks site (http://www.tpblocks.com) (registration required to view member profiles), and view Maya's profile.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mannie on May 09, 2007, 09:40:28 AM
says i cant just view any profile when i try, i did register
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 09, 2007, 09:57:17 PM
@Mannie - woops... hehe.. try again ;)

@babjusi - welcome  :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 10, 2007, 03:15:02 AM
Update 1.7
- Added option to display pics from members on your buddy list

When this is enabled ($gal_buddies = 1) then only pics from members on your buddy list are displayed in the block.  All other options remain in effect (random, newest/oldest, most/least, order, numpics, numcolumns, etc).

Code in first post.  Don't forget to read Buddy List Note in first post!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 10, 2007, 03:43:15 AM
Update 1.7.1
- quick fix to the url parsing in 1.7, will work properly in articles now

woopsie... now view all buddy pics link goes to the right place if you have the code in an article... sorry
Title: Re: [Block] SMF Gallery Random Picture
Post by: Shadow on May 10, 2007, 03:51:39 AM
Hey

The updata code is in the first place ???
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 10, 2007, 03:56:13 AM
Yes, updated code is always placed in the first post in this topic, along with any description/info for the block.

:)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 10, 2007, 04:02:43 AM
To view how the Buddies pics works, go to my TP Blocks site (http://www.tpblocks.com) (register if you are not already) and click the My Buddies Pics link in the Main Menu.

Title: Re: [Block] SMF Gallery Random Picture
Post by: Shadow on May 10, 2007, 04:09:04 AM
Awesome, Thanks for telling me that :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Shadow on May 10, 2007, 04:17:09 AM
Quote from: Thurnok on May 10, 2007, 04:02:43 AM
To view how the Buddies pics works, go to my TP Blocks site (http://www.tpblocks.com) (register if you are not already) and click the My Buddies Pics link in the Main Menu.



Alright, I join your forum and I see what it done and the code is pretty neat to use

Edited --

@Thurnok -I wanna to have the code set up like you have on your site.  Can you do it for me ???  If you dont mind at all

I will give you rights for Admin to get in the Admin Panel. Because I dont know how to set it up like you have it on yours site

Title: Re: [Block] SMF Gallery Random Picture
Post by: Mannie on May 10, 2007, 06:11:59 AM
Oh that's basicly the same as the hack i allready use from smfhacks, probably this is easier to put in ;)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 10, 2007, 09:45:50 PM
Actually, its a new feature to my SMF Gallery Random Pic block (which has been out for quite some time now).  If you take a look at the code comments, you will see the other features that have been in that block for a long time.

With this block, you can have as many blocks as you want each with different configurations to suit you as you please.  Try it out if you like, its as easy as copy/paste the code into a TP phpblock.  :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mannie on May 11, 2007, 06:33:02 AM
I know what the block is hehe been using it for some time. What i mean was the images on the profile screen ;)
Title: Re: [Block] SMF Gallery Random Picture
Post by: babjusi on May 11, 2007, 10:25:02 PM
Quote from: Mannie on May 11, 2007, 06:33:02 AM
I know what the block is hehe been using it for some time. What i mean was the images on the profile screen ;)

I think that this is taken in consideration for the feature releases of TP, but don''t qoute me on this as I may have heard it wrong
Title: Re: [Block] SMF Gallery Random Picture
Post by: wilsy on May 12, 2007, 07:04:06 AM
Thanks to Thurnock we now have member profiles with images - awesome work and I for one am really grateful  ;D

Can I now give a shameless plug to a request made some time ago for a search facility which would sooooo much compliment Thurnocks new profile images block: -

http://www.tinyportal.net/index.php?topic=14919.0

Regards,

Wilsy.
Title: Re: [Block] SMF Gallery Random Picture
Post by: npereira on May 15, 2007, 02:16:04 AM
I put this code snippet inside a php block in TP, and I get this error:

Parse error: syntax error, unexpected $end in /home/ottmoto/public_html/Sources/Load.php(1752) : eval()'d code(35) : eval()'d code on line 255


Quote from: Thurnok on December 01, 2006, 09:32:24 AM
(Note: new features in red)

What it is:
This block displays random, newest, oldest, most/least viewed or commented picture(s) from your SMF Gallery mod inside a block of your choice.  Actually, it displays the thumbnail and links to the full picture.

Type of block:
This is a phpblock.  It can be any block/article position (left/right/center/front/article).  If you use it in a left/right block, you should set the columns to 1.  If you use a center/frontpage/article block, then set the columns to however many you want.

This block snippet can be used in multiple simultaneous blocks using the same or different configuration settings in each without issue.


Features:
  • configurable number of pictures to display
  • sort order to display newest/oldest or most/least pics
  • configurable number of columns to display the pictures in
  • enable title display (if viewer is picture poster, it becomes a link to edit the picture)
  • displayed thumbnail links to full picture from the gallery
  • enable display of picture poster (links to their profile)
  • enable display of date posted
  • enable display of category picture is in (links to that gallery category)
  • enable display of number of views
  • enable display of picture dimensions (width X height)
  • enable display of picture's filesize
  • enable display of picture's description
  • can disallow pictures from various categories
  • can allow pictures only from various categories (disallowed cats override)
  • only displays approved pictures
  • configurable to require allowedTo('smfgallery_view') permission or not for viewing thumbnail
  • display pics posted by a member who's profile you are viewing, in the profile screen (see profile note) - added in ver 1.6
  • display pics posted by members in your buddy list - added in ver 1.7

    Profile Note: You must enable panels (blocks) for the profile screen via TinyPortal -> Settings -> Panels -> Hide panels when in these sections: -> Profile screen: No

    Buddy List Note: This will work everywhere except under the following condition:
    - you have the option to display profile pics turned on in an SMF Gallery Random Pic block that displays while in the profile screen, and you are currently viewing some member's profile.
    In otherwords, the Profile pics display will override the buddy pics display in that case.  If this same block however, displays on other pages (frontpage, forum, etc) then the buddy pics will display in the block when on those pages!

    See the Admin configuration section in code for each configuration variable.

    ////////////////////////////////////////////////////
    // SMF Gallery Random Picture - ver. 1.7.1        //
    ////////////////////////////////////////////////////
    //
    // Developed by Thurnok
    // Thurnok -AT- tinyportal .DOT. net
    // November 30, 2006
    //
    // Updated 5/9/2007
    // 1.7.1
    // - quick fix to parsing the url
    //
    // Updated 5/9/2007
    // 1.7
    // - added option to view pics that members on your buddy list posted
    //
    // For list of all previous updates history, see the UPDATES.TXT attached file
    // in the post where you got this code, or the .ZIP file if you downloaded it
    //
    // Used in a TinyPortal phpblock or Article.
    // This block displays random picture(s) from
    // the SMF Gallery mod along with other information
    //
    //////////////////////////////////////////////

    global $scripturl, $db_prefix, $modSettings, $boardurl, $ID_MEMBER, $user_info, $context;

    /*
    ****************************************
    ****************************************
    ***    !! Admin Config Section !!    ***
    ****************************************
    ****************************************
    */

    //   *****   LAYOUT OPTIONS   *****
    // how many pictures do you want to show?  0 = all!
    $gal_numpics = 1;

    // use random, or most recent pics?
    // 0 = random, 1 = most recent, 2 = most viewed, 3 = most commented
    $gal_showtype = 0;
    // sort :: 0 = Descending, 1 = Ascending
    $gal_sort = 0;

    // enable profile pics display?
    // 0 = disable, 1 = enable --- if enabled, and you are viewing a member profile, show pics from that member only
    // other options still apply (showtype, sort order, etc)
    $gal_profile = 1;

    // only show pics from buddies?
    // 0 = disable, 1 = enable --- if enabled, will only show pics posted by members in your buddy list
    $gal_buddies = 0;

    // use Normal Size Text, or Small Size Text? (0 = Normal Size, 1 = Small Size)
    $gal_smalltext = 1;

    // put pictures in how many columns?  (1 for left/right block, more for centerblock / article if you wish)
    $gal_columns = 1;

    // information display flags (0 = No, 1 = Yes)
    // display picture title?
    $gal_dispTitle = 1;
    // display membername who posted pic?
    $gal_dispMember = 1;
    // display posted date?
    $gal_dispDate = 1;
    // display category the picture is in?
    $gal_dispCategory = 1;
    // display number of views?
    $gal_dispViews = 1;
    // display dimensions?
    $gal_dispDimensions = 1;
    // display filesize?
    $gal_dispSize = 1;
    // display picture description?
    $gal_dispDescription = 0;


    //   *****   SECURITY CONFIGURATION   *****
    // do not allow the following category numbers to be displayed
    // example: $gal_disallowCats = "4,2,7" - don't show categories 2, 4, or 7
    $gal_disallowCats = "";
    // select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
    // example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
    $gal_allowCats = "";
    // Require the user has allowedTo('smfgallery_view') permission to view random pics thumbnails in block?
    $gal_viewPermission = 1;

    /*
    ****************************************
    ****************************************
    ***  !! END Admin Config Section !!  ***
    ****************************************
    ****************************************
    */

    //###############################################
    //###############################################
    //   You shouldn't change anything below here
    //###############################################
    //###############################################

    if (empty($modSettings['gallery_url'])){
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
    }

    $gal_textclass = empty($gal_smalltext) ? "normaltext" : "smalltext";

    // get this user's buddy list
    $gal_buddylist = implode(",", $user_info['buddies']);

    // prep for our switch routine
    if (empty($gal_showtype))
    $gal_showtype = 0;

    // sort text
    if (empty($gal_sort)){
    $gal_sort_text = 'DESC';
    } else {
    $gal_sort_text = '';
    }

    // are we viewing a member profile and $gal_profile is enabled?
    if (!empty($gal_profile) && strtolower($context['current_action']) == "profile"){
    $gal_member = empty($_GET['u']) ? $ID_MEMBER : $_GET['u'];
    }
    // allow member to view random pic based on security settings
    if (empty($gal_viewPermission) || allowedTo('smfgallery_view')){
    $gal_query = '
    SELECT
    thumbfilename,
    ID_PICTURE,
    ID_MEMBER,
    date,
    title,
    description,
    views,
    filesize,
    height,
    width,
    commenttotal,
    ID_CAT
    FROM '.$db_prefix.'gallery_pic
    WHERE approved = 1
    '.(empty($gal_member) ? (empty($gal_buddies) ? "" : (empty($gal_buddylist) ? "AND ID_MEMBER = NULL " : "AND ID_MEMBER in ($gal_buddylist)")) : "AND ID_MEMBER = $gal_member" ).'
    '.(empty($gal_disallowCats) ? "" : " AND ID_CAT NOT IN ($gal_disallowCats)").'
    '.(empty($gal_allowCats) ? "" : " AND ID_CAT IN ($gal_allowCats)").'
    GROUP BY thumbfilename ';

    switch ($gal_showtype){
    // most/least recent
    case 1:
    $gal_query .= '
    ORDER BY date '.$gal_sort_text;
    break;

    // most/least viewed
    case 2:
    $gal_query .= '
    ORDER BY views '.$gal_sort_text;
    break;

    // most/least commented
    case 3:
    $gal_query .= '
    ORDER BY commenttotal '.$gal_sort_text;
    break;

    default:
    $gal_query .= '
    ORDER BY rand() '.$gal_sort_text;
    break;
    }
    $gal_query .= (empty($_GET['gal_viewall']) && !empty($gal_numpics)) ? ' LIMIT '.$gal_numpics : '';
    $gal_result = mysql_query($gal_query);
    if (!$gal_result){
    // error retrieving information from database
    if (mysql_errno() == 1146){
    echo '<p />Error, no database found!<p />';
    } else {
    echo '<p />MySQL error:'.mysql_error().'<p />';
    }
    } else {
    echo "\n".'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%">'."\n";

    $gal_colcnt = 1;
    echo " <tr>\n";
    while ($row = mysql_fetch_assoc($gal_result)){
    if ($gal_colcnt > $gal_columns){
    // close out the row and start a new row
    echo " </tr>\n <tr>\n".' <td colspan="'.$gal_columns.'"><hr /></td>'."\n </tr>\n <tr>\n";
    // reset count to column 1
    $gal_colcnt = 1;
    }
    echo ' <td class="'.$gal_textclass.'" align="center">'."\n";
    // display title if enabled, make edit link if viewing user is picture poster
    if (!empty($gal_dispTitle)){
    echo " ".($ID_MEMBER == $row['ID_MEMBER'] ? ('<a href="'.$scripturl.'?action=gallery;sa=edit;id='.$row['ID_PICTURE'].'">'.$row['title'].'</a>') : $row['title'])."<br />\n";
    }
    // display the picture thumbnail and link it to gallery full picture
    echo ' <a href="'.$scripturl.'?action=gallery;sa=view;id='.$row['ID_PICTURE'].'"><img src="'.$modSettings['gallery_url'].$row['thumbfilename'].'" /></a><br />'."\n";
    // display poster's name and posted date if enabled
    if (!empty($gal_dispMember) || !empty($gal_dispDate)){
    echo 'Posted';
    if (!empty($gal_dispMember)){
    // display the membername who posted pic?  need to get name based on ID_MEMBER
    $gal_tmp = mysql_fetch_assoc(mysql_query("SELECT memberName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
    echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['memberName'].'</a>';
    }
    if (!empty($gal_dispDate)){
    // display the date it was posted
    echo ' on '.date("d M Y", $row['date']);
    }
    echo "<br />\n";
    }
    // display category if enabled
    if (!empty($gal_dispCategory)){
    // get category name based on category id
    $gal_tmp = mysql_fetch_assoc(mysql_query("SELECT title FROM ".$db_prefix."gallery_cat WHERE ID_CAT = ".$row['ID_CAT']));
    echo '<br />in<br /><a href="'.$scripturl.'?action=gallery;cat='.$row['ID_CAT'].'">'.$gal_tmp['title']."</a><br /><br />\n";
    }
    // display number of views if enabled
    if (!empty($gal_dispViews)){
    echo "Viewed ".$row['views']." times<br />\n";
    }
    // display dimensions if enabled
    if (!empty($gal_dispDimensions)){
    echo $row['width']."w X ".$row['height']."h<br />\n";
    }
    // display filesize if enabled
    if (!empty($gal_dispSize)){
    echo $row['filesize']." bytes<br />\n";
    }
    // display description if enabled
    if (!empty($gal_dispDescription)){
    echo "<br />".$row['description']."<br />\n";
    }
    echo " </td>\n";
    $gal_colcnt++;
    }
    mysql_free_result($gal_result);
    echo " </tr>\n</table>\n";
    if (!empty($gal_member) && empty($_GET['gal_viewall']))
    echo '<br /><a href="'.$boardurl.'/index.php?action=profile;u='.$gal_member.';gal_viewall=1">View all pics from this member</a>';
    if (!empty($gal_buddies) && empty($_GET['gal_viewall'])){
    // build the link
    $gal_querystring = $context['TPortal']['querystring'];
    $gal_querystring .= empty($gal_querystring) ? 'gal_viewall=1' : ';gal_viewall=1';
    echo '<br /><a href="'.$boardurl.'/index.php?'.$gal_querystring.'">View all pics of buddies</a>';
    }
    }
    } else {
    echo 'Sorry, you do not have permission to view pictures!';
    }

Title: Re: [Block] SMF Gallery Random Picture
Post by: thefley on May 27, 2007, 06:02:07 AM
Damn I am so GLAD I found TP.... you guys are GREAT. I have added so many cool options that fit my board.  I got the Calendar TP mod last night now this one.!!! 

YOU GUYS and GALs keep up the great work!!!

Title: Re: [Block] SMF Gallery Random Picture
Post by: Ibexy on June 08, 2007, 08:48:43 AM
How or where do I get the category numbers?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on June 15, 2007, 06:53:03 AM
You can click the gallery link on your site, and the categories should be displayed.  Just hover your mouse over the category name links and look at the URL in the status bar of your browser.  It should have at the end of the url something like:  cat=<cat number>  Example ( cat=4 ).

Or you can also go to the SMF Admin Control Panel, select Gallery Configuration, and then Manage Gallery to do the same thing.
Title: Re: [Block] SMF Gallery Random Picture
Post by: martinmarinekeeper on June 20, 2007, 11:28:35 AM
Great stuff

Clever man
hats off to you fella thanks
Title: Re: [Block] SMF Gallery Random Picture
Post by: iGate on June 26, 2007, 12:24:05 PM
nice mod...

i have this installed to just display the image only but i get some url related text in the block which shouldn't be there. any ideas on how to remove it.

thanks

PS my site is : http://test.ihf.lp.pl
Title: Re: [Block] SMF Gallery Random Picture
Post by: iGate on June 27, 2007, 11:02:45 AM
bump..any ideas how to remove it?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on June 28, 2007, 02:11:30 AM
Can you post a screenshot of the error/url text?
Title: Re: [Block] SMF Gallery Random Picture
Post by: iGate on June 28, 2007, 10:51:24 AM
yes...here is an attached png file
Title: Re: [Block] SMF Gallery Random Picture
Post by: iGate on June 30, 2007, 05:37:47 AM
bump...any ideas?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on July 01, 2007, 12:22:30 AM
That is BBC code.  There is no BBC code in the block code, so you have something eroneous in your block somewhere.

Try clearing the block, then copy/paste the original block code there and use the defaults just to see if you have the same situation.  Then change config items down to the same config you currently have.
Title: Re: [Block] SMF Gallery Random Picture
Post by: iGate on July 01, 2007, 03:55:34 AM
ok...thanks that helped...i learnt that i shud quote the "code" and copy it from teh "post" box so i get all of it and dont get added BBC code


thanks all works now
Title: Re: [Block] SMF Gallery Random Picture
Post by: vivid on July 02, 2007, 06:37:12 PM
hi

I have smf gallery

www.albahala.com/gallery

I copy the block in phpbox and activated it

but it gave me this msg

Error, no database found!
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on July 02, 2007, 09:52:30 PM
Does the gallery work properly on your site ?
A link is good for us to see for our selfs
Title: Re: [Block] SMF Gallery Random Picture
Post by: Laos on July 04, 2007, 01:32:06 AM
Hi,

I use the script at Brokeassgames.com

as you see, its up on the top over the articles.

The articles are not showing up via a articlebox, rather in TinyPortal Config as featured documents.

The thumbnails are not showing, and i cannot get it to float to the bottom

Any Help Here?
Title: Re: [Block] SMF Gallery Random Picture
Post by: DawnsWebDesigns on July 06, 2007, 02:39:06 AM
Works like a charm so far...thanks. :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on July 06, 2007, 08:17:43 PM
@Laos - I went to your site, but I do not see a block for random pix anywhere.
Title: Re: [Block] SMF Gallery Random Picture
Post by: vdubbia on July 20, 2007, 02:44:40 PM
how can I center this in a left block?  It seems to put the picture a little off center. 

Also, when selecting to show 'posted by user' and including date, it doesn't format it correctly... it doesn't break causing it to appear as a run-on.  Is there any way to format it so when you choose these options there it appears something like:

Posted by:
username
on June 1, 2007

instead of:

Posted by username on June
1, 2007


Otherwise, this is very nice.  Good work!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Ibexy on July 21, 2007, 10:04:05 AM
Great, great stuff this mod. Are u gonna add a slide show option, please? Be great to have that. :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on July 29, 2007, 07:24:17 AM
@vdubbia
The reason it displays the way it does is because all of the following options are available depending on how you configure it:

- Posted by username
- Posted on date
- Posted by username on date

Rather than add some extra logic, I simply shortcutted it.  I'll look at modifying that in the next update.

@Ibexy
Good possibility.  Just been too busy with RL work to do much updating, but I had thought about it.  Watch for the new features in the next update.
Title: Re: [Block] SMF Gallery Random Picture
Post by: samo_zin123 on August 08, 2007, 05:56:41 AM
thanx man  i really apretiat that
Title: Re: [Block] SMF Gallery Random Picture
Post by: cru on August 16, 2007, 01:14:42 AM
hi! can we see a live demo for this?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Ken. on August 16, 2007, 01:58:41 AM
Live Demo (http://www.mykimbrell.com/BiancasBuddies/index.php)
Title: Re: [Block] SMF Gallery Random Picture
Post by: cru on August 16, 2007, 06:17:51 AM
very nice mod! thanks!!!!!!!!!!!! :) worked!
Title: Re: [Block] SMF Gallery Random Picture
Post by: SoulPleX on August 21, 2007, 12:43:26 PM
Is possible to create a Top 5 voted by category block?  Please split if this is another topic.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Laos on August 27, 2007, 08:50:06 PM
A while back i asked for support and i took it down, its back up, and the same issue i mentioned, no thumbnail, take a look

brokeassgames.com
Title: Re: [Block] SMF Gallery Random Picture
Post by: Jondo on September 08, 2007, 10:31:35 PM
Hi,

I am following up on Laos's post above. We put our broken 'random pics' block back on our main page. Seems to be set up right, it ties to the gallery and shows the text info for the pics, just no thumbs. Also, when you click one of the text peices it takes you to a page that should show the pic, but it doesn't. Any help to get this right would be appreciated.

Jondo - BrokeAss Games

http://www.brokeassgames.com/Community/index.php (block on bottom left)
Title: Re: [Block] SMF Gallery Random Picture
Post by: mr tart on September 30, 2007, 05:41:41 PM
Anyone help with this error message:

Parse error: syntax error, unexpected $end in /home/capital/domains/capitalbocking.co.uk/public_html/bockersworld/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 255

I've literally copy and pasted the code from the first post into a new php block.
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on September 30, 2007, 06:03:33 PM
Copy and paste the entire code again, make sure you get everything from the code box before you paste it in a php block.
I have used this code so many times i know it's nothing wrong with it.

So redo the block again and test.
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on October 01, 2007, 01:46:13 AM
i used this block for the first time and i noticed that it showed the username of the poster (the one used to login) instead of the real name (the one shown in posts and other members . i replaced this

// display the membername who posted pic?  need to get name based on ID_MEMBER
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT memberName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['memberName'].'</a>';


with this

// display the membername who posted pic?  need to get name based on ID_MEMBER
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT realName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['realName'].'</a>';


and it worked just fine ! i am not a coder , just experimenting , so i have to ask , is that ok ?

i also have 2 questions : how do i change the dimensions of the thumbnail shown in the block , and , how do i change the language of the pic posting date shown in the block (it shows english while everything else is in greek) ?

thnx in advance !
Title: Re: [Block] SMF Gallery Random Picture
Post by: MYBESTHOMESnet on October 01, 2007, 02:11:36 AM
how to edit the code to have latest image in a specific/particular gallery category?

thanks
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on October 01, 2007, 02:27:39 AM
about the date thing , i replaced this

// display the date it was posted
echo ' on '.date("d M Y", $row['date']);
}


with this

// display the date it was posted
echo ' σÏ,,ιÏ, ' . timeformat($row['date']);
}


and it worked !

one more question : is there a way to change the color of the link of the poster's name so that it's the same with the one chosen member color link ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on October 01, 2007, 03:26:41 AM
I think the color of the links is controlled with the style.css file.

a:link and a:visted etc.
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on October 01, 2007, 04:54:53 PM
thnx a lot IchBinâ,,¢ , any ideas about the dimensions of the thumbnail ? is there any way i can change them ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on October 01, 2007, 05:31:51 PM
Quote from: MYBESTHOMESnet on October 01, 2007, 02:11:36 AM
how to edit the code to have latest image in a specific/particular gallery category?

thanks

it's easy i think ! (as i previously said i am not a coder , so if anyone knowing coding sees anything wrong please advice !)
just replace this

// use random, or most recent pics?
// 0 = random, 1 = most recent, 2 = most viewed, 3 = most commented
$gal_showtype = 0;


with this

// use random, or most recent pics?
// 0 = random, 1 = most recent, 2 = most viewed, 3 = most commented
$gal_showtype = 1;


that will show the last pic added in your gallery ! now if you want it to show the last pic added in a specific category you have to replace this

// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "";


with this

// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "4";


assuming off course that 4 is the number of the category you want the block to show . an easy way to find out what's your category number is to go to your gallery and click on the link of that category and check the url address of your browser , it should be something like

http://www.yoursite.com/index.php?action=gallery;cat=4
Title: Re: [Block] SMF Gallery Random Picture
Post by: Rabain on October 03, 2007, 04:50:06 PM
This is awesome...it's only taken me about 2 hours to find it and a lot of reading through posts at the SMF forum.

Great stuff!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Ken. on October 03, 2007, 04:56:05 PM
Glad you like it Rabain!
Let us see a link when you get it setup.  :up:
Title: Re: [Block] SMF Gallery Random Picture
Post by: scubasjl on October 04, 2007, 05:26:10 AM
Works awesome, I was creating a script do to the same thing until I found the list of block code snippets. So glad I did. :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: cyrildarkcloud on October 10, 2007, 12:58:26 PM
Quote from: MinasC on October 01, 2007, 01:46:13 AM
i used this block for the first time and i noticed that it showed the username of the poster (the one used to login) instead of the real name (the one shown in posts and other members . i replaced this

// display the membername who posted pic?  need to get name based on ID_MEMBER
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT memberName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['memberName'].'</a>';


with this

// display the membername who posted pic?  need to get name based on ID_MEMBER
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT realName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['realName'].'</a>';


and it worked just fine ! i am not a coder , just experimenting , so i have to ask , is that ok ?

MinasC, thanks for posting this.  I was just sitting down to try and figure out how to do the same thing when I found your post.  It's been working fine for me on two sites.
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on October 10, 2007, 04:34:28 PM
you are welcome !!!
Title: Re: [Block] SMF Gallery Random Picture
Post by: monotiz on October 20, 2007, 02:17:36 PM
Hi, I'm italian boy, sorry for my english.
I admin http://www.drz-italia.com.

I create php central block and I paste into SMF Gallery Random Picture code, but I can't view the latest pics.

Thanks.
Title: Re: [Block] SMF Gallery Random Picture
Post by: yllas on October 22, 2007, 05:48:36 PM
I am loving this and have installed it on my forum. Many thanks for all your hard work  :)

I was just wondering if there is a way to turn off the click on thumbnail option (to see larger images) Please
Title: Re: [Block] SMF Gallery Random Picture
Post by: Rus on October 22, 2007, 06:54:20 PM
I also have this and think its great.  My only request would be an option to see if comments had been added.
Title: Re: [Block] SMF Gallery Random Picture
Post by: yllas on October 25, 2007, 10:39:14 AM
Quote from: yllas on October 22, 2007, 05:48:36 PM
I am loving this and have installed it on my forum. Many thanks for all your hard work  :)

I was just wondering if there is a way to turn off the click on thumbnail option (to see larger images) Please

I think i've found the right part to edit, // display the picture thumbnail and link it to gallery full picture
echo ' <a href="'.$scripturl.'?action=gallery;sa=view;id='.$row['ID_PICTURE'].'"><img src="'.$modSettings['gallery_url'].$row['thumbfilename'].'" /></a><br />'."\n";

but am unsure what to do next ???  please advise  :-*
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on October 25, 2007, 12:01:33 PM
if you just remove the linking part it should be ok !!! replace the code you posted with this one .

// display the picture thumbnail and link it to gallery full picture
echo ' <img src="'.$modSettings['gallery_url'].$row['thumbfilename'].'" /><br />'."\n";
Title: Re: [Block] SMF Gallery Random Picture
Post by: yllas on October 25, 2007, 02:14:12 PM
MinasC you are a Star...many thanks for helping me  :up: it works like a dream
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on October 26, 2007, 12:41:43 AM
don't even mention it man , glad i could help !
Title: Re: [Block] SMF Gallery Random Picture
Post by: Peregrinus on October 26, 2007, 07:41:17 PM
This is a great snippet, perfect for my site!

A+++++++

Great work!
Title: Re: [Block] SMF Gallery Random Picture
Post by: contra on November 04, 2007, 01:12:02 PM
outstanding!  thank you...
Title: Re: [Block] SMF Gallery Random Picture
Post by: alhaudhie on November 06, 2007, 07:57:58 AM
is there any code to run with scriptbox or javascript?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on November 06, 2007, 04:37:40 PM
Why can't you use a php box?
Title: Re: [Block] SMF Gallery Random Picture
Post by: alhaudhie on November 07, 2007, 03:16:10 AM
Quote from: IchBinâ,,¢ on November 06, 2007, 04:37:40 PM
Why can't you use a php box?

i want to put it in yahoo style tab, i think that tab using javascript. so can i combined/add it with PHP?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on November 07, 2007, 03:38:03 AM
I don't think there is any javascript code for this.
Title: Re: [Block] SMF Gallery Random Picture
Post by: alhaudhie on November 07, 2007, 07:38:54 AM
can i have the own background for this block...?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on November 07, 2007, 04:46:59 PM
You can add a background to the table if you'd like.
echo "\n".'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%">'."\n";

Either assign a class with a background that you've created, or add the background property of the table.
Title: Re: [Block] SMF Gallery Random Picture
Post by: alhaudhie on November 07, 2007, 04:57:27 PM
Quote from: IchBinâ,,¢ on November 07, 2007, 04:46:59 PM
You can add a background to the table if you'd like.
echo "\n".'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%">'."\n";

Either assign a class with a background that you've created, or add the background property of the table.

where must i put my image url?
and where must i put this code..

very sorry for a alot of question here...
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on November 07, 2007, 05:29:05 PM
You can't make a background image a URL.
Title: Re: [Block] SMF Gallery Random Picture
Post by: alhaudhie on November 10, 2007, 02:47:03 PM
can u clearly tell me where must i put this code? and what must i change?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on November 10, 2007, 05:43:35 PM
As I stated before, you CANNOT make a background image a link.
Title: Re: [Block] SMF Gallery Random Picture
Post by: alhaudhie on November 10, 2007, 07:06:10 PM
can u tell me what must i put after this

echo "\n".'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%">'."\n";

to put my style background from my style css
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on November 10, 2007, 08:33:28 PM
How to do it with CSS:
http://www.w3schools.com/css/css_background.asp

How to do it with HTML tables:
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_background
or
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_table_cellbackground

Both of these were within the first 3 results of a google search. Don't forget to use google mate. :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Starbearer on November 18, 2007, 01:56:51 AM
I just installed SMFgallery lite on SMF 1.1.4 and TP 0.9.8 and wanted to use this nice block, but I get a strange error message. I looked through this thread and the forum, but I couldnt find any solution. Can anyone help me with that?

MySQL error:Access denied for user 'wwwrun'@'localhost' (using password: NO)

I copy->pasted it exactly like it is and took care that I didnt miss anything. Also I did not change anything in the code.  :-\

Thx in advance for your efforts.

Here is a link to our website with the nonworking block:
http://internationalchaos.com/
Title: Re: [Block] SMF Gallery Random Picture
Post by: Peregrinus on November 18, 2007, 04:50:47 AM
Quote from: Bombes on November 18, 2007, 01:56:51 AM
I just installed SMFgallery lite on SMF 1.1.4 and TP 0.9.8 and wanted to use this nice block, but I get a strange error message. I looked through this thread and the forum, but I couldnt find any solution. Can anyone help me with that?

MySQL error:Access denied for user 'wwwrun'@'localhost' (using password: NO)

I copy->pasted it exactly like it is and took care that I didnt miss anything. Also I did not change anything in the code.  :-\

Thx in advance for your efforts.

Here is a link to our website with the nonworking block:
http://internationalchaos.com/

That is an authentication error, check settings.php that the username and password for your MySQL database is ok. Alktough by the look of it, user wwwrun doesn't have a password set...
Title: Re: [Block] SMF Gallery Random Picture
Post by: Starbearer on November 18, 2007, 12:05:26 PM
As far as I can see all settings are correct.  :-\ Checked settings.php as well as database. Still not working.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Peregrinus on November 18, 2007, 12:51:25 PM
only thing I can think is that the username or password is incorrect, or some of your files/folders have the wrong chmod permissions.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Rafferty on November 24, 2007, 12:25:58 AM
Ive used the code for a period of time now, more recently with 1.1.4 and TP .98. Ive had errors appearing in my forum log but as the code had been seemingly working ok, I have ignored them.

For completeness however and my continued annoyance at the errors I'll throw this in:

"8: Undefined index: smfgalleryprofile_title
File: /home/www/xxxxxxx.org/forum/Themes/default/languages/Gallery.english.php (eval?)
Line: 399"

"8: Undefined index: smfgalleryprofile_viewall
File: /home/www/xxxxxxx.org/forum/Themes/default/languages/Gallery.english.php (eval?)
Line: 410"

These errors are repeated time and time again.

Whats happening here?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on November 24, 2007, 01:21:26 AM
Those are actual errors with the gallery, and not the code snippet I think.
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on November 25, 2007, 03:38:06 AM
is there any way to show the member's name who posted the picture , using the member's color ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Rafferty on November 27, 2007, 03:08:45 AM
QuoteIve used the code for a period of time now, more recently with 1.1.4 and TP .98. Ive had errors appearing in my forum log but as the code had been seemingly working ok, I have ignored them.

For completeness however and my continued annoyance at the errors I'll throw this in:

"8: Undefined index: smfgalleryprofile_title
File: /home/www/xxxxxxx.org/forum/Themes/default/languages/Gallery.english.php (eval?)
Line: 399"

"8: Undefined index: smfgalleryprofile_viewall
File: /home/www/xxxxxxx.org/forum/Themes/default/languages/Gallery.english.php (eval?)
Line: 410"

These errors are repeated time and time again.

Whats happening here?

Well this is weird, it's said here that this is a gallery error but over there they say it is this mod's error, what now?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Nokonium on December 01, 2007, 09:32:52 AM
I have made a small tweak to this to display the realName instead of the userName.

Why?

On boards where users can change their displayed name in their profile the username can be different to the  displayed name (realname).

////////////////////////////////////////////////////
// SMF Gallery Random Picture - ver. 1.7.1        //
////////////////////////////////////////////////////
//
// Developed by Thurnok
// Thurnok -AT- tinyportal .DOT. net
// November 30, 2006
//
//
// Updated 1/12/07 by nokonium
// 1.7.1 version with realName
//             - shows realName instead of membername
//
// Updated 5/9/2007
// 1.7.1
// - quick fix to parsing the url
//
// Updated 5/9/2007
// 1.7
// - added option to view pics that members on your buddy list posted
//
// For list of all previous updates history, see the UPDATES.TXT attached file
// in the post where you got this code, or the .ZIP file if you downloaded it
//
// Used in a TinyPortal phpblock or Article.
// This block displays random picture(s) from
// the SMF Gallery mod along with other information

//////////////////////////////////////////////

global $scripturl, $db_prefix, $modSettings, $boardurl, $ID_MEMBER, $user_info, $context;

/*
****************************************
****************************************
***    !! Admin Config Section !!    ***
****************************************
****************************************
*/

//   *****   LAYOUT OPTIONS   *****
// how many pictures do you want to show?  0 = all!
$gal_numpics = 1;

// use random, or most recent pics?
// 0 = random, 1 = most recent, 2 = most viewed, 3 = most commented
$gal_showtype = 0;
// sort :: 0 = Descending, 1 = Ascending
$gal_sort = 0;

// enable profile pics display?
// 0 = disable, 1 = enable --- if enabled, and you are viewing a member profile, show pics from that member only
// other options still apply (showtype, sort order, etc)
$gal_profile = 1;

// only show pics from buddies?
// 0 = disable, 1 = enable --- if enabled, will only show pics posted by members in your buddy list
$gal_buddies = 0;

// use Normal Size Text, or Small Size Text? (0 = Normal Size, 1 = Small Size)
$gal_smalltext = 1;

// put pictures in how many columns?  (1 for left/right block, more for centerblock / article if you wish)
$gal_columns = 1;

// information display flags (0 = No, 1 = Yes)
// display picture title?
$gal_dispTitle = 1;
// display realName who posted pic?
$gal_dispMember = 1;
// display posted date?
$gal_dispDate = 1;
// display category the picture is in?
$gal_dispCategory = 1;
// display number of views?
$gal_dispViews = 1;
// display dimensions?
$gal_dispDimensions = 1;
// display filesize?
$gal_dispSize = 1;
// display picture description?
$gal_dispDescription = 0;


//   *****   SECURITY CONFIGURATION   *****
// do not allow the following category numbers to be displayed
// example: $gal_disallowCats = "4,2,7" - don't show categories 2, 4, or 7
$gal_disallowCats = "";
// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "";
// Require the user has allowedTo('smfgallery_view') permission to view random pics thumbnails in block?
$gal_viewPermission = 1;

/*
****************************************
****************************************
***  !! END Admin Config Section !!  ***
****************************************
****************************************
*/

//###############################################
//###############################################
//   You shouldn't change anything below here
//###############################################
//###############################################

if (empty($modSettings['gallery_url'])){
$modSettings['gallery_url'] = $boardurl . '/gallery/';
}

$gal_textclass = empty($gal_smalltext) ? "normaltext" : "smalltext";

// get this user's buddy list
$gal_buddylist = implode(",", $user_info['buddies']);

// prep for our switch routine
if (empty($gal_showtype))
$gal_showtype = 0;

// sort text
if (empty($gal_sort)){
$gal_sort_text = 'DESC';
} else {
$gal_sort_text = '';
}

// are we viewing a member profile and $gal_profile is enabled?
if (!empty($gal_profile) && strtolower($context['current_action']) == "profile"){
$gal_member = empty($_GET['u']) ? $ID_MEMBER : $_GET['u'];
}
// allow member to view random pic based on security settings
if (empty($gal_viewPermission) || allowedTo('smfgallery_view')){
$gal_query = '
SELECT
thumbfilename,
ID_PICTURE,
ID_MEMBER,
date,
title,
description,
views,
filesize,
height,
width,
commenttotal,
ID_CAT
FROM '.$db_prefix.'gallery_pic
WHERE approved = 1
'.(empty($gal_member) ? (empty($gal_buddies) ? "" : (empty($gal_buddylist) ? "AND ID_MEMBER = NULL " : "AND ID_MEMBER in ($gal_buddylist)")) : "AND ID_MEMBER = $gal_member" ).'
'.(empty($gal_disallowCats) ? "" : " AND ID_CAT NOT IN ($gal_disallowCats)").'
'.(empty($gal_allowCats) ? "" : " AND ID_CAT IN ($gal_allowCats)").'
GROUP BY thumbfilename ';

switch ($gal_showtype){
// most/least recent
case 1:
$gal_query .= '
ORDER BY date '.$gal_sort_text;
break;

// most/least viewed
case 2:
$gal_query .= '
ORDER BY views '.$gal_sort_text;
break;

// most/least commented
case 3:
$gal_query .= '
ORDER BY commenttotal '.$gal_sort_text;
break;

default:
$gal_query .= '
ORDER BY rand() '.$gal_sort_text;
break;
}
$gal_query .= (empty($_GET['gal_viewall']) && !empty($gal_numpics)) ? ' LIMIT '.$gal_numpics : '';
$gal_result = mysql_query($gal_query);
if (!$gal_result){
// error retrieving information from database
if (mysql_errno() == 1146){
echo '<p />Error, no database found!<p />';
} else {
echo '<p />MySQL error:'.mysql_error().'<p />';
}
} else {
echo "\n".'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%">'."\n";

$gal_colcnt = 1;
echo " <tr>\n";
while ($row = mysql_fetch_assoc($gal_result)){
if ($gal_colcnt > $gal_columns){
// close out the row and start a new row
echo " </tr>\n <tr>\n".' <td colspan="'.$gal_columns.'"><hr /></td>'."\n </tr>\n <tr>\n";
// reset count to column 1
$gal_colcnt = 1;
}
echo ' <td class="'.$gal_textclass.'" align="center">'."\n";
// display title if enabled, make edit link if viewing user is picture poster
if (!empty($gal_dispTitle)){
echo " ".($ID_MEMBER == $row['ID_MEMBER'] ? ('<a href="'.$scripturl.'?action=gallery;sa=edit;id='.$row['ID_PICTURE'].'">'.$row['title'].'</a>') : $row['title'])."<br /><br />\n";
}
// display the picture thumbnail and link it to gallery full picture
echo ' <a href="'.$scripturl.'?action=gallery;sa=view;id='.$row['ID_PICTURE'].'"><img src="'.$modSettings['gallery_url'].$row['thumbfilename'].'" /></a><br /><br />'."\n";
// display poster's name and posted date if enabled
if (!empty($gal_dispMember) || !empty($gal_dispDate)){
echo 'Posted';
if (!empty($gal_dispMember)){
// display the realName who posted pic?  need to get name based on ID_MEMBER
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT realName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['realName'].'</a>';
}
if (!empty($gal_dispDate)){
// display the date it was posted
echo ' on '.date("d M Y", $row['date']);
}
echo "<br />\n";
}
// display category if enabled
if (!empty($gal_dispCategory)){
// get category name based on category id
$gal_tmp = mysql_fetch_assoc(mysql_query("SELECT title FROM ".$db_prefix."gallery_cat WHERE ID_CAT = ".$row['ID_CAT']));
echo '<br />in<br /><a href="'.$scripturl.'?action=gallery;cat='.$row['ID_CAT'].'">'.$gal_tmp['title']."</a><br /><br />\n";
}
// display number of views if enabled
if (!empty($gal_dispViews)){
echo "Viewed ".$row['views']." times<br />\n";
}
// display dimensions if enabled
if (!empty($gal_dispDimensions)){
echo $row['width']."w X ".$row['height']."h<br />\n";
}
// display filesize if enabled
if (!empty($gal_dispSize)){
echo $row['filesize']." bytes<br />\n";
}
// display description if enabled
if (!empty($gal_dispDescription)){
echo "<br />".$row['description']."<br />\n";
}
echo " </td>\n";
$gal_colcnt++;
}
mysql_free_result($gal_result);
echo " </tr>\n</table>\n";
if (!empty($gal_member) && empty($_GET['gal_viewall']))
echo '<br /><a href="'.$boardurl.'/index.php?action=profile;u='.$gal_member.';gal_viewall=1">View all pics from this member</a>';
if (!empty($gal_buddies) && empty($_GET['gal_viewall'])){
// build the link
$gal_querystring = $context['TPortal']['querystring'];
$gal_querystring .= empty($gal_querystring) ? 'gal_viewall=1' : ';gal_viewall=1';
echo '<br /><a href="'.$boardurl.'/index.php?'.$gal_querystring.'">View all pics of buddies</a>';
}
}
} else {
echo 'Sorry, you do not have permission to view pictures!';
}
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on December 01, 2007, 10:46:24 AM
Quote from: MinasC on November 25, 2007, 03:38:06 AM
is there any way to show the member's name who posted the picture , using the member's color ?

any ideas on that ? gallery itself uses member's color in the section "who's viewing a pic" but i couldn't find a way to do the same in my  fallery random pic block !  :(
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on December 12, 2007, 01:20:27 PM
anyone ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Zetan on December 22, 2007, 11:42:29 PM
Awsome just what I was looking for, any possible way to add a search to the code aswell, I am using this block as a front page block and would be nice to have a search right on top of the front page as well.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Zetan on December 22, 2007, 11:48:39 PM
finally found it then  :P
Title: Re: [Block] SMF Gallery Random Picture
Post by: Reality12 on January 10, 2008, 03:05:28 PM
i didn't see a response to changing the dimension of the displayed thumbnails...

...can anyone answer that one for me if possible?

Title: Re: [Block] SMF Gallery Random Picture
Post by: Mick on January 14, 2008, 09:01:48 PM
Im using the code in the 1st post.

Is there a way to change the display size to 568x426 pixels to use on  a center block?

...say...instead if grabbin the thumbnail size,maybe the size of the image itself?

Right now is on a left block and the image is displayed small. I'd like to change the size.
Title: Re: [Block] SMF Gallery Random Picture
Post by: RoarinRow on January 21, 2008, 11:07:39 PM
Works great, thanks for the code!  Woo hoo!   :up:
Title: Re: [Block] SMF Gallery Random Picture
Post by: Angelotus on January 22, 2008, 03:31:35 PM
How to use this as an SSI function?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Riggs on January 23, 2008, 01:42:45 AM
Worked like a charm.  Rock on Thurnok!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mick on January 30, 2008, 01:22:42 AM
Quote from: bluedevil on January 14, 2008, 09:01:48 PM
Im using the code in the 1st post.

Is there a way to change the display size to 568x426 pixels to use on  a center block?

...say...instead if grabbin the thumbnail size,maybe the size of the image itself?

Right now is on a left block and the image is displayed small. I'd like to change the size.

Anyone want to take a whack at this quote?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Reality12 on January 30, 2008, 02:18:54 AM
i didn't see a response to changing the dimension of the displayed thumbnails...

...can anyone answer that one for me if possible?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on January 30, 2008, 04:47:09 AM
As far as I could tell the gallery is what sets the size of the thumbnail.
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on January 30, 2008, 07:11:58 AM
QuoteAs far as I could tell the gallery is what sets the size of the thumbnail.

You are correct, had the same question a while back, SMFHacks had all the info on that ( where the mod comes from )
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on February 10, 2008, 05:08:22 AM
Sorry.. been on Hiatus for 6+ months... here are some answers to recent questions - even if some are a few months old  ;)

@Rafferty - The undefined errors you were receiving are from the SMF Gallery MOD - this thread deals with the TP Block that "uses" the MOD.  So when you say "Well this is weird, it's said here that this is a gallery error but over there they say it is this mod's error, what now?" - I assume by "over there" you mean at Simple Machine Forums - and they are correct... it is a problem with the MOD.  And when we here say it is a problem with the Gallery, we mean the Gallery MOD which was neither written here, nor at SMF, but instead at SMF Hacks.

@ MinasC - Yes, there is a way to show the member color, it just hasn't been added to the block code -- see top of this post  ;)

@ Jippo - There are already search capabilities provided by SMF and TP, you should be able to simply add them to your frontpage.  Unless you are talking about searching for gallery pics.  That would instead have to be added to the block.

@~Alex / Bluedevil - The thumbnail size is dictated by the SMF Gallery Mod.  Adding a dynamic thumbnail size to the block would take some looking into, which I don't currently have enough time to do, but may in the future when I'm back to a normal schedule.


This block has been around for quite awhile, and I haven't done any changes in numerous months, not sure if there is any real need to do any at this point until I'm fully back "in the game" so to say.  But if you still have feature requests, post them up.

Title: Re: [Block] SMF Gallery Random Picture
Post by: black.white9 on February 10, 2008, 06:36:12 AM
woooohooooo....many thanks to you!!
Title: Re: [Block] SMF Gallery Random Picture
Post by: MinasC on February 10, 2008, 11:20:28 PM
Quote from: Thurnok on February 10, 2008, 05:08:22 AM
@ MinasC - Yes, there is a way to show the member color, it just hasn't been added to the block code -- see top of this post  ;)

thnx a lot for the answer ! plz consider this a request !
Title: Re: [Block] SMF Gallery Random Picture
Post by: Rafferty on February 11, 2008, 09:23:01 AM
Sorry to be a pain Thurn, yep my bad. It was over at SMF they said it was the code I'm using in the snippet, at hacks he said it was SMF and here ya say its the gallery. No wonder Im confused.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on February 14, 2008, 02:41:39 AM
No pain whatsoever Rafferty.

Yea, it can be confusing when you are dealing with 4 different pieces to the puzzle.  SMF being the "base" piece, since it is the forum software, TP being another "rather big piece" since it is a Portal "mod" to SMF - and therefore a large integral piece to anyone's site that has SMF/TP installed, and then the Galler mod which, just like Tiny Portal, is a mod to SMF as well, though smaller in terms of a site's "perception", and finally the SMF Gallery Random Picture block code which is miniscule in comparison to any of the other three.

Going off of the errors you posted:
Quote from: Rafferty"8: Undefined index: smfgalleryprofile_title
File: /home/www/xxxxxxx.org/forum/Themes/default/languages/Gallery.english.php (eval?)
Line: 399"

"8: Undefined index: smfgalleryprofile_viewall
File: /home/www/xxxxxxx.org/forum/Themes/default/languages/Gallery.english.php (eval?)
Line: 410"

These are indeed errors "detected" by SMF but they point to an issue with the SMF Gallery mod (based on the variable names at issue).  Most likely they are due to a corrupt or incorrectly installed SMF Gallery mod, or a version of the mod that may have had problems or simply needs a fix.  Those particular variables (smfgalleryprofile_title and smfgalleryprofile_viewall) are not in SMF, TP, nor the SMF Gallery Random Picture block code, they only come from the SMF Gallery mod itself.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Rafferty on February 15, 2008, 03:39:11 AM
Thank you very much, your a gentleman and a scholar lol, appreciate the explanation. I'll go chasing.
Title: Re: [Block] SMF Gallery Random Picture
Post by: warhonowicz on February 19, 2008, 09:23:35 AM
Thurnok, thanks a lot for this fab bit of code and also for pointing me in its direction ...
Title: Re: [Block] SMF Gallery Random Picture
Post by: cepheus on February 21, 2008, 11:09:51 AM
Amazing bloc .... love it - thank you!
Title: Re: [Block] SMF Gallery Random Picture
Post by: allkvinde on February 21, 2008, 10:36:51 PM
Wow I am impressed because even I could do this and figure out how to change the script to how I wanted it. I never thought that I would be doing that.

Thank you so much for a wonderful very easy to follow description of how to do it.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on February 28, 2008, 02:21:27 AM
Welcome to all.

I try to make my block code as readable and easy to modify as possible since you generally have to make changes right in the code to configure things (for any block code).  So I hope its as easy for anyone else too.  :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: insanemustang on May 07, 2008, 06:28:46 PM
I'd like to know if the # of comments made about the photo can be added in with a link to take you to the comments of that particular picture.

Great script, thank you.
Title: Re: [Block] SMF Gallery Random Picture
Post by: insanemustang on May 08, 2008, 02:08:08 PM
Quote from: insanemustang on May 07, 2008, 06:28:46 PM
I'd like to know if the # of comments made about the photo can be added in with a link to take you to the comments of that particular picture.

Great script, thank you.

anyone?
Title: Re: [Block] SMF Gallery Random Picture
Post by: JPDeni on May 08, 2008, 02:16:09 PM
It's very likely possible. The trouble is that, before anyone can write code that accesses the information created by any modification, the coder has to have the mod installed. There are some small things that I don't mind installing on my test site, but some are just too involved for me to do. The gallery would require not only installing the mod, but also adding images and having people comment on them.

Possibly someone who has the mod installed on their site can help you.
Title: Re: [Block] SMF Gallery Random Picture
Post by: insanemustang on May 08, 2008, 02:26:30 PM
Hum... seems reasonable.  Maybe someone else can help... if not I will get with you and set you up an account on my website... that is... if you are trustworthy  >:D
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on May 12, 2008, 01:15:13 AM
The answer is "yes".  However, modification to the underlying code is necessary to pull the information from the database and then act on that.  I've added it to my "to-do's" but it might be awhile before I get back into modifications to my various block codes (due to recent events).  Anyone else is free to take a stab at it however.  It is not a very difficult addition.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Ken. on May 12, 2008, 01:22:00 AM
Good to see you Thurnok, we've been missing you.  :up:
Title: Re: [Block] SMF Gallery Random Picture
Post by: ccbtimewiz on June 04, 2008, 07:53:29 PM
I admit this code is quite useful, I used it to customize my own version of the modification, however... That is not the proper way to execute a mysql query in PHP. The code introduces a memory leak.

You are executing a query, fetching a single row, but you don't free up any of the memory that was used the execute the query. You have the store the result of the query in a variable, then use the mysql_fetch_assoc function. After you are done with the query results you MUST call mysql_free_result on the query result variable.

Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on June 04, 2008, 11:49:17 PM
I think you need to review the code again, or ensure you are looking at the full code.  There is in fact a mysql_free_result for the resource I fetch with my query.  It is near the end of the code.

Perhaps you are looking at someone's small subset of the code when they were asking a question?  I'm not sure what code you were looking at, but you will find the full code in the first post in this thread.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on June 05, 2008, 12:04:36 AM
By the way, I didn't mention it, but I might as well for those out there that may not know...

mysql_free_result() is actually NOT required as ccbtimewiz tries to indicate.  All result sets from mysql_query()'s are automatically freed at the php script's execution end.  It is good practice however, to use it (as I ALWAYS do), and also it helps if you are making multiple result sets that are very large, since they all take up memory "during" the script execution.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Talliostro on June 05, 2008, 07:50:01 AM
okay I can't help you with the code, but wanted to say thank you for the block, it works perfect on my site :) :up:
Title: Re: [Block] SMF Gallery Random Picture
Post by: ccbtimewiz on June 05, 2008, 08:36:14 PM
Quote from: Thurnok on June 04, 2008, 11:49:17 PM
I think you need to review the code again, or ensure you are looking at the full code.  There is in fact a mysql_free_result for the resource I fetch with my query.  It is near the end of the code.

Perhaps you are looking at someone's small subset of the code when they were asking a question?  I'm not sure what code you were looking at, but you will find the full code in the first post in this thread.

I'm looking at the code in the first post. ^^'

Quote from: Thurnok on June 05, 2008, 12:04:36 AM
By the way, I didn't mention it, but I might as well for those out there that may not know...

mysql_free_result() is actually NOT required as ccbtimewiz tries to indicate.  All result sets from mysql_query()'s are automatically freed at the php script's execution end.  It is good practice however, to use it (as I ALWAYS do), and also it helps if you are making multiple result sets that are very large, since they all take up memory "during" the script execution.

mysql_free_result($gal_result);

^ You can't call the function on an array. Only reason to why the error log isn't showing this error is because SMF is most likely deallocating the array.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on June 07, 2008, 03:49:56 AM
What drugs are you on exactly?
You even put a code snippet of my call to free the resource above.

Snippet of my code from the first post in this thread:

$gal_result = mysql_query($gal_query);

.
.
.

<various other stuff here>

.
.
.

mysql_free_result($gal_result);


$gal_result is NOT an array.  It is a variable of type RESOURCE returned from the mysql_query() function.  I'll direct you to the PHP website's own reference to help you better understand php: http://www.php.net/manual/en/function.mysql-free-result.php
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on June 07, 2008, 03:57:23 AM
Oh... and there is no error in SMF because, well... there is no error.
Title: Re: [Block] SMF Gallery Random Picture
Post by: ccbtimewiz on June 07, 2008, 04:30:35 PM
Ah.... I see. Never seen code written that way before. =T
Title: Re: [Block] SMF Gallery Random Picture
Post by: mrbean17 on June 20, 2008, 10:04:31 PM
Can you add links to view gallery and to add a picture? I attempted to add the html and I got a nice parse code because I suck.

Thanks!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on June 21, 2008, 07:29:28 AM
I think I partially understand what you are asking.

Try taking a look at another piece of block code here:
http://www.tinyportal.net/index.php?topic=14235.msg119054#msg119054
Title: Re: [Block] SMF Gallery Random Picture
Post by: mrbean17 on June 24, 2008, 05:34:25 PM
That's cool ... but ideally I'd just like links right under the random picture gallery that give the user a click able link to view gallery or add a picture.

Now I will show you my awesome artistic abilities!

---------------------
| (x's are pictures)   |
| x   x   x   x   x   x   |
|                           |
|     "view gallery"    |
|      "add picture"    |
----------------------

Thanks
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on June 25, 2008, 02:57:30 AM
Not sure I see the point in a link for "View Gallery" as you probably already have that in your menu, plus any picture they click on will show them that picture inside the SMF Gallery's picture view page that also has a link to the main gallery page.  Seems like it would be overly redundant to me.  But, you could simply add the link in the code to display at the bottom of your block.

The "add picture" link could also simply be added at the bottom of the block, though if they do not have rights to add pictures, SMF Gallery probably will display a message to such.  If you only wanted the "add" link to be displayed to users that have permission to add pictures, that would need to be added to the actual code.
Title: Re: [Block] SMF Gallery Random Picture
Post by: forummaker on July 01, 2008, 01:33:39 AM
Here's something odd. When I have a "Copperminefetch" block and a "SMF Gallery Random Picture" block on the front page at the same time the SMF GRP block does not display, and displays this error:
MySQL error:Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)
The error goes away when I remove the Copperminefetch block. I'd like to have both boxes on the page at the same time, but what do I need to do? Thanks in advance for any help.
Here's the link. www.remedydog.com
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on July 01, 2008, 06:53:29 AM
Sorry, but I do not have Coppermine, so I have no idea how it is setup in SMF.  Also, due to this, I do not have the Copperminefetch block.  And since I'm not the author, I'd say you are better off asking the author of that particular block.  It sounds like something in the Copperminefetch block, but that's not to say it couldn't be something in Coppermine itself, or its setup.
Title: Re: [Block] SMF Gallery Random Picture
Post by: trench on July 05, 2008, 02:02:17 AM
Can we adjust the thumbnail size???  this blocks works fine. Just wanted to make the Thumbnail bigger.
Title: Re: [Block] SMF Gallery Random Picture
Post by: scott_68 on July 06, 2008, 09:29:23 AM
 :D

Perfect works really good on my one www.zunft-hyboriens.de.
Same questeion as above - any option to have a little bigger thumbnails  ?

Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on July 07, 2008, 07:56:36 AM
The block currently uses SMF Gallery's own thumbnails.  So the size is set by SMF Gallery.  I've included the request on the wish list for a future release however.
Title: Re: [Block] SMF Gallery Random Picture
Post by: trench on July 07, 2008, 09:48:03 AM
You need PRO edition to set Thumbnails unfortunately....
Title: Re: [Block] SMF Gallery Random Picture
Post by: forummaker on July 12, 2008, 03:57:06 AM
Can someone assist me on fixing this error?
"2: mysql_query() [<a href='function.mysql-query'>function.mysql-query[/url]]: A link to the server could not be established
File: /home/content/j/u/m/html/forums/Themes/default/TPortal.template.php (tp_below sub template - eval?)
Line: 176:"
Thanks in advance.
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on July 12, 2008, 06:01:39 AM
Its trying to run a query, but you don't have a connection to the DB for some reason. I would speak to your host about this.
Title: Re: [Block] SMF Gallery Random Picture
Post by: forummaker on July 13, 2008, 03:09:56 PM
Thanks for responding. Everything seems to be working on the site. What issues could this possibly be posing that may be lurking behind the scenes? How urgent is this to be repaired? Thanks again.
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on July 13, 2008, 10:01:13 PM
Behind the scenes? I don't know why there would be anything like that. How urgent to get this repaired? Isn't that something you should be answering? lol ITs a HOST issue, and NOT a SMF or TP issue as far as I know.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on July 14, 2008, 01:36:16 AM
If you disable the SMF Random Pic block, does the error disappear?  If so, then check the block code to make sure you didn't make any typo's when configuring it.
Title: Re: [Block] SMF Gallery Random Picture
Post by: DirtBike on July 29, 2008, 09:37:20 AM
I have installed this mod and set it all up but I only get the dreaded Red X instead of the thumbnails showing up. Any ideas would be appreciated   
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on July 29, 2008, 10:18:49 AM
If you rightclick the red x and look at the properties, what does the path tell you ?  Make sure the images are in that path.
Title: Re: [Block] SMF Gallery Random Picture
Post by: DirtBike on July 29, 2008, 10:27:38 AM
Ok I had a look at this and I don’t have thumbnails in that folder at all. If I remove the thumb_ from in front of this the image displays   

/gallery/thumb_1_08_04_08_12_17_28.jpg
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on July 29, 2008, 10:34:09 AM
You have to contact smfhacks.com and ask them to help you with the thumnails and why you dont have any generated in that folder.
Title: Re: [Block] SMF Gallery Random Picture
Post by: DirtBike on July 29, 2008, 10:59:41 AM
Ok thanks I have done this, sorry about the post
Title: Re: [Block] SMF Gallery Random Picture
Post by: DirtBike on July 29, 2008, 02:46:25 PM
Quote from: DirtBike on July 29, 2008, 09:37:20 AM
I have installed this mod and set it all up but I only get the dreaded Red X instead of the thumbnails showing up. Any ideas would be appreciated   

I thought I would just post the fix for this if anyone else has this problem.

I had not installed the GD extensions in my php setup
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on July 29, 2008, 02:52:00 PM
Thanks DirtBike for poting up the fix  :up:

I will mark this to solved :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Phil Serna on August 05, 2008, 12:31:26 AM
nice share! just what I want
Title: Re: [Block] SMF Gallery Random Picture
Post by: blouogies on August 05, 2008, 03:43:50 PM
Thanks for the share Thurnok!!!

This is excellent!!!!  ;)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on August 07, 2008, 08:10:54 AM
Glad to help. :)

One of these days I'll actually get around to doing some updates I've planned for so long... hehe
Title: Re: [Block] SMF Gallery Random Picture
Post by: lOOmis on September 05, 2008, 08:27:34 PM
Great code. I have done a search and read through the threadbut did not find my problem. I am trying to get just one gallery to show up in the front page block. I've changed the path to the gallery pics in the gallery config and moved the pictures to the correct folder but no pictures show up in the block. I would like to use two different gallery blocks (one for graphics and one for web design) to show images from two different gallery's (graphics and web design). Thanks
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on September 09, 2008, 06:41:18 AM
Sorry, I'm not sure what you mean.  What do you mean by a single gallery?  Are you saying you have multiple SMF Galleries installed?  Or are you talking about only displaying a single gallery category vice all categories?

If you mean "categories" there is a variable in the Admin Config Section for that exact purpose and explained in the comment text of the code, as well as the first post in this thread.  Look at the $gal_allowCats variable info.
Title: Re: [Block] SMF Gallery Random Picture
Post by: katers on September 25, 2008, 09:36:55 PM
I am having sort of the same problem as 100mis.  I want to show only one category.  It is the add on recent video for smf gallery.  I think I change something in the following code but cannot figure out what.  Also, how do I figure out what the category number is?

Thank you

//   *****   SECURITY CONFIGURATION   *****
// do not allow the following category numbers to be displayed
// example: $gal_disallowCats = "4,2,7" - don't show categories 2, 4, or 7
$gal_disallowCats = "";
// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "";
// Require the user has allowedTo('smfgallery_view') permission to view random pics thumbnails in block?
$gal_viewPermission = 1;
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on September 25, 2008, 09:41:15 PM
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "";  <-- add the category number inbetween the quotes that you want show. To get the category number you look at your URL when you're in the category, it should show in the URL.
Title: Re: [Block] SMF Gallery Random Picture
Post by: katers on September 26, 2008, 01:03:36 AM
IchBin my hero, thanks for the help.

Sorry to be such an idiot about this, but the category number is 34 and obviously I stil put it in the wrong place because it is not showing.

//   *****   SECURITY CONFIGURATION   *****
// do not allow the following category numbers to be displayed
// example: $gal_disallowCats = "34" - don't show categories 2, 4, or 7
$gal_disallowCats = "";
// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "34" - show only categories 1, 3, and 4
$gal_allowCats = "";
// Require the user has allowedTo('smfgallery_view') permission to view random pics thumbnails in block?
$gal_viewPermission = 1;
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on September 26, 2008, 03:11:58 AM
Lines that start with a double forwardslash ( // ) are comment lines.  They are not active code and anything you change there will have no effect.  You changed a comment line, so it has no effect.

That said, you also were changing the wrong one.  The $gal_disallowCats is for you to specify categories you do NOT want to show.  In your case, that would be the wrong selection.  You said you only want to show category 34, so you should change the $gal_allowCats line.  Make sure you read the variables carefully as the two I just mentioned do the opposite things.

For your case, change the line:

$gal_allowCats = "";


to

$gal_allowCats = "34";


Be careful not to leave out the quotes surrounding the category, and also do not erase the semicolon at the end of the line or you will get errors.
Title: Re: [Block] SMF Gallery Random Picture
Post by: mr tart on September 26, 2008, 03:51:59 PM
Is there a way to get it to display the number of comments beneath the thumbnail?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Thurnok on September 27, 2008, 04:19:45 AM
This was actually asked for a long time back, but I have been away for awhile.  I just updated it to provide the option to display number of comments with a link to the picture/comments.

Since this was a "quicky" I decided to just post it as is, however I have a "to-do" list of things for this block which I hope to take care of soon now.
Title: Re: [Block] SMF Gallery Random Picture
Post by: mr tart on September 27, 2008, 10:58:17 AM
fantastic, thankyou very much :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: cabletool on October 23, 2008, 06:40:48 PM
Ive read all the posts and couldnt find the answer.

Im using Crips BlackBox theme. The random images will not show with that theme. Ive been using this mod for over a year with the default theme but want a fresh theme.

Whats involved in using this block in another theme or why wouldnt the theme call it?

tia!
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on October 24, 2008, 08:42:45 PM
Should not be any problem what so ever in any theme as the blocks follow the settings from the default theme.

You can look at it on my site, i have it on the frontpage topblock and in the forum you have the theme block to set diffrent themes to check it with.

www.familjegodis.se

What you can try to do though is to copy the tp-style.css from the default theme and paste it in your custom theme and see if it helps, but worth a try as thats the only thing i can think of that could change anything between the themes and the blocks.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Final60 on November 25, 2008, 11:27:08 PM
Heya
Thanks for this excellent block code!

I was having trouble. Not sure it it was because of updating to SMF 2.0b4 or because it is a newer SMG Gallery version, but the images were in a different url for example:

Main image is in: http://www.dcpryzom.co.uk/forum/index.php?action=gallery;sa=view;pic=163
The thumbnail in block pointed to:  http://www.dcpryzom.co.uk/forum/index.php?action=gallery;sa=view;id=163

So in the block code I had to search for sa=view;id and change it to sa=view;pic

Hope that helps anyone :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: JPDeni on December 06, 2008, 05:03:28 PM
Where are the images that are broken?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Ken. on December 06, 2008, 05:37:07 PM
Quote from: Final60 on November 25, 2008, 11:27:08 PM
Heya
Thanks for this excellent block code!

I was having trouble. Not sure it it was because of updating to SMF 2.0b4 or because it is a newer SMG Gallery version, but the images were in a different url for example:

Main image is in: http://www.dcpryzom.co.uk/forum/index.php?action=gallery;sa=view;pic=163
The thumbnail in block pointed to:  http://www.dcpryzom.co.uk/forum/index.php?action=gallery;sa=view;id=163

So in the block code I had to search for sa=view;id and change it to sa=view;pic

Hope that helps anyone :)

If you've updated to SMF 2.0 then you will find that TinyPortal will not work with that version of SMF... it's the same for block codes I think. :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: SmokyBlue on December 06, 2008, 06:25:48 PM
not sure but it looks like portamx without the copywrite..  :o
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on December 06, 2008, 08:00:11 PM
Final60 It have come to our attention that you have removed the copywrite for the theme you are using on your site BlackRainV2

I will have to ask you to add that back to the theme even if you have alterd the template and added your own header.
It's better and more polite to add in the copywrite for the orign theme creator , and add to the line that it's based on BlackRainV2 or similar.

Also it is as Smoky say that you have portaMX installed there.
For things not working with images and other isses with that, we dont have support on this site for that portal, the theme is not made for PortaMX eather
Title: Re: [Block] SMF Gallery Random Picture
Post by: Crip on December 06, 2008, 11:58:40 PM
Why remove my Copyright ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: SmokyBlue on December 07, 2008, 01:37:49 AM
i just dont know Crip.. ya know, when someone uses something for free, the least they can do is keep the copywrite and say thanks, but copywrite for sure..

removing it just makes them look bad when smarter people know the person that worked hard even to think of making a theme...

sometimes respect is often ignored this way and if you like free stuff.. lol then keep the copywrite..

otherwise ask/pay for the right to remove,   :knuppel2:
Title: Re: [Block] SMF Gallery Random Picture
Post by: Final60 on December 08, 2008, 09:38:10 AM
I havent removed any copyright intentionally. What code do i need to add to the index?
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on December 08, 2008, 09:44:39 AM
Check the original index.template.php
Title: Re: [Block] SMF Gallery Random Picture
Post by: Final60 on December 08, 2008, 11:33:03 AM
Ive attached the the index.template.php. Could you help me get your copyright on there crip? Also it wouldn't have TP copyright atm cus ive had to use PortAmx, whos copyright also isnt shown for some reason.

thanks in advance...
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on December 08, 2008, 03:28:04 PM
I see the copyright just fine on  the sites.

Looked at the wrong site.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Smoothbrain on December 09, 2008, 07:22:42 PM
Hi all, I have a site that I run SMF Gallery Lite and I love this block snippet and I have another site where I am trying out SMF Media Gallery as it has a few more features I like and I was wondering if anyone has or knows how to modify this block code so that it will work for SMG.  Thanks heaps in advance.  You guys rule!
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on December 09, 2008, 07:41:37 PM
You will have to ask Dragooon that question, this code is developed by Thurnok and he havent been online for ages, but the gallerys are so diffrent so best would be to ask dragoon make a new code that do the same thing
Title: Re: [Block] SMF Gallery Random Picture
Post by: Smoothbrain on December 09, 2008, 07:43:26 PM
Thanks I will try that.
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on December 14, 2008, 06:08:06 PM
Petee, i splitted your post to it's own topic as it is for SMF Media gallery, hope you dont mind.

http://www.tinyportal.net/index.php/topic,27392.0.html
Title: Re: [Block] SMF Gallery Random Picture
Post by: dimdom on December 28, 2008, 03:52:28 PM
OK, this is difficult...


Any way to use this block with the script below?

<script type="text/javascript">

/***********************************************
* Conveyor belt slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


//Specify the slider's width (in pixels)
var sliderwidth="300px"
//Specify the slider's height
var sliderheight="150px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=3
//configure background color:
slidebgcolor="#EAEAEA"

//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''
leftrightslide[0]='<a href="http://"><img src="dynamicbook1.gif" border=1></a>'
leftrightslide[1]='<a href="http://"><img src="dynamicbook2.gif" border=1></a>'
leftrightslide[2]='<a href="http://"><img src="dynamicbook3.gif" border=1></a>'
leftrightslide[3]='<a href="http://"><img src="dynamicbook4.gif" border=1></a>'
leftrightslide[4]='<a href="http://"><img src="dynamicbook5.gif" border=1></a>'

//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}
window.onload=fillup

function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}


if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0"

onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://dynamicdrive.com">Dynamic Drive</a></font></p>



You may see its action there: http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm

It is already implemented in Coopermine Gallery as "Slider".


I would really appreciate any help....
Title: Re: [Block] SMF Gallery Random Picture
Post by: phyzer on January 03, 2009, 04:51:35 AM
muchas gracias | thanks al lot , it works !
Title: Re: [Block] SMF Gallery Random Picture
Post by: wilsy on February 21, 2009, 02:19:23 PM
Quote from: dimdom on December 28, 2008, 03:52:28 PM
OK, this is difficult...


Any way to use this block with the script below?

<script type="text/javascript">

/***********************************************
* Conveyor belt slideshow script- Ã,© Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


//Specify the slider's width (in pixels)
var sliderwidth="300px"
//Specify the slider's height
var sliderheight="150px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=3
//configure background color:
slidebgcolor="#EAEAEA"

//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''
leftrightslide[0]='<a href="http://"><img src="dynamicbook1.gif" border=1></a>'
leftrightslide[1]='<a href="http://"><img src="dynamicbook2.gif" border=1></a>'
leftrightslide[2]='<a href="http://"><img src="dynamicbook3.gif" border=1></a>'
leftrightslide[3]='<a href="http://"><img src="dynamicbook4.gif" border=1></a>'
leftrightslide[4]='<a href="http://"><img src="dynamicbook5.gif" border=1></a>'

//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}
window.onload=fillup

function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}


if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0"

onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://dynamicdrive.com">Dynamic Drive</a></font></p>



You may see its action there: http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm

It is already implemented in Coopermine Gallery as "Slider".


I would really appreciate any help....

This looks really good, I wish you luck with your request.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Joe B on February 21, 2009, 03:29:26 PM
thanks for the code. I like it...
Title: Re: [Block] SMF Gallery Random Picture
Post by: GKDantas on February 22, 2009, 12:34:50 AM
Really great code! Can add to more features?

1 - show a thumb or dont show images marked as mature content.

2 - a more simple way to adjust size of the thumbnails.


Thanks
Title: Re: [Block] SMF Gallery Random Picture
Post by: alecoddly on March 10, 2009, 11:31:05 PM
I have a problem with the script on my site http://wcsconline.com/index.php following upgrading to smf 1.1.8 originally the block was at the top along the legth of the page but now while not working I have moved it to the bottom of the page. as you can see it is not full width.

Ive added the script below which is unchanged apart from visual options (i think)

Any help greatlyu appreciated.

Quote////////////////////////////////////////////////////
// SMF Gallery Random Picture - ver. 1.8          //
////////////////////////////////////////////////////
//
// Developed by Thurnok
// Thurnok -AT- tinyportal .DOT. net
// November 30, 2006
//
// Updated 9/26/2008
// 1.8
//      - added display # of comments option
//
// Used in a TinyPortal phpblock or Article.
// This block displays random/most/least/newest/oldest picture(s) from
// the SMF Gallery mod along with other information
//
//////////////////////////////////////////////

global $scripturl, $db_prefix, $modSettings, $boardurl, $ID_MEMBER, $user_info, $context;

/*
****************************************
****************************************
***    !! Admin Config Section !!    ***
****************************************
****************************************
*/

//   *****   LAYOUT OPTIONS   *****
// how many pictures do you want to show?  0 = all!
$gal_numpics = 9;

// use random, or most recent pics?
// 0 = random, 1 = most recent, 2 = most viewed, 3 = most commented
$gal_showtype = 0;
// sort :: 0 = Descending, 1 = Ascending
$gal_sort = 0;

// enable profile pics display?
// 0 = disable, 1 = enable --- if enabled, and you are viewing a member profile, show pics from that member only
// other options still apply (showtype, sort order, etc)
$gal_profile = 1;

// only show pics from buddies?
// 0 = disable, 1 = enable --- if enabled, will only show pics posted by members in your buddy list
$gal_buddies = 0;

// use Normal Size Text, or Small Size Text? (0 = Normal Size, 1 = Small Size)
$gal_smalltext = 1;

// put pictures in how many columns?  (1 for left/right block, more for centerblock / article if you wish)
$gal_columns = 9;

// information display flags (0 = No, 1 = Yes)
// display picture title?
$gal_dispTitle = 0;
// display membername who posted pic?
$gal_dispMember = 0;
// display posted date?
$gal_dispDate = 0;
// display category the picture is in?
$gal_dispCategory = 0;
// display number of views?
$gal_dispViews = 0;
// display dimensions?
$gal_dispDimensions = 0;
// display filesize?
$gal_dispSize = 0;
// display picture description?
$gal_dispDescription = 0;
// display # comments
$gal_dispNumComments = 0;

//   *****   SECURITY CONFIGURATION   *****
// do not allow the following category numbers to be displayed
// example: $gal_disallowCats = "4,2,7" - don't show categories 2, 4, or 7
$gal_disallowCats = "";
// select only from the following cats - leave empty for all - NOTE:($gal_disallowCats overrides)
// example: $gal_allowCats = "1,3,4" - show only categories 1, 3, and 4
$gal_allowCats = "";
// Require the user has allowedTo('smfgallery_view') permission to view random pics thumbnails in block?
$gal_viewPermission = 1;

/*
****************************************
****************************************
***  !! END Admin Config Section !!  ***
****************************************
****************************************
*/

//###############################################
//###############################################
//   You shouldn't change anything below here
//###############################################
//###############################################

if (empty($modSettings['gallery_url'])){
   $modSettings['gallery_url'] = $boardurl . '/gallery/';
}

$gal_textclass = empty($gal_smalltext) ? "normaltext" : "smalltext";

// get this user's buddy list
$gal_buddylist = implode(",", $user_info['buddies']);

// prep for our switch routine
if (empty($gal_showtype))
   $gal_showtype = 0;

// sort text
if (empty($gal_sort)){
   $gal_sort_text = 'DESC';
} else {
   $gal_sort_text = '';
}

// are we viewing a member profile and $gal_profile is enabled?
if (!empty($gal_profile) && strtolower($context['current_action']) == "profile"){
   $gal_member = empty($_GET['u']) ? $ID_MEMBER : $_GET['u'];
}
// allow member to view random pic based on security settings
if (empty($gal_viewPermission) || allowedTo('smfgallery_view')){
   $gal_query = '
         SELECT
            thumbfilename,
            ID_PICTURE,
            ID_MEMBER,
            date,
            title,
            description,
            views,
            filesize,
            height,
            width,
            commenttotal,
            ID_CAT
         FROM '.$db_prefix.'gallery_pic
         WHERE approved = 1
         '.(empty($gal_member) ? (empty($gal_buddies) ? "" : (empty($gal_buddylist) ? "AND ID_MEMBER = NULL " : "AND ID_MEMBER in ($gal_buddylist)")) : "AND ID_MEMBER = $gal_member" ).'
         '.(empty($gal_disallowCats) ? "" : "   AND ID_CAT NOT IN ($gal_disallowCats)").'
         '.(empty($gal_allowCats) ? "" : "   AND ID_CAT IN ($gal_allowCats)").'
         GROUP BY thumbfilename ';

   switch ($gal_showtype){
      // most/least recent
      case 1:
         $gal_query .= '
               ORDER BY date '.$gal_sort_text;
         break;

      // most/least viewed
      case 2:
         $gal_query .= '
               ORDER BY views '.$gal_sort_text;
         break;

      // most/least commented
      case 3:
         $gal_query .= '
               ORDER BY commenttotal '.$gal_sort_text;
         break;

      default:
         $gal_query .= '
               ORDER BY rand() '.$gal_sort_text;
         break;
   }
   $gal_query .= (empty($_GET['gal_viewall']) && !empty($gal_numpics)) ? ' LIMIT '.$gal_numpics : '';
   $gal_result = mysql_query($gal_query);
   if (!$gal_result){
      // error retrieving information from database
      if (mysql_errno() == 1146){
         echo '<p />Error, no database found!<p />';
      } else {
         echo '<p />MySQL error:'.mysql_error().'<p />';
      }
   } else {
      echo "\n".'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%">'."\n";
   
      $gal_colcnt = 1;
      echo "   <tr>\n";
      while ($row = mysql_fetch_assoc($gal_result)){
         if ($gal_colcnt > $gal_columns){
            // close out the row and start a new row
            echo "   </tr>\n   <tr>\n".'      <td colspan="'.$gal_columns.'">
</td>'."\n   </tr>\n   <tr>\n";
            // reset count to column 1
            $gal_colcnt = 1;
         }
         echo   '      <td class="'.$gal_textclass.'" align="center">'."\n";
         // display title if enabled, make edit link if viewing user is picture poster
         if (!empty($gal_dispTitle)){
            echo "         ".($ID_MEMBER == $row['ID_MEMBER'] ? ('<a href="'.$scripturl.'?action=gallery;sa=edit;id='.$row['ID_PICTURE'].'">'.$row['title'].'</a>') : $row['title'])."
\n";
         }
         // display the picture thumbnail and link it to gallery full picture
         echo   '         <a href="'.$scripturl.'?action=gallery;sa=view;id='.$row['ID_PICTURE'].'"><img src="'.$modSettings['gallery_url'].$row['thumbfilename'].'" /></a>
'."\n";
         // display poster's name and posted date if enabled
         if (!empty($gal_dispMember) || !empty($gal_dispDate)){
            echo 'Posted';
            if (!empty($gal_dispMember)){
               // display the membername who posted pic?  need to get name based on ID_MEMBER
               $gal_tmp = mysql_fetch_assoc(mysql_query("SELECT memberName FROM ".$db_prefix."members WHERE ID_MEMBER = ".$row['ID_MEMBER']));
               echo ' by <a href="'.$scripturl.'?action=profile;u='.$row['ID_MEMBER'].'">'.$gal_tmp['memberName'].'</a>';
            }
            if (!empty($gal_dispDate)){
               // display the date it was posted
               echo ' on '.date("d M Y", $row['date']);
            }
            echo "
\n";
         }
         // display category if enabled
         if (!empty($gal_dispCategory)){
            // get category name based on category id
            $gal_tmp = mysql_fetch_assoc(mysql_query("SELECT title FROM ".$db_prefix."gallery_cat WHERE ID_CAT = ".$row['ID_CAT']));
            echo '
in
<a href="'.$scripturl.'?action=gallery;cat='.$row['ID_CAT'].'">'.$gal_tmp['title']."</a>

\n";
         }
         // display number of views if enabled
         if (!empty($gal_dispViews)){
            echo "Viewed ".$row['views']." times
\n";
         }
         // display dimensions if enabled
         if (!empty($gal_dispDimensions)){
            echo $row['width']."w X ".$row['height']."h
\n";
         }
         // display filesize if enabled
         if (!empty($gal_dispSize)){
            echo $row['filesize']." bytes
\n";
         }
         // display description if enabled
         if (!empty($gal_dispDescription)){
            echo "
".$row['description']."
\n";
         }
         // display # of comments if enabled
         if (!empty($gal_dispNumComments)){
            echo '
<a href="'.$scripturl.'?action=gallery;sa=view;pic='.$row['ID_PICTURE'].'">'.$row['commenttotal']."</a> comment(s)
\n";
         }
         echo   "      </td>\n";
         $gal_colcnt++;
      }
      mysql_free_result($gal_result);
      echo "   </tr>\n</table>\n";
      if (!empty($gal_member) && empty($_GET['gal_viewall']))
         echo '
<a href="'.$boardurl.'/index.php?action=profile;u='.$gal_member.';gal_viewall=1">View all pics from this member</a>';
      if (!empty($gal_buddies) && empty($_GET['gal_viewall'])){
         // build the link
         $gal_querystring = $context['TPortal']['querystring'];
         $gal_querystring .= empty($gal_querystring) ? 'gal_viewall=1' : ';gal_viewall=1';
         echo '
<a href="'.$boardurl.'/index.php?'.$gal_querystring.'">View all pics of buddies</a>';
      }
   }
} else {
   echo 'Sorry, you do not have permission to view pictures!';
}
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on March 10, 2009, 11:56:03 PM
What are your panel settings for that panel?
Title: Re: [Block] SMF Gallery Random Picture
Post by: alecoddly on March 11, 2009, 01:15:23 AM
thanks ichbin, didnt even know that was there, sorted now :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on March 11, 2009, 05:07:02 AM
/me points at quote in sig. :D
Title: Re: [Block] SMF Gallery Random Picture
Post by: DocPixel on March 20, 2009, 05:14:29 AM
Hi Guys, I have several questions about this one. I've never downloaded a snippet before.

Does it work with SMF Gallery Pro?
For multiple galleries, can you specify which gallery to pull from?
To download it, do you just copy the code and paste it into a php block? Or is there a download somewhere that I'm not seeing?  ::)

Thanks!
Sarah
Title: Re: [Block] SMF Gallery Random Picture
Post by: G6Cad on March 20, 2009, 07:43:45 AM
Ehhh, did you even take your time reading the first post, or the rest of them ?

1. Yes, will work with SMF gallery pro
2. yes. can have more then one gallery to show ( check the settings in the code )

So, read the first post as all the info you need is right there....
Title: Re: [Block] SMF Gallery Random Picture
Post by: DocPixel on March 20, 2009, 04:44:14 PM
I did read many of the posts, but obviously not carefully enough. So you're right, most of what I needed was right there. Sorry, and thanks for the reply.

Say, where can I get that smiley package?
Title: Re: [Block] SMF Gallery Random Picture
Post by: IchBin on March 20, 2009, 10:13:54 PM
What smiley package?
Title: Re: [Block] SMF Gallery Random Picture
Post by: DocPixel on March 20, 2009, 10:17:45 PM
The one here - it's way cool. I tried right-clicking and uploading to a folder and importing, but can't seem to get it to work. So I'm hoping it's a downloadable package somewhere. *hopeful smile*
Title: Re: [Block] SMF Gallery Random Picture
Post by: ElectricSquid on June 13, 2009, 11:55:31 PM
On the SMF website, the mod this works with has been updated.
Does this TP Block still work correctly with the updated SMF Gallery?

This is the latest update of the Mod...
SMF Gallery
Last Modified:  May 20, 2009, 09:24:51 PM
Latest Version: 2.0.5

... and as of this reply, this is the last time this TP Block has been updated...
Ã,« Last Edit: September 26, 2008, 22:17 by Thurnok Ã,»
Title: Re: [Block] SMF Gallery Random Picture
Post by: ZarPrime on June 14, 2009, 01:06:56 AM
@ ∑Ã,£â„“Ã,¢ââ,¬Â Ã,®Ã,¡Ã,¢ Ã,§á»£Ã...³Ã,¡Ã,,‘,

It's hard to say.  I don't have the SMF Gallery Mod installed or I might try it.  Do you have the Mod installed?  If so, why not try it and let us know if it works.  If it doesn't work, I guess it's an easy option to delete the block.

ZarPrime
Title: Re: [Block] SMF Gallery Random Picture
Post by: ElectricSquid on June 14, 2009, 01:12:06 AM
I'm about to install it, but this TP Block was the main reason for the install, that's why I asked.
Title: Re: [Block] SMF Gallery Random Picture
Post by: ElectricSquid on June 15, 2009, 12:10:37 PM
Yes, this block code seems to still work with the new SMF Gallery 2.0.5

...but, due to another mod I'm trying to get working with it, I need a copy of the older Gallery version. SMF Gallery 1.9.3

If anyone has a copy of the zip package for this older version,
please email it to me. The address is "electricsquid at hotmail dot com"

Thanks.
Title: Re: [Block] SMF Gallery Random Picture
Post by: ZarPrime on June 15, 2009, 02:07:35 PM
Well, I don't know about 1.9.3 but apparently 1.8.3 is available here --> http://custom.simplemachines.org/mods/index.php?mod=473

If you are interested in a 1.9.3 version I suggest you ask the Mod author in this topic --> http://www.simplemachines.org/community/index.php?topic=114291.msg732154#msg732154

or check to see if it's available here --> http://www.smfhacks.com/index.php

ZarPrime
Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on June 15, 2009, 02:15:42 PM
Is SMF Gallery the same as SMF Gallery Lite ?

If so, then I have 1.9.4 if you want it.  I looked at the Change Log and there was only one entry for that version between 1.9.4 and 1.9.3

Lemme Know...
Title: Re: [Block] SMF Gallery Random Picture
Post by: ElectricSquid on June 15, 2009, 03:23:47 PM
Quote from: freddy888 on June 15, 2009, 02:15:42 PM
Is SMF Gallery the same as SMF Gallery Lite ?

If so, then I have 1.9.4 if you want it.  I looked at the Change Log and there was only one entry for that version between 1.9.4 and 1.9.3

Lemme Know...

Yes, I would like it.
Thanks
Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on June 15, 2009, 03:50:39 PM
Sent :)
Title: Re: [Block] SMF Gallery Random Picture
Post by: ElectricSquid on June 15, 2009, 03:57:20 PM
Quote from: freddy888 on June 15, 2009, 03:50:39 PM
Here you go Squiddy :)

Thanks a lot Freddy.
That'll keep me busy for the next few hours :P
Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on June 15, 2009, 04:04:52 PM
No problem  :up:
Title: Re: [Block] SMF Gallery Random Picture
Post by: fl4pj4ck on July 02, 2009, 07:12:53 AM
any chance for a SMF Media Gallery conversion?
Title: Re: [Block] SMF Gallery Random Picture
Post by: ZarPrime on July 03, 2009, 12:50:39 PM
Quote from: fl4pj4ck on July 02, 2009, 07:12:53 AM
any chance for a SMF Media Gallery conversion?

fl4pj4ck,

What do you mean?

ZarPrime
Title: Re: [Block] SMF Gallery Random Picture
Post by: fl4pj4ck on July 03, 2009, 01:24:06 PM
same block, but working with SMF Media Gallery
Title: Re: [Block] SMF Gallery Random Picture
Post by: Lesmond on July 03, 2009, 01:28:53 PM
Quote from: fl4pj4ck on July 03, 2009, 01:24:06 PM
same block, but working with SMF Media Gallery
You would be best asking over at smf media gallery for this request  

:edit: look here (http://smf-media.com/community/index.php?topic=121.0)
Title: Re: [Block] SMF Gallery Random Picture
Post by: ZarPrime on July 03, 2009, 02:20:29 PM
Quote from: Lesmondâ„¢ on July 03, 2009, 01:28:53 PM
Quote from: fl4pj4ck on July 03, 2009, 01:24:06 PM
same block, but working with SMF Media Gallery
You would be best asking over at smf media gallery for this request 

:edit: look here (http://smf-media.com/community/index.php?topic=121.0)

Nice find Les. :up: :up:

ZarPrime
Title: Re: [Block] SMF Gallery Random Picture
Post by: ElectricSquid on July 03, 2009, 05:46:50 PM
Am I correct in thinking that I could reuse some of the code that makes up this block, in order to rebuild how the main Gallery acts?

Some of the options this code has, I would like to add directly to the Gallery code.
Title: Re: [Block] SMF Gallery Random Picture
Post by: fl4pj4ck on July 04, 2009, 02:05:30 AM
I know the other block, but this one is superior talking about configuration, etc, that's why I'm asking

I changed the link from (=gallery) to (=mgallery) here, it works ok but not showing up the pictures
seems it's a little too big for me
Title: Re: [Block] SMF Gallery Random Picture
Post by: blizz-craft on July 21, 2009, 03:46:04 AM
Exactly what I need!
Title: Re: [Block] SMF Gallery Random Picture
Post by: alecoddly on August 06, 2009, 08:53:37 AM
Hi I have had it reported that when clicking on any of the images displayed it is not bringing up the full image. A page is displayed saying no image selected with something similar to http://wcsconline.com/index.php?action=gallery;sa=view;pic=71 in the address bar.

Can anyone help please

have noticed that within the gallery when you hover over a picture or click the link  shows id= whereas the link generated from the block shows pic=

FIXED edited the below to show id= instead of pic=

   // display the picture thumbnail and link it to gallery full picture
         echo   '         <a href="'.$scripturl.'?action=gallery;sa=view;id='.$row['ID_PICTURE'].'"><img src="'.$modSettings['gallery_url'].$row['thumbfilename'].'" /></a>
'."\n";
Title: Re: [Block] SMF Gallery Random Picture
Post by: wyvern on December 03, 2009, 07:05:05 AM
Glorious snippet!

Great help in the comments to assist configuration: was easy for me to display the 5 most recent pics, with minimal text.

Thank you very much!
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mick on April 10, 2010, 04:26:26 AM
Is this something that can be converted to smf 2.0?   Will it be a pain to do? 
Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on April 10, 2010, 12:20:55 PM
Does this code work ?

http://smf-media.com/community/index.php?topic=121.msg7728#msg7728
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mick on April 10, 2010, 12:53:42 PM
Quote from: freddy888 on April 10, 2010, 12:20:55 PM
Does this code work ?

http://smf-media.com/community/index.php?topic=121.msg7728#msg7728
Im sure it works for aeva but, im using SMF gallery.   Quite frankly i had it with aeva bugs.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on April 10, 2010, 12:56:40 PM
Yep, that block was listed under :

SMF Media Community Ã,» SMF Media Gallery Ã,» Hacks and mods Ã,» Random Image Block for TP

Did you try it then ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mick on April 10, 2010, 01:16:02 PM
Quote from: freddy888 on April 10, 2010, 12:56:40 PM
Yep, that block was listed under :

SMF Media Community Ã,» SMF Media Gallery Ã,» Hacks and mods Ã,» Random Image Block for TP

Did you try it then ?

In the code, it has 'mGallery" which is for aeva, not for smf gallery.  It didnt work, maybe it needs cleanup.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on April 10, 2010, 01:19:52 PM
AH okay, my apologies.

So then to save me wading through 30 pages of chat have you got some code that worked with SMF 1 ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mick on April 10, 2010, 01:33:31 PM
Quote from: freddy888 on April 10, 2010, 01:19:52 PM
AH okay, my apologies.

So then to save me wading through 30 pages of chat have you got some code that worked with SMF 1 ?

Thurnok's first post really worked well in all user aspects in 1.1.x.  Would be a great choice for update.

.....sorry Freddy but this code is the only one i've used for smf gallery. 

Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on April 10, 2010, 01:37:52 PM
Thats okay, what version of Media Gallery do you use ?
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mick on April 10, 2010, 01:42:48 PM
Quote from: freddy888 on April 10, 2010, 01:37:52 PM
Thats okay, what version of Media Gallery do you use ?
None...

If you mean SMF Gallery, i use SMF Gallery Pro which is based of the standard SMF Gallery, http://custom.simplemachines.org/mods/index.php?mod=473

Smf Gallery Pro is a paid mod...
Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on April 10, 2010, 01:53:54 PM
Sorry...was getting confused with all the galleries  :P

Well I can try working on it for the free version.  I can't buy the Pro version as I have no use for it, but if that code worked for the Pro version maybe it will be okay.

Leave it with me, it will take a while.
Title: Re: [Block] SMF Gallery Random Picture
Post by: Mick on April 10, 2010, 02:00:22 PM
Quote from: freddy888 on April 10, 2010, 01:53:54 PM
Sorry...was getting confused with all the galleries  :P

Well I can try working on it for the free version.  I can't buy the Pro version as I have no use for it, but if that code worked for the Pro version maybe it will be okay.

Leave it with me, it will take a while.

Very well..... ;)
Title: Re: [Block] SMF Gallery Random Picture
Post by: Freddy on April 10, 2010, 03:56:46 PM
I started a new topic here as this thread is currently for SMF 1 mainly it seems.  Made sense to branch out.

New topic here... (http://www.tinyportal.net/index.php?topic=32358)