Mark F Posted January 10, 2009 Share Posted January 10, 2009 Re: [mccode] Main menu users online count Thanks for a great addition. Quote Link to comment Share on other sites More sharing options...
Saha Posted January 11, 2009 Share Posted January 11, 2009 Re: [mccode] Main menu users online count +1 Peter although this isnt really a mod its more of an add on to mainmenu i will be using this Quote Link to comment Share on other sites More sharing options...
POG1 Posted January 11, 2009 Share Posted January 11, 2009 Re: main menu users online count It'll almost work Change $var = mysql_num_rows($sql); to $var = mysql_fetch_assoc($sql); And it will. Also there's no need to use sprintf on that, since you're putting the 900 in directly why assoc? If you look into the database class at the fetch_row function it will have MYSQL_ASSOC on by default.. Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted January 12, 2009 Share Posted January 12, 2009 Re: [mccode] Main menu users online count ah pog1 good question well to not just ground yourself at mc codes level programming you use actual commands making it more simple and compatible with other cms's Quote Link to comment Share on other sites More sharing options...
POG1 Posted January 12, 2009 Share Posted January 12, 2009 Re: [mccode] Main menu users online count oops i made a mistake, i thought the mccodes database class had it but i am wrong. In my database class for fetchRow is have this and as default it will have assoc selected instead of MYSQL_NUM function fetchRow($type='MYSQL_ASSOC') { return mysql_fetch_array($this->result_id,$type); } Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted January 12, 2009 Share Posted January 12, 2009 Re: [mccode] Main menu users online count interesting lol Quote Link to comment Share on other sites More sharing options...
Shivski Posted January 14, 2009 Share Posted January 14, 2009 Re: [mccode] Main menu users online count Thanks for the mod. Installed it in a couple of minutes. Works great :) Quote Link to comment Share on other sites More sharing options...
John99 Posted January 14, 2009 Share Posted January 14, 2009 Re: [mccode] Main menu users online count This mod i made from scratch, i will tell you how many poeple are onlineon the main menu. Open Main Menu Find the line: $mc=$ir['new_mail']; add under: $var2['num_users_on'] = mysql_query("SELECT userid FROM users WHERE laston >= UNIX_TIMESTAMP()-900", $c); $var['num_users_on'] = mysql_num_rows($var2['num_users_on']); and put this anywhere on the links in main menu: Users Online ({$var['num_users_on']}) This mod was made by me Peter Greenacre First Placed on modern-empires http://www.modern-empires.site40.net Yeah nice, could also be done on login page :) with a few little edits xD Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.