]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
before and after are switched, pass QSA in some rewrite rules
[quix0rs-gnu-social.git] / lib / util.php
index 4869d4dfdd7083c5e7b1fcdc1011da483a4bd6e4..169a23853c999720e3315c592fa00b22cbed4b22 100644 (file)
@@ -205,6 +205,16 @@ function common_show_footer() {
        common_element_end('div'); # content div
        common_foot_menu();
        common_element_start('div', array('id' => 'footer'));
+       common_element_start('p', 'laconica');
+       common_text(_t('This site is running the '));
+       common_element('a', array('class' => 'software',
+                                                         href => 'http://laconi.ca/'),
+                                  'Laconica');
+       common_text(_t('microblogging tool, version ' . LACONICA_VERSION . ', available under the '));
+       common_element('a', array(href => 'http://www.fsf.org/licensing/licenses/agpl-3.0.html'),
+                                  'GNU Affero General Public License');
+       common_text(_t('.'));
+       common_element_end('p');
        common_element('img', array('id' => 'cc',
                                                                'src' => $config['license']['image'],
                                                                'alt' => $config['license']['title']));
@@ -499,7 +509,11 @@ function common_local_url($action, $args=NULL) {
 function common_fancy_url($action, $args=NULL) {
        switch (strtolower($action)) {
         case 'public':
-               return common_path('');
+               if ($args && $args['page']) {
+                       return common_path('?page=' . $args['page']);
+               } else {
+                       return common_path('');
+               }
         case 'publicrss':
                return common_path('rss');
         case 'doc':
@@ -519,18 +533,27 @@ function common_fancy_url($action, $args=NULL) {
                return common_path('notice/new');
         case 'shownotice':
                return common_path('notice/'.$args['notice']);
-        case 'subscriptions':
-        case 'subscribed':
         case 'xrds':           
-        case 'all':
         case 'foaf':
                return common_path($args['nickname'].'/'.$action);
+        case 'subscriptions':
+        case 'subscribed':
+        case 'all':
+               if ($args && $args['page']) {
+                       return common_path($args['nickname'].'/'.$action.'?page=' . $args['page']);
+               } else {
+                       return common_path($args['nickname'].'/'.$action);
+               }
         case 'allrss':
                return common_path($args['nickname'].'/all/rss');
         case 'userrss':
                return common_path($args['nickname'].'/rss');
         case 'showstream':
-               return common_path($args['nickname']);
+               if ($args && $args['page']) {
+                       return common_path($args['nickname'].'?page=' . $args['page']);
+               } else {
+                       return common_path($args['nickname']);
+               }
         default:
                return common_simple_url($action, $args);
        }
@@ -737,7 +760,7 @@ function common_pagination($have_before, $have_after, $page, $action, $args=NULL
                                                                                 
                common_element_start('li', 'before');
                common_element('a', array('href' => common_local_url($action, $newargs)),
-                                          _t('« Before'));
+                                          _t('« After'));
                common_element_end('li');
        }
 
@@ -746,7 +769,7 @@ function common_pagination($have_before, $have_after, $page, $action, $args=NULL
                $newargs = ($args) ? array_merge($args,$pargs) : $pargs;
                common_element_start('li', 'after');
                common_element('a', array('href' => common_local_url($action, $newargs)),
-                                                  _t('After »'));
+                                                  _t('Before »'));
                common_element_end('li');
        }
        
@@ -833,3 +856,8 @@ function common_negotiate_type($cprefs, $sprefs) {
 
        return $besttype;
 }
+
+function common_config($main, $sub) {
+       global $config;
+       return $config[$main][$sub];
+}