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: 303
  • Total: 303

[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.

zambo92

sorry... anyway, can you guys please help me? :)
and i hope you know what im trying to ask of you guys to help me with

JPDeni

freddy will work on it for you, since he has the gallery installed. Just give him a little bit of time.

zambo92

ahh ok, no problemo... thank you very much ^_^

Freddy

Thanks JP :)

Hi zambo,

Ok just tell me for now what you want to display in this block.

You will of course want a thumbnail...do you also want :

1) The title ?
2) The member name of who submitted it ?
3) Do you want this to link to the item in the gallery too ?
4) Anything else ?

That should do for now..

zambo92

yes, a thumbnail, title, views, name of person who submitted it, and what album its from. (so if it were a one piece episode, it'd say 'One Piece')

Freddy

OK zambo thanks - I will start working on that now.

zambo92

awesome, thanks very much freddy :D

Freddy

#17
OK this seems to work, I've tested it with various media and it seems OK :

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__);

while ($row = mysql_fetch_assoc($request)) {

// Output the item..
echo '
<div 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>
</div>
';
}
mysql_free_result($request);


Let me know how you get on :)

zambo92

could you make it so that when it says 'In: Basquash' rather than 'In Basquash' ?
and the same for the person who added it, please :)

zambo92

#19
and also, instead of 'by' can you change it to 'Added by: ' :D
and make it appear in my main forum too?

This website is proudly hosted on Crocweb Cloud Website Hosting.