HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.

Dplayer

This discussion is related to the Dplayer addon.
edited March 2007 in Vanilla 1.0 Help
Dplayer
«13

Comments

  • awesome been waiting for something like this for a while tanx.
  • mattmatt ✭✭
    Has anybody been able to get this to work?

    edit: ah, I found the problem - all the links to files in the extensions folder do not work.

    fo fix - manually change all links to extensions/Dplayer/player.js to absolute links. there's probably a better way but that'll do for now.
  • Might be worth implementing the new pathfinder function wanderer?
  • mattmatt ✭✭
    This is incompatible with Comment Links.

    I'm not sure which is breaking which at the moment.
  • Uploaded version 1.0 of Dplayer.
  • Version 1.0 Uses new pathfinder function to linked files to overcome emsef's issue.

    Posted: Saturday, 24 March 2007 at 3:00PM (AEDT)

  • mattmatt ✭✭
    This is still half broken for me.

    Where default.php wrrites out the <script> tag is still a bad path.

    I use this version of default.php:
    <?php /* Extension Name: Dplayer Extension Url: http://lussumo.com/addons/ Description: Turns plain links to mp3 files into playable icons. Version: 0.0.1 Author: Wanderer - Joe Debono Author Url: http://www.debono.com.au/forum/ */ if (in_array($Context->SelfUrl, array('index.php', 'categories.php', 'comments.php', 'post.php'))) { class debplayer extends Control { function debplayer(&$Context) { $this->Name = 'debplayer'; } function Render() { //echo '<script type="text/javascript" src="extensions/Dplayer/player.js"></script>'; //commented out } } $debplayer = new debplayer($Context); $Page->AddRenderControl($debplayer, $Configuration['CONTROL_POSITION_FOOT'] - 5); // new line below $Head->AddScript('extensions/Dplayer/player.js'); } ?>
  • Well mate, that does not work for ME!

    It adds the link to the script too early before the page fully loads and it does not find the links to work on.

    Posted: Sunday, 25 March 2007 at 9:45AM (AEDT)

  • mattmatt ✭✭
    Wanderer, I'm not looking for a fight - I'm just telling you that I am having problems with your script.

    If you'd rather not use the $Head-> method then please address the fact the Render() function is injecting a relative path that won't work in every installation. Most crucially a "default" installation.

    Also, there are ways other than the onload event or adding the script at the bottom of a page to get an event to fire when the DOM is ready or the page has rendered. You might want to look into these.
  • Replace line 20 with:echo '<script type="text/javascript" src="'. $this->Context->Configuration['WEB_ROOT'] .'extensions/Dplayer/player.js"></script>';
  • Hey emsef mate, I wasn't picking a fight, and my installation is as "default" as it can be as far as I know.

    I have implemented guru Dinoboff's method, it works for me, but then all the others (except yours) worked too.

    Version 1.0.1 coming up...

    Posted: Tuesday, 27 March 2007 at 12:08AM (AEDT)

  • Version number changed from 1.0 to 1.0.1.
  • Uploaded version 1.0.1 of Dplayer.
  • mattmatt ✭✭
    This is still broken. Wanderer, are you testing this before you upload it each time?

    Notice: Trying to get property of non-object in /forum/extensions/Dplayer/default.php on line 20
  • Yes of course I test, it always works for me.
    Line 20 is Dinoboff's fix, it worked for me but then it wasn't broken for me.

    I don't understand what could be so different, I even installed Friendly URLs to test it with, works a treat.

    Sorry about the hassles, just fix it for your set-up (make the paths absolute), nothing in the actual player script has changed, the problem seems to be the path to the files in the extensions/Dplayer folder.

    Posted: Tuesday, 27 March 2007 at 7:14PM

  • mattmatt ✭✭
    I have done and I'll stop bugging you about it :)
  • Are you using Friendly URLs?

    Apparently the standard supplied .htaccess file needs fixing...

    Friendly URLs breaks stuff

    Posted: Tuesday, 27 March 2007 at 7:45PM

  • doesn't Vanilla by default use relative paths
    <script type="text/javascript" src="/vanilla/js/global.js"></script> <script type="text/javascript" src="/vanilla/js/vanilla.js"></script> <script type="text/javascript" src="/vanilla/js/ajax.js"></script> <script type="text/javascript" src="/vanilla/js/ac.js"></script>

    all relative paths
  • Yeah that's what I thought, apparently some people have gremlins that cause havoc.
    An then there's friendly URLs throwing a spanner in the works.

    Posted: Tuesday, 27 March 2007 at 8:26PM

  • Sorry, I didn't checked if the there was a Context property. Fixed with the following code:if (in_array($Context->SelfUrl, array('index.php', 'categories.php', 'comments.php', 'post.php'))) { class debplayer extends Control { var $Context; function debplayer(&$Context) { $this->Name = 'debplayer'; $this->Context = &$Context; } function Render() { echo '<script type="text/javascript" src="'. $this->Context->Configuration['WEB_ROOT'] .'extensions/Dplayer/player.js"></script>'; } } $debplayer = new debplayer($Context); $Page->AddRenderControl($debplayer, $Configuration['CONTROL_POSITION_FOOT'] - 5); // new line below $Head->AddScript('extensions/Dplayer/player.js'); }
This discussion has been closed.