本文整理汇总了PHP中osc_register_plugin函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_register_plugin函数的具体用法?PHP osc_register_plugin怎么用?PHP osc_register_plugin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_register_plugin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actions
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'));
}
示例2: digitalgoods_delete_item
}
function digitalgoods_delete_item($item)
{
DGModel::newInstance()->removeItem($item);
}
if (osc_version() >= 320) {
/**
* ADD ROUTES (VERSION 3.2+)
*/
osc_add_route('digitalgoods-admin-conf', 'digitalgoods/admin/conf', 'digitalgoods/admin/conf', osc_plugin_folder(__FILE__) . 'admin/conf.php');
osc_add_route('digitalgoods-admin-stats', 'digitalgoods/admin/stats', 'digitalgoods/admin/stats', osc_plugin_folder(__FILE__) . 'admin/stats.php');
osc_add_route('digitalgoods-ajax', 'digitalgoods/ajax', 'digitalgoods/ajax', osc_plugin_folder(__FILE__) . 'ajax.php');
osc_add_route('digitalgoods-download', 'digitalgoods/download/(.+)', 'digitalgoods/download/{file}', osc_plugin_folder(__FILE__) . 'download.php');
}
/**
* ADD HOOKS
*/
osc_register_plugin(osc_plugin_path(__FILE__), 'digitalgoods_install');
osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'digitalgoods_uninstall');
osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'digitalgoods_configure_link');
osc_add_hook('item_detail', 'digitalgoods_item_detail');
osc_add_hook('item_form', 'digitalgoods_form');
osc_add_hook('item_edit', 'digitalgoods_item_edit');
osc_add_hook('edited_item', 'digitalgoods_upload_files');
osc_add_hook('posted_item', 'digitalgoods_upload_files');
osc_add_hook('delete_item', 'digitalgoods_delete_item');
if (osc_version() < 320) {
osc_add_hook('admin_menu', 'digitalgoods_admin_menu');
} else {
osc_add_hook('admin_menu_init', 'digitalgoods_admin_menu');
}
示例3: cover_photo_user_menu
if ($en < $total) {
$en2 = $start + $len;
print "<a href='{$link}&start={$en2}' class='link2'> Next </a>";
} else {
print "<span class='bodytext'> Next </span>";
}
print "</td></tr></table>";
}
function cover_photo_user_menu()
{
echo '<li class="" ><a href="' . osc_render_file_url(osc_plugin_folder(__FILE__) . 'uploads.php') . '" >' . __('Cover Photo Uploader', 'cover_photo') . '</a></li>';
}
function cover_photo_total_count($flg)
{
$con = getConnection();
$qry = 'SELECT count(*) AS total FROM ' . DB_TABLE_PREFIX . 't_cover_photo ';
if ($flg != '') {
$qry .= ' WHERE status="' . $flg . '"';
}
$result = $con->osc_dbFetchResult($qry);
return $result['total'];
}
// This is needed in order to be able to activate the plugin
osc_register_plugin(osc_plugin_path(__FILE__), 'cover_photo_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', 'cover_photo_uninstall');
//configuring admin menu
osc_add_hook('admin_menu', 'cover_photo_admin_menu');
//configuring user menu
// Add link in user menu page
osc_add_hook('user_menu', 'cover_photo_user_menu');
示例4: google_analytics_call_after_uninstall
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');
示例5: osc_add_admin_submenu_page
</ul>';
} else {
osc_add_admin_submenu_page('plugins', __('Breadcrumbs F.A.Q. / Help', 'breadcrumbs'), osc_route_admin_url('breadcrumbs-admin-help'), 'breadcrumbs_help', 'administrator');
}
}
if (osc_version() >= 320) {
/**
* ADD ROUTES (VERSION 3.2+)
*/
osc_add_route('breadcrumbs-admin-help', 'breadcrumbs/admin/help', 'breadcrumbs/admin/help', osc_plugin_folder(__FILE__) . 'help.php');
}
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'));
}
}
// 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 Configure link at plugins table (you could also use some other hook to show a custom option panel)
osc_add_hook(osc_plugin_path(__FILE__) . '_configure', 'breadcrumbs_help');
// 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', '');
// Add the help to the menu
if (osc_version() < 320) {
osc_add_hook('admin_menu', 'breadcrumbs_admin_menu');
} else {
osc_add_hook('admin_menu_init', 'breadcrumbs_admin_menu');
}
示例6: osc_get_preference
}
$text .= osc_get_preference('allSeo_keywords', 'plugin-all_in_one');
}
return $text;
}
function allSeoTitle($title)
{
$file = explode('/', Params::getParam('file'));
if ($file[0] == 'all_in_one') {
$title = '<i class="fa fa-line-chart"></i> All in One SEO Plugin';
}
return $title;
}
osc_add_filter('custom_plugin_title', 'allSeoTitle');
// This is needed in order to be able to activate the plugin
osc_register_plugin(osc_plugin_path(__FILE__), 'allSeo_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', 'allSeo_call_after_uninstall');
// This will add own meta
osc_add_filter('meta_title_filter', 'allSeo_title_filter');
osc_add_filter('meta_description_filter', 'allSeo_description_filter');
// This will add own keywords
osc_add_filter('meta_keywords_filter', 'allSeo_keywords_filter');
// Display help
function allSeo_conf()
{
osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/admin/listings.php');
}
// This is a hack to show a Configure link at plugins table (you could also use some other hook to show a custom option panel)
osc_add_hook(osc_plugin_path(__FILE__) . '_configure', 'allSeo_conf');
// Add font awesome style to header
示例7: moreedit_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');
示例8: catch
$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');
示例9: seo_delete_item
$comm->insert(SEO_PLUGIN_ITEM_META_TABLE, $values);
}
}
}
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';
示例10: osc_register_plugin
if (preg_match('/youtu\\.be\\/([^\\&\\?\\/]+)/', $url, $id)) {
$values = $id[1];
} 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
示例11: osc_add_hook
osc_add_hook('before_delete_item', 'contact_counter_delete');
function contact_counter_delete($item)
{
ModelContactCounter::newInstance()->deleteItemStat($item);
}
osc_add_hook('posted_item', 'contact_counter_insert');
function contact_counter_insert($item)
{
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)
示例12: osc_ajax_plugin_url
echo '<script type="text/javascript">';
echo 'var watchlist_url = "' . osc_ajax_plugin_url('watchlist/ajax_watchlist.php') . '";';
echo '</script>';
echo '<!-- Watchlist js end -->';
}
function watchlist_delete_item($item)
{
$conn = getConnection();
$conn->osc_dbExec("DELETE FROM %st_item_watchlist WHERE fk_i_item_id = '{$item}'", DB_TABLE_PREFIX);
}
function watchlist_help()
{
osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/help.php');
}
// This is needed in order to be able to activate the plugin
osc_register_plugin(osc_plugin_path(__FILE__), 'watchlist_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', 'watchlist_call_after_uninstall');
// This is a hack to show a Configure link at plugins table (you could also use some other hook to show a custom option panel)
osc_add_hook(osc_plugin_path(__FILE__) . '_configure', 'watchlist_help');
// Add link in user menu page
osc_add_hook('user_menu', 'watchlist_user_menu');
// add javascript
if (osc_version() < 311) {
osc_add_hook('footer', 'watchlist_footer');
} else {
osc_add_hook('scripts_loaded', 'watchlist_scripts_loaded');
osc_register_script('watchlist', osc_plugin_url('watchlist/js/watchlist.js') . 'watchlist.js', array('jquery'));
osc_enqueue_script('watchlist');
}
//Delete item
示例13: osc_yandex_map_key
//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');
示例14: osc_register_plugin
position: relative;
text-decoration: none !important;
}
a.MCtooltip:hover {
z-index:999;
}
a.MCtooltip span {
display: none;
}
a.MCtooltip:hover span {
display: block;
position: absolute;
top:1em; left:1em;
width:100%;
padding:5px;
background-color: #ffffff;
}
</style>
<?php
}
/**
* ADD HOOKS
*/
osc_register_plugin(osc_plugin_path(__FILE__), 'multicurrency_install');
osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'multicurrency_uninstall');
osc_add_hook('cron_hourly', 'multicurrency_get_data');
osc_add_hook('header', 'multicurrency_header');
osc_add_filter('item_price', 'multicurrency_add_prices');
示例15: dd_nm_id
$('<?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');