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
";
}
//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 "";
?>