aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/diabook
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-22 20:19:44 -0700
committerfriendica <info@friendica.com>2012-03-22 20:19:44 -0700
commit42d231f8bfc55c3bce66bee7902fe4ec2a5e5041 (patch)
treed41c4e7a99583c808d226c126caf44800e89e0c3 /view/theme/diabook
parent528d795fb68a8ae53cb7b9ad8479aeaa2b1f975f (diff)
parentbf4dd8ad1701c79a3de097b2792fa8ae2fc673b4 (diff)
downloadvolse-hubzilla-42d231f8bfc55c3bce66bee7902fe4ec2a5e5041.tar.gz
volse-hubzilla-42d231f8bfc55c3bce66bee7902fe4ec2a5e5041.tar.bz2
volse-hubzilla-42d231f8bfc55c3bce66bee7902fe4ec2a5e5041.zip
Merge pull request #158 from tomtom84/master
add right_aside to theme diabook ... need author
Diffstat (limited to 'view/theme/diabook')
-rwxr-xr-xview/theme/diabook/communityhome.tpl42
-rwxr-xr-xview/theme/diabook/directory_item.tpl10
-rw-r--r--view/theme/diabook/right_aside.tpl20
-rw-r--r--view/theme/diabook/style.css31
-rwxr-xr-xview/theme/diabook/theme.php234
5 files changed, 327 insertions, 10 deletions
diff --git a/view/theme/diabook/communityhome.tpl b/view/theme/diabook/communityhome.tpl
new file mode 100755
index 000000000..876276ca8
--- /dev/null
+++ b/view/theme/diabook/communityhome.tpl
@@ -0,0 +1,42 @@
+{{ if $lastusers_title }}
+<h3 style="margin-top:0px;">Help or #Newhere?</h3>
+<a href="https://helpers.pyxis.uberspace.de/profile/helpers" style="margin-left: 10px; color:#000;" title="Friendica Support" target="blank">Friendica Support</a><br>
+<a href="https://letstalk.pyxis.uberspace.de/profile/letstalk" style="margin-left: 10px; color:#000;" title="Let's talk" target="blank">Let's talk</a><br>
+<a href="http://kakste.com/profile/newhere" title="#NewHere" style="margin-left: 10px; color:#000;" target="blank">NewHere</a>
+{{ endif }}
+{{ if $lastusers_title }}
+<h3>$lastusers_title</h3>
+<div class='items-wrapper'>
+{{ for $lastusers_items as $i }}
+ $i
+{{ endfor }}
+</div>
+{{ endif }}
+
+{{ if $activeusers_title }}
+<h3>$activeusers_title</h3>
+<div class='items-wrapper'>
+{{ for $activeusers_items as $i }}
+ $i
+{{ endfor }}
+</div>
+{{ endif }}
+
+{{ if $photos_title }}
+<h3>$photos_title</h3>
+<div class='items-wrapper'>
+{{ for $photos_items as $i }}
+ $i
+{{ endfor }}
+</div>
+{{ endif }}
+
+
+{{ if $like_title }}
+<h3>$like_title</h3>
+<ul id='likes'>
+{{ for $like_items as $i }}
+ <li>$i</li>
+{{ endfor }}
+</ul>
+{{ endif }}
diff --git a/view/theme/diabook/directory_item.tpl b/view/theme/diabook/directory_item.tpl
new file mode 100755
index 000000000..db1936e4b
--- /dev/null
+++ b/view/theme/diabook/directory_item.tpl
@@ -0,0 +1,10 @@
+
+<div class="directory-item" id="directory-item-$id" >
+ <div class="directory-photo-wrapper" id="directory-photo-wrapper-$id" >
+ <div class="directory-photo" id="directory-photo-$id" >
+ <a href="$profile-link" class="directory-profile-link" id="directory-profile-link-$id" >
+ <img class="directory-photo-img" src="$photo" alt="$alt-text" title="$alt-text" />
+ </a>
+ </div>
+ </div>
+</div>
diff --git a/view/theme/diabook/right_aside.tpl b/view/theme/diabook/right_aside.tpl
new file mode 100644
index 000000000..a65677696
--- /dev/null
+++ b/view/theme/diabook/right_aside.tpl
@@ -0,0 +1,20 @@
+<div id="profile_side">
+ <div id="ps-usernameicon">
+ <a href="$ps.usermenu.status.0" title="$userinfo.name">
+ <img src="$userinfo.icon" id="ps-usericon" alt="$userinfo.name">
+ </a>
+ <a href="$ps.usermenu.status.0" id="ps-username" title="$userinfo.name">$userinfo.name</a>
+ </div>
+
+<ul id="profile-side-menu" class="menu-profile-side">
+ <li id="profile-side-status" class="menu-profile-list home"><a class="menu-profile-list-item" href="$ps.usermenu.status.0">$ps.usermenu.status.1</a></li>
+ <li id="profile-side-photos" class="menu-profile-list photos"><a class="menu-profile-list-item" href="$ps.usermenu.photos.0">$ps.usermenu.photos.1</a></li>
+ <li id="profile-side-events" class="menu-profile-list events"><a class="menu-profile-list-item" href="$ps.usermenu.events.0">$ps.usermenu.events.1</a></li>
+ <li id="profile-side-notes" class="menu-profile-list notes"><a class="menu-profile-list-item" href="$ps.usermenu.notes.0">$ps.usermenu.notes.1</a></li>
+ <li id="profile-side-foren" class="menu-profile-list foren"><a class="menu-profile-list-item" href="http://dir.friendika.com/directory/forum" target="blanc">Public Groups</a></li>
+ <li id="profile-side-foren" class="menu-profile-list com_side"><a class="menu-profile-list-item" href="$ps.usermenu.community.0">$ps.usermenu.community.1</a></li>
+</ul>
+
+</div>
+
+ \ No newline at end of file
diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css
index 5841a96b3..f7dab9ef0 100644
--- a/view/theme/diabook/style.css
+++ b/view/theme/diabook/style.css
@@ -385,7 +385,7 @@
.hide-comments-outer {
margin-left: 80px;
margin-bottom: 5px;
- width: 684px;
+ width: 484px;
border-bottom: 1px solid #BDCDD4;
border-top: 1px solid #BDCDD4;
@@ -1096,8 +1096,8 @@ aside #side-peoplefind-url {
section {
display: table-cell;
vertical-align: top;
- width: 800px;
- padding: 0px 0px 0px 12px;
+ width: auto;
+ padding: 0px 12px 0px 12px;
}
body .pageheader{
@@ -1145,13 +1145,30 @@ body .pageheader{
#birthday-notice, #event-notice, #birthday-wrapper, #event-wrapper{
margin-bottom: 10px;
}
+
+right_aside {
+ display: table-cell;
+ vertical-align: top;
+ width: 180px;
+ /*border-left: 1px solid #D2D2D2;*/
+
+ /* background: #F1F1F1; */
+}
+right_aside h3 {border-bottom: 1px solid #D2D2D2; padding-top: 5px; padding-bottom: 0px; padding-left: 5px; margin-bottom: 0px;
+margin-top:30px;}
+right_aside .directory-item { width: 55px; height: 55px; vertical-align: center; text-align: center; }
+right_aside .directory-photo { margin: 0px; }
+right_aside .directory-photo-img { max-width: 48px; max-height: 48px; }
+right_aside #likes { margin: 0px; padding: 0px; list-style: none; }
+right_aside .items-wrapper{ overflow: auto; width: 100%; border-bottom: 1px solid #D2D2D2;}
+
/* wall item */
.tread-wrapper {
border-bottom: 1px solid #D2D2D2;
position: relative;
padding: 5px;
margin-bottom: 0px;
- width: 775px;
+ width: 575px;
}
.wall-item-decor {
position: absolute;
@@ -1162,7 +1179,7 @@ body .pageheader{
.wall-item-container {
display: table;
- width: 780px;
+ width: 580px;
}
@@ -1275,7 +1292,7 @@ body .pageheader{
margin-top: 5px;
margin-bottom: 5px;
margin-left: 80px;
- width: 700px;
+ width: 500px;
border-bottom: 1px solid hsl(198, 21%, 79%);
}
.wall-item-container.comment .contact-photo {
@@ -1591,7 +1608,7 @@ body .pageheader{
}
#profile-jot-wrapper{
margin: 0 2em 20px 0;
- width: 785px;
+ width: 585px;
}
#profile-jot-submit-wrapper {
diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php
index 39479ce52..25808d7e9 100755
--- a/view/theme/diabook/theme.php
+++ b/view/theme/diabook/theme.php
@@ -11,9 +11,10 @@ $a->theme_info = array(
'extends' => 'diabook',
);
-//profile_side
-
+//profile_side at networkpages
+if($is_url = preg_match ("/\bnetwork\b/i", $_SERVER['REQUEST_URI'])) {
+//
$nav['usermenu']=array();
$userinfo = null;
@@ -36,14 +37,241 @@ $ps['usermenu'][events] = Array('events/', t('Events'), "", t('Your events'));
$ps['usermenu'][notes] = Array('notes/', t('Personal notes'), "", t('Your personal photos'));
$ps['usermenu'][community] = Array('community/', t('Community'), "", "");
-if($is_url = preg_match ("/\bnetwork\b/i", $_SERVER['REQUEST_URI'])) {
+
$tpl = get_markup_template('profile_side.tpl');
$a->page['aside'] .= replace_macros($tpl, array(
'$userinfo' => $userinfo,
'$ps' => $ps,
));
+
}
+
+//right_aside at networkpages
+
+// last 12 users
+ $aside['$lastusers_title'] = t('Last users');
+ $aside['$lastusers_items'] = array();
+ $sql_extra = "";
+ $publish = (get_config('system','publish_all') ? '' : " AND `publish` = 1 " );
+ $order = " ORDER BY `register_date` DESC ";
+
+ $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`
+ FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
+ WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
+ 0,
+ 12
+ );
+ $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+ if(count($r)) {
+ $photo = 'thumb';
+ foreach($r as $rr) {
+ $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
+ $entry = replace_macros($tpl,array(
+ '$id' => $rr['id'],
+ '$profile-link' => $profile_link,
+ '$photo' => $rr[$photo],
+ '$alt-text' => $rr['name'],
+ ));
+ $aside['$lastusers_items'][] = $entry;
+ }
+ }
+
+// last 10 liked items
+ $aside['$like_title'] = t('Last likes');
+ $aside['$like_items'] = array();
+ $r = q("SELECT `T1`.`created`, `T1`.`liker`, `T1`.`liker-link`, `item`.* FROM
+ (SELECT `parent-uri`, `created`, `author-name` AS `liker`,`author-link` AS `liker-link`
+ FROM `item` WHERE `verb`='http://activitystrea.ms/schema/1.0/like' GROUP BY `parent-uri` ORDER BY `created` DESC) AS T1
+ INNER JOIN `item` ON `item`.`uri`=`T1`.`parent-uri`
+ WHERE `T1`.`liker-link` LIKE '%s%%' OR `item`.`author-link` LIKE '%s%%'
+ GROUP BY `uri`
+ ORDER BY `T1`.`created` DESC
+ LIMIT 0,10",
+ $a->get_baseurl(),$a->get_baseurl()
+ );
+
+ foreach ($r as $rr) {
+ $author = '<a href="' . $rr['liker-link'] . '">' . $rr['liker'] . '</a>';
+ $objauthor = '<a href="' . $rr['author-link'] . '">' . $rr['author-name'] . '</a>';
+
+ //var_dump($rr['verb'],$rr['object-type']); killme();
+ switch($rr['verb']){
+ case 'http://activitystrea.ms/schema/1.0/post':
+ switch ($rr['object-type']){
+ case 'http://activitystrea.ms/schema/1.0/event':
+ $post_type = t('event');
+ break;
+ default:
+ $post_type = t('status');
+ }
+ break;
+ default:
+ if ($rr['resource-id']){
+ $post_type = t('photo');
+ $m=array(); preg_match("/\[url=([^]]*)\]/", $rr['body'], $m);
+ $rr['plink'] = $m[1];
+ } else {
+ $post_type = t('status');
+ }
+ }
+ $plink = '<a href="' . $rr['plink'] . '">' . $post_type . '</a>';
+
+ $aside['$like_items'][] = sprintf( t('%1$s likes %2$s\'s %3$s'), $author, $objauthor, $plink);
+
+ }
+// last 12 photos
+ $aside['$photos_title'] = t('Last photos');
+ $aside['$photos_items'] = array();
+ $r = q("SELECT `photo`.`id`, `photo`.`resource-id`, `photo`.`scale`, `photo`.`desc`, `user`.`nickname`, `user`.`username` FROM
+ (SELECT `resource-id`, MAX(`scale`) as maxscale FROM `photo`
+ WHERE `profile`=0 AND `contact-id`=0 AND `album` NOT IN ('Contact Photos', '%s', 'Profile Photos', '%s')
+ AND `allow_cid`='' AND `allow_gid`='' AND `deny_cid`='' AND `deny_gid`='' GROUP BY `resource-id`) AS `t1`
+ INNER JOIN `photo` ON `photo`.`resource-id`=`t1`.`resource-id` AND `photo`.`scale` = `t1`.`maxscale`,
+ `user`
+ WHERE `user`.`uid` = `photo`.`uid`
+ AND `user`.`blockwall`=0
+ ORDER BY `photo`.`edited` DESC
+ LIMIT 0, 12",
+ dbesc(t('Contact Photos')),
+ dbesc(t('Profile Photos'))
+ );
+ if(count($r)) {
+ $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+ foreach($r as $rr) {
+ $photo_page = $a->get_baseurl() . '/photos/' . $rr['nickname'] . '/image/' . $rr['resource-id'];
+ $photo_url = $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] .'.jpg';
+
+ $entry = replace_macros($tpl,array(
+ '$id' => $rr['id'],
+ '$profile-link' => $photo_page,
+ '$photo' => $photo_url,
+ '$alt-text' => $rr['username']." : ".$rr['desc'],
+ ));
+
+ $aside['$photos_items'][] = $entry;
+ }
+ }
+
+
+ $tpl = file_get_contents(dirname(__file__).'/communityhome.tpl');
+ $a->page['right_aside'] = replace_macros($tpl, $aside);
+
+}
+
+//right_aside at profile pages
+
+if($is_url = preg_match ("/\bprofile\b/i", $_SERVER['REQUEST_URI'])) {
+//right_aside
+
+// last 12 users
+ $aside['$lastusers_title'] = t('Last users');
+ $aside['$lastusers_items'] = array();
+ $sql_extra = "";
+ $publish = (get_config('system','publish_all') ? '' : " AND `publish` = 1 " );
+ $order = " ORDER BY `register_date` DESC ";
+
+ $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`
+ FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
+ WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
+ 0,
+ 12
+ );
+ $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+ if(count($r)) {
+ $photo = 'thumb';
+ foreach($r as $rr) {
+ $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
+ $entry = replace_macros($tpl,array(
+ '$id' => $rr['id'],
+ '$profile-link' => $profile_link,
+ '$photo' => $rr[$photo],
+ '$alt-text' => $rr['name'],
+ ));
+ $aside['$lastusers_items'][] = $entry;
+ }
+ }
+
+// last 10 liked items
+ $aside['$like_title'] = t('Last likes');
+ $aside['$like_items'] = array();
+ $r = q("SELECT `T1`.`created`, `T1`.`liker`, `T1`.`liker-link`, `item`.* FROM
+ (SELECT `parent-uri`, `created`, `author-name` AS `liker`,`author-link` AS `liker-link`
+ FROM `item` WHERE `verb`='http://activitystrea.ms/schema/1.0/like' GROUP BY `parent-uri` ORDER BY `created` DESC) AS T1
+ INNER JOIN `item` ON `item`.`uri`=`T1`.`parent-uri`
+ WHERE `T1`.`liker-link` LIKE '%s%%' OR `item`.`author-link` LIKE '%s%%'
+ GROUP BY `uri`
+ ORDER BY `T1`.`created` DESC
+ LIMIT 0,10",
+ $a->get_baseurl(),$a->get_baseurl()
+ );
+
+ foreach ($r as $rr) {
+ $author = '<a href="' . $rr['liker-link'] . '">' . $rr['liker'] . '</a>';
+ $objauthor = '<a href="' . $rr['author-link'] . '">' . $rr['author-name'] . '</a>';
+
+ //var_dump($rr['verb'],$rr['object-type']); killme();
+ switch($rr['verb']){
+ case 'http://activitystrea.ms/schema/1.0/post':
+ switch ($rr['object-type']){
+ case 'http://activitystrea.ms/schema/1.0/event':
+ $post_type = t('event');
+ break;
+ default:
+ $post_type = t('status');
+ }
+ break;
+ default:
+ if ($rr['resource-id']){
+ $post_type = t('photo');
+ $m=array(); preg_match("/\[url=([^]]*)\]/", $rr['body'], $m);
+ $rr['plink'] = $m[1];
+ } else {
+ $post_type = t('status');
+ }
+ }
+ $plink = '<a href="' . $rr['plink'] . '">' . $post_type . '</a>';
+
+ $aside['$like_items'][] = sprintf( t('%1$s likes %2$s\'s %3$s'), $author, $objauthor, $plink);
+
+ }
+// last 12 photos
+ $aside['$photos_title'] = t('Last photos');
+ $aside['$photos_items'] = array();
+ $r = q("SELECT `photo`.`id`, `photo`.`resource-id`, `photo`.`scale`, `photo`.`desc`, `user`.`nickname`, `user`.`username` FROM
+ (SELECT `resource-id`, MAX(`scale`) as maxscale FROM `photo`
+ WHERE `profile`=0 AND `contact-id`=0 AND `album` NOT IN ('Contact Photos', '%s', 'Profile Photos', '%s')
+ AND `allow_cid`='' AND `allow_gid`='' AND `deny_cid`='' AND `deny_gid`='' GROUP BY `resource-id`) AS `t1`
+ INNER JOIN `photo` ON `photo`.`resource-id`=`t1`.`resource-id` AND `photo`.`scale` = `t1`.`maxscale`,
+ `user`
+ WHERE `user`.`uid` = `photo`.`uid`
+ AND `user`.`blockwall`=0
+ ORDER BY `photo`.`edited` DESC
+ LIMIT 0, 12",
+ dbesc(t('Contact Photos')),
+ dbesc(t('Profile Photos'))
+ );
+ if(count($r)) {
+ $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+ foreach($r as $rr) {
+ $photo_page = $a->get_baseurl() . '/photos/' . $rr['nickname'] . '/image/' . $rr['resource-id'];
+ $photo_url = $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] .'.jpg';
+
+ $entry = replace_macros($tpl,array(
+ '$id' => $rr['id'],
+ '$profile-link' => $photo_page,
+ '$photo' => $photo_url,
+ '$alt-text' => $rr['username']." : ".$rr['desc'],
+ ));
+
+ $aside['$photos_items'][] = $entry;
+ }
+ }
+
+
+ $tpl = file_get_contents(dirname(__file__).'/communityhome.tpl');
+ $a->page['right_aside'] = replace_macros($tpl, $aside);
+
}
//js scripts