View Single Post
Old 12-13-2007, 08:59 AM   #13 (permalink)
xenon
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

Quote:
Originally Posted by wGEric View Post
phpBB3 is a rewrite of phpBB2. None of the code is the same.
..but still, has the same crappy coding style (functions over classes, then some 'random code', then some more functions, and then a class or two), followed by some more spaghetti code. Check this out: (extras from /search.php):

Code:
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('search');

// Define initial vars
$mode            = request_var('mode', '');
$search_id        = request_var('search_id', '');
$start            = max(request_var('start', 0), 0);
$post_id        = request_var('p', 0);
$topic_id        = request_var('t', 0);
$view            = request_var('view', '');

[...]

gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);

if ($keywords || $author || $author_id || $search_id || $submit)
{
    // clear arrays
    $id_ary = array();

    // egosearch is an author search
    if ($search_id == 'egosearch')
    {
        $author_id = $user->data['user_id'];
        
        if ($user->data['user_id'] == ANONYMOUS)
        {
            login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
        }
    } // and the crap goes on...
For the sake of the other programmers, choose a GOOD style and stick to it.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote