Media Center

Started by JayBachatero, December 02, 2006, 12:43:49 AM

Previous topic - Next topic

JayBachatero

Link to Mod
Rate this Mod

Media Center Mod

Description
This mod will show forum attachments in a centralized location.  The mod is broken up into 3 sections; Music, Videos and Images.  They all check the users permission for the boards that they are allowed to see.  If they can't see a certain board then they can't see the attachment.  Each section has it's own permission.

Features
- Categorize attachments by media type into one location.
- The sections are Music, Movies and Images
- Each section has its own permission for maximum flexibility.
- Users only see attachments for the boards that they have permission to see.
- Uses advance sorting method in queries for maximum speed optimization.
- Stores the ID_ATTACH into cache for query optimization.
- Ability to format and clean names.  TRACK_01.mp3 would become Track 01.mp3.
- Uses thumbnails to show images previews.  If there is no thumb image it gets the default image if the image is smaller than the thumbnail settings.
- Caches the attachments to save bandwidth.

Hidden Features

Copyright
Images used by this mod are copyrighted by m3talc0re.

Legend
! Bug fixes
+ Feature addition

Changelog
12/06/06 - Beta 3
! When sorting make sure to keep all the parameters from the previous page. (MediaCenter.php, MediaCenter.template.php)
! Make sure that the members can see the Media Center button if they are allowed to see atleast one section. (MediaCenter.php)
! $user_info variable was missing from the global scope in RequestFile() function causing the file downloads to fail. (MediaCenter.php)

12/04/06 - Beta 2
+ Added permission for Custom Sections support (MediaCenter.php)
+ Added extra mime type headers to support other sections. (MediaCenter.php)
+ Added support to simplify the addition of extra sections.
+ Added option to only show attachments from a specific board (MediaCenter.php)
! Send only one Content-Type header when downloading an attachment (MediaCenter.php)
! Make sure to check to see if the user is allowed to see the board the attachment is on before downloading. (MediaCenter.php)

12/01/06 - Beta 1
! Having a leading comma in ManagePermissions.php caused PHP to return an error at times.
! Some themes make links too ovious making the easter egg show up so linked ( : ) was removed. (MediaCenter.php, MediaCenter template)

12/01/06
! Initial release
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

vbgamer45

Great mod I am going to be using this one soon. Finally an easy way for people to see all the attachs on the forums without having to search the topics for the attachments.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

JayBachatero

Umm forgot to document this but there is a hidden feature that you can get the attachments for an array of specific topics.  Just add ;mediatopics=1,165,625.  Each topic is separated by a comma.  If ;mediatopics does work try ;mediatopic.  I will document this tomorrow.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

littlefeather

QuoteUmm forgot to document this but there is a hidden feature that you can get the attachments for an array of specific topics.  Just add ;mediatopics=1,165,625.  Each topic is separated by a comma.  If ;mediatopics does work try ;mediatopic.  I will document this tomorrow.
Will wait for a bit more info on this, but have downloaded, and will play with this one a bit tonight. If this has the capabilities I think it does, this is one awesome mod Jay... :)

Panzer-

looks good, cant wait to install it :)

Auxsom

Why is there a video called "Monkey" in this mod???

Pages: [1]

The : puts a youtube video called monkey?

WHY?

I didn't ask for hidden annoyances  >:(

WarBirD

After installing this Mod i have the following when I want to take a look at the permissions in the administration.

Quote
Parse error: parse error, unexpected ',', expecting ')' in /path/to/my/website/forums/httpdocs/Sources/ManagePermissions.php on line 1336

That wasn´t before I installed the Mod. Whats that and how can I fix it ?

WarBirD

Ok, for some reason the Mod changed that file not entirely correct. It added a "," into line 1336, which was not supposed to be. After I remove that, it worked fine again.

MartinB

Installation went to super, but after the call, an error message appears.
Fatal error: Call to undefined function: () in \xampp\htdocs\community\Sources\Load.php(1710) : eval()'d code on line 218

here is cut out of the file

line 215 --> if ($dont_do_it > $modSettings['autoOptMaxOnline'])
line 216 --> return;
line 217 --> }
line 218 -->
line 219 --> // Handle if things are prefixed with a database name.
line 220 --> if (preg_match('~^`(.+?)`\.(.+?)$~', $db_prefix, $match) != 0)
line 221 --> {
line 222 --> $request = db_query("
line 223 --> SHOW TABLES
line 224 --> FROM `" . strtr($match[1], array('`' => '')) . "`
line 225 --> LIKE '" . str_replace('_', '\_', $match[2]) . "%'", __FILE__, __LINE__);


Sorry for my English

JayBachatero

Auxsom - That's supposed to be a hidden easteregg but it seems that some themes make links too damn visible.  I'll remove it though.  Sorry if it annoyed you.

WarBird - It seems that some versions of PHP goes nuts when arrays have a leading ",".  I had similar problem when I was working on the mod site here.  I'll change this later on today.

MartinB - This mod ONLY works with 1.1 RC3 and 1.1 Final.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

keith021773

Just to make sure..  It won't work on rc2?

JayBachatero

No it will not work on RC2.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

keith021773

Ok.. Thanks.   I still haven't gotten my nerve up yet to upgrade to rc3.   LOL

fiver

QuoteThe mod is broken up into 3 sections; Music, Videos and Images

Hi Jay,

How about one for files or documents? (pdf, doc, xls)

Thanks.

JayBachatero

#14
Quote from: fivearts on December 02, 2006, 11:29:03 AM
QuoteThe mod is broken up into 3 sections; Music, Videos and Images

Hi Jay,

How about one for files or documents? (pdf, doc, xls)

Thanks.

Well with some modification it can be done.  Just that this is a Media Center as in music videos and images :P.  I haven't tried it but you can try adding
Code (MediaCenter.php) Select

'pdf' => array(
'title' => $txt['media_tabs_pdf'],
'sub_template' => 'media',
'fileTypes' => array('pdf'),
'href' => $scripturl . '?action=mediacenter;sa=pdf',
'is_allowed' => $context['can_listen'],
),


Code (MediaCenter.english.php) Select

$txt['media_tabs_pdf'] = 'PDF';
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

JayBachatero

Ok released RC1 and fixed the easter egg issue and the other error on ManagePermissions.php.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

RvG

jay... on a fresh install smf 1.1:

Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Code    install.php    
2.    Execute Modification    ./index.php    Test successful
3.    Execute Modification    ./Sources/Subs.php    Test successful
4.    Execute Modification    ./Sources/Who.php    Test successful
5.    Execute Modification    ./Sources/ManagePermissions.php    Test failed
6.    Execute Modification    ./Sources/ModSettings.php    Test successful
7.    Execute Modification    ./Themes/default/index.template.php    Test successful
8.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
9.    Execute Modification    ./Themes/default/languages/ManagePermissions.english.php    Test successful
10.    Execute Modification    ./Themes/default/languages/Errors.english.php    Test successful
11.    Execute Modification    ./Themes/default/languages/Help.english.php    Test successful
12.    Extract File    ./Sources/MediaCenter.php    
13.    Extract File    ./Themes/default/MediaCenter.template.php    
14.    Extract File    ./Themes/default/languages/MediaCenter.english.php    
15.    Extract File    ./Themes/default/images/media_no_thumb.gif    
16.    Extract File    ./Themes/default/images/icons/media_audio.gif    
17.    Extract File    ./Themes/default/images/icons/media_video.gif    
18.    Extract File    ./Themes/default/images/icons/media_image.gif    
19.    Extract File    ./Themes/default/images/icons/media_download.gif

nitins60

I think, m talking about v1.1 of this mod, will come soon from this MONKEY?.

Features:
* support to all type @files (.pdf .zip...)
*  feature of which type files to be shown.

can i expect it soon as Download Center!

nitins60

I think, m talking about v1.1 of this mod, will come soon from this MONKEY? :-) .

Features:
* support to all type @files (.pdf .zip...)
*  feature of which type files to be shown.

can i expect it soon as Download Center! ;)

JayBachatero

RvG I'll have to look into it.  Seems that the "error" that I fixed with the commas is not working on some versions. >_</

nitins60 I'll make this mod more modular since its easy to add new categories but I will not make this a download mod.  Its a media center mod.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: