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 18, 2013, 03:10:46 am
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Stats
Members
Total Members: 10755
Latest:
henrywilliams0173
Stats
Total Posts: 32348
Total Topics: 5473
Online Today: 50
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 44
Total: 44
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
...
8
Author
Topic: Random Image in Block? (Read 78786 times)
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #15 on:
October 04, 2006, 07:13:27 am »
is there a way to make it universal because i couldnt figger it out so that code only works for my site but if any one wont to use it just change all the
www.mib4life.com:8080
to your site address
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #16 on:
October 04, 2006, 07:43:02 am »
nevermind i figgered it out i just forgot the a global lol heres the universal code
Code:
function ssi_grandom ($cat)
{
global $scripturl,$modSettings,$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="<?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>
Logged
jklapp
Inline PM Customer
Offline
Posts: 45
Re: Random Image in Block?
«
Reply #17 on:
October 09, 2006, 11:17:30 pm »
Quote from: usermike3969 on October 03, 2006, 07:33:17 pm
in ssi.php
Find :
Code:
?>
I'm confused... Could you explain this in more detail? ... Thank you
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #18 on:
October 10, 2006, 08:24:11 am »
Quote from: jklapp on October 09, 2006, 11:17:30 pm
Quote from: usermike3969 on October 03, 2006, 07:33:17 pm
in ssi.php
Find :
Code:
?>
I'm confused... Could you explain this in more detail? ... Thank you
if u look in your forums dir and find ssi.php and open it in a editor or notepad at the very bottem u will find ?> then place the code i gave right befor it
Logged
jklapp
Inline PM Customer
Offline
Posts: 45
Re: Random Image in Block?
«
Reply #19 on:
October 10, 2006, 10:41:08 am »
For some reason it's not working... I'm not getting a picture in the block (only an empty space where the image should be) But if I click-on the empty space, it does take me to the image that should be showing.
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 10987
Re: Random Image in Block?
«
Reply #20 on:
October 10, 2006, 10:50:31 am »
Yeah that is not the full random image. I have a good one in the paid section.
This one is missing the path to the images if you never set it.
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #21 on:
October 10, 2006, 11:17:42 am »
try this
Code:
function ssi_grandom ($cat)
{
global $scripturl,$modSettings,$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="',$modSettings['gallery_url'], $row['thumbfilename'] ,'" /></a>';
Logged
jklapp
Inline PM Customer
Offline
Posts: 45
Re: Random Image in Block?
«
Reply #22 on:
October 10, 2006, 12:13:02 pm »
No.. That gives this error
Quote
Parse error: parse error in D:\Inetpub\akronsanctuary\smf\SSI.php on line 1642
Logged
jklapp
Inline PM Customer
Offline
Posts: 45
Re: Random Image in Block?
«
Reply #23 on:
October 10, 2006, 12:15:57 pm »
What I need to do is talk to the Church people and get someone to donate this mod for the Church site
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #24 on:
October 10, 2006, 12:17:48 pm »
sorry i fixed it i forgot the } at the end of the code
Code:
function ssi_grandom ($cat)
{
global $scripturl,$modSettings,$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="',$modSettings['gallery_url'], $row['thumbfilename'] ,'" /></a>';
}
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #25 on:
October 10, 2006, 12:29:07 pm »
whats the url to your site if u dont mind me asking
Logged
jklapp
Inline PM Customer
Offline
Posts: 45
Re: Random Image in Block?
«
Reply #26 on:
October 10, 2006, 12:38:32 pm »
Wow... Thank you
That really works nice
I'm thinking about changing our Church site from Enigma 2.0 to Tiny Portal, so I've been testing mods.
Right now I'm using Gallery 2, but I'm starting to like this Gallery.
Our website is
www.akronsanctuary.com
This is Enigma 2.0. The test site is not accessable from the net right now.
Logged
Maya
Inline PM Customer
Offline
Posts: 19
Re: Random Image in Block?
«
Reply #27 on:
October 10, 2006, 04:15:55 pm »
I am trying to get this to go, without much luck.
2 questions, if I may...
I got the code in the ssi.php okay... I would like to run this in a front page block ( using tp.95 and rc3) ,
1. Do I create a 'script block', and paste the code in there, ( in an ssi block there is no option for the code snippet ) ?
In other words... what type of block should I create?
2. If I wanted to change from just 1 image to say a block in the center showing 3 or 4...is this as simple as instead of 'Limit_1' in the code to say 'Limit_3' ?
tia
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 10987
Re: Random Image in Block?
«
Reply #28 on:
October 10, 2006, 04:42:05 pm »
1. it would be a php block.
2. Very close that is part of it but you need to add a loop as well.
Logged
xface
Inline PM Customer
Offline
Posts: 16
Re: Random Image in Block?
«
Reply #29 on:
October 12, 2006, 03:42:46 am »
so cool! those linking codes I could not get to work, but hell of an idea!!! thanks for this code, its helped alot!!!
Logged
Pages:
1
[
2
]
3
4
...
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
Feature Requests for SMF ...
by
Secure
[May 16, 2013, 10:13:46 pm]
stuck on "Processing" scr...
by
SMFHacks
[May 15, 2013, 11:32:14 pm]
[Request] - Award for any...
by
SMFHacks
[May 15, 2013, 11:31:24 pm]
SMF Gallery Pro 5.0.1 not...
by
SMFHacks
[May 12, 2013, 09:10:43 am]
Golf Theme
by
Serglike
[May 10, 2013, 03:49:55 am]
Display ads on every page...
by
SMFHacks
[May 07, 2013, 07:12:40 pm]
Edited simple ad code and...
by
ApplianceJunk
[May 07, 2013, 02:37:14 pm]
"non" error on bulk uploa...
by
SMFHacks
[May 06, 2013, 10:29:56 pm]
Can I give member an ad p...
by
fernowl
[May 04, 2013, 03:22:01 pm]
How to configure the Auto...
by
SMFHacks
[May 04, 2013, 01:08:57 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Loading...