show_errors(); $table_name = $wpdb->prefix ."fbvacomments"; $wpdb->insert( $table_name, array( 'Comment' =>$fbvaComment, 'campaign' => $campaign ) ); } $spintaxtut = plugin_dir_url(__FILE__ ).'spintax.html'; echo"
Comment
"; echo"

How Do I Use Spintax?

"; echo '
'; $wp_list_table = new fbdiComments_Table(); $wp_list_table->prepare_items($campaign); $wp_list_table->display(); echo '
'; } show_errors(); $table_name = $wpdb->prefix ."fbvareplies"; $wpdb->insert( $table_name, array( 'Comment' =>$fbvaComment, 'campaign' => $campaign ) ); } $spintaxtut = plugin_dir_url(__FILE__ ).'spintax.html'; echo"
Reply
"; echo"

How Do I Use Spintax?

"; echo '
'; $wp_list_table = new fbdiReplies_Table(); $wp_list_table->prepare_items($campaign); $wp_list_table->display(); echo '
'; } '; $wp_list_table = new fbdiLog_Table(); $wp_list_table->prepare_items($campaign); $wp_list_table->display(); echo ''; } jQuery(document).ready(function () { jQuery('.ToggleSwitchSample').toggleSwitch(); }); function validateMyForm(){ var name = jQuery('#campaignname').val(); var id = jQuery('#fanpageid').val(); var keyword = jQuery('#keyword1').val(); if (name =='') { alert('please enter campaign name!'); return false; } if (id =='') { alert('please enter facebook page id!'); return false; } if (keyword =='') { alert('please enter at least one keyword!'); return false; } return true; } function changeStatus(id){ request = jQuery.ajax({ type: 'post', url: '".$setstatus."', data: { id: id} }) .done(function( msg ) { }); } "; if(isset($_POST['fbdiNewCampaign'])){ $table_name = $wpdb->prefix ."fbvaCampaigns"; $results = $wpdb->get_results( " SELECT * FROM $table_name " ,ARRAY_A); $wpdb->insert( $table_name, array( 'name' =>'' ) ); $id = $wpdb->insert_id; $_GET['edit'] = $id; echo""; } if(isset($_GET['edit'])){ fbva_editcampaigns($_GET['edit']); } else{ if(isset($_GET['delete'])){ $table_name = $wpdb->prefix ."fbvaCampaigns"; $wpdb->delete( $table_name, array( 'id' =>$_GET['delete'] ) ); } echo '
'.FBDIDATAIMPORT.'

Campaigns


'; echo "
"; echo '
'; $wp_list_table = new fbdiCampaigns(); $wp_list_table->prepare_items(); $wp_list_table->display(); echo '
'; } } function fbva_editcampaigns($id){ global $pagenow; global $wpdb; $wpdb->show_errors(); $table_name = $wpdb->prefix ."fbvaCampaigns"; $query = "SELECT name FROM $table_name WHERE id = $id"; $querydata = $wpdb->get_row($query); $name = $querydata->name; echo '
'.FBDIDATAIMPORT.'

'. $name.'


'; //generic HTML and code goes here if ( isset ( $_GET['tab'] ) ) fbva_admin_tabs($_GET['tab'], $id); else fbva_admin_tabs('settings', $id); } function fbva_admin_tabs( $current = 'settings' ,$campaign) { $campaign = $_GET['edit']; $tabs = array( 'settings' => 'Campaign Settings', 'pages' => 'Hot Pages', 'comments' => 'Comments','replies' => 'Replies','log'=>'Log', 'growth'=>'Growth'); echo '

'; echo ''; if ( isset ( $_GET['tab'] ) ) $tab = $_GET['tab']; else $tab = 'settings'; switch ( $tab ){ case 'settings' : fbva_campaign_settings($campaign); break; case 'pages': fbdi_search_data($campaign); break; case 'comments': fbdi_commenter($campaign); break; case 'replies': fbdi_replies($campaign); break; case 'log': fbdi_log($campaign); break; case 'growth': fbdi_growth($campaign); break; } } function fbva_campaign_settings($campaign){ global $wpdb; if(isset($_POST['fbdiSaveSettings'])){ $keyword1 = trim($_POST['keyword1']); $keyword2 = trim($_POST['keyword2']); $keyword3 = trim($_POST['keyword3']); $campaignname = trim($_POST['campaignname']); $fbpageid = trim($_POST['fbpageid']); update_post_meta('999911115', $campaign.'fbvakeyword1', $keyword1 ); update_post_meta('999911115', $campaign.'fbvakeyword2', $keyword2 ); update_post_meta('999911115', $campaign.'fbvakeyword3', $keyword3 ); update_post_meta('999911115', $campaign.'fbpageid', $fbpageid ); update_post_meta('999911115', $campaign.'campaignname', $campaignname ); $table_name = $wpdb->prefix ."fbvaCampaigns"; $wpdb->update( $table_name, array( 'name' => $campaignname // string ), array( 'id' => $campaign )); $successmessage = " Settings Saved"; } $keyword1 = get_post_meta(999911115,$campaign.'fbvakeyword1', TRUE); $keyword2 = get_post_meta(999911115,$campaign.'fbvakeyword2', TRUE); $keyword3 = get_post_meta(999911115,$campaign.'fbvakeyword3', TRUE); $fbpageid = get_post_meta(999911115,$campaign.'fbpageid', TRUE); $campaignname = get_post_meta(999911115,$campaign.'campaignname', TRUE); echo "

Campaign Name:
Facebook Page ID:
Keyword 1:
Keyword 2:
Keyword 3:
".$successmessage."
"; } prefix ."likesgrowth"; $query = "SELECT likes FROM $table_name WHERE campaign ='$campaign' ORDER BY time desc "; $results = $wpdb->get_results($query); $i = 0; $data = array(); foreach ($results as $result){ if ($i == 7){ break; } $data[$i] = $result->likes; $i++; } for ($i = 0; $i<7; $i++){ if (empty($data[$i])){ $data[$i] = 0; } } echo'
'; echo "
"; echo 'test canvas'; echo "
"; }