Browse Source

Merge remote-tracking branch 'fabrix/newui'

pull/1/head
Fabio Comuni 11 years ago
parent
commit
939449602a
  1. 171
      boot.php
  2. BIN
      images/connect-bg.png
  3. BIN
      images/icons/10/add.png
  4. BIN
      images/icons/10/delete.png
  5. BIN
      images/icons/10/edit.png
  6. BIN
      images/icons/10/feed.png
  7. BIN
      images/icons/10/gear.png
  8. BIN
      images/icons/10/group.png
  9. BIN
      images/icons/10/info.png
  10. BIN
      images/icons/10/lock.png
  11. BIN
      images/icons/10/menu.png
  12. BIN
      images/icons/10/notice.png
  13. BIN
      images/icons/10/notify_off.png
  14. BIN
      images/icons/10/notify_on.png
  15. BIN
      images/icons/10/star.png
  16. BIN
      images/icons/10/user.png
  17. BIN
      images/icons/16/add.png
  18. BIN
      images/icons/16/delete.png
  19. BIN
      images/icons/16/edit.png
  20. BIN
      images/icons/16/feed.png
  21. BIN
      images/icons/16/gear.png
  22. BIN
      images/icons/16/group.png
  23. BIN
      images/icons/16/info.png
  24. BIN
      images/icons/16/lock.png
  25. BIN
      images/icons/16/menu.png
  26. BIN
      images/icons/16/notice.png
  27. BIN
      images/icons/16/notify_off.png
  28. BIN
      images/icons/16/notify_on.png
  29. BIN
      images/icons/16/star.png
  30. BIN
      images/icons/16/user.png
  31. BIN
      images/icons/22/add.png
  32. BIN
      images/icons/22/delete.png
  33. BIN
      images/icons/22/edit.png
  34. BIN
      images/icons/22/feed.png
  35. BIN
      images/icons/22/gear.png
  36. BIN
      images/icons/22/group.png
  37. BIN
      images/icons/22/info.png
  38. BIN
      images/icons/22/lock.png
  39. BIN
      images/icons/22/menu.png
  40. BIN
      images/icons/22/notice.png
  41. BIN
      images/icons/22/notify_off.png
  42. BIN
      images/icons/22/notify_on.png
  43. BIN
      images/icons/22/star.png
  44. BIN
      images/icons/22/user.png
  45. BIN
      images/icons/48/add.png
  46. BIN
      images/icons/48/delete.png
  47. BIN
      images/icons/48/edit.png
  48. BIN
      images/icons/48/feed.png
  49. BIN
      images/icons/48/gear.png
  50. BIN
      images/icons/48/group.png
  51. BIN
      images/icons/48/info.png
  52. BIN
      images/icons/48/lock.png
  53. BIN
      images/icons/48/menu.png
  54. BIN
      images/icons/48/notice.png
  55. BIN
      images/icons/48/notify_off.png
  56. BIN
      images/icons/48/notify_on.png
  57. BIN
      images/icons/48/star.png
  58. BIN
      images/icons/48/user.png
  59. BIN
      images/icons/add.png
  60. BIN
      images/icons/delete.png
  61. BIN
      images/icons/edit.png
  62. BIN
      images/icons/feed.png
  63. BIN
      images/icons/gear.png
  64. BIN
      images/icons/group.png
  65. BIN
      images/icons/info.png
  66. BIN
      images/icons/lock.png
  67. 14
      images/icons/make.sh
  68. BIN
      images/icons/menu.png
  69. BIN
      images/icons/notice.png
  70. BIN
      images/icons/notify_off.png
  71. BIN
      images/icons/notify_on.png
  72. BIN
      images/icons/star.png
  73. BIN
      images/icons/user.png
  74. 51
      include/conversation.php
  75. 45
      include/nav.php
  76. 36
      include/template_processor.php
  77. 49
      include/text.php
  78. 20
      index.php
  79. 0
      js/acl.js
  80. 0
      js/ajaxupload.js
  81. 0
      js/country.js
  82. 0
      js/jquery.htmlstream.js
  83. 0
      js/jquery.js
  84. 99
      js/main.js
  85. 3
      library/jgrowl/README
  86. 136
      library/jgrowl/jquery.jgrowl.css
  87. 11
      library/jgrowl/jquery.jgrowl_minimized.js
  88. BIN
      library/stanlemon-jgrowl-tip.tar.gz
  89. 30
      library/tiptip/README
  90. 21
      library/tiptip/jquery.tipTip.minified.js
  91. 113
      library/tiptip/tipTip.css
  92. 2
      mod/admin.php
  93. 19
      mod/apps.php
  94. 2
      mod/community.php
  95. 2
      mod/contacts.php
  96. 2
      mod/directory.php
  97. 9
      mod/help.php
  98. 2
      mod/message.php
  99. 2
      mod/network.php
  100. 2
      mod/notifications.php
  101. Some files were not shown because too many files have changed in this diff Show More

171
boot.php

@ -5,6 +5,7 @@ require_once('include/network.php');
require_once('include/plugin.php');
require_once('include/text.php');
require_once("include/pgettext.php");
require_once('include/nav.php');
define ( 'FRIENDIKA_VERSION', '2.3.1116' );
@ -248,7 +249,7 @@ class App {
public $timezone;
public $interactive = true;
public $plugins;
public $apps;
public $apps = Array();
public $identities;
private $scheme;
@ -723,14 +724,16 @@ function remote_user() {
if(! function_exists('notice')) {
function notice($s) {
$a = get_app();
if(! x($_SESSION,'sysmsg')) $_SESSION['sysmsg'] = array();
if($a->interactive)
$_SESSION['sysmsg'] .= $s;
$_SESSION['sysmsg'][] = $s;
}}
if(! function_exists('info')) {
function info($s) {
$a = get_app();
if(! x($_SESSION,'sysmsg_info')) $_SESSION['sysmsg_info'] = array();
if($a->interactive)
$_SESSION['sysmsg_info'] .= $s;
$_SESSION['sysmsg_info'][] = $s;
}}
@ -812,8 +815,8 @@ function profile_load(&$a, $nickname, $profile = 0) {
$a->page['aside'] .= profile_sidebar($a->profile, $block);
if(! $block)
$a->page['aside'] .= contact_block();
/*if(! $block)
$a->page['aside'] .= contact_block();*/
return;
}}
@ -841,132 +844,107 @@ function profile_sidebar($profile, $block = 0) {
$a = get_app();
$o = '';
$location = '';
$location = false;
$address = false;
$pdesc = true;
if((! is_array($profile)) && (! count($profile)))
return $o;
call_hooks('profile_sidebar_enter', $profile);
$fullname = '<div class="fn">' . $profile['name'] . '</div>';
// don't show connect link to yourself
$connect = (($profile['uid'] != local_user()) ? t('Connect') : False);
$pdesc = '<div class="title">' . $profile['pdesc'] . '</div>';
// don't show connect link to authenticated visitors either
$tabs = '';
if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
$connect = False;
// show edit profile to yourself
if ($profile['uid'] == local_user()) {
$profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
local_user());
$profile['menu'] = array(
'chg_photo' => t('Change profile photo'),
'cr_new' => t('Create New Profile'),
'entries' => array(),
);
if(count($r)) {
$photo = '<div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="' . $profile['photo'] . '" alt="' . $profile['name'] . '" /></div>';
foreach($r as $rr) {
$profile['menu']['entries'][] = array(
'photo' => $rr['thumb'],
'id' => $rr['id'],
'alt' => t('Profile Image'),
'profile_name' => $rr['profile-name'],
'isdefault' => $rr['is-default'],
'visibile_to_everybody' => t('visible to everybody'),
'edit_visibility' => t('Edit visibility'),
);
}
// don't show connect link to yourself
$connect = (($profile['uid'] != local_user()) ? '<li><a id="dfrn-request-link" href="dfrn_request/' . $profile['nickname'] . '">' . t('Connect') . '</a></li>' : '');
// don't show connect link to authenticated visitors either
}
}
if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
$connect = '';
if((x($profile,'address') == 1)
|| (x($profile,'locality') == 1)
|| (x($profile,'region') == 1)
|| (x($profile,'postal-code') == 1)
|| (x($profile,'country-name') == 1))
$address = true;
if($address) {
$location .= '<div class="location"><span class="location-label">' . t('Location:') . '</span> <div class="adr">';
$location .= ((x($profile,'address') == 1) ? '<div class="street-address">' . $profile['address'] . '</div>' : '');
$location .= (((x($profile,'locality') == 1) || (x($profile,'region') == 1) || (x($profile,'postal-code') == 1))
? '<span class="city-state-zip"><span class="locality">' . $profile['locality'] . '</span>'
. ((x($profile['locality']) == 1) ? t(', ') : '')
. '<span class="region">' . $profile['region'] . '</span>'
. ' <span class="postal-code">' . $profile['postal-code'] . '</span></span>' : '');
$location .= ((x($profile,'country-name') == 1) ? ' <span class="country-name">' . $profile['country-name'] . '</span>' : '');
$location .= '</div></div><div class="profile-clear"></div>';
$location = t('Location:');
}
$gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
$gender = ((x($profile,'gender') == 1) ? '<div class="mf"><span class="gender-label">' . t('Gender:') . '</span> <span class="x-gender">' . $profile['gender'] . '</span></div><div class="profile-clear"></div>' : '');
$marital = ((x($profile,'marital') == 1) ? t('Status:') : False);
$pubkey = ((x($profile,'pubkey') == 1) ? '<div class="key" style="display:none;">' . $profile['pubkey'] . '</div>' : '');
$homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False);
$marital = ((x($profile,'marital') == 1) ? '<div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> ' . t('Status:') . ' </span><span class="marital-text">' . $profile['marital'] . '</span></div><div class="profile-clear"></div>' : '');
if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) {
$location = $pdesc = $connect = $gender = $marital = $homepage = False;
}
$homepage = ((x($profile,'homepage') == 1) ? '<div class="homepage"><span class="homepage-label">' . t('Homepage:') . ' </span><span class="homepage-url">' . linkify($profile['homepage']) . '</span></div><div class="profile-clear"></div>' : '');
$diaspora = array(
'podloc' => $a->get_baseurl(),
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
'nickname ' => $profile['nickname'],
'fullname' => $profile['name'],
'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
);
if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) {
$location = $pdesc = $connect = $gender = $marital = $homepage = '';
if (!$block){
$contact_block = contact_block();
}
$podloc = $a->get_baseurl();
$searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' );
$nickname = $profile['nickname'];
$photo300 = $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg';
$photo100 = $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg';
$photo50 = $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg';
$diaspora_vcard = <<< EOT
<div style="display:none;">
<dl class='entity_nickname'>
<dt>Nickname</dt>
<dd>
<a class="nickname url uid" href="$podloc/" rel="me">$nickname</a>
</dd>
</dl>
<dl class='entity_fn'>
<dt>Full name</dt>
<dd>
<span class='fn'>$fullname</span>
</dd>
</dl>
<dl class="entity_url">
<dt>URL</dt>
<dd>
<a class="url" href="$podloc/" id="pod_location" rel="me">$podloc/</a>
</dd>
</dl>
<dl class="entity_photo">
<dt>Photo</dt>
<dd>
<img class="photo avatar" height="300px" width="300px" src="$photo300">
</dd>
</dl>
<dl class="entity_photo_medium">
<dt>Photo</dt>
<dd>
<img class="photo avatar" height="100px" width="100px" src="$photo100">
</dd>
</dl>
<dl class="entity_photo_small">
<dt>Photo</dt>
<dd>
<img class="photo avatar" height="50px" width="50px" src="$photo50">
</dd>
</dl>
<dl class="entity_searchable">
<dt>Searchable</dt>
<dd>
<span class="searchable">$searchable</span>
</dd>
</dl>
</div>
EOT;
$tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, array(
'$fullname' => template_escape($fullname),
'$pdesc' => template_escape($pdesc),
'$tabs' => $tabs,
'$photo' => $photo,
'$profile' => $profile,
'$connect' => $connect,
'$location' => template_escape($location),
'$gender' => $gender,
'$pubkey' => $pubkey,
'$marital' => template_escape($marital),
'$homepage' => template_escape($homepage),
'$diaspora' => $diaspora_vcard
'$pdesc' => $pdesc,
'$marital' => $marital,
'$homepage' => $homepage,
'$diaspora' => $diaspora,
'$contact_block' => $contact_block,
));
@ -1174,3 +1152,4 @@ function load_contact_links($uid) {
$a->contacts = $ret;
return;
}}

BIN
images/connect-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

BIN
images/icons/10/add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/icons/10/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/icons/10/edit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/icons/10/feed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

BIN
images/icons/10/gear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/icons/10/group.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

BIN
images/icons/10/info.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

BIN
images/icons/10/lock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/icons/10/menu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/icons/10/notice.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

BIN
images/icons/10/notify_off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

BIN
images/icons/10/notify_on.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

BIN
images/icons/10/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/icons/10/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

BIN
images/icons/16/add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/icons/16/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/16/edit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/16/feed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

BIN
images/icons/16/gear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/16/group.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

BIN
images/icons/16/info.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

BIN
images/icons/16/lock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/16/menu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/icons/16/notice.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

BIN
images/icons/16/notify_off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

BIN
images/icons/16/notify_on.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

BIN
images/icons/16/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
images/icons/16/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

BIN
images/icons/22/add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/22/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/icons/22/edit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/icons/22/feed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/22/gear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/icons/22/group.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/22/info.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/22/lock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/icons/22/menu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/icons/22/notice.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

BIN
images/icons/22/notify_off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/22/notify_on.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

BIN
images/icons/22/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
images/icons/22/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/48/add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/icons/48/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/icons/48/edit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/icons/48/feed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
images/icons/48/gear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/icons/48/group.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
images/icons/48/info.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/icons/48/lock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/icons/48/menu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
images/icons/48/notice.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/icons/48/notify_off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/icons/48/notify_on.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/icons/48/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/icons/48/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/icons/add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
images/icons/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
images/icons/edit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
images/icons/feed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
images/icons/gear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
images/icons/group.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
images/icons/info.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
images/icons/lock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

14
images/icons/make.sh

@ -0,0 +1,14 @@
sizes="10 16 22 48"
for s in $sizes
do
echo "=[ ${s}x${s} ]===="
[ -d $s ] || mkdir $s
for f in *.png
do
convert $f -resize ${s}x${s} $s/$f
echo -n "#"
done
echo
done
echo "Ok."

BIN
images/icons/menu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/icons/notice.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
images/icons/notify_off.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
images/icons/notify_on.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
images/icons/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
images/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

51
include/conversation.php

@ -268,6 +268,10 @@ function conversation(&$a, $items, $mode, $update) {
$blowhard = 0;
$blowhard_count = 0;
// array with html for each thread (parent+comments)
$treads = array();
$treadsid = -1;
foreach($items as $item) {
$comment = '';
@ -294,7 +298,7 @@ function conversation(&$a, $items, $mode, $update) {
$toplevelprivate = (($toplevelpost && $item['private']) ? true : false);
$item_writeable = (($item['writable'] || $item['self']) ? true : false);
if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
/*if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
$blowhard_count ++;
if($blowhard_count == 3) {
$o .= '<div class="icollapse-wrapper fakelink" id="icollapse-wrapper-' . $item['parent']
@ -308,10 +312,13 @@ function conversation(&$a, $items, $mode, $update) {
if($blowhard_count >= 3)
$o .= '</div>';
$blowhard_count = 0;
}
}*/
$comments_seen = 0;
$comments_collapsed = false;
$treadsid++;
$treads[$treadsid] = "";
}
else {
// prevent private email from leaking into public conversation
@ -325,7 +332,7 @@ function conversation(&$a, $items, $mode, $update) {
if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
if(! $comments_collapsed) {
$o .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
$treads[$treadsid] .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
. '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\'); $(\'#ccollapse-wrapper-' . $item['parent'] . '\').hide();" >'
. sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>'
. '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >';
@ -333,15 +340,15 @@ function conversation(&$a, $items, $mode, $update) {
}
}
if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) {
$o .= '</div>';
$treads[$treadsid] .= '</div>';
}
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
: '<div class="wall-item-lock"></div>');
? t('Private Message')
: false);
// Top-level wall post not written by the wall owner (wall-to-wall)
@ -427,7 +434,21 @@ function conversation(&$a, $items, $mode, $update) {
$drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$select' => t('Select'), '$delete' => t('Delete')));
$star = (($profile_owner == local_user() && $toplevelpost) ? '<a href="#" id="starred-' . $item['id'] . '" onclick="dostar(' . $item['id'] . '); return false;" class="star-item icon ' . (($item['starred']) ? 'starred' : 'unstarred') . '" title="' . t('toggle star status') . '"></a>' : '');
$star = false;
if ($profile_owner == local_user() && $toplevelpost) {
$isstarred = (($item['starred']) ? "starred" : "unstarred");
$star = array(
'do' => t("add star"),
'undo' => t("remove star"),
'toggle' => t("toggle star status"),
'classdo' => (($item['starred']) ? "hidden" : ""),
'classundo' => (($item['starred']) ? "" : "hidden"),
'starred' => t('starred'),
);
}
$photo = $item['photo'];
@ -508,6 +529,7 @@ function conversation(&$a, $items, $mode, $update) {
'$owner_name' => template_escape($owner_name),
'$plink' => get_plink($item),
'$edpost' => $edpost,
'$isstarred' => $isstarred,
'$star' => $star,
'$drop' => $drop,
'$vote' => $likebuttons,
@ -521,7 +543,7 @@ function conversation(&$a, $items, $mode, $update) {
$arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr);
$o .= $arr['output'];
$treads[$treadsid] .= $arr['output'];
}
}
@ -530,10 +552,15 @@ function conversation(&$a, $items, $mode, $update) {
// if author collapsing is in force but didn't get closed, close it off now.
if($blowhard_count >= 3)
$o .= '</div>';
if($dropping)
$o .= '<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();"><div id="item-delete-selected-icon" class="icon drophide" title="' . t('Delete Selected Items') . '" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div><div id="item-delete-selected-desc" >' . t('Delete Selected Items') . '</div></div><div id="item-delete-selected-end"></div>';
$treads[$treadsid] .= '</div>';
$page_template = get_markup_template("conversation.tpl");
$o .= replace_macros($page_template, array(
'$treads' => $treads,
'$dropping' => $dropping,
));
//if($dropping)
// $o .= '<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();"><div id="item-delete-selected-icon" class="icon drophide" title="' . t('Delete Selected Items') . '" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div><div id="item-delete-selected-desc" >' . t('Delete Selected Items') . '</div></div><div id="item-delete-selected-end"></div>';
return $o;
}

45
include/nav.php

@ -37,11 +37,29 @@ function nav(&$a) {
* Display login or logout
*/
$nav['usermenu']=array();
$userinfo = null;
if(local_user()) {
$nav['logout'] = Array('logout',t('Logout'), "", t('End this session'));
// user menu
$nav['usermenu'][] = Array('profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations'));
$nav['usermenu'][] = Array('profile/' . $a->user['nickname']. '?tab=profile', t('Profile'), "", t('Your profile page'));
$nav['usermenu'][] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos'));
$nav['usermenu'][] = Array('events/', t('Events'), "", t('Your events'));
$nav['usermenu'][] = Array('notes/', t('Personal notes'), "", t('Your personal photos'));
// user info
$r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid']));
$userinfo = array(
'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"),
'name' => $a->user['username'],
);
}
else {
$nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'nav-selected':''), t('Sign in'));
$nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'selected':''), t('Sign in'));
}
@ -63,7 +81,7 @@ function nav(&$a) {
if(! get_config('system','hide_help'))
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));
if($a->apps)
if(count($a->apps)>0)
$nav['apps'] = array('apps', t('Apps'), "", t('Addon applications, utilities, games'));
$nav['search'] = array('search', t('Search'), "", t('Search site content'));
@ -137,8 +155,31 @@ function nav(&$a) {
'$sitelocation' => $sitelocation,
'$nav' => $nav,
'$banner' => $banner,
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $userinfo,
'$sel' => $a->nav_sel,
'$apps' => $a->apps,
));
call_hooks('page_header', $a->page['nav']);
}
/*
* Set a menu item in navbar as selected
*
*/
function nav_set_selected($item){
$a = get_app();
$a->nav_sel = array(
'community' => null,
'network' => null,
'home' => null,
'profiles' => null,
'notifications' => null,
'messages' => null,
'directyory' => null,
'settings' => null,
'contacts' => null,
);
$a->nav_sel[$item] = 'selected';
}

36
include/template_processor.php

@ -14,15 +14,18 @@
private function _preg_error(){
switch(preg_last_error()){
case PREG_INTERNAL_ERROR: die('PREG_INTERNAL_ERROR'); break;
case PREG_BACKTRACK_LIMIT_ERROR: die('PREG_BACKTRACK_LIMIT_ERROR'); break;
case PREG_RECURSION_LIMIT_ERROR: die('PREG_RECURSION_LIMIT_ERROR'); break;
case PREG_BAD_UTF8_ERROR: die('PREG_BAD_UTF8_ERROR'); break;
case PREG_BAD_UTF8_OFFSET_ERROR: die('PREG_BAD_UTF8_OFFSET_ERROR'); break;
case PREG_INTERNAL_ERROR: echo('PREG_INTERNAL_ERROR'); break;
case PREG_BACKTRACK_LIMIT_ERROR: echo('PREG_BACKTRACK_LIMIT_ERROR'); break;
case PREG_RECURSION_LIMIT_ERROR: echo('PREG_RECURSION_LIMIT_ERROR'); break;
case PREG_BAD_UTF8_ERROR: echo('PREG_BAD_UTF8_ERROR'); break;
case PREG_BAD_UTF8_OFFSET_ERROR: echo('PREG_BAD_UTF8_OFFSET_ERROR'); break;
default:
//die("Unknown preg error.");
return;
}
echo "<hr><pre>";
debug_print_backtrace();
die();
}
private function _build_replace($r, $prefix){
@ -31,8 +34,6 @@
foreach ($r as $k => $v ) {
if (is_array($v))
$this->_build_replace($v, "$prefix$k.");
if (is_object($v))
$this->_build_replace($v->getKeys(), "$prefix$k.");
$this->search[] = $prefix . $k;
$this->replace[] = $v;
@ -159,29 +160,14 @@
return $s;
}
private function _get_lang(){
if ($this->lang!=null) return $this->lang;
$a = get_app();
$this->lang=array();
if(is_array($a->strings) && count($a->strings)) {
foreach ($a->strings as $k=>$v){
$k = preg_replace("/[^a-z0-9-]/", "", str_replace(" ","-", strtolower($k)));
$this->lang[$k] = $v;
}
}
return $this->lang;
}
public function replace($s, $r) {
if (!x($r,'$lang')){
$r['$lang'] = &$this->_get_lang();
}
$this->r = $r;
$this->search = array();
$this->replace = array();
$this->_build_replace($r, "");
#$s = str_replace(array("\n","\r"),array("§n§","§r§"),$s);
$s = $this->_build_nodes($s);
$s = preg_replace_callback('/\|\|([0-9]+)\|\|/', array($this, "_replcb_node"), $s);

49
include/text.php

@ -538,22 +538,30 @@ function contact_block() {
$total = intval($r[0]['total']);
}
if(! $total) {
$o .= '<h4 class="contact-h4">' . t('No contacts') . '</h4>';
return $o;
}
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),
intval($shown)
);
if(count($r)) {
$o .= '<h4 class="contact-h4">' . sprintf( tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">';
foreach($r as $rr) {
$o .= micropro($rr,true,'mpfriend');
}
$o .= '</div><div id="contact-block-end"></div>';
$o .= '<div id="viewcontacts"><a id="viewcontacts-link" href="viewcontacts/' . $a->profile['nickname'] . '">' . t('View Contacts') . '</a></div>';
$contacts = t('No contacts');
$micropro = Null;
} else {
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),
intval($shown)
);
if(count($r)) {
$contacts = sprintf( tt('%d Contact','%d Contacts', $total),$total);
$micropro = Array();
foreach($r as $rr) {
$micropro[] = micropro($rr,true,'mpfriend');
}
}
}
$tpl = get_markup_template('contact_block.tpl');
$o = replace_macros($tpl, array(
'$contacts' => $contacts,
'$nickname' => $a->profile['nickname'],
'$viewcontacts' => t('View Contacts'),
'$micropro' => $micropro,
));
$arr = array('contacts' => $r, 'output' => $o);
@ -826,9 +834,14 @@ function feed_salmonlinks($nick) {
if(! function_exists('get_plink')) {
function get_plink($item) {
$a = get_app();
$plink = (((x($item,'plink')) && (! $item['private'])) ? '<div class="wall-item-links-wrapper"><a href="'
. $item['plink'] . '" title="' . t('link to source') . '" target="external-link" class="icon remote-link"></a></div>' : '');
return $plink;
if (x($item,'plink') && (! $item['private'])){
return array(
'href' => $item['plink'],
'title' => t('link to source'),
);
} else {
return false;
}
}}
if(! function_exists('unamp')) {
@ -981,4 +994,4 @@ if (!function_exists('str_getcsv')) {
return false;
}
}
}
}

20
index.php

@ -116,10 +116,10 @@ if(! x($_SESSION,'authenticated'))
header('X-Account-Management-Status: none');
if(! x($_SESSION,'sysmsg'))
$_SESSION['sysmsg'] = '';
$_SESSION['sysmsg'] = array();
if(! x($_SESSION,'sysmsg_info'))
$_SESSION['sysmsg_info'] = '';
$_SESSION['sysmsg_info'] = array();
/*
* check_config() is responsible for running update scripts. These automatically
@ -199,8 +199,8 @@ if(strlen($a->module)) {
if(! $a->module_loaded) {
// Stupid browser tried to pre-fetch our ACL img template. Don't log the event or return anything - just quietly exit.
if((x($_SERVER,'QUERY_STRING')) && strpos($_SERVER['QUERY_STRING'],'{0}') !== false) {
// Stupid browser tried to pre-fetch our Javascript img template. Don't log the event or return anything - just quietly exit.
if((x($_SERVER,'QUERY_STRING')) && preg_match('/{[0-9]}/',$_SERVER['QUERY_STRING']) !== 0) {
killme();
}
@ -211,7 +211,10 @@ if(strlen($a->module)) {
logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
notice( t('Page not found.' ) . EOL);
$tpl = get_markup_template("404.tpl");
$a->page['content'] = replace_macros($tpl, array(
'$message' => t('Page not found.' )
));
}
}
@ -266,7 +269,7 @@ if(isset($homebase))
// now that we've been through the module content, see if the page reported
// a permission problem and if so, a 403 response would seem to be in order.
if(stristr($_SESSION['sysmsg'], t('Permission denied'))) {
if(stristr( implode("",$_SESSION['sysmsg']), t('Permission denied'))) {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.'));
}
@ -276,7 +279,7 @@ if(stristr($_SESSION['sysmsg'], t('Permission denied'))) {
*
*/
if(x($_SESSION,'sysmsg')) {
/*if(x($_SESSION,'sysmsg')) {
$a->page['content'] = "<div id=\"sysmsg\" class=\"error-message\">{$_SESSION['sysmsg']}</div>\r\n"
. ((x($a->page,'content')) ? $a->page['content'] : '');
$_SESSION['sysmsg']="";
@ -287,7 +290,7 @@ if(x($_SESSION,'sysmsg_info')) {
. ((x($a->page,'content')) ? $a->page['content'] : '');
$_SESSION['sysmsg_info']="";
unset($_SESSION['sysmsg_info']);
}
}*/
@ -310,7 +313,6 @@ $a->page['content'] .= '<div id="pause"></div>';
*/
if($a->module != 'install') {
require_once('nav.php');
nav($a);
}

0
include/acl.js → js/acl.js

0
include/ajaxupload.js → js/ajaxupload.js

0
include/country.js → js/country.js

0
include/jquery.htmlstream.js → js/jquery.htmlstream.js

0
include/jquery.js → js/jquery.js vendored

99
include/main.js → js/main.js

@ -34,6 +34,18 @@
msie = $.browser.msie ;
/* setup tooltips */
$("a,.tt").each(function(){
var e = $(this);
var pos="bottom";
if (e.hasClass("tttop")) pos="top";
if (e.hasClass("ttbottom")) pos="bottom";
if (e.hasClass("ttleft")) pos="left";
if (e.hasClass("ttright")) pos="right";
e.tipTip({defaultPosition: pos});
});
/* setup onoff widgets */
$(".onoff input").each(function(){
@ -55,34 +67,64 @@
/* setup field_richtext */
setupFieldRichtext();
/* load tinyMCE if needed and setup field_richtext */
/*if(typeof tinyMCE == "undefined") {
window.tinyMCEPreInit = {
suffix:"",
base: baseurl+"/library/tinymce/jscripts/tiny_mce/",
query:"",
};
$.getScript(baseurl +"/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js", setupFieldRichtext);
} else {
}*/
/* popup menus */
$('a[rel^=#]').click(function(e){
menu = $( $(this).attr('rel') );
e.preventDefault();
e.stopPropagation();
if (menu.attr('popup')=="false") return false;
$(this).parent().toggleClass("selected");
menu.toggle();
return false;
});
/* notifications template */
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
var notifications_empty = unescape($("#nav-notifications-menu").html());
/* nav update event */
$('nav').bind('nav-update', function(e,data){;
var net = $(data).find('net').text();
if(net == 0) { net = ''; $('#net-update').hide() } else { $('#net-update').show() }
if(net == 0) { net = ''; $('#net-update').removeClass('show') } else { $('#net-update').addClass('show') }
$('#net-update').html(net);
var home = $(data).find('home').text();
if(home == 0) { home = ''; $('#home-update').hide() } else { $('#home-update').show() }
if(home == 0) { home = ''; $('#home-update').removeClass('show') } else { $('#home-update').addClass('show') }
$('#home-update').html(home);
var mail = $(data).find('mail').text();
if(mail == 0) { mail = ''; $('#mail-update').hide() } else { $('#mail-update').show() }
$('#mail-update').html(mail);
var intro = $(data).find('intro').text();
if(intro == 0) { intro = ''; $('#notify-update').hide() } else { $('#notify-update').show() }
$('#notify-update').html(intro);
var eNotif = $(data).find('notif')
notif = eNotif.attr('count');
if (notif>0){
$("#nav-notifications-linkmenu").addClass("on");
nnm = $("#nav-notifications-menu");
nnm.html("");
//nnm.attr('popup','true');
eNotif.children("note").each(function(){
e = $(this);
text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'));
nnm.append(html);
});
} else {
$("#nav-notifications-linkmenu").removeClass("on");
$("#nav-notifications-menu").html(notifications_empty);
}
if(notif == 0) { notif = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
$('#notify-update').html(notif);
var eSysmsg = $(data).find('sysmsgs');
eSysmsg.children("notice").each(function(){
text = $(this).text();
$.jGrowl(text, { sticky: true, theme: 'notice' });
});
eSysmsg.children("info").each(function(){
text = $(this).text();
$.jGrowl(text, { sticky: false, theme: 'info' });
});
});
@ -220,17 +262,22 @@
}
function dostar(ident) {
$('#like-rotator-' + ident.toString()).show();
$.get('starred/' + ident.toString(), function(data) {
ident = ident.toString();
$('#like-rotator-' + ident).show();
$.get('starred/' + ident, function(data) {
if(data.match(/1/)) {
$('#starred-' + ident.toString()).addClass('starred');
$('#starred-' + ident.toString()).removeClass('unstarred');
$('#starred-' + ident).addClass('starred');
$('#starred-' + ident).removeClass('unstarred');
$('#star-' + ident).addClass('hidden');
$('#unstar-' + ident).removeClass('hidden');
}
else {
$('#starred-' + ident.toString()).addClass('unstarred');
$('#starred-' + ident.toString()).removeClass('starred');
$('#starred-' + ident).addClass('unstarred');
$('#starred-' + ident).removeClass('starred');
$('#star-' + ident).removeClass('hidden');
$('#unstar-' + ident).addClass('hidden');
}
$('#like-rotator-' + ident.toString()).hide();
$('#like-rotator-' + ident).hide();
});
}

3
library/jgrowl/README

@ -0,0 +1,3 @@
http://stanlemon.net/projects/jgrowl.html
jGrowl is free and open source, it's distributed under the MIT and GPL licenses

136
library/jgrowl/jquery.jgrowl.css

@ -0,0 +1,136 @@
div.jGrowl {
z-index: 9999;
color: #fff;
font-size: 12px;
}
/** Special IE6 Style Positioning **/
div.ie6 {
position: absolute;
}
div.ie6.top-right {
right: auto;
bottom: auto;
left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}
div.ie6.top-left {
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}
div.ie6.bottom-right {
left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}
div.ie6.bottom-left {
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}
div.ie6.center {
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
width: 100%;
}
/** Normal Style Positions **/
div.jGrowl {
position: absolute;
}
body > div.jGrowl {
position: fixed;
}
div.jGrowl.top-left {
left: 0px;
top: 0px;
}
div.jGrowl.top-right {
right: 0px;
top: 0px;
}
div.jGrowl.bottom-left {
left: 0px;
bottom: 0px;
}
div.jGrowl.bottom-right {