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, 08:32:19 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: 32565
Total Topics: 5509
Online Today: 58
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 49
Total: 49
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 79512 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: 11053
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: 11053
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: 11053
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: 11053
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: 11053
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
Badge block
by
SMFHacks
[
Today
at 07:25:45 pm]
Rebadging after install
by
SMFHacks
[
Today
at 07:19:48 pm]
Showing Badge Icons on Bo...
by
Draffi
[
Today
at 06:00:40 pm]
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]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Loading...