function logbee_header() { $location = Rewrite::newInstance()->get_location(); $section = Rewrite::newInstance()->get_section(); if ($location == 'item' && $section == '') { echo ' <style type="text/css"> .logbee ul { margin: 10px 0; list-style: none; } .logbee ul li { float: left; } .logbee .clear { clear:both; } </style>'; // meta-tags $address_array = array(); if (osc_item_address() != "") { $address_array[] = osc_item_address(); } if (osc_item_city_area() != "") { $address_array[] = osc_item_city_area(); } if (osc_item_zip() != "") { $address_array[] = osc_item_zip(); } if (osc_item_city() != "") { $address_array[] = osc_item_city(); } if (osc_item_region() != "") { $address_array[] = osc_item_region(); } if (osc_item_country() != "") { $address_array[] = osc_item_country(); } $address = implode(", ", $address_array); $price = ''; if (osc_item_formated_price() != "") { $price = osc_item_formated_price(); } $email = ''; if (osc_item_show_email()) { $email = osc_item_contact_email(); } echo ' <meta property="logbee:title" content="' . osc_esc_html(osc_item_title()) . '"/> <meta property="logbee:url" content="' . osc_esc_html(osc_item_url()) . '"/> <meta property="logbee:desc" content="' . osc_esc_html(osc_item_description()) . '"/> <meta property="logbee:addr" content="' . osc_esc_html($address) . '"/> <meta property="logbee:email" content="' . osc_esc_html($email) . '"/> <meta property="logbee:price" content="' . osc_esc_html($price) . '"/>'; // do we have the cars_plugin enabled? if (osc_plugin_is_enabled('cars_attributes/index.php')) { require_once osc_plugin_path('') . '/cars_attributes/ModelCars.php'; if (osc_is_this_category('cars_plugin', osc_item_category_id())) { $detail = ModelCars::newInstance()->getCarAttr(osc_item_id()); echo ' <meta property="logbee:type" content="car"/> <meta property="logbee:mileage" content="' . osc_esc_html(@$detail['i_mileage']) . '"/> <meta property="logbee:firstreg" content="' . osc_esc_html(@$detail['i_year']) . '"/>'; } } // do we have the realestate_plugin enabled? if (osc_plugin_is_enabled('realestate_attributes/index.php')) { require_once osc_plugin_path('') . '/realestate_attributes/ModelRealEstate.php'; if (osc_is_this_category('realestate_plugin', osc_item_category_id())) { $detail = ModelRealEstate::newInstance()->getAttributes(osc_item_id()); echo ' <meta property="logbee:type" content="realty"/> <meta property="logbee:rooms" content="' . osc_esc_html(@$detail['i_num_rooms']) . '"/> <meta property="logbee:size" content="' . osc_esc_html(@$detail['s_square_meters']) . ' sqm"/>'; } } // images osc_reset_resources(); $images_array = array(); for ($i = 0; osc_has_item_resources(); $i++) { $images_array[] = osc_esc_html(osc_resource_url()); } $images = implode("|", $images_array); echo ' <meta property="logbee:imgurl" content="' . $images . '"/> '; osc_reset_resources(); echo "\n"; } }
/** * Makes this plugin the first to be loaded. * - Bumps this plugin at the top of the active_plugins stack. */ function mdh_emailmagick_bump_me() { if (OC_ADMIN) { // @legacy : ALWAYS remove this if active. if (osc_plugin_is_enabled("madhouse_utils/index.php")) { Plugins::deactivate("madhouse_utils/index.php"); } // Sanitize & get the {PLUGIN_NAME}/index.php. $path = str_replace(osc_plugins_path(), '', osc_plugin_path(__FILE__)); if (osc_plugin_is_installed($path)) { // Get the active plugins. $plugins_list = unserialize(osc_active_plugins()); if (!is_array($plugins_list)) { return false; } // Remove $path from the active plugins list foreach ($plugins_list as $k => $v) { if ($v == $path) { unset($plugins_list[$k]); } } // Re-add the $path at the beginning of the active plugins. array_unshift($plugins_list, $path); // Serialize the new active_plugins list. osc_set_preference('active_plugins', serialize($plugins_list)); if (Params::getParam("page") === "plugins" && Params::getParam("action") === "enable" && Params::getParam("plugin") === $path) { //osc_redirect_to(osc_admin_base_url(true) . "?page=plugins"); } else { osc_redirect_to(osc_admin_base_url(true) . "?" . http_build_query(Params::getParamsAsArray("get"))); } } } }
public function actions() { osc_register_plugin(osc_plugin_path(__FILE__), array('DLN_Classified', 'install')); // Add admin menu //$helper_premium = $this->get_helper( 'DLN_Helper_Premium' ); //osc_add_hook('admin_menu_init', array( $helper_premium, 'init_admin_menu' ) ); // Add google map drag n drop $helper_google = $this->get_helper('DLN_Helper_Google'); osc_add_hook('user_form', array($helper_google, 'load_google_map')); osc_add_hook('user_edit_completed', array($helper_google, 'insert_google_map')); // For users premium $helper_premium = $this->get_helper('DLN_Helper_Premium'); osc_add_hook('admin_users_table', array($helper_premium, 'admin_users_table')); osc_add_filter('users_processing_row', array($helper_premium, 'users_processing_row')); osc_add_hook('after_admin_html', array($helper_premium, 'users_html_modal')); }
function map_ru_help() { osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/help.php'); }
Preference::newInstance()->insert($fields); } function google_analytics_call_after_uninstall() { Preference::newInstance()->delete(array("s_section" => "plugin-google_analytics", "s_name" => "google_analytics_id")); } function google_analytics_admin() { osc_admin_render_plugin('google_analytics/admin.php'); } // HELPER function osc_google_analytics_id() { return osc_get_preference('google_analytics_id', 'plugin-google_analytics'); } /** * This function is called every time the page footer is being rendered */ function google_analytics_footer() { if (osc_google_analytics_id() != '') { $id = osc_google_analytics_id(); require osc_plugins_path() . 'google_analytics/footer.php'; } } // This is needed in order to be able to activate the plugin osc_register_plugin(osc_plugin_path(__FILE__), 'google_analytics_call_after_install'); // This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel) osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'google_analytics_call_after_uninstall'); osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'google_analytics_admin'); osc_add_hook('footer', 'google_analytics_footer');
function breadcrumbs_help() { if (osc_version() < 320) { osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/help.php'); } else { osc_redirect_to(osc_route_admin_url('breadcrumbs-admin-help')); } }
function seo_admin_menu() { echo '<h3><a href="#" style="font-weight:bold">All in One SEO</a></h3> <ul> <li><a style="color:blue;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/listings.php') . '"><i class="fa fa-angle-right"></i> ' . __('listings', 'all_in_one') . '</a></li> <li><a style="color:DarkTurquoise;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/categories.php') . '"><i class="fa fa-angle-right"></i> ' . __('categories', 'all_in_one') . '</a></li> <li><a style="color:Dred;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/locations.php') . '"><i class="fa fa-angle-right"></i> ' . __('locations', 'all_in_one') . '</a></li> <li><a style="color:goldenrod;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/pages.php') . '"><i class="fa fa-angle-right"></i> ' . __('static pages', 'all_in_one') . '</a></li> <li><a style="color:#D86B00;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/links.php') . '"><i class="fa fa-angle-right"></i> ' . __('back links', 'all_in_one') . '</a></li> <li><a style="color:purple;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/generate.php') . '"><i class="fa fa-angle-right"></i> ' . __('sitemap', 'all_in_one') . '</a></li> <li><a style="color:green;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/htaccess.php') . '"><i class="fa fa-angle-right"></i> ' . __('htaccess', 'all_in_one') . '</a></li> <li><a style="color:red;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/robots.php') . '"><i class="fa fa-angle-right"></i> ' . __('robots.txt', 'all_in_one') . '</a></li> <li><a style="color:DarkRed;font-weight:bold" href="' . osc_admin_render_plugin_url(osc_plugin_path(dirname(__FILE__)) . '/admin/stats.php') . '"><i class="fa fa-angle-right"></i> ' . __('stats', 'all_in_one') . '</a></li> </ul>'; }
function admanage_config() { osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/admin.php'); }
} global $stored_items; $stored_items = View::newInstance()->_get('item'); //save existing item array View::newInstance()->_exportVariableToView('items', $item_array); } else { echo 'No Results.'; } } function popular_ads_end() { global $stored_items; View::newInstance()->_exportVariableToView('items', $stored_items); //restore original item array } function pop_ad_style() { echo '<link href="' . osc_base_url() . "oc-content/plugins/popular_ads/pop_ads_style.css" . '" rel="stylesheet" type="text/css" />'; } // This is needed in order to be able to activate the plugin osc_register_plugin(osc_plugin_path(__FILE__), 'popular_ads_install'); // This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel) osc_add_hook(osc_plugin_path(__FILE__) . '_uninstall', 'popular_ads_uninstall'); // This is needed in order to be able to activate the plugin osc_register_plugin(osc_plugin_path(__FILE__), ''); // This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel) osc_add_hook(osc_plugin_path(__FILE__) . '_uninstall', ''); // Include our style sheet in the header osc_add_hook('header', 'pop_ad_style'); // Add the Help page to the admin menu osc_add_hook('admin_menu', 'popular_ads_admin_help');
function anr_call_after_install() { osc_set_preference('theme', 'light', 'plugin-anr_nocaptcha'); osc_set_preference('error_message', 'ERROR: Please solve Captcha correctly.', 'plugin-anr_nocaptcha'); } osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'anr_call_after_uninstall'); function anr_call_after_uninstall() { osc_delete_preference('site_key', 'plugin-anr_nocaptcha'); osc_delete_preference('secret_key', 'plugin-anr_nocaptcha'); osc_delete_preference('language', 'plugin-anr_nocaptcha'); osc_delete_preference('theme', 'plugin-anr_nocaptcha'); osc_delete_preference('error_message', 'plugin-anr_nocaptcha'); osc_delete_preference('no_js', 'plugin-anr_nocaptcha'); } osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'anr_render_admin'); function anr_render_admin() { osc_admin_render_plugin(osc_plugin_folder(__FILE__) . 'admin/admin.php'); } // Admin Menu function anr_admin_menu() { echo '<h3><a href="#">' . __('noCaptcha reCaptcha', 'anr') . '</a></h3> <ul> <li><a href="' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/admin.php') . '">' . '» ' . __('Settings', 'anr') . '</a><li> </ul>'; } function anr_admin_menu_new() { osc_add_admin_submenu_divider('plugins', 'noCaptcha reCaptcha', 'anr_divider', 'administrator');
osc_add_route('payment-pro-admin-pay', 'paymentpro/admin/pay/([0-1]+)/(.+)', 'paymentpro/admin/pay/{pay}/{id}', PAYMENT_PRO_PLUGIN_FOLDER . 'admin/pay.php'); osc_add_route('payment-pro-admin-conf', 'paymentpro/admin/conf', 'paymentpro/admin/conf', PAYMENT_PRO_PLUGIN_FOLDER . 'admin/conf.php'); osc_add_route('payment-pro-admin-prices', 'paymentpro/admin/prices', 'paymentpro/admin/prices', PAYMENT_PRO_PLUGIN_FOLDER . 'admin/conf_prices.php'); osc_add_route('payment-pro-admin-log', 'paymentpro/admin/log', 'paymentpro/admin/log', PAYMENT_PRO_PLUGIN_FOLDER . 'admin/log.php'); osc_add_route('payment-pro-checkout', 'paymentpro/checkout', 'paymentpro/checkout', PAYMENT_PRO_PLUGIN_FOLDER . 'user/checkout.php', false, 'custom', 'custom', __('Checkout', 'payment_pro')); osc_add_route('payment-pro-cart-delete', 'paymentpro/cart/delete/(.+)', 'paymentpro/cart/delete/{id}', PAYMENT_PRO_PLUGIN_FOLDER . 'user/cart-delete.php'); osc_add_route('payment-pro-addcart', 'paymentpro/cart/add/(.+)', 'paymentpro/cart/add/{item}', PAYMENT_PRO_PLUGIN_FOLDER . 'user/cart-add.php'); osc_add_route('payment-pro-done', 'paymentpro/done/(.*)', 'paymentpro/done/{tx}', PAYMENT_PRO_PLUGIN_FOLDER . 'user/done.php', false, 'custom', 'custom', __('Checkout', 'payment_pro')); osc_add_route('payment-pro-ajax', 'paymentpro/ajax', 'paymentpro/ajax', PAYMENT_PRO_PLUGIN_FOLDER . 'ajax.php'); osc_add_route('payment-pro-user-menu', 'paymentpro/menu', 'paymentpro/menu', PAYMENT_PRO_PLUGIN_FOLDER . 'user/menu.php', true, 'custom', 'custom', __('Payment status', 'payment_pro')); /** * ADD HOOKS */ osc_register_plugin(osc_plugin_path(__FILE__), 'payment_pro_install'); osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'payment_pro_configure_link'); osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'payment_pro_uninstall'); osc_add_hook('admin_menu_init', 'payment_pro_admin_menu'); osc_add_hook('init', 'payment_pro_admin_title'); osc_add_hook('admin_header', 'payment_pro_admin_page_header'); osc_add_hook('posted_item', 'payment_pro_publish', 8); osc_add_hook('edited_item', 'payment_pro_edited_item', 8); osc_add_hook('user_menu', 'payment_pro_user_menu'); osc_add_hook('cron_hourly', 'payment_pro_cron'); osc_add_hook('item_premium_off', 'payment_pro_premium_off'); osc_add_hook('before_item_edit', 'payment_pro_before_edit'); osc_add_hook('show_item', 'payment_pro_show_item'); osc_add_hook('delete_item', 'payment_pro_item_delete'); osc_add_hook('enable_item', 'payment_pro_enable_item'); osc_add_hook('disable_item', 'payment_pro_disable_item'); osc_add_hook('item_form', 'payment_pro_form'); osc_add_hook('item_edit', 'payment_pro_form');
if (!function_exists('seo_delete_item')) { function seo_delete_item($itemID) { $conn = DBConnectionClass::newInstance(); $c_db = $conn->getOsclassDb(); $comm = new DBCommandClass($c_db); $where = array('fk_i_item_id' => $itemID); $comm->delete(SEO_PLUGIN_ITEM_META_TABLE, $where); } } // when the plugin is installed osc_register_plugin(osc_plugin_path(__FILE__), 'seo_after_install'); // when the plugin is uninstalled osc_add_hook(osc_plugin_path(__FILE__) . '_uninstall', 'seo_after_uninstall'); //configure osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'seo_configure'); //hooks osc_add_hook('init_admin', 'seo_init_admin'); if (osc_is_admin_user_logged_in()) { osc_add_hook('item_form', 'seo_item_form'); osc_add_hook('item_edit', 'seo_item_edit'); osc_add_hook('posted_item', 'seo_posted_item'); osc_add_hook('edited_item', 'seo_edited_item'); } osc_add_hook('delete_item', 'seo_delete_item'); //filters require SEO_PLUGIN_PATH . 'filters.php'; function seo_wiz_menu() { ?> <style>
} else { if (preg_match('/youtube\\.com\\/verify_age\\?next_url=\\/watch%3Fv%3D([^\\&\\?\\/]+)/', $url, $id)) { $values = $id[1]; } else { // not an youtube video } } } } } return $values; } // create the youtube table when the plugin is installed osc_register_plugin(osc_plugin_path(__FILE__), 'youtube_call_after_install'); // drop youtube table when the plugin is uninstalled osc_add_hook(osc_plugin_path(__FILE__) . '_uninstall', 'youtube_call_after_uninstall'); // update osc_add_hook('init', 'youtube_update'); // show field in item post layout osc_add_hook('item_form', 'youtube_form'); // insert youtube string osc_add_hook('posted_item', 'youtube_form_post'); // show video in item detail layout osc_add_hook('item_detail', 'youtube_item_detail'); // show field in item edit layout osc_add_hook('item_edit', 'youtube_item_edit'); // update youtube string after edit POST osc_add_hook('edited_item', 'youtube_item_edit_post'); // delete youtube video of the deleted item osc_add_hook('delete_item', 'youtube_delete_item'); /* file end: ./youtube/index.php */
ModelContactCounter::newInstance()->insertItemStat($item['pk_i_id']); } osc_add_hook('hook_email_item_inquiry', 'contact_counter_increase'); function contact_counter_increase($item) { ModelContactCounter::newInstance()->increaseItemStat($item['id']); } osc_register_plugin(osc_plugin_path(__FILE__), 'contact_counter_install'); function contact_counter_install() { // create table structure ModelContactCounter::newInstance()->import("contact_counter/struct.sql"); // initialize stats ModelContactCounter::newInstance()->init(); } osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'contact_counter_uninstall'); function contact_counter_uninstall() { // remove table structure ModelContactCounter::newInstance()->uninstall(); } // add link to item contact stats page / manage listing, under more actions link function contact_counter_more_actions_link($options_more, $aRow) { // get number of contact by listing $num_contacts = ModelContactCounter::newInstance()->getTotalContactsByItemId($aRow['pk_i_id']); $aux = $options_more; $aux[] = '<a href="' . osc_route_admin_url('stats-contact-counter', array('id' => $aRow['pk_i_id'])) . '">' . sprintf(__('<b>%s</b> contacts +'), $num_contacts) . '</a>'; return $aux; } osc_add_hook('actions_manage_items', 'contact_counter_more_actions_link');
function watchlist_help() { osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/help.php'); }
$('<?php echo dd_nm_id(); ?> ').bind('cut copy paste', function (e) { e.preventDefault(); //$(this).addClass('error'); $(this).attr('placeholder', '<?php _e('Paste is not allowed', 'nm_copypaste_plugin'); ?> '); }); }); </script> <style type="text/css"> .error { border:1px solid #ff0000!important; } </style> <?php } osc_add_route('nm-copypaste-plugin-admin-conf', 'nm_copypaste_plugin', 'nm_copypaste_plugin', osc_plugin_folder(__FILE__) . 'admin/settings.php'); osc_add_hook('footer', 'nm_script'); osc_add_hook('init_admin', 'nm_copypaste_plugin_actions'); // show menu items osc_add_hook('admin_menu_init', 'nm_copypaste_plugin_admin_menu'); // This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel) osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'nm_copypaste_plugin_call_after_uninstall'); osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'nm_copypaste_plugin_admin'); // This is needed in order to be able to activate the plugin osc_register_plugin(osc_plugin_path(__FILE__), 'nm_copypaste_plugin_call_after_install');
} function payment_update_version() { ModelPayment::newInstance()->versionUpdate(); } /** * ADD ROUTES (VERSION 3.2+) */ osc_add_route('payment-admin-conf', 'payment/admin/conf', 'payment/admin/conf', osc_plugin_folder(__FILE__) . 'admin/conf.php'); osc_add_route('payment-admin-prices', 'payment/admin/prices', 'payment/admin/prices', osc_plugin_folder(__FILE__) . 'admin/conf_prices.php'); osc_add_route('payment-publish', 'payment/publish/([0-9]+)', 'payment/publish/{itemId}', osc_plugin_folder(__FILE__) . 'user/payperpublish.php'); osc_add_route('payment-premium', 'payment/premium/([0-9]+)', 'payment/premium/{itemId}', osc_plugin_folder(__FILE__) . 'user/makepremium.php'); osc_add_route('payment-user-menu', 'payment/menu', 'payment/menu', osc_plugin_folder(__FILE__) . 'user/menu.php', true); osc_add_route('payment-user-pack', 'payment/pack', 'payment/pack', osc_plugin_folder(__FILE__) . 'user/pack.php', true); osc_add_route('payment-wallet', 'payment/wallet/([^\\/]+)/([^\\/]+)/([^\\/]+)/(.+)', 'payment/wallet/{a}/{extra}/{desc}/{product}', osc_plugin_folder(__FILE__) . '/user/wallet.php', true); /** * ADD HOOKS */ osc_register_plugin(osc_plugin_path(__FILE__), 'payment_install'); osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'payment_configure_link'); osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'payment_uninstall'); osc_add_hook(osc_plugin_path(__FILE__) . "_enable", 'payment_update_version'); osc_add_hook('admin_menu_init', 'payment_admin_menu'); osc_add_hook('init', 'payment_load_lib'); osc_add_hook('posted_item', 'payment_publish', 10); osc_add_hook('user_menu', 'payment_user_menu'); osc_add_hook('cron_hourly', 'payment_cron'); osc_add_hook('item_premium_off', 'payment_premium_off'); osc_add_hook('before_item_edit', 'payment_before_edit'); osc_add_hook('show_item', 'payment_show_item'); osc_add_hook('delete_item', 'payment_item_delete');
function minify_admin() { osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/admin/index.php'); }
$conn->autocommit(FALSE); try { $conn->osc_dbExec('DROP TABLE %st_news', DB_TABLE_PREFIX); } catch (Exception $e) { $conn->rollback(); echo $e->getMessage(); } $conn->autocommit(TRUE); } /** * Includes stylesheets and javascript files to templates */ function gz_news_add_header() { osc_render_file(GZ_NEWS_PLUGIN_FOLDER . 'views/news_header.php'); } /** * Generate admin menu page to list news */ osc_add_admin_menu_page(__('News', 'gz_news'), GzNewsUtils::getAdminIndexUrl(), 'gz_news'); /** * Register a submenu into admin page, to add news */ osc_add_admin_submenu_page('gz_news', __('Add News', 'gz_news'), GzNewsUtils::getAdminAddUrl(), 'gz_news_add'); osc_add_hook('admin_header', 'gz_news_add_header'); osc_add_hook('header', 'gz_news_add_header'); /** Remove the uninstall hook to do not lose data osc_add_hook(osc_plugin_path(__FILE__) . '_uninstall', 'gz_news_call_after_uninstall'); */ osc_register_plugin(osc_plugin_path(__FILE__), 'gz_news_call_after_install');
Author: Osclass Author URI: http://www.osclass.org/ Short Name: Success page Plugin update URI: item_success */ function item_success_install() { osc_set_preference('item_success_version', '100', 'item_success', 'STRING'); } function item_success_uninstall() { osc_delete_preference('item_success_add_meta_og', 'item_success'); osc_delete_preference('item_success_version', 'item_success'); } osc_register_plugin(osc_plugin_path(__FILE__), 'market_install'); osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'market_uninstall'); function item_success_update_version() { $version = osc_get_preference('item_success_version', 'item_success'); if ($version == '') { $version = 0; } if ($version < 110) { osc_set_preference('item_success_add_meta_og', 'true', 'item_success', 'BOOLEAN'); osc_set_preference('item_success_version', '110', 'item_success', 'STRING'); osc_reset_preferences(); } } osc_add_hook('init', 'market_update_version'); if (OC_ADMIN) { function item_success_admin_menu()
} } function moreedit_admin_menu() { echo '<h3><a href="#">More Edit Options</a></h3> <ul> <li><a href="' . osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'admin/conf.php') . '">» ' . __('More Options', 'moreedit') . '</a></li> </ul>'; } function moreedit_init_admin_menu() { osc_add_admin_submenu_divider('plugins', 'More edit plugin', 'moreedit_divider', 'administrator'); osc_add_admin_submenu_page('plugins', __('More edit options', 'moreedit'), osc_route_admin_url('moreedit-conf'), 'moreedit_settings', 'administrator'); } /** * ADD HOOKS */ osc_register_plugin(osc_plugin_path(__FILE__), 'moreedit_install'); osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'moreedit_uninstall'); if (osc_version() < 320) { osc_add_hook('admin_menu', 'moreedit_admin_menu'); } else { osc_add_route('moreedit-conf', 'moreedit/conf', 'moreedit/conf', osc_plugin_folder(__FILE__) . 'admin/conf.php'); osc_add_hook('admin_menu_init', 'moreedit_init_admin_menu'); } osc_add_hook('posted_item', 'moreedit_moderate_all'); osc_add_hook('edited_item', 'moreedit_moderate_edit'); osc_add_hook('posted_item', 'moreedit_posted_item'); osc_add_hook('edited_item', 'moreedit_edited_item'); osc_add_hook('post_item', 'moreedit_item_add'); osc_add_hook('init', 'moreedit_item_edit');
function osclass_pm_config() { osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/admin.php'); }
function fbc_conf() { osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/admin/conf.php'); }
//end comment_picture_show() function current_user_picture() { // Configuration - Your Options /////////////////////////////////////////////////////// $width = '100'; $height = ''; // height is optional. If you use a height, *MAKE SURE* it's proportional to the WIDTH ////// ***** No modifications below here should be needed ***** ///////////////////// // First, check to see if user has existing profile picture... $user_id = osc_logged_user_id(); // the user id of the user profile we're at $conn = getConnection(); $result = $conn->osc_dbFetchResult("SELECT user_id, pic_ext FROM %st_profile_picture WHERE user_id = {$user_id} ", DB_TABLE_PREFIX, $user_id); if ($result > 0) { $upload_path = osc_plugins_path() . 'profile_picture/images/'; $modtime = filemtime($upload_path . 'profile' . $user_id . $result['pic_ext']); //ensures browser cache is refreshed if newer version of picture exists // This is the picture HTML code displayed on page echo '<img src="' . osc_base_url() . 'oc-content/plugins/profile_picture/images/profile' . $user_id . $result['pic_ext'] . '?' . $modtime . '">'; // width="'.$width.'" height="'.$height.'"display picture } else { echo '<img src="' . osc_base_url() . 'oc-content/plugins/profile_picture/no_picture.jpg">'; //width="'.$width.'" height="'.$height.'" } } //end comment_picture_post() // This is needed in order to be able to activate the plugin osc_register_plugin(osc_plugin_path(__FILE__), 'profile_picture_install'); // This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel) osc_add_hook(osc_plugin_path(__FILE__) . '_uninstall', 'profile_picture_uninstall');
}); </script> <?php } function cookie_menu() { osc_admin_menu_plugins('Cookies settings', osc_route_admin_url('cookie-conf'), 'cookie-conf'); } function cookie_install() { osc_set_preference('analytics_msg', 'We use cookies, just to track visits to our website, we store no personal details.', 'cookie', 'STRING'); osc_set_preference('non_analytics_msg', 'We use cookies on this website, you can <a href="{{cookiePolicyLink}}" title="read about our cookies">read about them here</a>. To use the website as intended please...', 'cookie', 'STRING'); osc_set_preference('analytics_id', '', 'cookie', 'STRING'); osc_set_preference('policy_link', osc_base_url(), 'cookie', 'STRING'); osc_set_preference('what_are_link', 'http://www.allaboutcookies.org/', 'cookie', 'STRING'); osc_set_preference('domain', '', 'cookie', 'STRING'); osc_set_preference('accept', 1, 'cookie', 'BOOLEAN'); osc_set_preference('decline', 1, 'cookie', 'BOOLEAN'); osc_set_preference('reset', 0, 'cookie', 'BOOLEAN'); } function cookie_uninstall() { Preference::newInstance()->delete(array('s_section' => 'cookie')); } osc_add_route('cookie-conf', 'cookie/conf', 'cookie/conf', osc_plugin_folder(__FILE__) . 'admin/conf.php'); osc_register_plugin(osc_plugin_path(__FILE__), 'cookie_install'); osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'cookie_uninstall'); if (OC_ADMIN != 1) { osc_add_hook('header', 'cookie_load', 10); } osc_add_hook('admin_menu_init', 'cookie_menu');
osc_add_admin_submenu_page('plugins', __('Settings', 'fb_page_plugin'), osc_route_admin_url('fb-page-plugin-admin-conf'), 'fb_page_plugin_settings', 'administrator'); //osc_add_admin_submenu_page('plugins', __('Help', 'fb_page_plugin'), osc_route_admin_url('fb-page-plugin-admin-help'), 'fb_page_plugin_help', 'administrator'); } /** * This function is called every time the page header is being rendered */ function fb_page_plugin() { if (dd_fb_page_url() != '') { $fb_page_url = dd_fb_page_url(); $fb_page_width = dd_fb_page_width(); $fb_page_height = dd_fb_page_height(); $fb_show_faces = dd_fb_show_faces(); $hide_page_cover = dd_hide_page_cover(); $show_page_posts = dd_show_page_posts(); $use_small_header = dd_use_small_header(); $adapt_container_width = dd_adapt_container_width(); require_once osc_plugins_path() . 'fb_page_plugin/code.php'; } } osc_add_route('fb-page-plugin-admin-conf', 'fb_page_plugin', 'fb_page_plugin', osc_plugin_folder(__FILE__) . 'admin.php'); osc_add_route('fb-page-plugin-admin-help', 'fb_page_plugin', 'fb_page_plugin', osc_plugin_folder(__FILE__) . 'help.php'); osc_add_hook('init_admin', 'fb_page_plugin_actions'); // show menu items osc_add_hook('admin_menu_init', 'fb_page_plugin_admin_menu'); // This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel) osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'fb_page_plugin_call_after_uninstall'); osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'fb_page_plugin_admin'); // This is needed in order to be able to activate the plugin osc_register_plugin(osc_plugin_path(__FILE__), 'fb_page_plugin_call_after_install');
} osc_set_preference('activated_users', (int) osc_get_preference('activated_users', 'butler') + $numSuccess, 'butler', 'INTEGER'); } osc_add_route('butler-admin-conf', 'butler/admin/conf', 'butler/admin/conf', osc_plugin_folder(__FILE__) . 'views/admin/conf.php'); osc_add_route('butler-admin-stats', 'butler/admin/stats', 'butler/admin/stats', osc_plugin_folder(__FILE__) . 'views/admin/stats.php'); osc_add_hook('admin_header', 'butler_init_pageHeader'); function butler_init_pageHeader() { $_r = Params::getParam('route'); switch ($_r) { case 'butler-admin-conf': case 'butler-admin-stats': osc_remove_hook('admin_page_header', 'customPageHeader'); osc_add_hook('admin_page_header', 'butler_PageHeader'); break; default: break; } } function butler_PageHeader() { ?> <h1><?php _e('Butler plugin', 'butler'); ?> </h1> <?php } osc_register_plugin(osc_plugin_path(__FILE__), 'butler_install'); osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'butler_uninstall');
function digitalgoods_configure_link() { osc_plugin_configure_view(osc_plugin_path(__FILE__)); }
function voting_admin_configuration() { // Standard configuration page for plugin which extend item's attributes osc_plugin_configure_view(osc_plugin_path(__FILE__)); }
//HELPER function osc_yandex_map_key() { return osc_get_preference('yandex_maps_key', 'plugin-yandex_maps'); } //admin page function yandex_map_admin() { osc_admin_render_plugin('yandex_maps/admin.php'); } function insert_geo_location($aItem) { $sAddress = isset($aItem['s_address']) ? $aItem['s_address'] : ''; $sRegion = isset($aItem['s_region']) ? $aItem['s_region'] : ''; $sCity = isset($aItem['s_city']) ? $aItem['s_city'] : ''; $address = sprintf('%s, %s %s', $sAddress, $sRegion, $sCity); $response = osc_file_get_contents(sprintf('http://maps.google.com/maps/geo?q=%s&output=json&sensor=false', urlencode($address))); $jsonResponse = json_decode($response); if (isset($jsonResponse->Placemark) && count($jsonResponse->Placemark[0]) > 0) { $coord = $jsonResponse->Placemark[0]->Point->coordinates; ItemLocation::newInstance()->update(array('d_coord_lat' => $coord[1], 'd_coord_long' => $coord[0]), array('fk_i_item_id' => $aItem['pk_i_id'])); } } // This is needed in order to be able to activate the plugin osc_register_plugin(osc_plugin_path(__FILE__), 'yandex_map_call_after_install'); // This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel) osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'yanex_map_call_after_uninstall'); osc_add_hook('location', 'yandex_maps_location'); osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'yandex_map_admin'); osc_add_hook('posted_item', 'insert_geo_location'); osc_add_hook('edited_item', 'insert_geo_location');