SMFHacks.com

SMF Gallery Pro => Support => Topic started by: Tonyvic on August 28, 2015, 01:55:41 pm

Title: Restrict Member Galleries viewing to only one membergroup
Post by: Tonyvic on August 28, 2015, 01:55:41 pm
Hi,
Is it possible to restrict access to member's galleries so that only one membergroup can see them, but still allow all other membergroups to see all other galleries?

Also, how do I turn off emails sent with regards to pics/comments etc. awaiting approval. I have installed the GalleryInfoHeader mod so emails aren't required.
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: SMFHacks on August 28, 2015, 04:57:56 pm
Quote
Is it possible to restrict access to member's galleries so that only one membergroup can see them, but still allow all other membergroups to see all other galleries?
Not currently. Would require a lot of different checks if you wanted to hide the pictures from appearing everywhere.

Quote
Also, how do I turn off emails sent with regards to pics/comments etc. awaiting approval. I have installed the GalleryInfoHeader mod so emails aren't required.
Would require editing the code. Sources/Gallery2.php

Find
Code: [Select]
// Send all the administrators a lovely email.
function Gallery_emailAdmins($subject, $body, $additional_recipients = array())
{
Add after
Code: [Select]
return;
That will stop them from being sent to gallery admins
[/quote]
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: Tonyvic on August 29, 2015, 05:46:06 am
Many thanks for your swift reply, and of course for an excellent product.
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: Tonyvic on August 31, 2015, 02:55:11 pm
Hi Hacks,

Is there an easy way to move all member galleries (200 galleries containing over 3000 pics) into a general gallery?
I have been looking and searching for a couple of days but can't see anything obvious.


Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: SMFHacks on August 31, 2015, 02:59:59 pm
Into a single category maybe but it would need to be an sql statement.
Otherwise there is an option when you edit a picture to move them one by one.
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: Tonyvic on August 31, 2015, 04:40:30 pm
All 3000+ pictures into one category would be great, is it possible to give me a guide for the sql statement as I have no idea. Thanks.
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: SMFHacks on August 31, 2015, 04:45:49 pm
Make a backup of your database first.

The following SQL will move ALL your user galleries images to a single category
Code: [Select]
UPDATE smf_gallery_pic SET USER_ID_CAT = 0, ID_CATEGORY = ###REPLACEWITHCATID###  WHERE ID_CAT = 0 AND USER_ID_CAT != 0

Just change ###REPLACEWITHCATID###  to the category ID number in the gallery category that you are changing it to.
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: Tonyvic on September 01, 2015, 01:59:50 pm
Many thanks, that helped a lot. Just one thing in case someone else needs this, I received an error with the SQL in your code
Code: [Select]
UPDATE smf_gallery_pic SET USER_ID_CAT = 0, ID_CATEGORY = ###REPLACEWITHCATID###  WHERE ID_CAT = 0 AND USER_ID_CAT != 0
( #1054 - Unknown column 'ID_CATEGORY' in 'field list') and changed it to
Code: [Select]
UPDATE smf_gallery_pic SET USER_ID_CAT = 0, ID_CAT = ###REPLACEWITHCATID###  WHERE ID_CAT = 0 AND USER_ID_CAT != 0

All Images appear to have been moved ok but the 'Target' category is showing 'Total Images 0', if I open the target there is only one page of images (Up to 60 if thats what I choose. However if I select 'Random Items (List All)' in fact any section from the index page I see all 59 pages of the images.

Have you got another trick up your sleeve to correct these issues.

TIA, I feel sure it is now close to perfect for us.

Tony

Edited to add: Member Galleries still shows 'Total Images 3477' but when opened it is empty.
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: SMFHacks on September 01, 2015, 02:12:06 pm
Oops yeah meant ID_CAT

There should be a button in the settings area to recount all picture totals I believe.
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: Tonyvic on September 01, 2015, 04:35:22 pm
There should be a button in the settings area to recount all picture totals I believe.
I have been all through settings twice, can't see a 'recount all picture totals' anywhere.
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: SMFHacks on September 01, 2015, 04:53:12 pm
Download SMFGalleryPro and rerun the galleryinstall2.0.x.php script by copying to the main directory of your forum and run it in your browser
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: Tonyvic on September 01, 2015, 05:28:21 pm
Brilliant, thanks a lot Hacks that did the trick.

Tony
Title: Re: Restrict Member Galleries viewing to only one membergroup
Post by: SMFHacks on September 01, 2015, 05:35:04 pm
Glad to help.