本文整理汇总了PHP中osc_register_plugin函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_register_plugin函数的具体用法?PHP osc_register_plugin怎么用?PHP osc_register_plugin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_register_plugin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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'));
}
开发者ID:httvncoder,项目名称:151722441,代码行数:16,代码来源:index.php
示例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');
}
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:31,代码来源:index.php
示例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');
开发者ID:uwwclass,项目名称:cover_photo,代码行数:31,代码来源:index.php
示例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');
开发者ID:acharei,项目名称:OSClass,代码行数:31,代码来源:index.php
示例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');
}
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:index.php
示例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
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:31,代码来源:index.php
示例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');
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:31,代码来源:index.php
示例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');
开发者ID:faosclass,项目名称:gz_news,代码行数:30,代码来源:index.php
示例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';
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:31,代码来源:index.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
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:31,代码来源:index.php
示例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)
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:31,代码来源:index.php
示例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
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:index.php
示例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');
开发者ID:bomvendador,项目名称:soroka_r,代码行数:31,代码来源:index.php
示例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');
开发者ID:bomvendador,项目名称:soroka_r,代码行数:31,代码来源:index.php
示例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');
开发者ID:krahamath,项目名称:nm_copypaste_plugin,代码行数:30,代码来源:index.php
示例16: payment_update_version
}
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');
开发者ID:virsoni,项目名称:plugin-payment,代码行数:31,代码来源:index.php
示例17: md5
{
include "lib/qrlib.php";
if ($id != '') {
$filename = $id . "_" . md5($data) . "_" . osc_get_preference("code_size", "qrcode") . ".png";
} else {
$filename = md5($data) . "_" . osc_get_preference("code_size", "qrcode") . ".png";
}
$filename = osc_get_preference('upload_path', 'qrcode') . $filename;
QRcode::png($data, $filename, 'M', osc_get_preference("code_size", "qrcode"), 2);
}
function show_qrcode()
{
$filename = osc_item_id() . "_" . md5(osc_item_url()) . "_" . osc_get_preference("code_size", "qrcode") . ".png";
if (!file_exists(osc_get_preference('upload_path', 'qrcode') . $filename)) {
qrcode_generateqr(osc_item_url(), osc_item_id());
}
echo '<img src="' . osc_get_preference('upload_url', 'qrcode') . $filename . '" alt="QR CODE" id="qrcode_' . osc_item_id() . '" class="qrcode" />';
}
/**
* ADD HOOKS
*/
osc_register_plugin(osc_plugin_path(__FILE__), 'qrcode_install');
osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'qrcode_uninstall');
// DELETE ITEM
osc_add_hook('delete_item', 'qrcode_delete_item');
// FANCY MENU
if (osc_version() < 320) {
osc_add_hook('admin_menu', 'qrcode_admin_menu');
} else {
osc_add_hook('admin_menu_init', 'qrcode_admin_menu');
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:31,代码来源:index.php
示例18: alert
}
else {
$("#freeTimes").attr('disabled','disabled');
}
});
$("#deleteDays").change(function(){
alert('<?php
_e("All ads that have been expired for ' + \$(this).val() + ' days will be deleted immediately!", "adManage");
?>
');
});
});
</script>
<?php
}
// This is needed in order to be able to activate the plugin
osc_register_plugin(osc_plugin_path(__FILE__), 'adManage_install');
osc_add_hook(__FILE__ . "_configure", 'adManage_config');
// 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', 'adManage_uninstall');
// Add the help to the menu
osc_add_hook('admin_menu', 'item_adManage_admin_menu');
// Add cron
osc_add_hook('cron_daily', 'item_adManage_cron');
// run after item is posted
osc_add_hook('item_form_post', 'item_adManage_posted');
// run hook when item is deleted
osc_add_hook('delete_item', 'item_adManage_delete');
// add javascript to the footer
osc_add_hook('admin_footer', 'adManage_footer');
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:index.php
示例19: item_success_install
Version: 1.1.0
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) {
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:index.php
示例20: osclass_pm_admin_header
}
function osclass_pm_admin_header()
{
// The following code converts a link that I added to the settings menu to a divider header
?>
<script type="text/javascript">
$(document).ready(function() {
$('#osclass_pm-settingsHead').parent('li').addClass('submenu-divide');
$('#osclass_pm-settingsHead').removeAttr("href");
$('#osclass_pm-settingsHead').contents().unwrap();
});
</script>
<?php
}
// This is needed in order to be able to activate the plugin
osc_register_plugin(osc_plugin_path(__FILE__), 'osclass_pm_install');
osc_add_hook(__FILE__ . "_configure", 'osclass_pm_config');
// 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', 'osclass_pm_uninstall');
osc_add_hook('header', 'osclass_pm_header');
if (osclass_is_inbox_page() || osclass_is_outbox_page() || osclass_is_messages_page() || osclass_is_reply_page()) {
osc_add_hook('admin_footer', 'osclass_pm_admin_footer');
}
osc_add_hook('user_menu', 'osclass_pm_user_menu', 1);
if (osc_version() < 300) {
osc_add_hook('admin_menu', 'osclass_pm_admin_menu', 1);
}
osc_add_hook('before_html', 'osclass_pm_before_html');
if ($cron != 0) {
osc_add_hook('cron_' . $cron, 'osclass_pm_cron');
}
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:index.php
注:本文中的osc_register_plugin函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论