Advertisement:

Author Topic: SMF Gallery  (Read 1244451 times)

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4080 on: June 09, 2021, 09:59:26 AM »
OK, thanks vbgamer45, I'll see if I can work out how to do that.

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4081 on: June 09, 2021, 10:19:04 AM »
I can't find addpicture2 via FTP, where should I be looking?

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,597
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Gallery
« Reply #4082 on: June 09, 2021, 10:26:04 AM »
In should be in the Sources/Gallery2.php file

That is a function inside that file.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4083 on: June 09, 2021, 06:02:02 PM »
In should be in the Sources/Gallery2.php file

That is a function inside that file.

Found it thanks. I've tried three or four things, but not managed to get them to work.

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,597
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Gallery
« Reply #4084 on: June 09, 2021, 06:09:47 PM »
What code did you add?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline robgratt

  • Newbie
  • *
  • Posts: 5
Re: SMF Gallery
« Reply #4085 on: June 09, 2021, 07:08:50 PM »
Hi,
Came across this and thought it might give you some ideas:

hxxp:code.tutsplus.com/tutorials/how-to-use-amazon-s3-php-to-dynamically-store-and-manage-files-with-ease--net-31 [nonactive]

Rob

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,597
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Gallery
« Reply #4086 on: June 09, 2021, 07:13:33 PM »
Nice, find code might old though from 2007 it looks like. so may not work or needs updating.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4087 on: June 09, 2021, 07:30:07 PM »
What code did you add?

I was 'winging it' and trying things as I went ( keeping back ups of the original ) and haven't kept copies of what I've tried so far. Trying to achieve thumbnail of 1000px wide and one photo per row.

Have you any suggestions for me to try?

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4088 on: June 10, 2021, 05:15:00 AM »
I've got to grips with html and css over the years, but php is still a bit of a mystery to me, so any help that you can offer would be very much appreciated.

I'm not scared of 'having a go' in php, but my lack of understanding means that I usually mess things up rather than fix anything!

Cheers
Mike

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4089 on: June 13, 2021, 09:35:11 AM »
Would the following be easier to add?
if cat=15 or cat=17 then thumbnail=full size image and display=one thumbnail per row.

If so, how should I write this and where should I insert it?

Any help very much appreciated.

Cheers
Mike

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,597
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Gallery
« Reply #4090 on: June 13, 2021, 02:32:17 PM »
For gallery Pro
Sources/Gallery2.php find
Code: [Select]
   $dbresult = $smcFunc['db_query']('', "
SELECT
p.id_picture, p.totalratings, p.rating, p.commenttotal, p.filesize, p.views,
p.thumbfilename, p.title, p.id_member, m.real_name, p.date, p.description,
p.mature, v.id_picture as unread, (p.rating / p.totalratings ) AS ratingaverage,
mg.online_color, p.totallikes
FROM {db_prefix}gallery_pic as p
LEFT JOIN {db_prefix}members AS m ON (p.id_member = m.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(m.ID_GROUP = 0, m.ID_POST_GROUP, m.ID_GROUP))
LEFT JOIN {db_prefix}gallery_log_mark_view AS v ON (p.id_picture = v.id_picture AND v.id_member = " . $context['user']['id'] . " AND v.user_id_cat = p.USER_ID_CAT)
WHERE ( p.id_cat = $cat OR FIND_IN_SET(" . $cat   . ", p.additionalcats)) AND p.approved = 1 GROUP BY p.id_picture  ORDER BY $sortby $orderby
LIMIT $context[start]," . $modSettings['gallery_set_images_per_page']);

        $context['gallery_image_listing_data'] = array();
    while($row = $smcFunc['db_fetch_assoc']($dbresult))
    {
       $context['gallery_image_listing_data'][] = $row;

        }
        $smcFunc['db_free_result']($dbresult);

    $context['page_index'] = constructPageIndex($scripturl . '?action=gallery;cat=' . $cat . ';sortby=' . $sortby2 . ';orderby=' .$orderby2, $_REQUEST['start'], GetTotalByCATID($cat,$context['gallery_cat_total']), $modSettings['gallery_set_images_per_page']);


// Image Listing
$context['sub_template']  = 'image_listing';

Change to
Code: [Select]
         if ( $cat == 15  || $cat == 17)
           {
                $modSettings['gallery_set_images_per_page'] = 1;
            }

   $dbresult = $smcFunc['db_query']('', "
SELECT
p.id_picture, p.totalratings, p.rating, p.commenttotal, p.filesize, p.views,
p.thumbfilename, p.filename, p.title, p.id_member, m.real_name, p.date, p.description,
p.mature, v.id_picture as unread, (p.rating / p.totalratings ) AS ratingaverage,
mg.online_color, p.totallikes
FROM {db_prefix}gallery_pic as p
LEFT JOIN {db_prefix}members AS m ON (p.id_member = m.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(m.ID_GROUP = 0, m.ID_POST_GROUP, m.ID_GROUP))
LEFT JOIN {db_prefix}gallery_log_mark_view AS v ON (p.id_picture = v.id_picture AND v.id_member = " . $context['user']['id'] . " AND v.user_id_cat = p.USER_ID_CAT)
WHERE ( p.id_cat = $cat OR FIND_IN_SET(" . $cat   . ", p.additionalcats)) AND p.approved = 1 GROUP BY p.id_picture  ORDER BY $sortby $orderby
LIMIT $context[start]," . $modSettings['gallery_set_images_per_page']);

        $context['gallery_image_listing_data'] = array();
    while($row = $smcFunc['db_fetch_assoc']($dbresult))
    {
       if ( $cat == 15 || $cat == 17)
           {
            $row['thumbfilename'] = $row['filename'];
           }
           
           
       $context['gallery_image_listing_data'][] = $row;

        }
        $smcFunc['db_free_result']($dbresult);

    $context['page_index'] = constructPageIndex($scripturl . '?action=gallery;cat=' . $cat . ';sortby=' . $sortby2 . ';orderby=' .$orderby2, $_REQUEST['start'], GetTotalByCATID($cat,$context['gallery_cat_total']), $modSettings['gallery_set_images_per_page']);


// Image Listing
$context['sub_template']  = 'image_listing';
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4091 on: June 13, 2021, 05:01:03 PM »
Thanks very much for your help vbgamer45  8)

That almost works, the thumbnails are now the correct size in those two categories, but the one image per row is being treated like a page instead of a row.
So I'm only getting one image and have to click on 'page2' to see the next one.

Any adjustments I can make to fix this?

Cheers
Mike

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,597
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Gallery
« Reply #4092 on: June 14, 2021, 10:12:30 AM »
One tweak then
Change
$modSettings['gallery_set_images_per_page'] = 1;
In both spots to
$modSettings['gallery_set_images_per_row'] = 1;
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4093 on: June 14, 2021, 10:46:34 AM »
Awesome .... thanks vbgamer45, you're a star!  8)

I only found one instance, but replacing that worked and it is now looking great  :)

The only other change that I'd like to make at some stage is to have both the 'Title' and the 'By' on top of the thumbnail, rather than the 'By' sitting below it.

Thank you so much for your patience and help!

Mike

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4094 on: June 15, 2021, 02:25:57 PM »
I've had a good look and I can't find/see what sets the order in Gallery Pro  :-[

I only have 'Title' and 'By member' set to display with thumbnails.
The current display order is:
(1) Title
(2) Thumbnail
(3) By member

I would like to change the order to:
(1) Title
(2) By member
(3) Thumbnail

Cheers
Mike


Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,597
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF Gallery
« Reply #4095 on: June 15, 2021, 02:34:24 PM »
There is no setting that controls the order of the items. Would require template edit in order to change the order.   check under template_image_listing function I believe.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Mike66

  • Jr. Member
  • **
  • Posts: 113
Re: SMF Gallery
« Reply #4096 on: June 16, 2021, 11:10:22 AM »
There is no setting that controls the order of the items. Would require template edit in order to change the order.   check under template_image_listing function I believe.

Thanks again for your help!
Can't see anything obvious there that controls it, but not a major problem, I'll revisit the templates every now and then and see if I can work something out.

Cheers
Mike