remove admin view of local directory

This commit is contained in:
friendica 2012-03-17 22:14:17 -07:00
parent 67fd539f53
commit 9e731506c2
2 changed files with 63 additions and 151 deletions

View file

@ -45,33 +45,7 @@
s = tinymce.trim(s);
function rep(re, str) {
//modify code to keep stuff intact within [code][/code] blocks
//Waitman Gobble NO WARRANTY
var o = new Array();
var x = s.split("[code]");
var i = 0;
var si = "";
si = x.shift();
si = si.replace(re,str);
o.push(si);
for (i = 0; i < x.length; i++) {
var no = new Array();
var j = x.shift();
var g = j.split("[/code]");
no.push(g.shift());
si = g.shift();
si = si.replace(re,str);
no.push(si);
o.push(no.join("[/code]"));
}
s = o.join("[code]");
s = s.replace(re, str);
};
@ -79,7 +53,6 @@
/* oembed */
function _h2b_cb(match) {
/*
function s_h2b(data) {
match = data;
}
@ -91,23 +64,6 @@
success: s_h2b,
dataType: 'html'
});
*/
var f, g, tof = [], tor = [];
var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;
while (f = find_spanc.exec(match)) {
var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;
if (g = find_a.exec(f[1])) {
var find_href = /href=[\"']([^\"']*)[\"']/ig;
var m2 = find_href.exec(g[1]);
if (m2[1]) {
tof.push(f[0]);
tor.push("[EMBED]" + m2[1] + "[/EMBED]");
}
}
}
for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);
return match;
}
if (s.indexOf('class="oembed')>=0){
@ -168,40 +124,9 @@
_dfrn_bbcode2html : function(s) {
s = tinymce.trim(s);
function rep(re, str) {
//modify code to keep stuff intact within [code][/code] blocks
//Waitman Gobble NO WARRANTY
var o = new Array();
var x = s.split("[code]");
var i = 0;
var si = "";
si = x.shift();
si = si.replace(re,str);
o.push(si);
for (i = 0; i < x.length; i++) {
var no = new Array();
var j = x.shift();
var g = j.split("[/code]");
no.push(g.shift());
si = g.shift();
si = si.replace(re,str);
no.push(si);
o.push(no.join("[/code]"));
}
s = o.join("[code]");
};
function rep(re, str) {
s = s.replace(re, str);
};
// example: [b] to <strong>
rep(/\n/gi,"<br />");

View file

@ -25,10 +25,6 @@ function directory_post(&$a) {
function directory_content(&$a) {
$everything = (($a->argc > 1 && $a->argv[1] === 'all' && is_site_admin()) ? true : false);
if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
$everything = false;
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL);
return;
@ -52,12 +48,6 @@ function directory_content(&$a) {
}
$admin = '';
if(is_site_admin()) {
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('Admin - View all site entries') . '</a></div></li></ul>';
}
$o .= replace_macros($tpl, array(
'$search' => $search,
@ -73,17 +63,14 @@ function directory_content(&$a) {
$search = dbesc($search);
$sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`pub_keywords`,`prv_keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
$publish = ((get_config('system','publish_all') || $everything) ? '' : " AND `publish` = 1 " );
$publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " );
$r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ");
if(count($r))
$a->set_pager_total($r[0]['total']);
if($everything)
$order = " ORDER BY `register_date` DESC ";
else
$order = " ORDER BY `name` ASC ";
$order = " ORDER BY `name` ASC ";
$r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",