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, 05:34:49 pm
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Stats
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: 33
Total: 33
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
...
8
Author
Topic: Random Image in Block? (Read 78790 times)
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #30 on:
October 12, 2006, 04:24:45 am »
what happen when u tried the linking codes
Logged
xface
Inline PM Customer
Offline
Posts: 16
Re: Random Image in Block?
«
Reply #31 on:
October 12, 2006, 12:05:35 pm »
fatal error, but I think I might have screwed something up there. I will try it again today now that I have a few hours of sleep under my belt.
I will let you know how it turns out...
Logged
Maya
Inline PM Customer
Offline
Posts: 19
Re: Random Image in Block?
«
Reply #32 on:
October 12, 2006, 01:33:24 pm »
I, understand code, but don't know how to write code, yet
, so I am just content to get this working for now with 1 image...figure the rest out later
lol... not havin fun here...no biggie, just trying this on a test site till I see something work..
heres what I have done..
added the code to the ssi.php
created a php block (thnx btw)
and heres what I get...
Quote
Fatal error: Cannot redeclare ssi_grandom() (previously declared in /home/talk/public_html/test/SSI.php:1595) in /home/talk/public_html/test/Sources/Load.php(1708) : eval()'d code(35) : eval()'d code on line 1
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 10987
Re: Random Image in Block?
«
Reply #33 on:
October 12, 2006, 01:41:33 pm »
What are you putting in the php block?
Logged
Maya
Inline PM Customer
Offline
Posts: 19
Re: Random Image in Block?
«
Reply #34 on:
October 12, 2006, 02:14:36 pm »
...k..( sorry Im workin on about 10 different thing right now...)
I pasted the wrong code in...
(its ok btw, I have just finished a slew of nasty words dericted to self....lol)
now I have put the correct call in the php box
ssi_grandom(2);
I removed the 2 to just make it ();
(if no cat is defined will it just call from all categories ?)
but get a red x...
it is trying to call the image from
http://mysite/gallery
and I need it to call them from mysite/test/gallery...
Is that back in the ssi.php code I put in...?
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #35 on:
October 12, 2006, 03:04:40 pm »
r u using the last code i gave here ??
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 10987
Re: Random Image in Block?
«
Reply #36 on:
October 12, 2006, 03:17:02 pm »
This is correct code you all should use
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 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
xface
Inline PM Customer
Offline
Posts: 16
Re: Random Image in Block?
«
Reply #37 on:
October 12, 2006, 03:30:32 pm »
yeah that is the correct code it works awesome.
What I liked about the other code was the linking codes. This would allow members of mine to host the photo at another forum, and in turn drag other visitor's to my site.....
I have not tryed the linking codes version posted earlier yet today, been to busy sleeping...LOL
Logged
Maya
Inline PM Customer
Offline
Posts: 19
Re: Random Image in Block?
«
Reply #38 on:
October 12, 2006, 03:48:57 pm »
actually the code i had posted was
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>';
}
(this code got the pics well the red x showing..
I just replaced it with the code u posted and i am back to
Quote
Fatal error: Call to undefined function: ssi_grandom() in /home/talk/public_html/test/Sources/Load.php(1708) : eval()'d code(35) : eval()'d code on line 1
phpbox with "ssi_grandom(); "
Logged
SMFHacks
Administrator
Hero Member
Offline
Posts: 10987
Re: Random Image in Block?
«
Reply #39 on:
October 12, 2006, 03:50:26 pm »
If you use my code then you would put ssi_galleryrandom(); in the php box
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #40 on:
October 12, 2006, 04:00:17 pm »
Maya is what u wont to do is like what i have on my main page in the center at the bottem ??
Logged
Maya
Inline PM Customer
Offline
Posts: 19
Re: Random Image in Block?
«
Reply #41 on:
October 12, 2006, 04:07:26 pm »
Perfect...
thank you...it works very well
Yes that is exactly what I want to do...a few adjustment for my site( and maybe without the info on bottom, but yes...
*btw thanks for the test for me...
Logged
usermike3969
Inline PM Customer
Offline
Posts: 28
Re: Random Image in Block?
«
Reply #42 on:
October 12, 2006, 04:10:38 pm »
Code:
function ssi_g3random ()
{global $db_prefix, $scripturl, $txt, $context,$ID_MEMBER,$modSettings, $boarddir,$boardurl;
echo'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%"><tr>';
$request10 = db_query("SELECT z.ID_PICTURE, z.commenttotal, z.filesize, z.views, z.thumbfilename, z.title, z.ID_MEMBER, x.memberName, x.realName, z.date, z.description FROM {$db_prefix}gallery_pic as z, {$db_prefix}members AS x WHERE approved = 1 GROUP BY date ORDER BY RAND() DESC LIMIT 3", __FILE__, __LINE__);
while ($row10 = mysql_fetch_assoc($request10))
{
echo'<td align="center" colspan="3"></br><a href="' . $scripturl . '?action=gallery;sa=view;id=' . $row10['ID_PICTURE'] . '"><img src="' . $modSettings['gallery_url'] . $row10['thumbfilename'] . '" /></a></br>';
}
mysql_free_result($request10);
echo'</td></tr>';
echo'</table></br>';
}
this is the code i used but mite not b the best way
Logged
Maya
Inline PM Customer
Offline
Posts: 19
Re: Random Image in Block?
«
Reply #43 on:
October 12, 2006, 05:46:58 pm »
no dice...
back to parse error on fp
Parse error: syntax error, unexpected $end in /home/talk/public_html/test/Sources/Load.php(1708) : eval()'d code(35) : eval()'d code on line 1
when I changed this in the ssi,
I changed what i put in the php box to match
ssi_g3random ()
then back... hmmm
Logged
Jpg
Inline PM Customer
Offline
Posts: 25
I love cats they taste like chicken!!
Re: Random Image in Block?
«
Reply #44 on:
October 12, 2006, 06:58:15 pm »
I'll help everyone out. I modified SMF Hack's code and made it center when it a block.. No biggy.
USE THIS ONE
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 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>'
;}
Put this in a
PHP
block.
Code:
ssi_galleryrandom();
Logged
Pages:
1
2
[
3
]
4
5
...
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...