/inc/plugins/automedia.php
PHP | 2427 lines | 1969 code | 226 blank | 232 comment | 383 complexity | c6315204ee4a709333f533fedad7cc64 MD5 | raw file
Possible License(s): GPL-3.0
- <?php
- /**
- * Plugin Name: AutoMedia for MyBB 1.6.*
- * Copyright Š 2011 doylecc
- * http://community.mybb.com/user-14694.html
- *
- *This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>
- */
-
-
- // Disallow direct access to this file for security reasons
- if(!defined("IN_MYBB"))
- {
- die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
- }
-
- //Add Hooks #####################################################################################################
- $plugins->add_hook("parse_message", "automedia_run");
- $plugins->add_hook("parse_message", "automedia_adult_run");
- $plugins->add_hook("parse_message", "automedia_oldyt_run");
- $plugins->add_hook("usercp_start", "ucp_automedia_status");
- $plugins->add_hook("usercp_start", "userautomedia");
- $plugins->add_hook("postbit", "automedia_hide");
- $plugins->add_hook("postbit_prev", "automedia_hide");
- $plugins->add_hook("postbit_pm", "automedia_hide");
- $plugins->add_hook("postbit", "automedia_count");
- $plugins->add_hook("postbit_prev", "automedia_count");
- $plugins->add_hook("postbit_pm", "automedia_count");
- $plugins->add_hook("pre_output_page", "amsigpreview");
- $plugins->add_hook("toolbar_container_collect", "automedia_collect");
- $plugins->add_hook("toolbar_container_collect", "amplaylist_collect");
-
-
- //Plugin Info ##################################################################################################
- function automedia_info()
- {
- global $lang;
-
- $lang->load("automedia");
-
- $am_info = array(
- "name" => "Auto Media",
- "description" => $lang->av_plugin_descr,
- "website" => "http://mods.mybb.com/",
- "author" => "doylecc",
- "authorsite" => "http://community.mybb.com/user-14694.html",
- "version" => "1.1.10",
- "guid" => "ed9c97754efa977edba8a463ab98272a",
- "compatibility" => "14*,16*"
- );
- //Add cURL status to info
- if(automedia_is_installed())
- {
- $am_info['description'] .= @automedia_curl_status();
- }
- return $am_info;
- }
-
- //Get cURL status ##############################################################################################
- function automedia_curl_status()
- {
- global $lang;
-
- $unsupported = $lang->av_unsupported;
-
- if (!function_exists('curl_init'))
- {
- $status .= " <ul><li style=\"list-style-image: url(styles/default/images/icons/warning.gif)\">"
- .$unsupported
- ."</li></ul>\n";
- }
- else
- {
- $status = "";
- }
- return $status;
- }
-
-
- //Plugin installed? ############################################################################################
- function automedia_is_installed()
- {
- global $db;
-
- $query = $db->simple_select('settings','*','name="av_signature"');
- $installed = $db->fetch_array($query);
-
- if($installed)
- {
- return true;
- }
- return false;
- }
-
-
- //Install the Plugin ###########################################################################################
- function automedia_install()
- {
- global $db, $mybb, $lang;
-
- if($db->field_exists('automedia_use', 'users'))
- {
- $db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP COLUMN automedia_use");
- }
-
- // DELETE ALL SETTINGS TO AVOID DUPLICATES
- $query = $db->simple_select('settinggroups','gid','name="AutoMedia Sites"');
- $ams = $db->fetch_array($query);
- $db->delete_query('settinggroups',"gid='".$ams['gid']."'");
- $query2 = $db->simple_select('settinggroups','gid','name="AutoMedia Global"');
- $amg = $db->fetch_array($query2);
- $db->delete_query('settinggroups',"gid='".$amg['gid']."'");
- $query3 = $db->simple_select('settinggroups','gid','name="AutoMedia"');
- $am = $db->fetch_array($query3);
- $db->delete_query('settinggroups',"gid='".$am['gid']."'");
-
- // Delete Settings
- $db->delete_query('settings',"gid='".$ams['gid']."'");
- $db->delete_query('settings',"gid='".$amg['gid']."'");
- $db->delete_query('settings',"gid='".$am['gid']."'");
-
- /**
- *
- * Add Settings
- *
- **/
- $query = $db->simple_select("settinggroups", "COUNT(*) as rows");
- $rows = $db->fetch_field($query, "rows");
-
- // Add Settinggroup for Videosites
- $automedia_group = array(
- "name" => "AutoMedia Sites",
- "title" => "AutoMedia Sites",
- "description" => $lang->av_group_sites_descr,
- "disporder" =>$rows+2,
- "isdefault" => 0
- );
- $db->insert_query("settinggroups", $automedia_group);
- $gid = $db->insert_id();
-
- //Add Settinggroup for Global Settings
- $automedia2_group = array(
- "name" => "AutoMedia Global",
- "title" => "AutoMedia Global",
- "description" => $lang->av_group_global_descr,
- "disporder" => $rows+1,
- "isdefault" => 0
- );
- $db->insert_query("settinggroups", $automedia2_group);
- $gid2 = $db->insert_id();
-
- // Add Settings for Global Settinggroup
- $automedia2_1 = array(
- "name" => "av_enable",
- "title" => $lang->av_enable_title,
- "description" => $lang->av_enable_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 1,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_1);
-
- $automedia2_2 = array(
- "name" => "av_guest",
- "title" => $lang->av_guest_title,
- "description" => $lang->av_guest_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 2,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_2);
-
- $automedia2_3 = array(
- "name" => "av_groups",
- "title" => $lang->av_groups_title,
- "description" => $lang->av_groups_descr,
- "optionscode" => "text",
- "value" => 0,
- "disporder" => 3,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_3);
-
- $automedia2_4 = array(
- "name" => "av_forums",
- "title" => $lang->av_forums_title,
- "description" => $lang->av_forums_descr,
- "optionscode" => "text",
- "value" => 0,
- "disporder" => 4,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_4);
-
- $automedia2_5= array(
- "name" => "av_adultsites",
- "title" => $lang->av_adultsites_title,
- "description" => $lang->av_adultsites_descr,
- "optionscode" => "yesno",
- "value" => 0,
- "disporder" => 5,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_5);
-
- $automedia2_6 = array(
- "name" => "av_adultguest",
- "title" => $lang->av_adultguest_title,
- "description" => $lang->av_adultguest_descr,
- "optionscode" => "yesno",
- "value" => 0,
- "disporder" => 6,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_6);
-
- $automedia2_7 = array(
- "name" => "av_adultgroups",
- "title" => $lang->av_adultgroups_title,
- "description" => $lang->av_adultgroups_descr,
- "optionscode" => "text",
- "value" => 0,
- "disporder" => 7,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_7);
-
- $automedia2_8 = array(
- "name" => "av_adultforums",
- "title" => $lang->av_adultforums_title,
- "description" => $lang->av_adultforums_descr,
- "optionscode" => "text",
- "value" => 0,
- "disporder" => 8,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_8);
-
- $automedia2_9 = array(
- "name" => "av_signature",
- "title" => $lang->av_signature_title,
- "description" => $lang->av_signature_descr,
- "optionscode" => "yesno",
- "value" => 0,
- "disporder" => 9,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_9);
-
- // setting if admins only, admins and mods or all users can embed flash files
- $automedia2_10 = array(
- "name" => "av_flashadmin",
- "title" => $lang->av_flashadmin_title,
- "description" => $lang->av_flashadmin_descr,
- "optionscode" => "radio
- admin=Admins
- mods=Admins, Supermods, Mods
- all=All Users",
- "value" => "admin",
- "disporder" => 10,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_10);
-
- // add setting for width of flash files
- $automedia2_11 = array(
- "name" => "av_flashwidth",
- "title" => $lang->av_flashwidth_title,
- "description" => $lang->av_flashwidth_descr,
- "optionscode" => "text",
- "value" => "480",
- "disporder" => 11,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_11);
-
- // add setting for height of flash files
- $automedia2_12 = array(
- "name" => "av_flashheight",
- "title" => $lang->av_flashheight_title,
- "description" => $lang->av_flashheight_descr,
- "optionscode" => "text",
- "value" => "360",
- "disporder" => 12,
- "gid" => intval($gid2)
- );
- $db->insert_query("settings", $automedia2_12);
-
-
- //Add Settings for Videosites Settinggroup
- $automedia_1 = array(
- "name" => "av_youtube",
- "title" => $lang->av_youtube_title,
- "description" => $lang->av_youtube_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 1,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_1);
-
- $automedia_2 = array(
- "name" => "av_dailymotion",
- "title" => $lang->av_dailymotion_title,
- "description" => $lang->av_dailymotion_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 2,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_2);
-
- $automedia_3 = array(
- "name" => "av_google",
- "title" => $lang->av_google_title,
- "description" => $lang->av_google_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 3,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_3);
-
- $automedia_4 = array(
- "name" => "av_myvideo",
- "title" => $lang->av_myvideo_title,
- "description" => $lang->av_myvideo_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 4,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_4);
-
- $automedia_5 = array(
- "name" => "av_clipfish",
- "title" => $lang->av_clipfish_title,
- "description" => $lang->av_clipfish_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 5,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_5);
-
- $automedia_6 = array(
- "name" => "av_vimeo",
- "title" => $lang->av_vimeo_title,
- "description" => $lang->av_vimeo_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 6,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_6);
-
- $automedia_7 = array(
- "name" => "av_metacafe",
- "title" => $lang->av_metacafe_title,
- "description" => $lang->av_metacafe_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 7,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_7);
-
- $automedia_8 = array(
- "name" => "av_trail",
- "title" => $lang->av_trail_title,
- "description" => $lang->av_trail_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 8,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_8);
-
- $automedia_9 = array(
- "name" => "av_apple",
- "title" => $lang->av_apple_title,
- "description" => $lang->av_apple_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 9,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_9);
-
- $automedia_10 = array(
- "name" => "av_photobucket",
- "title" => $lang->av_photobucket_title,
- "description" => $lang->av_photobucket_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 10,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_10);
-
- $automedia_11 = array(
- "name" => "av_divshare",
- "title" => $lang->av_divshare_title,
- "description" => $lang->av_divshare_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 11,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_11);
-
- $automedia_12 = array(
- "name" => "av_myspace",
- "title" => $lang->av_myspace_title,
- "description" => $lang->av_myspace_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 12,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_12);
-
- $automedia_13 = array(
- "name" => "av_megavideo",
- "title" => $lang->av_megavideo_title,
- "description" => $lang->av_megavideo_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 13,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_13);
-
- $automedia_14 = array(
- "name" => "av_yahoo",
- "title" => $lang->av_yahoo_title,
- "description" => $lang->av_yahoo_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 14,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_14);
-
- $automedia_15 = array(
- "name" => "av_streetfire",
- "title" => $lang->av_streetfire_title,
- "description" => $lang->av_streetfire_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 15,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_15);
-
- $automedia_16 = array(
- "name" => "av_sevenload",
- "title" => $lang->av_sevenload_title,
- "description" => $lang->av_sevenload_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 16,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_16);
-
- $automedia_17 = array(
- "name" => "av_facebook",
- "title" => $lang->av_facebook_title,
- "description" => $lang->av_facebook_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 17,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_17);
-
- $automedia_19 = array(
- "name" => "av_guba",
- "title" => $lang->av_guba_title,
- "description" => $lang->av_guba_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 19,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_19);
-
- $automedia_20 = array(
- "name" => "av_clipshack",
- "title" => $lang->av_clipshack_title,
- "description" => $lang->av_clipshack_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 20,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_20);
-
- $automedia_21 = array(
- "name" => "av_mp3",
- "title" => $lang->av_mp3_title,
- "description" => $lang->av_mp3_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 21,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_21);
-
- $automedia_22 = array(
- "name" => "av_flv",
- "title" => $lang->av_flv_title,
- "description" => $lang->av_flv_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 22,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_22);
-
- $automedia_23 = array(
- "name" => "av_swf",
- "title" => $lang->av_swf_title,
- "description" => $lang->av_swf_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 23,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_23);
-
- $automedia_24 = array(
- "name" => "av_divx",
- "title" => $lang->av_divx_title,
- "description" => $lang->av_divx_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 24,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_24);
-
- $automedia_25 = array(
- "name" => "av_avi",
- "title" => $lang->av_avi_title,
- "description" => $lang->av_avi_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 25,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_25);
-
- $automedia_26 = array(
- "name" => "av_mov",
- "title" => $lang->av_mov_title,
- "description" => $lang->av_mov_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 26,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_26);
-
- $automedia_27 = array(
- "name" => "av_real",
- "title" => $lang->av_real_title,
- "description" => $lang->av_real_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 27,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_27);
-
- $automedia_28 = array(
- "name" => "av_wmp",
- "title" => $lang->av_wmp_title,
- "description" => $lang->av_wmp_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 28,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_28);
-
- $automedia_29 = array(
- "name" => "av_mp4",
- "title" => $lang->av_mp4_title,
- "description" => $lang->av_mp4_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 29,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_29);
-
- $automedia_30 = array(
- "name" => "av_mpg",
- "title" => $lang->av_mpg_title,
- "description" => $lang->av_mpg_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 30,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_30);
-
- $automedia_31 = array(
- "name" => "av_veoh",
- "title" => $lang->av_veoh_title,
- "description" => $lang->av_veoh_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 31,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_31);
-
- $automedia_32 = array(
- "name" => "av_twitvid",
- "title" => $lang->av_twitvid_title,
- "description" => $lang->av_twitvid_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 32,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_32);
-
- $automedia_33 = array(
- "name" => "av_brightcove",
- "title" => $lang->av_brightcove_title,
- "description" => $lang->av_brightcove_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 33,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_33);
-
- $automedia_34 = array(
- "name" => "av_clipjunkie",
- "title" => $lang->av_clipjunkie_title,
- "description" => $lang->av_clipjunkie_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 34,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_34);
-
- $automedia_35 = array(
- "name" => "av_tudou",
- "title" => $lang->av_tudou_title,
- "description" => $lang->av_tudou_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 35,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_35);
-
- $automedia_36 = array(
- "name" => "av_collhumor",
- "title" => $lang->av_collhumor_title,
- "description" => $lang->av_collhumor_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 36,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_36);
-
- $automedia_37 = array(
- "name" => "av_mtvmov",
- "title" => $lang->av_mtvmov_title,
- "description" => $lang->av_mtvmov_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 37,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_37);
-
- $automedia_38 = array(
- "name" => "av_mtvmusic",
- "title" => $lang->av_mtvmusic_title,
- "description" => $lang->av_mtvmusic_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 38,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_38);
-
- $automedia_39 = array(
- "name" => "av_bbciplay",
- "title" => $lang->av_bbciplay_title,
- "description" => $lang->av_bbciplay_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 39,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_39);
-
- $automedia_40 = array(
- "name" => "av_lustich",
- "title" => $lang->av_lustich_title,
- "description" => $lang->av_lustich_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 40,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_40);
-
- $automedia_41 = array(
- "name" => "av_hulu",
- "title" => $lang->av_hulu_title,
- "description" => $lang->av_hulu_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 41,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_41);
-
- $automedia_42 = array(
- "name" => "av_viddler",
- "title" => $lang->av_viddler_title,
- "description" => $lang->av_viddler_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 42,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_42);
-
- $automedia_43 = array(
- "name" => "av_blip",
- "title" => $lang->av_blip_title,
- "description" => $lang->av_blip_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 43,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_43);
-
- $automedia_44 = array(
- "name" => "av_trtube",
- "title" => $lang->av_trtube_title,
- "description" => $lang->av_trtube_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 44,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_44);
-
- $automedia_45 = array(
- "name" => "av_break",
- "title" => $lang->av_break_title,
- "description" => $lang->av_break_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 45,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_45);
-
- $automedia_46 = array(
- "name" => "av_sapo",
- "title" => $lang->av_sapo_title,
- "description" => $lang->av_sapo_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 46,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_46);
-
- $automedia_47 = array(
- "name" => "av_futebol",
- "title" => $lang->av_futebol_title,
- "description" => $lang->av_futebol_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 47,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_47);
-
- $automedia_48 = array(
- "name" => "av_trilu",
- "title" => $lang->av_trilu_title,
- "description" => $lang->av_trilu_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 48,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_48);
-
- $automedia_49 = array(
- "name" => "av_rutube",
- "title" => $lang->av_rutube_title,
- "description" => $lang->av_rutube_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 49,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_49);
-
- $automedia_50 = array(
- "name" => "av_gametube",
- "title" => $lang->av_gametube_title,
- "description" => $lang->av_gametube_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 50,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_50);
-
- $automedia_51 = array(
- "name" => "av_gametrail",
- "title" => $lang->av_gametrail_title,
- "description" => $lang->av_gametrail_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 51,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_51);
-
- $automedia_52 = array(
- "name" => "av_gamespot",
- "title" => $lang->av_gamespot_title,
- "description" => $lang->av_gamespot_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 52,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_52);
-
- $automedia_53 = array(
- "name" => "av_123vid",
- "title" => $lang->av_123vid_title,
- "description" => $lang->av_123vid_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 53,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_53);
-
- $automedia_54 = array(
- "name" => "av_goear",
- "title" => $lang->av_goear_title,
- "description" => $lang->av_goear_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 54,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_54);
-
- $automedia_55 = array(
- "name" => "av_bofunk",
- "title" => $lang->av_bofunk_title,
- "description" => $lang->av_bofunk_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 55,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_55);
-
- $automedia_56 = array(
- "name" => "av_clipmoon",
- "title" => $lang->av_clipmoon_title,
- "description" => $lang->av_clipmoon_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 56,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_56);
-
- $automedia_57 = array(
- "name" => "av_funnyordie",
- "title" => $lang->av_funnyordie_title,
- "description" => $lang->av_funnyordie_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 57,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_57);
-
- $automedia_58 = array(
- "name" => "av_liveleak",
- "title" => $lang->av_liveleak_title,
- "description" => $lang->av_liveleak_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 58,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_58);
-
- $automedia_59 = array(
- "name" => "av_videahu",
- "title" => $lang->av_videahu_title,
- "description" => $lang->av_videahu_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 59,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_59);
-
- $automedia_60 = array(
- "name" => "av_imdb",
- "title" => $lang->av_imdb_title,
- "description" => $lang->av_imdb_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 60,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_60);
-
- $automedia_61 = array(
- "name" => "av_movshare",
- "title" => $lang->av_movshare_title,
- "description" => $lang->av_movshare_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 61,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_61);
-
- $automedia_63 = array(
- "name" => "av_ustream",
- "title" => $lang->av_ustream_title,
- "description" => $lang->av_ustream_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 63,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_63);
-
- $automedia_64 = array(
- "name" => "av_blogtv",
- "title" => $lang->av_blogtv_title,
- "description" => $lang->av_blogtv_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 64,
- "gid" => intval($gid)
- );
- $db->insert_query("settings", $automedia_64);
-
-
- //Add Profilesetting
- $db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD COLUMN automedia_use VARCHAR(1) NOT NULL DEFAULT'Y'");
-
- // Refresh settings.php
- rebuild_settings();
-
- }
-
-
- //Uninstall the Plugin #########################################################################################
- function automedia_uninstall()
- {
- global $db;
-
- //Remove the extra column
- if($db->field_exists('automedia_use', 'users'))
- {
- $db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP COLUMN automedia_use");
- }
-
-
- // DELETE ALL SETTINGS
- $query = $db->simple_select('settinggroups','gid','name="AutoMedia Sites"');
- $ams = $db->fetch_array($query);
- $db->delete_query('settinggroups',"gid='".$ams['gid']."'");
- $query2 = $db->simple_select('settinggroups','gid','name="AutoMedia Global"');
- $amg = $db->fetch_array($query2);
- $db->delete_query('settinggroups',"gid='".$amg['gid']."'");
- $query3 = $db->simple_select('settinggroups','gid','name="AutoMedia"');
- $am = $db->fetch_array($query3);
- $db->delete_query('settinggroups',"gid='".$am['gid']."'");
-
- // Delete Settings
- $db->delete_query('settings',"gid='".$ams['gid']."'");
- $db->delete_query('settings',"gid='".$amg['gid']."'");
- $db->delete_query('settings',"gid='".$am['gid']."'");
-
- // Refresh settings.php
- rebuild_settings();
- }
-
-
- //Activate the Plugin ##########################################################################################
- function automedia_activate()
- {
- global $db, $mybb, $lang;
-
- /**
- * Add / Edit Templates
- *
- **/
- require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
-
- find_replace_templatesets("usercp_nav_misc", "#".preg_quote('<tr><td class="trow1 smalltext"><a href="usercp.php?action=userautomedia" class="usercp_nav_item usercp_nav_options">AutoMedia</a></td></tr></tbody>')."#s",'</tbody>', '',0);
- //delete template editings by a former beta version
- find_replace_templatesets('usercp_editsig', '#\n{\$amsigpreview}<br /><br />#', '', 0);
-
- $db->delete_query("templates", "title = 'usercp_automedia'");
-
- find_replace_templatesets("usercp_nav_misc", '#</tbody>#', '<tr><td class="trow1 smalltext"><a href="usercp.php?action=userautomedia" class="usercp_nav_item usercp_nav_options">AutoMedia</a></td></tr></tbody>');
-
- $template = array(
- "title" => "usercp_automedia",
- "template" => $db->escape_string('<html>
- <head>
- <title>{$mybb->settings[bbname]} - Automedia in Posts</title>
- {$headerinclude}
- </head>
- <body>
- {$header}
- <form action="usercp.php" method="post">
- <table width="100%" border="0" align="center">
- <tr>
- {$usercpnav}
- <td valign="top">
- <table border="0" cellspacing="{$theme[borderwidth]}" cellpadding="{$theme[tablespace]}" class="tborder">
- <tr>
- <td class="thead" colspan="2"><strong>Automedia in Posts</strong></td>
- </tr>
- <tr>
- <td align="center" class="trow1" width="95%">
- <select name="automedia">
- <option>Yes</option>
- <option>No</option>
- </select></td>
- <td align="center" class="trow1" width="5%">
- <div style="float:left">{$ucpset}</div>
- </td>
- </tr>
- </table>
- <br />
- <div align="center">
- <input type="hidden" name="action" value="do_automedia" />
- <input type="submit" class="button" name="submit" value="OK" />
- </div>
- </td>
- </tr>
- </table>
- </form>
- {$footer}
- </body>
- </html>
- '),
- "sid" => -1
- );
-
- $db->insert_query("templates", $template);
-
- // Delete Settings for Justin.TV and Last.fm
- $query1 = $db->simple_select("settings", "*", "name='av_lastfm'");
- $result1 = $db->num_rows($query1);
- if($result1)
- {
- $db->delete_query('settings', "name='av_justin'");
- $db->delete_query('settings', "name='av_lastfm'");
- }
-
- // Update plugin from v.1.1.7 to v.1.1.10 add new settings if not exist
- $query2 = $db->simple_select("settings", "gid", "name='av_youtube'");
- $asgid = $db->fetch_array($query2);
- $gid4 = $asgid['gid'];
-
- $query = $db->simple_select("settings", "*", "name='av_soundcloud'");
- $result = $db->num_rows($query);
-
- if(!$result)
- {
- $automedia_65 = array(
- "name" => "av_soundcloud",
- "title" => $lang->av_soundcloud_title,
- "description" => $lang->av_soundcloud_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 65,
- "gid" => intval($gid4)
- );
- $db->insert_query("settings", $automedia_65);
-
- $automedia_66 = array(
- "name" => "av_mefeedia",
- "title" => $lang->av_mefeedia_title,
- "description" => $lang->av_mefeedia_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 66,
- "gid" => intval($gid4)
- );
- $db->insert_query("settings", $automedia_66);
-
- $automedia_67 = array(
- "name" => "av_wattv",
- "title" => $lang->av_wattv_title,
- "description" => $lang->av_wattv_descr,
- "optionscode" => "yesno",
- "value" => 1,
- "disporder" => 67,
- "gid" => intval($gid4)
- );
- $db->insert_query("settings", $automedia_67);
-
- rebuild_settings();
- }
- }
-
- //Deactivate the Plugin ########################################################################################
- function automedia_deactivate()
- {
- global $db, $mybb;
-
- /**
- *
- * Delete / Restore Templates
- *
- **/
- require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
- $db->delete_query("templates", "title = 'usercp_automedia'");
-
- find_replace_templatesets("usercp_nav_misc", "#".preg_quote('<tr><td class="trow1 smalltext"><a href="usercp.php?action=userautomedia" class="usercp_nav_item usercp_nav_options">AutoMedia</a></td></tr>')."#s",'', '',0);
-
- }
-
-
- // User CP #####################################################################################################
-
- /**
- *
- * UserCP Enabled Status
- *
- **/
- function ucp_automedia_status()
- {
- global $mybb, $db;
-
- $auset = $db->escape_string($mybb->user['automedia_use']);
-
- if ($auset == "Y")
- {
- $ucpstatus = " <b>Status:</b><br /> <img src=\"images/icons/thumbsup.gif\" />";
- }
- else
- {
- $ucpstatus = " <b>Status:</b><br /> <img src=\"images/icons/thumbsdown.gif\" />";
- }
-
- return $ucpstatus;
-
- }
-
- /**
- *
- * UserCP Settings
- *
- **/
- function userautomedia()
- {
-
- global $header, $headerinclude, $usercpnav, $footer, $mybb, $theme, $db, $lang, $templates;
-
- if ($mybb->input['action'] == "userautomedia")
- {
- add_breadcrumb($lang->nav_usercp, "usercp.php");
- add_breadcrumb("AutoMedia");
- $ucpset = @ucp_automedia_status();
- eval("\$editprofile = \"".$templates->get("usercp_automedia")."\";");
- output_page($editprofile);
- }
- elseif ($mybb->input['action'] == "do_automedia")
- {
- $uid = intval($mybb->user['uid']);
- $updated_record = array(
- "automedia_use" => $db->escape_string($mybb->input['automedia'])
- );
- if($db->update_query('users', $updated_record, "uid='".$uid."'"))
- {
- redirect("usercp.php?action=userautomedia","AutoMedia Settings updated!");
- }
- }
- else {
- return;
- }
- }
-
- // Lookup ######################################################################################################
- function get_avmatch($regex,$content)
- {
- preg_match($regex,$content,$matches);
- return $matches[1];
- }
-
-
- //Let other youtube mycodes still do their work ##################################################################
- function automedia_oldyt_run($message)
- {
- global $mybb;
-
- $message = preg_replace("#\[youtube\]http://((?:de|www)\.)?youtube.com/watch\?v=([A-Za-z0-9\-\_]+)\[/youtube\]#i", '<div class=\'am_embed\'><object width=\'425\' height=\'350\'><param name=\'movie\' value=\'http://www.youtube.com/v/$2\' /><embed src=\'http://www.youtube.com/v/$2\' type=\'application/x-shockwave-flash\' width=\'425\' height=\'350\'></embed></object></div>', $message);
- $message = preg_replace("#\[youtube\]([A-Za-z0-9\-\_]+)\[/youtube\]#i", '<div class=\'am_embed\'><object width=\'425\' height=\'350\'><param name=\'movie\' value=\'http://www.youtube.com/v/$1\' /><embed src=\'http://www.youtube.com/v/$1\' type=\'application/x-shockwave-flash\' width=\'425\' height=\'350\'></embed></object></div>', $message);
- $message = preg_replace("#\[yt\]http://((?:de|www)\.)?youtube.com/watch\?v=([A-Za-z0-9\-\_]+)\[/yt\]#i", '<div class=\'am_embed\'><object width=\'425\' height=\'350\'><param name=\'movie\' value=\'http://www.youtube.com/v/$2\' /><embed src=\'http://www.youtube.com/v/$2\' type=\'application/x-shockwave-flash\' width=\'425\' height=\'350\'></embed></object></div>', $message);
- $message = preg_replace("#\[yt\]([A-Za-z0-9\-\_]+)\[/yt\]#i", '<div class=\'am_embed\'><object width=\'425\' height=\'350\'><param name=\'movie\' value=\'http://www.youtube.com/v/$1\' /><embed src=\'http://www.youtube.com/v/$1\' type=\'application/x-shockwave-flash\' width=\'425\' height=\'350\'></embed></object></div>', $message);
- // mp3 playlist mycode
- $message = preg_replace("#\[ampl\](.*?)\[/ampl\]#i", "<div class=\"am_embed\"><object type=\"application/x-shockwave-flash\" data=\"{$mybb->settings['bburl']}/mediaplayer/emff_position_blue.swf\" width=\"100\" height=\"50\" /><param name=\"movie\" value=\"{$mybb->settings['bburl']}/mediaplayer/emff_position_blue.swf\" /><param name=\"FlashVars\" value=\"src=$1\" /></object></div>", $message);
-
- return $message;
- }
-
-
- // Embed the Media Files #######################################################################################
- function automedia_run($message)
- {
- global $db, $mybb, $cache, $post, $pmid, $memprofile, $automedia;
-
- //Add new mycode for disabling embedding
- $message = preg_replace("#\[amoff\](http://)(.*?)\[/amoff\]#i", '<a name=\'amoff\' href=\'${1}${2}\' id =\'am\' target=\'_blank\'>${1}${2}</a>', $message);
-
- /**
- * Get the settings for the forums
- */
- $avfid = intval($post['fid']);
-
- //Find the set fid's in Settings
- $fids = explode(',', $mybb->settings['av_forums']);
- if (in_array($avfid,$fids))
- {
- $efid = false;
- }
- else
- {
- $efid = true;
- }
-
-
- /**
- *Get the settings for the usergroups
- */
- //Find the excluded Groups in Settings
- $gid = intval($mybb->user['usergroup']);
- $groups = explode(',', $mybb->settings['av_groups']);
- if (in_array($gid,$groups))
- {
- $egid = true;
- }
- else {
- $egid = false;
- }
-
-
- //Find the Users Groups
- $ag = explode(',',$mybb->user['additionalgroups']);
-
- foreach($ag as $a)
- {
- if (in_array($a,$groups))
- {
- $agid = true;
- }
- else
- {
- $agid = false;
- }
- }
-
- /**
- * Get the settings for flash width and height
- */
- $width = intval($mybb->settings['av_flashwidth']);
- $height = intval($mybb->settings['av_flashheight']);
-
- if($width >= 10 && $width <= 1200)
- {
- $width = $width;
- }
- else
- {
- $width = "480";
- }
-
- if($height >= 10 && $height <= 1000)
- {
- $height = $height;
- }
- else
- {
- $height = "360";
- }
-
- /**
- * Apply the permissions
- */
-
- //AutoMedia not disabled in Settings?
- if ($mybb->settings['av_enable'] != 0)
- {
- //Embedding not disabled by using mycode?
- if (!preg_match('/<a name=\"amoff\" href=\"(.*)\" id=\"am\" target=\"_blank\">/isU',$message))
- {
-
- //AutoMedia allowed for Guests in Settings?
- if ($mybb->settings['av_guest'] != 0 || ($mybb->user['uid'] != 0))
- {
-
- //Are certain forums set?
- if (!$efid || $mybb->settings['av_forums'] == 0 || defined("IN_PORTAL"))
- {
-
- //Has the User AutoMedia enabled in User CP?
- if($mybb->user['automedia_use'] != 'N')
- {
-
- //Groups not excluded in Settings? - Admins can't be excluded in Settings
- if(!$egid && !$agid || $gid == 4)
- {
-
-
- /**
- * Embed the files
- */
- // http://www.youtube.com/watch?v=K2oLoBpFmho or http://www.youtube.com/watch?v=cSB2TpeY-2E&feature=related
- if($mybb->settings['av_youtube'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?youtube.com/watch\?v=(.{11})">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)?(www.)?youtube.com/watch\?(.*?)v=)(.{11})((\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><iframe title=\"YouTube video player\" width=\"640\" height=\"390\" src=\"http://www.youtube.com/embed/$6\" frameborder=\"0\" allowfullscreen></iframe></div>", $message);
- }
- if($mybb->settings['av_youtube'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?youtube.com/watch\?(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)?(www.)?youtube.com/watch\?(.*?)v=)(.{11})((.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"640\" height=\"390\"><param name=\"movie\" value=\"http://www.youtube.com/v/$6&fs=1\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowScriptAccess\" value=\"always\" /><embed src=\"http://www.youtube.com/v/$6&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"640\" height=\"390\"></embed></object></div>", $message);
- }
- if($mybb->settings['av_youtube'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?youtu.be/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)?(www.)?youtu.be/)(.{11}?)((.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><iframe title=\"YouTube video player\" width=\"640\" height=\"390\" src=\"http://www.youtube.com/embed/$5$6\" frameborder=\"0\" allowfullscreen></iframe></div>", $message);
- }
- if($mybb->settings['av_youtube'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?youtube.com/playlist(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)?(www.)?youtube.com/playlist\?(.*?)p=(PL)?)(\w{14,22})((.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><iframe title=\"YouTube video player\" width=\"640\" height=\"390\" src=\"http://www.youtube.com/embed/p/$7\" frameborder=\"0\" allowfullscreen></iframe></div>", $message);
- }
- // http://www.dailymotion.com/video/xa8h5c_dbo-frusty-offizielles-video_music
- if($mybb->settings['av_dailymotion'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?dailymotion.com/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)?(www.)?dailymotion.com/(.*?)/?video/)(.{3,8}?)_((.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'450\' height=\'350\' data=\'http://www.dailymotion.com/swf/${6}&related=0\' type=\'application/x-shockwave-flash\' ><param name=\'movie\' value=\'http://www.dailymotion.com/swf/${6}&related=0\' /><param name=\'allowFullScreen\' value=\'true\' /><param name=\'allowScriptAccess\' value=\'always\' /></object></div>', $message);
- }
- // http://video.google.com/videoplay?docid=-5152959115771418702
- if($mybb->settings['av_google'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?video.google.(com|co\.uk)/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?video.google.(com|co\.uk)/videoplay\?docid=)(\W?)(\d{15,20})(\[/automedia\]|\" target=\"_blank\">(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'400\' height=\'326\' id=\'VideoPlayback\' type=\'application/x-shockwave-flash\' data=\'http://video.google.com/googleplayer.swf?docId=${4}${5}&hl=en\'><param name=\'movie\' value=\'http://video.google.com/googleplayer.swf?docId=${4}${5}&hl=en\' /></object></div>', $message);
- }
- // http://www.metacafe.com/watch/3202541/awkward_moment/
- if($mybb->settings['av_metacafe'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?metacafe\.com/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?metacafe\.com/(?:watch|fplayer)/)(.{7}?)/(((.*?)(/?))(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'400\' height=\'345\' data=\'http://www.metacafe.com/fplayer/${3}/${6}.swf\' type=\'application/x-shockwave-flash\'><param name=\'movie\' value=\'http://www.metacafe.com/fplayer/${3}/${6}.swf\' /></object></div>', $message);
- }
- // http://www.myvideo.de/watch/6096698/Radioaktiv_Comedy_Street
- if($mybb->settings['av_myvideo'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?myvideo\.de/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?myvideo\.de/watch/)(\d{2,9})((.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:470px;height:406px;\' type=\'application/x-shockwave-flash\' data=\'http://www.myvideo.de/movie/${3}\'> <param name=\'movie\' value=\'http://www.myvideo.de/movie/${3}\' /> <param name=\'AllowFullscreen\' value=\'false\' /></object></div>', $message);
- }
- // http://www.vimeo.com/2464373
- if($mybb->settings['av_vimeo'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?vimeo\.com/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?vimeo\.com/(\d{1,12})(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'400\' height=\'250\' data=\'http://www.vimeo.com/moogaloop.swf?clip_id=${3}&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=\' type=\'application/x-shockwave-flash\'><param name=\'allowfullscreen\' value=\'true\' /><param name=\'allowscriptaccess\' value=\'always\' /><param name=\'movie\' value=\'http://www.vimeo.com/moogaloop.swf?clip_id=${3}&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1\' /></object></div>', $message);
- }
- // http://www.clipfish.de/video/3122529/millennium-force/
- if($mybb->settings['av_clipfish'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?clipfish.de(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?clipfish\.de/video/)(.{7}?)((.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'460\' height=\'375\' data=\'http://www.clipfish.de/videoplayer.swf?as=0&vid=${3}&r=1\' type=\'application/x-shockwave-flash\'><param name=\'movie\' value=\'http://www.clipfish.de/videoplayer.swf?as=0&vid=${3}&r=1\' /></object></div>', $message);
- }
- // http://www.veoh.com/browse/videos/category/comedy/watch/v18562639zWjqnSye
- if($mybb->settings['av_veoh'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?veoh\.com(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?veoh\.com/(?:[\w/]*?|videodetails2\.swf\?permalinkId=)(v\d[0-9a-z]*)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:460px;height:345px;\' type=\'application/x-shockwave-flash\' data=\'http://www.veoh.com/veohplayer.swf?permalinkId=${3}&id=anonymous&player=videodetailsembedded&videoAutoPlay=0\'> <param name=\'movie\' value=\'http://www.veoh.com/veohplayer.swf?permalinkId=${3}&id=anonymous&player=videodetailsembedded&videoAutoPlay=0\' /></object></div>', $message);
- }
- //http://s151.photobucket.com/albums/s152/kingsfordsa/?action=view¤t=vows.flv
- if($mybb->settings['av_photobucket'] != 0 && preg_match('<a href=\"(http://)([si](\w{1,5}))\.photobucket\.com/albums/((?:[\%\w-]{1,50}/){1,10})(?:\?[^\"]*?current=)?([\%\w-]{1,50}\.(?:pbr|flv))\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)([si](\w{1,5}))\.photobucket\.com/albums/((?:[\%\w-]{1,50}/){1,10})(?:\?[^\"]*?current=)?([\%\w-]{1,50}\.(?:pbr|flv))(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:448px;height:361px;\' type=\'application/x-shockwave-flash\' data=\'http://${3}.photobucket.com/player.swf?file=http://vid${4}.photobucket.com/albums/${5}${6}\'> <param name=\'movie\' value=\'http://${3}.photobucket.com/player.swf?file=http://vid${4}.photobucket.com/albums/${5}${6}\' /></object></div>', $message);
- }
- //http://www.divshare.com/download/7714880-d76
- if($mybb->settings['av_divshare'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?divshare\.com/download/([^\"]*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?divshare\.com/download/(.{11}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><b>DivShare Link:</b> <a href=\'http://www.divshare.com/download/${3}\' target=\'_blank\'><b>http://www.divshare.com/download/$3</b></a><br /><br /><b>DivShare Video?</b><br /><object style=\'width:423px;height:319px;\' type=\'application/x-shockwave-flash\' data=\'http://www.divshare.com/flash/video2?myId=${3}\'> <param name=\'movie\' value=\'http://www.divshare.com/flash/video2?myId=${3}\' /> </object><br /><br /><b>DivShare Audio?</b><br /><object style=\'width:335px;height:28px;\' type=\'application/x-shockwave-flash\' data=\'http://www.divshare.com/flash/playlist?myId=${3}\'> <param name=\'movie\' value=\'http://www.divshare.com/flash/playlist?myId=${3}\' /></object></div>', $message);
- }
- //http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=62365647
- if($mybb->settings['av_myspace'] != 0 && preg_match('<a href=\"(http://)(?:vids\.myspace|myspacetv)\.com/index\.cfm\?[^\"]*?VideoID=(\d{1,10})\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:vids\.myspace|myspacetv)\.com/index\.cfm\?[^\"]*?VideoID=(\d{1,10})(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:425px;height:360px;\' type=\'application/x-shockwave-flash\' data=\'http://mediaservices.myspace.com/services/media/embed.aspx/m=${3}\'> <param name=\'movie\' value=\'http://mediaservices.myspace.com/services/media/embed.aspx/m=${3}\' /></object></div>', $message);
- }
- //http://www.megavideo.com/?v=CZRADM47
- if($mybb->settings['av_megavideo'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?megavideo\.com/(?:\?[^\"]*?v=|v/)([0-9a-z]{8})\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?megavideo\.com/(?:\?[^\"]*?v=|v/)([0-9a-z]{8})(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:455px;height:370px;\' type=\'application/x-shockwave-flash\' data=\'http://www.megavideo.com/v/${3}.0.0\'> <param name=\'movie\' value=\'http://www.megavideo.com/v/${3}.0.0\' /></object></div>', $message);
- }
- //http://video.yahoo.com/watch/1350163/4656457
- if($mybb->settings['av_yahoo'] != 0 && preg_match('<a href=\"(http://)(?:(?:www|[a-z]{2})\.)?video\.yahoo\.com/watch/(\d*)/(\d+)(?:#thumb=(http[\w\./%\:]+\.jpg))?\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:(?:www|[a-z]{2})\.)?video\.yahoo\.com/watch/(\d*)/(\d+)(?:\#thumb=(http[\w\./%\:]+\.jpg))?(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:512px;height:322px;\' type=\'application/x-shockwave-flash\' data=\'http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40&id=${4}&vid=${3}&lang=en-us&intl=us&embed=1&thumbUrl=${5}\'> <param name=\'movie\' value=\'http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40&id=${4}&vid=${3}&lang=en-us&intl=us&embed=1&thumbUrl=${5}\' /></object></div>', $message);
- }
- //http://videos.streetfire.net/video/1500-HP-Camaro-Street-NRE_703469.htm
- if($mybb->settings['av_streetfire'] != 0 && preg_match('<a href=\"(http://)(?:www\.|videos\.)?streetfire\.net/video/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.|videos\.)?streetfire\.net/video/(.*?)(.{6}?)\.htm(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:430px;height:355px;\' type=\'application/x-shockwave-flash\' data=\'http://videos.streetfire.net/vidiac.swf?video=${4}\'> <param name=\'movie\' value=\'http://videos.streetfire.net/vidiac.swf?video=${4}\' /></object></div>', $message);
- }
- //http://de.sevenload.com/videos/ZWyfb8l-Kill-Bill-Teil-1-2-in-einer-Minute
- if($mybb->settings['av_sevenload'] != 0 && preg_match('<a href=\"(http://)((?:en|tr|de|www)\.)?sevenload.com/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)((?:en|tr|de|www)\.)?sevenload.com/(?:videos|videolar))/(.{7}?)((.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:500px;height:314px;\' type=\'application/x-shockwave-flash\' data=\'http://${3}sevenload.com/pl/${4}/500x314/swf\'><param name=\'allowFullscreen\' value=\'true\' /><param name=\'allowScriptAccess\' value=\'always\' /> <param name=\'movie\' value=\'http://${3}sevenload.com/pl/${4}/500x314/swf\' /></object></div>', $message);
- }
- //http://www.facebook.com/video/video.php?v=1114479015472&_fb_noscript=1
- if($mybb->settings['av_facebook'] != 0 && preg_match('<a href=\"(http://)?(www.)?facebook\.com/video/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?facebook\.com/video/video\.php\?v=([0-9a-z]{7,15})(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object style=\'width:480px;height:360px;\' type=\'application/x-shockwave-flash\' data=\'http://www.facebook.com/v/${4}\'><param name=\'allowFullscreen\' value=\'true\' /><param name=\'allowScriptAccess\' value=\'always\' /> <param name=\'movie\' value=\'http://www.facebook.com/v/${4}\' /></object></div>', $message);
- }
- //http://www.guba.com/watch/3000015922/George-Washington?duration_step=0&fields=23&filter_tiny=0&mst=63&pp=40&sb=5&set=-1&sf=0&size_step=0&o=0&sample=1251469427:ffa2ca28f244f50a7456a06f7f1bb0c2ffcb6026
- if($mybb->settings['av_guba'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?guba\.com/watch/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?guba\.com/watch/([0-9]{10})(.*)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object type=\'application/x-shockwave-flash\' data=\'http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/${3}/flash.flv&isEmbeddedPlayer=true\' width=\'520\' height=\'360\'><param name=\'movie\' value=\'http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/${3}/flash.flv&isEmbeddedPlayer=true\' /></object></div>', $message);
- }
- //http://www.clipshack.com/Clip.aspx?key=78303BB426C9EF24
- if($mybb->settings['av_clipshack'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?clipshack\.com/Clip\.aspx\?key=(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?clipshack\.com/Clip\.aspx\?key=([0-9a-f]{16})(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object type=\'application/x-shockwave-flash\' data=\'http://www.clipshack.com/player.swf?key=${3}\' width=\'430\' height=\'370\'><param name=\'movie\' value=\'http://www.clipshack.com/player.swf?key=${3}\' /></object></div>', $message);
- }
- //http://www.birding.dk/galleri/stemmermp3/Luscinia%20megarhynchos%201.mp3
- if($mybb->settings['av_mp3'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.mp3\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)\.(.*)/([\w/ &;%\.-]+\.mp3)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object type=\"application/x-shockwave-flash\" data=\"{$mybb->settings['bburl']}/mediaplayer/emff_position_blue.swf\" width=\"100\" height=\"50\" /><param name=\"movie\" value=\"{$mybb->settings['bburl']}/mediaplayer/emff_position_blue.swf\" /><param name=\"FlashVars\" value=\"src=$2$3$4.$5/$6\" /></object></div>", $message);
- }
- //www.gugelproductions.de/blog/wp-content/fltest.flv
- if($mybb->settings['av_flv'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.flv\">isU',$message))
- {
- if(THIS_SCRIPT=="private.php")
- {
- $priv = intval($pmid);
- $query = $db->simple_select("privatemessages", "fromid", "pmid='$priv'");
- $privuid = $db->fetch_array($query);
- $puid = intval($privuid['fromid']);
- }
- else if(THIS_SCRIPT=="usercp.php")
- {
- $puid = intval($mybb->user['uid']);
- }
- else if(THIS_SCRIPT=="member.php")
- {
- $puid = intval($memprofile['uid']);
- }
- else
- {
- $puid = intval($post['uid']);
- }
- //Get the posters usergroup
- $query = $db->simple_select("users", "usergroup", "uid='$puid'");
- $postgid = $db->fetch_array($query);
- $pgid = intval($postgid['usergroup']);
-
- switch($mybb->settings['av_flashadmin'])
- {
- case "admin":
- if($pgid == 4) {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)/([\w/ &;%\.-]+\.flv)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object id=\"flowplayer\" width=\"$width\" height=\"$height\" data=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"flashvars\" value='config={\"clip\":{\"url\":\"$2$3$4/$5\",\"autoPlay\":false}}' /></object></div>", $message);
- }
- break;
- case "mods":
- if($pgid == 3 || $pgid == 4 || $pgid == 6) {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)/([\w/ &;%\.-]+\.flv)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object id=\"flowplayer\" width=\"$width\" height=\"$height\" data=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"flashvars\" value='config={\"clip\":{\"url\":\"$2$3$4/$5\",\"autoPlay\":false}}' /></object></div>", $message);
- }
- break;
- case "all":
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)/([\w/ &;%\.-]+\.flv)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object id=\"flowplayer\" width=\"$width\" height=\"$height\" data=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"flashvars\" value='config={\"clip\":{\"url\":\"$2$3$4/$5\",\"autoPlay\":false}}' /></object></div>", $message);
- break;
- }
- }
- //http://www.arcadecabin.com/games/crazy-taxi.swf
- if($mybb->settings['av_swf'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.swf\">isU',$message))
- {
- if(THIS_SCRIPT=="private.php")
- {
- $priv = intval($pmid);
- $query = $db->simple_select("privatemessages", "fromid", "pmid='$priv'");
- $privuid = $db->fetch_array($query);
- $puid = intval($privuid['fromid']);
- }
- else if(THIS_SCRIPT=="usercp.php")
- {
- $puid = intval($mybb->user['uid']);
- }
- else if(THIS_SCRIPT=="member.php")
- {
- $puid = intval($memprofile['uid']);
- }
- else
- {
- $puid = intval($post['uid']);
- }
- //Get the posters usergroup
- $query = $db->simple_select("users", "usergroup", "uid='$puid'");
- $postgid = $db->fetch_array($query);
- $pgid = intval($postgid['usergroup']);
-
- switch($mybb->settings['av_flashadmin'])
- {
- case "admin":
- if($pgid == 4) {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)/([\w/ &;%\.-]+\.swf)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" width=\"$width\" height=\"$height\"><param name=\"movie\" value=\"$2$3$4/$5\" /><param name=\"menu\" value=\"true\" /><param name=\"autostart\" value=\"0\" /><embed src=\"$2$3$4/$5\" width=\"$width\" height=\"$height\" type=\"application/x-shockwave-flash\" menu=\"false\" autostart=\"false\"></embed></object></div>", $message);
- }
- break;
- case "mods":
- if($pgid == 3 || $pgid == 4 || $pgid == 6) {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)/([\w/ &;%\.-]+\.swf)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" width=\"$width\" height=\"$height\"><param name=\"movie\" value=\"$2$3$4/$5\" /><param name=\"menu\" value=\"true\" /><param name=\"autostart\" value=\"0\" /><embed src=\"$2$3$4/$5\" width=\"$width\" height=\"$height\" type=\"application/x-shockwave-flash\" menu=\"false\" autostart=\"false\"></embed></object></div>", $message);
- }
- break;
- case "all":
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)/([\w/ &;%\.-]+\.swf)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" width=\"$width\" height=\"$height\"><param name=\"movie\" value=\"$2$3$4/$5\" /><param name=\"menu\" value=\"true\" /><param name=\"autostart\" value=\"0\" /><embed src=\"$2$3$4/$5\" width=\"$width\" height=\"$height\" type=\"application/x-shockwave-flash\" menu=\"false\" autostart=\"false\"></embed></object></div>", $message);
- break;
- }
- }
- //http://showcase7.divx.com/qvga_TerminatorSalvationTrailer.divx
- if($mybb->settings['av_divx'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.divx\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)\.(.*)/([\w/ &;%\.-]+\.divx)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object id=\'ImageWindow\' classid=\'clsid:D050D736-2D21-4723-AD58-5B541FFB6C11\' width=\'500\' height=\'360\'> <param name=\'src\' value=\'${2}${3}${4}.${5}/${6}\' /><param name=\'autostart\' value=\'0\' /><embed src=\'${2}${3}${4}.${5}/${6}\' type=\'video/divx\'width=\'500\' height=\'360\' autostart=\'false\'></embed></object></div>', $message);
- }
- //http://www.hydro-kosmos.de/video/vfrogy.avi
- if($mybb->settings['av_avi'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.avi\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)\.(.*)/([\w/ &;%\.-]+\.avi)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object id=\'ImageWindow\' classid=\'clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\' codebase=\'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715\' width=\'500\' height=\'360\'><param name=\'src\' value=\'${2}${3}${4}.${5}/${6}\' /><param name=\'AutoStart\' value=\'true\' /><param name=\'ShowTracker\' value=\'true\'><param name=\'ShowControls\' value=\'true\'><param name=\'ShowGotoBar\' value=\'false\'><param name=\'ShowDisplay\' value=\'false\'><param name=\'ShowStatusBar\' value=\'false\'><param name=\'AutoSize\' value=\'false\'><embed name=\'MediaPlayer\' src=\'${2}${3}${4}.${5}/${6}\' type=\'video/avi\' width=\'500\' height=\'360\' autostart=\'true\'></embed></object></div>', $message);
- }
- //http://movies.apple.com/movies/disney/oceans/oceans-tsr1_h.320.mov
- if($mybb->settings['av_mov'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.mov\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)/([\w/ &;%\.-]+\.mov)(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object classid=\'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\' codebase=\'http://www.apple.com/qtactivex/qtplugin.cab\' width=\'500\' height=\'360\'> <param name=\'src\' value=\'${2}${3}${4}/${5}${6}\' /><embed src=\'${2}${3}${4}/${5}${6}\' type=\'video/quicktime\' width=\'500\' height=\'360\' pluginspage=\'http://www.apple.com/quicktime/download/\' /></object></div>', $message);
- }
- //http://spacem.at/movie/audio/podcast-2006-08-03-68914.m4v
- if($mybb->settings['av_mov'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.m4v(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)/([\w/ &;%\.-]+\.m4v)(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object id=\"flowplayer\" width=\"$width\" height=\"$height\" data=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"flashvars\" value='config={\"clip\":{\"url\":\"$2$3$4/$5\",\"autoPlay\":false}}' /></object></div>", $message);
- }
- //http://darfhurl.euro.real.com/darf/?prod=rn_video&filename=p6/RealOne-Europe-20090826-152142-rn_gratis_recording-LeSalondecoiffure-p6EP.rm
- if($mybb->settings['av_real'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.ra?m\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)\.(.*)/([\w/ &;%\.-]+\.ra?m)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object id=\'RVOCX\' classid=\'clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA\' width=\'500\' height=\'360\'><param name=\'src\' value=\'${2}${3}${4}.${5}/${6}\' /><param name=\'controller\' value=\'true\' /><param name=\'autoplay\' value=\'true\' /><param name="autostart" value="1" /><param name=\'controls\' value=\'ImageWindow\' /><param name=\'console\' value=\'video\' /><embed src=\'${2}${3}${4}.${5}/${6}\' type=\'audio/x-pn-realaudio-plugin\' controls=\'ImageWindow,ControlPanel,StatusBar\' console=\'video\' width=\'500\' height=\'360\' autostart=\'true\'></embed></object></div>', $message);
- }
- //http://www.amd.com/us-en/assets/content_type/DownloadableAssets/T64X2_animation.wmv or http://www.sound-emotion.com/sound-emotioncom/wmamusic/baroqueloop90z.wma
- if($mybb->settings['av_wmp'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.wm[va]\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)\.(.*)/([\w/ &;%\.-]+\.wm[va])(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object id=\'ImageWindow\' classid=\'clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\' width=\'500\' height=\'360\'><param name=\'src\' value=\'${2}${3}${4}.${5}/${6}\' /><param name=\'autostart\' value=\'0\' /><embed name=\'MediaPlayer\' src=\'${2}${3}${4}.${5}/${6}\' type=\'video/x-ms-wmv\' width=\'500\' height=\'360\' autostart=\'false\'></embed></object></div>', $message);
- }
- //http://medien.wdr.de/m/1251018000/maus/wdr_fernsehen_die_maus_20090823.mp4
- if($mybb->settings['av_mp4'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.mp4\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)\.(.*)/([\w/ &;%\.-]+\.mp4)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object id=\"flowplayer\" width=\"$width\" height=\"$height\" data=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"{$mybb->settings['bburl']}/mediaplayer/flowplayer-3.2.7.swf\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"flashvars\" value='config={\"clip\":{\"url\":\"$2$3$4.$5/$6\",\"autoPlay\":false}}' /></object></div>", $message);
- }
- //http://www.indymedia.ie/attachments/apr2004/downhillmass.mpg
- if($mybb->settings['av_mpg'] != 0 && preg_match('<a href=\"(http://)?(www.)?(.*)\.mpe?g\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?(.*)\.(.*)/([\w/ &;%\.-]+\.mpe?g)(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object id=\'ImageWindow\' classid=\'clsid:CLSID:05589FA1-C356-11CE-BF01-00AA0055595A\' width=\'500\' height=\'360\'><param name=\'src\' value=\'${2}${3}${4}.${5}/${6}\' /><param name=\'autostart\' value=\'0\' /><embed src=\'${2}${3}${4}.${5}/${6}\' type=\'video/mpeg\' width=\'500\' height=\'360\' autostart=\'false\'></embed></object></div>', $message);
- }
- //http://www.twitvid.com/BBF3D
- if($mybb->settings['av_twitvid'] != 0 && preg_match('<a href=\"(http://)?(www.)?twitvid\.com/(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(www.)?twitvid\.com/)(.{5}?)((.*?)\" target=\"_blank\">)?((.*?)\[/automedia\]|(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'425\' height=\'344\'><param name=\'movie\' value=\'http://www.twitvid.com/player/${4}\' /><param name=\'allowscriptaccess\' value=\'always\' /><param name=\'allowFullScreen\' value=\'true\' /><embed type=\'application/x-shockwave-flash\' src=\'http://www.twitvid.com/player/${4}\' quality=\'high\' allowscriptaccess=\'always\' allowNetworking=\'all\' allowfullscreen=\'true\' wmode=\'transparent\' height=\'344\' width=\'425\'></embed></object></div>', $message);
- }
- //http://link.brightcove.com/services/player/bcpid1119352258?bctid=35782829001
- if($mybb->settings['av_brightcove'] != 0 && preg_match('<a href=\"(http://)?(link.)?brightcove\.com/(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(link.)?brightcove\.com/services/(?:link|player)/bcpid(\d+)[^\">]*?bctid=?(\d+)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><embed src=\'http://c.brightcove.com/services/viewer/federated_f8/${4}\' bgcolor=\'#FFFFFF\' flashVars=\'videoId=${5}&playerId=${4}&viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&\' base=\'http://admin.brightcove.com\' name=\'flashObj\' width=\'440\' height=\'373\' seamlesstabbing=\'false\' type=\'application/x-shockwave-flash\' swLiveConnect=\'true\' pluginspage=\'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\'></embed></div>', $message);
- }
- //http://www.clipjunkie.com/Meerkat-Tribal-Council-vid5797.html
- if($mybb->settings['av_clipjunkie'] != 0 && preg_match('<a href=\"(http://)?(?:www\.)?clipjunkie\.com/(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?clipjunkie\.com/(.*?)-vid([0-9]{4})\.html(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'450\' height=\'350\' data=\'http://www.clipjunkie.com/flvplayer/flvplayer.swf?flv=http://videos.clipjunkie.com/videos/${3}-vid${4}.flv&themes=http://www.clipjunkie.com/flvplayer/themes.xml&playList=http://www.clipjunkie.com/playlist.php&config=http://www.clipjunkie.com/skin/config.xml\' type=\'application/x-shockwave-flash\' ><param name=\'movie\' value=\'http://www.clipjunkie.com/flvplayer/flvplayer.swf?flv=http://videos.clipjunkie.com/videos/${3}-vid${4}.flv&themes=http://www.clipjunkie.com/flvplayer/themes.xml&playList=http://www.clipjunkie.com/playlist.php&config=http://www.clipjunkie.com/skin/config.xml\' /></object></div>', $message);
- }
- //http://www.tudou.com/programs/view/Cp9PT_6LGKg/
- if($mybb->settings['av_tudou'] != 0 && preg_match('<a href=\"(http://)?(?:www\.)?tudou\.com/(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?tudou\.com/(?:programs/view/|v/)(.{1,12}?)(/?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'420\' height=\'320\'><param name=\'movie\' value=\'http://www.tudou.com/v/${3}\' /><param name=\'allowFullScreen\' value=\'true\' /><param name=\'allowscriptaccess\' value=\'always\' /><param name=\'wmode\' value=\'opaque\' /><embed src=\'http://www.tudou.com/v/${3}\' type=\'application/x-shockwave-flash\' allowscriptaccess=\'always\' allowfullscreen=\'true\' wmode=\'opaque\' width=\'420\' height=\'320\'></embed></object></div>', $message);
- }
- //http://www.collegehumor.com/video:1919170
- if($mybb->settings['av_collhumor'] != 0 && preg_match('<a href=\"(http://)?(?:www\.)?collegehumor\.com/video(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?collegehumor\.com/video:(\d{1,12})(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'420\' height=\'320\'><param name=\'movie\' value=\'http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=${3}\' /><embed src=\'http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=${3}\' type=\'application/x-shockwave-flash\' width=\'420\' height=\'320\'></embed></object></div>', $message);
- }
- //http://www.mtv.com/videos/?vid=430678
- if($mybb->settings['av_mtvmov'] != 0 && preg_match('<a href=\"(http://)?(?:www\.)?mtv\.com/videos/\?vid=(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?mtv\.com/videos/\?vid=(\d{1,12})(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><embed src=\'http://media.mtvnservices.com/mgid:uma:video:mtv.com:${3}\' type=\'application/x-shockwave-flash\' flashVars=\'configParams=vid%3D${3}%26uri%3Dmgid%3Auma%3Avideo%3Amtv.com%3A${3}\' allowscriptaccess=\'always\' allowfullscreen=\'true\' width=\'512\' height=\'319\' base=\'.\'></embed></div>', $message);
- }
- //http://www.mtv.com/videos/movie-trailers/491764/the-twilight-saga-eclipse.jhtml#movieId=1617225
- if($mybb->settings['av_mtvmov'] != 0 && preg_match('<a href=\"(http://)?(?:www\.)?mtv\.com/videos/movie-trailers/(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?mtv\.com/videos/movie-trailers/(\d{1,12})/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><embed src=\'http://media.mtvnservices.com/mgid:uma:video:mtv.com:${3}\' type=\'application/x-shockwave-flash\' flashVars=\'configParams=vid%3D${3}%26uri%3Dmgid%3Auma%3Avideo%3Amtv.com%3A${3}\' allowscriptaccess=\'always\' allowfullscreen=\'true\' width=\'512\' height=\'319\' base=\'.\'></embed></div>', $message);
- }
- //http://www.mtvmusic.com/artist/swift__taylor%20t_pain/videos/401599/thug-story
- if($mybb->settings['av_mtvmusic'] != 0 && preg_match('<a href=\"(http://)?(?:www\.)?mtvmusic\.com/(.*?)/videos/(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?mtvmusic\.com/(.*?)videos/(\d{1,9})/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"http://media.mtvnservices.com/mgid:uma:video:mtvmusic.com:$4\" width=\"512\" height=\"319\" type=\"application/x-shockwave-flash\" flashVars=\"dist=http://www.mtvmusic.com\" allowFullScreen=\"true\" AllowScriptAccess=\"always\"></embed></div>", $message);
- }
- //http://www.bbc.co.uk/iplayer/episode/b00m9z9q/1Xtras_Mixtape_with_MistaJam_30_08_2009/
- if($mybb->settings['av_bbciplay'] != 0 && preg_match('<a href=\"(http://)?(?:www\.)?bbc\.co\.uk/iplayer/(?:page/item|episode)/(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?bbc\.co\.uk/iplayer/(?:page/item|episode)/([a-z0-9]{8})/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'640\' height=\'385\'><param name=\'movie\' value=\'http://www.bbc.co.uk/emp/player.swf?playlist=http://www.bbc.co.uk/iplayer/playlist/${3}&config=http://www.bbc.co.uk/emp/iplayer/config.xml&domId=emp1\' /><param name=\'allowFullScreen\' value=\'true\' /><param name=\'allowscriptaccess\' value=\'always\' /><embed src=\'http://www.bbc.co.uk/emp/player.swf?playlist=http://www.bbc.co.uk/iplayer/playlist/${3}&config=http://www.bbc.co.uk/emp/iplayer/config.xml&domId=emp1\' type=\'application/x-shockwave-flash\' flashVars=\'configParams=id%3D${3}%26vid%3D${4}%26uri%3Dmgid:uma:video:mtv.com:${4}%26startUri={startUri}\' allowscriptaccess=\'always\' allowfullscreen=\'true\' width=\'640\' height=\'385\'></embed></object></div>', $message);
- }
- //http://lustich.de/videos/sportler/fan-verhindert-tor/
- if($mybb->settings['av_lustich'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?lustich\.de/videos/(.*)\">isU',$message))
- {
- $pattern = "<http://lustich.de/videos/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://lustich.de/videos/$url");
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nr = get_avmatch('/<param name=\"movie\" value=\"http:\/\/lustich\.de\/player\/pi\.swf\?id=(.*)\"><\/param>/isU',$data);
- $vid = array($nr);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?lustich\.de/videos/(.*?)/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"420\" height=\"350\"><param name=\"movie\" value=\"http://lustich.de/player/pe.swf?id=$n\" /><param name=\"wmode\" value=\"transparent\" /><embed wmode=\"transparent\" src=\"http://lustich.de/player/pe.swf?id=$n\" type=\"application/x-shockwave-flash\" width=\"420\" height=\"350\"></embed></object></div>", $message, $limit);
- }
- }
- }
- //http://www.hulu.com/watch/91202/divorcing-jack
- if($mybb->settings['av_hulu'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?hulu\.com/watch/(.*)\">isU',$message))
- {
- $pattern = "<http://www.hulu.com/watch/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.hulu.com/watch/$url");
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrh = get_avmatch('/<param name=\"movie\" value=\"http:\/\/www\.hulu\.com\/embed\/(.*)\"><\/param>/isU',$data);
- $vid = array($nrh);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?hulu\.com/watch/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"500\" height=\"350\"><param name=\"movie\" value=\"http://hulu.com/embed/$n\" /><param name=\"allowFullScreen\" value=\"true\" /><embed wmode=\"transparent\" src=\"http://hulu.com/embed/$n\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"350\"></embed></object></div>", $message, $limit);
- }
- }
- }
- //http://www.traileraddict.com/trailer/inglorious-basterds/interview-quentin-tarantino-ii
- if($mybb->settings['av_trail'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?traileraddict\.com/trailer/(.*)\">isU',$message))
- {
- $pattern = "<http://www.traileraddict.com/trailer/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.traileraddict.com/trailer/$url");
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrt = get_avmatch('/<param name=\"movie\" value=\"http:\/\/www\.traileraddict\.com\/emb\/(.*)\"><\/param>/isU',$data);
- $vid = array($nrt);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?traileraddict\.com/trailer/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"650\" height=\"388\"><param name=\"movie\" value=\"http://www.traileraddict.com/emd/$n\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.traileraddict.com/emd/$n\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" wmode=\"transparent\" width=\"650\" height=\"388\" allowFullScreen=\"true\"></embed></object></div>", $message, $limit);
- }
- }
- }
- //http://trailers.apple.com/trailers/paramount/gijoeriseofcobra/large.html
- if($mybb->settings['av_apple'] != 0 && preg_match('<a href=\"(http://)(?:trailers\.)?apple\.com/trailers/(.*)\.html\">isU',$message))
- {
- $pattern = "<http://trailers.apple.com/trailers/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://trailers.apple.com/trailers/$url");
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nra = get_avmatch('/\'http:\/\/trailers\.apple\.com\/movies\/(.*)\.mov\'/isU',$data);
- $vid = array($nra);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:trailers\.)?apple\.com/trailers/(.*)\.html(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object id=\"ImageWindow\" classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" width=\"640\" height=\"360\"> <param name=\"src\" value=\"http://trailers.apple.com/movies/$n.mov\" /><param name=\"autostart\" value=\"0\" /><embed src=\"http://trailers.apple.com/movies/$n.mov\" type=\"video/quicktime \"width=\"640\" height=\"360\" autostart=\"false\"></embed></object></div>", $message, $limit);
- }
- }
- }
- //http://www.viddler.com/explore/failblog/videos/253/
- if($mybb->settings['av_viddler'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?viddler\.com/explore/(.*)\">isU',$message))
- {
- $pattern = "<http://www.viddler.com/explore/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.viddler.com/explore/$url");
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrv = get_avmatch('/http:\/\/www\.viddler\.com\/player\/(.*)\//isU',$data);
- $vid = array($nrv);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)?(?:www\.)?viddler\.com/explore/(.*?)/videos/(?:\w{1,12})/(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"437\" height=\"333\" id=\"viddler_$n\"><param name=\"movie\" value=\"http://www.viddler.com/player/$n/\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.viddler.com/player/$n/\" width=\"437\" height=\"333\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\" allowFullScreen=\"true\" name=\"viddler_$n\"></embed></object></div>", $message, $limit);
- }
- }
- }
- //http://blip.tv/file/2588255/
- if($mybb->settings['av_blip'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?blip\.tv/file/(.*)\">isU',$message))
- {
- $pattern = "<http://blip.tv/file/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://blip.tv/file/$url");
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrblip = get_avmatch('/href=\"http:\/\/blip.tv\/play\/(.*)\" \/>/isU',$data);
- $vid = array($nrblip);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?blip\.tv/file/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"http://blip.tv/play/$n\" type=\"application/x-shockwave-flash\" width=\"480\" height=\"390\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed></div>", $message, $limit);
- }
- }
- }
- //http://www.trtube.com/-ayna-sen-unutma-beni--97383.html
- if($mybb->settings['av_trtube'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?trtube\.com/(.*)\.html\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?trtube\.com/(.*?)([0-9]{1,8})\.html(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'425\' height=\'350\'><param name=\'allowScriptAccess\' value=\'always\' /><param name=\'movie\' value=\'http://www.trtube.com/mediaplayer_3_15.swf?file=http://www.trtube.com/playlist.php?v=${5}\' /><embed src=\'http://www.trtube.com/mediaplayer_3_15.swf?file=http://www.trtube.com/playlist.php?v=${5}\' type=\'application/x-shockwave-flash\' height=\'350\' width=\'425\'></embed></object></div>', $message);
- }
- //http://www.break.com/index/kid-freaks-out-on-first-roller-coaster-ride.html
- if($mybb->settings['av_break'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?break\.com/[^\"]*?\w+\.html\">isU',$message))
- {
- $pattern = "<http://www.break.com/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.break.com/$url");
-
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrbreak = get_avmatch('/http:\/\/embed\.break\.com\/([0-9]{1,12}?)/isU',$data);
- $vid = array($nrbreak);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?break\.com/(.*?)\.html(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"464\" height=\"384\"><param name=\"movie\" value=\"http://embed.break.com/$n/\" /><param name=\"allowScriptAccess\" value=\"always\" /><embed src=\"http://embed.break.com/$n/\" width=\"464\" height=\"384\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\"></embed></object></div>", $message, $limit);
- }
- }
- }
- //http://videos.sapo.pt/h3zC1Cvy8Q28vEsBD2YW
- if($mybb->settings['av_sapo'] != 0 && preg_match('<a href=\"(http://)(?:videos\.)?sapo\.pt/(.*)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:videos\.)?sapo\.pt/(.{1,30}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'400\' height=\'350\'><param name=\'allowFullScreen\' value=\'true\' /><param name=\'movie\' value=\'http://rd3.videos.sapo.pt/play?file=http://rd3.videos.sapo.pt/${4}/mov/1\' /><embed src=\'http://rd3.videos.sapo.pt/play?file=http://rd3.videos.sapo.pt/${4}/mov/1\' type=\'application/x-shockwave-flash\' allowFullScreen=\'true\' height=\'350\' width=\'400\'></embed></object></div>', $message);
- }
- //http://futebol.videos.sapo.pt/38UEoigpbOyZjyPu4qwn
- if($mybb->settings['av_futebol'] != 0 && preg_match('<a href=\"(http://)(?:futebol\.)(?:videos\.)?sapo\.pt/(.*)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:futebol\.)(?:videos\.)?sapo\.pt/(.{1,30}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'400\' height=\'350\'><param name=\'allowFullScreen\' value=\'true\' /><param name=\'movie\' value=\'http://futebol.videos.sapo.pt/play-bwin?file=http://futebol.videos.sapo.pt/${4}/mov/1\' /><embed src=\'http://futebol.videos.sapo.pt/play-bwin?file=http://futebol.videos.sapo.pt/${4}/mov/1\' type=\'application/x-shockwave-flash\' allowFullScreen=\'true\' height=\'350\' width=\'400\'></embed></object></div>', $message);
- }
- //http://www.trilulilu.ro/PRINCESSE/22f352800f7ff7
- if($mybb->settings['av_trilu'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?trilulilu\.ro/(.*)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?trilulilu\.ro/(.{3,50}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'448\' height=\'371\'><param name=\'movie\' value=\'http://embed.trilulilu.ro/video/${4}/0xe9eff4.swf\' /><param name=\'allowFullScreen\' value=\'true\' /><param name=\'allowscriptaccess\' value=\'always\' /><embed src=\'http://embed.trilulilu.ro/video/${4}/0xe9eff4.swf\' type=\'application/x-shockwave-flash\' allowscriptaccess=\'always\' allowfullscreen=\'true\' width=\'448\' height=\'371\'></embed></object></div>', $message);
- }
- //http://rutube.ru/tracks/2370874.html?v=73ae0fe7d944c85caa4392d062fd9377
- if($mybb->settings['av_rutube'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?rutube\.ru/tracks/(.*)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?rutube\.ru/tracks/([0-9]{3,12}?)\.html\?v=([0-9a-f]{3,50}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'470\' height=\'353\'><param name=\'movie\' value=\'http://video.rutube.ru/${5}\' /><param name=\'wmode\' value=\'window\' /><param name=\'allowFullScreen\' value=\'true\' /><embed src=\'http://video.rutube.ru/${5}\' type=\'application/x-shockwave-flash\' wmode=\'window\' width=\'470\' height=\'353\' allowfullscreen=\'true\'></embed></object></div>', $message);
- }
- //http://www.gametube.org/#/video/smQYBG6dTJ44WXXRIN9hfUGInkE=
- if($mybb->settings['av_gametube'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?gametube\.org/(?:\#/video/)(.*)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?gametube\.org/(?:\#/video/)(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' codebase=\'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\' width=\'451\' height=\'372\'><param name=\'movie\' value=\'http://www.gametube.org/miniPlayer.swf?vidId=${4}\' /><param name=\'wmode\' value=\'transparent\' /><embed src=\'http://www.gametube.org/miniPlayer.swf?vidId=${4}\' type=\'application/x-shockwave-flash\' wmode=\'transparent\' width=\'451\' height=\'372\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object></div>', $message);
- }
- //http://www.gametrailers.com/video/nissan-gtr-need-for/55935
- if($mybb->settings['av_gametrail'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?gametrailers\.com/(.*?)/([0-9]{1,9}?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?gametrailers\.com/(.*?)/([0-9]{1,9}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' codebase=\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\' id=\'gtembed\' width=\'480\' height=\'392\'><param name=\'allowScriptAccess\' value=\'sameDomain\' /><param name=\'allowFullScreen\' value=\'true\' /><param name=\'movie\' value=\'http://www.gametrailers.com/remote_wrap.php?mid=${5}\' /><param name=\'quality\' value=\'high\' /><embed src=\'http://www.gametrailers.com/remote_wrap.php?mid=${5}\' swLiveConnect=\'true\' name=\'gtembed\' align=\'middle\' allowScriptAccess=\'sameDomain\' allowFullScreen=\'true\' quality=\'high\' type=\'application/x-shockwave-flash\' width=\'480\' height=\'392\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object></div>', $message);
- }
- //http://www.gamespot.com/xbox360/driving/forzamotorsport3/video/6237914/forza-motorsport-3-video-review
- if($mybb->settings['av_gamespot'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?gamespot\.com/(.*?)/video/([0-9]{1,9}?)/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?gamespot\.com/(.*?)/video/([0-9]{1,9}?)/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><embed id=\'mymovie\' width=\'432\' height=\'362\' flashvars=\'playerMode=embedded&movieAspect=4.3&flavor=EmbeddedPlayerVersion&skin=http://image.com.com/gamespot/images/cne_flash/production/media_player/proteus/one/skins/gamespot.png&paramsURI=http://www.gamespot.com/pages/video_player/xml.php?id=${5}&mode=embedded&width=432&height=362/\' wmode=\'transparent\' allowscriptaccess=\'always\' quality=\'high\' name=\'mymovie\' style=\'\' src=\'http://image.com.com/gamespot/images/cne_flash/production/media_player/proteus/one/proteus2.swf\' type=\'application/x-shockwave-flash\'></embed></div>', $message);
- }
- //http://www.123video.nl/playvideos.asp?MovieID=614229
- if($mybb->settings['av_123vid'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?123video\.nl/playvideos(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?123video\.nl/playvideos\.asp\?MovieID=)(.{6}?)((.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' codebase=\'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\' width=\'420\' height=\'339\'><param name=\'movie\' value=\'http://www.123video.nl/123video_share.swf?mediaSrc=${4}\' /><param name=\'quality\' value=\'high\' /><embed src=\'http://www.123video.nl/123video_share.swf?mediaSrc=${4}\' quality=\'high\' width=\'420\' height=\'339\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\' /></object></div>', $message);
- }
- //http://www.goear.com/listen/dacf88d/pokerface-pokerface
- if($mybb->settings['av_goear'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?goear\.com/listen(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?goear\.com/listen/([0-9a-f]{5,10}?)/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width= \"353\" height=\"132\"><embed src=\"http://www.goear.com/files/external.swf?file=$4\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" quality=\"high\" width=\"353\" height=\"132\"></embed></object></div>", $message);
- }
- //http://www.bofunk.com/video/9966/chick_gives_boyfriend_a_snow_job.html
- if($mybb->settings['av_bofunk'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?bofunk\.com/[^\"]*?\w+\.html\">isU',$message))
- {
- $pattern = "<http://www.bofunk.com/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.bofunk.com/$url");
-
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrbofunk = get_avmatch('/<embed src=\"http:\/\/www\.bofunk\.com\/e\/(.*)\" quality=\"high\" /isU',$data);
- $vid = array($nrbofunk);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?bofunk\.com/video/(.*?)\.html(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"http://www.bofunk.com/e/$n\" quality=\"high\" bgcolor=\"#000000\" width=\"446\" height=\"370\" name=\"flvplayer\" align=\"middle\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></div>", $message, $limit);
- }
- }
- }
- //http://www.clipmoon.com/videos/2190311/lazy-cats.html
- if($mybb->settings['av_clipmoon'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?clipmoon\.com/videos/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?clipmoon\.com/videos/([0-9a-f]{1,10}?)/(.*?)\.html(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"http://www.clipmoon.com/flvplayer.swf\" FlashVars=\"config=http://www.clipmoon.com/flvplayer.php?viewkey=$4&external=no\" quality=\"high\" bgcolor=\"#000000\" wmode=\"transparent\" width=\"460\" height=\"357\" loop=\"false\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" scale=\"exactfit\"></embed></div>", $message);
- }
- //http://www.funnyordie.com/videos/25a35c4142/brendan-fraser-hand-clap-remix
- if($mybb->settings['av_funnyordie'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?funnyordie\.(com|co\.uk)/videos/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?funnyordie\.(com|co\.uk)/videos/([0-9a-f]{1,15}?)/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"512\" height=\"328\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" id=\"ordie_player_$5\"><param name=\"movie\" value=\"http://player.ordienetworks.com/flash/fodplayer.swf\" /><param name=\"flashvars\" value=\"key=$5\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><embed width=\"512\" height=\"328\" flashvars=\"key=$5\" allowfullscreen=\"true\" allowscriptaccess=\"always\" quality=\"high\" src=\"http://player.ordienetworks.com/flash/fodplayer.swf\" name=\"ordie_player_$5\" type=\"application/x-shockwave-flash\"></embed></object></div>", $message);
- }
- //http://www.liveleak.com/view?i=6b0_1264510631
- if($mybb->settings['av_liveleak'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?liveleak\.com/view(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?liveleak\.com/view\?i=(\w{1,25}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"450\" height=\"370\"><param name=\"movie\" value=\"http://www.liveleak.com/e/$4\" /><param name=\"wmode\" value=\"transparent\" /><embed src=\"http://www.liveleak.com/e/$4\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"450\" height=\"370\"></embed></object></div>", $message);
- }
- //http://videa.hu/videok/sport/forma-1-2008-brazil-nagydij-alonso-elozes-eso-vQjWxcm8oYBLh68a
- if($mybb->settings['av_videahu'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?videa\.hu/videok/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?videa\.hu/videok/(.*?)-(\w{16}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"448\" height=\"366\"><param name=\"movie\" value=\"http://videa.hu/flvplayer.swf?v=$5\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"true\" /><embed width=\"448\" height=\"366\" src=\"http://videa.hu/flvplayer.swf?v=$5\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" /></object></div>", $message);
- }
- //http://www.imdb.com/video/imdb/vi14943257/
- if($mybb->settings['av_imdb'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?imdb\.com/video/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?imdb\.com/video/(\w*?)/vi([0-9]{1,12}?)/(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><iframe src=\"http://www.imdb.com/video/$4/vi$5/player\" width=\"640\" height=\"480\" name=\"IMDB Video\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\"></iframe></div>", $message);
- }
- //http://www.movshare.net/video/qf85cptaem4v8
- if($mybb->settings['av_movshare'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?movshare\.net/video/(.*?)">isU',$message))
- {
- //Movshare embed code not working in IE and Opera
- if(isset($_SERVER['HTTP_USER_AGENT'])){
- $agent = htmlspecialchars_uni($_SERVER['HTTP_USER_AGENT']);
- }
- if(!preg_match('/^Opera\//i',$agent) && (!preg_match('/^Mozilla\/4(.*)MSIE/i',$agent)))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?movshare\.net/video/(\w{5,18}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><iframe style=\"overflow: hidden; border: 0; width: 720px; height: 362px\" src=\"http://www.movshare.net/embed/$4/?width=720&height=306\" scrolling= \"no\"></iframe></div>", $message);
- }
- }
- //http://www.ustream.tv/channel/pix-wpa-01
- if($mybb->settings['av_ustream'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?ustream\.tv/channel/(.*?)">isU',$message))
- {
- $pattern = "<http://www.ustream.tv/channel/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.ustream.tv/channel/$url");
-
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrustream = get_avmatch('/cid=([0-9]{1,12}?)/isU',$data);
- $vid = array($nrustream);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = $db->escape_string($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?ustream\.tv/channel/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"480\" height=\"360\"><param name=\"flashvars\" value=\"autoplay=false&brand=embed&cid=$n\"/><param name=\"bgcolor\" value=\"#000000\"/><param name=\"allowfullscreen\" value=\"true\"/><param name=\"allowscriptaccess\" value=\"always\"/><param name=\"movie\" value=\"http://www.ustream.tv/flash/live/1/$n\"/><embed flashvars=\"autoplay=false&brand=embed&cid=$n\" width=\"480\" height=\"360\" bgcolor=\"#000000\" allowfullscreen=\"true\" allowscriptaccess=\"always\" src=\"http://www.ustream.tv/flash/live/1/$n\" type=\"application/x-shockwave-flash\" /></object></div>", $message, $limit);
- }
- }
- }
- //http://www.blogtv.com/Shows/1059925/Ze_vYeNGbWFEZu7xYe7&pos=ancr
- if($mybb->settings['av_blogtv'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?blogtv\.com/(.*?)">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?blogtv\.com/(.*)/(\w*)(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed width=\"445\" height=\"374\" src=\"http://www.blogtv.com/vb/$5\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\"></embed></div>", $message);
- }
- //http://soundcloud.com/skreamizm/skream-future-funk-teaser
- if($mybb->settings['av_soundcloud'] != 0 && preg_match('<a href=\"(http://)?soundcloud\.com/(.*?)">isU',$message))
- {
- $pattern = "<http://soundcloud.com/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://soundcloud.com/$url");
-
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrsstream = get_avmatch('/data-sc-track=\"(.*)\"><div class=/isU',$data);
- $vid = array($nrsstream);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = $db->escape_string($id);
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)?soundcloud\.com/(.*?)/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object height=\"81\" width=\"100%\"> <param name=\"movie\" value=\"http://player.soundcloud.com/player.swf?url=http://api.soundcloud.com/tracks/$n&secret_url=false\"></param> <param name=\"allowscriptaccess\" value=\"always\"></param> <embed allowscriptaccess=\"always\" height=\"81\" src=\"http://player.soundcloud.com/player.swf?url=http://api.soundcloud.com/tracks/$n&secret_url=false\" type=\"application/x-shockwave-flash\" width=\"100%\"></embed> </object></div>", $message, $limit);
- }
- }
- }
- //http://www.mefeedia.com/video/33461653
- if($mybb->settings['av_mefeedia'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?mefeedia\.com/video/(.*?)">isU',$message))
- {
- //Mefeedia embed code not working in Chrome
- if(isset($_SERVER['HTTP_USER_AGENT'])){
- $agent = htmlspecialchars_uni($_SERVER['HTTP_USER_AGENT']);
- }
- if(strpos($agent, 'Chrome') == false)
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?mefeedia\.com/video/([0-9]{1,12}?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><iframe scrolling=\"no\" frameborder=\"0\" width=\"640\" height=\"450\" src=\"http://www.mefeedia.com/video/$4&iframe\"></iframe></div>", $message);
- }
- }
- //http://www.wat.tv/video/the-pretty-reckless-just-tonight-360an_2zicp_.html
- if($mybb->settings['av_wattv'] != 0 && preg_match('<a href=\"(http://)(?:www\.)?wat\.tv/video/(.*?)\.html">isU',$message))
- {
- $pattern = "<http://www.wat.tv/video/(.*)\" target>";
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.wat.tv/video/$url");
-
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0");
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrwat = get_avmatch('/<link rel=\"video_src\" href=\"(.*)\"/isU',$data);
- $vid = array($nrwat);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = $db->escape_string($id);
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?wat\.tv/video/(.*?)\.html(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"480\" height=\"270\"><param name=\"movie\" value=\"$n\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowScriptAccess\" value=\"always\"></param><embed src=\"$n\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"270\"></embed></object></div>", $message, $limit);
- }
- }
- }
- return $message;
- }
- }
- }
- }
- }
- }
- }
-
-
-
-
- //Embed Adult Site Videos #############################################################################################
- function automedia_adult_run($message)
- {
- global $db, $mybb, $cache, $post, $automedia_adult;
-
-
- //Add new mycode for disabling embedding
- $message = preg_replace("#\[amoff\](http://)(.*?)\[/amoff\]#i", '<a name=\'amoff\' href=\'${1}${2}\' id =\'am\' target=\'_blank\'>${1}${2}</a>', $message);
-
-
- //Find the set fid's in Adult Settings
- $avfid = intval($post['fid']);
-
- $adfids = explode(',', $mybb->settings['av_adultforums']);
- if (in_array($avfid,$adfids))
- {
- $adultfid = false;
- }
- else
- {
- $adultfid = true;
- }
-
- /**
- *Get the settings for the usergroups
- */
- //Find the allowed Adult primary groups in Settings
- $gid = intval($mybb->user['usergroup']);
- $adultgroups = explode(',', $mybb->settings['av_adultgroups']);
- if (in_array($gid,$adultgroups))
- {
- $adultgid = false;
- }
- else
- {
- $adultgid = true;
- }
-
- //Find the allowed Adult secondary groups in Settings
- $adag = explode(',', $mybb->user['additionalgroups']);
- foreach($adag as $ad)
- {
- if (in_array($ad,$adultgroups))
- {
- $adultaddgid = false;
- }
- else
- {
- $adultaddgid = true;
- }
- }
-
- /**
- * Apply the permissions
- */
-
- //Adultsites enabled?
- if($mybb->settings['av_adultsites'] != 0)
- {
-
- //Has the User AutoMedia enabled in User CP?
- if($mybb->user['automedia_use'] != 'N')
- {
-
- //Embedding not disabled by using mycode?
- if (!preg_match('/<a name=\"amoff\" href=\"(.*)\" id=\"am\" target=\"_blank\">/isU',$message))
- {
-
- //Adultsites allowed for Guests in Settings?
- if ($mybb->settings['av_adultguest'] != 0 || ($mybb->user['uid'] != 0))
- {
-
- // User in allowed group? Admins always allowed, 0 = all groups allowed
- if(!$adultgid || !$adultaddgid || $gid == 4 || $mybb->settings['av_adultgroups'] == 0)
- {
-
- //Forum set for adult sites?
- if(!$adultfid || $mybb->settings['av_adultforums'] == 0)
- {
-
-
- /**
- * Embed the files
- */
- //http://www.redtube.com/12528
- if(preg_match('<a href=\"(http://)(?:www\.)?redtube\.com/(?:\d{1,8})\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?redtube\.com/(.{1,8})(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'434\' height=\'344\'><param name=\'movie\' value=\'http://embed.redtube.com/player/\' /><param name=\'FlashVars\' value=\'id=${4}&style=redtube\' /><embed src=\'http://embed.redtube.com/player/?id=${4}&style=redtube\' pluginspage=\'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\' type=\'application/x-shockwave-flash\' height=\'344\' width=\'434\'></embed></object></div>', $message);
- }
- //http://www.xvideos.com/video221033/daisy_marie_is_so_cute
- if(preg_match('<a href=\"(http://)(?:www\.)?xvideos\.com/video(?:\d{1,12})/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?xvideos\.com/video([0-9]{1,12})/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'510\' height=\'400\' classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' codebase=\'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\' ><param name=\'quality\' value=\'high\' /><param name=\'bgcolor\' value=\'#000000\' /><param name=\'allowScriptAccess\' value=\'always\' /><param name=\'movie\' value=\'http://static.xvideos.com/swf/flv_player_site_v4.swf\' /><param name=\'allowFullScreen\' value=\'true\' /><param name=\'flashvars\' value=\'id_video=${4}\' /><embed src=\'http://static.xvideos.com/swf/flv_player_site_v4.swf\' allowscriptaccess=\'always\' width=\'510\' height=\'400\' menu=\'false\' quality=\'high\' bgcolor=\'#000000\' allowfullscreen=\'true\' flashvars=\'id_video=${4}\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object></div>', $message);
- }
- //http://www.porn8.com/free-porn/video/3b878c4e2c/Hailey-Jade-in-POV-Casting-Couch-11-Scene-3-from-VideosZ.video
- if(preg_match('<a href=\"(http://)(?:www\.)?porn8\.com/free-porn/video/(?:\w{1,15})/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?porn8\.com/free-porn/video/([0-9a-f]{1,15})/(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object width=\'450\' height=\'370\' ><param name=\'movie\' value=\'http://www.porn8.com/flv/flvplayer.swf\' /><param name=\'FlashVars\' value=\'config=http://www.porn8.com/vidcolem/${4}/\' /><param name=\'quality\' value=\'high\' /><param name=\'bgcolor\' value=\'#000000\' /><param name=\'allowFullScreen\' value=\'true\' /><param name=\'allowScriptAccess\' value=\'always\' /><embed src=\'http://www.porn8.com/flv/flvplayer.swf\' allowscriptaccess=\'always\' allowfullscreen=\'true\' width=\'450\' height=\'370\' quality=\'high\' bgcolor=\'#000000\' FlashVars=\'config=http://www.porn8.com/vidcolem/${4}/\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object></div>', $message);
- }
- //http://www.keezmovies.com/video/amateur-brunette-blows-hubby-447981 or http://www.keezmovies.com/447981
- if(preg_match('<a href=\"(http://)(?:www\.)?keezmovies\.com/(.*)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?keezmovies\.com/([0-9]{1,15})(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object type=\'application/x-shockwave-flash\' data=\'http://km-static.phncdn.com/flash/player_embed.swf?cache=002\' width=\'508\' height=\'416\' ><param name=\'movie\' value=\'http://http://www.keezmovies.com/inc/players/v1/player.swf\' /><param name=\'bgcolor\' value=\'#000000\' /><param name=\'allowfullscreen\' value=\'true\' /><param name=\'allowScriptAccess\' value=\'always\' /><param name=\'FlashVars\' value=\'options=http://www.keezmovies.com/embed_player.php?id=${4}\' /><embed src=\'http://www.keezmovies.com/inc/players/v1/player.swf\' allowscriptaccess=\'always\' allowfullscreen=\'true\' width=\'508\' height=\'416\' bgcolor=\'#000000\' FlashVars=\'options=http://www.keezmovies.com/embed_player.php?id=${4}\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object></div>', $message);
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)(?:www\.)?keezmovies\.com/video/(.*?)-([0-9]{1,15})(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", '<div class=\'am_embed\'><object type=\'application/x-shockwave-flash\' data=\'http://km-static.phncdn.com/flash/player_embed.swf?cache=002\' width=\'508\' height=\'416\' ><param name=\'movie\' value=\'http://http://www.keezmovies.com/inc/players/v1/player.swf\' /><param name=\'bgcolor\' value=\'#000000\' /><param name=\'allowfullscreen\' value=\'true\' /><param name=\'allowScriptAccess\' value=\'always\' /><param name=\'FlashVars\' value=\'options=http://www.keezmovies.com/embed_player.php?id=${5}\' /><embed src=\'http://www.keezmovies.com/inc/players/v1/player.swf\' allowscriptaccess=\'always\' allowfullscreen=\'true\' width=\'508\' height=\'416\' bgcolor=\'#000000\' FlashVars=\'options=http://www.keezmovies.com/embed_player.php?id=${5}\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object></div>', $message);
- }
- //http://www.xxxymovies.com/watch/8379/Latin_wife_to_do_his_taxes_or_him.html
- $pattern = "<http://www.xxxymovies.com/watch/(.*)\" target>";
- if(preg_match($pattern, $message))
- {
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.xxxymovies.com/watch/$url");
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrxxx = get_avmatch('/fo\.addVariable\(\"videoid\", \"([0-9a-f]{1,50}?)/isU',$data);
- $vid = array($nrxxx);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?xxxymovies\.com/watch/(.*?)\.html(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><embed src=\"http://www.xxxymovies.com/embed/$n/\" loop=\"false\" width=\"480\" height=\"384\" allowfullscreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></div>", $message, $limit);
- }
- }
- }
- //http://www.pornhub.com/view_video.php?viewkey=395131153
- $pattern = "<http://www.pornhub.com/(.*)\" target>";
- if(preg_match($pattern, $message))
- {
- preg_match_all($pattern, $message, $links);
- $link = $links[1];
- foreach ($link as $url)
- {
- $site = htmlspecialchars_uni("http://www.pornhub.com/$url");
- //Use cURL and find the video id
- if (!function_exists('curl_init') || !$c = curl_init())
- return false;
- curl_setopt($c, CURLOPT_URL, $site);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0");
- curl_setopt($c, CURLOPT_TIMEOUT, 3);
- $data = utf8_encode(curl_exec($c));
- if (!$data)
- $data = 'not available';
- curl_close($c);
-
- if($data) {
- $nrph = get_avmatch('/video\.php\?id=([0-9]{1,10}?)/isU',$data);
- $vid = array($nrph);
- }
- $limit = 1;
- foreach ($vid as $id)
- {
- $n = htmlspecialchars_uni($id);
- $message = preg_replace("#(\[automedia\]|<a href=\"(http://)(?:www\.)?pornhub\.com/view(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object type=\"application/x-shockwave-flash\" data=\"http://ph-static.phncdn.com/flash/embed_player_v1.3.swf\" width=\"608\" height=\"476\"><param name=\"movie\" value=\"http://ph-static.phncdn.com/flash/embed_player_v1.3.swf\" /><param name=\"bgColor\" value=\"#000000\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"FlashVars\" value=\"options=http://www.pornhub.com/embed_player.php?id=$n\"/></object></div>", $message, $limit);
- }
- }
- }
- //http://latex.vidz.com/video/Pink_Ink_scene_1/vidz_porn_videos_blowjob_boots_brunette_doggystyle_gonzo_kissing_latex_long-hair_on-top_pussy-licking_shaved_smalltits_tattoo/?s=5244&n=111&p=-59
- if(preg_match('<a href=\"(.*?)\.vidz\.com/video/(.*?)\">isU',$message))
- {
- $message = preg_replace("#(\[automedia\]|(<a href=\")?(http://)?(.*?)\.vidz\.com/video/(.*?)s=([0-9]{1,8})(.*?)(\-?)([0-9]{1,5})(.*?)(\[/automedia\]|\" target=\"_blank\">)(.*?)</a>)#i", "<div class=\"am_embed\"><object width=\"640\" height=\"472\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" ><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#000000\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"movie\" value=\"http://webdata.vidz.com/demo/swf/FlashPlayerV2.swf\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"flashvars\" value=\"id_scene=$6&id_niche=$8$9&type=free\" /><embed src=\"http://webdata.vidz.com/demo/swf/FlashPlayerV2.swf\" allowscriptaccess=\"always\" width=\"640\" height=\"472\" menu=\"false\" quality=\"high\" bgcolor=\"#000000\" allowfullscreen=\"true\" flashvars=\"id_scene=$6&id_niche=$8$9&type=free\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object></div>", $message);
- }
- return $message;
- }
- }
- }
- }
- }
- }
- }
-
-
-
-
- //Embedding disabled in signatures #############################################################################
- function automedia_hide($post)
- {
- global $mybb, $lang, $settings, $automedia;
-
- $lang->load("automedia");
-
- if ($mybb->settings['av_signature'] != 1)
- {
- $post['signature'] = preg_replace("!<div class=\'am_embed\'>(.*?)</div>!i", "{$lang->av_sigreplace}", $post['signature']);
- $post['signature'] = preg_replace("!<div class=\"am_embed\">(.*?)</div>!i", "{$lang->av_sigreplace}", $post['signature']);
- $post['signature'] = preg_replace("!<object(.*?)</object>!i", "{$lang->av_sigreplace}", $post['signature']);
- $post['signature'] = preg_replace("!<embed(.*?)</embed>!i", "{$lang->av_sigreplace}", $post['signature']);
- $post['signature'] = preg_replace("!<iframe src=\"http://www.imdb.com/video/(.*?)</iframe>!i", "{$lang->av_sigreplace}", $post['signature']);
- $post['signature'] = preg_replace("!<iframe style=\"overflow: hidden; border: 0; width: 720px; height: 362px\" src=\"http://www.movshare.net/embed/(.*?)</iframe>!i", "{$lang->av_sigreplace}", $post['signature']);
- }
- }
-
- // Message in User CP signature preview and Profile if embedding in signatures is disabled #################################
- function amsigpreview($page)
- {
- global $mybb, $lang, $settings, $amsigpreview, $templates;
-
- $lang->load("automedia");
-
- if(THIS_SCRIPT=="usercp.php" || THIS_SCRIPT=="member.php")
- {
- if ($mybb->settings['av_signature'] != 1)
- {
- $page = preg_replace("!<div class=\'am_embed\'>(.*?)</div>!i", "{$lang->av_sigreplace}", $page);
- $page = preg_replace("!<div class=\"am_embed\">(.*?)</div>!i", "{$lang->av_sigreplace}", $page);
- }
- }
- }
-
- //Use MyBB 1.6.* maxpostvideos settings
- function automedia_count($post)
- {
- global $mybb, $lang, $settings, $automedia;
-
- $lang->load("automedia");
-
- // Get the permissions of the user who is making this post or thread
- $permissions = user_permissions($post['uid']);
-
- // Check if this post contains more videos than the forum allows
- if($post['savedraft'] != 1 && $mybb->settings['maxpostvideos'] != 0 && $permissions['cancp'] != 1)
- {
- // And count the number of all videos in the message.
- $automedia_count = substr_count($post['message'], "am_embed");
- $vids_count = substr_count($post['message'], "video_embed");
- $all_count = $automedia_count + $vids_count;
- if($all_count > $mybb->settings['maxpostvideos'])
- {
- // Throw back a message if over the count as well as the maximum number of videos per post.
- $post['message'] = "<div style=\"color:#FF0000\"><strong><u>{$lang->av_vidcount} {$mybb->settings['maxpostvideos']}</u></strong></div>";
- }
- }
- }
-
-
- /**
- * The Hook Function for toolbar-container plugin
- * -----------------
- * Function to fill the items attribute of the ItemCollector object
- * that declared on toolbar_contanier plugin. This function only executed
- * when Toolbar Container plugin is active.
- *
- * @param ItemCollector &$ic
- * @return void
- */
-
- function automedia_collect(&$ic) {
-
- global $lang, $mybb;
-
- $lang->load("automedia");
-
- // the javascript callback function
- // called when button clicked
- $callback = "
- var ask_me = prompt('Video Audio Link', '');
- if (ask_me == null) return;
- if (ask_me != '') {
- ask_me = ask_me;
- }
- // inject to editor
- clickableEditor.performInsert('[amoff]' + ask_me + '[/amoff]', '', true, false);
- ";
- $toolbar = array(
- 'id' => 'automedia_v116', // make sure it's unique, add version number to make sure
- 'name' => 'automedia',
- 'image' => 'amoff.png',
- 'callback' => $callback,
- 'title' => $lang->av_amoff
- );
- $ic->collect_item($toolbar);
- }
-
- function amplaylist_collect(&$ic) {
-
- global $lang, $mybb;
-
- $lang->load("automedia");
-
- // the javascript callback function
- // called when button clicked
- $callback = "
- var ask_me = prompt('Playlist Links', '');
- if (ask_me == null) return;
- if (ask_me != '') {
- ask_me = ask_me;
- }
- // inject to editor
- clickableEditor.performInsert('[ampl]' + ask_me + '[/ampl]', '', true, false);
- ";
- $toolbar = array(
- 'id' => 'automedia_v117', // make sure it's unique, add version number to make sure
- 'name' => 'automedia',
- 'image' => 'ampl.png',
- 'callback' => $callback,
- 'title' => 'MP3 Playlist'
- );
- $ic->collect_item($toolbar);
- }
- ?>