collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 399
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: Custom Gallery Block  (Read 8513 times)

0 Members and 1 Guest are viewing this topic.

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Custom Gallery Block
« on: September 18, 2008, 06:49:09 AM »
I was wondering if there is a way to write a custom Block to pull not only a random image from the SMF Gallery, but also the description of the image under it?

Cheers :)

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: Custom Gallery Block
« Reply #1 on: September 18, 2008, 03:40:19 PM »
By the way if it's not possible, this might be more useful in the feature request section :)

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom Gallery Block
« Reply #2 on: September 18, 2008, 04:12:14 PM »
Maybe we can add the description field too, not sure how it looks.

Try creating a php block with this content:

Code: [Select]
global $modSettings, $context, $user_info, $scripturl, $sc, $ID_MEMBER, $db_prefix, $txt;

$GD_Installed = function_exists('imagecreate');

$dbresult = db_query("
SELECT p.ID_PICTURE
FROM {$db_prefix}gallery_pic as p
ORDER BY ID_PICTURE DESC
LIMIT 1", __FILE__, __LINE__);

$max = mysql_fetch_assoc($dbresult);
$check = 0;

while($check == 0) {

$idpic = rand(1, $max['ID_PICTURE']);

$dbresult = 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.memberName, m.realName, 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 AND p.ID_PICTURE = $idpic
ORDER BY ID_PICTURE DESC", __FILE__, __LINE__);
$gallery_picture = array();
while($row = mysql_fetch_assoc($dbresult))
{
$gallery_picture = array (
'id' => $row['ID_PICTURE'],
'title' => $row['title'],
'desc' => $row['description'],
'views' => $row['views'],
'senderid' => $row['ID_MEMBER'],
'sendername' => $row['realName'],
'thumbfilename' => $row['thumbfilename'],
'filename' => $row['filename']
);
}

mysql_free_result($dbresult);

if(!empty($gallery_picture) || empty($max))
$check = 1;
}

if (!empty($gallery_picture)) {
echo '<div align="center">';
echo '
<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $gallery_picture['id'] . '"><img ' . ($GD_Installed == true ?  'src="' . $modSettings['gallery_url'] . $gallery_picture['thumbfilename'] . '" ' : 'src="' . $modSettings['gallery_url'] . $gallery_picture['filename'] . '" height="78" width="120" ')  . ' border="0" /></a>
<br />' . $gallery_picture['title'] . '<span class="smalltext"><br />
' . $gallery_picture['desc'] . '<br />
<b>' . $txt['sp-grpictureviews'] . '</b> ' . $gallery_picture['views'] . '<br />';
if ($gallery_picture['sendername'] != '')
echo '<b>' . $txt['sp-grpicturesender'] . '</b> <a href="' . $scripturl . '?action=profile;u=' . $gallery_picture['senderid'] . '">'  . $gallery_picture['sendername'] . '</a><br />';
else
echo '<b>' . $txt['sp-grpicturesender'] . '</b> ' . $txt['sp-grpictureguest'] . '<br />';
echo '</span>';
echo '</div>';
}
else
echo 'There is no picture in the gallery.';
And slowly, you come to realize... It's all as it should be...

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: Custom Gallery Block
« Reply #3 on: September 18, 2008, 04:22:30 PM »
Wow, it worked a treat. With small sentences it does a great job.

It has a little trouble with long descriptions which is a shame though (links aren't formatted either which is a shame) is there anyway to force it to stretch the block vertically instead of horizontally and to format links? I feel like I'm asking for a bit too much, sorry!  :wave:

edit: Or perhaps a sort of cut off on the amount of characters shown and a small '...' link to the rest in the gallery would be better?
« Last Edit: September 18, 2008, 04:24:13 PM by Cyst »

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom Gallery Block
« Reply #4 on: September 18, 2008, 04:24:47 PM »
We can cut some part of the description if you want, just tell me the char limit. And what you mean by "format links"?

Feel free to ask whatever you want, we are here to answer them. ;)
And slowly, you come to realize... It's all as it should be...

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: Custom Gallery Block
« Reply #5 on: September 18, 2008, 04:44:43 PM »
Hmm, maybe a 60 character limit would work? From the looks of it someone with a 101 characters on their description has stretched the block, while someone with 53 characters looks fine.
Would there be a way to add a link to the rest of the cut off description in the gallery, some thing like three periods that when clicked takes you there? I imagine that would be hard considering it's random...

By formatting of links I mean if someone posts
Code: [Select]
[url=http://url]text[/url] it shows the raw code instead of the actual link.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom Gallery Block
« Reply #6 on: September 18, 2008, 04:57:49 PM »
Ah, you mean BBC...

Edit the block, and use this codes instead:

Code: [Select]
global $modSettings, $context, $user_info, $scripturl, $sc, $ID_MEMBER, $db_prefix, $txt;

$GD_Installed = function_exists('imagecreate');

$dbresult = db_query("
SELECT p.ID_PICTURE
FROM {$db_prefix}gallery_pic as p
ORDER BY ID_PICTURE DESC
LIMIT 1", __FILE__, __LINE__);

$max = mysql_fetch_assoc($dbresult);
$check = 0;

while($check == 0) {

$idpic = rand(1, $max['ID_PICTURE']);

$dbresult = 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.memberName, m.realName, 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 AND p.ID_PICTURE = $idpic
ORDER BY ID_PICTURE DESC", __FILE__, __LINE__);
$gallery_picture = array();
while($row = mysql_fetch_assoc($dbresult))
{
$gallery_picture = array (
'id' => $row['ID_PICTURE'],
'title' => $row['title'],
'desc' => $row['description'],
'views' => $row['views'],
'senderid' => $row['ID_MEMBER'],
'sendername' => $row['realName'],
'thumbfilename' => $row['thumbfilename'],
'filename' => $row['filename']
);
}

mysql_free_result($dbresult);

if(!empty($gallery_picture) || empty($max))
$check = 1;
}

if (!empty($gallery_picture)) {
echo '<div align="center">';
echo '
<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $gallery_picture['id'] . '"><img ' . ($GD_Installed == true ?  'src="' . $modSettings['gallery_url'] . $gallery_picture['thumbfilename'] . '" ' : 'src="' . $modSettings['gallery_url'] . $gallery_picture['filename'] . '" height="78" width="120" ')  . ' border="0" /></a>
<br />' . $gallery_picture['title'] . '<span class="smalltext"><br />
' . parse_bbc($gallery_picture['desc']) . '<br />
<b>' . $txt['sp-grpictureviews'] . '</b> ' . $gallery_picture['views'] . '<br />';
if ($gallery_picture['sendername'] != '')
echo '<b>' . $txt['sp-grpicturesender'] . '</b> <a href="' . $scripturl . '?action=profile;u=' . $gallery_picture['senderid'] . '">'  . $gallery_picture['sendername'] . '</a><br />';
else
echo '<b>' . $txt['sp-grpicturesender'] . '</b> ' . $txt['sp-grpictureguest'] . '<br />';
echo '</span>';
echo '</div>';
}
else
echo 'There is no picture in the gallery.';

It will make those raws codes normal. But with this, limiting the chars could result with descriptions like this:

Quote
This is a description. <a href="http://gotosomewhere.net">Tes...

Normally it should be

Quote
This is a description. Testing
Word "Testing" is link to http://gotosomewhere.net.

If you want, we can remove those raw codes, but they won't be shown as link; just as a plain text without raw codes.
« Last Edit: September 18, 2008, 04:59:29 PM by [SiNaN] »
And slowly, you come to realize... It's all as it should be...

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: Custom Gallery Block
« Reply #7 on: September 18, 2008, 05:04:21 PM »
If you want, we can remove those raw codes, but they won't be shown as link; just as a plain text without raw codes.

This seems like a better idea, yes :) That way the tables won't get broken and there will be no BBC codes showing up either.

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom Gallery Block
« Reply #8 on: September 18, 2008, 05:12:19 PM »
This will remove BBCodes and just show 150 chars:

Code: [Select]
global $modSettings, $context, $user_info, $scripturl, $sc, $ID_MEMBER, $db_prefix, $txt, $func;

$GD_Installed = function_exists('imagecreate');

$dbresult = db_query("
SELECT p.ID_PICTURE
FROM {$db_prefix}gallery_pic as p
ORDER BY ID_PICTURE DESC
LIMIT 1", __FILE__, __LINE__);

$max = mysql_fetch_assoc($dbresult);
$check = 0;

while($check == 0) {

$idpic = rand(1, $max['ID_PICTURE']);

$dbresult = 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.memberName, m.realName, 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 AND p.ID_PICTURE = $idpic
ORDER BY ID_PICTURE DESC", __FILE__, __LINE__);
$gallery_picture = array();
while($row = mysql_fetch_assoc($dbresult))
{

$row['description'] = strip_tags(strtr(parse_bbc($row['description'], 1), array('<br />' => '')));
if ($func['strlen']($row['description']) > 128)
$row['description'] = $func['substr']($row['description'], 0, 150) . '...';

$gallery_picture = array (
'id' => $row['ID_PICTURE'],
'title' => $row['title'],
'desc' => $row['description'],
'views' => $row['views'],
'senderid' => $row['ID_MEMBER'],
'sendername' => $row['realName'],
'thumbfilename' => $row['thumbfilename'],
'filename' => $row['filename']
);
}

mysql_free_result($dbresult);

if(!empty($gallery_picture) || empty($max))
$check = 1;
}

if (!empty($gallery_picture)) {
echo '<div align="center">';
echo '
<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $gallery_picture['id'] . '"><img ' . ($GD_Installed == true ?  'src="' . $modSettings['gallery_url'] . $gallery_picture['thumbfilename'] . '" ' : 'src="' . $modSettings['gallery_url'] . $gallery_picture['filename'] . '" height="78" width="120" ')  . ' border="0" /></a>
<br />' . $gallery_picture['title'] . '<span class="smalltext"><br />
' . $gallery_picture['desc'] . '<br />
<b>' . $txt['sp-grpictureviews'] . '</b> ' . $gallery_picture['views'] . '<br />';
if ($gallery_picture['sendername'] != '')
echo '<b>' . $txt['sp-grpicturesender'] . '</b> <a href="' . $scripturl . '?action=profile;u=' . $gallery_picture['senderid'] . '">'  . $gallery_picture['sendername'] . '</a><br />';
else
echo '<b>' . $txt['sp-grpicturesender'] . '</b> ' . $txt['sp-grpictureguest'] . '<br />';
echo '</span>';
echo '</div>';
}
else
echo 'There is no picture in the gallery.';

If you want more or less, just change the number 150 in the codes.
And slowly, you come to realize... It's all as it should be...

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: Custom Gallery Block
« Reply #9 on: September 18, 2008, 05:17:16 PM »
Thanks Sinan, that's perfect :) Was making the "..." after the character limit cut off link to the rest of the description possible too? If not I'm very happy anyway!

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom Gallery Block
« Reply #10 on: September 18, 2008, 05:24:09 PM »
Try this:

Code: [Select]
global $modSettings, $context, $user_info, $scripturl, $sc, $ID_MEMBER, $db_prefix, $txt, $func;

$GD_Installed = function_exists('imagecreate');

$dbresult = db_query("
SELECT p.ID_PICTURE
FROM {$db_prefix}gallery_pic as p
ORDER BY ID_PICTURE DESC
LIMIT 1", __FILE__, __LINE__);

$max = mysql_fetch_assoc($dbresult);
$check = 0;

while($check == 0) {

$idpic = rand(1, $max['ID_PICTURE']);

$dbresult = 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.memberName, m.realName, 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 AND p.ID_PICTURE = $idpic
ORDER BY ID_PICTURE DESC", __FILE__, __LINE__);
$gallery_picture = array();
while($row = mysql_fetch_assoc($dbresult))
{

$row['description'] = strip_tags(strtr(parse_bbc($row['description'], 1), array('<br />' => '')));
if ($func['strlen']($row['description']) > 128)
$row['description'] = $func['substr']($row['description'], 0, 150) . '<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '">...</a>';

$gallery_picture = array (
'id' => $row['ID_PICTURE'],
'title' => $row['title'],
'desc' => $row['description'],
'views' => $row['views'],
'senderid' => $row['ID_MEMBER'],
'sendername' => $row['realName'],
'thumbfilename' => $row['thumbfilename'],
'filename' => $row['filename']
);
}

mysql_free_result($dbresult);

if(!empty($gallery_picture) || empty($max))
$check = 1;
}

if (!empty($gallery_picture)) {
echo '<div align="center">';
echo '
<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $gallery_picture['id'] . '"><img ' . ($GD_Installed == true ?  'src="' . $modSettings['gallery_url'] . $gallery_picture['thumbfilename'] . '" ' : 'src="' . $modSettings['gallery_url'] . $gallery_picture['filename'] . '" height="78" width="120" ')  . ' border="0" /></a>
<br />' . $gallery_picture['title'] . '<span class="smalltext"><br />
' . $gallery_picture['desc'] . '<br />
<b>' . $txt['sp-grpictureviews'] . '</b> ' . $gallery_picture['views'] . '<br />';
if ($gallery_picture['sendername'] != '')
echo '<b>' . $txt['sp-grpicturesender'] . '</b> <a href="' . $scripturl . '?action=profile;u=' . $gallery_picture['senderid'] . '">'  . $gallery_picture['sendername'] . '</a><br />';
else
echo '<b>' . $txt['sp-grpicturesender'] . '</b> ' . $txt['sp-grpictureguest'] . '<br />';
echo '</span>';
echo '</div>';
}
else
echo 'There is no picture in the gallery.';

Hope I got what you mean. :)
And slowly, you come to realize... It's all as it should be...

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: Custom Gallery Block
« Reply #11 on: September 18, 2008, 05:28:59 PM »
Exactly what I was after, thanks Sinan. It looks great in action  8)

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom Gallery Block
« Reply #12 on: September 18, 2008, 05:29:51 PM »
You're welcome. ;)
And slowly, you come to realize... It's all as it should be...

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: Custom Gallery Block
« Reply #13 on: September 18, 2008, 05:47:47 PM »
This is weird, it was working perfectly a second ago and now it's allowing descriptions bigger than 60 characters to show again, I did change the 150 to 60, did I break anything?  :D

Code: [Select]
global $modSettings, $context, $user_info, $scripturl, $sc, $ID_MEMBER, $db_prefix, $txt, $func;

$GD_Installed = function_exists('imagecreate');

$dbresult = db_query("
SELECT p.ID_PICTURE
FROM {$db_prefix}gallery_pic as p
ORDER BY ID_PICTURE DESC
LIMIT 1", __FILE__, __LINE__);

$max = mysql_fetch_assoc($dbresult);
$check = 0;

while($check == 0) {

$idpic = rand(1, $max['ID_PICTURE']);

$dbresult = 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.memberName, m.realName, 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 AND p.ID_PICTURE = $idpic
ORDER BY ID_PICTURE DESC", __FILE__, __LINE__);
$gallery_picture = array();
while($row = mysql_fetch_assoc($dbresult))
{

$row['description'] = strip_tags(strtr(parse_bbc($row['description'], 1), array('<br />' => '')));
if ($func['strlen']($row['description']) > 128)
$row['description'] = $func['substr']($row['description'], 0, 60) . '<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '">...</a>';

$gallery_picture = array (
'id' => $row['ID_PICTURE'],
'title' => $row['title'],
'desc' => $row['description'],
'views' => $row['views'],
'senderid' => $row['ID_MEMBER'],
'sendername' => $row['realName'],
'thumbfilename' => $row['thumbfilename'],
'filename' => $row['filename']
);
}

mysql_free_result($dbresult);

if(!empty($gallery_picture) || empty($max))
$check = 1;
}

if (!empty($gallery_picture)) {
echo '<div align="center">';
echo '
<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $gallery_picture['id'] . '"><img ' . ($GD_Installed == true ?  'src="' . $modSettings['gallery_url'] . $gallery_picture['thumbfilename'] . '" ' : 'src="' . $modSettings['gallery_url'] . $gallery_picture['filename'] . '" height="78" width="120" ')  . ' border="0" /></a>
<br />' . $gallery_picture['title'] . '<span class="smalltext"><br />
' . $gallery_picture['desc'] . '<br />
<b>' . $txt['sp-grpictureviews'] . '</b> ' . $gallery_picture['views'] . '<br />';
if ($gallery_picture['sendername'] != '')
echo '<b>' . $txt['sp-grpicturesender'] . '</b> <a href="' . $scripturl . '?action=profile;u=' . $gallery_picture['senderid'] . '">'  . $gallery_picture['sendername'] . '</a><br />';
else
echo '<b>' . $txt['sp-grpicturesender'] . '</b> ' . $txt['sp-grpictureguest'] . '<br />';
echo '</span>';
echo '</div>';
}
else
echo 'There is no picture in the gallery.';

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom Gallery Block
« Reply #14 on: September 18, 2008, 05:57:17 PM »
Sorry, missed a point. Change 128 in the codes as 60.
And slowly, you come to realize... It's all as it should be...

Offline Cyst

  • Semi Newbie
  • *
  • Posts: 31
Re: Custom Gallery Block
« Reply #15 on: September 18, 2008, 06:06:36 PM »
Perfect! Thanks again, sorry I took up so much time there  :-[

Offline edi67

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC1
  • SP Version: 2.3
Re: Custom Gallery Block
« Reply #16 on: November 12, 2008, 04:47:40 PM »
great work sinan is possible have code for smf 2?

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom Gallery Block
« Reply #17 on: November 13, 2008, 01:36:27 AM »
Very soon...
And slowly, you come to realize... It's all as it should be...

Offline dabeer

  • Semi Newbie
  • *
  • Posts: 11
Re: Custom Gallery Block
« Reply #18 on: February 21, 2009, 02:01:27 PM »
I'm using this code (really cool, thank you!) and I just thought of the following additions to this block:
- the number of comments for the displayed picture
- total number of pictures in the gallery

Something like:

--

[THUMBNAIL]

Title
Description

Views: 120
Author: sAmpLe
Comments: 3

Total pictures in Gallery: 44

--

Is there an easy way of implementing these changes?