Current time: 05-21-2024, 05:21 PM Hello There, Guest! (LoginRegister)


Post Reply 
RC5 release soon! Tester Wanted!
Author Message
ispcomm Offline
Junior Member
*

Posts: 93
Joined: Apr 2008
Reputation: 3
Post: #12
RE: RC5 release soon! Tester Wanted!
sci2tech Wrote:
Code:
function gen_page_awstats($tpl) {
        global $cfg;
        $awstats_act = $cfg['AWSTATS_ACTIVE'];
        if ($awstats_act != 'yes') {
                $tpl->assign('ACTIVE_AWSTATS', '');
        } else {
                $tpl->assign(
                        array(
                                'AWSTATS_PATH' => 'http://' . $_SESSION['user_logged'] . '/stats/',
                                'AWSTATS_TARGET' => '_blank'
                                )
                        );
        }
}
The bug is here. If awstats is dynanic AWSTATS_PATH is never defined hence never substituted in the template. Maybe a bug in the template (but since I'd move this logic to the php file I'd modify it to define a corrent AWSTATS_PATH).
sci2tech Wrote:BTW: It`s the same function in all that file Tongue
Yes... like I said in the past. Whoever coded this mess has been paid by the line of code and not for quality. SmileSmileSmile

Good luck. I think you nailed down the problem correctly.

ADDED: However a little more debugging on my platform shows that AWSTATS_PATH is set correctly.

The problem is in the declaration of the function where $tpl is passed as value. It must be passed as reference:
Code:
function gen_page_awstats(&$tpl) {
....

I tested and it works Smile

You can attach the patch to the ticket as you're the one who found it Smile

ispcomm.
(This post was last modified: 05-20-2008 04:54 AM by ispcomm.)
05-20-2008 04:42 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RC5 release soon! Tester Wanted! - RatS - 05-19-2008, 12:13 AM
RE: RC5 release soon! Tester Wanted! - ispcomm - 05-20-2008 04:42 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)