SMFHacks.com

SMF Gallery Pro => Support => Topic started by: VisiGod on July 17, 2022, 06:09:02 am

Title: Some questions
Post by: VisiGod on July 17, 2022, 06:09:02 am
Hello all,

I'm new to the SMF Gallery pro and I'm importing from my Coppermine 1.5 but I have some questions:

- How can I generate the thumbs and medium images after the import (I've imported using sql queries);
- Is it possible to have each gallery and subgallery on it's own folder?;
- How can I change the layout of the Gallery main page (number of galleries per row) and on the subgalleries?

Thanks for any help in advance
Title: Re: Some questions
Post by: SMFHacks on July 17, 2022, 11:55:30 am
I have a coppermine convertor in https://www.smfhacks.com/index.php/topic,2839.0.html
But, if you did already and have moved the gallery files to the gallery folder. And have the database just the filename for each table in smf_gallery_pic

First make sure you have "Generate medium size images" enabled under gallery configuration settings
You can then use the regenerate thumbnails option for each main category page.


Quote
- Is it possible to have each gallery and subgallery on it's own folder?;
If you are talking about file storage the closest option we have is
"Enable multiple folders for picture storage" if enabled when uploads occurs it creates a new folder for every 1000 uploads.


In Gallery Pro  there are two types of galleries main page categories which are gallery admin created where users can upload to if they have the right permissions

The second type is user galleries where each user has their own mini gallery that they can create categories and upload to. This is found under the Memberies gallery link on the homepage of the gallery. Or if the user clicks the MyGallery button.

We have a setting that controls the number of images per page when inside a gallery category.




Title: Re: Some questions
Post by: VisiGod on July 18, 2022, 05:33:44 pm
I've tried the coppermine converter but it seems it's for the 1.4 version and it times out using on the 1.5 version (have around 13k photos). I can share the sql I did for categories, subcategories (called albums in coppermine) and photos (didn't import the comments since I really don't use them).

I'll use a common gallery where the users can upload pictures and the the admins move them to the correct folder (after being approved).

Regarding the pages (and sorry if this is something more SMF related), can I change the layout (even if it is on the code) since the main page has around 54 categories (alphabet letters, # signal and user uploads) and inside each category I have all my subdivisions?
Title: Re: Some questions
Post by: SMFHacks on July 19, 2022, 04:49:26 pm
Good to know.
I am going to build out a feature to regenerate all thumbnails/medium for all categories.
Going to add the option to the regenerate thumbnails page.


Yes, you can change the layout just when updating make sure backup copies of files you edit. Then compare using software such as beyond compare.
Do you want to add paginating to the main page for categories?
Title: Re: Some questions
Post by: mickjav on July 19, 2022, 06:33:46 pm
I use pagging on mine

https://www.databasedreams.co.uk/charts/gallery/?cat=35


The code is here


https://www.databasedreams.co.uk/support/index.php?action=showcases;sa=view;id=56

This is a replacement for the function there is also another version but have stopped using that as needs some css which I'm no good at.
Title: Re: Some questions
Post by: VisiGod on July 20, 2022, 01:42:17 pm
Thanks SMFHacks and mickjav.

I will only use pagination for the subcategories since the main category will have all the 54 subcategories in one page (that's why I wanted to change the main category page to accommodate all the subcategories).

I'll do some experiments this weekend and then will let you know how it went  ;D
Title: Re: Some questions
Post by: SMFHacks on July 20, 2022, 02:01:32 pm
The main file is Gallery2.template.php in themes/default folder for SMF 2.0 or Gallery2.1.template.php in themes/default for SMF 2.1

In both the main function to check at the top is the template_mainview()  which controls the display of the main page.
Title: Re: Some questions
Post by: VisiGod on July 29, 2022, 05:32:53 pm
I've been having some fun customizing the main layout to my needs and made a simple function to display the number of subcats that can be of use to someone (or added to the core if you want):

Code: [Select]
function GetTotalSubCats($id_cat) {
    global $modSettings, $smcFunc, $subcats_linktree, $scripturl, $gallerySettings;

    $total = 0;

    $dbresult3 = $smcFunc['db_query']('', "
 SELECT count(ID_CAT) as total
 FROM {db_prefix}gallery_cat
 WHERE ID_PARENT = ".$id_cat);

    return $smcFunc['db_fetch_assoc']($dbresult3)['total'];
}

in the template, just add
Code: [Select]
echo '<td align="center" valign="middle" class="windowbg">'.GetTotalSubCats($row['id_cat']).'</td>'; to get the number of subcats to the main cat
Title: Re: Some questions
Post by: SMFHacks on July 29, 2022, 05:34:34 pm
Great tip!
Title: Re: Some questions
Post by: VisiGod on July 29, 2022, 05:37:02 pm
Forgot that in the table header, I've added the following:

Code: [Select]
    if(!isset($_GET[cat])) {
        echo '<th scope="col" class="smalltext" align="center">Total Bands</th>';
}

So it will only appear on the main gallery index
Title: Re: Some questions
Post by: mickjav on July 30, 2022, 03:20:26 am
That's Interesting may implement it with my other mods.

If you interested I have built 2 php Block that relate to the Galleries One for the lastest gallerys, Ill have to check but think if would be a copy past into a php block, It's for the latest galleries "sub Galleries" To a gallery say Artists/Bands

The other would require a mod to the Cats table and the add/edit system it shows latest videos added.

Let me know and I'll post both blocks on my support site.

All the best mick
Title: Re: Some questions
Post by: mickjav on July 30, 2022, 03:31:07 am
Forgot You can see them here

https://www.databasedreams.co.uk/charts/index.php