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

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

0 Members and 2 Guests are viewing this topic.

Offline Maya

  • Member
  • *
  • Posts: 19
    • View Profile
Re: Random Image in Block?
« Reply #45 on: October 12, 2006, 07:10:18 pm »
The code looks similar to an earlier post, but np

Thanks..I popped it in and ...

and it works, I just wanted to  uh.. 'enhance ' it now

show 3 or 4 images in a center block at once

do you know how? ;D

Offline Maya

  • Member
  • *
  • Posts: 19
    • View Profile
Re: Random Image in Block?
« Reply #46 on: October 12, 2006, 07:30:11 pm »
rofl.. u should here what my son just asked

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: Random Image in Block?
« Reply #47 on: October 12, 2006, 07:31:33 pm »
Let me take a look into it. I'll see what I can do. If I remember correctly I can make an infinite amount...





Offline usermike3969

  • Member
  • *
  • Posts: 28
    • View Profile
    • mib4life
Re: Random Image in Block?
« Reply #48 on: October 12, 2006, 08:33:43 pm »
try like this

Code: [Select]
function ssi_galleryrandom()

 {
  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 RAND() 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);
}

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: Random Image in Block?
« Reply #49 on: October 12, 2006, 08:43:35 pm »
Nice.

I like it.
How about for 5...

Code: [Select]
function ssi_galleryrandom()
{
  global $scripturl,$db_prefix,$modSettings,$boardurl;
  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }

  $request = db_query("SELECT thumbfilename,ID_PICTURE
                                FROM {$db_prefix}gallery_pic
                                ORDER BY RAND() LIMIT 5", __FILE__, __LINE__);

  while ($row = mysql_fetch_assoc($request))
  {
    echo' <center><a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="',  $modSettings['gallery_url'] . $row['thumbfilename'] ,'" /></a></center>';
  }
  mysql_free_result($request);
}

I got some help from a pal of mine. :)

Shows 5. Just add this to the bottom of your SSi.php.
Then you can use the SSI function
Code: [Select]
ssi_galleryrandom();





Offline usermike3969

  • Member
  • *
  • Posts: 28
    • View Profile
    • mib4life
Re: Random Image in Block?
« Reply #50 on: October 12, 2006, 08:57:17 pm »
nice but it puts them under each other and i think she wonted them beside each other thats y i made the tables in the code i edited

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: Random Image in Block?
« Reply #51 on: October 12, 2006, 09:06:59 pm »
I love your idea much more better. :D





Offline Maya

  • Member
  • *
  • Posts: 19
    • View Profile
Re: Random Image in Block?
« Reply #52 on: October 12, 2006, 09:07:30 pm »
hehe... ur right usermike...5 random go vertical..

I definitely want them to go horrorzontally... :P

autothumbnailing too... sure looks like it from the pics I put in for test..*thmbs up 2u

very cool...




Offline usermike3969

  • Member
  • *
  • Posts: 28
    • View Profile
    • mib4life
Re: Random Image in Block?
« Reply #53 on: October 12, 2006, 09:12:09 pm »
so does that mean it worked ??? ?

Offline Maya

  • Member
  • *
  • Posts: 19
    • View Profile
Re: Random Image in Block?
« Reply #54 on: October 12, 2006, 09:22:26 pm »
 :D lol...sorry...( im trying to cook some grub too...)

yes it worked..I even experimented....

changed the colspan from 3 to 5
and the limit 3 to limit 5...

voila...perfect ( almost: auto- height resizes but not width)

sorry for takin so long...


and thanks all for your patience...  :D
« Last Edit: November 06, 2006, 03:16:27 pm by Maya »

Offline Jpg

  • Member
  • *
  • Posts: 25
  • I love cats they taste like chicken!!
    • View Profile
    • InflameHq
Re: Random Image in Block?
« Reply #55 on: October 12, 2006, 10:57:18 pm »
I had some fun with the template with this code.
I'll post up some codes later, some for editing it like adding a logo and 5 most recent images, and 5 random images with little pictures as headers...blah blah blah.





Offline Maya

  • Member
  • *
  • Posts: 19
    • View Profile
Re: Random Image in Block?
« Reply #56 on: October 12, 2006, 11:15:57 pm »
cool Jpg

5 most recent for a tp side block... :)

what about having them able to randomise from certain cats only....

ie: have one center block for a cat of artwork and one for musicians run in another block right below...

uh oh...I feel a few more ideas comin on...lol

btw-same Maya  ;)


Offline xface

  • Bad Emails DO NOT EMAIL
  • Member
  • *
  • Posts: 16
    • View Profile
Re: Random Image in Block?
« Reply #57 on: October 12, 2006, 11:29:37 pm »
what happen when u tried the linking codes ???

This:

Parse error: syntax error, unexpected '=' in /full/directory/path/www/site/SSI.php on line 1572

I have tryed just about every combination to get it included, but then again my knowledge is not all that great, LOL!!

Offline usermike3969

  • Member
  • *
  • Posts: 28
    • View Profile
    • mib4life
Re: Random Image in Block?
« Reply #58 on: October 13, 2006, 01:13:46 am »
try this

Code: [Select]
function ssi_galleryrandom()
{
  global $scripturl,$db_prefix,$modSettings,$boardurl;

  if(empty($modSettings['gallery_url']))
  {
    $modSettings['gallery_url'] = $boardurl . '/gallery/';
  }
 
  $request = db_query("SELECT thumbfilename,ID_PICTURE,filename FROM

{$db_prefix}gallery_pic GROUP BY thumbfilename ORDER BY RAND() LIMIT 1", __FILE__,

__LINE__);
  $row = mysql_fetch_assoc($request);
  mysql_free_result($request);
  echo' <center><a href="', $scripturl, '?action=gallery;sa=view;id=',

$row['ID_PICTURE'], '"><img src="',  $modSettings['gallery_url'] .

$row['thumbfilename'] ,'" /></a></center>'

;
?><script language="javascript" type="text/javascript">
<!--
function linkingcodes() {
  newwindow2=window.open('','name','height=350,width=800,scrollbars=yes');
  var tmp = newwindow2.document;
  tmp.write('<html><head><title>Linking codes</title>');
  tmp.write('');
  tmp.write('</head><body bgcolor="#000000"><center><font color="#FFFFFF">');
  tmp.write('HTML THUMB</br>&lt;img src="<?echo $modSettings['gallery_url'].$row['thumbfilename'];?>"&gt; ');
  tmp.write('</br></br>HTML</br>&lt;img src="<?echo $modSettings['gallery_url'].$row['filename']; ?>"&gt;');
  tmp.write('</br></br>BBC THUMB</br>[img]<?echo $modSettings['gallery_url'].$row['thumbfilename'];?>[/img]');
  tmp.write('</br></br>BBC</br>[img]<?echo $modSettings['gallery_url'].$row['filename']; ?>[/img]');
  tmp.write('</font></center></body></html>');
  tmp.close();
}
// -->
</script><center><form>
</br><input type="button" onClick="return linkingcodes()" value="Linking codes!">
</form></center>
<?
}
place this before
Code: [Select]
?>

Offline xface

  • Bad Emails DO NOT EMAIL
  • Member
  • *
  • Posts: 16
    • View Profile
Re: Random Image in Block?
« Reply #59 on: October 13, 2006, 09:41:07 am »
yup that works perfect!! is there an easy way to combine the thumbnail with the direct link to the gallery full image page? I think this little code is priceless!!!

your the king!

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
6142 Views
Last post June 18, 2010, 09:18:00 am
by dvera
2 Replies
9302 Views
Last post October 15, 2010, 04:03:02 pm
by Rafferty
1 Replies
5400 Views
Last post October 16, 2016, 12:12:51 pm
by exit
5 Replies
5370 Views
Last post July 12, 2017, 03:45:34 pm
by donk
8 Replies
7026 Views
Last post December 04, 2017, 09:41:20 pm
by Boomslanger

+- 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