SMF Gallery

Started by SMFHacks.com Team, September 16, 2006, 07:13:02 PM

Previous topic - Next topic

Mike66

OK, thanks vbgamer45, I'll see if I can work out how to do that.

Mike66

I can't find addpicture2 via FTP, where should I be looking?

vbgamer45

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

Mike66

Quote from: vbgamer45 on June 09, 2021, 10:26:04 AM
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.

vbgamer45

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

robgratt

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

vbgamer45

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

Mike66

Quote from: vbgamer45 on June 09, 2021, 06:09:47 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?

Mike66

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

Mike66

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

vbgamer45

For gallery Pro
Sources/Gallery2.php find

   $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

         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

Mike66

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

vbgamer45

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

Mike66

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

Mike66

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


vbgamer45

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

Mike66

Quote from: vbgamer45 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.

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

Mike66

Just a little niggle ......

When we tick 'Create a Default User Gallery Category' in Admin, the user gallery sets the category as 'Default my galllery category', with gallery spelt wrong.

Can I correct the spelling somewhere? I can't find it.

Best wishes
Mike

vbgamer45

Hmm that must have been from an old version of the gallery.
That text is found in themes/default/langauges/gallery.english.php  and gallery.english-ut8.php
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

Mike66

Thanks for the quick reply  :)

Package manager says I'm on Gallery Pro 7.0.8

I have changed the spelling in both those places, but it doesn't seem to update users galleries. Not to worry, it's not a major issue, just a niggle.

Cheers
Mike

Advertisement: