vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - aMP3 - (mp3 attachment player) (https://vborg.vbsupport.ru/showthread.php?t=161567)

yoyoyoyo 11-07-2007 07:25 PM

Quote:

Originally Posted by derfelix (Post 1377936)
this is awsome..
just made it work in blogs..
if someone else is interested (and if I may)

here is the modification I applied..
in the productxml find:
PHP Code:

if ($vbulletin->options['amp3_enabled']) { 
$vbulletin->templatecache['postbit_attachment'] = preg_replace('#<tr#''<tr style=\"vertical-align: top;\"',$vbulletin->templatecache['postbit_attachment']);

$vbulletin->templatecache['postbit_attachment'] = preg_replace('#\)</td>#'')" . ( ($attachment[attachmentextension] == "mp3")?("<div style=\'float: left;\'><script src=\'./clientscript/audio/audio-player.js\' language=\'JavaScript\'></script><object style=\'vertical-align: middle;\' id=\'./attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]\' width=\'290\' height=\'24\' data=\'./clientscript/audio/player.swf\' type=\'application/x-shockwave-flash\'><param value=\'./clientscript/audio/player.swf\' name=\'movie\'/><param value=\'playerID=1&soundFile=./attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]\' name=\'FlashVars\'/><param value=\'high\' name=\'quality\'/><param value=\'false\' name=\'menu\'/><param value=\'transparent\' name=\'wmode\'/></object></div>"):("") ) . "</td>',$vbulletin->templatecache['postbit_attachment']);


replace with:
PHP Code:

if ($vbulletin->options['amp3_enabled']) { 
$cachedtemp THIS_SCRIPT == 'blog' ?  $vbulletin->templatecache['blog_entry_attachment'] : $vbulletin->templatecache['postbit_attachment']; 

if(
strlen($cachedtemp)>1)
{
    
$cachedtemp preg_replace('#<tr#''<tr style=\"vertical-align: top;\"',$cachedtemp);

    
$cachedtemp preg_replace('#\)</td>#'')" . ( ($attachment[attachmentextension] == "mp3")?("<div style=\'float: left;\'><script src=\'./clientscript/audio/audio-player.js\' language=\'JavaScript\'></script><object style=\'vertical-align: middle;\' id=\'./attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]\' width=\'290\' height=\'24\' data=\'./clientscript/audio/player.swf\' type=\'application/x-shockwave-flash\'><param value=\'./clientscript/audio/player.swf\' name=\'movie\'/><param value=\'playerID=1&soundFile=./attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]\' name=\'FlashVars\'/><param value=\'high\' name=\'quality\'/><param value=\'false\' name=\'menu\'/><param value=\'transparent\' name=\'wmode\'/></object></div>"):("") ) . "</td>',$cachedtemp);

    if(
THIS_SCRIPT == 'blog')
    {
        
$vbulletin->templatecache['blog_entry_attachment'] = $cachedtemp;
    }
    else
    {
        
$vbulletin->templatecache['postbit_attachment'] = $cachedtemp;
    }
    unset(
$cachedtemp);


Actually the only thing I did was to change the template to parse if we are in blogs.. from $vbulletin->templatecache['postbit_attachment'] to $vbulletin->templatecache['blog_entry_attachment']
if we are not in blogs it works as usual..


It now seems to work fine in vblogs AND showthread :rolleyes:
and i'm happy
Felix

very cool - can you please post it with the proper plugin formatting? (with the back slashes)?

derfelix 11-07-2007 07:37 PM

hmm.. sorry but i'm a bit a newbie to plugins.. this is only php code modified in the product.xml
what is the plugin format?? backslashes?? sorry if the question is stupid..

all i did is cut and paste in the product.xml ... reinstall with overwrite..
if you meen rewrite the xml an post as attachment.. i dont know if its allowed because i'm not the author...
Felix

albibak 11-08-2007 07:20 PM

I love this hack, thanks.

Coders Shack 11-12-2007 04:32 AM

Quote:

Originally Posted by derfelix (Post 1377963)
hmm.. sorry but i'm a bit a newbie to plugins.. this is only php code modified in the product.xml
what is the plugin format?? backslashes?? sorry if the question is stupid..

all i did is cut and paste in the product.xml ... reinstall with overwrite..
if you meen rewrite the xml an post as attachment.. i dont know if its allowed because i'm not the author...
Felix

you have the permission to attach the XML as long as its only in this thread.

derfelix 11-12-2007 06:29 AM

Quote:

Originally Posted by Coders Shack (Post 1380813)
you have the permission to attach the XML as long as its only in this thread.

Thx.. so here is the product.xml as I use it..
import attached product --> overwrite yes

What I changed..
Made it work for blog if vblog is installed (I didnt test it without blog installed but it should work as before as its a IF THIS_SCRIPT check)
Added an ACP setting: Registered users only.. if set to yes, only registered users will see the player.

TODO...
1. (hint @Coders Shack ;) ) implement SWFObject as for all modern flash embeds .. this would allow gracefull degrading, upgrading flash and less markup code, better SEO and 100% validation (which is irrelevant though if set to registered users only). Even Youtube uses SWFObject embedding on their page! check out SWFObject
(I will implement it for my installation.. but as my forums are very custom.. my implementation will not work for other installations and I do not have time to make it work for all)

2. debug Sometimes in IE7 i get an error (even with the original product installed) a javascript alert .. something like :"could not load object" (its a german message.. as I use german IE7).. has something todo with the actionscript in the player.. not communicating correctly with the javascript on the page.. it does not interfere with functionality but should be turned off.. I think it should, if there is more than one player.. turn off the others, but it doesnt.. more than one player can be played at the same time)

Thats all from me..
Felix

Coders Shack 11-15-2007 05:18 PM

wouldnt SWFObject require additional JS?

derfelix 11-15-2007 05:33 PM

yes but its pretty small and used only once.. and you save the markup for<object.... etc...
if you have many instances of player.. its overall shorter...
F.

FleaBag 11-17-2007 11:46 PM

Wow, this is awesome. Thanks so much!

moon_spell 11-18-2007 02:42 PM

nice hack but i am looking for this music portal player and download page :

https://vborg.vbsupport.ru/external/2007/11/28.jpg

i have seen it on vbulletin board as a page like a download hack !
if is any please give me a link

thx
this hack is installed and works perfect !

TheMilkCarton 12-14-2007 04:01 PM

Any easy way to make this work for inline attachments also?

I started poking around the code for attachments, and all the different hooks, but I'm at a loss.

Inline attachments insert code directly into the post like so:

[attach]XXXX[/attach] where XXXX is the attachmentid.

*snip*

-----

Well, I've done it but I think it will require a file edit no matter what. *sigh*

I had to edit class_bbcode.php and add a case for "mp3" and give the proper code. No other way around that, I guess. I don't think any of the bbcode hook locations can handle this through plugins.

yotsume 12-14-2007 07:01 PM

INSTALLED! Works perfect even on 3.6.4

Looking forward to the development of this. A volume control would be good. I saw someone asked what this was based off of... The player looks exactly like the one used for the Wordpress plugin called "Podpress". I have begged the Podpress developer a number of times to release his plugin for vBulletin. One stop plugin for anything multimedia! Plays many video types and audio types.

This is off to a good start but needs to really bloom into a full audio plugin with similar features to Podpress.

Thanks for this!

Booyakan 12-19-2007 08:11 PM

Quote:

Originally Posted by TheMilkCarton (Post 1401029)
Any easy way to make this work for inline attachments also?

I started poking around the code for attachments, and all the different hooks, but I'm at a loss.

Inline attachments insert code directly into the post like so:

[attach]XXXX[/attach] where XXXX is the attachmentid.

*snip*

-----

Well, I've done it but I think it will require a file edit no matter what. *sigh*

I had to edit class_bbcode.php and add a case for "mp3" and give the proper code. No other way around that, I guess. I don't think any of the bbcode hook locations can handle this through plugins.

can you please let us know how to do it?

ShadowOne 01-11-2008 12:51 AM

I Didnt have to register to view the page... i dont need this mod, although it is nice, but nice video in the demo...:D

mykkal 01-11-2008 04:24 AM

i want to use the mod. but i saw the mp3 players werent playing the music. whats up with that?

Konstantinos 01-11-2008 10:04 PM

1) does it support .wav ?

2) what do we need to change in the server to avoid php timeouts while uploading the mp3s ?

Booyakan 01-22-2008 08:32 PM

anyone know why the player would just say "buffering" and sit there and never play?
sometimes it works, and sometimes it doesn't (mostly does not)

Baldilocks 01-29-2008 05:33 PM

Where excactly to i put the files to get this to work??
Sorry, vB newb here.

yotsume 02-27-2008 05:22 AM

I just uploaded a flv file that I converted to MP3. It plays fine on my computer. When it is on my forum it plays to fast and sounds like the Chipmunks as singing... what gives? How can this be? How can I fix that?

yotsume 02-27-2008 06:11 AM

Sorry for the double quick posts here but I figured out the problem... crap converter program messing up the bit rates leads to the mp3 file playing to fast with this mod.

I switched to RIVA Flash Encoder 2.0 and it converts flv perfect to mp3 with correct bit rates. Files play perfect now. If you don't know already all you have to do is change the output extension with this free encoder program and it converts to that extension.

AURFSCAN 04-12-2008 10:25 PM

Very cool...Installed and thanks

Iain M 04-13-2008 09:29 PM

installed,

would also like these features:
Quote:

Originally Posted by Coders Shack (Post 1372515)
if i update this product i will be:

+ hiding the player if attachment download is set to member only or user group specific
+ ability to use it only in specified forums rather than globally

and a different player with volume controls :)


Thanks!
Iain

Cybermonsters 05-23-2008 06:32 PM

Will this work on 3.7?

D.Baker 07-06-2008 02:37 AM

I just installed it on 3.7 and it works fine.

This would be perfect if it allowed embedding using the ATTACH tag! Has anyone figured out how to do that yet?

brandondrury 07-08-2008 03:32 PM

For those of you who have the problem of the mp3 buffering forever but never playing, it's caused when a user is not logged in.

I'm going to ad an if ($logged in) {this mode} code and see if it I can get it to disappear when the user is not logged in maybe with a message that says "You must be logged in to listen to this mp3".

Brandon

AURFSCAN 07-09-2008 08:10 PM

that would be a good idea brandondrury..did you do this and does it work ?

cserna 07-15-2008 06:31 PM

Quote:

Originally Posted by D.Baker (Post 1567837)
This would be perfect if it allowed embedding using the ATTACH tag! Has anyone figured out how to do that yet?

This would be exactly what I am looking for... If user ATTACH extension is .mp3 then replace with player inline...

If anyone knows of anything like this please post a link...

thanks!

yotsume 08-31-2008 12:09 PM

Can this be made to work in blogs? I really want that for my members to be able to blog music or audio files.

yotsume 09-01-2008 07:08 AM

Sorry I didn't realize a blog version was made already. I have this installed on my vb 3.7 board and it works perfect in blogs and forums.

How can we use a different player that has volume control?

alangland 01-11-2009 02:02 PM

Probably needless to say, but as this is just a bbcode thing, this mod still works in 3.8.

jl255 09-09-2009 04:12 PM

i suppose this will increase the load significantly on the server if i have about 300 threads with ringtone mp3 attached?

Daky 09-10-2009 11:27 PM

Installed on 3.8 no problem so far,.... just

How can we use a different player that has volume control?

yotsume 09-13-2009 05:58 AM

New Player With Volume Control!

To have the new player with volume control in your forum and blogs is actually very simple! I have attached the files you need to upgrade this mod to the new player.

Instructions:
Simply upload the contents of my attached zip file and overwrite the contents of your audio directory located here:

forumroot -> clientscript -> audio
  1. You must first install this mod.
  2. Next, upload the contents of my audio folder in the zip instead of the original one that comes with this mod.
NOTE: I will update this post when I relocate the website where this player is being developed. The developer of this player releases updates from time to time. It is good to check that site to keep your player up to date with the latest release.

(This mod needs to be posted in the vb3.8x forum with the new player. This mod works perfect with vb3.7 and 3.8x and the latest vbBlog. I can't think of any reason why this should not be built right into default VB with a nice option to turn it on or off per forum.)

Daky 09-14-2009 05:09 PM

Quote:

Originally Posted by yotsume (Post 1883979)
[SIZE=3][COLOR=DarkRed]

(This mod needs to be posted in the vb3.8x forum with the new player. This mod works perfect with vb3.7 and 3.8x and the latest vbBlog. I can't think of any reason why this should not be built right into default VB with a nice option to turn it on or off per forum.)

+1 for that,...

tnx for palyer,... will try now!

Daky 09-14-2009 05:12 PM

Player works like charm!!!!!

Thank you again,...

This mod, is highly recommended!!!!

yotsume 09-14-2009 06:34 PM

I relocated the source website where the new player with volume control is being developed. It was designed for WordPress but works on any kind of site.

WordPress Audio Player

http://wpaudioplayer.com/

The player I posted is the current beta released to date. It is a good idea to save this site and watch it for a new release. As flash is updated with new versions this player, we hope, will continue to be updated as well.

jl255 09-16-2009 04:51 PM

anyone noticed a significant increase in load after using this mod?

my server crashed like every few hrs after installation, but i'm not sure if it's due to the mod. disabling it removed the crashes though....

milaszewski 11-20-2009 09:50 PM

Is there any chance to get this mod working in VB4?
It's the only thing that keeps me from upgrading from 3.7

milaszewski 12-11-2009 11:38 AM

the php code seems easy to rewrite for a skilled programmer - can somebody try to have a go?

mugz 01-19-2010 07:43 PM

nice one I been looking every place for mod like this installed

Rupe42 01-27-2010 11:41 PM

Does this work ok on vB4 in the CMS content/articles?


All times are GMT. The time now is 01:33 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01509 seconds
  • Memory Usage 1,841KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete