TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 03:59:33 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 57
  • Total: 57

SMF Gallery Block

Started by HaxXxoR, September 19, 2006, 06:50:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JPDeni

Looks like I missed a single quote. Let's try again.

$query = db_query(
        "SELECT *  FROM `{$db_prefix}gallery_pic`
         WHERE approved = '1'
         ORDER BY Date DESC
         LIMIT 1", __FILE__, __LINE__);
$latest_pic = mysql_fetch_assoc($query);

echo '<img src="url/to/image/directory/"' . $latest_pic['filename'] . 'height="' $latest_pic['height'] . ' width="' . $latest_pic['width'] '">';

Thurnok

more than one ;)

Plus, don't forget the global statement:

global $db_prefix;
$query = db_query(
"SELECT * FROM `{$db_prefix}gallery_pic`
WHERE approved = '1'
ORDER BY Date DESC
LIMIT 1", __FILE__, __LINE__);
$latest_pic = mysql_fetch_assoc($query);

echo '<img src="url/to/image/directory/"' . $latest_pic['filename'] . ' height="' . $latest_pic['height'] . ' width="' . $latest_pic['width'] . '">';

JPDeni

I should know better than to try to write code in these little boxes. Thanks, Thurnok.

HaxXxoR

This is what i put in and nothing happened.

global $db_prefix;
$query = db_query(
"SELECT * FROM `{$db_prefix}gallery_pic`
WHERE approved = '1'
ORDER BY Date DESC
LIMIT 1", __FILE__, __LINE__);
$latest_pic = mysql_fetch_assoc($query);

echo '<img src="http://www.Tasty-Fragism.com/forum/gallery/"' . $latest_pic['filename'] . ' height="' . $latest_pic['height'] . ' width="' . $latest_pic['width'] . '">';

JPDeni

The trouble is that I can't test it because I don't have it installed. I normally don't post code that I haven't tested on my own site and I've got all sorts of little things that I do to troubleshoot when it doesn't work as I expect it to.

First, look at the source code for the page and see what is printed in the block. That should tell us a whole lot.

G6Cad

As all mods we have to ask you to search the mod author for help with issues regarding the mods they build.

Thurnok

@historyhunter - vbgamer45 has made about 6 updates just in the past week to SMF Gallery.  Might want to check back for a newer version to see if it is fixed.  It is certainly not bug free, but it is looking pretty good so far.  I'm sure in the next few weeks there will be a fairly stable version of it.

exerciseforum

hmmm I cant get it work :( has any body got this working on there site?

JDMhustle

Yep... just for a limited time, i'm still working on the gallery ;)

http://forum.sirfanaticsholland.com/index.php

exerciseforum

Ye thats excellent  :up: now cud i see the box code ? and what bits you edited to your setup..

Thanks alot be great to have it on my site too  :laugh: