From: Michael Vogel Date: Thu, 15 Mar 2012 20:11:58 +0000 (+0100) Subject: Merge commit 'upstream/master' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9243c9fc141237453f05d215058d4b975d010437;hp=-c;p=friendica.git Merge commit 'upstream/master' --- 9243c9fc141237453f05d215058d4b975d010437 diff --combined include/text.php index 08c5a54246,199460d2cf..d34fd7fbee --- a/include/text.php +++ b/include/text.php @@@ -874,29 -874,17 +874,30 @@@ function link_compare($a,$b) if(! function_exists('prepare_body')) { function prepare_body($item,$attach = false) { + $a = get_app(); call_hooks('prepare_body_init', $item); - $s = prepare_text($item['body']); + $cache = get_config('system','itemcache'); + + if (($cache != '')) { + $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body']); + + if (file_exists($cachefile)) + $s = file_get_contents($cachefile); + else { + $s = prepare_text($item['body']); + file_put_contents($cachefile, $s); + } + } else + $s = prepare_text($item['body']); $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body', $prep_arr); $s = $prep_arr['html']; - if(! $attach) + if(! $attach) { return $s; + } $arr = explode(',',$item['attach']); if(count($arr)) { @@@ -926,10 -914,37 +927,37 @@@ } $s .= '
'; } + $matches = false; + $cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER); + if($cnt) { + // logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG); + foreach($matches as $mtch) { + if(strlen($x)) + $x .= ','; + $x .= file_tag_decode($mtch[1]); + } + if(strlen($x)) + $s .= '
' . t('Categories:') . ' ' . $x . '
'; + + + } + $matches = false; + $x = ''; + $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER); + if($cnt) { + // logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG); + foreach($matches as $mtch) { + if(strlen($x)) + $x .= '   '; + $x .= file_tag_decode($mtch[1]). ' ' . t('[remove]') . ''; + } + if(strlen($x) && (local_user() == $item['uid'])) + $s .= '
' . t('Filed under:') . ' ' . $x . '
'; + } - $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body_final', $prep_arr); + return $prep_arr['html']; }} @@@ -1248,4 -1263,77 +1276,77 @@@ function item_post_type($item) return t('post'); } + // post categories and "save to file" use the same item.file table for storage. + // We will differentiate the different uses by wrapping categories in angle brackets + // and save to file categories in square brackets. + // To do this we need to escape these characters if they appear in our tag. + + function file_tag_encode($s) { + return str_replace(array('<','>','[',']'),array('%3c','%3e','%5b','%5d'),$s); + } + + function file_tag_decode($s) { + return str_replace(array('%3c','%3e','%5b','%5d'),array('<','>','[',']'),$s); + } + + function file_tag_file_query($table,$s,$type = 'file') { + if($type == 'file') + $str = preg_quote( '[' . file_tag_encode($s) . ']' ); + else + $str = preg_quote( '<' . file_tag_encode($s) . '>' ); + return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' "; + } + + function file_tag_save_file($uid,$item,$file) { + $result = false; + if(! intval($uid)) + return false; + $r = q("select file from item where id = %d and uid = %d limit 1", + intval($item), + intval($uid) + ); + if(count($r)) { + if(! stristr($r[0]['file'],'[' . file_tag_encode($file) . ']')) + q("update item set file = '%s' where id = %d and uid = %d limit 1", + dbesc($r[0]['file'] . '[' . file_tag_encode($file) . ']'), + intval($item), + intval($uid) + ); + $saved = get_pconfig($uid,'system','filetags'); + if((! strlen($saved)) || (! stristr($saved,'[' . file_tag_encode($file) . ']'))) + set_pconfig($uid,'system','filetags',$saved . '[' . file_tag_encode($file) . ']'); + } + return true; + } + + function file_tag_unsave_file($uid,$item,$file) { + $result = false; + if(! intval($uid)) + return false; + + $pattern = '[' . file_tag_encode($file) . ']' ; + + $r = q("select file from item where id = %d and uid = %d limit 1", + intval($item), + intval($uid) + ); + if(! count($r)) + return false; + + q("update item set file = '%s' where id = %d and uid = %d limit 1", + dbesc(str_replace($pattern,'',$r[0]['file'])), + intval($item), + intval($uid) + ); + + $r = q("select file from item where uid = %d " . file_tag_file_query('item',$file), + intval($uid) + ); + + if(! count($r)) { + $saved = get_pconfig($uid,'system','filetags'); + set_pconfig($uid,'system','filetags',str_replace($pattern,'',$saved)); + } + return true; + } diff --combined view/theme/diabook/style.css index c9be0111d5,437f323faa..b7568631ff --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@@ -177,8 -177,8 +177,8 @@@ .icon.on { background-image: url("../../../view/theme/diabook/icons/toogle_on.png"); background-repeat: no-repeat;} .icon.off { background-image: url("../../../view/theme/diabook/icons/toogle_off.png"); background-repeat: no-repeat;} - .prev { background-position: -90px -60px;} - .next { background-position: -110px -60px;} + .icon.prev { background-image: url("../../../view/theme/diabook/icons/prev.png"); background-repeat: no-repeat;} + .icon.next { background-image: url("../../../view/theme/diabook/icons/next.png"); background-repeat: no-repeat;} /*.tagged { background-position: -130px -60px;}*/ .attachtype { @@@ -247,7 -247,7 +247,7 @@@ background-image: url("../../../images/icons/10/edit.png"); } .icon.s10.star { - background-image: url("../../../images/icons/10/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s10.menu { background-image: url("../../../images/icons/10/menu.png"); @@@ -285,7 -285,7 +285,7 @@@ background-image: url("../../../images/icons/16/edit.png"); }*/ .icon.s16.star { - background-image: url("../../../images/icons/16/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s16.menu { background-image: url("../../../images/icons/16/menu.png"); @@@ -323,7 -323,7 +323,7 @@@ background-image: url("../../../images/icons/22/edit.png"); } .icon.s22.star { - background-image: url("../../../images/icons/22/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s22.menu { background-image: url("../../../images/icons/22/menu.png"); @@@ -361,7 -361,7 +361,7 @@@ background-image: url("../../../images/icons/48/edit.png"); } .icon.s48.star { - background-image: url("../../../images/icons/48/star.png"); + background-image: url("../../../images/star_dummy.png"); } .icon.s48.menu { background-image: url("../../../images/icons/48/menu.png"); @@@ -400,6 -400,7 +400,7 @@@ body margin: 50px auto auto; display: table; } + h4 { font-size: 1.1em; } @@@ -461,7 -462,7 +462,7 @@@ code } #panel { position: absolute; - width: 10em; + width: 12em; background: #ffffff; color: #2d2d2d; margin: 0px; @@@ -484,9 -485,6 +485,9 @@@ #sidebar-group-list .tool:hover { background: #EEE; } +#sidebar-pages-list .tool:hover { + background: #EEE; +} .tool .label { float: left; } @@@ -707,21 -705,17 +708,17 @@@ nav #nav-user-linkmen nav #nav-user-linkmenu{ margin-right: 0px; } - nav #nav-home-link{ + nav #nav-home-link, #nav-directory-link, #nav-apps-link{ margin-left: 0px; + margin-right: 0px; font-weight: bold; + margin: 3px 5px; } nav #nav-directory-link{ - margin-left: 0px; - margin-right: 0px; - font-weight: bold; - margin: 3px 15px; + margin-right: 0px; } - nav #nav-apps-link{ - margin-left: 0px; - margin-right: 0px; - font-weight: bold; - margin: 3px 15px; + nav #nav-home-link{ + margin-left: 0px; } nav #nav-help-link .menu-popup, nav #nav-search-link .menu-popup, @@@ -775,8 -769,6 +772,6 @@@ ul.menu-popup margin: 0px; padding: 0px; list-style: none; - border: 1px solid #364e59; - border-top-color: transparent; z-index: 100000; -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); -moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); @@@ -869,6 -861,43 +864,43 @@@ ul.menu-popup .empty padding: 7px 7px 0px 0px; } + /*profile_side*/ + #profile_side { + margin-bottom: 30px; + } + #ps-usericon{ + height: 25px + } + #ps-username{ + font-size: 1.17em; + font-weight: bold; + vertical-align: top; + position: absolute; + padding-top: 4px; + padding-left: 5px; + color: #2D2D2D; + } + #ps-username:hover{ + text-decoration: none; + } + .menu-profile-side{ + list-style: none; + padding-left: 16px; + min-height: 16px; + } + .menu-profile-list{ + height: auto; + overflow: auto; + padding-top: 3px; + padding-bottom: 3px; + } + .menu-profile-list:hover{ + background: #EEE; + } + .menu-profile-list-item:hover{ + text-decoration: none; + } + /* aside */ aside { display: table-cell; @@@ -879,6 -908,7 +911,7 @@@ float: left; /* background: #F1F1F1; */ } + aside .vcard .fn { font-size: 18px; font-weight: bold; @@@ -965,6 -995,10 +998,10 @@@ aside #side-peoplefind-url widht: 55px; height: 55px; } + #lost-password-link { + float: left; + margin-right: 20px; + } /* widget */ .widget { margin-bottom: 2em; @@@ -1039,6 -1073,13 +1076,13 @@@ section width: 800px; padding: 0px 0px 0px 12px; } + + body .pageheader{ + text-align: center; + margin-top: 25px; + font-size: 0px; + } + #id_username { width: 173px; } @@@ -1049,13 -1090,13 +1093,13 @@@ width: 173px; } #contact-edit-end { - } .pager { padding: 10px; text-align: center; font-size: 1.0em; - margin-top: 140%; + clear: both; + display: block; } .tabs { @@@ -1293,14 -1334,14 +1337,14 @@@ } .tag { /*background: url("../../../images/tag_b.png") repeat-x center left;*/ - color: #3465A4; + color: #999; padding-left: 3px; font-size: 12px; } .tag a { padding-right: 5px; /*background: url("../../../images/tag.png") no-repeat center right;*/ - color: #3465A4; + color: #999; } .wwto { position: absolute !important; @@@ -1861,7 -1902,6 +1905,6 @@@ ul.tabs li .active /* photo */ .lframe { float: left; - margin: 0px 10px 10px 0px; } /* profile match wrapper */ .profile-match-wrapper { @@@ -1975,10 -2015,22 +2018,22 @@@ box-shadow: 1px 1px 5px 0 } #prvmail-submit { - float: left; + float: right; margin-top: 10px; - margin-right: 30px; } + #prvmail-subject + { + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #CCCCCC; + border-radius: 5px 5px 5px 5px; + font-weight: bold; + height: 20px; + margin: 0 0 5px; + vertical-align: middle; + } + #prvmail-form{ + width: 597px; + } #prvmail-upload-wrapper, #prvmail-link-wrapper, #prvmail-rotator-wrapper { @@@ -2166,14 -2218,25 +2221,25 @@@ a.mail-list-link padding: 10px; float: left; } + .lightbox{ + float: left; + } #photo-photo { float: left; } #photo-like-div .wall-item-like-buttons { - float: left; - margin-right: 10px; + float: left; + margin-right: 5px; + margin-top: 30px; } + .comment-edit-text-empty { + margin: 10px 0 0; + width: 85%; + } + .comment-edit-photo { + margin: 10px 0 0; + } .wall-item-like-buttons .icon.like { float: left; } @@@ -2286,7 -2349,36 +2352,36 @@@ color: #999999; } - .photo-top-image-wrapper { + #side-bar-photos-albums{ + margin-top: 15px; + } + .photo-top-photo, .photo-album-photo { + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; + } + .photo-album-image-wrapper, .photo-top-image-wrapper { + float: left; + -moz-box-shadow: 0 0 5px #888; + -webkit-box-shadow: 0 0 5px #888; + box-shadow: 0 0 5px #888; + background-color: #EEE; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding-bottom: 20px; + position: relative; + margin: 0 10px 10px 0; + } + .photo-top-album-name { + position: absolute; + bottom: 0; + padding: 0 5px; + } + .photo-top-album-link{ + color: #1872A2; + } + /*.photo-top-image-wrapper { position: relative; float: left; margin-top: 15px; @@@ -2302,7 -2394,7 +2397,7 @@@ padding: 0px 3px; padding-top: 0.5em; background-color: rgb(255, 255, 255); - } + }*/ #photo-top-end { clear: both; } @@@ -2315,5 -2407,4 +2410,4 @@@ #photos-upload-newalbum-div { float: left; width: 175px; - } - + }