dangerous typo that removes all your hublocs, fix reshare formatting
This commit is contained in:
parent
bcf4592cb0
commit
b86277b0ff
@ -151,15 +151,15 @@ function bb_ShareAttributes($match) {
|
|||||||
|
|
||||||
$headline = '<div class="shared_header">';
|
$headline = '<div class="shared_header">';
|
||||||
|
|
||||||
if ($avatar != "")
|
if ($avatar != "")
|
||||||
$headline .= '<img src="'.$avatar.'" height="32" width="32" >';
|
$headline .= '<img src="'.$avatar.'" height="32" width="32" />';
|
||||||
|
|
||||||
$headline .= sprintf(t('<span><a href="%s" target="external-link">%s</a> wrote the following <a href="%s" target="external-link">post</a>'.$reldate.':</span>'), $profile, $author, $link);
|
$headline .= sprintf(t('<span><a href="%s">%s</a> wrote the following <a href="%s">post</a>'.$reldate.':</span>'), $profile, $author, $link);
|
||||||
|
|
||||||
$headline .= "</div>";
|
$headline .= "</div>";
|
||||||
|
|
||||||
$text = $headline.'<blockquote class="shared_content">'.trim($match[2])."</blockquote>";
|
$text = $headline . '<div style="reshared-content">' . trim($match[2]) . '</div>';
|
||||||
|
logger('bbshare: ' . $text);
|
||||||
return($text);
|
return($text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,9 +232,6 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
|
|||||||
$Text = str_replace("<", "<", $Text);
|
$Text = str_replace("<", "<", $Text);
|
||||||
$Text = str_replace(">", ">", $Text);
|
$Text = str_replace(">", ">", $Text);
|
||||||
|
|
||||||
// This only matters when looking for tags - otherwise has no meaning
|
|
||||||
|
|
||||||
$Text = str_replace(array('[share]','[/share]'), array('',''), $Text);
|
|
||||||
|
|
||||||
// Convert new line chars to html <br /> tags
|
// Convert new line chars to html <br /> tags
|
||||||
|
|
||||||
@ -259,13 +256,15 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
|
|||||||
|
|
||||||
// Perform URL Search
|
// Perform URL Search
|
||||||
|
|
||||||
$Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1<a href="$2" >$2</a>', $Text);
|
$Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1<a href="$2" >$2</a>', $Text);
|
||||||
|
|
||||||
if ($tryoembed)
|
if ($tryoembed)
|
||||||
$Text = preg_replace_callback("/\[bookmark\=([^\]]*)\].*?\[\/bookmark\]/ism",'tryoembed',$Text);
|
$Text = preg_replace_callback("/\[bookmark\=([^\]]*)\].*?\[\/bookmark\]/ism",'tryoembed',$Text);
|
||||||
|
|
||||||
$Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism",'[url=$1]$2[/url]',$Text);
|
$Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism",'[url=$1]$2[/url]',$Text);
|
||||||
|
|
||||||
|
$Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism","bb_ShareAttributes",$Text);
|
||||||
|
|
||||||
if ($tryoembed)
|
if ($tryoembed)
|
||||||
$Text = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism",'tryoembed',$Text);
|
$Text = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism",'tryoembed',$Text);
|
||||||
|
|
||||||
@ -402,7 +401,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
|
|||||||
// [img]pathtoimage[/img]
|
// [img]pathtoimage[/img]
|
||||||
$Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
|
$Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
|
||||||
|
|
||||||
$Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism","bb_ShareAttributes",$Text);
|
|
||||||
|
|
||||||
$Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'<br/><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
|
$Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'<br/><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
|
||||||
$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism",'<br/><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
|
$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism",'<br/><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
|
||||||
|
@ -652,6 +652,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Normal View
|
// Normal View
|
||||||
|
// logger('conv: items: ' . print_r($items,true));
|
||||||
|
|
||||||
require_once('include/ConversationObject.php');
|
require_once('include/ConversationObject.php');
|
||||||
require_once('include/ItemObject.php');
|
require_once('include/ItemObject.php');
|
||||||
|
@ -20,22 +20,22 @@ function get_browser_language() {
|
|||||||
$langs = array();
|
$langs = array();
|
||||||
|
|
||||||
if (x($_SERVER,'HTTP_ACCEPT_LANGUAGE')) {
|
if (x($_SERVER,'HTTP_ACCEPT_LANGUAGE')) {
|
||||||
// break up string into pieces (languages and q factors)
|
// break up string into pieces (languages and q factors)
|
||||||
preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i',
|
preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i',
|
||||||
$_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
|
$_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
|
||||||
|
|
||||||
if (count($lang_parse[1])) {
|
if (count($lang_parse[1])) {
|
||||||
// create a list like "en" => 0.8
|
// create a list like "en" => 0.8
|
||||||
$langs = array_combine($lang_parse[1], $lang_parse[4]);
|
$langs = array_combine($lang_parse[1], $lang_parse[4]);
|
||||||
|
|
||||||
// set default to 1 for any without q factor
|
// set default to 1 for any without q factor
|
||||||
foreach ($langs as $lang => $val) {
|
foreach ($langs as $lang => $val) {
|
||||||
if ($val === '') $langs[$lang] = 1;
|
if ($val === '') $langs[$lang] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort list based on value
|
// sort list based on value
|
||||||
arsort($langs, SORT_NUMERIC);
|
arsort($langs, SORT_NUMERIC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$langs['en'] = 1;
|
$langs['en'] = 1;
|
||||||
@ -60,7 +60,7 @@ function get_best_language() {
|
|||||||
if(isset($preferred))
|
if(isset($preferred))
|
||||||
return $preferred;
|
return $preferred;
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
return ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
|
return ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ function pop_lang() {
|
|||||||
|
|
||||||
// load string translation table for alternate language
|
// load string translation table for alternate language
|
||||||
|
|
||||||
function load_translation_table($lang) {
|
function load_translation_table($lang, $install = false) {
|
||||||
global $a;
|
global $a;
|
||||||
|
|
||||||
$a->strings = array();
|
$a->strings = array();
|
||||||
@ -107,15 +107,17 @@ function load_translation_table($lang) {
|
|||||||
include("view/$lang/strings.php");
|
include("view/$lang/strings.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
$plugins = q("SELECT name FROM addon WHERE installed=1;");
|
if(! $install) {
|
||||||
if ($plugins!==false) {
|
$plugins = q("SELECT name FROM addon WHERE installed=1;");
|
||||||
foreach($plugins as $p) {
|
if ($plugins!==false) {
|
||||||
$name = $p['name'];
|
foreach($plugins as $p) {
|
||||||
if(file_exists("addon/$name/lang/$lang/strings.php")) {
|
$name = $p['name'];
|
||||||
include("addon/$name/lang/$lang/strings.php");
|
if(file_exists("addon/$name/lang/$lang/strings.php")) {
|
||||||
}
|
include("addon/$name/lang/$lang/strings.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Allow individual strings to be over-ridden on this site
|
// Allow individual strings to be over-ridden on this site
|
||||||
// Either for the default language or for all languages
|
// Either for the default language or for all languages
|
||||||
|
@ -520,7 +520,7 @@ function import_xchan($arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for($x = 0; $x < count($xisting); $x ++) {
|
for($x = 0; $x < count($xisting); $x ++) {
|
||||||
if($xisiting[$x]['hubloc_url'] == $location['url']) {
|
if($xisting[$x]['hubloc_url'] == $location['url']) {
|
||||||
$xisting[$x]['updated'] = true;
|
$xisting[$x]['updated'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -567,10 +567,10 @@ function import_xchan($arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get rid of any hubs we have for this channel which weren't reported.
|
// get rid of any hubs we have for this channel which weren't reported.
|
||||||
|
|
||||||
if($xisting) {
|
if($xisting) {
|
||||||
foreach($xisting as $x) {
|
foreach($xisting as $x) {
|
||||||
if(! array_key_exists('updated',$x)) {
|
if(! array_key_exists('updated',$x)) {
|
||||||
|
logger('import_xchan: removing unreferenced hub location ' . $x['hubloc_url');
|
||||||
$r = q("delete from hubloc where hubloc_id = %d limit 1",
|
$r = q("delete from hubloc where hubloc_id = %d limit 1",
|
||||||
intval($x['hubloc_id'])
|
intval($x['hubloc_id'])
|
||||||
);
|
);
|
||||||
|
@ -29,7 +29,6 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
|
|||||||
|
|
||||||
$a->language = get_best_language();
|
$a->language = get_best_language();
|
||||||
|
|
||||||
load_translation_table($a->language);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -53,7 +52,15 @@ if(! $install) {
|
|||||||
require_once("session.php");
|
require_once("session.php");
|
||||||
load_hooks();
|
load_hooks();
|
||||||
call_hooks('init_1');
|
call_hooks('init_1');
|
||||||
|
|
||||||
|
load_translation_table($a->language);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// load translations but do not check plugins as we have no database
|
||||||
|
load_translation_table($a->language,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3752,3 +3752,5 @@ ul.menu-popup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.profile-match-connect { margin-top: 5px; }
|
.profile-match-connect { margin-top: 5px; }
|
||||||
|
|
||||||
|
.reshared-content { margin-left: 10px; }
|
Reference in New Issue
Block a user