Start a new topic

Uploader User Details in Radio

I'm looking to display the user details in the Radio player. Essentially I would like the basic profile details to show and update as songs change. This would allow listeners to follow, link to profile, etc. Quick way to check out the uploader right from Radio player.


I have not found method as of yet to do so; but I have just started.


If anyone has suggestions I'd love to hear them. As I make progress I will post the details here for others as well.


Thanks


Identical process

Locate: /themes/uploader/modules/templates/radio.php

Add you data; example:

<# if ( data.author_post_url ) { #><span class="exc-playlist-item-author_post_url">{{ data.author_post_url }}</span><# } #> <? //REVOLVEDMEDIA.COM LINE ADDED ?>

I'm off to style it and maybe pull the author profile pic etc, going to make this look good now ;-)

Well that's about it. Hope someone else can put this to good use.

 

 In my case I wanted to use the author_id, $author_post_url and $author_username. I modified the code in:

/plugins/exc-uploader-theme/radio_class.php


Starting line 146

==========================


//REVOLVEDMEDIA.COM
/**
* Add the track author data to the radio
*/
$author_ID = esc_attr( $attachment->post_author );
$author_post_url = esc_url( get_author_posts_url( $attachment->post_author ) );
$author_username = exc_get_user_name($attachment->post_author, true);
//END REVOLVEDMEDIA.COM

$track = array(
'src' => $url,
'type' => $ftype['type'],
'title' => $attachment->post_title,
'caption' => $attachment->post_excerpt,
'description' => $attachment->post_content,
'authorID' => $author_ID, //REVOLVEDMEDIA.COM CUSTOM VAR
'author_post_url' => $author_post_url, //REVOLVEDMEDIA.COM CUSTOM VAR
'author_username' => $author_username //REVOLVEDMEDIA.COM CUSTOM VAR
);


Next I located the widget template:

/themes/uploader/includes/views/widgets/templates/radio.php  and added the following lines:


Starting at Line 6

==========================


<# if ( data.authorID ) { #><span class="exc-playlist-item-authorid">{{ data.authorID }}</span><# } #> <? //REVOLVEDMEDIA.COM LINE ADDED ?>
<# if ( data.author_post_url ) { #><span class="exc-playlist-item-author_post_url">{{ data.author_post_url }}</span><# } #> <? //REVOLVEDMEDIA.COM LINE ADDED ?>
<# if ( data.author_username ) { #><span class="exc-playlist-item-author_post_url"><a rel="author" href="{{ data.author_post_url }}">View {{ data.author_username }} Profile</a></span><# } #> <? //REVOLVEDMEDIA.COM LINE ADDED ?>


I am now able to use the data as needed within the widget - and add any new variables and data that I want :-)


Off to locate the Radio Player to do the same!


I will report and document my findings


From what I have found so far:


An ajax post is sent:

security=1a3b62cea4&action=exc_radio_widget&station_id=414


Has the following response format:

{   "success":true,
"data":{
"type":"audio",
"tracklist":false,
"tracknumbers":false,
"images":false,
"artists":true,
"poster":0,
"tracks":[{"src":"http:\/\/example.com\/wp-content\/uploads\/2016\/01\/femvox-the-realm-speech.mp3",
"type":"audio\/mpeg",
"title":"femvox-the-realm-speech",
"caption":"",
"description":"",
"meta":{
"album":"Acapella",
"length_formatted":"1:01"
}
},
{"src":"http:\/\/example.com\/wp-content\/uploads\/2016\/01\/angelas-Jurassic-Park-Impression.wav",
"type":"audio\/wav",
"title":"angelas-Jurassic-Park-Impression",
"caption":"",
"description":"",
"meta":{
"length_formatted":"0:07"
}
},
{"src":"http:\/\/example.com\/wp-content\/uploads\/2016\/01\/answer-these-q-in-english.wav",
"type":"audio\/wav",
"title":"answer-these-q-in-english",
"caption":"",
"description":"",
"meta":{
"length_formatted":"0:07"
}
}
]
}
}

And this has lead me to /plugins/exc-uploader-theme/radio_class.php


The loop to create the track list starts at line 94

//Load Upload Files


Line 136, the loop through the attachments begins.


Line 141 the data array is filled.


This is where I can pop in the values I need :-)


I will report as I make further progress.



Login or Signup to post a comment