Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
aMP3 - (mp3 attachment player) Details »»
aMP3 - (mp3 attachment player)
Version: 1.00, by Coders Shack Coders Shack is offline
Developer Last Online: Sep 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.8 Rating:
Released: 10-30-2007 Last Update: Never Installs: 110
Uses Plugins
Additional Files  
No support by the author.

[hr]value[/hr]
. . . . . . . . Brought to you by

. . . http://www.Scriptasy.com
[hr]value[/hr]

Installation Time: < 5 mins
Product: 1
Files: 2
VB Version: 3.6.X


Description:
I ran across a request for the ability to play someones audio straight from the attachment bit, i had a few minutes to spare so i created it.

[Live Demo]

Installation Instructions:
  1. Install Product
  2. Place files in the correct folder (i created a mock file structure with the folders)
If you like then [Mark As Installed]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 11-07-2007, 07:25 PM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by derfelix View Post
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
and i'm happy
Felix
very cool - can you please post it with the proper plugin formatting? (with the back slashes)?
Reply With Quote
  #43  
Old 11-07-2007, 07:37 PM
derfelix derfelix is offline
 
Join Date: Nov 2001
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #44  
Old 11-08-2007, 07:20 PM
albibak's Avatar
albibak albibak is offline
 
Join Date: Feb 2003
Location: Paris (France)
Posts: 302
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I love this hack, thanks.
Reply With Quote
  #45  
Old 11-12-2007, 04:32 AM
Coders Shack Coders Shack is offline
 
Join Date: Apr 2007
Location: Culver City, CA
Posts: 807
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by derfelix View Post
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.
Reply With Quote
  #46  
Old 11-12-2007, 06:29 AM
derfelix derfelix is offline
 
Join Date: Nov 2001
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Coders Shack View Post
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
Reply With Quote
  #47  
Old 11-15-2007, 05:18 PM
Coders Shack Coders Shack is offline
 
Join Date: Apr 2007
Location: Culver City, CA
Posts: 807
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wouldnt SWFObject require additional JS?
Reply With Quote
  #48  
Old 11-15-2007, 05:33 PM
derfelix derfelix is offline
 
Join Date: Nov 2001
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #49  
Old 11-17-2007, 11:46 PM
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Posts: 1,674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, this is awesome. Thanks so much!
Reply With Quote
  #50  
Old 11-18-2007, 02:42 PM
moon_spell moon_spell is offline
 
Join Date: Oct 2007
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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



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 !
Reply With Quote
  #51  
Old 12-14-2007, 04:01 PM
TheMilkCarton TheMilkCarton is offline
 
Join Date: Jan 2007
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:46 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.04949 seconds
  • Memory Usage 2,328KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete