wp-content->plugins->newantracks. Open newantracks.php on notepad. On line 26 of newantracks.php, edit the localhost, username, and password to your corresponding database localhost name, username, and password. For step by step instructions, please visit http://wordpress.org/plugins/antracks/installation/'.mysql_error()); mysql_select_db("wordpress") or die(mysql_error()); //create table if(mysql_num_rows(mysql_query("SHOW TABLES LIKE '%antable'"))==1) { //table euerrxist } else { $sql="CREATE TABLE antable(plname CHAR(50), pllink CHAR(255), autoplay INT(1))"; if (mysql_query($sql)) { echo "Table antable created successfully"; } else { echo "Error creating table: " . mysql_error(); } } //database area ends here //add to settings add_action('admin_menu', 'antracks_admin_actions'); function antracks_admin_actions(){ add_options_page('antracks','antracks','manage_options', _FILE_, 'antracks_admin'); } //GLOBAL VARIABLE $result5=array(); //this will be displayed on the Antracks Admin Settings, the admin will record the playlists' name, url and enable or disable autoplay function antracks_admin(){ ?>

ANTRACKS: a new YouTube Playlist GUI plugin for WordPress

Name Playlist:
YouTube Playlist URI:
copy and paste this shortcode to your post or page= [antracks]
".$explaylist[1]; //check if the values submitted are empty or not if($try!=NULL && $try!=NULL){ $arr2=$explaylist[1]; $playid = $explaylist[1]; //$arr3 = strtr ($arr2, array ('&' => '?')); //record to database $check= mysql_query("SELECT plname FROM antable WHERE plname='$pname'"); if(mysql_num_rows($check) != 0) { //do nothing if playlist name already exist } else { mysql_query("INSERT INTO antable (plname, pllink, autoplay)VALUES ('$pname','$playid','0')"); } echo "
"; } //choose playlist for shortcode from the saved playlists: $code = mysql_query("SELECT plname,autoplay FROM antable"); echo "
Choose a playlist: "; echo "Activate Autoplay: YesNo
"; if($_POST['playchoose']!=' '){ echo "

Copy paste this to your page or post:
"; echo "
Autoplay: "; $chosenplist = $_POST['playchoose']; ; //update autoplay status to daytabase $update = mysql_query("UPDATE antable SET autoplay='".$_POST[autoplayc]."' where plname='".$chosenplist."'"); $query = mysql_query("SELECT autoplay FROM antable where plname='".$chosenplist."'"); $datax = mysql_fetch_array($query); if($datax['autoplay']==1){ echo "YES"; } else{ echo "NO"; } } } //antracks_admin() ends here. function foobar_func($atts){ wp_enqueue_style( 'newantracks', plugins_url( 'tglobal.css', __FILE__ ), false, false, 'all' ); extract( shortcode_atts( array( 'id' => '$atts', ), $atts ) ); $resultfoo = mysql_query("SELECT pllink,autoplay FROM antable WHERE plname='$id'"); $row = mysql_fetch_array($resultfoo); //echo $row['pllink']; function getYoutubeImage($e){ //GET THE URL $url = $e; $queryString = parse_url($url, PHP_URL_QUERY); parse_str($queryString, $params); $v = $params['v']; //DISPLAY THE IMAGE if(strlen($v)>0){ echo ""; } } $playid = $row['pllink']; //$var = $row['autoplay'] $xml = simplexml_load_file("http://gdata.youtube.com/feeds/api/playlists/$playid"); echo ""; ?>
children('yt', true)->playlistId; $authorname=(string)$xml->author->name; echo "".(string)$xml->title.""; echo " by ".$authorname.''; ?>
entry as $value){ $result3[$r] = $value->link->attributes()->href; $title[$r] = $value->title; $result4[$r] = substr($result3[$r],31,-22); $result5[$r] = substr($result3[$r],31,-22); $number = $r; if($result4[$r]!=NULL){ $r++; } } $queryy = mysql_query("SELECT autoplay FROM antable where plname='".$id."'"); $dataxx = mysql_fetch_array($queryy); $aplay = $dataxx['autoplay']; ?> 1
entry as $value){ $result3[$r] = $value->link->attributes()->href; $result6[$r] = $value->author->name; $title[$r] = $value->title; $result4[$r] = substr($result3[$r],31,-22); $result5[$r] = substr($result3[$r],31,-22); $number = $r+1; if($result4[$r]!=NULL){ echo "
".$number."
"; echo ""; getYoutubeImage("http://www.youtube.com/watch?v=$result4[$r]"); echo "
".$title[$r]."
by ".$result6[$r]."
"; echo "
"; $r++; } } $queryy = mysql_query("SELECT autoplay FROM antable where plname='".$id."'"); $dataxx = mysql_fetch_array($queryy); $aplay = $dataxx['autoplay']; ?>