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: 241
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 208
Total: 208

Author Topic: PIMP YOUR GALLERY TUT!!  (Read 24821 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
PIMP YOUR GALLERY TUT!!
« on: October 13, 2006, 02:48:26 pm »
Well howdy everyone.
I thought I'll make a tutorial for pimping out your gallery.
You can-

Add a logo
5 most recently submitted images
5 Random Images
Replace "My Images" and "Search" with buttons/images.

-------------------------
Soon to be added-

Members Pages in a table...perhaps scrolling.
"Add Image" link on main[Very Simple].
--------------------------------------------------------
WARNING!!!
IT MIGHT GO OFF BOTTOM OF PAGE!
USE ONLY IF YOU HAVE TP AND YOU HAVE A MENU ON THE LEFT OR RIGHT SIDE LONG ENOUGH!!!


All of these addons are for the gallery.template.php
I'm not responsible for your losses or if you mess up and you want to blame me.

Now that legal matters are out of the way...

ON WITH THE TUT!!

Adding a logo above everything else...look for line 20...something like that.

Should say-

Code: [Select]
   global $db_prefix, $scripturl, $txt, $context,$ID_MEMBER,$modSettings, $boarddir,$boardurl;

   echo '<div class="tborder">';


After that you can add anything you please. Let's put a logo first.

Code: [Select]
   echo '
<center><a href="' . $scripturl . '?action=gallery"><img src="your image url.whatever" style="float: center;" title="Gallery logo" alt="Welcome to the Gallery" /></a></center>';


Simple right? Now let's put a block perhaps with a header on it.
A pic saying...random images or recent blocks.

--------------------
5 Random images:

Header Image-
Code: [Select]
echo '
<center><img src="img url" style="float: center;" title="Random" alt="Random Images" /></center>';
I used

For that.

Code-
Code: [Select]
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 WHERE approved = '1' GROUP BY thumbfilename ORDER BY RAND() 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);


--------------------------
5 Most Recent


Header-
Code: [Select]
echo '
<center><img src="url" style="float: center;" title="5 Recent" alt="Recent Imgs" /></center>';

I used

for that.

Code-
Code: [Select]
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 WHERE approved = '1' 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);



------------------
WARNING!!!
IT MIGHT GO OFF BOTTOM OF PAGE!
USE ONLY IF YOU HAVE TP AND YOU HAVE A MENU ON THE LEFT OR RIGHT SIDE LONG ENOUGH!!!




-------------------------------
Making My Images and Search buttons!!

Ok what you do now is..............
get your images first. ANd upload them. Their should be 2.
My Images and Search Button.
Feel free to use the ones I made, I too use them on my site.




First you edit the thing for guests.
Code: [Select]
echo '<center><a href="' . $scripturl . '?action=gallery;sa=myimages;u=' . $ID_MEMBER . '">' . $txt['gallery_text_myimages'] . '</a></center>&nbsp;<center><a href="' . $scripturl . '?action=gallery;sa=search">' . $txt['gallery_text_search'] . '</a></center>';
Replace it with this.

Code: [Select]
echo '<center><a href="' . $scripturl . '?action=gallery;sa=myimages;u=' . $ID_MEMBER . '"><img src="Myimages.png Url Here" border="0" alt="Your Images"></a></center>&nbsp;<center><a href="' . $scripturl . '?action=gallery;sa=search"><img src="Search.png Url Here" border="0" alt="Search"></a></center>';
Edit the urls accordingly.

Okay now for your members.

Look for
Code: [Select]
//No Category is set.
if($g_add && !($context['user']['is_guest']))

Inb the table under it you'll see...

Code: [Select]
' . $txt['gallery_text_myimages'] . '

Replace with
Code: [Select]
<img src="Myimages.png Url Here" border="0" alt="Your Images">
After that you'll see a code

Code: [Select]
' . $txt['gallery_text_search'] . '
Replace With

Code: [Select]
<img src="Search.png Url Here" border="0" alt="Search">
And that'll be it for now. :D
« Last Edit: October 14, 2006, 11:11:49 pm by Jpg »





Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: PIMP YOUR GALLERY TUT!!
« Reply #1 on: October 13, 2006, 03:00:42 pm »
Wait, let me tell people how to edit the codes a little bit.
---------------

If you don't like the amount of images and you want 6 or 7 or less than 5...like 3?

Well you can have as many as you want...

Find the code
Code: [Select]
LIMIT 5Change the limit # to anything if you want more or less iamges.

---------------------
If you wanted to get rid of the thing that says gallery above the gallery then go to the langauge file and edit it a little bit. There's a tut for this in another topic.

---------------------

Feel free to use the images. Just upload them to the server or photobucket whatever and just add the url in the code in the places that say URL.

----------------------

If someone knows how to expand the gallery for everyone else just paste the code/tut here.


No need to give credit. :d





Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: PIMP YOUR GALLERY TUT!!
« Reply #2 on: October 13, 2006, 03:01:03 pm »
Good stuff.
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 #3 on: October 13, 2006, 03:19:12 pm »
Thanks. I'm glad someone appreciates it. A got a demo at my site but I don't feel like posting it...I'm not done with it.





Offline Jump1979man

  • Sr. Member
  • ****
  • Posts: 274
    • View Profile
    • Midwest Motorcycles Forum
Re: PIMP YOUR GALLERY TUT!!
« Reply #4 on: October 13, 2006, 03:24:39 pm »
works great!
Midwest Motorcycles Forum
http://www.mwmotorcycles.com

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

Offline Jump1979man

  • Sr. Member
  • ****
  • Posts: 274
    • View Profile
    • Midwest Motorcycles Forum
Re: PIMP YOUR GALLERY TUT!!
« Reply #5 on: October 13, 2006, 03:43:59 pm »
How can I get rid of the GALLERY text now?  I have looked in the code but it appears to be embedded somehow.
Midwest Motorcycles Forum
http://www.mwmotorcycles.com

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

Offline Jump1979man

  • Sr. Member
  • ****
  • Posts: 274
    • View Profile
    • Midwest Motorcycles Forum
Re: PIMP YOUR GALLERY TUT!!
« Reply #6 on: October 13, 2006, 03:44:55 pm »
How can I get rid of the GALLERY text now?  I have looked in the code but it appears to be embedded somehow.

Oops nevermind....just re-read your instructions....thanks.
Midwest Motorcycles Forum
http://www.mwmotorcycles.com

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

Offline Maya

  • Member
  • *
  • Posts: 19
    • View Profile
Re: PIMP YOUR GALLERY TUT!!
« Reply #7 on: October 14, 2006, 12:32:55 am »
 ;D luv the title... ;)

Way to go Jpg... and speedy too...lol

Could you mention for all what type of  'blocks' to create.. ie php, html, script... Im assuming in TinyPortal of course..


Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: PIMP YOUR GALLERY TUT!!
« Reply #8 on: October 14, 2006, 10:03:54 am »
No you just add it to the galery template.php in the deafult theme folder. Make a backup first.

Btw, you can just put those codes in a php code block if you want. It'll work perfectly. :)


-------------

Added another tut.

------------

Enhanced Logo Code.

Code: [Select]
   echo '
<center><a href="' . $scripturl . '?action=gallery"><img src="your image url.whatever" style="float: center;" title="Gallery logo" alt="Welcome to the Gallery" /></a></center>';

Now links back to the gallery main instad of being there for show...
« Last Edit: October 14, 2006, 11:55:51 am by Jpg »





Offline Jump1979man

  • Sr. Member
  • ****
  • Posts: 274
    • View Profile
    • Midwest Motorcycles Forum
Re: PIMP YOUR GALLERY TUT!!
« Reply #9 on: October 14, 2006, 01:52:38 pm »
What exactly does the enhanced logo code do?  I know it says links back to the gallery main instead of being there for show but what does that mean?

Got an example....
Midwest Motorcycles Forum
http://www.mwmotorcycles.com

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

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: PIMP YOUR GALLERY TUT!!
« Reply #10 on: October 14, 2006, 03:06:37 pm »
http://Http://inflamehq.com/
Login as
User-demo
Pass-demo

Look at my gallery.

The logo now is a link.
When you click it it takes you back to the main page of the gallery instead of just being a picture.
Just replace your old logo code if you had one with the new one...
« Last Edit: October 14, 2006, 04:24:53 pm by Jpg »





Offline TeamVTEC

  • Member
  • *
  • Posts: 45
    • View Profile
Re: PIMP YOUR GALLERY TUT!!
« Reply #11 on: October 14, 2006, 04:50:08 pm »
looks nice, good job

Offline Jump1979man

  • Sr. Member
  • ****
  • Posts: 274
    • View Profile
    • Midwest Motorcycles Forum
Re: PIMP YOUR GALLERY TUT!!
« Reply #12 on: October 14, 2006, 10:26:22 pm »
http://Http://inflamehq.com/
Login as
User-demo
Pass-demo

Look at my gallery.

The logo now is a link.
When you click it it takes you back to the main page of the gallery instead of just being a picture.
Just replace your old logo code if you had one with the new one...


ok, that is what I thought by looking at the code but wanted to be sure....
Midwest Motorcycles Forum
http://www.mwmotorcycles.com

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

Offline Jump1979man

  • Sr. Member
  • ****
  • Posts: 274
    • View Profile
    • Midwest Motorcycles Forum
Re: PIMP YOUR GALLERY TUT!!
« Reply #13 on: October 14, 2006, 10:43:08 pm »
Did you know that in the random and recent sections you add through your code,

submitted pictures show up even before being approved by the admin........

Is there a way to stop this from happening?
Midwest Motorcycles Forum
http://www.mwmotorcycles.com

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

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: PIMP YOUR GALLERY TUT!!
« Reply #14 on: October 14, 2006, 10:49:33 pm »
Need to add this to query  WHERE approved = 1
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/

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
14020 Views
Last post October 21, 2006, 11:40:55 am
by SMFHacks
0 Replies
18641 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