Twitter SMFHacks Facebook SMFHacks SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 18, 2013, 07:46:03 pm

Login with username, password and session length
Members
Total Members: 10757
Latest: DTroup
Stats
Total Posts: 32348
Total Topics: 5473
Online Today: 56
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 36
Total: 36
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 2 3 [4] 5 6 ... 8 Go Down Print
Author Topic: Random Image in Block?  (Read 78791 times)
Maya
Inline PM Customer
*****
Offline Offline

Posts: 19


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

Posts: 19


View Profile
« Reply #46 on: October 12, 2006, 07:30:11 pm »

rofl.. u should here what my son just asked
Logged
Jpg
Inline PM Customer
*****
Offline Offline

Posts: 25


I love cats they taste like chicken!!


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





usermike3969
Inline PM Customer
*****
Offline Offline

Posts: 28


View Profile WWW
« Reply #48 on: October 12, 2006, 08:33:43 pm »

try like this

Code:
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);
}
Logged
Jpg
Inline PM Customer
*****
Offline Offline

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« Reply #49 on: October 12, 2006, 08:43:35 pm »

Nice.

I like it.
How about for 5...

Code:
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. Smiley

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





usermike3969
Inline PM Customer
*****
Offline Offline

Posts: 28


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

Posts: 25


I love cats they taste like chicken!!


View Profile WWW
« Reply #51 on: October 12, 2006, 09:06:59 pm »

I love your idea much more better. Cheesy
Logged





Maya
Inline PM Customer
*****
Offline Offline

Posts: 19


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

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

very cool...



Logged
usermike3969
Inline PM Customer
*****
Offline Offline

Posts: 28


View Profile WWW
« Reply #53 on: October 12, 2006, 09:12:09 pm »

so does that mean it worked Huh ?
Logged
Maya
Inline PM Customer
*****
Offline Offline

Posts: 19


View Profile
« Reply #54 on: October 12, 2006, 09:22:26 pm »

 Cheesy 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...  Cheesy
« Last Edit: November 06, 2006, 03:16:27 pm by Maya » Logged
Jpg
Inline PM Customer
*****
Offline Offline

Posts: 25


I love cats they taste like chicken!!


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





Maya
Inline PM Customer
*****
Offline Offline

Posts: 19


View Profile
« Reply #56 on: October 12, 2006, 11:15:57 pm »

cool Jpg

5 most recent for a tp side block... Smiley

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  Wink

Logged
xface
Inline PM Customer
*****
Offline Offline

Posts: 16


View Profile
« Reply #57 on: October 12, 2006, 11:29:37 pm »

what happen when u tried the linking codes Huh

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!!
Logged
usermike3969
Inline PM Customer
*****
Offline Offline

Posts: 28


View Profile WWW
« Reply #58 on: October 13, 2006, 01:13:46 am »

try this

Code:
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:
?>
Logged
xface
Inline PM Customer
*****
Offline Offline

Posts: 16


View Profile
« 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!
Logged
Pages: 1 2 3 [4] 5 6 ... 8 Go Up Print 
« previous next »
Jump to:  

Recent
[May 16, 2013, 10:13:46 pm]

[May 15, 2013, 11:32:14 pm]

[May 15, 2013, 11:31:24 pm]

[May 12, 2013, 09:10:43 am]

[May 10, 2013, 03:49:55 am]

[May 07, 2013, 07:12:40 pm]

[May 07, 2013, 02:37:14 pm]

[May 06, 2013, 10:29:56 pm]

[May 04, 2013, 03:22:01 pm]

[May 04, 2013, 01:08:57 pm]
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.223 seconds with 21 queries.