News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF Gallery

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

Previous topic - Next topic

Angelotus

VBGAMER: I have made this SSI function to fetch the latest items in the gallery. It works for me, although I have no clue if the code is clean, however it works.
Maybe U can use it for a next release?


function ssi_galitems($limit = null, $output_method = 'echo')
{
global $scripturl, $smcFunc, $txt, $context, $modSettings, $id_member;
       
// Check if GD is installed if not we will not show the thumbnails
$GD_Installed = function_exists('imagecreate');
         
        if ($limit === null)
                  $limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 20;
                  else
                  $limit = (int) $limit;
                 




$context['start'] = (int) $_REQUEST['start'];

$dbresult = $smcFunc['db_query']('', "
SELECT COUNT(*) AS total
FROM {db_prefix}gallery_pic as p
WHERE p.approved = 1");
$row = $smcFunc['db_fetch_assoc']($dbresult);
$totalPics = $row['total'];
                  $smcFunc['db_free_result']($dbresult);



// Show the pictures
$dbresult = $smcFunc['db_query']('', "
SELECT p.id_picture, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.filename, p.height, p.width,
p.title, p.id_member, m.member_name, m.real_name, p.date, p.description
FROM {db_prefix}gallery_pic as p
LEFT JOIN {db_prefix}members AS m on ( p.id_member = m.id_member)
WHERE p.approved = 1 ORDER BY id_picture DESC LIMIT $context[start]," . $limit);
$rowlevel = 0;

                 



while($row = $smcFunc['db_fetch_assoc']($dbresult))
{
if ($rowlevel == 0)

echo '<div class="panel">
<a href="' . $scripturl . '?action=gallery;sa=view;pic=' . $row['id_picture'] . '">
<img ' . ($GD_Installed == true ?  'src="http://www.weeklyfun.nl/forum/gallery/' . $row['thumbfilename'] . '" ' : 'src="' . $modSettings['gallery_url'] . $row['filename'] . '"')  . ' alt="Bekijk dit plaatje in het groot!" /></a></div>';


if($rowlevel < ($maxrowlevel-1))
$rowlevel++;
else
{
echo '';
$rowlevel = 0;
}



}


if ($rowlevel !=0)
{
echo '';
}




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

gemigene

Nice Mod, congrats.

One question though, would a pagination function be easy to implement? I can't imagine hundreds of thumbnails on one very long page.

Cheers,
Gene
"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

vbgamer45

I believe I added it to the SMF 2.x version of the modification
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

gemigene

Quote from: vbgamer45 on February 16, 2009, 08:02:42 PM
I believe I added it to the SMF 2.x version of the modification

I have Gallery 2.0.5 running on SMF 1.1.8, will it do pagination on it's own or is that for SMF 2* only?

Thanks,
Gene
"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

DarkAngel612

is there any way to do pagination in the 1.8.3 version? We would love to not have a boat load of images on one page only
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

vbgamer45

It is only for the SMF 2.0 version at this time.
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

gemigene

Quote from: vbgamer45 on February 16, 2009, 08:32:42 PM
It is only for the SMF 2.0 version at this time.

Are you planning on implementing it? I'm sure a lot of users don't plan on upgrading to ver. 2 for a while yet.

Thanks,
Gene
"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

time31415

When I installed this it didn't work so I tried to uninstall it. It didn't uninstall properly so left the Gallery link in the nav bar broken, and it left many different things in the Admins section still there.

What file didn't get deleted?

DarkAngel612

true many of us are not planning to upgrade higher for quite awhile and yet would like to have pages and not just one long page to scroll thru. I had the paid version of this one but have since left the site that we had it for and was told that although we paid for it we are not allowed to use it for any other location..not right since it is paid for but since then we went to the free one.

I also have it implemented in other forums I have set up--the lite version--and they would like to have pages too.

Having to have it for only one certain website is what is deterring us from purchasing again to be honest...otherwise the gallery is great
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

time31415

What files didn't uninstall?
What files do I need to delete?

It also shows up the SMF gallery in the permissions section.


4b11l

Hello,

I am currently using Gallery 1.1.8.1.2, can I update to this or will I have to uninstall and reinstall the newer version.
Will there be any problems of losing images or categories if that's the case?

vbgamer45

Quote from: 4b11l on February 26, 2009, 03:40:09 AM
Hello,

I am currently using Gallery 1.1.8.1.2, can I update to this or will I have to uninstall and reinstall the newer version.
Will there be any problems of losing images or categories if that's the case?
You can upgrade or uninstall and resinstall. Uninstalling does not delete pictures or data
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

4b11l

Quote from: vbgamer45 on February 26, 2009, 09:13:25 PM
Quote from: 4b11l on February 26, 2009, 03:40:09 AM
Hello,

I am currently using Gallery 1.1.8.1.2, can I update to this or will I have to uninstall and reinstall the newer version.
Will there be any problems of losing images or categories if that's the case?
You can upgrade or uninstall and resinstall. Uninstalling does not delete pictures or data

So I can just upload this package and install normally? Or is there a seperate upgrade package.

vbgamer45

Yes. I would suggest to uninstall and reinstall though.
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

4b11l

Ok.

I just tried it and this was what I got.

QuoteThis package is already installed, and no upgrade was found!

You should uninstall the old version first to avoid problems, or ask the author to create an upgrade from your old version.

Please remember to always make regular backups of your sources and database before installing mods, especially beta versions.

I will uninstall and reinstall. I will let you know if I should encounter any problems.

vbgamer45

You should be good. If it fails on like modifications.english.php when uninstalling that is ok and is normal.
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

wickedstangs

vb just installed it on 2.0RC1 and missing the link again.
http://modularfoxmustangs.com

vbgamer45

Missing the link to the gallery?

It looks like it added to the template. Check the text gallery text from modifications.english.php is in your themes languages modifications.english.php 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

videoman57

are you planning any comment email notification for the gallery 2.0.5?

vbgamer45

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

Advertisement: