diff --git a/boot.php b/boot.php index 48d52846..5b32e057 100644 --- a/boot.php +++ b/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 = '
' . $profile['name'] . '
'; - - $pdesc = '
' . $profile['pdesc'] . '
'; - - $tabs = ''; - - $photo = '
' . $profile['name'] . '
'; - + // don't show connect link to yourself - $connect = (($profile['uid'] != local_user()) ? '
  • ' . t('Connect') . '
  • ' : ''); + $connect = (($profile['uid'] != local_user()) ? t('Connect') : False); // don't show connect link to authenticated visitors either if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid'])) - $connect = ''; + $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)) { + + 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'), + + ); + } + + + } + + + } + + + + 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; + $location = t('Location:'); - if($address) { - $location .= '
    ' . t('Location:') . '
    '; - $location .= ((x($profile,'address') == 1) ? '
    ' . $profile['address'] . '
    ' : ''); - $location .= (((x($profile,'locality') == 1) || (x($profile,'region') == 1) || (x($profile,'postal-code') == 1)) - ? '' . $profile['locality'] . '' - . ((x($profile['locality']) == 1) ? t(', ') : '') - . '' . $profile['region'] . '' - . ' ' . $profile['postal-code'] . '' : ''); - $location .= ((x($profile,'country-name') == 1) ? ' ' . $profile['country-name'] . '' : ''); - $location .= '
    '; - - } + $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False); - $gender = ((x($profile,'gender') == 1) ? '
    ' . t('Gender:') . ' ' . $profile['gender'] . '
    ' : ''); + $marital = ((x($profile,'marital') == 1) ? t('Status:') : False); - $pubkey = ((x($profile,'pubkey') == 1) ? '' : ''); - - $marital = ((x($profile,'marital') == 1) ? '
    ' . t('Status:') . ' ' . $profile['marital'] . '
    ' : ''); - - $homepage = ((x($profile,'homepage') == 1) ? '
    ' . t('Homepage:') . ' ' . linkify($profile['homepage']) . '
    ' : ''); + $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False); if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) { - $location = $pdesc = $connect = $gender = $marital = $homepage = ''; + $location = $pdesc = $connect = $gender = $marital = $homepage = False; } - $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 = 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', + ); - $diaspora_vcard = <<< EOT + if (!$block){ + $contact_block = contact_block(); + } -
    -
    -
    Nickname
    -
    -$nickname -
    -
    -
    -
    Full name
    -
    -$fullname -
    -
    -
    -
    URL
    -
    -$podloc/ -
    -
    -
    -
    Photo
    -
    - -
    -
    -
    -
    Photo
    -
    - -
    -
    -
    -
    Photo
    -
    - -
    -
    -
    -
    Searchable
    -
    -$searchable -
    -
    -
    -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; }} + diff --git a/images/connect-bg.png b/images/connect-bg.png new file mode 100644 index 00000000..0611c73e Binary files /dev/null and b/images/connect-bg.png differ diff --git a/images/icons/10/add.png b/images/icons/10/add.png new file mode 100644 index 00000000..296e8e50 Binary files /dev/null and b/images/icons/10/add.png differ diff --git a/images/icons/10/delete.png b/images/icons/10/delete.png new file mode 100644 index 00000000..e4bd8593 Binary files /dev/null and b/images/icons/10/delete.png differ diff --git a/images/icons/10/edit.png b/images/icons/10/edit.png new file mode 100644 index 00000000..d939342a Binary files /dev/null and b/images/icons/10/edit.png differ diff --git a/images/icons/10/feed.png b/images/icons/10/feed.png new file mode 100644 index 00000000..22aa5fd4 Binary files /dev/null and b/images/icons/10/feed.png differ diff --git a/images/icons/10/gear.png b/images/icons/10/gear.png new file mode 100644 index 00000000..b1f2a8f5 Binary files /dev/null and b/images/icons/10/gear.png differ diff --git a/images/icons/10/group.png b/images/icons/10/group.png new file mode 100644 index 00000000..a58d5191 Binary files /dev/null and b/images/icons/10/group.png differ diff --git a/images/icons/10/info.png b/images/icons/10/info.png new file mode 100644 index 00000000..667c127c Binary files /dev/null and b/images/icons/10/info.png differ diff --git a/images/icons/10/lock.png b/images/icons/10/lock.png new file mode 100644 index 00000000..ad8079c2 Binary files /dev/null and b/images/icons/10/lock.png differ diff --git a/images/icons/10/menu.png b/images/icons/10/menu.png new file mode 100644 index 00000000..7dbb779d Binary files /dev/null and b/images/icons/10/menu.png differ diff --git a/images/icons/10/notice.png b/images/icons/10/notice.png new file mode 100644 index 00000000..88ea4ac7 Binary files /dev/null and b/images/icons/10/notice.png differ diff --git a/images/icons/10/notify_off.png b/images/icons/10/notify_off.png new file mode 100644 index 00000000..8ba240e1 Binary files /dev/null and b/images/icons/10/notify_off.png differ diff --git a/images/icons/10/notify_on.png b/images/icons/10/notify_on.png new file mode 100644 index 00000000..d4ef7155 Binary files /dev/null and b/images/icons/10/notify_on.png differ diff --git a/images/icons/10/star.png b/images/icons/10/star.png new file mode 100644 index 00000000..cd8518a1 Binary files /dev/null and b/images/icons/10/star.png differ diff --git a/images/icons/10/user.png b/images/icons/10/user.png new file mode 100644 index 00000000..6c2d161e Binary files /dev/null and b/images/icons/10/user.png differ diff --git a/images/icons/16/add.png b/images/icons/16/add.png new file mode 100644 index 00000000..1ff064bb Binary files /dev/null and b/images/icons/16/add.png differ diff --git a/images/icons/16/delete.png b/images/icons/16/delete.png new file mode 100644 index 00000000..53234686 Binary files /dev/null and b/images/icons/16/delete.png differ diff --git a/images/icons/16/edit.png b/images/icons/16/edit.png new file mode 100644 index 00000000..bd845a76 Binary files /dev/null and b/images/icons/16/edit.png differ diff --git a/images/icons/16/feed.png b/images/icons/16/feed.png new file mode 100644 index 00000000..082e1bc7 Binary files /dev/null and b/images/icons/16/feed.png differ diff --git a/images/icons/16/gear.png b/images/icons/16/gear.png new file mode 100644 index 00000000..86cbe1eb Binary files /dev/null and b/images/icons/16/gear.png differ diff --git a/images/icons/16/group.png b/images/icons/16/group.png new file mode 100644 index 00000000..29ef6967 Binary files /dev/null and b/images/icons/16/group.png differ diff --git a/images/icons/16/info.png b/images/icons/16/info.png new file mode 100644 index 00000000..e8e7b35b Binary files /dev/null and b/images/icons/16/info.png differ diff --git a/images/icons/16/lock.png b/images/icons/16/lock.png new file mode 100644 index 00000000..f4432bbe Binary files /dev/null and b/images/icons/16/lock.png differ diff --git a/images/icons/16/menu.png b/images/icons/16/menu.png new file mode 100644 index 00000000..a6b1cac4 Binary files /dev/null and b/images/icons/16/menu.png differ diff --git a/images/icons/16/notice.png b/images/icons/16/notice.png new file mode 100644 index 00000000..13c5c6b7 Binary files /dev/null and b/images/icons/16/notice.png differ diff --git a/images/icons/16/notify_off.png b/images/icons/16/notify_off.png new file mode 100644 index 00000000..3031fc90 Binary files /dev/null and b/images/icons/16/notify_off.png differ diff --git a/images/icons/16/notify_on.png b/images/icons/16/notify_on.png new file mode 100644 index 00000000..1da6245a Binary files /dev/null and b/images/icons/16/notify_on.png differ diff --git a/images/icons/16/star.png b/images/icons/16/star.png new file mode 100644 index 00000000..ac620c43 Binary files /dev/null and b/images/icons/16/star.png differ diff --git a/images/icons/16/user.png b/images/icons/16/user.png new file mode 100644 index 00000000..95c42c57 Binary files /dev/null and b/images/icons/16/user.png differ diff --git a/images/icons/22/add.png b/images/icons/22/add.png new file mode 100644 index 00000000..2079e725 Binary files /dev/null and b/images/icons/22/add.png differ diff --git a/images/icons/22/delete.png b/images/icons/22/delete.png new file mode 100644 index 00000000..d0f2acf1 Binary files /dev/null and b/images/icons/22/delete.png differ diff --git a/images/icons/22/edit.png b/images/icons/22/edit.png new file mode 100644 index 00000000..ad251b8e Binary files /dev/null and b/images/icons/22/edit.png differ diff --git a/images/icons/22/feed.png b/images/icons/22/feed.png new file mode 100644 index 00000000..a0b75f11 Binary files /dev/null and b/images/icons/22/feed.png differ diff --git a/images/icons/22/gear.png b/images/icons/22/gear.png new file mode 100644 index 00000000..9ccf5280 Binary files /dev/null and b/images/icons/22/gear.png differ diff --git a/images/icons/22/group.png b/images/icons/22/group.png new file mode 100644 index 00000000..f1360159 Binary files /dev/null and b/images/icons/22/group.png differ diff --git a/images/icons/22/info.png b/images/icons/22/info.png new file mode 100644 index 00000000..18d32664 Binary files /dev/null and b/images/icons/22/info.png differ diff --git a/images/icons/22/lock.png b/images/icons/22/lock.png new file mode 100644 index 00000000..92c8c490 Binary files /dev/null and b/images/icons/22/lock.png differ diff --git a/images/icons/22/menu.png b/images/icons/22/menu.png new file mode 100644 index 00000000..e3461da8 Binary files /dev/null and b/images/icons/22/menu.png differ diff --git a/images/icons/22/notice.png b/images/icons/22/notice.png new file mode 100644 index 00000000..2b977389 Binary files /dev/null and b/images/icons/22/notice.png differ diff --git a/images/icons/22/notify_off.png b/images/icons/22/notify_off.png new file mode 100644 index 00000000..513687bc Binary files /dev/null and b/images/icons/22/notify_off.png differ diff --git a/images/icons/22/notify_on.png b/images/icons/22/notify_on.png new file mode 100644 index 00000000..18002e15 Binary files /dev/null and b/images/icons/22/notify_on.png differ diff --git a/images/icons/22/star.png b/images/icons/22/star.png new file mode 100644 index 00000000..484e2479 Binary files /dev/null and b/images/icons/22/star.png differ diff --git a/images/icons/22/user.png b/images/icons/22/user.png new file mode 100644 index 00000000..79bb05e4 Binary files /dev/null and b/images/icons/22/user.png differ diff --git a/images/icons/48/add.png b/images/icons/48/add.png new file mode 100644 index 00000000..753ac4b6 Binary files /dev/null and b/images/icons/48/add.png differ diff --git a/images/icons/48/delete.png b/images/icons/48/delete.png new file mode 100644 index 00000000..2835638a Binary files /dev/null and b/images/icons/48/delete.png differ diff --git a/images/icons/48/edit.png b/images/icons/48/edit.png new file mode 100644 index 00000000..709fbb35 Binary files /dev/null and b/images/icons/48/edit.png differ diff --git a/images/icons/48/feed.png b/images/icons/48/feed.png new file mode 100644 index 00000000..13d88f70 Binary files /dev/null and b/images/icons/48/feed.png differ diff --git a/images/icons/48/gear.png b/images/icons/48/gear.png new file mode 100644 index 00000000..8bb12e96 Binary files /dev/null and b/images/icons/48/gear.png differ diff --git a/images/icons/48/group.png b/images/icons/48/group.png new file mode 100644 index 00000000..26238ac6 Binary files /dev/null and b/images/icons/48/group.png differ diff --git a/images/icons/48/info.png b/images/icons/48/info.png new file mode 100644 index 00000000..760eca5c Binary files /dev/null and b/images/icons/48/info.png differ diff --git a/images/icons/48/lock.png b/images/icons/48/lock.png new file mode 100644 index 00000000..9943bb17 Binary files /dev/null and b/images/icons/48/lock.png differ diff --git a/images/icons/48/menu.png b/images/icons/48/menu.png new file mode 100644 index 00000000..376e60ca Binary files /dev/null and b/images/icons/48/menu.png differ diff --git a/images/icons/48/notice.png b/images/icons/48/notice.png new file mode 100644 index 00000000..f6fbc95c Binary files /dev/null and b/images/icons/48/notice.png differ diff --git a/images/icons/48/notify_off.png b/images/icons/48/notify_off.png new file mode 100644 index 00000000..7c8cd978 Binary files /dev/null and b/images/icons/48/notify_off.png differ diff --git a/images/icons/48/notify_on.png b/images/icons/48/notify_on.png new file mode 100644 index 00000000..3275898c Binary files /dev/null and b/images/icons/48/notify_on.png differ diff --git a/images/icons/48/star.png b/images/icons/48/star.png new file mode 100644 index 00000000..f53914ef Binary files /dev/null and b/images/icons/48/star.png differ diff --git a/images/icons/48/user.png b/images/icons/48/user.png new file mode 100644 index 00000000..c42410cd Binary files /dev/null and b/images/icons/48/user.png differ diff --git a/images/icons/add.png b/images/icons/add.png new file mode 100644 index 00000000..78497fbc Binary files /dev/null and b/images/icons/add.png differ diff --git a/images/icons/delete.png b/images/icons/delete.png new file mode 100644 index 00000000..f0cae515 Binary files /dev/null and b/images/icons/delete.png differ diff --git a/images/icons/edit.png b/images/icons/edit.png new file mode 100644 index 00000000..aeaf835f Binary files /dev/null and b/images/icons/edit.png differ diff --git a/images/icons/feed.png b/images/icons/feed.png new file mode 100644 index 00000000..6894257e Binary files /dev/null and b/images/icons/feed.png differ diff --git a/images/icons/gear.png b/images/icons/gear.png new file mode 100644 index 00000000..02847ef9 Binary files /dev/null and b/images/icons/gear.png differ diff --git a/images/icons/group.png b/images/icons/group.png new file mode 100644 index 00000000..de0dc790 Binary files /dev/null and b/images/icons/group.png differ diff --git a/images/icons/info.png b/images/icons/info.png new file mode 100644 index 00000000..ea2b0ffa Binary files /dev/null and b/images/icons/info.png differ diff --git a/images/icons/lock.png b/images/icons/lock.png new file mode 100644 index 00000000..7e58ead2 Binary files /dev/null and b/images/icons/lock.png differ diff --git a/images/icons/make.sh b/images/icons/make.sh new file mode 100644 index 00000000..34811741 --- /dev/null +++ b/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." diff --git a/images/icons/menu.png b/images/icons/menu.png new file mode 100644 index 00000000..56afc854 Binary files /dev/null and b/images/icons/menu.png differ diff --git a/images/icons/notice.png b/images/icons/notice.png new file mode 100644 index 00000000..b6017c8d Binary files /dev/null and b/images/icons/notice.png differ diff --git a/images/icons/notify_off.png b/images/icons/notify_off.png new file mode 100644 index 00000000..e6eac16b Binary files /dev/null and b/images/icons/notify_off.png differ diff --git a/images/icons/notify_on.png b/images/icons/notify_on.png new file mode 100644 index 00000000..b9e07d24 Binary files /dev/null and b/images/icons/notify_on.png differ diff --git a/images/icons/star.png b/images/icons/star.png new file mode 100644 index 00000000..4a2236c9 Binary files /dev/null and b/images/icons/star.png differ diff --git a/images/icons/user.png b/images/icons/user.png new file mode 100644 index 00000000..f1132b1a Binary files /dev/null and b/images/icons/user.png differ diff --git a/include/conversation.php b/include/conversation.php index b8364ad3..acbbc9bd 100644 --- a/include/conversation.php +++ b/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 .= ''; } $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'])))) - ? '
    ' . t('Private Message') . '
    ' - : '
    '); + ? 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) ? '' : ''); + $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 .= ''; + $treads[$treadsid] .= ''; - if($dropping) - $o .= '
    '; + $page_template = get_markup_template("conversation.tpl"); + $o .= replace_macros($page_template, array( + '$treads' => $treads, + '$dropping' => $dropping, + )); + //if($dropping) + // $o .= '
    '; return $o; } diff --git a/include/nav.php b/include/nav.php index 895c321e..b290a8da 100644 --- a/include/nav.php +++ b/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'; } diff --git a/include/template_processor.php b/include/template_processor.php index 90452dac..63d75eaa 100644 --- a/include/template_processor.php +++ b/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 "
    ";
    +			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);
    diff --git a/include/text.php b/include/text.php
    index cc181816..ea64a3d2 100644
    --- a/include/text.php
    +++ b/include/text.php
    @@ -538,22 +538,30 @@ function contact_block() {
     		$total = intval($r[0]['total']);
     	}
     	if(! $total) {
    -		$o .= '

    ' . t('No contacts') . '

    '; - 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 .= '

    ' . sprintf( tt('%d Contact','%d Contacts', $total),$total) . '

    '; - foreach($r as $rr) { - $o .= micropro($rr,true,'mpfriend'); - } - $o .= '
    '; - $o .= '
    ' . t('View Contacts') . '
    '; + $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'])) ? '' : ''); - 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; } } -} \ No newline at end of file +} diff --git a/index.php b/index.php index 17d250e5..98733c4c 100644 --- a/index.php +++ b/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'] = "
    {$_SESSION['sysmsg']}
    \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'] .= '
    '; */ if($a->module != 'install') { - require_once('nav.php'); nav($a); } diff --git a/include/acl.js b/js/acl.js similarity index 100% rename from include/acl.js rename to js/acl.js diff --git a/include/ajaxupload.js b/js/ajaxupload.js similarity index 100% rename from include/ajaxupload.js rename to js/ajaxupload.js diff --git a/include/country.js b/js/country.js similarity index 100% rename from include/country.js rename to js/country.js diff --git a/include/jquery.htmlstream.js b/js/jquery.htmlstream.js similarity index 100% rename from include/jquery.htmlstream.js rename to js/jquery.htmlstream.js diff --git a/include/jquery.js b/js/jquery.js similarity index 100% rename from include/jquery.js rename to js/jquery.js diff --git a/include/main.js b/js/main.js similarity index 79% rename from include/main.js rename to js/main.js index 9929c336..896cbeb5 100644 --- a/include/main.js +++ b/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(""+e.attr('name')+""); + 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(); }); } diff --git a/library/jgrowl/README b/library/jgrowl/README new file mode 100644 index 00000000..3c94f750 --- /dev/null +++ b/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 diff --git a/library/jgrowl/jquery.jgrowl.css b/library/jgrowl/jquery.jgrowl.css new file mode 100755 index 00000000..b4deb978 --- /dev/null +++ b/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 { + right: 0px; + bottom: 0px; +} + +div.jGrowl.center { + top: 0px; + width: 50%; + left: 25%; +} + +/** Cross Browser Styling **/ +div.center div.jGrowl-notification, div.center div.jGrowl-closer { + margin-left: auto; + margin-right: auto; +} + +div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer { + background-color: #000; + opacity: .85; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); + zoom: 1; + width: 235px; + padding: 10px; + margin-top: 5px; + margin-bottom: 5px; + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 1em; + text-align: left; + display: none; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +div.jGrowl div.jGrowl-notification { + min-height: 40px; +} + +div.jGrowl div.jGrowl-notification, +div.jGrowl div.jGrowl-closer { + margin: 10px; +} + +div.jGrowl div.jGrowl-notification div.jGrowl-header { + font-weight: bold; + font-size: .85em; +} + +div.jGrowl div.jGrowl-notification div.jGrowl-close { + z-index: 99; + float: right; + font-weight: bold; + font-size: 1em; + cursor: pointer; +} + +div.jGrowl div.jGrowl-closer { + padding-top: 4px; + padding-bottom: 4px; + cursor: pointer; + font-size: .9em; + font-weight: bold; + text-align: center; +} + +/** Hide jGrowl when printing **/ +@media print { + div.jGrowl { + display: none; + } +} diff --git a/library/jgrowl/jquery.jgrowl_minimized.js b/library/jgrowl/jquery.jgrowl_minimized.js new file mode 100644 index 00000000..78289809 --- /dev/null +++ b/library/jgrowl/jquery.jgrowl_minimized.js @@ -0,0 +1,11 @@ +(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0) +$('
    ').addClass((o&&o.position)?o.position:$.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);} +if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',themeState:'highlight',corners:'10px',check:250,life:3000,closeDuration:'normal',openDuration:'normal',easing:'swing',closer:true,closeTemplate:'×',closerTemplate:'
    [ close all ]
    ',log:function(e,m,o){},beforeOpen:function(e,m,o){},afterOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);if(typeof o.speed!=='undefined'){o.openDuration=o.speed;o.closeDuration=o.speed;} +this.notifications.push({message:message,options:o});o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('
    '+'
    '+o.closeTemplate+'
    '+'
    '+o.header+'
    '+'
    '+message+'
    ').data("jGrowl",o).addClass(o.theme).children('div.jGrowl-close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true);}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false);}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open');}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification);}else{$('div.jGrowl-notification:first',self.element).before(notification);} +$(this).animate(o.animateOpen,o.openDuration,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0)) +this.style.removeAttribute('filter');if($(this).data("jGrowl")!=null) +$(this).data("jGrowl").created=new Date();$(this).trigger('jGrowl.afterOpen');});}}).bind('jGrowl.afterOpen',function(){o.afterOpen.apply(notification,[notification,message,o,self.element]);}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false) +$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.closeDuration,o.easing,function(){if($.isFunction(o.close)){if(o.close.apply(notification,[notification,message,o,self.element])!==false) +$(this).remove();}else{$(this).remove();}});}).trigger('jGrowl.beforeOpen');if(o.corners!=''&&$.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().trigger("jGrowl.beforeClose");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+parseInt($(this).data("jGrowl").life))<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},parseInt(this.defaults.check));if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); \ No newline at end of file diff --git a/library/stanlemon-jgrowl-tip.tar.gz b/library/stanlemon-jgrowl-tip.tar.gz new file mode 100644 index 00000000..07a5fb09 Binary files /dev/null and b/library/stanlemon-jgrowl-tip.tar.gz differ diff --git a/library/tiptip/README b/library/tiptip/README new file mode 100644 index 00000000..a83cfba3 --- /dev/null +++ b/library/tiptip/README @@ -0,0 +1,30 @@ +http://code.drewwilson.com/entry/tiptip-jquery-plugin + +License +This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses. + + +ChangeLog +Version 1.3 (Mar. 23, 2010) + + Added defaultPoistion option that enables you to set the default orientation TipTip should show up as. + Added attribute option that enables you to set the HTML attribute that TipTip should pull it's content from. + Added content option. This will be used as the content for the TipTip and will overwrite any content pulled form any HTML attribute. + Added activation option enables you to specify the jQuery method TipTip is activated with: hover, focus or click. Now you can use TipTip on forms and for validation! + Added keepAlive option that when set to true the TipTip will only fadeout when you hover over the actual TipTip and then hover off of it. Allowing for hyperlinks inside your TipTip content to be accessible. + +Version 1.2 (Jan. 13, 2010) + + Added HTML support with Tip Tip. You can now add HTML into the Title attribute (though this is not recommended if you want strictly valid code). + Tightened up spacing margins in JS. + Updated margins in CSS file. + +Version 1.1 (Jan. 03, 2010) + + Swapped dynamically added orientation CSS class names ('_left' & '_right') to make better sense. + Added in some tighter spacing for the tooltip in JS. + +Version 1.0 (Jan. 02, 2010) + + Initial release. + diff --git a/library/tiptip/jquery.tipTip.minified.js b/library/tiptip/jquery.tipTip.minified.js new file mode 100644 index 00000000..cdf3a892 --- /dev/null +++ b/library/tiptip/jquery.tipTip.minified.js @@ -0,0 +1,21 @@ + /* + * TipTip + * Copyright 2010 Drew Wilson + * www.drewwilson.com + * code.drewwilson.com/entry/tiptip-jquery-plugin + * + * Version 1.3 - Updated: Mar. 23, 2010 + * + * This Plug-In will create a custom tooltip to replace the default + * browser tooltip. It is extremely lightweight and very smart in + * that it detects the edges of the browser window and will make sure + * the tooltip stays within the current window size. As a result the + * tooltip will adjust itself to be displayed above, below, to the left + * or to the right depending on what is necessary to stay within the + * browser window. It is completely customizable as well via CSS. + * + * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('
    ');var tiptip_content=$('
    ');var tiptip_arrow=$('
    ');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('
    ')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery); \ No newline at end of file diff --git a/library/tiptip/tipTip.css b/library/tiptip/tipTip.css new file mode 100644 index 00000000..4fb95d37 --- /dev/null +++ b/library/tiptip/tipTip.css @@ -0,0 +1,113 @@ +/* TipTip CSS - Version 1.2 */ + +#tiptip_holder { + display: none; + position: absolute; + top: 0; + left: 0; + z-index: 99999; +} + +#tiptip_holder.tip_top { + padding-bottom: 5px; +} + +#tiptip_holder.tip_bottom { + padding-top: 5px; +} + +#tiptip_holder.tip_right { + padding-left: 5px; +} + +#tiptip_holder.tip_left { + padding-right: 5px; +} + +#tiptip_content { + font-size: 11px; + color: #fff; + text-shadow: 0 0 2px #000; + padding: 4px 8px; + border: 1px solid rgba(255,255,255,0.25); + background-color: rgb(25,25,25); + background-color: rgba(25,25,25,0.92); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000)); + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + box-shadow: 0 0 3px #555; + -webkit-box-shadow: 0 0 3px #555; + -moz-box-shadow: 0 0 3px #555; +} + +#tiptip_arrow, #tiptip_arrow_inner { + position: absolute; + border-color: transparent; + border-style: solid; + border-width: 6px; + height: 0; + width: 0; +} + +#tiptip_holder.tip_top #tiptip_arrow { + border-top-color: #fff; + border-top-color: rgba(255,255,255,0.35); +} + +#tiptip_holder.tip_bottom #tiptip_arrow { + border-bottom-color: #fff; + border-bottom-color: rgba(255,255,255,0.35); +} + +#tiptip_holder.tip_right #tiptip_arrow { + border-right-color: #fff; + border-right-color: rgba(255,255,255,0.35); +} + +#tiptip_holder.tip_left #tiptip_arrow { + border-left-color: #fff; + border-left-color: rgba(255,255,255,0.35); +} + +#tiptip_holder.tip_top #tiptip_arrow_inner { + margin-top: -7px; + margin-left: -6px; + border-top-color: rgb(25,25,25); + border-top-color: rgba(25,25,25,0.92); +} + +#tiptip_holder.tip_bottom #tiptip_arrow_inner { + margin-top: -5px; + margin-left: -6px; + border-bottom-color: rgb(25,25,25); + border-bottom-color: rgba(25,25,25,0.92); +} + +#tiptip_holder.tip_right #tiptip_arrow_inner { + margin-top: -6px; + margin-left: -5px; + border-right-color: rgb(25,25,25); + border-right-color: rgba(25,25,25,0.92); +} + +#tiptip_holder.tip_left #tiptip_arrow_inner { + margin-top: -6px; + margin-left: -7px; + border-left-color: rgb(25,25,25); + border-left-color: rgba(25,25,25,0.92); +} + +/* Webkit Hacks */ +@media screen and (-webkit-min-device-pixel-ratio:0) { + #tiptip_content { + padding: 4px 8px 5px 8px; + background-color: rgba(45,45,45,0.88); + } + #tiptip_holder.tip_bottom #tiptip_arrow_inner { + border-bottom-color: rgba(45,45,45,0.88); + } + #tiptip_holder.tip_top #tiptip_arrow_inner { + border-top-color: rgba(20,20,20,0.92); + } +} \ No newline at end of file diff --git a/mod/admin.php b/mod/admin.php index e42fe93f..da561d55 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -540,7 +540,7 @@ function admin_page_plugins(&$a){ } $admin_form=""; - if (in_array($plugin, $a->plugins_admin)){ + if (is_array($a->plugins_admin) && in_array($plugin, $a->plugins_admin)){ @require_once("addon/$plugin/$plugin.php"); $func = $plugin.'_plugin_admin'; $func($a, $admin_form); diff --git a/mod/apps.php b/mod/apps.php index 7a0a3f59..8049b45f 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -1,15 +1,18 @@ ' . t('Applications') . ''; - - if($a->apps) - $o .= $a->apps; - else + if(count($a->apps)==0) notice( t('No installed applications.') . EOL); - return $o; -} \ No newline at end of file + $tpl = get_markup_template("apps.tpl"); + return replace_macros($tpl, array( + '$title' => $title, + '$apps' => $a->apps, + )); + + + +} diff --git a/mod/community.php b/mod/community.php index cf43598b..cb255029 100644 --- a/mod/community.php +++ b/mod/community.php @@ -25,7 +25,7 @@ function community_content(&$a, $update = 0) { $o .= '

    ' . t('Community') . '

    '; if(! $update) { - $o .= ''; + nav_set_selected('community'); $o .= '
    ' . "\r\n"; $o .= "\r\n"; } diff --git a/mod/contacts.php b/mod/contacts.php index 6dda546d..ea429d39 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -117,7 +117,7 @@ function contacts_content(&$a) { $sort_type = 0; $o = ''; - $o .= ''; + nav_set_selected('contacts'); $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; diff --git a/mod/directory.php b/mod/directory.php index 0c60f04b..93abcd5d 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -22,7 +22,7 @@ function directory_content(&$a) { } $o = ''; - $o .= ''; + nav_set_selected('directory'); if(x($_SESSION,'theme')) unset($_SESSION['theme']); diff --git a/mod/help.php b/mod/help.php index 495b4ccc..af05bd47 100644 --- a/mod/help.php +++ b/mod/help.php @@ -17,6 +17,7 @@ function load_doc_file($s) { function help_content(&$a) { + nav_set_selected('help'); global $lang; @@ -35,10 +36,12 @@ function help_content(&$a) { if(! strlen($text)) { header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found')); - notice( t('Page not found.' ) . EOL); - return; + $tpl = get_markup_template("404.tpl"); + return replace_macros($tpl, array( + '$message' => t('Page not found.' ) + )); } return Markdown($text); -} \ No newline at end of file +} diff --git a/mod/message.php b/mod/message.php index e031cdaf..1bee45d4 100644 --- a/mod/message.php +++ b/mod/message.php @@ -36,7 +36,7 @@ function message_post(&$a) { function message_content(&$a) { $o = ''; - $o .= ''; + nav_set_selected('messages'); if(! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/network.php b/mod/network.php index 739dcf0d..9488cd97 100644 --- a/mod/network.php +++ b/mod/network.php @@ -196,7 +196,7 @@ function network_content(&$a, $update = 0) { } } - $o .= ''; + nav_set_selected('network'); $_SESSION['return_url'] = $a->cmd; diff --git a/mod/notifications.php b/mod/notifications.php index 8c32ee86..0c35d4cd 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -64,7 +64,7 @@ function notifications_content(&$a) { } $o = ''; - $o .= ''; + nav_set_selected("notifications"); if(($a->argc > 1) && ($a->argv[1] == 'all')) $sql_extra = ''; diff --git a/mod/ping.php b/mod/ping.php index 924f9ff7..d11af2e0 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -1,5 +1,5 @@ "; + $obj = parse_xml_string($xmlhead.$it['object']); + $it['fname'] = $obj->title; + $friends[] = $it; + break; + default: + if ($it['parent']!=$it['id']) $comments[] = $it; + } + } - $r = q("SELECT COUNT(*) AS `total` FROM `item` - WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d AND `wall` = 1 ", - intval(local_user()) - ); - $home = $r[0]['total']; - $r = q("SELECT COUNT(*) AS `total` FROM `intro` - WHERE `uid` = %d AND `blocked` = 0 AND `ignore` = 0 ", + $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, + `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, + `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` + FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` + WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND + `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 1", + intval(local_user()) + ); + $home = count($r); + foreach ($r as $it) { + switch($it['verb']){ + case ACTIVITY_LIKE: + $likes[] = $it; + break; + case ACTIVITY_DISLIKE: + $dislikes[] = $it; + break; + case ACTIVITY_FRIEND: + $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; + $obj = parse_xml_string($xmlhead.$it['object']); + $it['fname'] = $obj->title; + $friends[] = $it; + break; + default: + if ($it['parent']!=$it['id']) $comments[] = $it; + } + } + + + $intros1 = q("SELECT COUNT(`intro`.`id`) AS `total`, `intro`.`id`, `intro`.`datetime`, + `fcontact`.`name`, `fcontact`.`url`, `fcontact`.`photo` + FROM `intro` LEFT JOIN `fcontact` ON `intro`.`fid` = `fcontact`.`id` + WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 AND `intro`.`fid`!=0", intval(local_user()) ); - $intro = $r[0]['total']; + $intros2 = q("SELECT COUNT(`intro`.`id`) AS `total`, `intro`.`id`, `intro`.`datetime`, + `contact`.`name`, `contact`.`url`, `contact`.`photo` + FROM `intro` LEFT JOIN `contact` ON `intro`.`contact-id` = `contact`.`id` + WHERE `intro`.`uid` = %d AND `intro`.`blocked` = 0 AND `intro`.`ignore` = 0 AND `intro`.`contact-id`!=0", + intval(local_user()) + ); + + $intro = $intros1[0]['total'] + $intros2[0]['total']; + if ($intros1[0]['total']==0) $intros1=Array(); + if ($intros2[0]['total']==0) $intros2=Array(); + $intros = $intros1+$intros2; + + $myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ; - $r = q("SELECT COUNT(*) AS `total` FROM `mail` + $mails = q("SELECT *, COUNT(*) AS `total` FROM `mail` WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ", intval(local_user()), dbesc($myurl) ); - $mail = $r[0]['total']; - + $mail = $mails[0]['total']; + if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){ - $r = q("SELECT COUNT(*) AS `total` FROM `register`"); - $register = $r[0]['total']; + $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); + $register = $regs[0]['total']; } else { $register = "0"; } + + function xmlize($href, $name, $url, $photo, $date, $message){ + $notsxml = '%s'; + return sprintf ( $notsxml, + $href, $name, $url, $photo, $date, $message + ); + } header("Content-type: text/xml"); - echo "\r\n$intro$mail$network$home$register\r\n"; + echo " + + $intro + $mail + $network + $home"; + if ($register!=0) echo "$register"; + + $tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends); + + echo ' '; + if ($intro>0){ + foreach ($intros as $i) { + echo xmlize( $a->get_baseurl().'/notifications/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") ); + }; + } + if ($mail>0){ + foreach ($mails as $i) { + echo xmlize( $a->get_baseurl().'/message/'.$i['id'], $i['from-name'], $i['from-url'], $i['from-photo'], relative_date($i['created']), t("{0} sent you a message") ); + }; + } + if ($register>0){ + foreach ($regs as $i) { + echo xmlize( $a->get_baseurl().'/admin/users/', $i['name'], $i['url'], $i['micro'], relative_date($i['created']), t("{0} requested registration") ); + }; + } + + if (count($comments)){ + foreach ($comments as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} commented %s's post"), $i['pname'] ) ); + }; + } + if (count($likes)){ + foreach ($likes as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} like %s's post"), $i['pname'] ) ); + }; + } + if (count($dislikes)){ + foreach ($dislikes as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} dislike %s's post"), $i['pname'] ) ); + }; + } + if (count($friends)){ + foreach ($friends as $i) { + echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} is now friend with %s"), $i['fname'] ) ); + }; + } + + + echo " "; + + echo " "; + if(x($_SESSION,'sysmsg')){ + foreach ($_SESSION['sysmsg'] as $m){ + echo "".($m).""; + } + $_SESSION['sysmsg']=array(); + unset($_SESSION['sysmsg']); + } + if(x($_SESSION,'sysmsg_info')){ + foreach ($_SESSION['sysmsg_info'] as $m){ + echo "".($m).""; + } + $_SESSION['sysmsg_info']=array(); + unset($_SESSION['sysmsg_info']); + } + + echo " "; + echo" + "; killme(); } diff --git a/mod/profile.php b/mod/profile.php index b09251cd..50bbdd46 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -70,8 +70,9 @@ function profile_content(&$a, $update = 0) { $a->profile['profile_uid'] = $update; } else { - if($a->profile['profile_uid'] == local_user()) - $o .= ''; + if($a->profile['profile_uid'] == local_user()) { + nav_set_selected('home'); + } } $contact = null; diff --git a/mod/profiles.php b/mod/profiles.php index b269fa30..5cc9fa38 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -220,7 +220,7 @@ function profiles_post(&$a) { function profiles_content(&$a) { $o = ''; - $o .= ''; + nav_set_selected('profiles'); if(! local_user()) { notice( t('Permission denied.') . EOL); diff --git a/mod/search.php b/mod/search.php index 2ce3c8dc..396b5073 100644 --- a/mod/search.php +++ b/mod/search.php @@ -68,6 +68,8 @@ function search_content(&$a) { notice( t('Public access denied.') . EOL); return; } + + nav_set_selected('search'); require_once("include/bbcode.php"); require_once('include/security.php'); diff --git a/mod/settings.php b/mod/settings.php index 1b4098de..44ebdd77 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -299,7 +299,7 @@ if(! function_exists('settings_content')) { function settings_content(&$a) { $o = ''; - $o .= ''; + nav_set_selected('settings'); if(! local_user()) { notice( t('Permission denied.') . EOL ); diff --git a/view/404.tpl b/view/404.tpl new file mode 100644 index 00000000..bf4d4e94 --- /dev/null +++ b/view/404.tpl @@ -0,0 +1 @@ +

    $message

    diff --git a/view/admin_remoteupdate.tpl b/view/admin_remoteupdate.tpl index 0c15692c..41ecfaf8 100644 --- a/view/admin_remoteupdate.tpl +++ b/view/admin_remoteupdate.tpl @@ -1,4 +1,4 @@ - + + + + - - + + - + - + - +