diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2014-11-24 14:19:22 +0100 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2014-11-24 14:19:22 +0100 |
commit | bef8879cb1356b880279c6104fcffb0752414a7c (patch) | |
tree | ce3733df7ca168f4afe7e963dc81b6f00944c34c /include/dir_fns.php | |
parent | 1cb45c30e9032794b7827738cc28f7728ac28677 (diff) | |
parent | 5b7124f0daeca4aa619f6411ee373d9ff5a22b7b (diff) | |
download | volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.tar.gz volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.tar.bz2 volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.zip |
Merge pull request #7 from friendica/master
Merge from main project
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r-- | include/dir_fns.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php index f58e7c307..909005bbb 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -38,7 +38,7 @@ function check_upstream_directory() { */ $directory = get_config('system','directory_server'); if ($directory) { - $r = q("select * from site where site_url = '%s' and (site_flags & %d) ", + $r = q("select * from site where site_url = '%s' and (site_flags & %d) > 0 ", dbesc($directory), intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY|DIRECTORY_MODE_STANDALONE) ); @@ -53,10 +53,11 @@ function check_upstream_directory() { function dir_sort_links() { $o = replace_macros(get_markup_template('dir_sort_links.tpl'), array( - '$header' => t('Sort Options'), + '$header' => t('Directory Options'), '$normal' => t('Alphabetic'), '$reverse' => t('Reverse Alphabetic'), - '$date' => t('Newest to Oldest') + '$date' => t('Newest to Oldest'), + '$pubforums' => t('Public Forums Only'), )); return $o; } @@ -86,14 +87,14 @@ function sync_directories($dirmode) { $realm = get_directory_realm(); if($realm == DIRECTORY_REALM) { - $r = q("select * from site where (site_flags & %d) and site_url != '%s' and ( site_realm = '%s' or site_realm = '') ", + $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and ( site_realm = '%s' or site_realm = '') ", intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY), dbesc(z_root()), dbesc($realm) ); } else { - $r = q("select * from site where (site_flags & %d) and site_url != '%s' and site_realm like '%s' ", + $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_realm like '%s' ", intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY), dbesc(z_root()), dbesc(protect_sprintf('%' . $realm . '%')) @@ -120,7 +121,7 @@ function sync_directories($dirmode) { dbesc($r[0]['site_realm']) ); - $r = q("select * from site where (site_flags & %d) and site_url != '%s'", + $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s'", intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY), dbesc(z_root()) ); @@ -146,7 +147,7 @@ function sync_directories($dirmode) { if((! $j['transactions']) || (! is_array($j['transactions']))) continue; - q("update site set site_sync = '%s' where site_url = '%s' limit 1", + q("update site set site_sync = '%s' where site_url = '%s'", dbesc(datetime_convert()), dbesc($rr['site_url']) ); @@ -267,7 +268,7 @@ function local_dir_update($uid,$force) { if($new_flags != $r[0]['xchan_flags']) { - $r = q("update xchan set xchan_flags = %d where xchan_hash = '%s' limit 1", + $r = q("update xchan set xchan_flags = %d where xchan_hash = '%s'", intval($new_flags), dbesc($p[0]['channel_hash']) ); @@ -281,10 +282,10 @@ function local_dir_update($uid,$force) { } else { // they may have made it private - $r = q("delete from xprof where xprof_hash = '%s' limit 1", + $r = q("delete from xprof where xprof_hash = '%s'", dbesc($hash) ); - $r = q("delete from xtag where xtag_hash = '%s' limit 1", + $r = q("delete from xtag where xtag_hash = '%s'", dbesc($hash) ); } |