fix directory page on testbubble, don't use system theme for community, directory, and search if the viewer is logged in.
--- /dev/null
+<?php
+
+function follow_widget() {
+
+ return replace_macros(get_markup_template('follow.tpl'),array(
+ '$connect' => t('Add New Contact'),
+ '$desc' => t('Enter address or web location'),
+ '$hint' => t('Example: bob@example.com, http://example.com/barbara'),
+ '$follow' => t('Connect')
+ ));
+
+}
+
+function findpeople_widget() {
+
+ $a = get_app();
+
+ $inv = (($a->config['register_policy'] != REGISTER_CLOSED) ? t('Invite Friends') : '');
+
+ if(get_config('system','invitation_only')) {
+ $x = get_pconfig(local_user(),'system','invites_remaining');
+ if($x || is_site_admin()) {
+ $a->page['aside'] .= '<div class="side-link" id="side-invite-remain">'
+ . sprintf( tt('%d invitation available','%d invitations available',$x), $x)
+ . '</div>' . $inv;
+ }
+ }
+
+ return replace_macros(get_markup_template('peoplefind.tpl'),array(
+ '$findpeople' => t('Find People'),
+ '$desc' => t('Enter name or interest'),
+ '$label' => t('Connect/Follow'),
+ '$hint' => t('Examples: Robert Morgenstein, Fishing'),
+ '$findthem' => t('Find'),
+ '$similar' => t('Similar Interests'),
+ '$inv' => $inv
+ ));
+
+}
+
<?php
+function community_init(&$a) {
+ if(! local_user())
+ unset($_SESSION['theme']);
+
+
+}
+
function community_content(&$a, $update = 0) {
require_once('include/security.php');
require_once('include/conversation.php');
- if(x($_SESSION,'theme'))
- unset($_SESSION['theme']);
-
$o .= '<h3>' . t('Community') . '</h3>';
if(! $update) {
}
require_once('include/group.php');
+ require_once('include/contact_widgets.php');
+
if(! x($a->page,'aside'))
$a->page['aside'] = '';
- $a->page['aside'] .= replace_macros(get_markup_template('follow.tpl'),array(
- '$connect' => t('Add New Contact'),
- '$desc' => t('Enter address or web location'),
- '$hint' => t('Example: bob@example.com, http://example.com/barbara'),
- '$follow' => t('Connect')
- ));
-
-
+ $a->page['aside'] .= follow_widget();
$a->page['aside'] .= group_side('contacts','group',false,0,$contact_id);
- if(get_config('system','invitation_only')) {
- $x = get_pconfig(local_user(),'system','invites_remaining');
- if($x || is_site_admin()) {
- $a->page['aside'] .= '<div class="side-link" id="side-invite-remain">'
- . sprintf( tt('%d invitation available','%d invitations available',$x), $x)
- . '</div>' . $inv;
- }
- }
-
- $tpl = get_markup_template('peoplefind.tpl');
-
- $inv = (($a->config['register_policy'] != REGISTER_CLOSED) ? t('Invite Friends') : '');
-
- $a->page['aside'] .= replace_macros($tpl,array(
- '$findpeople' => t('Find People'),
- '$desc' => t('Enter name or interest'),
- '$label' => t('Connect/Follow'),
- '$hint' => t('Examples: Robert Morgenstein, Fishing'),
- '$findthem' => t('Find'),
- '$similar' => t('Similar Interests'),
- '$inv' => $inv
- ));
-
-
+ $a->page['aside'] .= findpeople_widget();
}
function directory_init(&$a) {
$a->set_pager_itemspage(60);
+
+ if(local_user()) {
+ require_once('include/contact_widgets.php');
+
+ $a->page['aside'] .= findpeople_widget();
+
+ }
+ else
+ unset($_SESSION['theme']);
+
+
}
$o = '';
nav_set_selected('directory');
- if(x($_SESSION,'theme'))
- unset($_SESSION['theme']);
if(x($a->data,'search'))
$search = notags(trim($a->data['search']));
if($everything)
$admin = '<ul><li><div id="directory-admin-link"><a href="' . $a->get_baseurl() . '/directory' . '">' . t('Normal site view') . '</a></div></li></ul>';
else
- $admin = '<ul><li><div id="directory-admin-link"><a href="' . $a->get_baseurl() . '/directory/all' . '">' . t('View all site entries') . '</a></div></li></ul>';
+ $admin = '<ul><li><div id="directory-admin-link"><a href="' . $a->get_baseurl() . '/directory/all' . '">' . t('Admin - View all site entries') . '</a></div></li></ul>';
}
$o .= replace_macros($tpl, array(
'$search' => $search,
'$globaldir' => $globaldir,
+ '$desc' => t('Find on this site'),
'$admin' => $admin,
'$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""),
'$sitedir' => t('Site Directory'),
<?php
+function dirfind_init(&$a) {
+
+ require_once('include/contact_widgets.php');
+
+ if(! x($a->page,'aside'))
+ $a->page['aside'] = '';
+
+ $a->page['aside'] .= follow_widget();
+
+ $a->page['aside'] .= findpeople_widget();
+}
+
+
function dirfind_content(&$a) {
if(count($r)) {
$o .= '<ul id="saved-search-ul">' . "\r\n";
foreach($r as $rr) {
- $o .= '<li class="saved-search-li clear"><a href="network/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="network/?f&search=' . urlencode($rr['term']) . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
+ $o .= '<li class="saved-search-li clear"><a href="network/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="network/?f=&search=' . urlencode($rr['term']) . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
$o .= '</ul>';
}
+ $o .= '<div class="clear"></div>';
+
$o .= '</div>' . "\r\n";
return $o;
foreach($r as $rr) {
$o .= '<li class="saved-search-li clear"><a href="search/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="search/?f=&search=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
- $o .= '</ul></div>' . "\r\n";
+ $o .= '</ul><div class="clear"></div></div>' . "\r\n";
}
return $o;
$a->page['aside'] .= search_saved_searches();
}
+ else
+ unset($_SESSION['theme']);
+
}
require_once('include/security.php');
require_once('include/conversation.php');
- if(x($_SESSION,'theme'))
- unset($_SESSION['theme']);
-
$o = '<div id="live-search"></div>' . "\r\n";
- $o .= '<h3>' . t('Search') . '</h3>';
+ $o .= '<h3>' . t('Search This Site') . '</h3>';
if(x($a->data,'search'))
$search = notags(trim($a->data['search']));
<div id="directory-search-wrapper">
<form id="directory-search-form" action="directory" method="get" >
+<span class="dirsearch-desc">$desc</span>
<input type="text" name="search" id="directory-search" class="search-input" onfocus="this.select();" value="$search" />
<input type="submit" name="submit" id="directory-search-submit" value="$submit" class="button" />
</form>
width: 150px;
}
+.directory-end {
+ clear: both;
+}
+
/* ========= */
/* = Admin = */
/* ========= */