News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Media Center

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

Previous topic - Next topic

SaltedWeb

Still never got it to work on a clean modeless install.
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

tsmalmbe

I donät know if this is a bug or a feature. But here goes.

To get uploads and downloads in general to work, I had to modify these in php.ini:
- upload_max_filesize
- post_max_size

Now, with large enought values, I can upload and download from my posts. Then I installed the mediacenter. All looks fine. BUT. Any file largern than approximately 5MB can not be "streamed" NOR downloaded. Somehow the mediacenter uses a totally different approache to getting the file to the browser tah the "normal" download from a post, right?

The "solution" was to set the variable memory_limit in php.ini to a large value. This is OK in my development environment, but my webhost is not changing this value. It poses a security risk with bad scripts hogging memory etc. etc. etc. I agree, I think.

Can this be fixed - where in the code is the part with dl'ing and "streaming" located?

This is a really nasty limitation.

Thanks for any discussion regarding this.
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

dakotaroar

I don't think you needed to mess with upload_max_filesize or post_max_size directly.

When you say streaming, do you mean that you have media that is designed to stream, or just media that typically plays within the browser window?  As far as I know, Media Center just links to the file, and it's up to the user to have the right thing to view it.
The only forum for students in North and South Dakota!  Campus Dakota.

JayBachatero

Quote from: Michelle_Reed on February 20, 2007, 10:54:53 AM
My request/question is,is there any way I can make this mod sort by date rather than name? I really need it to be a recent downloads section for my site. I can edit the code myself if given instruction, I just can't write the code :p

Also is there any way to change the name of the media center main button and would you mind if I did this?
Code (find) Select

// Sort by filename asc.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'filename';
$_REQUEST['sort'] = 'att.filename';
$ascending = true;
}

Code (replace) Select

// Sort by filename asc.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'posterTime';
$_REQUEST['sort'] = 'm.posterTime';
$ascending = true;
}

To change the "Media Center" text in the tab just edit the Modifications.english.php file.

Quote from: dakotaroar on February 20, 2007, 11:11:40 AM
I've been trying to get someone to help me with this for a while.
What error are you exactly having?

Quote from: Diamondcomputer on February 20, 2007, 11:17:54 AM
Still never got it to work on a clean modeless install.
What version of SMF are you using?

tsmalmbe this mod uses an identical function like SMF's default download function.  So it should work with bigger files.  Also there is no need to modify those value sin the php.ini file.
Follow me on Twitter

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

tsmalmbe

Quotetsmalmbe this mod uses an identical function like SMF's default download function.  So it should work with bigger files.  Also there is no need to modify those value sin the php.ini file.

OK. But the fact remains on my site. Changing the values makes a difference. And the "default download" and the mediacenter download behaves differently. I will reset the default php.ini values in my development environent, re-create the issua and post the logs.
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

RoarinRow

Does anyone with a lot of pictures notice any performance issues?  Our site has a lot of attachments, just wondering if notice a big slow down rendering the pictures through this mod.

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

zargs

Dose it work whit 1.1.2? And is so how do I get it to work?

WhatsUp

Quote from: RoarinRow on February 22, 2007, 01:19:21 PM
Does anyone with a lot of pictures notice any performance issues?  Our site has a lot of attachments, just wondering if notice a big slow down rendering the pictures through this mod.
My understanding is that the mod does not create the attachment files, it merely presents the files already attached, as per the settings.
As it does not create new files, how could these non-existent files cause the site to slow appreciably?

The only time speed is an issue is when the user views the mod.

For file types that are merely listed (as with PDFs that I use the mod for), little data is being passed. For images, this will depend on the thumbnail size you have set for your site. Mine is set for 600 px, which I think is reasonable.
History Hunters: http://historyhuntersinternational.org/
Enter: test/test
SMF and TinyPortal

RoarinRow

Quote from: WhatsUp on February 22, 2007, 02:09:39 PM
Quote from: RoarinRow on February 22, 2007, 01:19:21 PM
Does anyone with a lot of pictures notice any performance issues?  Our site has a lot of attachments, just wondering if notice a big slow down rendering the pictures through this mod.
My understanding is that the mod does not create the attachment files, it merely presents the files already attached, as per the settings.
As it does not create new files, how could these non-existent files cause the site to slow appreciably?

The only time speed is an issue is when the user views the mod.

For file types that are merely listed (as with PDFs that I use the mod for), little data is being passed. For images, this will depend on the thumbnail size you have set for your site. Mine is set for 600 px, which I think is reasonable.

thanks for the clarification   8)

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

tsmalmbe

Some debugging info about the parameters I posted about earlier.

I lowered my memory_limit in php.ini back to the standard 8MB. And this is the outcome.

- http://forum.malmberg.fi/smf/index.php?PHPSESSID=720f0086de149c5dd74eba521d96b4cb&action=mediacenterfile;attach=8;music;download

- http://forum.malmberg.fi/smf/index.php?PHPSESSID=720f0086de149c5dd74eba521d96b4cb&action=mediacenterpopup;attach=8;music

Both gives this error message in /var/log/httpd/error_log
"Allowed memory size of 8388608 bytes exhausted (tried to allocate 138 bytes)
"

While using this link:
http://forum.malmberg.fi/smf/index.php?PHPSESSID=4824f4f85b4574df670d38aec94cf8cd&action=dlattach;topic=43.0;attach=8

..works 100%.

The latter link being the download link from the post where the files is originally attached.

If I increase the parameter to 15MB, my file also works from the mediacenter. So what am I doing wrong?
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

RoarinRow

Quote from: RoarinRow on February 22, 2007, 02:24:42 PM
Quote from: WhatsUp on February 22, 2007, 02:09:39 PM
Quote from: RoarinRow on February 22, 2007, 01:19:21 PM
Does anyone with a lot of pictures notice any performance issues?  Our site has a lot of attachments, just wondering if notice a big slow down rendering the pictures through this mod.
My understanding is that the mod does not create the attachment files, it merely presents the files already attached, as per the settings.
As it does not create new files, how could these non-existent files cause the site to slow appreciably?

The only time speed is an issue is when the user views the mod.

For file types that are merely listed (as with PDFs that I use the mod for), little data is being passed. For images, this will depend on the thumbnail size you have set for your site. Mine is set for 600 px, which I think is reasonable.

thanks for the clarification   8)

Seemed to work fine even with over 1400 pages of images   :o

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

rickdias

man first i gotta say well done on the mod its a beauty!

works prefect for me, i use it mainly for playing mixes and i was wondering if the listen popup could use windows media player to play the files instead of quicktime.

I have tried to change the object and embed tags to the win media ones but it wont play the file, i think its a problem with the src="', $context['media_center_file'], '" bit.

it gives the link as: http://mysite/smf/index.php?action=mediacenterfile;attach=1;music

is there anyway i could get this to be recognized by win media?

thx.

JayBachatero

Quote from: tsmalmbe on February 22, 2007, 03:12:55 PM
Some debugging info about the parameters I posted about earlier.

I lowered my memory_limit in php.ini back to the standard 8MB. And this is the outcome.

- http://forum.malmberg.fi/smf/index.php?PHPSESSID=720f0086de149c5dd74eba521d96b4cb&action=mediacenterfile;attach=8;music;download

- http://forum.malmberg.fi/smf/index.php?PHPSESSID=720f0086de149c5dd74eba521d96b4cb&action=mediacenterpopup;attach=8;music

Both gives this error message in /var/log/httpd/error_log
"Allowed memory size of 8388608 bytes exhausted (tried to allocate 138 bytes)
"

While using this link:
http://forum.malmberg.fi/smf/index.php?PHPSESSID=4824f4f85b4574df670d38aec94cf8cd&action=dlattach;topic=43.0;attach=8

..works 100%.

The latter link being the download link from the post where the files is originally attached.

If I increase the parameter to 15MB, my file also works from the mediacenter. So what am I doing wrong?

SMF might be setting it's memory_limit a bit higher.  I'm going to have to look into this and see what's going on.

Quote from: RoarinRow on February 22, 2007, 05:28:38 PM
Quote from: RoarinRow on February 22, 2007, 02:24:42 PM
Quote from: WhatsUp on February 22, 2007, 02:09:39 PM
Quote from: RoarinRow on February 22, 2007, 01:19:21 PM
Does anyone with a lot of pictures notice any performance issues?  Our site has a lot of attachments, just wondering if notice a big slow down rendering the pictures through this mod.
My understanding is that the mod does not create the attachment files, it merely presents the files already attached, as per the settings.
As it does not create new files, how could these non-existent files cause the site to slow appreciably?

The only time speed is an issue is when the user views the mod.

For file types that are merely listed (as with PDFs that I use the mod for), little data is being passed. For images, this will depend on the thumbnail size you have set for your site. Mine is set for 600 px, which I think is reasonable.

thanks for the clarification   8)

Seemed to work fine even with over 1400 pages of images   :o
If you have caching enabled for SMF it performs even better ;).
Follow me on Twitter

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

RoarinRow

Doh!  Here's what it says in my CP - SMF has not been able to detect a compatible accelerator on your server.  

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

JayBachatero

Are you ona dedicated server?
Follow me on Twitter

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

RoarinRow


SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

tsmalmbe

Another thing: I've had requests for the possibility to order by date-posted. Could it be implemented?
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

dakotaroar

The only forum for students in North and South Dakota!  Campus Dakota.

JayBachatero

Quote from: RoarinRow on February 28, 2007, 01:50:35 PM
Quote from: JayBachatero on February 28, 2007, 01:28:49 PM
Are you ona dedicated server?

I wish!
You wont be able to use cache.  It should be pretty quick though.
Follow me on Twitter

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

RoarinRow

Quote from: JayBachatero on March 01, 2007, 12:24:52 AM
Quote from: RoarinRow on February 28, 2007, 01:50:35 PM
Quote from: JayBachatero on February 28, 2007, 01:28:49 PM
Are you ona dedicated server?

I wish!
You wont be able to use cache.  It should be pretty quick though.

Yup, it's not bad.  Just wish the database had more integrity, but that's another story.   :)

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Advertisement: