'.$msg.'

'; add_action('admin_notices', create_function("", 'echo \''.$notice.'\';')); } } function registerWidget() { $description = "The most recent posted videos and comments in your blog"; $options = array("classname" => "widget_text", "description" => $description); $id = "all-in-one-video-pack-widget"; $name = "Recent Videos Widget"; wp_register_sidebar_widget($id, $name, array(&$this, 'displayWidget'), $options); } function displayWidget($args) { extract($args); echo $before_widget; echo $before_title; echo 'Recent Videos'; echo $after_title; echo '
' . "\n"; echo ''.__("Posted Videos").' | ' . "\n"; echo ''.__("Video Comments").'' . "\n"; echo '
' . "\n"; echo '
Loading...
' . "\n"; echo '
' . "\n"; echo '' . "\n"; echo $after_widget; } function getVideoComments() { $page_size = 5; $page = (integer)(@$_GET["page"]); if ($page < 1) $page = 1; $widgets = KalturaWPModel::getLastPublishedCommentWidgets($page, $page_size); $total_count = KalturaWPModel::getLastPublishedCommentWidgetsCount(); if ($page * $page_size >= $total_count) $last_page = true; if ($page == 1) $first_page = true; echo '
'; if ($widgets) { echo ''; echo ''; } else { echo 'No video comments yet'; } echo '
'; } function getVideoPosts() { $page_size = 5; $page = (integer)(@$_GET["page"]); if ($page < 1) $page = 1; $widgets = KalturaWPModel::getLastPublishedPostWidgets($page, $page_size); $total_count = KalturaWPModel::getLastPublishedPostWidgetsCount(); if ($page * $page_size >= $total_count) $last_page = true; if ($page == 1) $first_page = true; echo '
'; if ($widgets) { echo ''; echo ''; } else { echo 'No posted videos yet'; } echo '
'; } } // initialize the plugin after all plugins are loaded because we depend on our main plugin add_action("plugins_loaded", create_function("", '$allInOneVideoWidget = new AllInOneVideoWidget();')); ?>