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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 247
  • Total: 247

[Block] Recent activity block for SMF Media Gallery

Started by zambo92, September 01, 2009, 01:23:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JPDeni

Sorry. The last character didn't get copied over. It's there now.

zambo92

thats awesome, thank you very much, just one more thing, i would like to center that, so they'd be in the middle rather than on the left side of my page :P

JPDeni


global $scripturl, $db_prefix;

$limit = 5; // Set how many you want to display here
// Grab the media details..
$request = db_query("
SELECT n.name, m.id_media, m.id_member, m.title, m.album_id, m.member_name, m.views
FROM {$db_prefix}mgallery_media m
INNER JOIN {$db_prefix}mgallery_albums n ON m.album_id = n.id_album
WHERE m.approved = 1
ORDER BY m.time_added DESC LIMIT $limit", __FILE__,__LINE__);
echo '<center><table><tr>';
while ($row = mysql_fetch_assoc($request)) {

// Output the item..
echo '
<td style="text-align:center">
<p style="margin:0px">
<a href="' , $scripturl , '?action=mgallery;sa=item;id=' , $row['id_media'] , '">' , $row['title'] , '</a><br />
<a href="' , $scripturl , '?action=mgallery;sa=item;id=' , $row['id_media'] , '"><img alt="" src="' , $scripturl . '?action=mgallery;sa=media;id=' , $row['id_media'] , ';thumb" /></a><br />
In : <a href="' , $scripturl , '?action=mgallery;sa=album;id=' , $row['album_id'] , '">' , $row['name'] , '</a><br />
Added by : <a href="' , $scripturl , '?action=profile;u=' , $row['id_member'] , '">' , $row['member_name'] , '</a><br />
' , $row['views'] , ($row['views'] == 1 ? ' view' : ' views') , '
</p>
</td>
';
}
echo '</tr></table></center>';
mysql_free_result($request);

zambo92

and also, is there a way to put a border around them individually so they dont look like they're merging together? xD



JPDeni

There are patterns in the code if you just look for them, but rather than have 10 more posts about this, I'll spell it out.

Replace


echo '<center><table><tr>';


with


echo '<center><table border=1><tr>';


zambo92


IchBin

Quote from: zambo92 on September 01, 2009, 10:46:24 PM
well i know what i want, the code you changed was what i wanted however it caused them to line up vertically when i wanted them horizontally :P
could you just fix that please?
10 posts later.... lmao!

G6Cad

Quote from: IchBinâ„¢ on September 02, 2009, 05:25:15 AM
Quote from: zambo92 on September 01, 2009, 10:46:24 PM
well i know what i want, the code you changed was what i wanted however it caused them to line up vertically when i wanted them horizontally :P
could you just fix that please?
10 posts later.... lmao!

My exact thought to..
Awsome tolerance JP Deni, a big rose for you to day :)

This website is proudly hosted on Crocweb Cloud Website Hosting.