'video', //singular name of the listed records 'plural' => 'videos', //plural name of the listed records 'ajax' => false //does this table support ajax? ) ); } function column_default($item, $column_name){ switch($column_name){ case 'title': // case 'director': return $item[$column_name]; default: return print_r($item,true); //Show the whole array for troubleshooting purposes } } function column_title($item){ //Build row actions $actions = array( 'edit' => sprintf('Edit','prash_edit_video','edit',$item['id']), 'delete' => sprintf('Delete','prash_delete_video','delete',$item['id']), 'get_full_video_code' => sprintf('Get Video Code(Full)','prash_get_full_video_code','get_full_video_code',$item['id']), 'get_video_shortcode' => sprintf('Get Video Shortcode','prash_get_video_shortcode','get_video_shortcode',$item['id']), ); //Return the title contents return sprintf('%1$s (id:%2$s)%3$s', /*$1%s*/ $item['title'], /*$2%s*/ $item['id'], /*$3%s*/ $this->row_actions($actions) ); } function column_cb($item){ return sprintf( '', /*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("movie") /*$2%s*/ $item['id'] //The value of the checkbox should be the record's id ); } function get_columns(){ $columns = array( 'cb' => '', //Render a checkbox instead of text 'title' => 'Title' ); return $columns; } function get_sortable_columns() { $sortable_columns = array( 'title' => array('title',false) //true means it's already sorted ); return $sortable_columns; } function get_bulk_actions() { $actions = array( 'delete' => 'Delete' ); return $actions; } function process_bulk_action() { //Detect when a bulk action is being triggered... if( 'delete'===$this->current_action() ) { wp_die('Items deleted (or they would be if we had items to delete)!'); } } function prepare_items() { global $wpdb; //This is used only if making any database queries $all_videos_sql = "select id, title, vid from " . $wpdb->prefix . 'prash_videos'; $all_videos = $wpdb->get_results($all_videos_sql); $all_videos_arr = array(); foreach($all_videos as $my_video){ $temp_array = array( 'id' => $my_video->id, 'title' => $my_video->title ); array_push($all_videos_arr, $temp_array); } /** * First, lets decide how many records per page to show */ $per_page = 5; $columns = $this->get_columns(); $hidden = array(); $sortable = $this->get_sortable_columns(); $this->_column_headers = array($columns, $hidden, $sortable); $this->process_bulk_action(); $data = $this->example_data; $data = $all_videos_arr; function usort_reorder($a,$b){ $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'title'; //If no sort, default to title $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order return ($order==='asc') ? $result : -$result; //Send final sort direction to usort } usort($data, 'usort_reorder'); $current_page = $this->get_pagenum(); /** * REQUIRED for pagination. Let's check how many items are in our data array. * In real-world use, this would be the total number of items in your database, * without filtering. We'll need this later, so you should always include it * in your own package classes. */ $total_items = count($data); /** * The WP_List_Table class does not handle pagination for us, so we need * to ensure that the data is trimmed to only the current page. We can use * array_slice() to */ $data = array_slice($data,(($current_page-1)*$per_page),$per_page); /** * REQUIRED. Now we can add our *sorted* data to the items property, where * it can be used by the rest of the class. */ $this->items = $data; /** * REQUIRED. We also have to register our pagination options & calculations. */ $this->set_pagination_args( array( 'total_items' => $total_items, //WE have to calculate the total number of items 'per_page' => $per_page, //WE have to determine how many items to show on a page 'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages ) ); } } class Optinformtable extends WP_List_Table { function __construct(){ global $status, $page; //Set parent defaults parent::__construct( array( 'singular' => 'video', //singular name of the listed records 'plural' => 'videos', //plural name of the listed records 'ajax' => false //does this table support ajax? ) ); } /** ************************************************************************ * Recommended. This method is called when the parent class can't find a method * specifically build for a given column. Generally, it's recommended to include * one method for each column you want to render, keeping your package class * neat and organized. For example, if the class needs to process a column * named 'title', it would first see if a method named $this->column_title() * exists - if it does, that method will be used. If it doesn't, this one will * be used. Generally, you should try to use custom column methods as much as * possible. * * Since we have defined a column_title() method later on, this method doesn't * need to concern itself with any column with a name of 'title'. Instead, it * needs to handle everything else. * * For more detailed insight into how columns are handled, take a look at * WP_List_Table::single_row_columns() * * @param array $item A singular item (one full row's worth of data) * @param array $column_name The name/slug of the column to be processed * @return string Text or HTML to be placed inside the column **************************************************************************/ function column_default($item, $column_name){ switch($column_name){ case 'title': // case 'director': return $item[$column_name]; default: return print_r($item,true); //Show the whole array for troubleshooting purposes } } /** ************************************************************************ * Recommended. This is a custom column method and is responsible for what * is rendered in any column with a name/slug of 'title'. Every time the class * needs to render a column, it first looks for a method named * column_{$column_title} - if it exists, that method is run. If it doesn't * exist, column_default() is called instead. * * This example also illustrates how to implement rollover actions. Actions * should be an associative array formatted as 'slug'=>'link html' - and you * will need to generate the URLs yourself. You could even ensure the links * * * @see WP_List_Table::::single_row_columns() * @param array $item A singular item (one full row's worth of data) * @return string Text to be placed inside the column (movie title only) **************************************************************************/ function column_title($item){ //Build row actions $actions = array( // 'edit' => sprintf('Edit',$_REQUEST['page'],'edit',$item['id']), // 'delete' => sprintf('Delete',$_REQUEST['page'],'delete',$item['id']), 'edit' => sprintf('Edit','prash_edit_optin','edit',$item['id']), 'delete' => sprintf('Delete','prash_delete_optin','delete',$item['id']), // 'add_action' => sprintf('Manage Actions','prash_add_action','add_action',$item['id']), ); //Return the title contents return sprintf('%1$s (id:%2$s)%3$s', /*$1%s*/ $item['title'], /*$2%s*/ $item['id'], /*$3%s*/ $this->row_actions($actions) ); } /** ************************************************************************ * REQUIRED if displaying checkboxes or using bulk actions! The 'cb' column * is given special treatment when columns are processed. It ALWAYS needs to * have it's own method. * * @see WP_List_Table::::single_row_columns() * @param array $item A singular item (one full row's worth of data) * @return string Text to be placed inside the column (movie title only) **************************************************************************/ function column_cb($item){ return sprintf( '', /*$1%s*/ $this->_args['singular'], //Let's simply repurpose the table's singular label ("movie") /*$2%s*/ $item['id'] //The value of the checkbox should be the record's id ); } /** ************************************************************************ * REQUIRED! This method dictates the table's columns and titles. This should * return an array where the key is the column slug (and class) and the value * is the column's title text. If you need a checkbox for bulk actions, refer * to the $columns array below. * * The 'cb' column is treated differently than the rest. If including a checkbox * column in your table you must create a column_cb() method. If you don't need * bulk actions or checkboxes, simply leave the 'cb' entry out of your array. * * @see WP_List_Table::::single_row_columns() * @return array An associative array containing column information: 'slugs'=>'Visible Titles' **************************************************************************/ function get_columns(){ $columns = array( 'cb' => '', //Render a checkbox instead of text 'title' => 'Title' ); return $columns; } /** ************************************************************************ * Optional. If you want one or more columns to be sortable (ASC/DESC toggle), * you will need to register it here. This should return an array where the * key is the column that needs to be sortable, and the value is db column to * sort by. Often, the key and value will be the same, but this is not always * the case (as the value is a column name from the database, not the list table). * * This method merely defines which columns should be sortable and makes them * clickable - it does not handle the actual sorting. You still need to detect * the ORDERBY and ORDER querystring variables within prepare_items() and sort * your data accordingly (usually by modifying your query). * * @return array An associative array containing all the columns that should be sortable: 'slugs'=>array('data_values',bool) **************************************************************************/ function get_sortable_columns() { $sortable_columns = array( 'title' => array('title',false) //true means it's already sorted ); return $sortable_columns; } /** ************************************************************************ * Optional. If you need to include bulk actions in your list table, this is * the place to define them. Bulk actions are an associative array in the format * 'slug'=>'Visible Title' * * If this method returns an empty value, no bulk action will be rendered. If * you specify any bulk actions, the bulk actions box will be rendered with * the table automatically on display(). * * Also note that list tables are not automatically wrapped in
elements, * so you will need to create those manually in order for bulk actions to function. * * @return array An associative array containing all the bulk actions: 'slugs'=>'Visible Titles' **************************************************************************/ function get_bulk_actions() { $actions = array( 'delete' => 'Delete' ); return $actions; } /** ************************************************************************ * Optional. You can handle your bulk actions anywhere or anyhow you prefer. * For this example package, we will handle it in the class to keep things * clean and organized. * * @see $this->prepare_items() **************************************************************************/ function process_bulk_action() { //Detect when a bulk action is being triggered... if( 'delete'===$this->current_action() ) { wp_die('Items deleted (or they would be if we had items to delete)!'); } } /** ************************************************************************ * REQUIRED! This is where you prepare your data for display. This method will * usually be used to query the database, sort and filter the data, and generally * get it ready to be displayed. At a minimum, we should set $this->items and * $this->set_pagination_args(), although the following properties and methods * are frequently interacted with here... * * @global WPDB $wpdb * @uses $this->_column_headers * @uses $this->items * @uses $this->get_columns() * @uses $this->get_sortable_columns() * @uses $this->get_pagenum() * @uses $this->set_pagination_args() **************************************************************************/ function prepare_items() { global $wpdb; //This is used only if making any database queries $all_videos_sql = "select id, name from " . $wpdb->prefix . 'prash_optins'; $all_videos = $wpdb->get_results($all_videos_sql); $all_videos_arr = array(); foreach($all_videos as $my_video){ $temp_array = array( 'id' => $my_video->id, 'title' => $my_video->name ); array_push($all_videos_arr, $temp_array); } /** * First, lets decide how many records per page to show */ $per_page = 5; /** * REQUIRED. Now we need to define our column headers. This includes a complete * array of columns to be displayed (slugs & titles), a list of columns * to keep hidden, and a list of columns that are sortable. Each of these * can be defined in another method (as we've done here) before being * used to build the value for our _column_headers property. */ $columns = $this->get_columns(); $hidden = array(); $sortable = $this->get_sortable_columns(); /** * REQUIRED. Finally, we build an array to be used by the class for column * headers. The $this->_column_headers property takes an array which contains * 3 other arrays. One for all columns, one for hidden columns, and one * for sortable columns. */ $this->_column_headers = array($columns, $hidden, $sortable); /** * Optional. You can handle your bulk actions however you see fit. In this * case, we'll handle them within our package just to keep things clean. */ $this->process_bulk_action(); /** * Instead of querying a database, we're going to fetch the example data * property we created for use in this plugin. This makes this example * package slightly different than one you might build on your own. In * this example, we'll be using array manipulation to sort and paginate * our data. In a real-world implementation, you will probably want to * use sort and pagination data to build a custom query instead, as you'll * be able to use your precisely-queried data immediately. */ $data = $this->example_data; $data = $all_videos_arr; /** * This checks for sorting input and sorts the data in our array accordingly. * * In a real-world situation involving a database, you would probably want * to handle sorting by passing the 'orderby' and 'order' values directly * to a custom query. The returned data will be pre-sorted, and this array * sorting technique would be unnecessary. */ function usort_reorder($a,$b){ $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'title'; //If no sort, default to title $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order return ($order==='asc') ? $result : -$result; //Send final sort direction to usort } usort($data, 'usort_reorder'); /*********************************************************************** * --------------------------------------------------------------------- * vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv * * In a real-world situation, this is where you would place your query. * * For information on making queries in WordPress, see this Codex entry: * http://codex.wordpress.org/Class_Reference/wpdb * * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * --------------------------------------------------------------------- **********************************************************************/ /** * REQUIRED for pagination. Let's figure out what page the user is currently * looking at. We'll need this later, so you should always include it in * your own package classes. */ $current_page = $this->get_pagenum(); /** * REQUIRED for pagination. Let's check how many items are in our data array. * In real-world use, this would be the total number of items in your database, * without filtering. We'll need this later, so you should always include it * in your own package classes. */ $total_items = count($data); /** * The WP_List_Table class does not handle pagination for us, so we need * to ensure that the data is trimmed to only the current page. We can use * array_slice() to */ $data = array_slice($data,(($current_page-1)*$per_page),$per_page); /** * REQUIRED. Now we can add our *sorted* data to the items property, where * it can be used by the rest of the class. */ $this->items = $data; /** * REQUIRED. We also have to register our pagination options & calculations. */ $this->set_pagination_args( array( 'total_items' => $total_items, //WE have to calculate the total number of items 'per_page' => $per_page, //WE have to determine how many items to show on a page 'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages ) ); } } // function app_upgrademe() // { // return 'http://agilevideoplayer.com/latest.php'; // } function plugin_tables_install() { require_once( ABSPATH . '/wp-admin/includes/upgrade.php' ); global $wpdb; $db_table_actions = $wpdb->prefix . 'prash_actions'; $db_table_optins = $wpdb->prefix . 'prash_optins'; $db_table_relations = $wpdb->prefix . 'prash_relations'; $db_table_videos = $wpdb->prefix . 'prash_videos'; if( $wpdb->get_var( "SHOW TABLES LIKE '$db_table_actions'" ) != $db_table_actions ) { if ( ! empty( $wpdb->charset ) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty( $wpdb->collate ) ) $charset_collate .= " COLLATE $wpdb->collate"; $sql_actions = "CREATE TABLE " . $db_table_actions . " ( `id` int(11) NOT NULL AUTO_INCREMENT, `vid_id` int(11) NOT NULL, `form_id` int(11) DEFAULT NULL, `cta_text_color` varchar(10) DEFAULT NULL, `cta_bg_color` varchar(10) DEFAULT NULL, `cta_text` text NOT NULL, `img_url` text, `img_link` text, `act_type` varchar(10) NOT NULL, `show_seconds` int(3) NOT NULL DEFAULT '0', `entry_anim` varchar(15) DEFAULT NULL, `exit_anim` varchar(15) DEFAULT NULL, `on_pause` int(11) NOT NULL DEFAULT '0', `on_end` int(11) NOT NULL DEFAULT '0', `skipfb` int(11) NOT NULL DEFAULT '0', `skip_fb_text` varchar(50) NOT NULL, `skip_fb_text_color` varchar(10) DEFAULT NULL, `fbid` text, `fb_title` varchar(50) NOT NULL, `fb_title_color` varchar(10) DEFAULT NULL, `buy_now_code` int(11) NOT NULL DEFAULT '0', `buy_now_tp` text, `buy_now_link` text, `ct_bt_code` int(11) NOT NULL DEFAULT '0', `ct_bt_bgcolor` varchar(10) NOT NULL, `ct_bt_bcolor` varchar(10) NOT NULL, `ct_bt_tcolor` varchar(10) NOT NULL, `ct_bt_text` text, `ct_bt_link` text, `cta_template` varchar(10) NOT NULL, PRIMARY KEY (`id`), KEY `form_id` (`form_id`), KEY `vid_id` (`vid_id`) ) $charset_collate;"; dbDelta( $sql_actions ); } if( $wpdb->get_var( "SHOW TABLES LIKE '$db_table_optins'" ) != $db_table_optins ) { if ( ! empty( $wpdb->charset ) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty( $wpdb->collate ) ) $charset_collate .= " COLLATE $wpdb->collate"; $sql_optins = "CREATE TABLE " . $db_table_optins . " ( `id` int(11) NOT NULL AUTO_INCREMENT, `pre_form_name` varchar(10) NOT NULL, `ar` varchar(2) NOT NULL, `name` varchar(30) NOT NULL, `bg` varchar(10) NOT NULL, `headcolor` varchar(10) NOT NULL, `headtext` varchar(50) NOT NULL, `msgcolor` varchar(10) NOT NULL, `msgtext` varchar(100) NOT NULL, `butcolor` varchar(10) NOT NULL, `buttext` varchar(20) NOT NULL, `buttextcolor` varchar(10) NOT NULL, `emailvalidtxtcolor` varchar(10) NOT NULL, `skip_optin_text` int(11) NOT NULL DEFAULT '0', `skip_bt_text` varchar(50) NOT NULL, `optinskiptxtcolor` varchar(10) NOT NULL, `optinbordercolor` varchar(10) NOT NULL, `gr_key` varchar(50) DEFAULT NULL, `gr_campaign` varchar(50) DEFAULT NULL, `gr_track_id` varchar(100) DEFAULT NULL, `aw_key` varchar(50) DEFAULT NULL, `aw_secret` varchar(50) DEFAULT NULL, `aw_accessid` varchar(50) DEFAULT NULL, `aw_access_secret` varchar(50) DEFAULT NULL, `aw_ac_id` varchar(50) DEFAULT NULL, `aw_list_id` varchar(50) DEFAULT NULL, `aw_track_id` varchar(50) DEFAULT NULL, `mc_key` varchar(50) DEFAULT NULL, `mc_listid` varchar(50) DEFAULT NULL, `mc_trackid` varchar(100) DEFAULT NULL, `ic_key` varchar(50) DEFAULT NULL, `ic_list_id` varchar(50) DEFAULT NULL, `ic_uname` varchar(50) DEFAULT NULL, `ic_pass` varchar(50) DEFAULT NULL, `oa_key` varchar(50) DEFAULT NULL, `oa_sq` text, `oa_tag_name` varchar(100) DEFAULT NULL, `is_key` varchar(50) DEFAULT NULL, `is_fus_id` text, `is_tag_id` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) $charset_collate;"; dbDelta( $sql_optins ); } if( $wpdb->get_var( "SHOW TABLES LIKE '$db_table_relations'" ) != $db_table_relations ) { if ( ! empty( $wpdb->charset ) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty( $wpdb->collate ) ) $charset_collate .= " COLLATE $wpdb->collate"; $sql_relations = "CREATE TABLE " . $db_table_relations . " ( `id` int(11) NOT NULL AUTO_INCREMENT, `video_id` int(11) NOT NULL, `action_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) $charset_collate;"; dbDelta( $sql_relations ); } if( $wpdb->get_var( "SHOW TABLES LIKE '$db_table_videos'" ) != $db_table_videos ) { if ( ! empty( $wpdb->charset ) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty( $wpdb->collate ) ) $charset_collate .= " COLLATE $wpdb->collate"; $sql_videos = "CREATE TABLE " . $db_table_videos . " ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(50) NOT NULL, `vid` varchar(20) NOT NULL, `youtube` varchar(200) DEFAULT NULL, `width` int(11) NOT NULL, `height` int(11) NOT NULL, `dim` int(11) NOT NULL DEFAULT '0', `scroll_pause` int(11) NOT NULL DEFAULT '0', `autoplay` int(11) NOT NULL DEFAULT '0', `controls` int(11) NOT NULL DEFAULT '1', `auto_hide_cb` varchar(10) NOT NULL, `theme` varchar(10) NOT NULL, `vbordercolor` varchar(10) NOT NULL, `social_share` int(11) NOT NULL DEFAULT '0', `video_type` varchar(10) NOT NULL, `class` int(11) DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `mp4` varchar(200) DEFAULT NULL, `webm` varchar(200) DEFAULT NULL, `ogg` varchar(200) DEFAULT NULL, `poster` varchar(200) DEFAULT NULL, `loop` int(11) NOT NULL DEFAULT '0', `preload` int(11) NOT NULL DEFAULT '0', `responsive` int(11) DEFAULT NULL, `logo_brand_code` int(11) NOT NULL DEFAULT '0', `logo_pick` text, `logo_link` text, `logo_ps` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) $charset_collate;"; dbDelta( $sql_videos ); } } register_activation_hook(__FILE__, 'plugin_tables_install'); ////CREATING TABLES WHEN PLUGIN IS ACTIVATED END function Prash_Video_List(){ ?>

Upgrade to the full version for awesome marketing features. Click here >>

prepare_items(); ?>

My Videos


Add Video display() ?>

Available Actions


Create new action
update($wpdb->prefix.'prash_optins', array( 'name' => stripslashes_deep($_POST['name']), 'pre_form_name' => stripslashes_deep($_POST['pre_forms']), 'ar' => stripslashes_deep($_POST['ar']), 'bg' => stripslashes_deep($_POST['bg']), 'headcolor' => stripslashes_deep($_POST['headcolor']), 'headtext' => stripslashes_deep($_POST['headtext']), 'msgcolor' => stripslashes_deep($_POST['msgcolor']), 'msgtext' => stripslashes_deep($_POST['msgtext']), 'butcolor' => stripslashes_deep($_POST['butcolor']), 'buttext' => stripslashes_deep($_POST['buttext']), 'buttextcolor' => stripslashes_deep($_POST['buttextcolor']), 'emailvalidtxtcolor' => stripslashes_deep($_POST['emailvalidtxtcolor']), 'optinskiptxtcolor' => stripslashes_deep($_POST['optinskiptxtcolor']), 'skip_optin_text' => stripslashes_deep($_POST['skip_optin_form']), 'skip_bt_text' => stripslashes_deep($_POST['skip_optin_form_text']), 'optinbordercolor' => stripslashes_deep($_POST['o_border_color']), 'gr_key' => stripslashes_deep($_POST['grkey']), 'gr_campaign' => stripslashes_deep($_POST['getr_ca_id']), 'gr_track_id' => stripslashes_deep($_POST['getr_track_id']), 'aw_key' => stripslashes_deep($_POST['awkey']), 'aw_secret' => stripslashes_deep($_POST['awsecret']), 'aw_accessid' => stripslashes_deep($_POST['aweb_acc_id']), 'aw_access_secret' => stripslashes_deep($_POST['aweb_acc_sec']), 'aw_ac_id' => stripslashes_deep($_POST['aweb_acco_id']), 'aw_list_id' => stripslashes_deep($_POST['aweb_list_id']), 'aw_track_id' => stripslashes_deep($_POST['aweb_trac_id']), 'mc_key' => stripslashes_deep($_POST['mckey']), 'mc_listid' => stripslashes_deep($_POST['mailch_list_id']), 'mc_trackid' => stripslashes_deep($_POST['mailch_track_id']), 'ic_key' => stripslashes_deep($_POST['ickey']), 'ic_list_id' => stripslashes_deep($_POST['icon_list_id']), 'ic_uname' => stripslashes_deep($_POST['icon_api_user']), 'ic_pass' => stripslashes_deep($_POST['icon_api_pass']), 'oa_key' => stripslashes_deep($_POST['oakey']), 'oa_sq' => stripslashes_deep($_POST['offa_sq']), 'oa_tag_name' => stripslashes_deep($_POST['offa_tag_name']), 'is_key' => stripslashes_deep($_POST['iskey']), 'is_fus_id' => stripslashes_deep($_POST['insoft_fus_id']), 'is_tag_id' => stripslashes_deep($_POST['insoft_tag_id']) ), array('id' => $optin_id) , array('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%d','%s','%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ); if(0 < $save_check){ // echo "Optin form edited successfully"; wp_redirect("admin.php?page=prash_optin_forms&success_msg=" . urlencode("Optin form edited successfully")); exit(); return true; } else if(0 === $save_check){ // echo "Optin form edited successfully"; wp_redirect("admin.php?page=prash_optin_forms&success_msg=" . urlencode("Optin form edited successfully")); exit(); return true; }else if(false === $save_check){ // echo "Error while editing optin form"; wp_redirect("admin.php?page=prash_optin_forms&error_msg=" . urlencode("Error while editing optin form")); exit(); return false; } else{ //Do Nothing } // if($save_check){ // echo "Optin form edited successfully"; // // return true; // // }else{ // // echo "Error while editing optin form"; // //// echo $wpdb->print_error(); // // return false; // } }else{ echo "Optin Form not found"; } } elseif($_POST['mode'] == 'new'){ $save_check= $wpdb->insert($wpdb->prefix.'prash_optins', array( 'name' => stripslashes_deep($_POST['name']), 'pre_form_name' => stripslashes_deep($_POST['pre_forms']), 'ar' => stripslashes_deep($_POST['ar']), 'bg' => stripslashes_deep($_POST['bg']), 'headcolor' => stripslashes_deep($_POST['headcolor']), 'headtext' => stripslashes_deep($_POST['headtext']), 'msgcolor' => stripslashes_deep($_POST['msgcolor']), 'msgtext' => stripslashes_deep($_POST['msgtext']), 'butcolor' => stripslashes_deep($_POST['butcolor']), 'buttext' => stripslashes_deep($_POST['buttext']), 'buttextcolor' => stripslashes_deep($_POST['buttextcolor']), 'emailvalidtxtcolor' => stripslashes_deep($_POST['emailvalidtxtcolor']), 'optinskiptxtcolor' => stripslashes_deep($_POST['optinskiptxtcolor']), 'skip_optin_text' => stripslashes_deep($_POST['skip_optin_form']), 'skip_bt_text' => stripslashes_deep($_POST['skip_optin_form_text']), 'optinbordercolor' => stripslashes_deep($_POST['o_border_color']), 'gr_key' => stripslashes_deep($_POST['grkey']), 'gr_campaign' => stripslashes_deep($_POST['getr_ca_id']), 'gr_track_id' => stripslashes_deep($_POST['getr_track_id']), 'aw_key' => stripslashes_deep($_POST['awkey']), 'aw_secret' => stripslashes_deep($_POST['awsecret']), 'aw_accessid' => stripslashes_deep($_POST['aweb_acc_id']), 'aw_access_secret' => stripslashes_deep($_POST['aweb_acc_sec']), 'aw_ac_id' => stripslashes_deep($_POST['aweb_acco_id']), 'aw_list_id' => stripslashes_deep($_POST['aweb_list_id']), 'aw_track_id' => stripslashes_deep($_POST['aweb_trac_id']), 'mc_key' => stripslashes_deep($_POST['mckey']), 'mc_listid' => stripslashes_deep($_POST['mailch_list_id']), 'mc_trackid' => stripslashes_deep($_POST['mailch_track_id']), 'ic_key' => stripslashes_deep($_POST['ickey']), 'ic_list_id' => stripslashes_deep($_POST['icon_list_id']), 'ic_uname' => stripslashes_deep($_POST['icon_api_user']), 'ic_pass' => stripslashes_deep($_POST['icon_api_pass']), 'oa_key' => stripslashes_deep($_POST['oakey']), 'oa_sq' => stripslashes_deep($_POST['offa_sq']), 'oa_tag_name' => stripslashes_deep($_POST['offa_tag_name']), 'is_key' => stripslashes_deep($_POST['iskey']), 'is_fus_id' => stripslashes_deep($_POST['insoft_fus_id']), 'is_tag_id' => stripslashes_deep($_POST['insoft_tag_id']) ), array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )); if(0 < $save_check){ wp_redirect("admin.php?page=prash_optin_forms&success_msg=" . urlencode("Optin Form Created Successfully")); exit(); return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=prash_optin_forms&success_msg=" . urlencode("Optin Form Created Successfully")); exit(); return true; }else if(false === $save_check){ wp_redirect("admin.php?page=prash_optin_forms&error_msg=" . urlencode("Error creating optin form")); exit(); return false; } else{ //Do Nothing } } //Create an instance of our package class... $optinListTable = new Optinformtable(); //Fetch, prepare, sort, and filter our data... $optinListTable->prepare_items(); ?>

My Optin Forms


Create
display() ?>
delete( $wpdb->prefix ."prash_optins", array('id' => $form_id )); $delete_action_optin_form = $wpdb->delete( $wpdb->prefix ."prash_actions", array('form_id' => $form_id )); if($delete_optin_form){ wp_redirect("admin.php?page=prash_optin_forms&success_msg=" . urlencode("Optin Form deleted successfully.")); exit(); // echo "Optin Form deleted successfully."; return true; }else{ wp_redirect("admin.php?page=prash_optin_forms&error_msg=" . urlencode("Error while deleting Optin Form")); exit(); // echo "Error while deleting Optin Form"; return false; } } function prash_delete_optin_form(){ global $wpdb; $form_id = $_REQUEST['id']; ?>

Are you sure want to delete Optin form?


prefix . 'prash_optins'; $optin_id = $_REQUEST['id']; $optin_edit = $wpdb->get_row("SELECT * FROM " . $optin_table . " where id = " .$optin_id); ?>

Edit Optin Form

Form name

Prebuild Forms

Autoresponder

Form background color


Heading color


Heading text

Message color


Message  text

Button color


Button text color


Button text

Email validation text color


Optin Border color


Skip Optin form?


Skip Optin form text

Skip optin text color



Header
Message
Please enter a valid email id

Skip this step >>

** - Please select any autoresponder to save optin form





"; print_r($shortcode_tags); echo ""; ?>

Create new Optin Form

Select from pre-created optin forms to start creating beautiful customizable forms for your videos.


Create actions

Actions are interactive elements/features that you can add to your videos. Select from the list below to create a new action.

prefix . "prash_videos"; $video_url = esc_html($_POST["youtube_url"]); if(strpos($video_url, 'http') === 0) { }else{ $video_url = "http://" . $video_url; echo "inloop"; } echo "video url: " . $video_url; $videoid = getYouTubeVideoId($video_url); echo "video id: " . $videoid; $wpdb->show_errors(); if($videoid != "" && $videoid != null){ $save_check= $wpdb->insert($wpdb->prefix.'prash_videos', array( 'vid' => uniqid(), 'title' => esc_html($_POST["title"]), 'youtube' => $videoid, 'width' => $_POST["width"], 'height' => $_POST["height"], 'autoplay' => $_POST["autoplay"], 'dim' => $_POST["dim"], 'scroll_pause' => $_POST["scroll"], 'controls' => $_POST["show_controls"], 'auto_hide_cb' => $_POST["auto_hide_control_bar"], 'theme' => $_POST["player_theme"], 'vbordercolor' => $_POST["v_border_color"], 'social_share' => $_POST["s_share"], 'logo_brand_code' => $_POST["logo_brand"], 'logo_ps' => $_POST["logo_brand_position"], 'logo_pick' => $_POST["logo_pick"], 'logo_link' => $_POST["lk_logo"] ), array( '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s', '%d', '%d', '%d', '%s', '%s' )); }else{ echo "Please check the Youtube video URL and try again." ; // echo $wpdb->print_error(); return false; } if(0 < $save_check){ wp_redirect("admin.php?page=Prash_Video_List&success_msg=" . urlencode("Video Created Successfully")); exit(); // echo "Video Created Successfully"; return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=Prash_Video_List&success_msg=" . urlencode("Video Created Successfully")); exit(); // echo "Video Created Successfully"; return true; }else if(false === $save_check){ wp_redirect("admin.php?page=Prash_Video_List&error_msg=" . urlencode("Error creating video")); exit(); // echo "Error creating video"; return false; } else{ //Do Nothing } } function prash_choose_action_form(){ ?>

Choose Feature

Upgrade to the full version of Agile Video Player for awesome marketing features. Click here >>

Add New Video

Form name

Prebuild Forms

Autoresponder

Form background color


Heading color


Heading text

Message color


Message  text

Button color


Button text color


Button text

Email validation text color


Optin Border color


Skip Optin form?


Skip Optin form text

Skip optin text color


** - Please select any autoresponder to create optin form.
If there is no option to select any autoresponder then save
your autoresponder credentials in Autoresponder Settings
for selection.







Header
Message
Please enter a valid email id

Skip this step >>
Title

Youtube Video URL

Width

Height

Autoplay


Dim background while playing


Show Controls


Auto Hide Control Bar

Theme

Video Border color


Share Video option?


Add Logo For Branding?

Logo Position:




show_errors(); $video_id = $_REQUEST['video']; $mode = $_POST['mode']; if($mode == 'add'){ $save_check= $wpdb->insert($wpdb->prefix.'prash_actions', array( 'vid_id' => stripslashes_deep($_POST['video']), 'form_id' => stripslashes_deep($_POST['form_id']), 'act_type' => stripslashes_deep($_POST['action_type']), 'show_seconds' => stripslashes_deep($_POST['seconds_in']), 'entry_anim' => stripslashes_deep($_POST['entry_anim']), 'exit_anim' => stripslashes_deep($_POST['exit_anim']), 'on_pause' => stripslashes_deep($_POST['show_pause']), 'on_end' => stripslashes_deep($_POST['show_end']) ), array( '%d', '%d', '%s', '%d', '%s', '%s', '%d', '%d' )); if(0 < $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Action Created Successfully")); exit(); // echo "Action Created Successfully"; return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Action Created Successfully")); exit(); // echo "Action Created Successfully"; return true; }else if(false === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&error_msg=" . urlencode("Error creating action")); exit(); // echo "Error creating action"; return false; } else{ //Do Nothing } } $video_table = $wpdb->prefix.'prash_videos'; $optin_forms_table = $wpdb->prefix.'prash_optins'; $video_row = $wpdb->get_row("SELECT title FROM " . $video_table . " where id = " .$video_id); $all_optins_sql = "select id, name from " . $optin_forms_table; $all_optins = $wpdb->get_results($all_optins_sql); ?>

Add optin form to video

Add an optin form to your video. The optin form will be overlayed after the number of seconds entered below.

Video: title ?>

Choose Optin Form:


Show in seconds:
seconds

Show on pause?

Show at end of video?





show_errors(); $video_id = $_REQUEST['video']; $mode = $_REQUEST['mode']; $action_id = $_REQUEST['id']; if($mode == 'edit'){ $save_check = $wpdb->update( $wpdb->prefix.'prash_actions', array( 'vid_id' => stripslashes_deep($_POST['video']), 'form_id' => stripslashes_deep($_POST['form_id']), 'act_type' => stripslashes_deep($_POST['action_type']), 'show_seconds' => stripslashes_deep($_POST['seconds_in']), 'entry_anim' => stripslashes_deep($_POST['entry_anim']), 'exit_anim' => stripslashes_deep($_POST['exit_anim']), 'on_pause' => stripslashes_deep($_POST['show_pause']), 'on_end' => stripslashes_deep($_POST['show_end']) ), array( 'ID' => $action_id ), array( '%d', '%d', '%s', '%d', '%s', '%s', '%d', '%d' ), array( '%d' ) ); if(0 < $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Action Edited Successfully")); exit(); // echo "Action Edited Successfully"; return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Action Edited Successfully")); exit(); // echo "Action Edited Successfully"; return true; }else if(false === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&error_msg=" . urlencode("Error editing action")); exit(); // echo "Error editing action"; return false; } else{ //Do Nothing } } $video_table = $wpdb->prefix.'prash_videos'; $actions_table = $wpdb->prefix.'prash_actions'; $optin_forms_table = $wpdb->prefix.'prash_optins'; $video_row = $wpdb->get_row("SELECT title FROM " . $video_table . " where id = " .$video_id); $all_optins_sql = "select * from " . $optin_forms_table ; $all_optins = $wpdb->get_results($all_optins_sql); $action_row = $wpdb->get_row("select * from " . $actions_table . " where id=" . $action_id); ?>

Edit optin form action

Video: title ?>

Choose Optin Form:

Show optin in seconds:


Show optin on pause?

Show optin at end of video?





show_errors(); $fbappid = stripslashes_deep($_POST['fbappid']); $seconds = stripslashes_deep($_POST['seconds']); $vid_id = stripslashes_deep($_POST['video_id']); $save_check = null; if(strlen($fbappid) > 3){ $save_check= $wpdb->insert($wpdb->prefix.'prash_actions', array( 'vid_id' => stripslashes_deep($_POST['video_id']), 'act_type' => 'fblike', 'show_seconds' => stripslashes_deep($_POST['in_seconds']), 'skipfb' => stripslashes_deep($_POST['skipfblike']), 'skip_fb_text' => stripslashes_deep($_POST['fb_skip_text']), 'skip_fb_text_color' => stripslashes_deep($_POST['fb_skip_text_color']), 'fbid' => stripslashes_deep($_POST['fbappid']), 'fb_title' => stripslashes_deep($_POST['fb_title']), 'fb_title_color' => stripslashes_deep($_POST['fb_tcolor']) ), array('%s', '%s', '%d', '%d', '%s', '%s', '%s', '%s', '%s')); if(0 < $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $vid_id ."&success_msg=" . urlencode("Saved successfully")); exit(); // echo "Saved successfully"; return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $vid_id ."&success_msg=" . urlencode("Saved successfully")); exit(); // echo "Saved successfully"; return true; }else if(false === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $vid_id ."&error_msg=" . urlencode("Error while saving form")); exit(); // echo "Error while saving form"; return false; } else{ //Do Nothing } }else{ $save_check= $wpdb->insert($wpdb->prefix.'prash_actions', array( 'vid_id' => stripslashes_deep($_POST['video_id']), 'act_type' => 'fblike', 'show_seconds' => stripslashes_deep($_POST['in_seconds']), 'skipfb' => stripslashes_deep($_POST['skipfblike']), 'skip_fb_text' => stripslashes_deep($_POST['fb_skip_text']), 'skip_fb_text_color' => stripslashes_deep($_POST['fb_skip_text_color']), 'fb_title' => stripslashes_deep($_POST['fb_title']), 'fb_title_color' => stripslashes_deep($_POST['fb_tcolor']) ), array('%s', '%s', '%d', '%d', '%s', '%s', '%s', '%s')); if(0 < $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $vid_id ."&success_msg=" . urlencode("Saved successfully")); exit(); // echo "Saved successfully"; return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $vid_id ."&success_msg=" . urlencode("Saved successfully")); exit(); // echo "Saved successfully"; return true; }else if(false === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $vid_id ."&error_msg=" . urlencode("Error while saving form")); exit(); // echo "Error while saving form"; return false; } else{ //Do Nothing } } } function prash_add_cta_ok(){ global $wpdb; $wpdb->show_errors(); $action_type = stripslashes_deep($_POST['cta_type']); $video_id = $_REQUEST['video_id']; if($action_type == 'ctat'){ $save_check= $wpdb->insert($wpdb->prefix.'prash_actions', array( 'vid_id' => stripslashes_deep($_POST['video_id']), 'act_type' => stripslashes_deep($_POST['cta_type']), 'cta_text' => stripslashes_deep($_POST['call_to_text']), 'img_link' => stripslashes_deep($_POST['img_link']), 'show_seconds' => stripslashes_deep($_POST['seconds_in']), 'cta_text_color' => stripslashes_deep($_POST['cta_text_color']), 'cta_bg_color' => stripslashes_deep($_POST['cta_bg_color']), 'buy_now_code' => stripslashes_deep($_POST['buy_now_req']), 'buy_now_tp' => stripslashes_deep($_POST['buy_now_bt']), 'buy_now_link' => stripslashes_deep($_POST['buy_now_link']), 'ct_bt_code' => stripslashes_deep($_POST['custom_bt_req']), 'ct_bt_bgcolor' => stripslashes_deep($_POST['custom_bt_color']), 'ct_bt_bcolor' => stripslashes_deep($_POST['custom_bt_border_color']), 'ct_bt_tcolor' => stripslashes_deep($_POST['custom_bt_text_color']), 'ct_bt_text' => stripslashes_deep($_POST['custom_bt_text']), 'ct_bt_link' => stripslashes_deep($_POST['custom_bt_link']), 'cta_template' => stripslashes_deep($_POST['cta_temp']) ), array( '%d', '%s', '%s', '%s', '%d', '%s', '%s', '%d', '%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s' )); if(0 < $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Call-To-Action added successfully")); exit(); // echo "Call-To-Action added successfully"; return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Call-To-Action added successfully")); exit(); // echo "Call-To-Action added successfully"; return true; }else if(false === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&error_msg=" . urlencode("Error adding call to action")); exit(); // echo "Error adding call to action"; return false; } else{ //Do Nothing } } } function prash_edit_fblike_form(){ global $wpdb; $wpdb->show_errors(); $video_id = $_REQUEST['video']; $action_id = $_REQUEST['id']; // echo "Action: " . $action_id; // echo "Video: " . $video_id; if($video_id == null || $action_id == null || $video_id == '' || $action_id == '' ){ echo "Error: Incomplete values. Please try again."; }else { if($_REQUEST['mode'] == 'edit'){ $save_check = $wpdb->update( $wpdb->prefix.'prash_actions', array( 'show_seconds' => stripslashes_deep($_POST['seconds_in']), 'skipfb' => stripslashes_deep($_POST['skipfblike']), 'skip_fb_text' => stripslashes_deep($_POST['fb_skip_text']), 'skip_fb_text_color' => stripslashes_deep($_POST['fb_skip_text_color']), 'fbid' => stripslashes_deep($_POST['fbappid']), 'fb_title' => stripslashes_deep($_POST['fb_title']), 'fb_title_color' => stripslashes_deep($_POST['fb_tcolor']) ), array( 'id' => $action_id ), array( '%d', '%d', '%s', '%s', '%s', '%s', '%s' ), array('%d') ); if(0 < $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Edited successfully")); exit(); // echo "Edited successfully"; return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Edited successfully")); exit(); // echo "Edited successfully"; return true; }else if(false === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&error_msg=" . urlencode("Error editing Call to action. Please try again")); exit(); // echo "Error editing Call to action. Please try again"; return false; } else{ //Do Nothing } } $action_table = $wpdb->prefix . 'prash_actions'; $action_row = $wpdb->get_row("SELECT * FROM " . $action_table . " where id = " .$action_id); $video_table = $wpdb->prefix . 'prash_videos'; $video_row = $wpdb->get_row("SELECT title FROM " . $video_table . " where id = " .$video_id); ?>

Edit Facebook "Like" Button

Over video: title?>


Facebook App ID (optional):
Show after (in seconds):
Allow user to "skip": skipfb == 1) echo " checked " ?> name="skipfblike" id="checkboxes-0" value=1>

Skip fb text:

Skip fb text color:

Message text:

Message color:

update( $wpdb->prefix.'prash_actions', array( 'vid_id' => stripslashes_deep($_POST['video']), 'act_type' => stripslashes_deep($_POST['cta_type']), 'cta_text' => stripslashes_deep($_POST['call_to_text']), 'img_link' => stripslashes_deep($_POST['img_link']), // 'img_url' => stripslashes_deep($_POST['img_url']), 'show_seconds' => stripslashes_deep($_POST['seconds_in']), 'cta_text_color' => stripslashes_deep($_POST['cta_text_color']), 'cta_bg_color' => stripslashes_deep($_POST['cta_bg_color']), 'buy_now_code' => stripslashes_deep($_POST['buy_now_req']), 'buy_now_tp' => stripslashes_deep($_POST['buy_now_bt']), 'buy_now_link' => stripslashes_deep($_POST['buy_now_link']), 'ct_bt_code' => stripslashes_deep($_POST['custom_bt_req']), 'ct_bt_bgcolor' => stripslashes_deep($_POST['custom_bt_color']), 'ct_bt_bcolor' => stripslashes_deep($_POST['custom_bt_border_color']), 'ct_bt_tcolor' => stripslashes_deep($_POST['custom_bt_text_color']), 'ct_bt_text' => stripslashes_deep($_POST['custom_bt_text']), 'ct_bt_link' => stripslashes_deep($_POST['custom_bt_link']), 'cta_template' => stripslashes_deep($_POST['cta_temp']) ), array( 'ID' => $action_id ), array( '%d', '%s', '%s', '%s', // '%s', '%d', '%s', '%s', '%d', '%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s' ), array( '%d' ) ); if(0 < $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Call to action edited successfully")); exit(); // echo "Call to action edited successfully"; return true; } else if(0 === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&success_msg=" . urlencode("Call to action edited successfully")); exit(); // echo "Call to action edited successfully"; return true; }else if(false === $save_check){ wp_redirect("admin.php?page=prash_add_action&video=". $video_id ."&error_msg=" . urlencode("Error editing Call to action. Please try again")); exit(); // echo "Error editing Call to action. Please try again"; return false; } else{ //Do Nothing } } $video_table = $wpdb->prefix . 'prash_videos'; $action_table = $wpdb->prefix . 'prash_actions'; $video_row = $wpdb->get_row("SELECT * FROM " . $video_table . " where id = " .$video_id); $action_row = $wpdb->get_row("SELECT * FROM " . $action_table . " where id = " .$action_id); ?>

Edit Call-To-Action

On video: title?>


Select type:

Background Color


Select Template:

Call to action Content:

Preview


Show CTA in seconds:





$video_id = substr($url['path'], 1); } elseif (strcasecmp($url['host'], 'www.youtube.com') === 0) { if (isset($url['query'])) { parse_str($url['query'], $url['query']); if (isset($url['query']['v'])) { #### (dontcare)://www.youtube.com/(dontcare)?v=