• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_site_name函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_site_name函数的典型用法代码示例。如果您正苦于以下问题:PHP get_site_name函数的具体用法?PHP get_site_name怎么用?PHP get_site_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_site_name函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX.
  *
  * @return tempcode  The snippet
  */
 function run()
 {
     $type = get_param('type');
     if (!has_zone_access(get_member(), 'adminzone')) {
         return new ocp_tempcode();
     }
     decache('main_staff_checklist');
     require_lang('staff_checklist');
     switch ($type) {
         case 'add':
             $recurinterval = get_param_integer('recurinterval', 0);
             $task_title = get_param('tasktitle', false, true);
             $id = $GLOBALS['SITE_DB']->query_insert('customtasks', array('tasktitle' => $task_title, 'datetimeadded' => time(), 'recurinterval' => $recurinterval, 'recurevery' => get_param('recurevery'), 'taskisdone' => NULL), true);
             require_code('notifications');
             $subject = do_lang('CT_NOTIFICATION_MAIL_SUBJECT', get_site_name(), $task_title);
             $mail = do_lang('CT_NOTIFICATION_MAIL', comcode_escape(get_site_name()), comcode_escape($task_title));
             dispatch_notification('checklist_task', NULL, $subject, $mail);
             return do_template('BLOCK_MAIN_STAFF_CHECKLIST_CUSTOM_TASK', array('TASKTITLE' => comcode_to_tempcode(get_param('tasktitle', false, true)), 'DATETIMEADDED' => display_time_period(time()), 'RECURINTERVAL' => $recurinterval == 0 ? '' : integer_format($recurinterval), 'RECUREVERY' => get_param('recurevery'), 'TASKDONE' => 'not_completed', 'ID' => strval($id)));
         case 'delete':
             $GLOBALS['SITE_DB']->query_delete('customtasks', array('id' => get_param_integer('id')), '', 1);
             break;
         case 'mark_done':
             $GLOBALS['SITE_DB']->query_update('customtasks', array('taskisdone' => time()), array('id' => get_param_integer('id')), '', 1);
             break;
         case 'mark_undone':
             $GLOBALS['SITE_DB']->query_update('customtasks', array('taskisdone' => NULL), array('id' => get_param_integer('id')), '', 1);
             break;
     }
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:checklist_task_manage.php


示例2: run

 /**
  * Standard modular run function for CRON hooks. Searches for tasks to perform.
  */
 function run()
 {
     if (get_forum_type() != 'ocf') {
         return;
     }
     $time = time();
     $last_time = intval(get_value('last_confirm_reminder_time'));
     if ($last_time > time() - 24 * 60 * 60 * 2) {
         return;
     }
     set_value('last_confirm_reminder_time', strval($time));
     require_code('mail');
     require_lang('ocf');
     $GLOBALS['NO_DB_SCOPE_CHECK'] = true;
     $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'f_members WHERE ' . db_string_not_equal_to('m_validated_email_confirm_code', '') . ' AND m_join_time>' . strval($last_time));
     $GLOBALS['NO_DB_SCOPE_CHECK'] = false;
     foreach ($rows as $row) {
         $coppa = get_option('is_on_coppa') == '1' && utctime_to_usertime(time() - mktime(0, 0, 0, $row['m_dob_month'], $row['m_dob_day'], $row['m_dob_year'])) / 31536000.0 < 13.0;
         if (!$coppa) {
             $zone = get_module_zone('join');
             if ($zone != '') {
                 $zone .= '/';
             }
             $url = get_base_url() . '/' . $zone . 'index.php?page=join&type=step4&email=' . rawurlencode($row['m_email_address']) . '&code=' . $row['m_validated_email_confirm_code'];
             $url_simple = get_base_url() . '/' . $zone . 'index.php?page=join&type=step4';
             $message = do_lang('OCF_SIGNUP_TEXT', comcode_escape(get_site_name()), comcode_escape($url), array($url_simple, $row['m_email_address'], strval($row['m_validated_email_confirm_code'])), $row['m_language']);
             mail_wrap(do_lang('CONFIRM_EMAIL_SUBJECT', get_site_name(), NULL, NULL, $row['m_language']), $message, array($row['m_email_address']), $row['m_username']);
         }
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:33,代码来源:ocf_confirm_reminder.php


示例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 < 2) {
         $GLOBALS['SITE_DB']->create_table('sitewatchlist', array('id' => '*AUTO', 'siteurl' => 'URLPATH', 'site_name' => 'SHORT_TEXT'));
         $GLOBALS['SITE_DB']->query_insert('sitewatchlist', array('siteurl' => get_base_url(), 'site_name' => get_site_name()));
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:13,代码来源:main_staff_website_monitoring.php


示例4: run

 /**
  * Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX.
  *
  * @return tempcode  The snippet
  */
 function run()
 {
     $val = get_param('name');
     $test = $GLOBALS['FORUM_DB']->query_value_null_ok('f_members', 'm_username', array('m_email_address' => $val));
     if (is_null($test)) {
         return new ocp_tempcode();
     }
     require_lang('ocf');
     return make_string_tempcode(strip_tags(str_replace(array('&lsquo;', '&rsquo;', '&ldquo;', '&rdquo;'), array('"', '"', '"', '"'), html_entity_decode(do_lang('EMAIL_ADDRESS_IN_USE', escape_html(get_site_name())), ENT_QUOTES))));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:15,代码来源:email_exists.php


示例5: send_content_validated_notification

/**
 * Send a "your content has been validated" notification out to the submitter of some content. Only call if this is true ;).
 *
 * @param  ID_TEXT		Content type
 * @param  ID_TEXT		Content ID
 */
function send_content_validated_notification($content_type, $content_id)
{
    require_code('content');
    list($content_title, $submitter_id, , , , $content_url_safe) = content_get_details($content_type, $content_id);
    if (!is_null($content_url_safe)) {
        require_code('notifications');
        require_lang('unvalidated');
        $subject = do_lang('CONTENT_VALIDATED_NOTIFICATION_MAIL_SUBJECT', $content_title, get_site_name());
        $mail = do_lang('CONTENT_VALIDATED_NOTIFICATION_MAIL', comcode_escape(get_site_name()), comcode_escape($content_title), array($content_url_safe->evaluate()));
        dispatch_notification('content_validated', NULL, $subject, $mail, array($submitter_id));
    }
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:18,代码来源:submit.php


示例6: bootstrap_get_title

/**
 * bootstrap_get_title()
 * 
 * This creates the page title for the <title> tags.
 * This function supports the following plugins:
 *   - Custom Title
 *
 * @return (string) : Echos the page title
 */
function bootstrap_get_title()
{
    if (function_exists('get_custom_title_tag')) {
        # Custom Title plugin
        echo get_custom_title_tag();
    } else {
        # Default title format
        get_page_clean_title();
        echo " &raquo ";
        get_site_name();
    }
}
开发者ID:hatasu,项目名称:appdroid,代码行数:21,代码来源:functions.php


示例7: 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);
         }
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:54,代码来源:insults.php


示例8: run

 /**
  * Standard modular run function for CRON hooks. Searches for tasks to perform.
  */
 function run()
 {
     if (!addon_installed('catalogues')) {
         return;
     }
     $last = get_value('last_classified_refresh');
     $time = time();
     if (!is_null($last) && intval($last) > $time - 60 * 60) {
         return;
     }
     // Don't do more than once per hour
     if (function_exists('set_time_limit')) {
         @set_time_limit(0);
     }
     $start = 0;
     do {
         $entries = $GLOBALS['SITE_DB']->query_select('catalogue_entries e JOIN ' . get_table_prefix() . 'classifieds_prices p ON p.c_catalogue_name=e.c_name', array('e.*'), array('ce_validated' => 1), '', 1000, $start);
         foreach ($entries as $entry) {
             if ($entry['ce_last_moved'] == $entry['ce_add_date']) {
                 require_code('classifieds');
                 initialise_classified_listing($entry);
             }
             // Expiring
             if ($entry['ce_last_moved'] < $time) {
                 $GLOBALS['SITE_DB']->query_update('catalogue_entries', array('ce_validated' => 0), array('id' => $entry['id']), '', 1);
                 decache('main_cc_embed');
                 decache('main_recent_cc_entries');
                 require_code('catalogues2');
                 calculate_category_child_count_cache($entry['cc_id']);
             } elseif ($entry['ce_last_moved'] < $time + 60 * 60 * 24 && $entry['ce_last_moved'] > $time + 60 * 60 * 23) {
                 // Expiring in 24 hours
                 require_code('notifications');
                 require_lang('classifieds');
                 $member_id = $entry['ce_submitter'];
                 $renew_url = build_url(array('page' => 'classifieds', 'type' => 'adverts', 'id' => $member_id), get_module_zone('classifieds'));
                 require_code('catalogues');
                 $data_map = get_catalogue_entry_map($entry, NULL, 'CATEGORY', 'DEFAULT', NULL, NULL, array(0));
                 $ad_title = $data_map['FIELD_0_PLAIN'];
                 if (is_object($ad_title)) {
                     $ad_title = $ad_title->evaluate();
                 }
                 $subject_tag = do_lang('SUBJECT_CLASSIFIED_ADVERT_EXPIRING', $ad_title, get_site_name(), NULL, get_lang($member_id), false);
                 $mail = do_lang('MAIL_CLASSIFIED_ADVERT_EXPIRING', $ad_title, comcode_escape(get_site_name()), comcode_escape($renew_url->evaluate()), get_lang($member_id), false);
                 // Send actual notification
                 dispatch_notification('classifieds__' . $entry['c_name'], '', $subject_tag, $mail, array($member_id), A_FROM_SYSTEM_PRIVILEGED);
             }
         }
     } while (count($entries) == 1000);
     set_value('last_classified_refresh', strval($time));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:53,代码来源:classifieds.php


示例9: activities_addon_syndicate_described_activity

/**
 * @license		http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
 * @copyright	ocProducts Ltd
 * @package		activity_feed
 */
function activities_addon_syndicate_described_activity($a_language_string_code = '', $a_label_1 = '', $a_label_2 = '', $a_label_3 = '', $a_pagelink_1 = '', $a_pagelink_2 = '', $a_pagelink_3 = '', $a_addon = '', $a_is_public = 1, $a_member_id = NULL, $sitewide_too = false, $a_also_involving = NULL)
{
    require_code('activities');
    require_lang('activities');
    if (get_db_type() == 'xml' && get_param_integer('keep_testing_logging', 0) != 1) {
        return NULL;
    }
    $stored_id = 0;
    if (is_null($a_member_id)) {
        $a_member_id = get_member();
    }
    if (is_guest($a_member_id)) {
        return NULL;
    }
    $go = array('a_language_string_code' => $a_language_string_code, 'a_label_1' => $a_label_1, 'a_label_2' => $a_label_2, 'a_label_3' => $a_label_3, 'a_is_public' => $a_is_public);
    $stored_id = mixed();
    // Check if this has been posted previously (within the last 10 minutes) to
    // stop spamming but allow generalised repeat status messages.
    $test = $GLOBALS['SITE_DB']->query_select('activities', array('a_language_string_code', 'a_label_1', 'a_label_2', 'a_label_3', 'a_is_public'), NULL, 'WHERE a_time>' . strval(time() - 600), 1);
    if (!array_key_exists(0, $test) || $test[0] != $go || running_script('execute_temp')) {
        // Log the activity
        $row = $go + array('a_member_id' => $a_member_id, 'a_also_involving' => $a_also_involving, 'a_pagelink_1' => $a_pagelink_1, 'a_pagelink_2' => $a_pagelink_2, 'a_pagelink_3' => $a_pagelink_3, 'a_time' => time(), 'a_addon' => $a_addon, 'a_is_public' => $a_is_public);
        $stored_id = $GLOBALS['SITE_DB']->query_insert('activities', $row, true);
        // Update the latest activity file
        log_newest_activity($stored_id, 1000);
        // External places
        if ($a_is_public == 1 && !$GLOBALS['IS_ACTUALLY_ADMIN']) {
            $dests = find_all_hooks('systems', 'syndication');
            foreach (array_keys($dests) as $hook) {
                require_code('hooks/systems/syndication/' . $hook);
                $ob = object_factory('Hook_Syndication_' . $hook);
                if ($ob->is_available()) {
                    $ob->syndicate_user_activity($a_member_id, $row);
                    if ($sitewide_too && has_specific_permission(get_member(), 'syndicate_site_activity') && post_param_integer('syndicate_this', 0) == 1) {
                        $ob->syndicate_site_activity($row);
                    }
                }
            }
        }
        list($message) = render_activity($row, false);
        require_code('notifications');
        $username = $GLOBALS['FORUM_DRIVER']->get_username($a_member_id);
        $subject = do_lang('ACTIVITY_NOTIFICATION_MAIL_SUBJECT', get_site_name(), $username, html_entity_decode(strip_tags($message->evaluate()), ENT_QUOTES, get_charset()));
        $mail = do_lang('ACTIVITY_NOTIFICATION_MAIL', comcode_escape(get_site_name()), comcode_escape($username), array('[semihtml]' . $message->evaluate() . '[/semihtml]'));
        dispatch_notification('activity', strval($a_member_id), $subject, $mail);
    }
    return $stored_id;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:53,代码来源:activities_submission.php


示例10: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     require_lang('facebook_friends');
     require_code('facebook_connect');
     $appid = get_option('facebook_appid', true);
     if (is_null($appid) || $appid == '') {
         return new ocp_tempcode();
     }
     $stream = array_key_exists('stream', $map) ? $map['stream'] : '0';
     $fans = array_key_exists('fans', $map) ? $map['fans'] : '10';
     $logobar = array_key_exists('logobar', $map) ? $map['logobar'] : '0';
     $show_fanpage_link = array_key_exists('show_fanpage_link', $map) ? $map['show_fanpage_link'] : '0';
     $fanpage_name = isset($map['fanpage_name']) && strlen($map['fanpage_name']) > 0 ? $map['fanpage_name'] : get_site_name();
     $out = new ocp_tempcode();
     return do_template('BLOCK_MAIN_FACEBOOK_FRIENDS', array('TITLE' => do_lang_tempcode('BLOCK_FACEBOOK_FRIENDS_TITLE'), 'CONTENT' => $out, 'FANPAGE_NAME' => $fanpage_name, 'SHOW_FANPAGE_LINK' => $show_fanpage_link, 'LOGOBAR' => $logobar, 'FANS' => $fans, 'STREAM' => $stream));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:22,代码来源:main_facebook_friends.php


示例11: send_recommendation_email

/**
 * Sends out a recommendation e-mail.
 *
 * @param  string		Recommenders name
 * @param  mixed		Their e-mail address (string or array of alternates)
 * @param  string		The recommendation message
 * @param  boolean	Whether this is an invitation
 * @param  ?string	Email address of the recommender (NULL: current user's)
 * @param  ?string	The subject (NULL: default)
 * @param  ?array		List of names (NULL: use email addresses as names)
 */
function send_recommendation_email($name, $email_address, $message, $is_invite = false, $recommender_email = NULL, $subject = NULL, $names = NULL)
{
    if (!is_array($email_address)) {
        $email_address = array($email_address);
    }
    if (is_null($recommender_email)) {
        $recommender_email = $GLOBALS['FORUM_DRIVER']->get_member_email_address(get_member());
    }
    if (is_null($subject)) {
        $subject = do_lang('RECOMMEND_MEMBER_SUBJECT', get_site_name());
    }
    require_code('mail');
    if ($message == '') {
        $message = '(' . do_lang('NONE') . ')';
    }
    mail_wrap(do_lang('RECOMMEND_MEMBER_SUBJECT', get_site_name()), $message, $email_address, is_null($names) ? $email_address : $names, $recommender_email, $name);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:28,代码来源:recommend.php


示例12: run

 /**
  * Standard modular run function for CRON hooks. Searches for tasks to perform.
  */
 function run()
 {
     if (!defined('MAXIMUM_DIGEST_LENGTH')) {
         define('MAXIMUM_DIGEST_LENGTH', 1024 * 100);
         // 100KB
     }
     require_code('notifications');
     foreach (array(A_DAILY_EMAIL_DIGEST => 60 * 60 * 24, A_WEEKLY_EMAIL_DIGEST => 60 * 60 * 24 * 7, A_MONTHLY_EMAIL_DIGEST => 60 * 60 * 24 * 31) as $frequency => $timespan) {
         $start = 0;
         do {
             // Find where not tint-in-tin
             $members = $GLOBALS['SITE_DB']->query('SELECT DISTINCT d_to_member_id FROM ' . get_table_prefix() . 'digestives_consumed c JOIN ' . get_table_prefix() . 'digestives_tin t ON c.c_member_id=t.d_to_member_id AND c.c_frequency=' . strval($frequency) . ' WHERE c_time<' . strval(time() - $timespan) . ' AND c_frequency=' . strval($frequency), 100, $start);
             foreach ($members as $member) {
                 require_lang('notifications');
                 $to_member_id = $member['d_to_member_id'];
                 $to_name = $GLOBALS['FORUM_DRIVER']->get_username($to_member_id);
                 $to_email = $GLOBALS['FORUM_DRIVER']->get_member_email_address($to_member_id);
                 $messages = $GLOBALS['SITE_DB']->query_select('digestives_tin', array('d_subject', 'd_message', 'd_date_and_time'), array('d_to_member_id' => $to_member_id, 'd_frequency' => $frequency), 'ORDER BY d_date_and_time');
                 $GLOBALS['SITE_DB']->query_delete('digestives_tin', array('d_to_member_id' => $to_member_id, 'd_frequency' => $frequency));
                 $_message = '';
                 foreach ($messages as $message) {
                     if ($_message != '') {
                         $_message .= chr(10);
                     }
                     if (strlen($_message) + strlen($message['d_message']) < MAXIMUM_DIGEST_LENGTH) {
                         $_message .= do_lang('DIGEST_EMAIL_INDIVIDUAL_MESSAGE_WRAP', comcode_escape($message['d_subject']), $message['d_message'], array(comcode_escape(get_site_name()), get_timezoned_date($message['d_date_and_time'])));
                     } else {
                         $_message .= do_lang('DIGEST_ITEM_OMITTED', comcode_escape($message['d_subject']), get_timezoned_date($message['d_date_and_time']), array(comcode_escape(get_site_name())));
                     }
                 }
                 if ($_message != '') {
                     $wrapped_subject = do_lang('DIGEST_EMAIL_SUBJECT_' . strval($frequency), comcode_escape(get_site_name()));
                     $wrapped_message = do_lang('DIGEST_EMAIL_MESSAGE_WRAP', $_message, comcode_escape(get_site_name()));
                     require_code('mail');
                     mail_wrap($wrapped_subject, $wrapped_message, array($to_email), $to_name, get_option('staff_address'), get_site_name(), 3, NULL, true, A_FROM_SYSTEM_UNPRIVILEGED, false);
                     $GLOBALS['SITE_DB']->query_update('digestives_consumed', array('c_time' => time()), array('c_member_id' => $to_member_id, 'c_frequency' => $frequency), '', 1);
                 }
             }
             $start += 100;
         } while (count($members) == 100);
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:45,代码来源:notification_digests.php


示例13: add_bookmark_form

/**
 * Get the form to add a bookmark / set breadcrumbs.
 *
 * @param  mixed			Where the form should go to
 * @return tempcode		The form
 */
function add_bookmark_form($post_url)
{
    $title = get_page_title('ADD_BOOKMARK');
    require_lang('zones');
    require_code('character_sets');
    $url = base64_decode(get_param('url', '', true));
    $url = convert_to_internal_encoding($url, 'UTF-8');
    // Note that this is intentionally passed in to not be a short URL
    $page_link = convert_to_internal_encoding(url_to_pagelink($url, false, false), 'UTF-8');
    $default_title = get_param('title', '', true);
    $default_title = convert_to_internal_encoding($default_title, 'UTF-8');
    $default_title = preg_replace('#\\s.\\s' . str_replace('#', '\\#', preg_quote(get_site_name())) . '$#s', '', $default_title);
    $default_title = preg_replace('#^' . str_replace('#', '\\#', preg_quote(get_site_name())) . '\\s.\\s#s', '', $default_title);
    $default_title_2 = @preg_replace('#\\s.\\s' . str_replace('#', '\\#', preg_quote(get_site_name())) . '$#su', '', $default_title);
    $default_title_2 = @preg_replace('#^' . str_replace('#', '\\#', preg_quote(get_site_name())) . '\\s.\\s#su', '', $default_title_2);
    if ($default_title_2 !== false) {
        $default_title = $default_title_2;
    }
    if (!is_string($default_title)) {
        $default_title = '';
    }
    require_code('form_templates');
    $rows = $GLOBALS['SITE_DB']->query_select('bookmarks', array('DISTINCT b_folder'), array('b_owner' => get_member()), 'ORDER BY b_folder');
    $list = new ocp_tempcode();
    $list->attach(form_input_list_entry('', false, do_lang_tempcode('NA_EM')));
    $list->attach(form_input_list_entry('!', true, do_lang_tempcode('ROOT_EM')));
    foreach ($rows as $row) {
        if ($row['b_folder'] != '') {
            $list->attach(form_input_list_entry($row['b_folder']));
        }
    }
    $fields = new ocp_tempcode();
    $fields->attach(form_input_list(do_lang_tempcode('OLD_BOOKMARK_FOLDER'), do_lang_tempcode('DESCRIPTION_OLD_BOOKMARK_FOLDER'), 'folder', $list, NULL, false, false));
    $fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('NEW_BOOKMARK_FOLDER')), do_lang_tempcode('DESCRIPTION_NEW_BOOKMARK_FOLDER'), 'folder_new', '', false));
    $fields->attach(form_input_line(do_lang_tempcode('TITLE'), do_lang_tempcode('DESCRIPTION_TITLE'), 'title', $default_title == '' ? '' : substr($default_title, 0, 200), true));
    $fields->attach(form_input_line(do_lang_tempcode('PAGE_LINK'), do_lang_tempcode('DESCRIPTION_PAGE_LINK_BOOKMARK'), 'page_link', $page_link, true));
    $submit_name = do_lang_tempcode('ADD_BOOKMARK');
    breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('MANAGE_BOOKMARKS'))));
    $javascript = 'standardAlternateFields(\'folder\',\'folder_new\'); var title=document.getElementById(\'title\'); if (((title.value==\'\') || (title.value==\'0\')) && (window.opener)) title.value=getInnerHTML(window.opener.document.getElementsByTagName(\'title\')[0]); ';
    return do_template('FORM_SCREEN', array('_GUID' => '7e94bb97008de4fa0fffa2b5f91c95eb', 'TITLE' => $title, 'HIDDEN' => '', 'TEXT' => '', 'FIELDS' => $fields, 'URL' => $post_url, 'SUBMIT_NAME' => $submit_name, 'JAVASCRIPT' => $javascript));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:47,代码来源:bookmarks.php


示例14: buddy_add

/**
 * Add a buddy.
 *
 * @param  MEMBER			The member befriending
 * @param  MEMBER			The member being befriended
 * @param  ?TIME			The logged time of the friendship (NULL: now)
 */
function buddy_add($likes, $liked, $time = NULL)
{
    if (is_null($time)) {
        $time = time();
    }
    $GLOBALS['SITE_DB']->query_delete('chat_buddies', array('member_likes' => $likes, 'member_liked' => $liked), '', 1);
    // Just in case page refreshed
    $GLOBALS['SITE_DB']->query_insert('chat_buddies', array('member_likes' => $likes, 'member_liked' => $liked, 'date_and_time' => $time));
    // Send a notification
    if (is_null($GLOBALS['SITE_DB']->query_value_null_ok('chat_buddies', 'date_and_time', array('member_likes' => $liked, 'member_liked' => $likes)))) {
        require_lang('chat');
        require_code('notifications');
        $to_name = $GLOBALS['FORUM_DRIVER']->get_username($liked);
        $from_name = $GLOBALS['FORUM_DRIVER']->get_username($likes);
        $subject_tag = do_lang('YOURE_MY_BUDDY_SUBJECT', $from_name, get_site_name(), NULL, get_lang($liked));
        $befriend_url = build_url(array('page' => 'chat', 'type' => 'buddy_add', 'member_id' => $likes), get_module_zone('chat'), NULL, false, false, true);
        $message_raw = do_lang('YOURE_MY_BUDDY_BODY', comcode_escape($to_name), comcode_escape(get_site_name()), array($befriend_url->evaluate(), comcode_escape($from_name)), get_lang($liked));
        dispatch_notification('new_buddy', NULL, $subject_tag, $message_raw, array($liked), $likes);
        // Log the action
        log_it('MAKE_BUDDY', strval($likes), strval($liked));
        syndicate_described_activity('chat:PEOPLE_NOW_FRIENDS', $to_name, '', '', '_SEARCH:members:view:' . strval($liked), '_SEARCH:members:view:' . strval($likes), '', 'chat', 1, $likes);
        syndicate_described_activity('chat:PEOPLE_NOW_FRIENDS', $to_name, '', '', '_SEARCH:members:view:' . strval($liked), '_SEARCH:members:view:' . strval($likes), '', 'chat', 1, $liked);
    }
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:31,代码来源:chat2.php


示例15: run

 /**
  * Standard modular run function for CRON hooks. Searches for tasks to perform.
  */
 function run()
 {
     $this_birthday_day = date('d/m/Y');
     if (get_long_value('last_birthday_day') !== $this_birthday_day) {
         set_long_value('last_birthday_day', $this_birthday_day);
         require_lang('ocf');
         require_code('ocf_general');
         $_birthdays = ocf_find_birthdays();
         $birthdays = new ocp_tempcode();
         foreach ($_birthdays as $_birthday) {
             $member_url = $GLOBALS['OCF_DRIVER']->member_profile_url($_birthday['id'], false, true);
             $username = $_birthday['username'];
             $birthday_url = build_url(array('page' => 'topics', 'type' => 'birthday', 'id' => $_birthday['username']), get_module_zone('topics'));
             require_code('notifications');
             $subject = do_lang('BIRTHDAY_NOTIFICATION_MAIL_SUBJECT', get_site_name(), $username);
             $mail = do_lang('BIRTHDAY_NOTIFICATION_MAIL', comcode_escape(get_site_name()), comcode_escape($username), array($member_url->evaluate(), $birthday_url->evaluate()));
             if (addon_installed('chat')) {
                 $friends = $GLOBALS['SITE_DB']->query_select('chat_buddies', array('member_likes'), array('member_liked' => $_birthday['id']));
                 dispatch_notification('ocf_friend_birthday', NULL, $subject, $mail, collapse_1d_complexity('member_likes', $friends));
             }
             dispatch_notification('ocf_birthday', NULL, $subject, $mail);
         }
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:27,代码来源:ocf_birthdays.php


示例16: get_header

        <!--FOR GSCMS PLUGINS-->
        <?php 
get_header();
?>

        <?php 
if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
    header('X-UA-Compatible: IE=edge,chrome=1');
}
?>

        <title><?php 
get_page_clean_title();
?>
 - <?php 
get_site_name();
?>
</title>

        <!--[if IE]>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

    </head>

    <body id="<?php 
get_page_slug();
?>
">
        <div id="body-container">
            <!--SIDEBAR DIV CONTAINER-->
开发者ID:Kevinf63,项目名称:KevPortfolio,代码行数:31,代码来源:template.php


示例17: ocf_make_member


//.........这里部分代码省略.........
        if ($g_id == $primary_group) {
            unset($secondary_groups[$_g_id]);
        }
    }
    if (is_null($ip_address)) {
        $ip_address = get_ip_address();
    }
    if ($password_compatibility_scheme == '' && get_value('no_password_hashing') === '1') {
        $password_compatibility_scheme = 'plain';
        $salt = '';
    }
    if ($salt == '' && $password_compatibility_scheme == '') {
        $salt = produce_salt();
        $password_salted = md5($salt . md5($password));
    } else {
        $password_salted = $password;
    }
    // Supplement custom field values given with defaults, and check constraints
    $all_fields = list_to_map('id', ocf_get_all_custom_fields_match($secondary_groups));
    require_code('fields');
    foreach ($all_fields as $field) {
        $field_id = $field['id'];
        if (array_key_exists($field_id, $custom_fields)) {
            if ($check_correctness && $field[array_key_exists('cf_show_on_join_form', $field) ? 'cf_show_on_join_form' : 'cf_required'] == 0 && $field['cf_owner_set'] == 0 && !has_actual_page_access(get_member(), 'admin_ocf_join')) {
                access_denied('I_ERROR');
            }
        } else {
            $custom_fields[$field_id] = '';
        }
    }
    if (!addon_installed('unvalidated')) {
        $validated = 1;
    }
    $map = array('m_username' => $username, 'm_pass_hash_salted' => $password_salted, 'm_pass_salt' => $salt, 'm_theme' => $theme, 'm_avatar_url' => $avatar_url, 'm_validated' => $validated, 'm_validated_email_confirm_code' => $validated_email_confirm_code, 'm_cache_num_posts' => 0, 'm_cache_warnings' => 0, 'm_max_email_attach_size_mb' => 5, 'm_join_time' => $join_time, 'm_timezone_offset' => $timezone, 'm_primary_group' => $primary_group, 'm_last_visit_time' => $last_visit_time, 'm_last_submit_time' => $last_submit_time, 'm_signature' => insert_lang_comcode($signature, 4, $GLOBALS['FORUM_DB']), 'm_is_perm_banned' => $is_perm_banned, 'm_preview_posts' => $preview_posts, 'm_notes' => $personal_notes, 'm_dob_day' => $dob_day, 'm_dob_month' => $dob_month, 'm_dob_year' => $dob_year, 'm_reveal_age' => $reveal_age, 'm_email_address' => $email_address, 'm_title' => $title, 'm_photo_url' => $photo_url, 'm_photo_thumb_url' => $photo_thumb_url, 'm_views_signatures' => $views_signatures, 'm_auto_monitor_contrib_content' => $auto_monitor_contrib_content, 'm_highlighted_name' => $highlighted_name, 'm_pt_allow' => $pt_allow, 'm_pt_rules_text' => insert_lang_comcode($pt_rules_text, 4, $GLOBALS['FORUM_DB']), 'm_language' => $language, 'm_ip_address' => $ip_address, 'm_zone_wide' => $zone_wide, 'm_allow_emails' => $allow_emails, 'm_allow_emails_from_staff' => $allow_emails_from_staff, 'm_password_change_code' => '', 'm_password_compat_scheme' => $password_compatibility_scheme, 'm_on_probation_until' => NULL);
    if (!is_null($id)) {
        $map['id'] = $id;
    }
    $member_id = $GLOBALS['FORUM_DB']->query_insert('f_members', $map, true);
    if ($check_correctness) {
        // If it was an invite/recommendation, award the referrer
        if (addon_installed('recommend')) {
            $inviter = $GLOBALS['FORUM_DB']->query_value_null_ok('f_invites', 'i_inviter', array('i_email_address' => $email_address), 'ORDER BY i_time');
            if (!is_null($inviter)) {
                if (addon_installed('points')) {
                    require_code('points2');
                    require_lang('recommend');
                    system_gift_transfer(do_lang('RECOMMEND_SITE_TO', $username, get_site_name()), intval(get_option('points_RECOMMEND_SITE')), $inviter);
                }
                if (addon_installed('chat')) {
                    require_code('chat2');
                    buddy_add($inviter, $member_id);
                    buddy_add($member_id, $inviter);
                }
            }
        }
    }
    $value = mixed();
    // Store custom fields
    $row = array('mf_member_id' => $member_id);
    $all_fields_types = collapse_2d_complexity('id', 'cf_type', $all_fields);
    foreach ($custom_fields as $field_num => $value) {
        if (!array_key_exists($field_num, $all_fields_types)) {
            continue;
        }
        // Trying to set a field we're not allowed to (doesn't apply to our group)
        $ob = get_fields_hook($all_fields_types[$field_num]);
        list(, , $storage_type) = $ob->get_field_value_row_bits($all_fields[$field_num]);
        if (strpos($storage_type, '_trans') !== false) {
            $value = insert_lang($value, 3, $GLOBALS['FORUM_DB']);
        }
        $row['field_' . strval($field_num)] = $value;
    }
    // Set custom field row
    $all_fields_regardless = $GLOBALS['FORUM_DB']->query_select('f_custom_fields', array('id', 'cf_type'));
    foreach ($all_fields_regardless as $field) {
        if (!array_key_exists('field_' . strval($field['id']), $row)) {
            $ob = get_fields_hook($field['cf_type']);
            list(, , $storage_type) = $ob->get_field_value_row_bits($field);
            $value = '';
            if (strpos($storage_type, '_trans') !== false) {
                $value = insert_lang($value, 3, $GLOBALS['FORUM_DB']);
            }
            $row['field_' . strval($field['id'])] = $value;
        }
    }
    $GLOBALS['FORUM_DB']->query_insert('f_member_custom_fields', $row);
    // Any secondary work
    foreach ($secondary_groups as $g) {
        if ($g != $primary_group) {
            $GLOBALS['FORUM_DB']->query_delete('f_group_members', array('gm_member_id' => $member_id, 'gm_group_id' => $g), '', 1);
            $GLOBALS['FORUM_DB']->query_insert('f_group_members', array('gm_group_id' => $g, 'gm_member_id' => $member_id, 'gm_validated' => 1));
        }
    }
    if ($check_correctness) {
        if (function_exists('decache')) {
            decache('side_stats');
        }
    }
    return $member_id;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:101,代码来源:ocf_members_action.php


示例18: give_points

/**
 * Give a member some points, from another member.
 *
 * @param  integer		The amount being given
 * @param  MEMBER			The member receiving the points
 * @param  MEMBER			The member sending the points
 * @param  SHORT_TEXT	The reason for the gift
 * @param  boolean		Does the sender want to remain anonymous?
 * @param  boolean		Whether to send out an email about it
 */
function give_points($amount, $recipient_id, $sender_id, $reason, $anonymous = false, $send_email = true)
{
    require_lang('points');
    require_code('points');
    $your_username = $GLOBALS['FORUM_DRIVER']->get_username($sender_id);
    $GLOBALS['SITE_DB']->query_insert('gifts', array('date_and_time' => time(), 'amount' => $amount, 'gift_from' => $sender_id, 'gift_to' => $recipient_id, 'reason' => insert_lang_comcode($reason, 4), 'anonymous' => $anonymous ? 1 : 0));
    $sender_gift_points_used = point_info($sender_id);
    $sender_gift_points_used = array_key_exists('gift_points_used', $sender_gift_points_used) ? $sender_gift_points_used['gift_points_used'] : 0;
    $GLOBALS['FORUM_DRIVER']->set_custom_field($sender_id, 'gift_points_used', strval($sender_gift_points_used + $amount));
    $temp_points = point_info($recipient_id);
    $GLOBALS['FORUM_DRIVER']->set_custom_field($recipient_id, 'points_gained_given', strval((array_key_exists('points_gained_given', $temp_points) ? $temp_points['points_gained_given'] : 0) + $amount));
    $their_username = $GLOBALS['FORUM_DRIVER']->get_username($recipient_id);
    if (is_null($their_username)) {
        warn_exit(do_lang_tempcode('_USER_NO_EXIST', $recipient_id));
    }
    $yes = $GLOBALS['FORUM_DRIVER']->get_member_email_allowed($recipient_id);
    if ($yes && $send_email) {
        $_url = build_url(array('page' => 'points', 'type' => 'member', 'id' => $recipient_id), get_module_zone('points'), NULL, false, false, true);
        $url = $_url->evaluate();
        require_code('notifications');
        if ($anonymous) {
            $message_raw = do_lang('GIVEN_POINTS_FOR_ANON', comcode_escape(get_site_name()), comcode_escape(integer_format($amount)), array(comcode_escape($reason), comcode_escape($url)), get_lang($recipient_id));
            dispatch_notification('received_points', NULL, do_lang('YOU_GIVEN_POINTS', integer_format($amount), NULL, NULL, get_lang($recipient_id)), $message_raw, array($recipient_id), A_FROM_SYSTEM_UNPRIVILEGED);
        } else {
            $message_raw = do_lang('GIVEN_POINTS_FOR', comcode_escape(get_site_name()), comcode_escape(integer_format($amount)), array(comcode_escape($reason), comcode_escape($url), comcode_escape($your_username)), get_lang($recipient_id));
            dispatch_notification('received_points', NULL, do_lang('YOU_GIVEN_POINTS', integer_format($amount), NULL, NULL, get_lang($recipient_id)), $message_raw, array($recipient_id), $sender_id);
        }
        $message_raw = do_lang('USER_GIVEN_POINTS_FOR', comcode_escape($their_username), comcode_escape(integer_format($amount)), array(comcode_escape($reason), comcode_escape($url), comcode_escape($your_username)), get_site_default_lang());
        dispatch_notification('receive_points_staff', NULL, do_lang('USER_GIVEN_POINTS', integer_format($amount), NULL, NULL, get_site_default_lang()), $message_raw, NULL, $sender_id);
    }
    global $TOTAL_POINTS_CACHE, $POINT_INFO_CACHE;
    if (array_key_exists($recipient_id, $TOTAL_POINTS_CACHE)) {
        $TOTAL_POINTS_CACHE[$recipient_id] += $amount;
    }
    if (array_key_exists($recipient_id, $POINT_INFO_CACHE) && array_key_exists('points_gained_given', $POINT_INFO_CACHE[$recipient_id])) {
        $POINT_INFO_CACHE[$recipient_id]['points_gained_given'] += $amount;
    }
    if (array_key_exists($sender_id, $POINT_INFO_ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_site_option函数代码示例发布时间:2022-05-15
下一篇:
PHP get_site_list函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap