return $string;
}
-if (! function_exists('bb_extract_images')) {
function bb_extract_images($body) {
$saved_image = array();
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
-}}
+}
-if (! function_exists('bb_replace_images')) {
function bb_replace_images($body, $images) {
$newbody = $body;
}
return $newbody;
-}}
+}
function bb_ShareAttributes($share, $simplehtml) {
$attributes = $share[2];
require_once "include/bbcode.php";
require_once "include/acl_selectors.php";
-/*
- * Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
- * is identical to the code in mod/message.php for 'item_extract_images' and
- * 'item_redir_and_replace_images'
- */
-if (! function_exists('item_extract_images')) {
function item_extract_images($body) {
$saved_image = array();
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
-}}
+}
-if (! function_exists('item_redir_and_replace_images')) {
function item_redir_and_replace_images($body, $images, $cid) {
$origbody = $body;
$cnt++;
}
return $newbody;
-}}
+}
/**
* Render actions localized
return "`item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`";
}
-if (!function_exists('conversation')) {
/**
* "Render" a conversation or list of items for HTML display.
* There are two major forms of display:
));
return $o;
-}}
+}
function best_link_url($item, &$sparkle, $url = '') {
return $o;
}
-if (! function_exists('builtin_activity_puller')) {
/**
* @brief Checks item to see if it is one of the builtin activities (like/dislike, event attendance, consensus items, etc.)
* Increments the count of each matching activity and adds a link to the author as needed.
return;
}
}
-}}
+}
-if (! function_exists('format_like')) {
/**
* Format the vote text for a profile item
* @param int $cnt = number of people who vote the item
$o .= $expanded;
return $o;
-}}
+}
function status_editor(App $a, $x, $notes_cid = 0, $popup = false) {
$o = '';
* The purpose of this function is to apply system message length limits to
* imported messages without including any embedded photos in the length
*/
-if (! function_exists('limit_body_size')) {
function limit_body_size($body) {
// logger('limit_body_size: start', LOGGER_DEBUG);
} else {
return $body;
}
-}}
+}
function title_is_body($title, $body) {
require_once "include/dba.php";
-if (! function_exists('get_browser_language')) {
/**
* @brief get the prefered language from the HTTP_ACCEPT_LANGUAGE header
*/
// in case none matches, get the system wide configured language, or fall back to English
return Config::get('system', 'language', 'en');
-}}
+}
function push_lang($language) {
// l
-if (! function_exists('load_translation_table')) {
/**
* load string translation table for alternate language
*
include("view/lang/$lang/strings.php");
}
-}}
+}
/**
* @brief Return the localized version of the provided string with optional string interpolation
require_once 'include/acl_selectors.php';
require_once 'include/message.php';
+require_once 'include/conversation.php';
function message_init(App $a) {
}
-// Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
-// is identical to the code in include/conversation.php
-if (! function_exists('item_extract_images')) {
-function item_extract_images($body) {
-
- $saved_image = array();
- $orig_body = $body;
- $new_body = '';
-
- $cnt = 0;
- $img_start = strpos($orig_body, '[img');
- $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
- $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
- while(($img_st_close !== false) && ($img_end !== false)) {
-
- $img_st_close++; // make it point to AFTER the closing bracket
- $img_end += $img_start;
-
- if (! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
- // This is an embedded image
-
- $saved_image[$cnt] = substr($orig_body, $img_start + $img_st_close, $img_end - ($img_start + $img_st_close));
- $new_body = $new_body . substr($orig_body, 0, $img_start) . '[!#saved_image' . $cnt . '#!]';
-
- $cnt++;
- } else
- $new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
-
- $orig_body = substr($orig_body, $img_end + strlen('[/img]'));
-
- if ($orig_body === false) // in case the body ends on a closing image tag
- $orig_body = '';
-
- $img_start = strpos($orig_body, '[img');
- $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
- $img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
- }
-
- $new_body = $new_body . $orig_body;
-
- return array('body' => $new_body, 'images' => $saved_image);
-}}
-
-if (! function_exists('item_redir_and_replace_images')) {
-function item_redir_and_replace_images($body, $images, $cid) {
-
- $origbody = $body;
- $newbody = '';
-
- for($i = 0; $i < count($images); $i++) {
- $search = '/\[url\=(.*?)\]\[!#saved_image' . $i . '#!\]\[\/url\]' . '/is';
- $replace = '[url=' . System::baseUrl() . '/redir/' . $cid
- . '?f=1&url=' . '$1' . '][!#saved_image' . $i . '#!][/url]' ;
-
- $img_end = strpos($origbody, '[!#saved_image' . $i . '#!][/url]') + strlen('[!#saved_image' . $i . '#!][/url]');
- $process_part = substr($origbody, 0, $img_end);
- $origbody = substr($origbody, $img_end);
-
- $process_part = preg_replace($search, $replace, $process_part);
- $newbody = $newbody . $process_part;
- }
- $newbody = $newbody . $origbody;
-
- $cnt = 0;
- foreach ($images as $image) {
- // We're depending on the property of 'foreach' (specified on the PHP website) that
- // it loops over the array starting from the first element and going sequentially
- // to the last element
- $newbody = str_replace('[!#saved_image' . $cnt . '#!]', '[img]' . $image . '[/img]', $newbody);
- $cnt++;
- }
-
- return $newbody;
-}}
-
-
-
function message_content(App $a) {
$o = '';
}
-if(! function_exists('profile_photo_content')) {
function profile_photo_content(App $a) {
if (! local_user()) {
}
return; // NOTREACHED
-}}
+}
-if(! function_exists('profile_photo_crop_ui_head')) {
function profile_photo_crop_ui_head(App $a, Image $Image) {
$max_length = Config::get('system','max_image_length');
if (! $max_length) {
$a->page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), array());
$a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), array());
return;
-}}
-
+}