diff options
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 |