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)) {
}
$s .= '<div class="clear"></div></div>';
}
+ $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 .= '<div class="categorytags"><span>' . t('Categories:') . ' </span>' . $x . '</div>';
+
+
+ }
+ $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]). ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . file_tag_decode($mtch[1]) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>';
+ }
+ if(strlen($x) && (local_user() == $item['uid']))
+ $s .= '<div class="filesavetags"><span>' . t('Filed under:') . ' </span>' . $x . '</div>';
+ }
-
$prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body_final', $prep_arr);
+
return $prep_arr['html'];
}}
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;
+ }
.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 {
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");
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");
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");
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");
margin: 50px auto auto;
display: table;
}
+
h4 {
font-size: 1.1em;
}
}
#panel {
position: absolute;
- width: 10em;
+ width: 12em;
background: #ffffff;
color: #2d2d2d;
margin: 0px;
#sidebar-group-list .tool:hover {
background: #EEE;
}
+#sidebar-pages-list .tool:hover {
+ background: #EEE;
+}
.tool .label {
float: left;
}
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,
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);
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;
float: left;
/* background: #F1F1F1; */
}
+
aside .vcard .fn {
font-size: 18px;
font-weight: bold;
widht: 55px;
height: 55px;
}
+ #lost-password-link {
+ float: left;
+ margin-right: 20px;
+ }
/* widget */
.widget {
margin-bottom: 2em;
width: 800px;
padding: 0px 0px 0px 12px;
}
+
+ body .pageheader{
+ text-align: center;
+ margin-top: 25px;
+ font-size: 0px;
+ }
+
#id_username {
width: 173px;
}
width: 173px;
}
#contact-edit-end {
-
}
.pager {
padding: 10px;
text-align: center;
font-size: 1.0em;
- margin-top: 140%;
+ clear: both;
+ display: block;
}
.tabs {
}
.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;
/* photo */
.lframe {
float: left;
- margin: 0px 10px 10px 0px;
}
/* profile match wrapper */
.profile-match-wrapper {
}
#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 {
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;
}
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;
padding: 0px 3px;
padding-top: 0.5em;
background-color: rgb(255, 255, 255);
- }
+ }*/
#photo-top-end {
clear: both;
}
#photos-upload-newalbum-div {
float: left;
width: 175px;
- }
-
+ }