/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
Large files files are truncated, but you can click here to view the full file
- <?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 h…
Large files files are truncated, but you can click here to view the full file