11
Xetox
Re: Login Issue
  • 2005/11/3 13:32

  • Xetox

  • Just popping in

  • Posts: 71

  • Since: 2005/10/28


Ok clearing the cash worked, thanks.

This is what I have as of right now.

* Function to redirect a user to certain pages
*/
function redirect_header($url, $time = 3, $message = '', $addredirect = true)
{
global $xoopsConfig, $xoopsLogger, $xTheme, $xoopsOption, $xoopsModule, $xoopsUser, $xoopsTpl;
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;
}
}
//$xTheme->tplEngine->assign('xoops_showrblock', 1);

$xTheme->tplEngine->assign('time', intval($time));
if ($addredirect && strstr($url, 'user.php')) {
if (!strstr($url, '?')) {
$url .= '?xoops_redirect='.urlencode($_SERVER['REQUEST_URI']);
} else {
$url .= '&xoops_redirect='.urlencode($_SERVER['REQUEST_URI']);
}
}
if (defined('SID') && (! isset($_COOKIE[session_name()]) || ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '' && !isset($_COOKIE[$xoopsConfig['session_name']])))) {
if (!strstr($url, '?')) {
$url .= '?' . SID;
} else {
$url .= '&'.SID;
}
}
$url = preg_replace("/&/i", '&', htmlspecialchars($url, ENT_QUOTES));
$xTheme->tplEngine->assign('url', $url);
$message = trim($message) != '' ? $message : _TAKINGBACK;
$xTheme->tplEngine->assign('message', $message);
$xTheme->tplEngine->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url));
$xTheme->tplEngine->assign('xoops_module_header', '');
$xoopsOption['template_main'] = 'system_redirect.html';
include XOOPS_ROOT_PATH."/footer.php";
exit();
}

Do you see anything wrong there....that should be causeing this?

12
dickinsd
Re: Login Issue
  • 2005/11/3 13:36

  • dickinsd

  • Quite a regular

  • Posts: 278

  • Since: 2004/11/14


Just taking a few steps back; there is a template for the Redirect page, now I am not sure how much of an effect you could have on the redirect function, but just to rule it out, have you made any changes to this template?

Sorry mate, just guessing here, XOOPS is a tricky beast, if I have had to figure it out myself, I can help, but if its something that I have not come across before then I am just looking around the forum etc trying to find something that might be of use.


Dave

13
dickinsd
Re: Login Issue
  • 2005/11/3 13:51

  • dickinsd

  • Quite a regular

  • Posts: 278

  • Since: 2004/11/14


Quote:

Xetox wrote:
Ok clearing the cash worked, thanks.

This is what I have as of right now.

...

Do you see anything wrong there....that should be causeing this?


I noticed one difference, if you look at the code below (it is the code you posted) you will see one line that is bold that line is from your code, when I compared your code to mine, the only difference I noticed was that this line is different in my functions.php file, I included mine so that you can see the difference, mine is obviously the red code.

That was the only thing I noticed, so perhaps you could just try replacing that line in your functions.php file.

* Function to redirect a user to certain pages
*/
function 
redirect_header($url$time 3$message ''$addredirect true)
{
    global 
$xoopsConfig$xoopsLogger$xTheme$xoopsOption$xoopsModule$xoopsUser$xoopsTpl;
    [
b]if ( preg_match"/[\0-\31]|about:|script:/i"$url) ) {[/b]
    [
color=990000]if (preg_match('/b(java)?script:/si'$url) ) {[/color]
        if (!
preg_match('/^b(java)?script:([s]*)history.go(-[0-9]*)([s]*[;]*[s]*)$/si'$url) ) {
            
$url XOOPS_URL;
        }
    }
    
//$xTheme->tplEngine->assign('xoops_showrblock', 1);

    
$xTheme->tplEngine->assign('time'intval($time));
    if (
$addredirect && strstr($url'user.php')) {
        if (!
strstr($url'?')) {
            
$url .= '?xoops_redirect='.urlencode($_SERVER['REQUEST_URI']);
        } else {
            
$url .= '&xoops_redirect='.urlencode($_SERVER['REQUEST_URI']);
        }
    }
    if (
defined('SID') && (! isset($_COOKIE[session_name()]) || ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '' && !isset($_COOKIE[$xoopsConfig['session_name']])))) {
        if (!
strstr($url'?')) {
            
$url .= '?' SID;
        } else {
            
$url .= '&'.SID;
        }
    }
    
$url preg_replace("/&/i"'&'htmlspecialchars($urlENT_QUOTES));
    
$xTheme->tplEngine->assign('url'$url);
    
$message trim($message) != '' $message _TAKINGBACK;
    
$xTheme->tplEngine->assign('message'$message);
    
$xTheme->tplEngine->assign('lang_ifnotreload'sprintf(_IFNOTRELOAD$url));
    
$xTheme->tplEngine->assign('xoops_module_header''.$url.'" />');
    
$xoopsOption['template_main'] = 'system_redirect.html';
    include 
XOOPS_ROOT_PATH."/footer.php";
    exit();
}


Dave

EDIT: If you want I can email you my functions.php file, you could back up yours and just try the one that works on a my test site - let me know.

14
dickinsd
Re: Login Issue
  • 2005/11/3 14:24

  • dickinsd

  • Quite a regular

  • Posts: 278

  • Since: 2004/11/14


Hey.

Just been looking around the forums, and this may be of interest to you

https://xoops.org/modules/newbb/viewtopic.php?topic_id=40134&forum=39&post_id=175996#forumpost175996

Also when you try what is in that post, I would suggest that you upload a fresh copy of the functions.php file to your site.

To test if that post will fix your problem, you could just change your theme back to the default one or the xmt theme and see if the redirects work again.

Just a thought

Dave

15
Xetox
Re: Login Issue
  • 2005/11/3 16:03

  • Xetox

  • Just popping in

  • Posts: 71

  • Since: 2005/10/28


Ok looking at the source on the user.php

All I have is


Thank you for logging in, Test.


If the page does not automatically reload, please click here




can someont take a look at theres and see what I am missing.

Also is the the user.php that in the in root public_html folder?

16
Xetox
Re: Login Issue
  • 2005/11/3 16:27

  • Xetox

  • Just popping in

  • Posts: 71

  • Since: 2005/10/28


Quote:

dickinsd wrote:
Hey.

Just been looking around the forums, and this may be of interest to you

https://xoops.org/modules/newbb/viewtopic.php?topic_id=40134&forum=39&post_id=175996#forumpost175996

Also when you try what is in that post, I would suggest that you upload a fresh copy of the functions.php file to your site.

To test if that post will fix your problem, you could just change your theme back to the default one or the xmt theme and see if the redirects work again.

Just a thought

Dave


I have takin a look at both the default theme and my theme.html and both have the {$xoops_module_header} in them......anyone have a gun :)

17
Xetox
Re: Login Issue
  • 2005/11/3 16:37

  • Xetox

  • Just popping in

  • Posts: 71

  • Since: 2005/10/28


it is a issue with my theme....I change back to default theme and all is well but I would like to keep my theme if at all possible.

here is what the theme.html looks like.

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
<
head>
<
meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
<
meta http-equiv="content-language" content="<{$xoops_langcode}>" />
<
meta name="robots" content="<{$xoops_meta_robots}>" />
<
meta name="keywords" content="<{$xoops_meta_keywords}>" />
<
meta name="description" content="<{$xoops_meta_description}>" />
<
meta name="rating" content="<{$xoops_meta_rating}>" />
<
meta name="author" content="<{$xoops_meta_author}>" />
<
meta name="copyright" content="<{$xoops_meta_copyright}>" />
<
meta name="generator" content="XOOPS" />
<
title><{$xoops_sitename}> - <{$xoops_pagetitle}>title>
<
link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
<
link rel="stylesheet" type="text/css" media="all" href="<{$xoops_url}>/xoops.css" />

<
link rel="stylesheet" type="text/css" media="all" href="<{$xoops_themecss}>" />


<{
$xoops_module_header}>
<
script type="text/javascript" language="javascript">

script>
head>
<
body>

<
table cellspacing="0" id="top">
    <
tr><td class="slogan" colspan="2"><{$xoops_slogan}>td>tr>
    <
tr id="header">
        <
td id="headerlogo"><a href="<{$xoops_url}>/"><img src="<{$xoops_imageurl}>logo.jpg" alt="" />a>td>
        <
td id="headerbanner"><{$xoops_banner}>td>
    tr>
    <
tr>
        <
td class="slogan" colspan="2">
<{if 
$xoops_isuser}>
        
Welcome, <a href="<{$xoops_url}>/user.php"><{$xoops_uname}>a
to <{$xoops_sitename}>
<{else}>
        <
a href="<{$xoops_url}>/register.php">Become a memberaof <{$xoops_sitename}>, right now!
<{/if}>
        td>
    tr>
table>
<
table cellspacing="0">
    <
tr>
        <
td id="leftcolumn">
        
<{foreach 
item=block from=$xoops_lblocks}>
    <{include 
file="karate_redux_blue/theme_blockleft.html"}>
<{/foreach}>
        
        td>
        <
td id="centercolumn">

<{if 
$xoops_showcblock == 1}>
            <
table cellspacing="0">
                <
tr>
                    <
td id="centerCcolumn" colspan="2">

                    
<{foreach 
item=block from=$xoops_ccblocks}>
    <{include 
file="karate_redux_blue/theme_blockcenter_c.html"}>
<{/foreach}>
                    

                    td>
                  tr>
                  <
tr>
                    <
td id="centerLcolumn">

                    
<{foreach 
item=block from=$xoops_clblocks}>
    <{include 
file="karate_redux_blue/theme_blockcenter_l.html"}>
<{/foreach}>
                    
                    td>
                    <
td id="centerRcolumn">

                    
<{foreach 
item=block from=$xoops_crblocks}>
    <{include 
file="karate_redux_blue/theme_blockcenter_r.html"}>
<{/foreach}>
                    
                    td>
                tr>
            table>
<{/if}>

            <
div id="content"><{$xoops_contents}>div>
        td>
<{if 
$xoops_showrblock == 1}>
        <
td id="rightcolumn">
        
<{foreach 
item=block from=$xoops_rblocks}>
    <{include 
file="karate_redux_blue/theme_blockright.html"}>
<{/foreach}>
        
        td>
<{/if}>
    tr>
table>
<
div id="footer"><{$xoops_footer}>div>
body>
html>


here is what my functions.php looks like now.

// $Id: functions.php,v 1.69.6.4.2.31.2.7 2005/10/28 01:50:55 skalpa Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                                                    //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  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.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

// ################## Various functions from here ################

function xoops_header($closehead=true)
{
    global 
$xoopsConfig$xoopsTheme$xoopsConfigMetaFooter;
    
$myts =& MyTextSanitizer::getInstance();
    if (
$xoopsConfig['gzip_compression'] == 1) {
        
ob_start("ob_gzhandler");
    } else {
        
ob_start();
    }
    if (!
headers_sent()) {
        
header('Content-Type:text/html; charset='._CHARSET);
        
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
        
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
        
header('Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0');
        
header("Pragma: no-cache");
    }
    echo 
"
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>"
;
    echo 
'._LANGCODE.'" lang="'._LANGCODE.'">
    
    
    ._LANGCODE.'" />
    .$xoopsConfigMetaFooter['meta_robots'].'" />
    .$xoopsConfigMetaFooter['meta_keywords'].'" />
    .$xoopsConfigMetaFooter['meta_desc'].'" />
    .$xoopsConfigMetaFooter['meta_rating'].'" />
    .$xoopsConfigMetaFooter['meta_author'].'" />
    .$xoopsConfigMetaFooter['meta_copyright'].'" />
    
    '</span><span style="color: #007700">.</span><span style="color: #0000BB">$xoopsConfig</span><span style="color: #007700">[</span><span style="color: #DD0000">'sitename'</span><span style="color: #007700">].</span><span style="color: #DD0000">'
    .
XOOPS_URL.'/include/xoops.js">
    '
;
    
$themecss getcss($xoopsConfig['theme_set']);
    echo 
'.XOOPS_URL.'/xoops.css" />';
    if (
$themecss) {
        echo 
'.$themecss.'" />';
        
//echo '';
    
}
    if (
$closehead) {
        echo 
'';
    }
}

function 
xoops_footer()
{
    echo 
'';
    
ob_end_flush();
}

function 
xoops_error($msg$title='')
{
    echo 
'
    '
;
    if (
$title != '') {
        echo 
'

'.$title.'

'
;
    }
    if (
is_array($msg)) {
        foreach (
$msg as $m) {
            echo 
$m.'';
        }
    } else {
        echo 
$msg;
    }
    echo 
'
';
}

function 
xoops_result($msg$title='')
{
    echo 
'
    '
;
    if (
$title != '') {
        echo 
'

'.$title.'

'
;
    }
    if (
is_array($msg)) {
        foreach (
$msg as $m) {
            echo 
$m.'';
        }
    } else {
        echo 
$msg;
    }
    echo 
'
';
}

function 
xoops_confirm($hiddens$action$msg$submit=''$return ''$addtoken true)
{
    
$submit = ($submit != '') ? trim($submit) : _SUBMIT;
    echo 
'
    
      

'.$msg.'


      .$action.'">
    '
;
    foreach (
$hiddens as $name => $value) {
        if (
is_array($value)) {
            foreach (
$value as $caption => $newvalue) {
                echo 
'.$name.'" value="'.htmlspecialchars($newvalue).'" /> '.$caption;
            }
            echo 
'';
        } else {
            echo 
'.$name.'" value="'.htmlspecialchars($value).'" />';
        }
    }
    if (
$addtoken != false) {
        echo 
$GLOBALS['xoopsSecurity']->getTokenHTML();
    }
    if (
$return != '') {
        
$return "javascript: location.href='".$return."'";
    }
    else {
        
$return "javascript: history.go(-1)";
    }
    echo 
'
        .$submit.'" /> 
value="'
._CANCEL.'" onclick="'.$return.';" />
      
    

    ';
}

/**
* Load the specified localized strings file
*/
function xoops_load_lang_file$filename$module ''$default 'english' ) {
    
$lang $GLOBALS['xoopsConfig']['language'];
    
$path XOOPS_ROOT_PATH . ( empty($module) ? '/' "/modules/$module/" ) . 'language';
    if ( !( 
$ret = include_once( "$path/$lang/$filename.php" ) ) ) {
        
$ret = include_once( "$path/$default/$filename.php" );
    }
    return 
$ret;
}



/**
* Deprecated, use {@link XoopsSecurity} class instead
**/
function xoops_refcheck($docheck=1)
{
    return 
$GLOBALS['xoopsSecurity']->checkReferer($docheck);
}

function 
xoops_getUserTimestamp($time$timeoffset="")
{
    global 
$xoopsConfig$xoopsUser;
    if (
$timeoffset == '') {
        if (
$xoopsUser) {
            
$timeoffset $xoopsUser->getVar("timezone_offset");
        } else {
            
$timeoffset $xoopsConfig['default_TZ'];
        }
    }
    
$usertimestamp intval($time) + (intval($timeoffset) - $xoopsConfig['server_TZ'])*3600;
    return 
$usertimestamp;
}



/*
* Function to display formatted times in user timezone
*/
function formatTimestamp($time$format="l"$timeoffset="")
{
       if(
is_callable(array("XoopsLocal""formatTimestamp"))) {
           return 
XoopsLocal::formatTimestamp($time$format$timeoffset); 
           
// Or
           // return xoops_local("formatTimestamp", $time, $format, $timeoffset);
       
}
    
    global 
$xoopsConfig$xoopsUser;
    
$usertimestamp xoops_getUserTimestamp($time$timeoffset);
    switch (
strtolower($format)) {
        case 
's':
        
$datestring _SHORTDATESTRING;
        break;
        case 
'm':
        
$datestring _MEDIUMDATESTRING;
        break;
        case 
'mysql':
        
$datestring "Y-m-d H:i:s";
        break;
        case 
'rss':
        
$datestring "r";
        break;
        case 
'l':
        
$datestring _DATESTRING;
        break;
        default:
        if (
$format != '') {
            
$datestring $format;
        } else {
            
$datestring _DATESTRING;
        }
        break;
    }
    return 
ucfirst(date($datestring$usertimestamp));
}

/*
* Function to calculate server timestamp from user entered time (timestamp)
*/
function userTimeToServerTime($timestamp$userTZ=null)
{
    global 
$xoopsConfig;
    if (!isset(
$userTZ)) {
        
$userTZ $xoopsConfig['default_TZ'];
    }
    
$timestamp $timestamp - (($userTZ $xoopsConfig['server_TZ']) * 3600);
    return 
$timestamp;
}

function 
xoops_makepass($length 5) {
    
$makepass '';
    
$syllables = array("a""b""c""d""e""f""g""h""i""j""k""l""m""n","o""p""q""r""s""t""u""v""x""y""z",
    
"A""B""C""D""E""F""G""H""I""J""K""L""M""N","O""P""Q""R""S""T""U""V""X""Y""Z",
    
"1""2""3""4""5""6""7""8""9""0");
    
srand((double)microtime()*1000000);
    
$syllable_count count($syllables);
    for (
$count 1$count <= $length$count++) {
        if (
rand()%10 == 1) {
            
$makepass .= sprintf("%0.0f",(rand()%50)+1);
        } else {
            
$makepass .= $syllables[rand()%$syllable_count];
        }
    }
    return 
$makepass;
}

/*
* Functions to display dhtml loading image box
*/
function OpenWaitBox()
{
    echo 
"
    
      
        
._FETCHING.".XOOPS_URL."/images/await.gif' alt='' />

._PLEASEWAIT."
      
    
    

    
    
    ";
}

function 
CloseWaitBox()
{
    echo 
"
    
    
    "
;
}

function 
checkEmail($email,$antispam false)
{
    if (!
$email || !preg_match("/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+([.][a-z0-9-]+)+$/i",$email)){
        return 
false;
    }
    if (
$antispam) {
        
$email str_replace("@"" at "$email);
        
$email str_replace("."" dot "$email);
    }
    return 
$email;
}

function 
formatURL($url)
{
    
$url trim($url);
    if (
$url != '') {
        if ((!
preg_match("/^http[s]*:///i"$url)) && (!preg_match("/^ftp*:///i"$url)) && (!preg_match("/^ed2k*:///i"$url)) ) {
            
$url 'http://'.$url;
        }
    }
    return 
$url;
}

/*
* Function to display banners in all pages
*/
function showbanner()
{
    echo 
xoops_getbanner();
}

/*
* Function to get banner html tags for use in templates
*/
function xoops_getbanner()
{
    global 
$xoopsConfig;
    
$db =& Database::getInstance();
    
$bresult $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner"));
    list (
$numrows) = $db->fetchRow($bresult);
    if ( 
$numrows ) {
        
$numrows $numrows-1;
        
mt_srand((double)microtime()*1000000);
        
$bannum mt_rand(0$numrows);
    } else {
        
$bannum 0;
    }
    if ( 
$numrows ) {
        
$bresult $db->query("SELECT * FROM ".$db->prefix("banner"), 1$bannum);
        list (
$bid$cid$imptotal$impmade$clicks$imageurl$clickurl$date$htmlbanner$htmlcode) = 

$db->fetchRow($bresult);
        if (
$xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) {
            
// EMPTY
        
} else {
            
$db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = %u"$db->prefix("banner"), $bid));
        }
        
/* Check if this impression is the last one and print the banner */
        
if ( $imptotal == $impmade ) {
            
$newid $db->genId($db->prefix("bannerfinish")."_bid_seq");
            
$sql sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, 

%u)"
$db->prefix("bannerfinish"), $newid$cid$impmade$clicks$datetime());
            
$db->queryF($sql);
            
$db->queryF(sprintf("DELETE FROM %s WHERE bid = %u"$db->prefix("banner"), $bid));
        }
        if (
$htmlbanner){
            
$bannerobject $htmlcode;
        }else{
            
$bannerobject '
.XOOPS_URL.'/banners.php?op=click&bid='.$bid.'" target="_blank">';
            if (
stristr($imageurl'.swf')) {
                
$bannerobject $bannerobject
                
.'
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" 

height="60">'
                
.'.$imageurl.'">'
                
.''
                
.'.$imageurl.'" quality=high 

pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; 

type="application/x-shockwave-flash" width="468" height="60">'
                
.''
                
.'';
            } else {
                
$bannerobject $bannerobject.'.$imageurl.'" alt="" />';
            }

            
$bannerobject $bannerobject.'
'
;
        }
        return 
$bannerobject;
    }
}

/*
* Function to redirect a user to certain pages
*/
function redirect_header($url$time 3$message ''$addredirect true)
{
    global 
$xoopsConfig$xoopsLogger$xTheme$xoopsOption$xoopsModule$xoopsUser$xoopsTpl;
    if (
preg_match('/b(java)?script:/si'$url) ) {
        if (!
preg_match('/^b(java)?script:([s]*)history.go(-[0-9]*)([s]*[;]*[s]*)$/si'$url) ) {
            
$url XOOPS_URL;
        }
    }
    
//$xTheme->tplEngine->assign('xoops_showrblock', 1);

    
$xTheme->tplEngine->assign('time'intval($time));
    if (
$addredirect && strstr($url'user.php')) {
        if (!
strstr($url'?')) {
            
$url .= '?xoops_redirect='.urlencode($_SERVER['REQUEST_URI']);
        } else {
            
$url .= '&xoops_redirect='.urlencode($_SERVER['REQUEST_URI']);
        }
    }
    if (
defined('SID') && (! isset($_COOKIE[session_name()]) || ($xoopsConfig['use_mysession'] && 

$xoopsConfig['session_name'] != '' && !isset($_COOKIE[$xoopsConfig['session_name']])))) {
        if (!
strstr($url'?')) {
            
$url .= '?' SID;
        } else {
            
$url .= '&'.SID;
        }
    }
    
$url preg_replace("/&/i"'&'htmlspecialchars($urlENT_QUOTES));
    
$xTheme->tplEngine->assign('url'$url);
    
$message trim($message) != '' $message _TAKINGBACK;
    
$xTheme->tplEngine->assign('message'$message);
    
$xTheme->tplEngine->assign('lang_ifnotreload'sprintf(_IFNOTRELOAD$url));
    
$xTheme->tplEngine->assign('xoops_module_header''.$url.'" />');
    
$xoopsOption['template_main'] = 'system_redirect.html';
    include 
XOOPS_ROOT_PATH."/footer.php";
    exit();
}

function 
xoops_getenv($key)
{
    return isset(
$_SERVER[$key]) ? $_SERVER[$key] : (isset($_ENV[$key]) ? $_ENV[$key] : null);
}

/*
* This function is deprecated. Do not use!
*/
function getTheme()
{
    return 
$GLOBALS['xoopsConfig']['theme_set'];
}

/*
* Function to get css file for a certain theme
* This function will be deprecated.
*/
function getcss($theme '')
{
    return 
xoops_getcss($theme);
}

/**
 * Function to get css file for a certain themeset
 * 
 * @var string $theme name of theme
 * @var string $type which type (main, admin or RSS) of CSS to return
 *
 * @return string
 */
function xoops_getcss($theme ''$type "main")
{
    if (
$theme == '') {
        
$theme $GLOBALS['xoopsConfig']['theme_set'];
    }
    
$uagent xoops_getenv('HTTP_USER_AGENT');
    if (
$type == "admin" || $type == "main") {
        if (
stristr($uagent'mac')) {
            
$str_css 'styleMAC';
        } elseif (
preg_match("/MSIE ([0-9].[0-9]{1,2})/i"$uagent)) {
            
$str_css 'style';
        } else {
            
$str_css 'styleNN';
        }
    }
    if (
is_dir(XOOPS_THEME_PATH.'/'.$theme)) {
        switch (
$type) {
            case 
"main":
            if (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/css/'.$str_css.'.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/css/'.$str_css.'.css';
            }
            elseif (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/'.$str_css.'.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/'.$str_css.'.css';
            }
            elseif (
file_exists(XOOPS_THEME_PATH.'/css/'.$theme.'/style.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/css/style.css';
            }
            elseif (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/style.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/style.css';
            }
            else {
                return 
XOOPS_THEME_URL.'/default/css/style.css';
            }
            break;

            case 
"RSS":
            if (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/css/rss.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/css/rss.css';
            }
            elseif (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/rss.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/rss.css';
            }
            else {
                return 
'';
            }
            break;

            case 
"admin":
            
$str_css $str_css."Admin";
            if (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/css/'.$str_css.'.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/css/'.$str_css.'.css';
            }
            elseif (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/'.$str_css.'.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/'.$str_css.'.css';
            }
            elseif (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/css/styleAdmin.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/css/styleAdmin.css';
            }
            elseif (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/styleAdmin.css')) {
                return 
XOOPS_THEME_URL.'/'.$theme.'/styleAdmin.css';
            }
            else {
                
//return regular CSS
                
return xoops_getcss($theme);
            }
            break;

            case 
"module":
            
$moduleCSS = array();
            if (
is_object($GLOBALS['xoopsModule'])) {
                if (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/css/'.$GLOBALS['xoopsModule']->getVar('dirname').'.css')) {
                    
$moduleCSS[] = XOOPS_THEME_URL.'/'.$theme.'/css/'.$GLOBALS['xoopsModule']->getVar('dirname').'.css';
                }
                else {
                    
$cssfiles $GLOBALS['xoopsModule']->getInfo('css');
                    
$cssfiles is_array($cssfiles)?$cssfiles:array($cssfiles);
                    foreach(
$cssfiles as $cssfile){
                        if (
$cssfile && 

file_exists(XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['xoopsModule']->getVar('dirname').'/'.$cssfile)) {
                            
$moduleCSS[] = XOOPS_URL.'/modules/'.$GLOBALS['xoopsModule']->getVar('dirname').'/'.$cssfile;
                        }
                    }
                }
            }
            return 
$moduleCSS;
            break;
        }
        return 
'';
    }
}

function &
getMailer()
{
    global 
$xoopsConfig;
    include_once 
XOOPS_ROOT_PATH."/class/xoopsmailer.php";
    if ( 
file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/xoopsmailerlocal.php") ) {
        include_once 
XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/xoopsmailerlocal.php";
        if ( 
class_exists("XoopsMailerLocal") ) {
            return new 
XoopsMailerLocal();
        }
    }
    return new 
XoopsMailer();
}

function &
xoops_gethandler($name$optional false )
{
    static 
$handlers;
    
$name strtolower(trim($name));
    if (!isset(
$handlers[$name])) {
        if ( 
file_exists$hnd_file XOOPS_ROOT_PATH.'/kernel/'.$name.'.php' ) ) {
            require_once 
$hnd_file;
        }
        
$class 'Xoops'.ucfirst($name).'Handler';
        if (
class_exists($class)) {
            
$handlers[$name] =& new $class($GLOBALS['xoopsDB']);
        }
    }
    if (!isset(
$handlers[$name]) && !$optional ) {
        
trigger_error('Class '.$class.' does not existHandler Name: '
.$nameE_USER_ERROR);
    }
    if ( isset( 
$handlers[$name] ) ) {
        return 
$handlers[$name];
    }
    return 
false;
}

function &
xoops_getmodulehandler($name null$module_dir null$optional false)
{
    static 
$handlers;
    
// if $module_dir is not specified
    
if (!isset($module_dir)) {
        
//if a module is loaded
        
if (isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule'])) {
            
$module_dir $GLOBALS['xoopsModule']->getVar('dirname');
        } else {
            
trigger_error('No Module is loaded'E_USER_ERROR);
        }
    } else {
        
$module_dir trim($module_dir);
    }
    
$name = (!isset($name)) ? $module_dir trim($name);
    if (!isset(
$handlers[$module_dir][$name])) {
        if ( 
file_exists$hnd_file XOOPS_ROOT_PATH "/modules/{$module_dir}/class/{$name}.php" ) ) {
            include_once 
$hnd_file;
        }
        
$class ucfirst(strtolower($module_dir)).ucfirst($name).'Handler';
        if (
class_exists($class)) {
            
$handlers[$module_dir][$name] =& new $class$GLOBALS['xoopsDB'] );
        }
    }
    if (!isset(
$handlers[$module_dir][$name]) && !$optional) {
        
trigger_error('Handler does not existModule: '.$module_dir.'Name: '.$nameE_USER_ERROR);
    }
    if ( isset( 
$handlers[$module_dir][$name] ) ) {
        return 
$handlers[$module_dir][$name];
    }
    return 
false;
}

function 
xoops_getrank($rank_id =0$posts 0)
{
    
$db =& Database::getInstance();
    
$myts =& MyTextSanitizer::getInstance();
    
$rank_id intval($rank_id);
    if (
$rank_id != 0) {
        
$sql "SELECT rank_title AS title, rank_image AS image FROM ".$db->prefix('ranks')." WHERE rank_id = ".$rank_id;
    } else {
        
$sql "SELECT rank_title AS title, rank_image AS image FROM ".$db->prefix('ranks')." WHERE rank_min <= ".$posts.

AND rank_max >= "
.$posts." AND rank_special = 0";
    }
    
$rank $db->fetchArray($db->query($sql));
    
$rank['title'] = $myts->makeTboxData4Show($rank['title']);
    
$rank['id'] = $rank_id;
    return 
$rank;
}


/**
* Returns the portion of string specified by the start and length parameters. If $trimmarker is supplied, it is appended to the 

return string. This function works fine with multi-byte characters if mb_* functions exist on the server.
*
* @param    string    $str
* @param    int       $start
* @param    int       $length
* @param    string    $trimmarker
*
* @return   string
*/
function xoops_substr($str$start$length$trimmarker '...')
{
       if(
is_callable(array("XoopsLocal""substr"))) {
           return 
XoopsLocal::substr($str$start$length); 
           
// Or
           // return xoops_local("substr", $str, $start, $length);
       
}
    if ( !
XOOPS_USE_MULTIBYTES ) {
        return ( 
strlen($str) - $start <= $length ) ? substr$str$start$length ) : substr$str$start$length strlen($trimmarker

) . 
$trimmarker;
    }
    if (
function_exists('mb_internal_encoding') && @mb_internal_encoding(_CHARSET)) {
        
$str2 mb_strcut$str $start $length strlen$trimmarker ) );
        return 
$str2 . ( mb_strlen($str)!=mb_strlen($str2) ? $trimmarker '' );
    }
}

// RMV-NOTIFY
// ################ Notification Helper Functions ##################

// We want to be able to delete by module, by user, or by item.
// How do we specify this??

function xoops_notification_deletebymodule ($module_id)
{
    
$notification_handler =& xoops_gethandler('notification');
    return 
$notification_handler->unsubscribeByModule ($module_id);
}

function 
xoops_notification_deletebyuser ($user_id)
{
    
$notification_handler =& xoops_gethandler('notification');
    return 
$notification_handler->unsubscribeByUser ($user_id);
}

function 
xoops_notification_deletebyitem ($module_id$category$item_id)
{
    
$notification_handler =& xoops_gethandler('notification');
    return 
$notification_handler->unsubscribeByItem ($module_id$category$item_id);
}

// ################### Comment helper functions ####################

function xoops_comment_count($module_id$item_id null)
{
    
$comment_handler =& xoops_gethandler('comment');
    
$criteria = new CriteriaCompo(new Criteria('com_modid'intval($module_id)));
    if (isset(
$item_id)) {
        
$criteria->add(new Criteria('com_itemid'intval($item_id)));
    }
    return 
$comment_handler->getCount($criteria);
}

function 
xoops_comment_delete($module_id$item_id)
{
    if (
intval($module_id) > && intval($item_id) > 0) {
        
$comment_handler =& xoops_gethandler('comment');
        
$comments =& $comment_handler->getByItemId($module_id$item_id);
        if (
is_array($comments)) {
            
$count count($comments);
            
$deleted_num = array();
            for (
$i 0$i $count$i++) {
                if (
false != $comment_handler->delete($comments[$i])) {
                    
// store poster ID and deleted post number into array for later use
                    
$poster_id $comments[$i]->getVar('com_uid');
                    if (
$poster_id != 0) {
                        
$deleted_num[$poster_id] = !isset($deleted_num[$poster_id]) ? : ($deleted_num[$poster_id] + 1);
                    }
                }
            }
            
$member_handler =& xoops_gethandler('member');
            foreach (
$deleted_num as $user_id => $post_num) {
                
// update user posts
                
$com_poster $member_handler->getUser($user_id);
                if (
is_object($com_poster)) {
                    
$member_handler->updateUserByField($com_poster'posts'$com_poster->getVar('posts') - $post_num);
                }
            }
            return 
true;
        }
    }
    return 
false;
}

// ################ Group Permission Helper Functions ##################

function xoops_groupperm_deletebymoditem($module_id$perm_name$item_id null)
{
    
// do not allow system permissions to be deleted
    
if (intval($module_id) <= 1) {
        return 
false;
    }
    
$gperm_handler =& xoops_gethandler('groupperm');
    return 
$gperm_handler->deleteByModule($module_id$perm_name$item_id);
}

function &
xoops_utf8_encode(&$text)
{
       if(
is_callable(array("XoopsLocal""utf8_encode"))) {
           return 
XoopsLocal::utf8_encode($text); 
       }
    if (
XOOPS_USE_MULTIBYTES == 1) {
        if (
function_exists('mb_convert_encoding')) {
            return 
mb_convert_encoding($text'UTF-8''auto');
        }
        return 
$text;
    }
    return 
utf8_encode($text);
}

function &
xoops_convert_encoding(&$text$to='utf-8'$from='')
{
       if(
is_callable(array("XoopsLocal""convert_encoding"))) {
           return 
XoopsLocal::convert_encoding($text$to$from); 
       }
       if(
strtolower($to)!="utf-8") return $text;
    return 
xoops_utf8_encode($text);
}

function 
xoops_getLinkedUnameFromId($userid$usereal 1)
{
    
$userid intval($userid);
    if (
$userid 0) {
        
$member_handler =& xoops_gethandler('member');
        
$user =& $member_handler->getUser($userid);
        if (
is_object($user)) {
            
$linkeduser 'href="'.XOOPS_URL.'/userinfo.php?uid='.$userid.'">';
            if ( 
$usereal && xoops_trim($user->getVar('name'))!='') {
                
$linkeduser .= $user->getVar('name');
            }
            else {
                
$linkeduser .= $user->getVar('uname');
            }
            
$linkeduser .= '
';
            return 
$linkeduser;
        }
    }
    return 
$GLOBALS['xoopsConfig']['anonymous'];
}

function 
xoops_trim($text)
{
       if(
is_callable(array("XoopsLocal""trim"))) {
           return 
XoopsLocal::trim($text); 
           
// Or
           // return xoops_local("trim", $text);
       
}
    return 
trim($text);
}

// calling XoopsLocal::{$func}()
function &xoops_local($func)
{
    
$par_string "";
    
// get parameters
    
if (func_num_args() > 1) {
        
$params array_slice(func_get_args(),1);
        
$count count($params);
        
$par_string .= '$params[0]';
        for(
$i=1;$i<$count;$i++) {
            
$par_string .= ',$params[' $i ']';
        }
    }
    
// local method defined
    
if(is_callable(array("XoopsLocal"$func))) {
        
$code "return XoopsLocal::{$func}(";
        if(!empty(
$par_string)) $code .= $par_string;
        
$code .= ');';
        return eval(
$code);
    }
    
// php function defined
    
if(function_exists($func)){
        
$code "return {$func}(";
        if(!empty(
$par_string)) $code .= $par_string;
        
$code .= ');';
        return eval(
$code);
    }
    
// nothing
    
return null;
}

// Used in kernel/module.php
function xoops_array_diff_assoc($array1$array2)
{
    if(!
is_array($array1) || count($array1)==0) {
        return array();
    } 
    if(!
is_array($array2) || count($array2)==0) {
        return 
$array1;
    } 
    if(
function_exists("array_diff_assoc")){ // PHP 4.3.0+
        
return array_diff_assoc($array1$array2);
    }else{
        
$diff = array();
        foreach(
$array1 as $key => $value){
            if(!isset(
$array2[$key]) || ((string) $value !== (string) $array2[$key])){
                
$diff[$key] = $value;
            }
        }
    return 
$diff ;
    }
}
?>

18
Xetox
Re: Login Issue
  • 2005/11/3 18:12

  • Xetox

  • Just popping in

  • Posts: 71

  • Since: 2005/10/28


Dave

EDIT: If you want I can email you my functions.php file, you could back up yours and just try the one that works on a my test site - let me know.[/quote]

That would be great, I have tried a frest one from the XOOPS install. But right now I would be willing to try about anything.

19
dickinsd
Re: Login Issue
  • 2005/11/3 20:14

  • dickinsd

  • Quite a regular

  • Posts: 278

  • Since: 2004/11/14


From your post above, it seems that sending my functions.php file would not really acheive anything as it looks as though you narrowed the fault down to an issue with the theme.

Assuming that the theme you have is not a custom theme you made for yourself, I would suggest you change all themes back to default then delete the theme you are currently using from your server.

Clear your cache (Again...)

Then upload a fresh copy of that theme with NO changes it to it (i.e. as it comes with the standard logos etc)

Then change to your new theme and and try again.

If your still in the same boat, then your best bet would be to contact the theme creator and ask them for further help. (assuming you did not make the theme yourself)

If your theme is a custom theme, let me have a copy, I will stick it on a test site and see if the problems are on my site also.

Dave.

PS: I will email you a copy of my functions.php file anyway, but if the theme is at fault, I don't think it is going to make a huge difference.

20
Xetox
Re: Login Issue
  • 2005/11/3 21:58

  • Xetox

  • Just popping in

  • Posts: 71

  • Since: 2005/10/28


The issue is with my theme, I am using karate_redux_blue. I did what you said and then reinstalled the theme but still doing the same.

I install a different theme and everthing is fine. I just wish I could figure out what is up with karate, cause I have edited my page to look good with that theme :)

Login

Who's Online

187 user(s) are online (141 user(s) are browsing Support Forums)


Members: 0


Guests: 187


more...

Donat-O-Meter

Stats
Goal: AU$15.00
Due Date: Jul 31
Gross Amount: AU$0.00
Net Balance: AU$0.00
Left to go: AU$15.00
Make donations with PayPal!

Latest GitHub Commits