本文整理汇总了PHP中get_site_name函数的典型用法代码示例。如果您正苦于以下问题:PHP get_site_name函数的具体用法?PHP get_site_name怎么用?PHP get_site_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_site_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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']);
}
}
}
示例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()));
}
}
示例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('‘', '’', '“', '”'), array('"', '"', '"', '"'), html_entity_decode(do_lang('EMAIL_ADDRESS_IN_USE', escape_html(get_site_name())), ENT_QUOTES))));
}
示例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));
}
}
示例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 " » ";
get_site_name();
}
}
示例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);
}
}
}
示例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));
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
}
示例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));
}
示例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);
}
}
示例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);
}
}
}