Deprecated: Function set_magic_quotes_runtime() is deprecated in /customers/stein-ivar.net/stein-ivar.net/httpd.www/textpattern/lib/txplib_db.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /customers/stein-ivar.net/stein-ivar.net/httpd.www/textpattern/lib/txplib_db.php:14) in /customers/stein-ivar.net/stein-ivar.net/httpd.www/textpattern/lib/txplib_misc.php on line 1625

Warning: Cannot modify header information - headers already sent by (output started at /customers/stein-ivar.net/stein-ivar.net/httpd.www/textpattern/lib/txplib_db.php:14) in /customers/stein-ivar.net/stein-ivar.net/httpd.www/textpattern/publish.php on line 477
Testing! — stein-ivar.net - hatin' php since 2002.

Testing! · Jul 5, 03:03


Testing the code-tag using the last.fm plugin.

function lastfm($atts) { global $s, $c; extract(lAtts(array( ‘label’ => ‘’, ‘labeltag’ => ‘’, ‘break’ => ‘br’, ‘wraptag’ => ‘’, ‘parent’ => ‘’, ‘posted’ => ‘’, ‘section’ => $s, ‘sticky’ => ‘’, ‘user’ => ‘’, ),$atts)); function openURL($url, $headers = null){ if (function_exists(‘curl_init’)) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data[‘html’] = curl_exec($ch); curl_close($ch); } elseif (ini_get(‘allow_url_fopen’) == 1) { $data[‘html’] = file_get_contents($url); } if($headers) {$data[‘headers’] = get_headers($url, 1); } return $data;
} $url = “http://ws.audioscrobbler.com/1.0/user/” . $user . “/recenttracks.xml”; $xml = openURL($url); $info = simplexml_load_string($xml[“html”]); // OUTPUT $out = array(); for($i=0;$i<5;$i++){ $fm = $info->track[$i]; $out[$i] = tag($fm->artist . ‘ – ‘ . $fm->name, ‘a’, ‘ href=”’ . $fm->url . ‘”’); } return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
}


Permanent Link


Name

E-mail

http://

Message

 

Textile Help