Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 SoundCloud forum
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #8
RE: SoundCloud forum
The default artwork is 100x100 (if any).

You can try this:
sc_forumdisplay

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'});
	var scdefaultimg = 'images/logo.png';
</script>

Replace the images/logo.png with the default image (if there is no artwork found). Don't forget to replace the CLIENT_ID

Then in your sc_forumdisplay_thread:

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

It will use the 400×400 artwork or load the default image.



Attached File(s) Thumbnail(s)
   

(This post was last modified: 11-22-2015 01:44 AM by RateU.)
11-22-2015 01:35 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: