本文整理汇总了PHP中add_config_option函数的典型用法代码示例。如果您正苦于以下问题:PHP add_config_option函数的具体用法?PHP add_config_option怎么用?PHP add_config_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_config_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
require_lang('reportcontent');
$GLOBALS['SITE_DB']->create_table('reported_content', array('r_session_id' => '*AUTO_LINK', 'r_content_type' => '*ID_TEXT', 'r_content_id' => '*ID_TEXT', 'r_counts' => 'BINARY'));
$GLOBALS['SITE_DB']->create_index('reported_content', 'reported_already', array('r_content_type', 'r_content_id'));
add_config_option('REPORTED_TIMES', 'reported_times', 'integer', 'return \'3\';', 'FEATURE', 'REPORT_CONTENT');
}
示例2: action
/**
* Standard interface stage of pointstore item purchase.
*
* @return tempcode The UI
*/
function action()
{
require_code('database_action');
$class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));
//if (get_option('is_on_'.$class.'_buy')=='0') return new ocp_tempcode();
$tablename_exists = $GLOBALS['SITE_DB']->table_exists('bank');
if (!$tablename_exists) {
$GLOBALS['SITE_DB']->create_table('bank', array('id' => '*AUTO', 'user_id' => 'INTEGER', 'amount' => 'INTEGER', 'divident' => 'INTEGER', 'add_time' => '?TIME'));
}
$_bank_dividend = get_option('bank_divident', true);
if (is_null($_bank_dividend)) {
//add option and default value
add_config_option('BANK_DIVIDEND', 'bank_divident', 'integer', 'return \'40\';', 'POINTSTORE', 'BANKING');
// TODO: Fix spelling
// IDEA: Make 30 days a config option too, or even have multiple products?
// IDEA: Send email saying bank returned money?
// IDEA: Have the bank do marketing to people? http://ocportal.com/forum/topicview/misc/addons/ocbank_4.htm?redirected=1#post_87711
$bank_dividend = 4;
} else {
$bank_dividend = intval($_bank_dividend);
}
$title = get_page_title('BANKING');
$points_left = available_points(get_member());
$next_url = build_url(array('page' => '_SELF', 'type' => 'action_done', 'id' => $class), '_SELF');
// Check points
if ($points_left < 0 && !has_specific_permission(get_member(), 'give_points_self')) {
return warn_screen($title, do_lang_tempcode('_CANT_AFFORD_BANK'));
}
require_code('form_templates');
$fields = new ocp_tempcode();
$fields->attach(form_input_integer(do_lang_tempcode('AMOUNT'), do_lang_tempcode('DESCRIPTION_BANK_AMOUNT', integer_format($points_left)), 'amount', $points_left, true));
$text = do_lang_tempcode('BANK_A', integer_format($points_left));
return do_template('FORM_SCREEN', array('_GUID' => 'ae703225db618f2bc938290fbae4d6d8', 'TITLE' => $title, 'TEXT' => $text, 'URL' => $next_url, 'FIELDS' => $fields, 'HIDDEN' => '', 'SUBMIT_NAME' => do_lang_tempcode('PROCEED')));
}
示例3: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
if (is_null($upgrade_from) || $upgrade_from < 3) {
add_config_option('SHOW_NEWEST_MEMBER', 'usersonline_show_newest_member', 'tick', 'return ((has_no_forum()) || (get_forum_type()!=\'ocf\'))?NULL:\'0\';', 'BLOCKS', 'USERS_ONLINE_BLOCK');
add_config_option('BIRTHDAYS', 'usersonline_show_birthdays', 'tick', 'return ((has_no_forum()) || (get_forum_type()!=\'ocf\'))?NULL:\'0\';', 'BLOCKS', 'USERS_ONLINE_BLOCK');
}
}
示例4: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
if (is_null($upgrade_from)) {
$GLOBALS['SITE_DB']->create_table('leader_board', array('lb_member' => '*USER', 'lb_points' => 'INTEGER', 'date_and_time' => '*TIME'));
}
if (is_null($upgrade_from) || $upgrade_from < 3) {
add_config_option('LEADERBOARD_START_DATE', 'leaderboard_start_date', 'date', 'return strval(filemtime(get_file_base().\'/index.php\'));', 'POINTS', 'POINT_LEADERBOARD');
}
}
示例5: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
if ($upgrade_from == 2) {
set_option('supermembers_text', '[html]' . get_option('supermembers_text') . '[/html]');
return;
}
add_config_option('PAGE_TEXT', 'supermembers_text', 'transtext', 'return do_lang(\'SUPERMEMBERS_TEXT\');', 'SECURITY', 'SUPER_MEMBERS');
require_lang('supermembers');
add_menu_item_simple('collab_website', NULL, 'SUPER_MEMBERS', '_SEARCH:supermembers');
}
示例6: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
$GLOBALS['SITE_DB']->create_table('test_sections', array('id' => '*AUTO', 's_section' => 'SHORT_TEXT', 's_notes' => 'LONG_TEXT', 's_inheritable' => 'BINARY', 's_assigned_to' => '?USER'));
$GLOBALS['SITE_DB']->create_table('tests', array('id' => '*AUTO', 't_section' => 'AUTO_LINK', 't_test' => 'LONG_TEXT', 't_assigned_to' => '?USER', 't_enabled' => 'BINARY', 't_status' => 'INTEGER', 't_inherit_section' => '?AUTO_LINK'));
add_specific_permission('TESTER', 'perform_tests', false);
add_specific_permission('TESTER', 'add_tests', true);
add_specific_permission('TESTER', 'edit_own_tests', true);
add_config_option('TESTER_FORUM_NAME', 'tester_forum_name', 'forum', 'return do_lang(\'DEFAULT_TESTER_FORUM\');', 'FEATURE', 'TESTER');
add_config_option('BUG_REPORT_TEXT', 'bug_report_text', 'text', 'return do_lang(\'DEFAULT_BUG_REPORT_TEMPLATE\');', 'FEATURE', 'TESTER');
}
示例7: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
if (is_null($upgrade_from)) {
add_config_option('BLOCK_CACHE', 'is_on_block_cache', 'tick', 'return $GLOBALS[\'SEMI_DEBUG_MODE\']?\'0\':\'1\';', 'SITE', 'CACHES', 1);
add_config_option('TEMPLATE_CACHE', 'is_on_template_cache', 'tick', 'return \'1\';', 'SITE', 'CACHES', 1);
add_config_option('COMCODE_PAGE_CACHE', 'is_on_comcode_page_cache', 'tick', 'return \'1\';', 'SITE', 'CACHES', 1);
}
if (is_null($upgrade_from) || $upgrade_from < 3) {
add_config_option('LANGUAGE_CACHE', 'is_on_lang_cache', 'tick', 'return \'1\';', 'SITE', 'CACHES', 1);
}
}
示例8: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
if (is_null($upgrade_from)) {
$GLOBALS['SITE_DB']->create_table('poll', array('id' => '*AUTO', 'question' => 'SHORT_TRANS', 'option1' => 'SHORT_TRANS', 'option2' => 'SHORT_TRANS', 'option3' => '?SHORT_TRANS', 'option4' => '?SHORT_TRANS', 'option5' => '?SHORT_TRANS', 'option6' => '?SHORT_TRANS', 'option7' => '?SHORT_TRANS', 'option8' => '?SHORT_TRANS', 'option9' => '?SHORT_TRANS', 'option10' => '?SHORT_TRANS', 'votes1' => 'INTEGER', 'votes2' => 'INTEGER', 'votes3' => 'INTEGER', 'votes4' => 'INTEGER', 'votes5' => 'INTEGER', 'votes6' => 'INTEGER', 'votes7' => 'INTEGER', 'votes8' => 'INTEGER', 'votes9' => 'INTEGER', 'votes10' => 'INTEGER', 'allow_rating' => 'BINARY', 'allow_comments' => 'SHORT_INTEGER', 'allow_trackbacks' => 'BINARY', 'notes' => 'LONG_TEXT', 'num_options' => 'SHORT_INTEGER', 'is_current' => 'BINARY', 'date_and_time' => '?TIME', 'submitter' => 'USER', 'add_time' => 'INTEGER', 'poll_views' => 'INTEGER', 'edit_date' => '?TIME'));
$GLOBALS['SITE_DB']->create_index('poll', 'poll_views', array('poll_views'));
$GLOBALS['SITE_DB']->create_index('poll', 'get_current', array('is_current'));
$GLOBALS['SITE_DB']->create_index('poll', 'ps', array('submitter'));
$GLOBALS['SITE_DB']->create_index('poll', 'padd_time', array('add_time'));
$GLOBALS['SITE_DB']->create_index('poll', 'date_and_time', array('date_and_time'));
add_specific_permission('POLLS', 'choose_poll', false);
add_config_option('ADD_POLL', 'points_ADD_POLL', 'integer', 'return addon_installed(\'points\')?\'150\':NULL;', 'POINTS', 'COUNT_POINTS_GIVEN');
add_config_option('CHOOSE_POLL', 'points_CHOOSE_POLL', 'integer', 'return addon_installed(\'points\')?\'35\':NULL;', 'POINTS', 'COUNT_POINTS_GIVEN');
add_config_option('POLL_REGULARITY', 'poll_update_time', 'integer', 'return \'168\';', 'ADMIN', 'CHECK_LIST');
$GLOBALS['SITE_DB']->create_index('poll', 'ftjoin_pq', array('question'));
$GLOBALS['SITE_DB']->create_index('poll', 'ftjoin_po1', array('option1'));
$GLOBALS['SITE_DB']->create_index('poll', 'ftjoin_po2', array('option2'));
$GLOBALS['SITE_DB']->create_index('poll', 'ftjoin_po3', array('option3'));
$GLOBALS['SITE_DB']->create_index('poll', 'ftjoin_po4', array('option4'));
$GLOBALS['SITE_DB']->create_index('poll', 'ftjoin_po5', array('option5'));
}
if (!is_null($upgrade_from) && $upgrade_from < 3) {
$GLOBALS['SITE_DB']->add_table_field('poll', 'allow_trackbacks', 'BINARY', 1);
}
if (!is_null($upgrade_from) && $upgrade_from < 4) {
$GLOBALS['SITE_DB']->add_table_field('poll', 'option6', 'SHORT_TRANS');
$GLOBALS['SITE_DB']->add_table_field('poll', 'option7', 'SHORT_TRANS');
$GLOBALS['SITE_DB']->add_table_field('poll', 'option8', 'SHORT_TRANS');
$GLOBALS['SITE_DB']->add_table_field('poll', 'option9', 'SHORT_TRANS');
$GLOBALS['SITE_DB']->add_table_field('poll', 'option10', 'SHORT_TRANS');
$GLOBALS['SITE_DB']->add_table_field('poll', 'votes6', 'INTEGER', 0);
$GLOBALS['SITE_DB']->add_table_field('poll', 'votes7', 'INTEGER', 0);
$GLOBALS['SITE_DB']->add_table_field('poll', 'votes8', 'INTEGER', 0);
$GLOBALS['SITE_DB']->add_table_field('poll', 'votes9', 'INTEGER', 0);
$GLOBALS['SITE_DB']->add_table_field('poll', 'votes10', 'INTEGER', 0);
}
if (is_null($upgrade_from) || $upgrade_from < 5) {
$GLOBALS['SITE_DB']->create_table('poll_votes', array('id' => '*AUTO', 'v_poll_id' => 'AUTO_LINK', 'v_voter_id' => '?USER', 'v_voter_ip' => 'IP', 'v_vote_for' => '?SHORT_INTEGER'));
$GLOBALS['SITE_DB']->create_index('poll_votes', 'v_voter_id', array('v_voter_id'));
$GLOBALS['SITE_DB']->create_index('poll_votes', 'v_voter_ip', array('v_voter_ip'));
$GLOBALS['SITE_DB']->create_index('poll_votes', 'v_vote_for', array('v_vote_for'));
}
if (!is_null($upgrade_from) && $upgrade_from < 5) {
$polls = $GLOBALS['SITE_DB']->query_select('poll', array('id', 'ip'));
foreach ($polls as $poll) {
$voters = explode('-', $poll['ip']);
foreach ($voters as $voter) {
$GLOBALS['SITE_DB']->query_insert('poll_votes', array('v_poll_id' => $poll['id'], 'v_voter_id' => is_numeric($voter) ? intval($voter) : NULL, 'v_voter_ip' => is_numeric($voter) ? '' : $voter, 'v_vote_for' => NULL));
}
}
$GLOBALS['SITE_DB']->delete_table_field('poll', 'ip');
}
}
示例9: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
if (is_null($upgrade_from)) {
$GLOBALS['SITE_DB']->create_table('text', array('id' => '*AUTO', 'user_id' => 'USER', 'the_message' => 'SHORT_TRANS', 'days' => 'INTEGER', 'order_time' => 'TIME', 'activation_time' => '?TIME', 'active_now' => 'BINARY', 'notes' => 'LONG_TEXT'));
$GLOBALS['SITE_DB']->create_index('text', 'findflagrant', array('active_now'));
add_config_option('SYSTEM_FLAGRANT', 'system_flagrant', 'transline', 'return \'\';', 'SITE', 'GENERAL');
} else {
if ($upgrade_from < 3) {
delete_config_option('system_flagrant');
add_config_option('SYSTEM_FLAGRANT', 'system_flagrant', 'transline', 'return \'\';', 'SITE', 'GENERAL');
}
}
}
示例10: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
$GLOBALS['SITE_DB']->create_table('bookable', array('id' => '*AUTO', 'title' => 'SHORT_TRANS', 'description' => 'LONG_TRANS', 'price' => 'REAL', 'categorisation' => 'SHORT_TRANS', 'cycle_type' => 'ID_TEXT', 'cycle_pattern' => 'SHORT_TEXT', 'user_may_choose_code' => 'BINARY', 'supports_notes' => 'BINARY', 'dates_are_ranges' => 'BINARY', 'calendar_type' => '?AUTO_LINK', 'add_date' => 'TIME', 'edit_date' => '?TIME', 'submitter' => 'USER', 'sort_order' => 'INTEGER', 'enabled' => 'BINARY', 'active_from_day' => 'SHORT_INTEGER', 'active_from_month' => 'SHORT_INTEGER', 'active_from_year' => 'INTEGER', 'active_to_day' => '?SHORT_INTEGER', 'active_to_month' => '?SHORT_INTEGER', 'active_to_year' => '?INTEGER'));
$GLOBALS['SITE_DB']->create_table('bookable_blacked', array('id' => '*AUTO', 'blacked_from_day' => 'SHORT_INTEGER', 'blacked_from_month' => 'SHORT_INTEGER', 'blacked_from_year' => 'INTEGER', 'blacked_to_day' => 'SHORT_INTEGER', 'blacked_to_month' => 'SHORT_INTEGER', 'blacked_to_year' => 'INTEGER', 'blacked_explanation' => 'LONG_TRANS'));
$GLOBALS['SITE_DB']->create_table('bookable_blacked_for', array('bookable_id' => '*AUTO_LINK', 'blacked_id' => '*AUTO_LINK'));
$GLOBALS['SITE_DB']->create_table('bookable_codes', array('bookable_id' => '*AUTO_LINK', 'code' => '*ID_TEXT'));
$GLOBALS['SITE_DB']->create_table('bookable_supplement', array('id' => '*AUTO', 'price' => 'REAL', 'price_is_per_period' => 'BINARY', 'supports_quantities' => 'BINARY', 'title' => 'SHORT_TRANS', 'promo_code' => 'ID_TEXT', 'supports_notes' => 'BINARY', 'sort_order' => 'INTEGER'));
$GLOBALS['SITE_DB']->create_table('bookable_supplement_for', array('supplement_id' => '*AUTO_LINK', 'bookable_id' => '*AUTO_LINK'));
$GLOBALS['SITE_DB']->create_table('booking', array('id' => '*AUTO', 'bookable_id' => 'AUTO_LINK', 'member_id' => 'USER', 'b_day' => 'SHORT_INTEGER', 'b_month' => 'SHORT_INTEGER', 'b_year' => 'INTEGER', 'code_allocation' => 'ID_TEXT', 'notes' => 'LONG_TEXT', 'booked_at' => 'TIME', 'paid_at' => '?TIME', 'paid_trans_id' => '?AUTO_LINK'));
$GLOBALS['SITE_DB']->create_table('booking_supplement', array('booking_id' => '*AUTO_LINK', 'supplement_id' => '*AUTO_LINK', 'quantity' => 'INTEGER', 'notes' => 'LONG_TEXT'));
add_config_option('BOOKINGS_SHOW_WARNINGS_FOR_MONTHS', 'bookings_show_warnings_for_months', 'integer', 'return \'6\';', 'FEATURE', 'BOOKINGS');
add_config_option('BOOKINGS_MAX_AHEAD_MONTHS', 'bookings_max_ahead_months', 'integer', 'return \'36\';', 'FEATURE', 'BOOKINGS');
}
示例11: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
// TODO: This is actually for the 'syndication' addon
if (is_null($upgrade_from)) {
add_config_option('ENABLE_RSS', 'is_on_rss', 'tick', 'return \'1\';', 'FEATURE', 'NEWS_AND_RSS');
add_config_option('UPDATE_TIME', 'rss_update_time', 'integer', 'return \'60\';', 'FEATURE', 'NEWS_AND_RSS');
}
if ($upgrade_from < 3 || is_null($upgrade_from)) {
add_config_option('ENABLE_RSS_ADVERTISING', 'is_rss_advertised', 'tick', 'return \'0\';', 'FEATURE', 'NEWS_AND_RSS');
delete_config_option('rss_side_max_entries');
delete_config_option('rss_max_entries');
}
}
示例12: run
/**
* Standard modular run function for CRON hooks. Searches for tasks to perform.
*/
function run()
{
//if (!addon_installed('octhief')) return;
require_lang('insults');
// ensure it is done once per week
$time = time();
$last_time = intval(get_value('last_insult_time'));
if ($last_time > time() - 24 * 60 * 60) {
return;
}
// run it once a day
set_value('last_insult_time', strval($time));
// how many points a correct response will give
$_insult_points = get_option('insult_points', true);
if (is_null($_insult_points)) {
// add option and default value if not installed yet
require_code('database_action');
add_config_option('INSULT_POINTS', 'insult_points', 'integer', 'return \'10\';', 'POINTS', 'INSULT_TITLE');
}
$insult_points = isset($_insult_points) && is_numeric($_insult_points) ? intval($_insult_points) : 10;
// who to insult?
$selected_members = $GLOBALS['FORUM_DB']->query('SELECT id FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE id <> ' . strval($GLOBALS['FORUM_DRIVER']->get_guest_id()) . ' ORDER BY RAND( ) ', 2, NULL, true);
$selected_member1 = isset($selected_members[0]['id']) && $selected_members[0]['id'] > 0 ? $selected_members[0]['id'] : 0;
$selected_member2 = isset($selected_members[1]['id']) && $selected_members[1]['id'] > 0 ? $selected_members[1]['id'] : 0;
// send insult to picked members
if ($selected_member1 != 0 && $selected_member2 != 0) {
$get_insult = '';
if (is_file(get_file_base() . '/text_custom/' . user_lang() . '/insults.txt')) {
$insults = file(get_file_base() . '/text_custom/' . user_lang() . '/insults.txt');
$insults_array = array();
foreach ($insults as $insult) {
$x = explode('=', $insult);
$insults_array[] = $x[0];
}
$rand_key = array_rand($insults_array, 1);
$rand_key = is_array($rand_key) ? $rand_key[0] : $rand_key;
$get_insult = $insults_array[$rand_key];
}
if ($get_insult != '') {
global $SITE_INFO;
$insult_pt_topic_post = do_lang('INSULT_EXPLANATION', get_site_name(), $get_insult, $insult_points);
$subject = do_lang('INSULT_PT_TOPIC', $GLOBALS['FORUM_DRIVER']->get_username($selected_member2), $GLOBALS['FORUM_DRIVER']->get_username($selected_member1));
require_code('ocf_topics_action');
$topic_id = ocf_make_topic(NULL, $subject, '', 1, 1, 0, 0, 0, $selected_member2, $selected_member1, true, 0, NULL, '');
require_code('ocf_posts_action');
$post_id = ocf_make_post($topic_id, $subject, $insult_pt_topic_post, 0, true, 1, 0, do_lang('SYSTEM'), NULL, NULL, $GLOBALS['FORUM_DRIVER']->get_guest_id(), NULL, NULL, NULL, false, true, NULL, true, $subject, 0, NULL, true, true, true);
require_code('ocf_topics_action2');
send_pt_notification($post_id, $subject, $topic_id, $selected_member2, $selected_member1);
}
}
}
示例13: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
require_lang('recommend');
if (is_null($upgrade_from)) {
add_config_option('RECOMMEND_SITE', 'points_RECOMMEND_SITE', 'integer', 'return addon_installed(\'points\')?\'350\':NULL;', 'POINTS', 'COUNT_POINTS_GIVEN');
}
if (!is_null($upgrade_from) && $upgrade_from < 3) {
delete_menu_item_simple('_SEARCH:recommend:from={$REPLACE&,:,%3A,{$SELF_URL}}');
delete_menu_item_simple('_SEARCH:recommend:from={$REPLACE,:,%3A,{$SELF_URL&,0,0,0,from=<null>}}');
}
if (is_null($upgrade_from) || $upgrade_from < 3) {
add_menu_item_simple('root_website', NULL, 'RECOMMEND_SITE', '_SEARCH:recommend:from={$SELF_URL&,0,0,0,from=<null>}');
}
}
示例14: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
if (is_null($upgrade_from)) {
$usergroups = $GLOBALS['FORUM_DRIVER']->get_usergroup_list(false, true);
foreach (array_keys($usergroups) as $id) {
$GLOBALS['SITE_DB']->query_insert('group_page_access', array('page_name' => 'admin_occle', 'zone_name' => 'adminzone', 'group_id' => $id));
// OcCLE very dangerous
}
$GLOBALS['SITE_DB']->create_table('occlechat', array('id' => '*AUTO', 'c_message' => 'LONG_TEXT', 'c_url' => 'URLPATH', 'c_incoming' => 'BINARY', 'c_timestamp' => 'TIME'));
add_config_option('OCCLE_CHAT_ANNOUNCE', 'occle_chat_announce', 'tick', 'return \'0\';', 'SITE', 'ADVANCED');
}
if (is_null($upgrade_from) || $upgrade_from < 2) {
add_config_option('OCCLE_BUTTON', 'bottom_show_occle_button', 'tick', 'return (get_file_base()!=get_custom_file_base())?\'0\':\'1\';', 'FEATURE', 'BOTTOM_LINKS');
}
}
示例15: install
/**
* Standard modular install function.
*
* @param ?integer What version we're upgrading from (NULL: new install)
* @param ?integer What hack version we're upgrading from (NULL: new-install/not-upgrading-from-a-hacked-version)
*/
function install($upgrade_from = NULL, $upgrade_from_hack = NULL)
{
add_config_option('_MESSAGING_FORUM_NAME', 'messaging_forum_name', 'forum', 'return do_lang(\'MESSAGING_FORUM_NAME\',\'\',\'\',\'\',get_site_default_lang());', 'FEATURE', 'CONTACT_US_MESSAGING');
if (get_forum_type() == 'ocf' && !running_script('upgrader')) {
$moderator_groups = $GLOBALS['FORUM_DRIVER']->get_moderator_groups();
$staff_access = array();
foreach ($moderator_groups as $id) {
$staff_access[$id] = 5;
}
ocf_require_all_forum_stuff();
require_code('ocf_forums_action');
require_code('ocf_forums_action2');
$GLOBALS['OCF_DRIVER'] = $GLOBALS['FORUM_DRIVER'];
ocf_make_forum(do_lang('MESSAGING_FORUM_NAME'), '', db_get_first_id() + 1, $staff_access, db_get_first_id());
}
}