]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/favorited.php
Confirm dialog for reset OAuth consumer key and secret button
[quix0rs-gnu-social.git] / actions / favorited.php
index 006dd54883aa760703349703e2fab2878fd5e580..9ffa5b84454093fde32b98460751b60bbab32745 100644 (file)
@@ -28,7 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -153,8 +153,7 @@ class FavoritedAction extends Action
             $message .= _('Be the first to add a notice to your favorites by clicking the fave button next to any notice you like.');
         }
         else {
-            $message .= sprintf(_('Why not [register an account](%%%%action.%s%%%%) and be the first to add a notice to your favorites!'),
-                                (!common_config('site','openidonly')) ? 'register' : 'openidlogin');
+            $message .= _('Why not [register an account](%%action.register%%) and be the first to add a notice to your favorites!');
         }
 
         $this->elementStart('div', 'guide');
@@ -186,11 +185,7 @@ class FavoritedAction extends Action
 
     function showContent()
     {
-        if (common_config('db', 'type') == 'pgsql') {
-            $weightexpr='sum(exp(-extract(epoch from (now() - fave.modified)) / %s))';
-        } else {
-            $weightexpr='sum(exp(-(now() - fave.modified) / %s))';
-        }
+        $weightexpr = common_sql_weight('fave.modified', common_config('popular', 'dropoff'));
 
         $qry = 'SELECT notice.*, '.
           $weightexpr . ' as weight ' .
@@ -208,7 +203,7 @@ class FavoritedAction extends Action
         }
 
         $notice = Memcached_DataObject::cachedQuery('Notice',
-                                                    sprintf($qry, common_config('popular', 'dropoff')),
+                                                    $qry,
                                                     600);
 
         $nl = new NoticeList($notice, $this);