Permalink
Browse files

- Enforce minimum elapsed time on registration form

- Removed redirection after save
- Show most recent page of results on index, rather than most recent day
- Minor code style updates
- Shameless self-aggrandising

Signed-off-by: Marcus Campbell <marcus.campbell@gmail.com>
  • Loading branch information...
1 parent d297e7b commit 6b106efb4f8497f1bd9dc334683751508caa176e @scronide committed Dec 21, 2010
Showing with 156 additions and 203 deletions.
  1. +2 −2 about.php
  2. +1 −2 ajaxDelete.php
  3. +1 −2 ajaxGetTitle.php
  4. +1 −2 ajaxIsAvailable.php
  5. +7 −7 alltags.php
  6. +1 −1 api/httpauth.inc.php
  7. +6 −7 api/posts_add.php
  8. +3 −4 api/posts_all.php
  9. +8 −7 api/posts_dates.php
  10. +7 −7 api/posts_delete.php
  11. +4 −5 api/posts_get.php
  12. +5 −6 api/posts_recent.php
  13. +4 −8 api/posts_update.php
  14. +5 −6 api/tags_get.php
  15. +13 −13 api/tags_rename.php
  16. +6 −11 bookmarks.php
  17. +5 −7 config.inc.php.example
  18. +1 −2 debug.inc.php
  19. +5 −6 edit.php
  20. +2 −4 header.inc.php
  21. +2 −3 history.php
  22. +2 −3 import.php
  23. +2 −3 importNetscape.php
  24. +11 −25 index.php
  25. +1 −1 locales/de_DE/LC_MESSAGES/messages.po
  26. +1 −1 locales/dk_DK/LC_MESSAGES/messages.po
  27. +1 −1 locales/en_GB/LC_MESSAGES/messages.po
  28. +1 −1 locales/es_ES/LC_MESSAGES/messages.po
  29. +1 −1 locales/fr_FR/LC_MESSAGES/messages.po
  30. +1 −1 locales/hi_IN/LC_MESSAGES/messages.po
  31. +1 −1 locales/it_IT/LC_MESSAGES/messages.po
  32. +1 −1 locales/ja_JP/LC_MESSAGES/messages.po
  33. +1 −1 locales/lt_LT/LC_MESSAGES/messages.po
  34. +1 −1 locales/nl_NL/LC_MESSAGES/messages.po
  35. +1 −1 locales/pt_BR/LC_MESSAGES/messages.po
  36. +1 −1 locales/zh_CN/LC_MESSAGES/messages.po
  37. +3 −4 login.php
  38. +2 −3 password.php
  39. +2 −3 populartags.php
  40. +2 −3 profile.php
  41. +1 −1 readme.txt
  42. +10 −4 register.php
  43. +2 −3 rss.php
  44. +6 −8 search.inc.php
  45. +2 −3 search.php
  46. +2 −3 tagdelete.php
  47. +2 −3 tagrename.php
  48. +2 −3 tags.php
  49. +0 −1 templates/dynamictags.inc.php
  50. +2 −3 watch.php
  51. +2 −3 watchlist.php
View
@@ -1,7 +1,7 @@
<?php
/***************************************************************************
-Copyright (c) 2004 - 2010 Scuttle project
-http://sourceforge.net/projects/scuttle/
+Copyright (c) 2004 - 2010 Marcus Campbell
+http://scuttle.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
View
@@ -1,7 +1,6 @@
<?php
/***************************************************************************
-Copyright (c) 2005 - 2010 Scuttle project
-http://sourceforge.net/projects/scuttle/
+Copyright (c) 2005 - 2010 Marcus Campbell
http://scuttle.org/
This program is free software; you can redistribute it and/or modify
View
@@ -1,7 +1,6 @@
<?php
/***************************************************************************
-Copyright (c) 2005 - 2010 Scuttle project
-http://sourceforge.net/projects/scuttle/
+Copyright (c) 2005 - 2010 Marcus Campbell
http://scuttle.org/
This program is free software; you can redistribute it and/or modify
View
@@ -1,7 +1,6 @@
<?php
/***************************************************************************
-Copyright (c) 2006 - 2010 Scuttle project
-http://sourceforge.net/projects/scuttle/
+Copyright (c) 2006 - 2010 Marcus Campbell
http://scuttle.org/
This program is free software; you can redistribute it and/or modify
View
@@ -1,7 +1,6 @@
<?php
/***************************************************************************
-Copyright (c) 2004 - 2006 Scuttle project
-http://sourceforge.net/projects/scuttle/
+Copyright (c) 2004 - 2010 Marcus Campbell
http://scuttle.org/
This program is free software; you can redistribute it and/or modify
@@ -19,13 +18,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once 'header.inc.php';
+
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
-$tagservice =& ServiceFactory::getServiceInstance('TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$tagservice =& ServiceFactory::getServiceInstance('TagService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
+$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
-list($url, $user) = explode('/', $_SERVER['PATH_INFO']);
+@list($url, $user) = explode('/', $_SERVER['PATH_INFO']);
if (!$user) {
header('Location: '. createURL('populartags'));
exit;
@@ -5,7 +5,7 @@
function authenticate() {
header('WWW-Authenticate: Basic realm="del.icio.us API"');
header('HTTP/1.0 401 Unauthorized');
- die("Use of the API calls requires authentication.");
+ die(T_('Use of the API calls requires authentication.'));
}
if (!isset($_SERVER['PHP_AUTH_USER'])) {
View
@@ -10,11 +10,11 @@
// - No support for 'replace' variable
// Force HTTP authentication
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
// Get all the bookmark's passed-in information
if (isset($_REQUEST['url']) && (trim($_REQUEST['url']) != ''))
@@ -67,17 +67,16 @@
// Error out if there's no address or description
if (is_null($url) || is_null($description)) {
- $added = false;
+ $added = FALSE;
} else {
// We're good with info; now insert it!
if ($bookmarkservice->bookmarkExists($url, $userservice->getCurrentUserId()))
- $added = false;
+ $added = FALSE;
else
- $added = $bookmarkservice->addBookmark($url, $description, $extended, $status, $tags, $dt, true);
+ $added = $bookmarkservice->addBookmark($url, $description, $extended, $status, $tags, $dt, TRUE);
}
// Set up the XML file and output the result.
header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<result code="'. ($added ? 'done' : 'something went wrong') .'" />';
-?>
View
@@ -5,11 +5,11 @@
// - doesn't include the filtered tag as an attribute on the root element (we do)
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
// Check to see if a tag was specified.
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
@@ -47,4 +47,3 @@
}
echo '</posts>';
-?>
View
@@ -3,11 +3,11 @@
// by tag).
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
// Check to see if a tag was specified.
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
@@ -26,17 +26,18 @@
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<dates tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentusername, 'xml') ."\">\r\n";
+$count = 0;
$lastdate = NULL;
-foreach($bookmarks['bookmarks'] as $row) {
+foreach ($bookmarks['bookmarks'] as $row) {
$thisdate = gmdate('Y-m-d', strtotime($row['bDatetime']));
if ($thisdate != $lastdate && $lastdate != NULL) {
echo "\t<date count=\"". $count .'" date="'. $lastdate ."\" />\r\n";
$count = 1;
- } else {
- $count = $count + 1;
+ }
+ else {
+ $count++;
}
$lastdate = $thisdate;
}
echo "</dates>";
-?>
View
@@ -7,27 +7,27 @@
// - doesn't set the Content-Type to text/xml (we do).
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
// Note that del.icio.us only errors out if no URL was passed in; there's no error on attempting
// to delete a bookmark you don't have.
// Error out if there's no address
if (is_null($_REQUEST['url'])) {
- $deleted = false;
-} else {
+ $deleted = FALSE;
+}
+else {
$bookmark = $bookmarkservice->getBookmarkByAddress($_REQUEST['url']);
$bid = $bookmark['bId'];
$delete = $bookmarkservice->deleteBookmark($bid);
- $deleted = true;
+ $deleted = TRUE;
}
// Set up the XML file and output the result.
header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<result code="'. ($deleted ? 'done' : 'something went wrong') .'" />';
-?>
View
@@ -10,11 +10,11 @@
// - Uses today, instead of the last bookmarked date, if no date is specified
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
// Check to see if a tag was specified.
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
@@ -40,7 +40,7 @@
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<posts'. (is_null($dtstart) ? '' : ' dt="'. $dtstart .'"') .' tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentusername, 'xml') ."\">\r\n";
-foreach($bookmarks['bookmarks'] as $row) {
+foreach ($bookmarks['bookmarks'] as $row) {
if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
$description = '';
else
@@ -59,4 +59,3 @@
}
echo '</posts>';
-?>
View
@@ -4,14 +4,14 @@
// Set default and max number of posts
$countDefault = 15;
-$countMax = 100;
+$countMax = 100;
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
// Check to see if a tag was specified.
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
@@ -41,7 +41,7 @@
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<posts tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentusername, 'xml') ."\">\r\n";
-foreach($bookmarks['bookmarks'] as $row) {
+foreach ($bookmarks['bookmarks'] as $row) {
if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
$description = '';
else
@@ -60,4 +60,3 @@
}
echo '</posts>';
-?>
View
@@ -5,22 +5,18 @@
// - doesn't set the Content-Type to text/xml (we do).
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice =& ServiceFactory::getServiceInstance('UserService');
// Get the posts relevant to the passed-in variables.
$bookmarks =& $bookmarkservice->getBookmarks(0, 1, $userservice->getCurrentUserId());
-$currentuser = $userservice->getCurrentUser();
-$currentusername = $currentuser[$userservice->getFieldName('username')];
-
// Set up the XML file and output all the tags.
header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
-foreach($bookmarks['bookmarks'] as $row) {
+foreach ($bookmarks['bookmarks'] as $row) {
echo '<update time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) .'" />';
}
-?>
View
@@ -5,10 +5,10 @@
// - tags can't have spaces
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
-$tagservice =& ServiceFactory::getServiceInstance('TagService');
+$tagservice =& ServiceFactory::getServiceInstance('TagService');
$userservice =& ServiceFactory::getServiceInstance('UserService');
// Get the tags relevant to the passed-in variables.
@@ -18,8 +18,7 @@
header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo "<tags>\r\n";
-foreach($tags as $row) {
- echo "\t<tag count=\"". $row['bCount'] .'" tag="'. filter(convertTag($row['tag'], 'out'), 'xml') ."\" />\r\n";
+foreach ($tags as $row) {
+ echo "\t<tag count=\"". $row['bCount'] .'" tag="'. filter(convertTag($row['tag'], 'out'), 'xml') ."\" />\r\n";
}
echo "</tags>";
-?>
View
@@ -5,33 +5,33 @@
// - oddly, returns an entirely different result (<result></result>) than the other API calls.
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
-$tagservice =& ServiceFactory::getServiceInstance('TagService');
+$tagservice =& ServiceFactory::getServiceInstance('TagService');
$userservice =& ServiceFactory::getServiceInstance('UserService');
// Get the tag info.
if (isset($_REQUEST['old']) && (trim($_REQUEST['old']) != ''))
- $old = trim($_REQUEST['old']);
+ $old = trim($_REQUEST['old']);
else
- $old = NULL;
+ $old = NULL;
if (isset($_REQUEST['new']) && (trim($_REQUEST['new']) != ''))
- $new = trim($_REQUEST['new']);
+ $new = trim($_REQUEST['new']);
else
- $new = NULL;
+ $new = NULL;
if (is_null($old) || is_null($new)) {
- $renamed = false;
-} else {
- // Rename the tag.
- $result = $tagservice->renameTag($userservice->getCurrentUserId(), $old, $new, true);
- $renamed = $result;
+ $renamed = FALSE;
+}
+else {
+ // Rename the tag.
+ $result = $tagservice->renameTag($userservice->getCurrentUserId(), $old, $new, TRUE);
+ $renamed = $result;
}
// Set up the XML file and output the result.
header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<result>'. ($renamed ? 'done' : 'something went wrong') .'</result>';
-?>
Oops, something went wrong.

0 comments on commit 6b106ef

Please sign in to comment.