Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 SoundCloud forum
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #5
RE: SoundCloud forum
Great. Thanks for the demo link Smile

BTW, if you want displaying the artwork of each sounds (for example in your forumdisplay_thread), you can use resolve endpoint (not all songs have artwork).

To do this, at least you need to create sc_forumdisplay and sc_showthread templates. Put the link for the SoundCloud js API and your client id inside the header tags, so it will be initialized once.
For example:

HTML Code
<script src="https://connect.soundcloud.com/sdk/sdk-3.0.0.js"></script>
<script type="text/javascript">
	SC.initialize({client_id: 'CLIENT_ID'});
</script>


Then in your sc_forumdispplay_thread, you can grab the artwork URL like this (for example only):

HTML Code
1
2
3
4
5
6
<div id="sc_{$GLOBALS['thread']['tid']}"></div>
<script type="text/javascript">
	SC.resolve('{$GLOBALS['threadfields']['sc_url']}').then(function(tracks){
		$('#sc_{$GLOBALS['thread']['tid']}').html('<img src="'+tracks.artwork_url+'" alt="'+tracks.title+'" title="'+tracks.title+'" />');
	});
</script>


For displaying the oEmbed in sc_showthread or sc_postbit_first/_classic (example only):

HTML Code
<div id="sc_{$GLOBALS['thread']['tid']}"></div>
<script type="text/javascript">
	SC.oEmbed('{$GLOBALS['threadfields']['sc_url']}',{element: document.getElementById('sc_{$GLOBALS['thread']['tid']}'),maxheight:100,show_comments:false});
</script>


Display Format of the sc_url custom thread field:

Code:
{VALUE}


Again, not all songs have artwork. But seems you have custom templates for various showthread/postbit and forumdisplay_* for the SoundCloud forum, so maybe it may useful for you as a reference.



Attached File(s) Thumbnail(s)
   

11-21-2015 01:58 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
SoundCloud forum - Waleed - 11-19-2015, 05:00 PM
RE: SoundCloud forum - RateU - 11-20-2015, 03:34 AM
RE: SoundCloud forum - Waleed - 11-20-2015, 08:13 AM
RE: SoundCloud forum - Waleed - 11-20-2015, 09:40 AM
RE: SoundCloud forum - RateU - 11-21-2015 01:58 AM
RE: SoundCloud forum - Waleed - 11-21-2015, 09:38 AM
RE: SoundCloud forum - Waleed - 11-21-2015, 04:13 PM
RE: SoundCloud forum - RateU - 11-22-2015, 01:35 AM
RE: SoundCloud forum - Waleed - 11-22-2015, 08:28 AM

 Standard Tools
Forum Jump: