Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 221
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 190
Total: 190

Author Topic: PIMP YOUR GALLERY TUT!!  (Read 24819 times)

0 Members and 1 Guest are viewing this topic.

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: PIMP YOUR GALLERY TUT!!
« Reply #15 on: October 14, 2006, 11:10:19 pm »
Ok, let me add this in...

----------

Done, Now they work like a charm.





Offline Me_angus

  • Member
  • *
  • Posts: 39
    • View Profile
    • A Kinky Cafe
Re: PIMP YOUR GALLERY TUT!!
« Reply #16 on: October 15, 2006, 07:47:59 am »
Add this where? And is the bug fix you mentioned in SSI Mod topic?

Need to add this to query  WHERE approved = 1


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: PIMP YOUR GALLERY TUT!!
« Reply #17 on: October 15, 2006, 08:07:36 am »
Yeah same fix this is just for the random image.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: PIMP YOUR GALLERY TUT!!
« Reply #18 on: October 17, 2006, 08:35:27 pm »
Any ideas man?
I noticed that the logo, etc...
Doesn't show up in the add images section,etc....hmmm....
I'll take a look into this.





Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: PIMP YOUR GALLERY TUT!!
« Reply #19 on: March 13, 2007, 08:28:06 pm »
I'm back with another tutorial on Gallery Lite...Show top 5 most popular images in the gallery in a category.

This is the code for most popular/most viewed images in your gallery.
[This is for a php block with tinyportal if you have.]

Code: [Select]
    global $scripturl,$db_prefix,$modSettings,$boardurl;

  echo'<p align="left"><font  size="1"><b>Popular</b></font></p>';
  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 WHERE approved = '1' GROUP BY thumbfilename ORDER BY views 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);


Lemme break some of this code apart for everyone to learn some php.

This section of the code controls what data of the code above shows.

 
Code: [Select]
  $request = db_query("SELECT thumbfilename,ID_PICTURE FROM {$db_prefix}gallery_pic WHERE approved = '1' GROUP BY thumbfilename ORDER BY views DESC LIMIT 5", __FILE__,__LINE__);

Code: [Select]
WHERE approved = '1' Shows only images been approved or not.



This following code orders the thumbnails with the next comman which can be anything.
Code: [Select]
ORDER BY
You can replace
Code: [Select]
views with
Code: [Select]
date to do it by newest if you want.


The next code shows the number of thumbnails descending. Just change the number 5 to anything else you want.
Code: [Select]
DESC LIMIT 5

The next code is to organize the thumbnails by category if you only want 1 you add this code.
Code: [Select]
WHERE ID_CAT = '???'
It should be used like-
Code: [Select]
     global $scripturl,$db_prefix,$modSettings,$boardurl;

  echo'<p align="left"><font  size="1"><b>Category 1</b></font></p>';
  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_CAT, ID_PICTURE FROM {$db_prefix}gallery_pic  WHERE ID_CAT = '1' GROUP BY thumbfilename ORDER BY date DESC LIMIT 5", __FILE__, __LINE__);
$row = mysql_fetch_assoc($request);
  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);

There are other commands but these are the basics.
-------------
I actually redid the whole gallery package with completely different templates and drop down menus to go through categories...and I learned how to integrate it with the default profile...
I also learned how to add shadows to images...but I don't think SmfHacks would appreciate a hooked up version of gallery lite running around with unique features that gallery pro doesn't even have...
So I'll keep it personal...I really wish I had gallery pro though.
I wouldn't even need to hook up gallery lite. <.<
I'll release probably the full hack later on when I finish it..lol..

« Last Edit: March 13, 2007, 08:32:32 pm by Jpg »





Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: PIMP YOUR GALLERY TUT!!
« Reply #20 on: June 02, 2007, 11:44:43 am »
Yowza, haven't even been using TP lately..but then again I think I should release one more trick I have.

Well this trick gives you newest and most popular 5 images on your gallery main...but looks just like Gallery Pro...in the fact I used the catbgs and tite classses to decorate them. :)


Add them below this code:
Code: [Select]
         echo '</tr>';
         if($g_manage)
         {
            echo '<tr class="titlebg">
            <td colspan="6"> </td>
         </tr>';
         }
         else
            echo '<tr class="titlebg">
            <td colspan="4"> </td>
         </tr>';

         mysql_free_result($dbresult2);

      }
      mysql_free_result($dbresult);
      echo '</table><br /><br /><br />';

Newest Code-
Code: [Select]
echo'
<table cellspacing="0" cellpadding="5" border="0" align="center" width="100%" class="tborder">
            <tr class="titlebg">
               <td align="center" width="100%" >Newest</td>
            </tr></table>
<table cellspacing="0" cellpadding="5" border="0" align="center" width="100%" class="tborder">
            <tr class="windowbg2">
         <td align="center" width="100%" >';
  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }
      $dbresult = db_query("SELECT p.ID_PICTURE, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.memberName, m.realName, p.date, p.description FROM {$db_prefix}gallery_pic as p, {$db_prefix}members AS m WHERE  p.ID_MEMBER = m.ID_MEMBER AND p.approved = 1 ORDER BY date DESC LIMIT 5", __FILE__, __LINE__);
      $rowlevel = 0;
      while($row = mysql_fetch_assoc($dbresult))
      {
         if($rowlevel == 0)

         echo '<center><td align="center" width="100%" ><span class="img-shadow"><a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '"><img src="' . $modSettings['gallery_url'] . $row['thumbfilename']  . '" border="0" /></a></span><br />';
         echo ' <td align="center" width="100%" ><span class="smalltext">' . $txt['gallery_text_views'] . $row['views'] . '<br />';
         echo $txt['gallery_text_filesize'] . round($row['filesize'] / 1024, 2) . 'KB<br />';
         echo $txt['gallery_text_date'] . timeformat($row['date']) . '<br />';
         echo $txt['gallery_text_comments'] . ' (<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '">' . $row['commenttotal'] . '</a>)<br />';
         echo $txt['gallery_text_by'] . ' <a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">'  . $row['realName'] . '</a><br />';

         echo '</span>';
      }
  echo'</td></tr></center>';
  echo'</table></br>';
      mysql_free_result($dbresult);

Popular/Top 5 Most Viewed-
Code: [Select]
echo'
<table cellspacing="0" cellpadding="5" border="0" align="center" width="100%" class="tborder">
            <tr class="titlebg">
               <td align="center" width="100%" >Popular</td>
            </tr></table>
<table cellspacing="0" cellpadding="5" border="0" align="center" width="100%" class="tborder">
            <tr class="windowbg2">
         <td align="center">';
  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }
      $dbresult = db_query("SELECT p.ID_PICTURE, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.memberName, m.realName, p.date, p.description FROM {$db_prefix}gallery_pic as p, {$db_prefix}members AS m WHERE  p.ID_MEMBER = m.ID_MEMBER AND p.approved = 1 ORDER BY views DESC LIMIT 5", __FILE__, __LINE__);
      $rowlevel = 0;
      while($row = mysql_fetch_assoc($dbresult))
      {
         if($rowlevel == 0)

         echo '<center><td align="center"  ><span class="img-shadow"><a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '"><img src="' . $modSettings['gallery_url'] . $row['thumbfilename']  . '" border="0" /></a></span><br />';
         echo ' <td align="center" width="100%" ><span class="smalltext">' . $txt['gallery_text_views'] . $row['views'] . '<br />';
         echo $txt['gallery_text_filesize'] . round($row['filesize'] / 1024, 2) . 'KB<br />';
         echo $txt['gallery_text_date'] . timeformat($row['date']) . '<br />';
         echo $txt['gallery_text_comments'] . ' (<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '">' . $row['commenttotal'] . '</a>)<br />';
         echo $txt['gallery_text_by'] . ' <a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">'  . $row['realName'] . '</a><br />';

         echo '</span>';
      }
  echo'</td></tr></center>';
  echo'</table></br>';
      mysql_free_result($dbresult);
« Last Edit: June 02, 2007, 11:46:26 am by Jpg »





Offline Jump1979man

  • Sr. Member
  • ****
  • Posts: 274
    • View Profile
    • Midwest Motorcycles Forum
Re: PIMP YOUR GALLERY TUT!!
« Reply #21 on: June 02, 2007, 12:12:43 pm »
nice work.
Midwest Motorcycles Forum
http://www.mwmotorcycles.com

Riverway Racing
https://www.riverwayracing.com
Motorcycle parts, gear, and accessories.

Offline SoulPleX

  • Member
  • *
  • Posts: 8
    • View Profile
Re: PIMP YOUR GALLERY TUT!!
« Reply #22 on: August 26, 2007, 12:14:41 pm »
'add shadows to images' what does this mean?  If i place my mouse over a image in my gallery i want it to blow up in a bigger box for viewing. I hope that made since. Is adding shadows to images th same then?? 

Offline MinasC

  • Member
  • *
  • Posts: 36
    • View Profile
Re: PIMP YOUR GALLERY TUT!!
« Reply #23 on: August 29, 2007, 10:38:15 am »
woooooow , great work Jpg !!!!

Offline Hassan

  • Member
  • *
  • Posts: 4
    • View Profile
Re: PIMP YOUR GALLERY TUT!!
« Reply #24 on: November 23, 2007, 07:52:38 pm »
Yowza, haven't even been using TP lately..but then again I think I should release one more trick I have.

Well this trick gives you newest and most popular 5 images on your gallery main...but looks just like Gallery Pro...in the fact I used the catbgs and tite classses to decorate them. :)


Add them below this code:
Code: [Select]
         echo '</tr>';
         if($g_manage)
         {
            echo '<tr class="titlebg">
            <td colspan="6"> </td>
         </tr>';
         }
         else
            echo '<tr class="titlebg">
            <td colspan="4"> </td>
         </tr>';

         mysql_free_result($dbresult2);

      }
      mysql_free_result($dbresult);
      echo '</table><br /><br /><br />';

Newest Code-
Code: [Select]
echo'
<table cellspacing="0" cellpadding="5" border="0" align="center" width="100%" class="tborder">
            <tr class="titlebg">
               <td align="center" width="100%" >Newest</td>
            </tr></table>
<table cellspacing="0" cellpadding="5" border="0" align="center" width="100%" class="tborder">
            <tr class="windowbg2">
         <td align="center" width="100%" >';
  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }
      $dbresult = db_query("SELECT p.ID_PICTURE, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.memberName, m.realName, p.date, p.description FROM {$db_prefix}gallery_pic as p, {$db_prefix}members AS m WHERE  p.ID_MEMBER = m.ID_MEMBER AND p.approved = 1 ORDER BY date DESC LIMIT 5", __FILE__, __LINE__);
      $rowlevel = 0;
      while($row = mysql_fetch_assoc($dbresult))
      {
         if($rowlevel == 0)

         echo '<center><td align="center" width="100%" ><span class="img-shadow"><a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '"><img src="' . $modSettings['gallery_url'] . $row['thumbfilename']  . '" border="0" /></a></span><br />';
         echo ' <td align="center" width="100%" ><span class="smalltext">' . $txt['gallery_text_views'] . $row['views'] . '<br />';
         echo $txt['gallery_text_filesize'] . round($row['filesize'] / 1024, 2) . 'KB<br />';
         echo $txt['gallery_text_date'] . timeformat($row['date']) . '<br />';
         echo $txt['gallery_text_comments'] . ' (<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '">' . $row['commenttotal'] . '</a>)<br />';
         echo $txt['gallery_text_by'] . ' <a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">'  . $row['realName'] . '</a><br />';

         echo '</span>';
      }
  echo'</td></tr></center>';
  echo'</table></br>';
      mysql_free_result($dbresult);

Popular/Top 5 Most Viewed-
Code: [Select]
echo'
<table cellspacing="0" cellpadding="5" border="0" align="center" width="100%" class="tborder">
            <tr class="titlebg">
               <td align="center" width="100%" >Popular</td>
            </tr></table>
<table cellspacing="0" cellpadding="5" border="0" align="center" width="100%" class="tborder">
            <tr class="windowbg2">
         <td align="center">';
  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }
      $dbresult = db_query("SELECT p.ID_PICTURE, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.memberName, m.realName, p.date, p.description FROM {$db_prefix}gallery_pic as p, {$db_prefix}members AS m WHERE  p.ID_MEMBER = m.ID_MEMBER AND p.approved = 1 ORDER BY views DESC LIMIT 5", __FILE__, __LINE__);
      $rowlevel = 0;
      while($row = mysql_fetch_assoc($dbresult))
      {
         if($rowlevel == 0)

         echo '<center><td align="center"  ><span class="img-shadow"><a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '"><img src="' . $modSettings['gallery_url'] . $row['thumbfilename']  . '" border="0" /></a></span><br />';
         echo ' <td align="center" width="100%" ><span class="smalltext">' . $txt['gallery_text_views'] . $row['views'] . '<br />';
         echo $txt['gallery_text_filesize'] . round($row['filesize'] / 1024, 2) . 'KB<br />';
         echo $txt['gallery_text_date'] . timeformat($row['date']) . '<br />';
         echo $txt['gallery_text_comments'] . ' (<a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '">' . $row['commenttotal'] . '</a>)<br />';
         echo $txt['gallery_text_by'] . ' <a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">'  . $row['realName'] . '</a><br />';

         echo '</span>';
      }
  echo'</td></tr></center>';
  echo'</table></br>';
      mysql_free_result($dbresult);


this just doesn't work for me and i did everthing that was asked?

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
14018 Views
Last post October 21, 2006, 11:40:55 am
by SMFHacks
0 Replies
18639 Views
Last post October 04, 2006, 11:51:34 pm
by SMFHacks
7 Replies
8472 Views
Last post October 14, 2006, 10:05:17 am
by Jpg
1 Replies
4930 Views
Last post October 12, 2006, 10:25:45 am
by SMFHacks
1 Replies
4906 Views
Last post November 09, 2006, 05:32:19 pm
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal