Twitter SMFHacks Facebook SMFHacks SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
June 19, 2013, 11:24:40 am

Login with username, password and session length
Members
Total Members: 10807
Latest: GoldDigger1950
Stats
Total Posts: 32559
Total Topics: 5507
Online Today: 58
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 1
Guests: 35
Total: 36
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 [2] Go Down Print
Author Topic: PIMP YOUR GALLERY TUT!!  (Read 14083 times)
Jpg
Inline PM Customer
*****
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« Reply #15 on: October 14, 2006, 11:10:19 pm »

Ok, let me add this in...

----------

Done, Now they work like a charm.
Logged





Me_angus
Inline PM Customer
*****
Offline Offline

Posts: 39



View Profile WWW
« 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

Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11051


View Profile
« Reply #17 on: October 15, 2006, 08:07:36 am »

Yeah same fix this is just for the random image.
Logged
Jpg
Inline PM Customer
*****
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« 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.
Logged





Jpg
Inline PM Customer
*****
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« 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:
    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:
  $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:
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:
ORDER BY

You can replace
Code:
views
with
Code:
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:
DESC LIMIT 5


The next code is to organize the thumbnails by category if you only want 1 you add this code.
Code:
WHERE ID_CAT = '???'

It should be used like-
Code:
     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 » Logged





Jpg
Inline PM Customer
*****
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« 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. Smiley


Add them below this code:
Code:
         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:
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:
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 » Logged





Jump1979man
Sr. Member
****
Offline Offline

Posts: 274



View Profile WWW
« Reply #21 on: June 02, 2007, 12:12:43 pm »

nice work.
Logged

Midwest Motorcycles Forum
http://www.mwmotorcycles.com

Riverway Racing
https://www.riverwayracing.com
Motorcycle parts, gear, and accessories.
SoulPleX
Inline PM Customer
*****
Offline Offline

Posts: 8


View Profile
« 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?? 
Logged
MinasC
Inline PM Customer
*****
Offline Offline

Posts: 36


View Profile
« Reply #23 on: August 29, 2007, 10:38:15 am »

woooooow , great work Jpg !!!!
Logged
Hassan
Inline PM Customer
*****
Offline Offline

Posts: 4


View Profile
« 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. Smiley


Add them below this code:
Code:
         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:
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:
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?
Logged
Pages: 1 [2] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 03:45:00 am]

[June 18, 2013, 07:27:33 am]

[June 18, 2013, 06:10:04 am]

[June 17, 2013, 12:27:50 pm]

[June 16, 2013, 08:17:21 pm]

[June 16, 2013, 07:29:04 am]

[June 15, 2013, 08:34:38 pm]

[June 14, 2013, 10:28:18 pm]

[June 13, 2013, 11:00:52 pm]

[June 12, 2013, 03:37:47 am]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 1.541 seconds with 22 queries.