Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Making Nuke Efficient
Author Message
Mesum
Useless



Joined: Aug 23, 2002
Posts: 213
Location: Chicago

PostPosted: Wed Dec 08, 2004 7:52 am Reply with quote

Hello again guys, I know most people don't bother reading this section but I just thought of posting it here and see you guys think of this:

The idea has been taken from CNBYA...What if we break the mainfile.php into many small files?

Code:


case "get_theme":
        {
            include("includes/main/gettheme.php");
        } else {
            disabled();
        }
    break;


And in includes/main/gettheme.php

Code:


function get_theme() {
    global $user, $cookie, $Default_Theme;
    static $ThemeSelSave;
    if (isset($ThemeSelSave)) return ($ThemeSelSave);
    if(is_user($user)) {
        $user2 = base64_decode($user);
        $t_cookie = explode(":", $user2);
        if($t_cookie[9]=="") $t_cookie[9]=$Default_Theme;
        if(isset($theme)) $t_cookie[9]=$theme;
        if(!$tfile=@opendir("themes/$t_cookie[9]")) {
            $ThemeSel = $Default_Theme;
        } else {
            $ThemeSel = $t_cookie[9];
        }
    } else {
        $ThemeSel = $Default_Theme;
    }
    $ThemeSelSave = $ThemeSel;
    return($ThemeSel);
}

with other necessary code needed and then we global everything in once...Hell, I have no idea what I am talking about but I hope someone gets the idea.

What you guys think? Yay or Nay?
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Dec 08, 2004 9:14 am Reply with quote

Organizationally it might be nice. But as for speed, I would say that any increase would not be significant enough to matter.
 
View user's profile Send private message
Mesum







PostPosted: Wed Dec 08, 2004 1:25 pm Reply with quote

Can we add the "if" function to the case like:

Code:


if case "get_theme":
        {
            include("includes/main/gettheme.php");
        } else {
            donothing();
        }
    break;


Or something like that, this way it won't call the quires for something that hasn't been used?
 
Specks
New Member
New Member



Joined: Jan 24, 2005
Posts: 12

PostPosted: Tue Jan 25, 2005 1:43 pm Reply with quote

Case doesn't work that way. PHP will complain if you do that. In fact it won't even run.
 
View user's profile Send private message
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Making Nuke Efficient

View next topic
View previous 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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©