<?php
/*
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
- * Copyright (C) 2002-2009 The Nucleus Group
+ * Copyright (C) 2002-2010 The Nucleus Group
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* SKIN::getAllowedActionsForType($type) method
*
* @license http://nucleuscms.org/license.txt GNU General Public License
- * @copyright Copyright (C) 2002-2009 The Nucleus Group
+ * @copyright Copyright (C) 2002-2010 The Nucleus Group
* @version $Id$
* @version $NucleusJP: ACTIONS.php,v 1.8 2007/04/19 06:05:55 kimitake Exp $
*/
* When present, the output will be a full <a href...> link. When empty,
* only a raw link will be outputted
*/
- function _searchlink($maxresults, $startpos, $direction, $linktext = '') {
+ function _searchlink($maxresults, $startpos, $direction, $linktext = '', $recount = '') {
global $CONF, $blog, $query, $amount;
// TODO: Move request uri to linkparams. this is ugly. sorry for that.
$startpos = intval($startpos); // will be 0 when empty.
+ $path = $parsed['path'];
$parsed = parse_url(serverVar('REQUEST_URI'));
$parsed = $parsed['query'];
- $url = '';
+ $url = '';
switch ($direction) {
case 'prev':
if ( intval($startpos) - intval($maxresults) >= 0) {
$startpos = intval($startpos) - intval($maxresults);
- $url = $CONF['SearchURL'].'?'.alterQueryStr($parsed,'startpos',$startpos);
+ //$url = $CONF['SearchURL'].'?'.alterQueryStr($parsed,'startpos',$startpos);
+ switch ($this->skintype)
+ {
+ case 'index':
+ $url = $path;
+ break;
+ case 'search':
+ $url = $CONF['SearchURL'];
+ break;
+ }
+ $url .= '?'.alterQueryStr($parsed,'startpos',$startpos);
}
break;
case 'next':
- $iAmountOnPage = $this->amountfound;
- if ($iAmountOnPage == 0)
+ global $navigationItems;
+ if (!isset($navigationItems)) $navigationItems = 0;
+
+ if ($recount)
+ $iAmountOnPage = 0;
+ else
+ $iAmountOnPage = $this->amountfound;
+
+ if (intval($navigationItems) > 0) {
+ $iAmountOnPage = intval($navigationItems) - intval($startpos);
+ }
+ elseif ($iAmountOnPage == 0)
{
// [%nextlink%] or [%prevlink%] probably called before [%blog%] or [%searchresults%]
// try a count query
$sqlquery = $blog->getSqlBlog('', 'count');
break;
case 'search':
+ $unused_highlight = '';
$sqlquery = $blog->getSqlSearch($query, $amount, $unused_highlight, 'count');
+ $url = $CONF['SearchURL'];
break;
}
if ($sqlquery)
}
if (intval($iAmountOnPage) >= intval($maxresults)) {
$startpos = intval($startpos) + intval($maxresults);
- $url = $CONF['SearchURL'].'?'.alterQueryStr($parsed,'startpos',$startpos);
+ //$url = $CONF['SearchURL'].'?'.alterQueryStr($parsed,'startpos',$startpos);
+ $url .= '?'.alterQueryStr($parsed,'startpos',$startpos);
}
+ else $url = '';
break;
default:
break;
* Code that opens a bookmarklet in an popup window
*/
function parse_addpopupcode() {
- echo "if (event && event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=no,width=600,height=550,left=10,top=10,status=no,resizable=yes');winbm.focus();return false;";
+ echo "if (event && event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=no,width=710,height=550,left=10,top=10,status=no,resizable=yes');winbm.focus();return false;";
}
/**
*/
function parse_categorylist($template, $blogname = '') {
global $blog, $manager;
-
+
+ // when no blog found
+ if (($blogName == '') && (!is_object($blog)))
+ return 0;
+
if ($blogname == '') {
$this->_preBlogContent('categorylist',$blog);
$blog->showCategoryList($template);
$this->doForm('commentform-closed');
return;
}
-
+
+ if (!$blog->isPublic() && !$member->isLoggedIn()) {
+ $this->doForm('commentform-closedtopublic');
+ return;
+ }
+
if (!$destinationurl)
{
$destinationurl = createLink(
* (includes a member info thingie)
*/
function parse_member($what) {
- global $memberinfo, $member;
+ global $memberinfo, $member, $CONF;
// 1. only allow the member-details-page specific variables on member pages
if ($this->skintype == 'member') {
case 'yourid':
echo $member->getID();
break;
+ case 'yourprofileurl':
+ if ($CONF['URLMode'] == 'pathinfo')
+ echo createMemberLink($member->getID());
+ else
+ echo $CONF['IndexURL'] . createMemberLink($member->getID());
+ break;
}
}
-
}
-
+
/**
* Parse skinvar membermailform
*/
/**
* Parse skinvar nextlink
*/
- function parse_nextlink($linktext = '', $amount = 10) {
+ function parse_nextlink($linktext = '', $amount = 10, $recount = '') {
global $itemidnext, $archivenext, $startpos;
if ($this->skintype == 'item')
$this->_itemlink($itemidnext, $linktext);
else if ($this->skintype == 'search' || $this->skintype == 'index')
- $this->_searchlink($amount, $startpos, 'next', $linktext);
+ $this->_searchlink($amount, $startpos, 'next', $linktext, $recount);
else
$this->_archivelink($archivenext, $linktext);
}