TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 291
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 192
  • Total: 192

SMF Gallery Block

Started by HaxXxoR, September 19, 2006, 06:50:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JDMhustle

well i used the SSI Mod for SMF Gallery

Includes the following functions
ssi_gallerylatestpicture($output_method = 'echo');
ssi_gallerystats($output_method = 'echo');
ssi_galleryrandom();

Then put it in a php block and presto ;)
Do you have the lite or Pro version?

Jpg

Here comes JPG to save the day!
echo'
<table cellspacing="0" cellpadding="2" border="0px black solid" align="center" width="90%"><tr>';
  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }
  $request = db_query("SELECT thumbfilename,ID_PICTURE FROM {$db_prefix}gallery_pic GROUP BY thumbfilename ORDER BY date DESC LIMIT 5", __FILE__,__LINE__);
  while ($row = mysql_fetch_assoc($request))
  echo' <center><td align="center" colspan="3"><a href="', $scripturl, '?action=gallery;sa=view;id=',
  $row['ID_PICTURE'], '"><img src="',  $modSettings['gallery_url'] .

  $row['thumbfilename'] ,'" /></a></center>';
  echo'</td></tr>';
  echo'</table></br>';
  mysql_free_result($request);

I use it at mine. Http://inflamehq.com
User:Demo
Pass:Demo

Might want to check out my topic for modding your whole template for the gallery at SMF hacks.
http://www.smfhacks.com/index.php/topic,188.msg1231/topicseen.html#new


exerciseforum

I have the lite version...
I must be missing something

anybody got a step by step lol i need it ...

Jpg

I too have the Lite Version.
You need to add
echo'
<table cellspacing="0" cellpadding="2" border="0px black solid" align="center" width="90%"><tr>';
  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }
  $request = db_query("SELECT thumbfilename,ID_PICTURE FROM {$db_prefix}gallery_pic GROUP BY thumbfilename ORDER BY date DESC LIMIT 5", __FILE__,__LINE__);
  while ($row = mysql_fetch_assoc($request))
  echo' <center><td align="center" colspan="3"><a href="', $scripturl, '?action=gallery;sa=view;id=',
  $row['ID_PICTURE'], '"><img src="',  $modSettings['gallery_url'] .

  $row['thumbfilename'] ,'" /></a></center>';
  echo'</td></tr>';
  echo'</table></br>';
  mysql_free_result($request);


In a php block.
If you want less than 5 images appearing change the Limit Number
LIMIT 5
to something less than 5 or more than 5. :D

exerciseforum

well i get this error when i do that

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

:-\

Jpg

It's not the code then it's your forum.

exerciseforum

oh poo :( thanks for ur help anyways

Jpg

Wait...lol...hahahaha..I forgot something in my code....

global $scripturl,$db_prefix,$modSettings,$boardurl;
  echo'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%"><tr>';
  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }
  $request = db_query("SELECT thumbfilename,ID_PICTURE FROM {$db_prefix}gallery_pic GROUP BY thumbfilename ORDER BY date DESC LIMIT 3", __FILE__,__LINE__);
  while ($row = mysql_fetch_assoc($request))
  echo' <center><td align="center" colspan="3"><a href="', $scripturl, '?action=gallery;sa=view;id=',
  $row['ID_PICTURE'], '"><img src="',  $modSettings['gallery_url'] .

  $row['thumbfilename'] ,'" /></a></center>';
  echo'</td></tr>';
  echo'</table></br>';
  mysql_free_result($request);

exerciseforum


Jpg

Your welcome. I forgot the global commands....lol...

This website is proudly hosted on Crocweb Cloud Website Hosting.