diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-10 15:47:23 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-10 15:47:23 -0700 |
commit | 2128d5a2560383e0d3587087a7dd0aab217bc262 (patch) | |
tree | c2aa27a08a9e96ecf291d10db46e4fcf0e3806c9 /mod | |
parent | eb6a1f838724504f0034d51a28567ea9a8119b54 (diff) | |
parent | 52ddbd1adda88690a19aafc35e455b01d059852f (diff) | |
download | volse-hubzilla-2128d5a2560383e0d3587087a7dd0aab217bc262.tar.gz volse-hubzilla-2128d5a2560383e0d3587087a7dd0aab217bc262.tar.bz2 volse-hubzilla-2128d5a2560383e0d3587087a7dd0aab217bc262.zip |
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Diffstat (limited to 'mod')
-rw-r--r-- | mod/home.php | 11 | ||||
-rw-r--r-- | mod/item.php | 44 |
2 files changed, 27 insertions, 28 deletions
diff --git a/mod/home.php b/mod/home.php index b2779051d..242b2dcec 100644 --- a/mod/home.php +++ b/mod/home.php @@ -72,13 +72,10 @@ function home_content(&$a, $update = 0, $load = false) { if($sitename) $o .= '<h1>' . sprintf( t("Welcome to %s") ,$sitename) . '</h1>'; - if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) { - // If there's nothing special happening, just spit out a login box - $loginbox = get_config('system','login_on_homepage'); - if(intval($loginbox) || $loginbox === false) - $o .= login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1); - } + $loginbox = get_config('system','login_on_homepage'); + if(intval($loginbox) || $loginbox === false) + $o .= login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1); return $o; -}
\ No newline at end of file +} diff --git a/mod/item.php b/mod/item.php index 94b32d01c..d631bd1f2 100644 --- a/mod/item.php +++ b/mod/item.php @@ -581,27 +581,6 @@ function item_post(&$a) { } } - $attachments = ''; - $match = false; - - if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { - $attachments = array(); - foreach($match[2] as $mtch) { - $hash = substr($mtch,0,strpos($mtch,',')); - $rev = intval(substr($mtch,strpos($mtch,','))); - $r = attach_by_hash_nodata($hash,$rev); - if($r['success']) { - $attachments[] = array( - 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'], - 'length' => $r['data']['filesize'], - 'type' => $r['data']['filetype'], - 'title' => urlencode($r['data']['filename']), - 'revision' => $r['data']['revision'] - ); - } - $body = str_replace($match[1],'',$body); - } - } /** * @@ -638,6 +617,29 @@ function item_post(&$a) { } + + $attachments = ''; + $match = false; + + if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { + $attachments = array(); + foreach($match[2] as $mtch) { + $hash = substr($mtch,0,strpos($mtch,',')); + $rev = intval(substr($mtch,strpos($mtch,','))); + $r = attach_by_hash_nodata($hash,$rev); + if($r['success']) { + $attachments[] = array( + 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'], + 'length' => $r['data']['filesize'], + 'type' => $r['data']['filetype'], + 'title' => urlencode($r['data']['filename']), + 'revision' => $r['data']['revision'] + ); + } + $body = str_replace($match[1],'',$body); + } + } + } // BBCODE end alert |