Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12382
Latest: ImportedPotato
New This Month: 1
New This Week: 1
New Today: 0
Stats
Total Posts: 40238
Total Topics: 7088
Most Online Today: 97
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 31
Total: 31

Author Topic: Random Image in Block?  (Read 127640 times)

0 Members and 1 Guest are viewing this topic.

Offline Protocultura

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Random Image in Block?
« Reply #75 on: November 20, 2006, 04:35:46 pm »
One last thing, this mod shows not aproved images, there is a way to block not admited images?
Cheers.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15116
    • View Profile
Re: Random Image in Block?
« Reply #76 on: November 20, 2006, 04:45:44 pm »
Change
Code: [Select]
SELECT thumbfilename,ID_PICTURE,filename FROM

{$db_prefix}gallery_pic GROUP BY thumbfilename ORDER BY RAND() LIMIT 1"
To
Code: [Select]
SELECT thumbfilename,ID_PICTURE,filename FROM

{$db_prefix}gallery_pic Where approved = 1 GROUP BY thumbfilename ORDER BY RAND() LIMIT 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/

Offline craftervillage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Random Image in Block?
« Reply #77 on: March 18, 2007, 10:04:50 pm »
thanks, works like a charm!
You can see the mod in my site www.c4dbrasil.com
Thanks SMFHacks a priceless piece of code!!!

Your site is very nice. I tried and tried to get the code to work on my board. No dice. I like the way your thumbnails are all the same size. Looks very professional. I don't understand a word on your site but the design is excellent!! Maybe soon I will figure out how to get the block code to work on mine. I wish it was in the mod package to make it easy. I think it is too hard for me to understand. I only know the html old school.  :( I am an php idiot. I bought the pro version in high hopes of a block code pre installed on it.  :'(
I have just started the board and have not any members yet and at this rate maybe I will give up. I have a design that I like called christmas2006_11. It's just right for my forum but the button would not show on it so I had to reinstall the whole thing over and I did not install the template a second time. 

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15116
    • View Profile
Re: Random Image in Block?
« Reply #78 on: March 19, 2007, 06:50:28 am »
If you need help adding a button for the menu on a custom theme I can do that for you. Just attach your index.template.php of your custom theme.
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 craftervillage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Random Image in Block?
« Reply #79 on: March 19, 2007, 08:48:36 am »
I think that's the right file. Let me know if it's not. Thank you for doing that. I can't wait to start up my board. I really like the gallery. The old gals will like it too. Thanks again for the help.
craftervillage.com/board/

Offline ~Alex

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Random Image in Block?
« Reply #80 on: March 19, 2007, 08:07:55 pm »
Well, I've got the SMF Gallery Lite v1.7 or so and have tried to do as everyone's indicated, but I keep getting an SSI error, after copying the code, pasting it, then creating the php block.

Can someone be a bit more specific about which one is the correct code to use?

I'm on SMF 1.1.2 and TP 0.9.8.

Which code goes into SSI.php? Which command goes into the PHP we are suppose to create? And lastly, what I'm trying to do is create a random image block, am I even reading the correct thread?  ;D

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15116
    • View Profile
Re: Random Image in Block?
« Reply #81 on: March 19, 2007, 09:25:32 pm »
I think that's the right file. Let me know if it's not. Thank you for doing that. I can't wait to start up my board. I really like the gallery. The old gals will like it too. Thanks again for the help.
craftervillage.com/board/


File attached with gallery menu
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 ~Alex

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Random Image in Block?
« Reply #82 on: March 19, 2007, 11:48:28 pm »
SMFHacks...Taking that index template and replacing it with the one I have, changes my entire board to something unrecognizable...

Offline ~Alex

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Random Image in Block?
« Reply #83 on: March 19, 2007, 11:49:46 pm »
Unless that response was not meant for me?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15116
    • View Profile
Re: Random Image in Block?
« Reply #84 on: March 20, 2007, 06:56:55 am »
That was not meant for you.
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 ~Alex

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Random Image in Block?
« Reply #85 on: March 20, 2007, 07:53:59 pm »
That was not meant for you.

LoL. Well, can someone advise?

Offline ~Alex

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Random Image in Block?
« Reply #86 on: March 21, 2007, 01:18:16 am »
any help is appreciated.

i'm on 1.1.2 w/ TP .98.

Offline craftervillage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Random Image in Block?
« Reply #87 on: March 21, 2007, 09:51:39 am »
I managed to get some code to work on my site for a random images.

   
global $scripturl,$db_prefix,$modSettings,$boardurl;

echo'<table cellspacing="0" cellpadding="1" 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 RAND() LIMIT 10", __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);

I have it on my boardindex.template just below the set of tabs. The only thing I don't like about the code is my picturres repeat themselves. Really I don't know how they look in someone elses browser and I don't know any php at all. I just played around until something worked. Well I think it worked. I would like to have the pictures in a matching table but I lack the skills to make one. I hope someone will visit my site and tell me if it is ok in their browser. I didn't use any ssi. ssi to me is something disabled people get?.! No clue. ;)
http://www.craftervillage.com/board/

Offline craftervillage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Random Image in Block?
« Reply #88 on: March 21, 2007, 02:41:52 pm »
I think that's the right file. Let me know if it's not. Thank you for doing that. I can't wait to start up my board. I really like the gallery. The old gals will like it too. Thanks again for the help.
craftervillage.com/board/


File attached with gallery menu

The code didn't work. I cannot see the button/link for the gallery. I really like it. I know it's installed because it works with the default template. Did I not do something right? I uploaded the file twice just to make sure it was the file you fixed. I even copied and pasted it to the index.template and it still did not work. I can link to it but I cannot find the link to it....http://craftervillage.com/board/index.php?action=gallery
« Last Edit: March 21, 2007, 02:47:50 pm by craftervillage »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15116
    • View Profile
Re: Random Image in Block?
« Reply #89 on: March 21, 2007, 07:16:31 pm »
Hmm reattached the file.
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
4 Replies
3505 Views
Last post June 18, 2010, 09:18:00 am
by dvera
2 Replies
4255 Views
Last post October 15, 2010, 04:03:02 pm
by Rafferty
1 Replies
2596 Views
Last post October 16, 2016, 12:12:51 pm
by exit
5 Replies
2910 Views
Last post July 12, 2017, 03:45:34 pm
by donk
8 Replies
4784 Views
Last post December 04, 2017, 09:41:20 pm
by Boomslanger

+- Recent Topics

Call to undefined function mysql_num_rows() by SMFHacks
July 30, 2020, 07:45:29 am

Problem with one videosite embedding by Hatshepsut
July 24, 2020, 01:25:08 am

Download System Lite by Rock Lee
June 03, 2020, 07:34:24 pm

Font question by SMFHacks
May 27, 2020, 08:15:26 am

Error message with latest SMF 2.1 Github build by Hatshepsut
May 25, 2020, 01:43:26 am

smfblog not working on 2.0.17 by tech9
May 20, 2020, 01:44:34 pm

Copyright removal by stbc
May 18, 2020, 01:27:57 am

Mod Verified User i can't square the image by Rock Lee
May 07, 2020, 07:56:10 pm

SMF4Mobile 2.0 released for SMF 2.0.x by SMFHacks
May 06, 2020, 12:13:14 pm

SMF Social Login Pro - Discontinued? by Nicole
May 02, 2020, 05:47:04 pm

Powered by EzPortal