diff --git a/htconfig.php b/htconfig.php index aab00a972f..e9c2db3507 100644 --- a/htconfig.php +++ b/htconfig.php @@ -28,6 +28,6 @@ $a->config['register_policy'] = REGISTER_OPEN; $a->config['register_text'] = ''; $a->config['admin_email'] = ''; -// Maximum size of an imported message, 0 is unlimited. +// Maximum size of an imported message, 0 is unlimited (but our database 'text' element is limited to 65535). $a->config['max_import_size'] = 10000; \ No newline at end of file diff --git a/index.php b/index.php index a30c69d37d..e27d6f04fa 100644 --- a/index.php +++ b/index.php @@ -43,8 +43,8 @@ if(strlen($a->module)) { // invoke module functions // Important: Modules normally do not emit content, unless you need it for debugging. // The module_init, module_post, and module_afterpost functions process URL parameters and POST processing. -// The module_content function returns content text to this function where it is included on the page. -// Modules emitting XML/Atom, etc. should do so in the _init function and promptly exit. +// The module_content function returns content text to this file where it is included on the page. +// Modules emitting XML/Atom, etc. should do so idirectly and promptly exit before the HTML page can be rendered. // "Most" HTML resides in the view directory as text templates with macro substitution. // They look like HTML with PHP variables but only a couple pass through the PHP processor - those with .php extensions. // The macro substitution is defined per page for the .tpl files. diff --git a/mod/contacts.php b/mod/contacts.php index c1b3781bf6..89e1f24df4 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -187,7 +187,7 @@ function contacts_content(&$a) { '$poll_interval' => contact_poll_interval($r[0]['priority']), '$last_update' => (($r[0]['last-update'] == '0000-00-00 00:00:00') ? t('Never') - : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, G:i A')), + : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, g:i A')), '$profile_select' => contact_profile_assign($r[0]['profile-id']), '$contact_id' => $r[0]['id'], '$block_text' => (($r[0]['blocked']) ? t('Unblock this contact') : t('Block this contact') ), diff --git a/mod/photos.php b/mod/photos.php index e680bc5a2f..ca05f651bc 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -51,6 +51,29 @@ function photos_post(&$a) { killme(); } + if(($a->argc > 1) && (x($_POST,'desc') !== false)) { + $desc = notags(trim($_POST['desc'])); + $tags = notags(trim($_POST['tags'])); + $item_id = intval($_POST['item_id']); + $id = $a->argv[1]; + + $r = q("UPDATE `photo` SET `desc` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", + dbesc($desc), + intval($id), + intval($_SESSION['uid']) + ); + $r = q("UPDATE `item` SET `tag` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", + dbesc($tags), + intval($item_id), + intval($_SESSION['uid']) + ); + + goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + return; // NOTREACHED + } + + + $r = q("SELECT * FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` WHERE `user`.`uid` = %d AND `self` = 1 LIMIT 1", intval($_SESSION['uid']) ); @@ -409,11 +432,17 @@ function photos_content(&$a) { $o .= '