You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 278 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Speedup mainfile.php [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Poll :: This speed upgrade was usefull for me ?

Yes
61%
 61%  [ 64 ]
A bit
26%
 26%  [ 28 ]
No
11%
 11%  [ 12 ]
Total Votes : 104


Author Message
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Mon Mar 01, 2004 5:16 am Reply with quoteBack to top

VinDSL just name it "PHP script executed in:"

_________________
Famous people never give their signature Rolling Eyes
http://www.cpgnuke.com <- back online thanks to dedicatednow.com
Don't ask me to be admin on your site please Exclamation
Find all posts by djmazeView user's profileSend private messageVisit poster's website
KaTXi
Nuke Soldier
Nuke Soldier


Joined: Jul 02, 2003
Posts: 13


PostPosted: Mon Mar 01, 2004 12:30 pm Reply with quoteBack to top

DJ, may i ask you for a little favor???
I know you've released cpgnuke, which are great news indeed, since i've modified my mainfile.php with your suggested functions and i've noticed a speed increase. Thanks.
My problem is that i'd like to "upgrade" to CPG, but i have tons of modification to my 6.5 nuke installation (in fact i cannot upgrade to even nuke 6.6 Very Happy ).
Can you, please, try to explain us where are you main modifications "6.5 compatible / plug'n'play" in the same way you did with the great mainfile mods???

Thanks in advance!!!
Find all posts by KaTXiView user's profileSend private message
ryan1918
Sergeant
Sergeant


Joined: Aug 16, 2003
Posts: 144


PostPosted: Mon Mar 01, 2004 6:26 pm Reply with quoteBack to top

oh okay.

_________________
www.ryan1918.com
Security portal. Security news, information, downloads, exploits, forum, free webmail, and much more!
Image
Find all posts by ryan1918View user's profileSend private messageVisit poster's website
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Tue Mar 02, 2004 9:03 am Reply with quoteBack to top

KaTXi wrote:
Can you, please, try to explain us where are you main modifications "6.5 compatible / plug'n'play" in the same way you did with the great mainfile mods???


Sorry i can't, actualy we are modifying all files and nothing will be left alone.
8.0 is just the beginning of making it a incredible system.

You'd better use something like "WinMerge" application to check the differences between the 2
Find all posts by djmazeView user's profileSend private messageVisit poster's website
Steve_Lillico
Nuke Soldier
Nuke Soldier


Joined: Feb 27, 2004
Posts: 27


PostPosted: Wed Mar 03, 2004 7:12 pm Reply with quoteBack to top

Thank you, works like a charm, no phantom users, no problems at all.

viva Nukecops.
Find all posts by Steve_LillicoView user's profileSend private messageVisit poster's website
JesseJames01
Lieutenant
Lieutenant


Joined: Jan 15, 2004
Posts: 164

Location: U.S.A

PostPosted: Wed Mar 03, 2004 7:15 pm Reply with quoteBack to top

Steve_Lillico wrote:
Thank you, works like a charm, no phantom users, no problems at all.

viva Nukecops.
uhhh yeah what he said

_________________

http://flashlevel.com | http://ultrashock.com | http://billybussey.com
Find all posts by JesseJames01View user's profileSend private messageSend e-mailVisit poster's websiteYahoo MessengerMSN MessengerICQ Number
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Thu Mar 04, 2004 12:20 pm Reply with quoteBack to top

Just found another speed increaser Very Happy

Just replace the old functions with these in mainfile.php
Code:
function formatAidHeader($aid) {
    echo get_author($aid);
}

function get_author($aid) {
    global $prefix, $db;
    static $users;
    if (is_array($users[$aid])) {
        $row = $users[$aid];
    } else {
        $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $users[$aid] = $row;
    }
    if (isset($row['url'])) {
        $aid = "<a href=\"$row[url]\">$aid</a>";
    } elseif (isset($row['email'])) {
        $aid = "<a href=\"mailto:$row[email]\">$aid</a>";
    } else {
        $aid = $aid;
    }
    return $aid;
}

_________________
Famous people never give their signature Rolling Eyes
http://www.cpgnuke.com <- back online thanks to dedicatednow.com
Don't ask me to be admin on your site please Exclamation
Find all posts by djmazeView user's profileSend private messageVisit poster's website
LordShinyK
Corporal
Corporal


Joined: Oct 29, 2003
Posts: 51


PostPosted: Wed Mar 10, 2004 3:04 pm Reply with quoteBack to top

Sorry but is the phantom user problem solved ?
Find all posts by LordShinyKView user's profileSend private message
Rami100735
Nuke Cadet
Nuke Cadet


Joined: Dec 16, 2003
Posts: 3


PostPosted: Wed Mar 10, 2004 8:22 pm Reply with quoteBack to top

djmaze wrote:
Just found another speed increaser Very Happy

Just replace the old functions with these in mainfile.php
Code:
function formatAidHeader($aid) {
    echo get_author($aid);
}

function get_author($aid) {
    global $prefix, $db;
    static $users;
    if (is_array($users[$aid])) {
        $row = $users[$aid];
    } else {
        $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'";
        $result = $db->sql_query($sql);
        $row = $db->sql_fetchrow($result);
        $users[$aid] = $row;
    }
    if (isset($row['url'])) {
        $aid = "<a href=\"$row[url]\">$aid</a>";
    } elseif (isset($row['email'])) {
        $aid = "<a href=\"mailto:$row[email]\">$aid</a>";
    } else {
        $aid = $aid;
    }
    return $aid;
}


Actually the two codes arent the same, so that may not be advisable.
Find all posts by Rami100735View user's profileSend private message
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Wed Mar 10, 2004 9:25 pm Reply with quoteBack to top

Rami100735 wrote:
Actually the two codes arent the same, so that may not be advisable.


Huh ?

At my place they are the same with 1 difference
formatAidHeader() echo's the aid
get_author() returns the aid

here's the OLD code
Code:
function formatAidHeader($aid) {
    global $prefix, $db;
    $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $url = $row[url];
    $email = $row[email];
    if (isset($url)) {
        $aid = "<a href=\"$url\">$aid</a>";
    } elseif (isset($email)) {
        $aid = "<a href=\"mailto:$email\">$aid</a>";
    } else {
        $aid = $aid;
    }
    echo "$aid";
}

function get_author($aid) {
    global $prefix, $db;
    $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    if (isset($row[url])) {
        $aid = "<a href=\"$row[url]\">$aid</a>";
    } elseif (isset($row[email])) {
        $aid = "<a href=\"mailto:$row[email]\">$aid</a>";
    } else {
        $aid = $aid;
    }
    return($aid);
}
Find all posts by djmazeView user's profileSend private messageVisit poster's website
nicruisin
Captain
Captain


Joined: Oct 08, 2003
Posts: 449


PostPosted: Sat Mar 13, 2004 5:27 pm Reply with quoteBack to top

Nice one went from an average of about 2.6s to 1.505s

Good work!

_________________
Image
www.nicruisin.com/html
Find all posts by nicruisinView user's profileSend private message
wgwara
Nuke Soldier
Nuke Soldier


Joined: Mar 16, 2004
Posts: 11

Location: UK

PostPosted: Thu Mar 18, 2004 1:45 am Reply with quoteBack to top

It's been a while since anyone has written anythign here.

I have merged all of the updated functions from this topic into my mainfile.php Smile It works! The problem is that when a user was trying to login to his account page was displayed without all the navigation buttons and no options to choose, the Login block was still displayed so basically the user was not logged in.

As soon as I rolled back some of the STATIC to the ones posted by djmaze (without static) everything started to work fine. The functions which I rolled back were to get it to work were getusrinfo(..) and is_user(..)
Find all posts by wgwaraView user's profileSend private message
steven111
Lieutenant
Lieutenant


Joined: Dec 30, 2003
Posts: 283


PostPosted: Sun Mar 21, 2004 1:33 am Reply with quoteBack to top

djmaze, thank you for brining this effort to the nuke masses, and supporting it all the way.

steve Razz Razz

_________________
ezClassifieds|Forums:Auto,Mac,Job,Win,HW
Find all posts by steven111View user's profileSend private messageVisit poster's website
webdev1
Nuke Soldier
Nuke Soldier


Joined: Feb 19, 2004
Posts: 33


PostPosted: Sun Mar 21, 2004 9:21 pm Reply with quoteBack to top

Steven 111,
I agree and really appreciate the work DJMaze & Team have done, If your like me you may not want to have to go in and rework every file, thats why I've switched over to CPG-Nuke, the install went smoothly and there are more and more modules and blocks being ported daily, in addition to the many PHP-Nuke ones that still work fine. Oh, and don't forget, CPG-Nuke is OSCNukeLite ready.
webdev1

_________________
Image
Find all posts by webdev1View user's profileSend private message
Waldo
Nuke Soldier
Nuke Soldier


Joined: Mar 16, 2004
Posts: 24


PostPosted: Mon Mar 22, 2004 9:12 pm Reply with quoteBack to top

djmaze wrote:
Rami100735 wrote:
Actually the two codes arent the same, so that may not be advisable.


Huh ?

At my place they are the same with 1 difference
formatAidHeader() echo's the aid
get_author() returns the aid

here's the OLD code
Code:
function formatAidHeader($aid) {
    global $prefix, $db;
    $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $url = $row[url];
    $email = $row[email];
    if (isset($url)) {
        $aid = "<a href=\"$url\">$aid</a>";
    } elseif (isset($email)) {
        $aid = "<a href=\"mailto:$email\">$aid</a>";
    } else {
        $aid = $aid;
    }
    echo "$aid";
}

function get_author($aid) {
    global $prefix, $db;
    $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    if (isset($row[url])) {
        $aid = "<a href=\"$row[url]\">$aid</a>";
    } elseif (isset($row[email])) {
        $aid = "<a href=\"mailto:$row[email]\">$aid</a>";
    } else {
        $aid = $aid;
    }
    return($aid);
}



Well, you're right, they're not 100% the same (see how they treat the $email variable differently.) However, they appear to be FUNCTIONALLY the same-- the only difference being that $row[email] is assigned to a variable before substituted in the URL in one version, but not the other. Assigning the variable may actually slow it down a microsecond, since PHP has to move memory around...

who knows.. I'll try it and see ifa nything bad happens.

W
Find all posts by WaldoView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.051 Seconds - 390 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::