Merge pull request #912 from annando/master

More compatible "Vier", more speed and problems with some parsed characters
This commit is contained in:
Tobias Diekershoff 2014-02-17 08:00:21 +01:00
commit 623bf1c4d1
5 changed files with 37 additions and 27 deletions

View file

@ -575,7 +575,11 @@ function network_content(&$a, $update = 0) {
//$sql_nets = (($nets) ? sprintf(" and `contact`.`network` = '%s' ", dbesc($nets)) : ''); //$sql_nets = (($nets) ? sprintf(" and `contact`.`network` = '%s' ", dbesc($nets)) : '');
$sql_nets = (($nets) ? sprintf(" and `item`.`network` = '%s' ", dbesc($nets)) : ''); $sql_nets = (($nets) ? sprintf(" and `item`.`network` = '%s' ", dbesc($nets)) : '');
$sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $sql_options ) "; if ($star OR $bmark) {
$sql_table = "`item` INNER JOIN (SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options and deleted = 0 ORDER BY `commented` DESC) AS `temp1` ON item.parent = `temp1`.parent ";
$sql_extra = "";
} else
$sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $sql_options ) ";
if($group) { if($group) {
$r = q("SELECT `name`, `id` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1", $r = q("SELECT `name`, `id` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",

View file

@ -40,14 +40,14 @@ function notify_content(&$a) {
return login(); return login();
$notif_tpl = get_markup_template('notifications.tpl'); $notif_tpl = get_markup_template('notifications.tpl');
$not_tpl = get_markup_template('notify.tpl'); $not_tpl = get_markup_template('notify.tpl');
require_once('include/bbcode.php'); require_once('include/bbcode.php');
$r = q("SELECT * from notify where uid = %d and seen = 0 order by date desc", $r = q("SELECT * from notify where uid = %d and seen = 0 order by date desc",
intval(local_user()) intval(local_user())
); );
if (count($r) > 0) { if (count($r) > 0) {
foreach ($r as $it) { foreach ($r as $it) {
$notif_content .= replace_macros($not_tpl,array( $notif_content .= replace_macros($not_tpl,array(
@ -60,7 +60,7 @@ function notify_content(&$a) {
} else { } else {
$notif_content .= t('No more system notifications.'); $notif_content .= t('No more system notifications.');
} }
$o .= replace_macros($notif_tpl, array( $o .= replace_macros($notif_tpl, array(
'$notif_header' => t('System Notifications'), '$notif_header' => t('System Notifications'),
'$tabs' => '', // $tabs, '$tabs' => '', // $tabs,

View file

@ -327,12 +327,14 @@ function parse_url_content(&$a) {
if($url && $title && $text) { if($url && $title && $text) {
$title = str_replace(array("\r","\n"),array('',''),$title);
if($textmode) if($textmode)
$text = '[quote]' . trim($text) . '[/quote]' . $br; $text = '[quote]' . trim($text) . '[/quote]' . $br;
else else {
$text = '<blockquote>' . trim($text) . '</blockquote><br />'; $text = '<blockquote>' . htmlspecialchars(trim($text)) . '</blockquote><br />';
$title = htmlspecialchars($title);
$title = str_replace(array("\r","\n"),array('',''),$title); }
$result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags; $result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags;
@ -381,7 +383,7 @@ function parse_url_content(&$a) {
if($textmode) if($textmode)
$text = '[quote]'.trim($text).'[/quote]'; $text = '[quote]'.trim($text).'[/quote]';
else else
$text = '<blockquote>'.trim($text).'</blockquote>'; $text = '<blockquote>'.htmlspecialchars(trim($text)).'</blockquote>';
} }
if($image) { if($image) {

View file

@ -5,7 +5,7 @@ require_once("include/datetime.php");
function ping_init(&$a) { function ping_init(&$a) {
header("Content-type: text/xml"); header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<result>"; <result>";
@ -69,7 +69,7 @@ function ping_init(&$a) {
intval(local_user()) intval(local_user())
); );
if(count($r)) { if(count($r)) {
$arr = array('items' => $r); $arr = array('items' => $r);
call_hooks('network_ping', $arr); call_hooks('network_ping', $arr);
@ -95,11 +95,11 @@ function ping_init(&$a) {
break; break;
case ACTIVITY_FRIEND: case ACTIVITY_FRIEND:
$obj = parse_xml_string($xmlhead.$it['object']); $obj = parse_xml_string($xmlhead.$it['object']);
$it['fname'] = $obj->title; $it['fname'] = $obj->title;
$friends[] = $it; $friends[] = $it;
break; break;
default: default:
if ($it['parent']!=$it['id']) { if ($it['parent']!=$it['id']) {
$comments[] = $it; $comments[] = $it;
} else { } else {
if(! $it['wall']) if(! $it['wall'])
@ -121,7 +121,7 @@ function ping_init(&$a) {
WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 AND `intro`.`contact-id`!=0", WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 AND `intro`.`contact-id`!=0",
intval(local_user()) intval(local_user())
); );
$intro = count($intros1) + count($intros2); $intro = count($intros1) + count($intros2);
$intros = $intros1+$intros2; $intros = $intros1+$intros2;
@ -135,7 +135,7 @@ function ping_init(&$a) {
); );
if($mails) if($mails)
$mail = $mails[0]['total']; $mail = $mails[0]['total'];
if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){ if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){
$regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1");
if($regs) if($regs)
@ -195,7 +195,7 @@ function ping_init(&$a) {
xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($seen), xmlify($message) xmlify($href), xmlify($name), xmlify($url), xmlify($photo), xmlify($date), xmlify($seen), xmlify($message)
); );
} }
echo "<intro>$intro</intro> echo "<intro>$intro</intro>
<mail>$mail</mail> <mail>$mail</mail>
<net>$network</net> <net>$network</net>
@ -208,7 +208,7 @@ function ping_init(&$a) {
<events-today>$events_today</events-today> <events-today>$events_today</events-today>
<birthdays>$birthdays</birthdays> <birthdays>$birthdays</birthdays>
<birthdays-today>$birthdays_today</birthdays-today>\r\n"; <birthdays-today>$birthdays_today</birthdays-today>\r\n";
$tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags); $tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags);
require_once('include/bbcode.php'); require_once('include/bbcode.php');
@ -222,7 +222,7 @@ function ping_init(&$a) {
if($zz['seen'] == 0) if($zz['seen'] == 0)
$sysnotify ++; $sysnotify ++;
} }
} }
echo ' <notif count="'. $sysnotify .'">'; echo ' <notif count="'. $sysnotify .'">';
if(count($z)) { if(count($z)) {
@ -234,7 +234,7 @@ function ping_init(&$a) {
if($firehose) { if($firehose) {
if ($intro>0){ if ($intro>0){
foreach ($intros as $i) { foreach ($intros as $i) {
echo xmlize( $a->get_baseurl().'/notifications/intros/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), 'notify-unseen',t("{0} wants to be your friend") ); echo xmlize( $a->get_baseurl().'/notifications/intros/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), 'notify-unseen',t("{0} wants to be your friend") );
}; };
} }

View file

@ -887,6 +887,7 @@ aside {
line-height: 17px; line-height: 17px;
position: fixed; position: fixed;
/* overflow: auto; */ /* overflow: auto; */
height: 100%;
height: calc(100% - 42px); height: calc(100% - 42px);
/* overflow: scroll; */ /* overflow: scroll; */
box-shadow: 1px 1px 6px -3px #666; box-shadow: 1px 1px 6px -3px #666;
@ -1102,7 +1103,7 @@ section {
border-right: 1px solid lightgray; border-right: 1px solid lightgray;
border-left: 1px solid lightgray; */ border-left: 1px solid lightgray; */
position: absolute; position: absolute;
/*left: 215px;*/ left: 215px;
left: calc(215px + (100% - (215px + 766px)) / 6); left: calc(215px + (100% - (215px + 766px)) / 6);
/* left: calc(215px + (100% - 215px) / 10); */ /* left: calc(215px + (100% - 215px) / 10); */
} }
@ -1125,7 +1126,7 @@ border-bottom: 1px solid #D2D2D2;
} }
.wall-item-decor { .wall-item-decor {
position: absolute; position: absolute;
/* left: 755px; */ left: 755px;
left: calc(100% - 7px); left: calc(100% - 7px);
/* top: -10px; */ /* top: -10px; */
width: 16px; width: 16px;
@ -1135,7 +1136,7 @@ border-bottom: 1px solid #D2D2D2;
} }
.wall-item-container { .wall-item-container {
display: table; display: table;
/* width: 745px; */ width: 745px;
width: calc(100% - 10px); width: calc(100% - 10px);
} }
@ -1351,7 +1352,7 @@ border-bottom: 1px solid #D2D2D2;
margin-top: 5px; margin-top: 5px;
margin-bottom: 5px; margin-bottom: 5px;
margin-left: 80px; margin-left: 80px;
/* width: 665px; */ width: 665px;
width: calc(100% - 90px); width: calc(100% - 90px);
border-bottom: 1px solid hsl(198, 21%, 79%); border-bottom: 1px solid hsl(198, 21%, 79%);
} }
@ -1410,7 +1411,8 @@ border-bottom: 1px solid #D2D2D2;
} }
.comment-edit-preview { .comment-edit-preview {
width: 660px; /* width: 660px; */
width: 100%;
border: 1px solid #2d2d2d; border: 1px solid #2d2d2d;
margin-top: 10px; margin-top: 10px;
top: 15px !important; top: 15px !important;
@ -1420,10 +1422,12 @@ border-bottom: 1px solid #D2D2D2;
padding-left: 12px; padding-left: 12px;
} }
.comment-edit-preview .wall-item-container { .comment-edit-preview .wall-item-container {
width: 700px; /* width: 700px; */
width: 100%;
} }
.comment-edit-preview .tread-wrapper { .comment-edit-preview .tread-wrapper {
width: 700px; /* width: 700px; */
width: 100%;
padding: 0; padding: 0;
margin: 10px 0; margin: 10px 0;
border-bottom: 0px; border-bottom: 0px;
@ -1480,7 +1484,7 @@ border-bottom: 1px solid #D2D2D2;
#profile-jot-form #profile-jot-text { #profile-jot-form #profile-jot-text {
height: 2.0em; height: 2.0em;
/* width: 99%; */ /* width: 99%; */
/* width: 752px; */ width: 752px;
width: calc(100% - 10px); width: calc(100% - 10px);
font-size: 15px; font-size: 15px;
color: #999999; color: #999999;