X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Futil.php;h=b78edc93cc4ef4158fbc999e8e43a98f881cd9ac;hb=0299b6f2caa5b3b956c9e00a17d6cf3c72966396;hp=e1e50817652843add1ce2d96e309bd13e037cc1c;hpb=a86477aad3bab8ad519626c56e3e253faea50518;p=quix0rs-gnu-social.git diff --git a/lib/util.php b/lib/util.php index e1e5081765..b78edc93cc 100644 --- a/lib/util.php +++ b/lib/util.php @@ -166,6 +166,11 @@ function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall= 'href="'.theme_path('ie'.$ver.'.css').' /> 'text/javascript', + 'src' => common_path('js/jquery.min.js')), + ' '); + if ($callable) { if ($data) { call_user_func($callable, $data); @@ -178,12 +183,17 @@ function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall= common_element_start('div', array('id' => 'wrap')); common_element_start('div', array('id' => 'header')); common_nav_menu(); - common_element_start('a', array('href' => common_local_url('public'))); - common_element('img', array('src' => ($config['site']['logo']) ? - ($config['site']['logo']) : theme_path('logo.png'), - 'alt' => $config['site']['name'], - 'id' => 'logo')); - common_element_end('a'); + if ($config['site']['logo'] || file_exists(theme_file('logo.png'))) { + common_element_start('a', array('href' => common_local_url('public'))); + common_element('img', array('src' => ($config['site']['logo']) ? + ($config['site']['logo']) : theme_path('logo.png'), + 'alt' => $config['site']['name'], + 'id' => 'logo')); + common_element_end('a'); + } + common_element('h1', 'pagetitle', $pagetitle); + common_element('h2', 'sitename', $config['site']['name']); + if ($headercall) { if ($data) { call_user_func($headercall, $data); @@ -200,6 +210,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'])); @@ -494,7 +514,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': @@ -514,18 +538,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); } @@ -732,7 +765,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'); } @@ -741,7 +774,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'); } @@ -828,3 +861,8 @@ function common_negotiate_type($cprefs, $sprefs) { return $besttype; } + +function common_config($main, $sub) { + global $config; + return $config[$main][$sub]; +}