SMFHacks.com
SMFHacks
Community Suite
SMF Gallery Pro
SMF Store
SMF Classifieds
Newsletter Pro
Downloads System Pro
Ad Seller Pro
Badge Awards
Hacks and Mods
Latest SMF Hacks
TopTen Hacks
Styles and Themes
Add a Hack
Manage Hacks
Earn Money from Your Forum with these tips
SMF Theme Generator
SMF Package Parser
Free SMF Hosting
Buy Website Traffic
Site Showcase
Email Marketing Software
Search Forums
Advanced search
User
Welcome,
Guest
. Please
login
or
register
.
June 19, 2013, 04:25:13 pm
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Stats
Members
Total Members: 10807
Latest:
GoldDigger1950
Stats
Total Posts: 32560
Total Topics: 5507
Online Today: 58
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 2
Guests: 42
Total: 44
SeppoK
william777
SMFHacks.com
Forum
SMF Gallery Lite
SMF Gallery Lite
Random Image in Block?
0 Members and 1 Guest are viewing this topic.
« previous
next »
Pages:
1
2
3
[
4
]
5
6
...
8
Author
Topic: Random Image in Block? (Read 79511 times)
Maya
Inline PM Customer
Offline
Posts: 19
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?
Logged
Maya
Inline PM Customer
Offline
Posts: 19
Re: Random Image in Block?
«
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
Posts: 25
I love cats they taste like chicken!!
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...
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
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
Posts: 25
I love cats they taste like chicken!!
Re: Random Image in Block?
«
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.
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
Posts: 28
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
Logged
Jpg
Inline PM Customer
Offline
Posts: 25
I love cats they taste like chicken!!
Re: Random Image in Block?
«
Reply #51 on:
October 12, 2006, 09:06:59 pm »
I love your idea much more better.
Logged
Maya
Inline PM Customer
Offline
Posts: 19
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...
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
Posts: 28
Re: Random Image in Block?
«
Reply #53 on:
October 12, 2006, 09:12:09 pm »
so does that mean it worked
?
Logged
Maya
Inline PM Customer
Offline
Posts: 19
Re: Random Image in Block?
«
Reply #54 on:
October 12, 2006, 09:22:26 pm »
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...
«
Last Edit: November 06, 2006, 03:16:27 pm by Maya
»
Logged
Jpg
Inline PM Customer
Offline
Posts: 25
I love cats they taste like chicken!!
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.
Logged
Maya
Inline PM Customer
Offline
Posts: 19
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
Logged
xface
Inline PM Customer
Offline
Posts: 16
Re: Random Image in Block?
«
Reply #57 on:
October 12, 2006, 11:29:37 pm »
Quote from: usermike3969 on October 12, 2006, 04:24:45 am
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!!
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
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><img src="<?echo $modSettings['gallery_url'].$row['thumbfilename'];?>"> ');
tmp.write('</br></br>HTML</br><img src="<?echo $modSettings['gallery_url'].$row['filename']; ?>">');
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
Posts: 16
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!
Logged
Pages:
1
2
3
[
4
]
5
6
...
8
« previous
next »
Jump to:
Please select a destination:
-----------------------------
SMFHacks.com
-----------------------------
=> News
=> Site Discussion
===> Suggestions
===> Bugs
-----------------------------
SMF Gallery Pro
-----------------------------
=> Announcements
=> Presales
=> Support
===> Bugs
===> Feature Requests
-----------------------------
SMF Store
-----------------------------
=> Announcements
=> Presales
=> Support
===> Guides and Tips
===> Feature Requests
===> Bugs
-----------------------------
SMF Classifieds
-----------------------------
=> Announcements
=> Presales
=> Support
===> Bugs
===> Feature Requests
-----------------------------
Downloads System Pro
-----------------------------
=> Announcements
=> Presales
=> Support
===> Feature Requests
===> Bugs
-----------------------------
Ad Seller Pro
-----------------------------
=> Presales
=> Support
-----------------------------
Menu Editor Pro
-----------------------------
=> Presales Menu Editor Pro
=> Bug Reports
-----------------------------
Inline Personal Messages
-----------------------------
=> Presales
=> Support
=> Bug Reports
-----------------------------
Newsletter Pro
-----------------------------
=> Presales
=> Support
===> Feature Requests
-----------------------------
Badge Awards
-----------------------------
=> Presales
=> Support
-----------------------------
Tweet Topics/FB Post System
-----------------------------
=> Presales
-----------------------------
Social Login Pro
-----------------------------
=> Presales
-----------------------------
SMF Gallery Lite
-----------------------------
=> SMF Gallery Lite
-----------------------------
Modifications/Themes
-----------------------------
=> General SMF Forum
=> Modifications Talk
===> Latest Mods
===> Modification Showcase
=> Theme Talk
===> Theme Showcase
===> Latest Themes
Recent
WhatÄs this?
by
Labradoodle-360
[
Today
at 01:36:26 pm]
A few problems with Ad Se...
by
SeppoK
[
Today
at 03:45:00 am]
Can "Ad Seller Pro" do it...
by
SMFHacks
[June 18, 2013, 07:27:33 am]
Feature Requests for SMF ...
by
BSD2000
[June 18, 2013, 06:10:04 am]
paid auctions
by
SMFHacks
[June 17, 2013, 12:27:50 pm]
Wow
by
Nicole
[June 16, 2013, 08:17:21 pm]
Modification allowing Adm...
by
AcEAndroid
[June 15, 2013, 08:34:38 pm]
Setting up Ad Seller Pro ...
by
steelhead
[June 14, 2013, 10:28:18 pm]
Left/right side of a mess...
by
SMFHacks
[June 13, 2013, 11:00:52 pm]
Show New Classifieds list...
by
amwebby
[June 12, 2013, 03:37:47 am]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Loading...