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
.
May 24, 2013, 05:33:38 am
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Stats
Members
Total Members: 10768
Latest:
CayoTTe
Stats
Total Posts: 32395
Total Topics: 5480
Online Today: 48
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 58
Total: 58
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
...
8
Author
Topic: Random Image in Block? (Read 78834 times)
jklapp
Inline PM Customer
Offline
Posts: 45
Random Image in Block?
«
on:
September 22, 2006, 06:40:03 pm »
Can a random image be put in a block with SMF Gallery ?
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 11003
Re: Random Image in Block?
«
Reply #1 on:
September 22, 2006, 06:48:38 pm »
You mean like a random image block for like tiny portal?
Just a box with a random image?
«
Last Edit: September 22, 2006, 07:43:53 pm by SMFHacks
»
Logged
jklapp
Inline PM Customer
Offline
Posts: 45
Re: Random Image in Block?
«
Reply #2 on:
September 22, 2006, 09:23:44 pm »
Yes
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 11003
Re: Random Image in Block?
«
Reply #3 on:
September 22, 2006, 09:30:06 pm »
Yeah that wouldn't hard to do I could supply some TP codes later on.
Logged
jklapp
Inline PM Customer
Offline
Posts: 45
Re: Random Image in Block?
«
Reply #4 on:
September 22, 2006, 10:06:32 pm »
Thank would be great!!! Thank you
Logged
BrocLee
Inline PM Customer
Offline
Posts: 5
Re: Random Image in Block?
«
Reply #5 on:
September 29, 2006, 11:09:28 am »
Yeah, that would be a cool addition
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #6 on:
October 03, 2006, 03:21:29 am »
i have a code that i use iin ssi.php that will show random imgs from what ever cat u wont
is it ok to put it here for everyone or is it something that u r doing for pro ver. only
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #7 on:
October 03, 2006, 03:52:17 am »
heres a live demo
www.mib4life.com:8080
on the left side 2nd block also with it being a ssi function u can use it even if your not using tportal
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 11003
Re: Random Image in Block?
«
Reply #8 on:
October 03, 2006, 06:35:49 pm »
Ah, I see it now the sig spotlight
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #9 on:
October 03, 2006, 06:44:14 pm »
......so can i post the code here ?
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 11003
Re: Random Image in Block?
«
Reply #10 on:
October 03, 2006, 07:17:55 pm »
I don't mind.
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #11 on:
October 03, 2006, 07:33:17 pm »
ok thanks....here it is
in ssi.php
Find :
Code:
?>
Place before :
Code:
function ssi_grandom ($cat)
{
mysql_select_db($db_name);
$query = "SELECT `thumbfilename`,`ID_CAT`,`ID_PICTURE` FROM `smf_gallery_pic` WHERE `ID_CAT`='$cat' GROUP BY `thumbfilename` ORDER BY RAND() LIMIT 1";
$request = mysql_query($query);
while($row = mysql_fetch_array($request, MYSQL_ASSOC))
echo' <a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row['ID_PICTURE'] . '"><img src="/gallery/'. $row['thumbfilename'] . '" />';}
then put in a php block ssi_grandom(2); where the 2 = cat number
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 11003
Re: Random Image in Block?
«
Reply #12 on:
October 03, 2006, 07:55:34 pm »
Nice work,
I updated it a little
Code:
function ssi_grandom ($cat)
{
global $scripturl,$db_prefix;
$cat = (int) $cat;
$request = db_query("SELECT thumbfilename, ID_CAT, ID_PICTURE FROM {$db_prefix}gallery_pic WHERE ID_CAT = $cat GROUP BY thumbfilename ORDER BY RAND() LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($request);
mysql_free_result($request);
echo' <a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="/gallery/', $row['thumbfilename'] ,'" />'
;}
«
Last Edit: October 03, 2006, 07:57:36 pm by SMFHacks
»
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #13 on:
October 03, 2006, 08:54:57 pm »
cool thanks
i am not very good with php i didnt even know any php like 6 mo. ago and that was the first little code that i did on my own
again thanks for fixing it
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #14 on:
October 04, 2006, 07:07:05 am »
How about this ? It puts the linking codes below the thumb
Code:
function ssi_grandom ($cat)
{
global $scripturl,$db_prefix;
$cat = (int) $cat;
$request = db_query("SELECT thumbfilename, filename, ID_CAT, ID_PICTURE FROM {$db_prefix}gallery_pic WHERE ID_CAT = $cat GROUP BY thumbfilename ORDER BY RAND() LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_assoc($request);
mysql_free_result($request);
echo' <a href="', $scripturl, '?action=gallery;sa=view;id=', $row['ID_PICTURE'], '"><img src="/gallery/', $row['thumbfilename'] ,'" /></a>';
?><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="http://mib4life.com:8080/gallery/thumb_<?echo $row['filename'];?>"> ');
tmp.write('</br></br>HTML</br><img src="http://mib4life.com:8080/gallery/<?echo $row['filename']; ?>">');
tmp.write('</br></br>BBC THUMB</br>[img]http://mib4life.com:8080/gallery/thumb_<?echo $row['filename'];?>[/img]');
tmp.write('</br></br>BBC</br>[img]http://mib4life.com:8080/gallery/<?echo $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>
<?
}
Logged
Pages:
[
1
]
2
3
...
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
Why i need a PP-Business-...
by
SMFHacks
[May 23, 2013, 08:29:56 pm]
Simple Audio Video Embede...
by
tuberose
[May 23, 2013, 04:50:21 am]
news letter pro cant find...
by
ozzie4x4
[May 22, 2013, 10:03:30 pm]
Automated newsletter of r...
by
SMFHacks
[May 22, 2013, 03:00:09 pm]
Help me program these awa...
by
Draffi
[May 22, 2013, 03:03:31 am]
Code for ultimate Profile
by
Draffi
[May 21, 2013, 03:27:16 pm]
Parent and children Badge...
by
Draffi
[May 21, 2013, 02:11:10 pm]
Badge block
by
Draffi
[May 21, 2013, 01:18:58 pm]
[Request] - Award for any...
by
SMFHacks
[May 21, 2013, 12:22:02 am]
Changing the font
by
SMFHacks
[May 21, 2013, 12:20:41 am]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Loading...