1
0
Fork 0

Merge branch 'master', remote-tracking branch 'remotes/upstream/master'

* remotes/upstream/master:
  diabook-themes: add "community profiles"-box to right_column
  change api.php in function api_item_get_user to check if $usercache is NULL before checking an element in it
  make 'aaa joined group bbb' work from the initiating end, new privacy pref to control it also hidewall wasn't properly checked before sending 'xxx is friends with yyy' messages
  diabook-themes: add "last tweets"-box to right_aside, that searches for #friendica on twitter
  rev update
  start adding tooltips to tab menus
  fix join group notifications

* master:
This commit is contained in:
Simon L'nu 2012-05-01 00:49:42 -04:00
commit 46558e98a8
34 changed files with 1044 additions and 465 deletions

View file

@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '2.3.1327' );
define ( 'FRIENDICA_VERSION', '2.3.1328' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1140 );
@ -1472,16 +1472,19 @@ if(! function_exists('profile_tabs')){
'label'=>t('Status'),
'url' => $url,
'sel' => ((!isset($tab)&&$a->argv[0]=='profile')?'active':''),
'title' => t('Status Messages and Posts'),
),
array(
'label' => t('Profile'),
'url' => $url.'/?tab=profile',
'sel' => ((isset($tab) && $tab=='profile')?'active':''),
'title' => t('Profile Details'),
),
array(
'label' => t('Photos'),
'url' => $a->get_baseurl() . '/photos/' . $nickname,
'sel' => ((!isset($tab)&&$a->argv[0]=='photos')?'active':''),
'title' => t('Photo Albums'),
),
);
@ -1490,11 +1493,13 @@ if(! function_exists('profile_tabs')){
'label' => t('Events'),
'url' => $a->get_baseurl() . '/events',
'sel' =>((!isset($tab)&&$a->argv[0]=='events')?'active':''),
'title' => t('Events and Calendar'),
);
$tabs[] = array(
'label' => t('Personal Notes'),
'url' => $a->get_baseurl() . '/notes',
'sel' =>((!isset($tab)&&$a->argv[0]=='notes')?'active':''),
'title' => t('Only You Can See This'),
);
}

View file

@ -380,7 +380,7 @@
$nick = $name;
// Generating a random ID
if (!array_key_exists($nick, $usercache))
if (is_null($usercache[$nick]) or !array_key_exists($nick, $usercache))
$usercache[$nick] = mt_rand(2000000, 2100000);
$ret = array(

View file

@ -290,22 +290,26 @@ function contacts_content(&$a) {
'label' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/block',
'sel' => '',
'title' => t('Toggle Blocked status'),
),
array(
'label' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/ignore',
'sel' => '',
'title' => t('Toggle Ignored status'),
),
array(
'label' => (($contact['archive']) ? t('Unarchive') : t('Archive') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/archive',
'sel' => '',
'title' => t('Toggle Archive status'),
),
array(
'label' => t('Repair'),
'url' => $a->get_baseurl(true) . '/crepair/' . $contact_id,
'sel' => '',
'title' => t('Advanced Contact Settings'),
)
);
$tab_tpl = get_markup_template('common_tabs.tpl');
@ -403,40 +407,47 @@ function contacts_content(&$a) {
'label' => t('Suggestions'),
'url' => $a->get_baseurl(true) . '/suggest',
'sel' => '',
'title' => t('Suggest potential friends'),
),
array(
'label' => t('All Contacts'),
'url' => $a->get_baseurl(true) . '/contacts/all',
'sel' => ($all) ? 'active' : '',
'title' => t('Show all contacts'),
),
array(
'label' => t('Unblocked'),
'url' => $a->get_baseurl(true) . '/contacts',
'sel' => ((! $all) && (! $blocked) && (! $hidden) && (! $search) && (! $nets) && (! $ignored) && (! $archived)) ? 'active' : '',
'title' => t('Only show unblocked contacts'),
),
array(
'label' => t('Blocked'),
'url' => $a->get_baseurl(true) . '/contacts/blocked',
'sel' => ($blocked) ? 'active' : '',
'title' => t('Only show blocked contacts'),
),
array(
'label' => t('Ignored'),
'url' => $a->get_baseurl(true) . '/contacts/ignored',
'sel' => ($ignored) ? 'active' : '',
'title' => t('Only show ignored contacts'),
),
array(
'label' => t('Archived'),
'url' => $a->get_baseurl(true) . '/contacts/archived',
'sel' => ($archived) ? 'active' : '',
'title' => t('Only show archived contacts'),
),
array(
'label' => t('Hidden'),
'url' => $a->get_baseurl(true) . '/contacts/hidden',
'sel' => ($hidden) ? 'active' : '',
'title' => t('Only show hidden contacts'),
),
);

View file

@ -207,7 +207,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
if($duplex == 1)
$params['duplex'] = 1;
if($user['page-flags'] == PAGE_COMMUNITY)
if($user[0]['page-flags'] == PAGE_COMMUNITY)
$params['page'] = 1;
logger('dfrn_confirm: Confirm: posting data to ' . $dfrn_confirm . ': ' . print_r($params,true), LOGGER_DATA);
@ -435,13 +435,9 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$contact = null;
$forum_type = false;
if($user['page-flags'] == PAGE_SOAPBOX || $user['page-flags'] == PAGE_COMMUNITY)
$forum_type = true;
if((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
if((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND) || ($forum_type)) {
if(($contact) && ($contact['network'] === NETWORK_DIASPORA) && (! $forum_type)) {
if(($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
require_once('include/diaspora.php');
$ret = diaspora_share($user[0],$r[0]);
logger('mod_follow: diaspora_share returns: ' . $ret);
@ -452,7 +448,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
intval($uid)
);
if((count($r)) && ($activity) && (! $hidden)) {
if((count($r)) && ($r[0]['hide-friends'] == 0) && ($activity) && (! $hidden)) {
require_once('include/items.php');
@ -480,29 +477,15 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$B = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$BPhoto = '[url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]';
if($forum_type) {
$arr['verb'] = ACTIVITY_JOIN;
$arr['object-type'] = ACTIVITY_OBJ_GROUP;
$arr['body'] = sprintf( t('%1$s joined %2$s'), $B, $A)."\n\n\n".$APhoto;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $self[0]['name'] . '</title>'
. '<id>' . $self[0]['url'] . '/' . $self[0]['name'] . '</id>';
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $self[0]['url'] . '" />' . "\n");
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $self[0]['thumb'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n";
}
else {
$arr['verb'] = ACTIVITY_FRIEND;
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
$arr['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$BPhoto;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
. '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n");
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n";
}
$arr['verb'] = ACTIVITY_FRIEND;
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
$arr['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$BPhoto;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
. '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n");
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n";
$arr['last-child'] = 1;
@ -733,6 +716,10 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
WHERE `contact`.`id` = %d LIMIT 1",
intval($dfrn_record)
);
if(count($r))
$combined = $r[0];
if((count($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) {
push_lang($r[0]['language']);
@ -761,6 +748,65 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
}
pop_lang();
}
// Send a new friend post if we are allowed to...
if($page && intval(get_pconfig($local_uid,'system','post_joingroup'))) {
$r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
intval($local_uid)
);
if((count($r)) && ($r[0]['hide-friends'] == 0)) {
require_once('include/items.php');
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
intval($local_uid)
);
if(count($self)) {
$arr = array();
$arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $local_uid);
$arr['uid'] = $local_uid;
$arr['contact-id'] = $self[0]['id'];
$arr['wall'] = 1;
$arr['type'] = 'wall';
$arr['gravity'] = 0;
$arr['origin'] = 1;
$arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
$arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
$arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
$A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
$APhoto = '[url=' . $self[0]['url'] . ']' . '[img]' . $self[0]['thumb'] . '[/img][/url]';
$B = '[url=' . $combined['url'] . ']' . $combined['name'] . '[/url]';
$BPhoto = '[url=' . $combined['url'] . ']' . '[img]' . $combined['thumb'] . '[/img][/url]';
$arr['verb'] = ACTIVITY_JOIN;
$arr['object-type'] = ACTIVITY_OBJ_GROUP;
$arr['body'] = sprintf( t('%1$s has joined %2$s'), $A, $B)."\n\n\n" .$BPhoto;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $combined['name'] . '</title>'
. '<id>' . $combined['url'] . '/' . $combined['name'] . '</id>';
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $combined['url'] . '" />' . "\n");
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $combined['thumb'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n";
$arr['last-child'] = 1;
$arr['allow_cid'] = $user[0]['allow_cid'];
$arr['allow_gid'] = $user[0]['allow_gid'];
$arr['deny_cid'] = $user[0]['deny_cid'];
$arr['deny_gid'] = $user[0]['deny_gid'];
$i = item_store($arr);
if($i)
proc_run('php',"include/notifier.php","activity","$i");
}
}
}
xml_status(0); // Success
return; // NOTREACHED

View file

@ -700,7 +700,8 @@ function dfrn_request_content(&$a) {
'node' => $r[0]['nickname'],
'dfrn_id' => $r[0]['issued-id'],
'intro_id' => $intro[0]['id'],
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0)
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
'activity' => intval(get_pconfig($r[0]['uid'],'system','post_newfriend'))
);
dfrn_confirm_post($a,$handsfree);
}

View file

@ -171,37 +171,44 @@ function network_content(&$a, $update = 0) {
'label' => t('Commented Order'),
'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?f=&cid=' . $_GET['cid'] : ''),
'sel'=>$all_active,
'title'=> t('Sort by Comment Date'),
),
array(
'label' => t('Posted Order'),
'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel'=>$postord_active,
'title' => t('Sort by Post Date'),
),
array(
'label' => t('Personal'),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1',
'sel' => $conv_active,
'title' => t('Posts that mention or involve you'),
),
array(
'label' => t('New'),
'url' => $a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'sel' => $new_active,
'title' => t('Activity Stream - by date'),
),
array(
'label' => t('Starred'),
'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1',
'sel'=>$starred_active,
'title' => t('Favourite Posts'),
),
array(
'label' => t('Shared Links'),
'url'=>$a->get_baseurl(true) . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&bmark=1',
'sel'=>$bookmarked_active,
'title'=> t('Interesting Links'),
),
// array(
// 'label' => t('Spam'),
// 'url'=>$a->get_baseurl(true) . '/network?f=&spam=1'
// 'sel'=> $spam_active,
// 'title' => t('Posts flagged as SPAM'),
// ),

View file

@ -352,6 +352,7 @@ function settings_post(&$a) {
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
$post_newfriend = (($_POST['post_newfriend'] == 1) ? 1: 0);
$post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
$post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0);
@ -436,6 +437,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'system','suggestme', $suggestme);
set_pconfig(local_user(),'system','post_newfriend', $post_newfriend);
set_pconfig(local_user(),'system','post_joingroup', $post_joingroup);
set_pconfig(local_user(),'system','post_profilechange', $post_profilechange);
@ -802,6 +804,9 @@ function settings_content(&$a) {
$post_newfriend = get_pconfig(local_user(), 'system','post_newfriend');
$post_newfriend = (($post_newfriend===false)? '0': $post_newfriend); // default if not set: 0
$post_joingroup = get_pconfig(local_user(), 'system','post_joingroup');
$post_joingroup = (($post_joingroup===false)? '0': $post_joingroup); // default if not set: 0
$post_profilechange = get_pconfig(local_user(), 'system','post_profilechange');
$post_profilechange = (($post_profilechange===false)? '0': $post_profilechange); // default if not set: 0
@ -976,6 +981,7 @@ function settings_content(&$a) {
'$h_not' => t('Notification Settings'),
'$activity_options' => t('By default post a status message when:'),
'$post_newfriend' => array('post_newfriend', t('accepting a friend request'), $post_newfriend, ''),
'$post_joingroup' => array('post_joingroup', t('joining a forum/community'), $post_joingroup, ''),
'$post_profilechange' => array('post_profilechange', t('making an <em>interesting</em> profile change'), $post_profilechange, ''),
'$lbl_not' => t('Send a notification email when:'),
'$notify1' => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''),

File diff suppressed because it is too large Load diff

View file

@ -102,6 +102,7 @@ $unkmail
<strong>$activity_options</strong>
{{inc field_checkbox.tpl with $field=$post_newfriend }}{{endinc}}
{{inc field_checkbox.tpl with $field=$post_joingroup }}{{endinc}}
{{inc field_checkbox.tpl with $field=$post_profilechange }}{{endinc}}

View file

@ -4,9 +4,20 @@
{{ endif }}
</div>
<div id="close_profiles">
{{ if $comunity_profilest_title }}
<h3>$comunity_profilest_title<a id="close_comunity_profiles_icon" onClick="close_profiles()" class="icon close_box" title="close"></a></h3>
<div id='lastusers-wrapper' class='items-wrapper'>
{{ for $comunity_profiles_items as $i }}
$i
{{ endfor }}
</div>
{{ endif }}
</div>
<div id="close_helpers">
{{ if $lastusers_title }}
<h3 style="margin-top:0px;">$helpers.title.1<a id="close_helpers_icon" onClick="close_helpers()" class="icon close_box" title="close"></a></h3>
<h3>$helpers.title.1<a id="close_helpers_icon" onClick="close_helpers()" class="icon close_box" title="close"></a></h3>
<a href="http://kakste.com/profile/newhere" title="@NewHere" style="margin-left: 10px; " target="blank">NewHere</a><br>
<a href="https://helpers.pyxis.uberspace.de/profile/helpers" style="margin-left: 10px; " title="Friendica Support" target="blank">Friendica Support</a><br>
<a href="https://letstalk.pyxis.uberspace.de/profile/letstalk" style="margin-left: 10px; " title="Let's talk" target="blank">Let's talk</a><br>
@ -42,6 +53,9 @@ $nv.search
{{ endif }}
</div>
<div id="twitter">
</div>
<div id="close_lastusers">
{{ if $lastusers_title }}
<h3>$lastusers_title<a id="close_lastusers_icon" onClick="close_lastusers()" class="icon close_box" title="close"></a></h3>

View file

@ -1182,7 +1182,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-aerith/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1191,14 +1191,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-aerith/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-aerith/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1178,7 +1178,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-aerith/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1187,14 +1187,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-aerith/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-aerith/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1158,7 +1158,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-aerith/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1167,14 +1167,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-aerith/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-aerith/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1154,7 +1154,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-aerith/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1163,14 +1163,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-aerith/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-aerith/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1148,7 +1148,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-blue/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1157,14 +1157,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-blue/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-blue/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1144,7 +1144,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-blue/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1153,14 +1153,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-blue/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-blue/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1128,7 +1128,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-blue/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1137,14 +1137,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-blue/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-blue/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1124,7 +1124,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-blue/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1133,14 +1133,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-blue/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-blue/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1158,7 +1158,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-green/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1167,14 +1167,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-green/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-green/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1155,7 +1155,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-green/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1164,14 +1164,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-green/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-green/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1134,7 +1134,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-green/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1143,14 +1143,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-green/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-green/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1130,7 +1130,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-green/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1139,14 +1139,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-green/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-green/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1158,7 +1158,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-pink/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1167,14 +1167,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-pink/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-pink/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1155,7 +1155,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-pink/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1164,14 +1164,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-pink/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-pink/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1134,7 +1134,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-pink/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1143,14 +1143,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-pink/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-pink/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1130,7 +1130,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-pink/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1139,14 +1139,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-pink/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-pink/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1182,7 +1182,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-red/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1191,14 +1191,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-red/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-red/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1178,7 +1178,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-red/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1187,14 +1187,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-red/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-red/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1141,7 +1141,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-red/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1150,14 +1150,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-red/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-red/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -1137,7 +1137,7 @@ list-style-type: disc;
}
/* widget: search */
span.sbox_l {
background: white url('../diabook/icons/srch_l.gif') no-repeat top left;
background: white url('../diabook-red/icons/srch_l.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-left: 10px;
@ -1146,14 +1146,14 @@ span.sbox_l {
}
span.sbox_r {
background: white url('../diabook/icons/srch_r.gif') no-repeat top left;
background: white url('../diabook-red/icons/srch_r.gif') no-repeat top left;
float: left;
width: 19px; height: 19px;
margin-top: 5px;
}
span.sbox input {
background: white url('../diabook/icons/srch_bg.gif') repeat-x top left;
background: white url('../diabook-red/icons/srch_bg.gif') repeat-x top left;
float: left;
margin-top: 5px;
border: 0;

View file

@ -24,3 +24,8 @@ $(function() {
_______________________________________________________________________________________________
http://javascriptly.com/examples/jquery-grab-bag/autogrow-textarea.html
_______________________________________________________________________________________________
http://jquery.malsup.com/
http://jquery.malsup.com/twitter/

View file

@ -0,0 +1,289 @@
/*!
* jQuery Twitter Search Plugin
* Examples and documentation at: http://jquery.malsup.com/twitter/
* Copyright (c) 2010 M. Alsup
* Version: 1.04 (15-SEP-2011)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires: jQuery v1.3.2 or later
*/
;(function($) {
$.fn.twitterSearch = function(options) {
if (typeof options == 'string')
options = { term: options };
return this.each(function() {
var grabFlag = false,
grabbing = false,
$frame = $(this), text, $text, $title, $bird, $cont, height, paused = false,
opts = $.extend(true, {}, $.fn.twitterSearch.defaults, options || {}, $.metadata ? $frame.metadata() : {});
opts.formatter = opts.formatter || $.fn.twitterSearch.formatter;
opts.filter = opts.filter || $.fn.twitterSearch.filter;
if (!opts.applyStyles) { // throw away all style defs
for (var css in opts.css)
opts.css[css] = {};
}
if (opts.title === null) // user can set to '' to suppress title
opts.title = opts.term;
opts.title = opts.title || '';
text = opts.titleLink ? ('<a href="'+ opts.titleLink +'">'+ opts.title + '</a>') : ('<span>' + opts.title +'<a id="close_friends_icon" onClick="close_twitter()" class="icon close_box" title="close"></a>'+ '</span>');
$text = $(text);
if (opts.titleLink)
$text.css(opts.css['titleLink']);
$title = $('<div class="twitterSearchTitle"></div>').append($text).appendTo($frame).css(opts.css['title']);
if (opts.bird) {
$bird = $('<img class="twitterSearchBird" src="'+opts.birdSrc+'" />').appendTo($title).css(opts.css['bird']);
if (opts.birdLink)
$bird.wrap('<a href="'+ opts.birdLink +'"></a>');
}
$cont = $('<div class="twitterSearchContainter"></div>').appendTo($frame).css(opts.css['container']);
cont = $cont[0];
if (opts.colorExterior)
$title.css('background-color',opts.colorExterior);
if (opts.colorInterior)
$cont.css('background-color',opts.colorInterior);
$frame.css(opts.css['frame']);
if (opts.colorExterior)
$frame.css('border-color',opts.colorExterior);
height = $frame.innerHeight() - $title.outerHeight();
$cont.height(height);
if (opts.pause)
$cont.hover(function(){paused = true;},function(){paused = false;});
$('<div class="twitterSearchLoading">Loading tweets..</div>').css(opts.css['loading']).appendTo($cont);
grabTweets();
function grabTweets() {
var url = opts.url + opts.term;
grabFlag = false;
grabbing = true;
// grab twitter stream
$.getJSONP({
url: url,
timeout: 30000,
error: function(xhr, status, e) {
failWhale(e);
},
complete: function() {
grabbing = false;
if (opts.refreshSeconds)
setTimeout(regrab, opts.refreshSeconds * 1000);
},
success: function(json) {
if (json.error) {
failWhale(json.error);
return;
}
$cont.fadeOut('fast',function() {
$cont.empty();
// iterate twitter results
$.each(json.results, function(i) {
if (!opts.filter.call(opts, this))
return; // skip this tweet
var $img, $text, w,
tweet = opts.formatter(this, opts),
$tweet = $(tweet);
$tweet.css(opts.css['tweet']);
$img = $tweet.find('.twitterSearchProfileImg').css(opts.css['img']);
$tweet.find('.twitterSearchUser').css(opts.css['user']);
$tweet.find('.twitterSearchTime').css(opts.css['time']);
$tweet.find('a').css(opts.css['a']);
$tweet.appendTo($cont);
$text = $tweet.find('.twitterSearchText').css(opts.css['text']);
if (opts.avatar) {
w = $img.outerWidth() + parseInt($tweet.css('paddingLeft'));
$text.css('paddingLeft', w);
}
});
$cont.fadeIn('fast');
if (json.results.length < 2) {
if (opts.refreshSeconds)
setTimeout(grabTweets, opts.refreshSeconds * 1000);
return;
}
// stage first animation
setTimeout(go, opts.timeout);
});
}
});
};
function regrab() {
grabFlag = true;
}
function failWhale(msg) {
var $fail = $('<div class="twitterSearchFail">' + msg + '</div>').css(opts.css['fail']);
$cont.empty().append($fail);
};
function go() {
if (paused || grabbing) {
setTimeout(go, 500);
return;
}
var h, $el = $cont.children(':first'), el = $el[0];
$el.animate(opts.animOut, opts.animOutSpeed, function() {
h = $el.outerHeight();
$el.animate({ marginTop: -h }, opts.animInSpeed, function() {
$el.css({ marginTop: 0, opacity: 1 });
/*@cc_on
try { el.style.removeAttribute('filter'); } // ie cleartype fix
catch(smother) {}
@*/
$el.css(opts.css['tweet']).show().appendTo($cont);
setTimeout(grabFlag ? grabTweets : go, opts.timeout);
});
});
}
});
};
$.fn.twitterSearch.filter = function(tweet) {
return true;
};
$.fn.twitterSearch.formatter = function(json, opts) {
var str, pretty,
text = json.text;
if (opts.anchors) {
text = json.text.replace(/(http:\/\/\S+)/g, '<a href="$1">$1</a>');
text = text.replace(/\@(\w+)/g, '<a href="http://twitter.com/$1">@$1</a>');
}
str = '<div class="twitterSearchTweet">';
if (opts.avatar)
str += '<img class="twitterSearchProfileImg" src="' + json.profile_image_url + '" />';
str += '<div><span class="twitterSearchUser"><a href="http://www.twitter.com/'+ json.from_user+'/status/'+ json.id_str +'">'
+ json.from_user + '</a></span>';
pretty = prettyDate(json.created_at);
if (opts.time && pretty)
str += ' <span class="twitterSearchTime">('+ pretty +')</span>'
str += '<div class="twitterSearchText">' + text + '</div></div></div>';
return str;
};
$.fn.twitterSearch.defaults = {
url: 'http://search.twitter.com/search.json?callback=?&q=',
anchors: true, // true or false (enable embedded links in tweets)
animOutSpeed: 500, // speed of animation for top tweet when removed
animInSpeed: 500, // speed of scroll animation for moving tweets up
animOut: { opacity: 0 }, // animation of top tweet when it is removed
applyStyles: true, // true or false (apply default css styling or not)
avatar: true, // true or false (show or hide twitter profile images)
bird: true, // true or false (show or hide twitter bird image)
birdLink: false, // url that twitter bird image should like to
birdSrc: 'http://cloud.github.com/downloads/malsup/twitter/tweet.gif', // twitter bird image
colorExterior: null, // css override of frame border-color and title background-color
colorInterior: null, // css override of container background-color
filter: null, // callback fn to filter tweets: fn(tweetJson) { /* return false to skip tweet */ }
formatter: null, // callback fn to build tweet markup
pause: false, // true or false (pause on hover)
refreshSeconds: 0, // number of seconds to wait before polling for newer tweets
term: '', // twitter search term
time: true, // true or false (show or hide the time that the tweet was sent)
timeout: 4000, // delay betweet tweet scroll
title: null, // title text to display when frame option is true (default = 'term' text)
titleLink: null, // url for title link
css: {
// default styling
a: { textDecoration: 'none', color: '#3B5998' },
bird: { width: '50px', height: '20px', position: 'absolute', left: '-30px', top: '-20px', border: 'none' },
container: { overflow: 'hidden', backgroundColor: '', height: '360px' },
fail: { background: '#6cc5c3 url(http://cloud.github.com/downloads/malsup/twitter/failwhale.png) no-repeat 50% 50%', height: '100%', padding: '10px' },
frame: { border: '0px solid #C2CFF1', borderRadius: '0px', '-moz-border-radius': '0px', '-webkit-border-radius': '0px' },
tweet: { padding: '5px 10px', clear: 'left' },
img: { 'float': 'left', margin: '5px', width: '48px', height: '48px' },
loading: { padding: '20px', textAlign: 'center', color: '#888' },
text: {},
time: { fontSize: 'smaller', color: '#888' },
title: { 'border-bottom': '1px solid #D2D2D2', 'padding-top': '5px', 'padding-bottom': '0px', 'padding-left': '9px', 'margin-bottom': '0px', 'margin-top': '30px' , 'display': 'block', 'font-size': '1.17em', 'font-weight': 'bold'},
titleLink: { textDecoration: 'none', color: '#3B5998' },
user: { fontWeight: 'bold' }
}
};
// fn to handle jsonp with timeouts and errors
// hat tip to Ricardo Tomasi for the timeout logic
$.getJSONP = function(s) {
s.dataType = 'jsonp';
$.ajax(s);
// figure out what the callback fn is
var $script = $(document.getElementsByTagName('head')[0].firstChild);
var url = $script.attr('src') || '';
var cb = (url.match(/callback=(\w+)/)||[])[1];
if (!cb)
return; // bail
var t = 0, cbFn = window[cb];
$script[0].onerror = function(e) {
$script.remove();
handleError(s, {}, "error", e);
clearTimeout(t);
};
if (!s.timeout)
return;
window[cb] = function(json) {
clearTimeout(t);
cbFn(json);
cbFn = null;
};
t = setTimeout(function() {
$script.remove();
handleError(s, {}, "timeout");
if (cbFn)
window[cb] = function(){};
}, s.timeout);
function handleError(s, xhr, msg, e) {
s.error && s.error.call(s.context, xhr, msg, e);
s.global && $.event.trigger("ajaxError", [xhr, s, e || msg]);
s.complete && s.complete.call(s.context, xhr, e || msg);
}
};
/*
* JavaScript Pretty Date
* Copyright (c) 2008 John Resig (jquery.com)
* Licensed under the MIT license.
*/
// converts ISO time to casual time
function prettyDate(time){
var date = new Date((time || "").replace(/-/g,"/").replace(/TZ/g," ")),
diff = (((new Date()).getTime() - date.getTime()) / 1000),
day_diff = Math.floor(diff / 86400);
if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 )
return;
var v = day_diff == 0 && (
diff < 60 && "just now" ||
diff < 120 && "1 minute ago" ||
diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" ||
diff < 7200 && "1 hour ago" ||
diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") ||
day_diff == 1 && "Yesterday" ||
day_diff < 7 && day_diff + " days ago" ||
day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago";
if (!v)
window.console && console.log(time);
return v ? v : '';
}
})(jQuery);

View file

@ -1252,6 +1252,7 @@ right_aside .icon {width: 10px; height: 10px;}
transition: all 0.2s ease-in-out;
}
/* wall item */
.tread-wrapper {
border-bottom: 1px solid #D2D2D2;

View file

@ -3,13 +3,13 @@
/*
* Name: Diabook
* Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu
* Version: (Version: 1.023)
* Version: (Version: 1.024)
* Author:
*/
//print diabook-version for debugging
$diabook_version = "Diabook (Version: 1.023)";
$diabook_version = "Diabook (Version: 1.024)";
$a->page['htmlhead'] .= sprintf('<script "%s" ></script>', $diabook_version);
//change css on network and profilepages
@ -44,6 +44,26 @@ function diabook_community_info(){
$a = get_app();
// comunity_profiles
$aside['$comunity_profilest_title'] = t('Community Profiles');
$aside['$comunity_profiles_items'] = array();
$r = q("select gcontact.* from gcontact left join glink on glink.gcid = gcontact.id
where glink.cid = 0 and glink.uid = 0 order by rand() limit 9");
$tpl = file_get_contents( dirname(__file__).'/ch_directory_item.tpl');
if(count($r)) {
$photo = 'photo';
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' => zrl($rr['url']),
'$photo' => $rr[$photo],
'$alt-text' => $rr['name'],
));
$aside['$comunity_profiles_items'][] = $entry;
}
}
// last 12 users
$aside['$lastusers_title'] = t('Last users');
$aside['$lastusers_items'] = array();
@ -175,9 +195,8 @@ function diabook_community_info(){
//Community Page
if(local_user()) {
$page = '<div id="page-sidebar-right_aside" class="widget">
<div class="title tool">
<h3>'.t("Community Pages").'<a id="close_pages_icon" onClick="close_pages()" class="icon close_box" title="close"></a></h3></div>
$page = '<div id="page-sidebar-right_aside" >
<h3 style="margin-top:0px;">'.t("Community Pages").'<a id="close_pages_icon" onClick="close_pages()" class="icon close_box" title="close"></a></h3></div>
<div id="sidebar-page-list"><ul>';
$pagelist = array();
@ -266,9 +285,9 @@ if ($a->argv[0] === "network" && local_user()){
}
$ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes'];
$ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_profiles'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_twitter'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes'];
if($ccCookie != "7") {
if($ccCookie != "9") {
// COMMUNITY
diabook_community_info();
@ -282,7 +301,7 @@ if ($a->argv[0] === "network" && local_user()){
//right_aside at profile pages
if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){
if($ccCookie != "7") {
if($ccCookie != "9") {
// COMMUNITY
diabook_community_info();
@ -312,6 +331,10 @@ $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></scrip
$autogrowJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.autogrow.textarea.js";
$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $autogrowJS);
//load jquery.twitter.search.js
$twitterJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.twitter.search.js";
$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $twitterJS);
//js scripts
//check if community_home-plugin is activated and change css
@ -343,8 +366,17 @@ $a->page['htmlhead'] .= '
$a->page['htmlhead'] .= '
<script>
$(function() {
$("a.lightbox").fancybox(); // Select all links with lightbox class
$("#twitter").twitterSearch({
term: "friendica",
animInSpeed: 250,
bird: false,
avatar: false,
colorExterior: "#fff",
title: "Last Tweets",
timeout: 10000 });
});
$(window).load(function() {
@ -429,8 +461,10 @@ $a->page['htmlhead'] .= '
function restore_boxes(){
$.cookie("close_pages","2", { expires: 365, path: "/" });
$.cookie("close_helpers","2", { expires: 365, path: "/" });
$.cookie("close_profiles","2", { expires: 365, path: "/" });
$.cookie("close_services","2", { expires: 365, path: "/" });
$.cookie("close_friends","2", { expires: 365, path: "/" });
$.cookie("close_twitter","2", { expires: 365, path: "/" });
$.cookie("close_lastusers","2", { expires: 365, path: "/" });
$.cookie("close_lastphotos","2", { expires: 365, path: "/" });
$.cookie("close_lastlikes","2", { expires: 365, path: "/" });
@ -450,7 +484,7 @@ $a->page['htmlhead'] .= '
</script>';
if($ccCookie != "7") {
if($ccCookie != "9") {
$a->page['htmlhead'] .= '
<script>
$("right_aside").ready(function(){
@ -459,6 +493,11 @@ $("right_aside").ready(function(){
{
document.getElementById( "close_pages" ).style.display = "none";
};
if($.cookie("close_profiles") == "1")
{
document.getElementById( "close_profiles" ).style.display = "none";
};
if($.cookie("close_helpers") == "1")
{
@ -475,6 +514,10 @@ $("right_aside").ready(function(){
document.getElementById( "close_friends" ).style.display = "none";
};
if($.cookie("close_twitter") == "1")
{
document.getElementById( "twitter" ).style.display = "none";
};
if($.cookie("close_lastusers") == "1")
{
@ -498,6 +541,11 @@ function close_pages(){
$.cookie("close_pages","1", { expires: 365, path: "/" });
};
function close_profiles(){
document.getElementById( "close_profiles" ).style.display = "none";
$.cookie("close_profiles","1", { expires: 365, path: "/" });
};
function close_helpers(){
document.getElementById( "close_helpers" ).style.display = "none";
$.cookie("close_helpers","1", { expires: 365, path: "/" });
@ -512,7 +560,11 @@ function close_friends(){
document.getElementById( "close_friends" ).style.display = "none";
$.cookie("close_friends","1", { expires: 365, path: "/" });
};
function close_twitter(){
document.getElementById( "twitter" ).style.display = "none";
$.cookie("close_twitter","1", { expires: 365, path: "/" });
};
function close_lastusers(){
document.getElementById( "close_lastusers" ).style.display = "none";