• ResolvedPlugin Author arcain6

    (@arcain6)


    OK Snakeice64, i’ve added the features you wanted, this is a continuation of the edits i suggested in this thread

    !!!!! WARNING !!!!!
    These edits will NOT work unless you have completed the edit in the above mentioned thread!!

    These edits add album art to the widgets (queued, recent, requested etc)
    ——————–=[ THE EDITS ]=——————–

    To get album art on the widgets, do these edits:

    FILE: functions.php

    FIND: function build_upcoming_tracks_query
    THEN FIND: $sanitized_sam_query = $samdb->prepare( "SELECT songlist.ID AS songid
    INLINE EDIT:
    AFTER: songlist.duration,
    ADD: songlist.picture,
    RESULT: songlist.artist, songlist.duration,songlist.picture, queuelist.requestID AS requestID
    FIND: function build_recently_played_query
    THEN FIND: $sanitized_sam_query = $samdb->prepare( "SELECT songlist.ID AS songid
    INLINE EDIT:
    AFTER: songlist.duration,
    ADD: songlist.picture,
    RESULT: songlist.artist, songlist.duration, songlist.picture, historylist.requestID AS requestID,
    FIND:function prepare_widget_song( $song ) {
    EDIT: under $title = '';
    ADD:
    //ADD ALBUM ART!
            $album = '';
            $album = $song->picture;
    
            if ( empty( $album ) ) {
                    $album = 'NA.gif';
            }
    
    //End Album Art!

    CLOSE FILE

    FILE: widgets.php

    REPLACE:$output = $output.'<td>'.$song_info['artist'].'<br />'.$song_info['title'];
    REPLACE WITH:$output = $output.'<td><img src="/sam/'.$song_info['album'].'" height="30" width="30">'.$song_info['artist'].'<br />'.$song_info['title'];
    REPLACE:$output = $output.'<td>'.$song_info['artist'].'<br />'.$song_info['title'].'</td>';
    REPLACE WITH:$output = $output.'<td><img src="/sam/'.$song_info['album'].'" height="30" width="30">'.$song_info['artist'].'<br />'.$song_info['title'].'</td>';
    REPLACE:$output = $output.'<td>'.( 0 == $row_number ? '<strong>' : '').$song_info['artist'].'<br />'.$song_info['title'];
    REPLACE WITH:$output = $output.'<td>'.( 0 == $row_number ? '<strong>' : '').'<img src="/sam/'.$song_info['album'].'" height="30" width="30">'.$song_info['artist'].'<br />'.$song_info['title'];

    I hope these edits work the way you wanted. You can customize the size of the album art in the widgets by changing teh 30 x 30 in each line of the widgets.php edits

    Enjoy 🙂

    https://ww.wp.xz.cn/plugins/ngs-sam-integrator/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thanks for adding these functions. Curious if there is a way to simply display the artwork for the track that is currently playing?

    Here for example: http://live.coldbustedradio.com/

    Thanks again,
    Derrick

    Plugin Author arcain6

    (@arcain6)

    Yeppers 🙂

    if you remember i had you alter the track lines –> HERE <–

    Original:

    <tr>
                                    <td><img src="/sam/<?php echo $song_info['album']; ?>" height="60" width="60"></td>
                                    <td> <?php echo $row_number++; ?></td>
                                    <td><a rel="nofollow" href="<?php echo $song_info['requestlink'] ?>"><?php echo $song_info['artistandtitle']; ?></a></td>
                                    <td><?php echo $song_info['formattedduration']; ?></td>
                            </tr>

    New:

    <tr>
                                    <td><img src="/sam/<?php echo $song_info['album']; ?>" height="60" width="60"></td>
                            </tr>

    As you can see, we’ve stripped the rest of the data from the list.
    or..

    If you want it to look similar to theirs with the data beneith the album rather than inline next to it:

    <tr>
        <td><center><img src="/sam/<?php echo $song_info['album']; ?>" height="60" width="60"></center></td>
      </tr>
      <tr>
        <td><center><a rel="nofollow" href="<?php echo $song_info['requestlink'] ?>"><?php echo $song_info['artistandtitle']; ?></a></center></td>
      </tr>
      <tr>
        <td><center><?php echo $song_info['formattedduration']; ?></center></td>
      </tr>

    Btw, i’ve recently contacted the original creator of this plugin, and have been given SVN access to update it. So i will be working to improve the plugin, and add the ability to enable / disable album are within the admin options page, as well as i may add other features as far as layout and design is concerned. but bear with me as i familiarize myself with the current code in use.

    Plugin Author arcain6

    (@arcain6)

    Looking for someone to test the new version of the plugin before i commit it to the plugin database.

    The reason i need testers, is i don’t want to break what currently works, but i also need to test the plugin in as many environments as possible. I.e. you may have plugins that cause issues with the new version, or your environment may cause some of my alterations to function abnormally.

    The goal is the keep as much original as possible, but to add functionality. This limits me as far as backwards compatability.

    If you are willing to test my new version, leave a message with your email, and i’ll send you a link to download the beta.

    If you DO wish to test it, be sure to make a backup of your current settings before installing.

    In order to properly test the plugin, you need to do 3 tests.

    1)
    A – Install the beta plugin by completely overwriting the current plugin files without deactivating, or removing the plugins database settings.

    Make sure everything works, if not, please document as fully as you can the issues you see, as well as turn on debugging, and log all errors reported.

    2)
    A – Completely uninstall the beta plugin and revert your database back to the current release, as well as the plugin files from your backup.
    B – Then deactivate the plugin, and install the beta as an upgrade by overwriting the current plugin files.

    Make sure everything works, if not, please document as fully as you can the issues you see, as well as turn on debugging, and log all errors reported.

    3)
    A – revert back to the current plugin by restoring database, and backup files.
    B – completely uninstall the current plugin, making sure the database entries are also removed.
    C – install the beta plugin as a new plugin.

    Make sure everything works, if not, please document as fully as you can the issues you see, as well as turn on debugging, and log all errors reported.

    Please post your findings to this thread

    Seperate each report by placing your full report in code blocks and placing a title above.

    Example:

    Test 1

    Working as intended

    Test 2

    Album art not working in following widgets:
    blah
    blah

    Test 3

    My computer blew up because your wordpress plugin is evil, and it downloaded monkeys and kitties till my hard drive and CPU overheated and caught fire!!

    Plugin Author arcain6

    (@arcain6)

    Nevermind the above testing post. There is now a new version 🙂

    You are correct and is working properly.
    I may have asked the wrong question and perhaps I’m looking for a feature request when you have the time.
    Would be great to have an additional Widget Album Art for Now Playing.
    Then I could have the artwork display on a page:
    http://prntscr.com/7fxxlu

    Thanks again,
    Derrick

    Plugin Author arcain6

    (@arcain6)

    Give me a couple of days, i’ll cobble something together i’m sure.

    Plugin Author arcain6

    (@arcain6)

    Updated the plugin, now there is a “Now Playing” widget, here are some options you can use to tailor a custom page and embed the widget where you wish.

    Custom Page Creation:
    WordPress Forum Topic

    Plugins:
    Currently there are quite a few plugins that allow you to embed a widget within a post, or a page.

    here is one such example:
    AMR Shorcode any Widget

    NOTE: I have not tested these methods for embedding widgets into pages, your results may vary.
    I have also not tested nor am i specifically endorsing the AMR plugin, it was simply the first one i came across, so again, results may vary.

    I will be spending the next few days away from the office, so i may not respond as quickly, but rest assured, i am still looking at adding features to the plugin.

    This is exactly what we needed. Thanks so much for adding the now playing widget. Everything is working great: http://live.coldbustedradio.com

    Plugin Author arcain6

    (@arcain6)

    Glad we could get it solved for you 🙂

    arcain6, Thanks for getting the album art working all the way around, looks great! I did the symbolic link to my current album art location to /sam diretory.

    I need to work on my site a lot more and hope to get the “Now Playing” widget in a few spots by supplying the short code maybe even in some other blogs.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Continued Modification for Snakeice64’ is closed to new replies.