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: 227
  • 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: Gallery Block?  (Read 8364 times)

0 Members and 1 Guest are viewing this topic.

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Gallery Block?
« on: October 25, 2008, 10:04:43 PM »
I am running SMF 2.0 Beta 4. I have SMFGallery installed, and SimplePortal Version Classic 2.0.5 yet there is no block for the Gallery, like on my 1.1.6 forums.

Does anyone have a working random image block that I could get the code for?

Offline ibm450

  • Semi Newbie
  • *
  • Posts: 49
  • Gender: Male
    • yarrie health & safety
Re: Gallery Block?
« Reply #1 on: October 25, 2008, 10:50:21 PM »
this works on my setup - smf 116, gallery lite 193 http://yarriesafety.mine.nu

create php block in sp and paste, not sure if it will work with media gallery though, try see what happens  :P

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="gallery/' . $modSettings['gallery_url'] . $gallery_picture['filename'] . '" ' : 'src="' . $modSettings['gallery_url'] . $gallery_picture['filename'] . '" height="90" width="90" ')  . ' border="3" /></a>
<br />' . $gallery_picture['title'] . '<span class="smalltext"><br />
' . $gallery_picture['desc'] . '<br />
<b>' . $txt['sp-grpictureviews'] . '</b> ' . $gallery_picture['views'] . '<br />';

echo '<li><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></li>';

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>';
         

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Gallery Block?
« Reply #2 on: October 25, 2008, 11:04:55 PM »
SMF Gallery is a default block on SP, no?

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Re: Gallery Block?
« Reply #3 on: October 26, 2008, 01:23:53 AM »
Not on the latest, combined with SMF 2.0 Beta 4.
That's what shocked me....LOL

Offline ???1031

  • ... feel not as a dev at the moment ...
  • Comrade
  • *
  • Posts: 789
  • Gender: Male
  • Overworked <<
  • SMF Version: None
  • SP Version: None
Re: Gallery Block?
« Reply #4 on: October 28, 2008, 02:15:10 AM »
At the moment we released the SMF 2.0 Beta Version of SPortal there was no compatible Version for the SMF Shop, SMF Arcarde and SMF Gallery. So we did no implemented these in the Version. But we will insert it again, if the mods are working in the same way as before. ;)

Bye
DIN1031
Again... I'm having time problems...Normal Monday to Friday I'm at office from 6:00-16:00 (On my local time ;P).

Offline Burke Knight

  • Sr. Member
  • ****
  • Posts: 394
  • Gender: Male
  • I tell it how I see it. Don't like it? Hit Alt+F4
    • BurkeKnight Enterprises
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
Re: Gallery Block?
« Reply #5 on: October 28, 2008, 08:53:40 AM »
Well, as soon as new block for Gallery is made, I'll be all set on that one site. :)

Offline Simone

  • Semi Newbie
  • *
  • Posts: 14
  • Gender: Female
    • Robertson426
Re: Gallery Block?
« Reply #6 on: November 19, 2008, 05:52:13 AM »
Above code doesn't seem to work with SMF Media Gallery 1.5 RC 2
But would love it to. If someone can figure it out would be greatly appreciated  :)

Can look HERE . Just scroll down to bottom.

Offline ???1031

  • ... feel not as a dev at the moment ...
  • Comrade
  • *
  • Posts: 789
  • Gender: Male
  • Overworked <<
  • SMF Version: None
  • SP Version: None
Re: Gallery Block?
« Reply #7 on: November 19, 2008, 10:15:19 AM »
In the new Version there will be a block for the media gallery and the gallery lite :).
Again... I'm having time problems...Normal Monday to Friday I'm at office from 6:00-16:00 (On my local time ;P).

Offline swtdivalove

  • Jr. Member
  • **
  • Posts: 50
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: Gallery Block?
« Reply #8 on: November 23, 2008, 10:59:37 AM »
Kind of bummed out about this not working for 2.0.4.  It's one of those things that I kept looking for but couldn't find.  So, I popped over here to see what's up and it's not available on 2.0.4.  :'(

I'd really like to see this as I use it as an attraction on my sites.

Any kind of time frame when it will be added?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Gallery Block?
« Reply #9 on: November 23, 2008, 06:06:34 PM »
In the next version of SimplePortal.

The release should be soon.

The dev team has not set a specific timeframe/date, and won't be giving a date. This takes pressure off the dev team, meaning that we have the time to properly test and fix all of the bugs that are fixed and the features that are added, before the SimplePortal version is made public.

SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline iain sherriff

  • Semi Newbie
  • *
  • Posts: 40
    • Global Support
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Gallery Block?
« Reply #10 on: December 10, 2008, 04:57:16 AM »
Above code doesn't seem to work with SMF Media Gallery 1.5 RC 2
But would love it to. If someone can figure it out would be greatly appreciated  :)

Can look HERE . Just scroll down to bottom.

I have SMG 1.5 working in a center block with this code
Code: [Select]
global $sourcedir, $context, $txt, $galurl, $scripturl, $settings;

require_once($sourcedir . '/Subs-MGallery.php');
loadMGal_Settings();

if (loadlanguage('MGallery') == false)
  loadLanguage('MGallery', 'english');

$items = getMediaItems(0, 4, 'rand()');

echo '
<center><table border="0">
  <tr>';

foreach ($items as $item)
  echo '
    <td>
      <div class="smalltext" style="text-align: center; line-height: 1.4em; border: 1px #000000 solid; padding: 5px;">
      <a href="',$galurl,'sa=item;id=',$item['id'],'">',$item['title'],'</a><br />
      <a href="',$galurl,'sa=item;id=',$item['id'],'"><img alt="" src="',$galurl,'sa=media;id=',$item['id'],';thumb" alt="" /></a><br />
      ',$txt['mgallery_views'],': ',$item['views'],'<br />
      ',$txt['mgallery_posted_by'],': <a href="',$scripturl,'?action=profile;u=',$item['poster_id'],'">',$item['poster_name'],'</a><br />
      ',$txt['mgallery_in_album'],': <a href="',$galurl,'sa=album;id=',$item['id_album'],'">',$item['album_name'],'</a>
      ',$item['is_new'] ? '<br /><img alt="" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" border="0" />' : '','
      </div>
    </td>';
echo '
  </tr>
</table></center>';
/code]


SMF 1.1.7
SMG 1.5
SP 2.1.1

uklows.com

Offline ibm450

  • Semi Newbie
  • *
  • Posts: 49
  • Gender: Male
    • yarrie health & safety
Re: Gallery Block?
« Reply #11 on: December 10, 2008, 05:44:25 PM »
no probs with media gallery 1.5 here also, changed thumb sizes to 500 x 500 so the random pic display isnt so tiny on home page


yarriesafety.mine.nu


Offline slinouille

  • Newbie
  • Posts: 3
    • VAG-Technique
Re: Gallery Block?
« Reply #12 on: December 14, 2008, 02:45:16 AM »
Hello all !

My first post here  :holding-flower:

Does anyone has managed to adapt this last code to SMF2b4 ?

I've tried but didn't get it work  :'(

Thx

SliN

Offline iain sherriff

  • Semi Newbie
  • *
  • Posts: 40
    • Global Support
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Gallery Block?
« Reply #13 on: December 14, 2008, 09:49:59 AM »
i've just done a test board with
SMF 2.0b4
SMG 1.5
SP 2.1.1

the code works just the same as with 1.1.7 ?

Offline slinouille

  • Newbie
  • Posts: 3
    • VAG-Technique
Re: Gallery Block?
« Reply #14 on: December 14, 2008, 11:14:31 AM »
Strange ... in the same configuration I've got an empty block

Don't understand why because the code proposed should work  :-X

I've used a PHP block, it's correct ?

----------------
EDIT :

Yep it works ... I've deleted the old one and created a new

Thanks
« Last Edit: December 14, 2008, 12:32:44 PM by slinouille »