WordPress.org

Ready to get started?Download WordPress

Forums

MP3-jPlayer
[resolved] found how to change hardcoded margin and border of playlistplayer (3 posts)

  1. Deskslider
    Member
    Posted 1 year ago #

    Hi, hunted my ass off to fix this, and found it, so I thought I'd share. Please respond if it helps you... Let's help eachother use this kickass player if Simon is held up a bit right now.
    This is quite intermediate level and you need to be able to understand code somewhat. It can give you a helpful pointer if you need it though.

    I wanted to have my playlist player on the right of text, but text would touch it on the left of player. Also I wanted a litte grey outline to go with the pic on my site that also have that. And shorten the underborder. Firebug will give you 'element.style' which means its inline coded, in this case in the php code. Geeezzz, bummer. Solving it involved editing in several places:
    in the player admin settings under playlist player options setting above and below player options to 3px (I think I override it later but just to be sure)
    Then, at the top of this particular page, in wordpress text edit mode added (adjust this to your own particular page /post path with Firebug, using copy CSS path):
    <style>
    body.page div#wrapper div#content.page section#main.fullwidth article.post-68 div.article-inner section.entry div.wrap-MI
    {
    float: right;
    border: 1px solid #F0F0F0;
    }
    </style>

    Float is to make my paragraph text go to the left of the player. Oh, put player shortcode first, then text.

    Finally, the kicker:
    in mp3j_main.php line 799 change to
    } else if ( $pos == "rel-R" ) {
    $floater = "position:relative; padding:" . " 3px " . " 3px " . " 3px " . " 3px; margin:-1px 0px 0px 17px;";

    This overrides fetching the margin and padding from the database settings. Your situation can be different, this only works for short code option rel-R but if you can understand code a little bit, now you know where to look or go, I hope.
    Finally, here's my shortcode:

    [mp3-jplayer tracks="http://pathtomp3/Verhaalbass.mp3,
    http://pathtomp3/StabbyGroove.mp3,
    http://pathtomp3/PacMan.mp3,
    http://pathtomp3/PostModernChillTrance.mp3,
    http://pathtomp3/Bazen-128.mp3,
    " width="165px" pos="rel-R" list="y" vol="73" ]

    webtext myarticle blablabla follows here...

    For a while the result can be seen in action on
    http://www.audionstudio.nl/audion/workshopsjongeren/
    Proud!

    Greets,
    Jay van Bruggen

    http://wordpress.org/extend/plugins/mp3-jplayer/

  2. simon.ward
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jay,
    re. the hard coded margins - you didn't really need to do this.

    You can set the player to float using pos="left" or pos="right" in the shortcode, and set the 'Inner margin' option on the player settings page (under 'Playlist player Options') as needed.

    To get a border around a player then you'd probably want to not float it and wrap it in a div that is floated instead eg:

    <div style="float:right; border:1px solid #ccc; padding:2px; margin-left:30px;">
    [mp3-jplayer etc...]
    </div>

    then set the margins to 0px on the settings page.

    Hope that helps.

  3. Deskslider
    Member
    Posted 1 year ago #

    Thanks Simon,
    In the situation I was in then, it didn't work, or I messed up, I don't know. But indeed you're method is much more elegant and I've seen it work now in a fresh test install, so I'll use that from now on.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic