// ======== Private messages counter ============
$criteria = new CriteriaCompo(new Criteria('read_msg', 0));
$criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
$pm_handler =& xoops_gethandler('privmessage');
$pm_counter = $pm_handler->getCount($criteria);
$xoopsTpl->assign( 'pm_counter', $pm_counter );
n**Headers already sent in file "" on line "0"array(7) { [0]=> string(23) "X-Powered-By: PHP/5.3.3" [1]=> string(38) "Expires: Thu, 19 Nov 1981 08:52:00 GMT" [2]=> string(77) "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0" [3]=> string(16) "Pragma: no-cache" [4]=> string(80) "Set-Cookie: PHPSESSID=a1ff8c1e09713cc85556f1a8e3b813ca; path=/; domain=.test1.ru" [5]=> string(79) "Set-Cookie: newbb_1LV=1344940223; expires=Thu, 13-Sep-2012 10:30:23 GMT; path=/" [6]=> string(23) "Content-type: text/html" }
n**Headers already sent in file "" on line "0"
In this case you really only need to extend the XoopsForm class as Mamba suggests. You'll just need to create a render() method. You can see ./class/xoopsform/simpleform.php as an example.
Deka, maybe extending the class will help you. See this tutorial
/**
* System Preloads
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @author Cointin Maxime (AKA Kraven30)
* @author Andricq Nicolas (AKA MusS)
* @version $Id:$
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class SystemCorePreload extends XoopsPreloadItem
{
function eventCoreIncludeFunctionsRedirectheader($args)
{
global $xoopsConfig;
$url = $args[0];
if (preg_match("/[\0-\31]|about:|script:/i", $url)) {
if (!preg_match('/^b(java)?script:([s]*)history.go(-[0-9]*)([s]*[;]*[s]*)$/si', $url)) {
$url = XOOPS_URL;
}
}
if (isset($xoopsConfig['redirect_message_ajax']) && $xoopsConfig['redirect_message_ajax']) {
$_SESSION['redirect_message'] = $args[2];
header("Location: " . preg_replace("/[&]amp;/i", '&', $url));
exit();
}
}
function eventCoreHeaderCheckcache($args)
{
if (!empty($_SESSION['redirect_message'])) {
$GLOBALS['xoTheme']->contentCacheLifetime = 0;
unset($_SESSION['redirect_message']);
}
}
function eventCoreHeaderAddmeta($args)
{
if (!empty($_SESSION['redirect_message'])) {
$GLOBALS['xoTheme']->addStylesheet('xoops.css');
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js');
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.jgrowl.js');
$GLOBALS['xoTheme']->addScript('', array('type' => 'text/javascript'), '
(function($){
$(document).ready(function(){
$.jGrowl("' . $_SESSION['redirect_message'] . '", { life:3000 , position: "center", speed: "slow" });
});
})(jQuery);
');
}
}
function eventSystemClassGuiHeader($args)
{
if (!empty($_SESSION['redirect_message'])) {
$GLOBALS['xoTheme']->addStylesheet('xoops.css');
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js');
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.jgrowl.js');
$GLOBALS['xoTheme']->addScript('', array('type' => 'text/javascript'), '
(function($){
$(document).ready(function(){
$.jGrowl("' . $_SESSION['redirect_message'] . '", { life:3000 , position: "center", speed: "slow" });
});
})(jQuery);
');
unset($_SESSION['redirect_message']);
}
}
}
?>