icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old November 13th, 2007, 10:08 PM   #10 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,218 posts
Gave thanks: 18
Thanked 86 times
Glad it worked.

With the OR, the IF statement as written would never be "False" and the else portion would never be executed. A somewhat less confusing IF statement would be:

if ((id == 1) OR (id == 23))
then print footer stuff
else don't do footer stuff

But since it works, I wouldn't mess with it LOL.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old November 13th, 2007, 10:21 PM   #11 (permalink)
wgm
Registered User
Super #1
 
Joined in Mar 2005
Lives in Washougal, WA
1,302 posts
Gave thanks: 23
Thanked 39 times
Glad its working, I knew it was that line, with my lack of PHP knowlegde could not pinpoint exactly what it was.
wgm is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old November 13th, 2007, 10:39 PM   #12 (permalink)
MR. SECURITY
Excelling Contributor
 
Tracer Round's Avatar
 
Joined in Jun 2004
Lives in Orlando, USA
Hosted on SH129
722 posts
Gave thanks: 4
Thanked 1 Time in 1 Post
I got another part of some code here.. I am not getting and errors with it but the output is not what is desired. I did not write the original code and I have this posted up on his forum but if you are bored or what a challenge, I would love for this to work.

I only copied the code and added the table and rows for all user sessions. I am sure there is a better way to write it and I believe I am counteracting some of this code. The row names are the same as the original but minus the "admin" part.

PHP Code:
<?php
//------------------------------------------
# Active admins
//------------------------------------------

$get_session_entries $kernel->db->query"SELECT s.adminsession_user_id, s.adminsession_name, s.adminsession_group_id, s.adminsession_timestamp, s.adminsession_run_timestamp FROM " TABLE_PREFIX "sessions_admin s ORDER BY s.adminsession_group_id, s.adminsession_name" );

//Show all users in Control Panel
$get_session_entries $kernel->db->query"SELECT s.session_user_id, s.session_name, s.session_group_id, s.session_timestamp, s.session_run_timestamp FROM " TABLE_PREFIX "sessions s ORDER BY s.session_group_id, s.session_name" );
//----end
$kernel->vars['html']['controlpanel_sessions'] = $kernel->tp->call"admin_session_header"CALL_TO_PAGE );

while( 
$session $kernel->db->data$get_session_entries ) )
{
    if( 
$session['adminsession_group_id'] != $current_group_id AND $current_group_id )
    {
        
$kernel->vars['html']['controlpanel_sessions'] .= $kernel->tp->call"admin_session_break"CALL_TO_PAGE );
    }
//----start    
    
if( $session['session_group_id'] != $current_group_id AND $current_group_id )
    {
        
$kernel->vars['html']['controlpanel_sessions'] .= $kernel->tp->call"admin_session_break"CALL_TO_PAGE );
    }
//----end
    
$current_group_id $session['adminsession_group_id'];
//----start
    
$current_group_id $session['session_group_id'];
//----end    
    
$kernel->vars['html']['controlpanel_sessions'] .= $kernel->tp->call"admin_session_row"CALL_TO_PAGE );

    
    if( 
$session['adminsession_group_id'] == )
    {
        
$session['adminsession_group_id'] = $kernel->admin->construct_icon"user_admin.gif"$kernel->ld['lang_b_administrator'], true"center" );
    }
    else
    {
        
$session['adminsession_group_id'] = $kernel->admin->construct_icon"user_mod.gif"$kernel->ld['lang_b_moderator'], true"center" );
    }
//----start
    
if( $session['session_group_id'] > )
    {
        
$session['session_group_id'] = $kernel->admin->construct_icon"user_regular.gif"$kernel->ld['lang_b_user'], true"center" );
    }
//----end
    
    
if( $session['adminsession_user_id'] == $kernel->session->vars['adminsession_user_id'] )
    {
        
$session['adminsession_name'] = "<b>{$session['adminsession_name']}</b>";
    }
//----start
    
if( $session['session_user_id'] == $kernel->session->vars['session_user_id'] )
    {
        
$session['session_name'] = "<b>{$session['session_name']}</b>";
    }
//----end
    
    
$session['adminsession_timestamp'] = $kernel->format_secondsUNIX_TIME $session['adminsession_timestamp'] );
    
$session['adminsession_run_timestamp'] = $kernel->format_secondsUNIX_TIME $session['adminsession_run_timestamp'] );
    
$session['adminsession_timestamp'] = sprintf$kernel->ld['lang_b_time_ago'], $session['adminsession_timestamp'] );
    
$session['adminsession_name'] = $kernel->format_input$session['adminsession_name'], T_HTML );
    
$session['adminsession_run_timestamp'] = sprintf$kernel->ld['lang_b_time_ago'], $session['adminsession_run_timestamp'] );
//----start
    
$session['session_timestamp'] = $kernel->format_secondsUNIX_TIME $session['session_timestamp'] );
    
$session['session_run_timestamp'] = $kernel->format_secondsUNIX_TIME $session['session_run_timestamp'] );
    
$session['session_timestamp'] = sprintf$kernel->ld['lang_b_time_ago'], $session['session_timestamp'] );
    
$session['session_name'] = $kernel->format_input$session['session_name'], T_HTML );
    
$session['session_run_timestamp'] = sprintf$kernel->ld['lang_b_time_ago'], $session['session_run_timestamp'] );
//--end
    
    
$kernel->vars['html']['controlpanel_sessions'] = $kernel->tp->cache$session0$kernel->vars['html']['controlpanel_sessions'] );
}

$kernel->vars['html']['controlpanel_sessions'] .= $kernel->tp->call"admin_session_footer"CALL_TO_PAGE );
?>
__________________
2005 Surpassies: Winner of Most Skilled Wordsmith

SH129 - Power
SH81 - OC5
Tracer Round is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old November 15th, 2007, 10:56 PM   #13 (permalink)
MR. SECURITY
Excelling Contributor
 
Tracer Round's Avatar
 
Joined in Jun 2004
Lives in Orlando, USA
Hosted on SH129
722 posts
Gave thanks: 4
Thanked 1 Time in 1 Post
No takers.. aww
__________________
2005 Surpassies: Winner of Most Skilled Wordsmith

SH129 - Power
SH81 - OC5
Tracer Round is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old November 15th, 2007, 11:06 PM   #14 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,033 posts
Gave thanks: 48
Thanked 129 times
Now I remember why I wasn't sad to move away from PHP.

Note: I edited one of the posts to add the syntax highlighting.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old November 16th, 2007, 12:22 AM   #15 (permalink)
wgm
Registered User
Super #1
 
Joined in Mar 2005
Lives in Washougal, WA
1,302 posts
Gave thanks: 23
Thanked 39 times
Quote:
Originally Posted by Tracer Round View Post
No takers.. aww
Its over my head, sorry.
wgm is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old November 16th, 2007, 12:37 AM   #16 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,218 posts
Gave thanks: 18
Thanked 86 times
work pretty much drained all the mental capacity from my brain today.. the smart bits are currently in recovery mode.. should go to sleep but I'm resisting for some dumb reason..

MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On