Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Unactivated Users

Asked Modified Viewed 2,345 times
P
ponas
P
ponas 10
SUPERADMIN & CREATOR:
www.lhslbandy.com
  • Member, joined since
  • Contributed 59 posts on the community forums.
  • Started 21 threads in the forums
  • Started this discussions
asked
Member

I want a panel in my site showing if there's any unactivated users in my site.
I've allready got this panel showing how many visitors there are on my site pluss inlogged members (look further down) and It would be super if someone could include the unactivatet user-thing into it. On the top of it all i want the new addition only to show when I log in as an superadministrator.

if ($settings['maintenance'] != "1") {
$cond = ($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'");
$result = dbquery("SELECT * FROM ".DB_ONLINE." WHERE online_user=".$cond."");
if (dbrows($result) != 0) {
$result = dbquery("UPDATE ".DB_ONLINE." SET online_lastactive='".time()."' WHERE online_user=".$cond."");
} else {
$name = ($userdata['user_level'] != 0 ? $userdata['user_id'] : "0");
$result = dbquery("INSERT INTO ".DB_ONLINE." (online_user, online_ip, online_lastactive) VALUES ('$name', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_lastactive<".(time()-180)."");
openside("Online");
$result = dbquery(
"SELECT ton.*, tu.user_id,user_name FROM ".DB_ONLINE." ton
LEFT JOIN ".DB_USERS." tu ON ton.online_user=tu.user_id"
);
$guests = 0; $members = array();
while ($data = dbarray($result)) {
if ($data['online_user'] == "0") {
$guests++;
} else {
array_push($members, array($data['user_id'], $data['user_name']));
}
}
//Påloggede Medlemmer (tell antall i online tabellen som IKKE er gjester, dvs. IKKE 0 )
echo "".THEME_BULLET." Medlemmer: ".number_format(dbcount("(online_ip)", DB_ONLINE, "online_user!='0'"))."<br />\n";
// Viser antall i online tabellen minus de som er logget inn = gjester:
echo "".THEME_BULLET." Gjester: ".$guests."<br />\n";
closeside();
}
Edited by ponas on 03-07-2008 21:32,
0 replies

3 posts

P
ponas
P
ponas 10
SUPERADMIN & CREATOR:
www.lhslbandy.com
  • Member, joined since
  • Contributed 59 posts on the community forums.
  • Started 21 threads in the forums
  • Started this discussions
answered
Member

BUMP ><
0 replies
F
fanggaming
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

This should work, You will need to change the language etc and I have put a bit in to include both unactivated types depending on how you run your registration.
I didnt look into your code above at all other than to add the first securirty check.

<?php
if (!defined("IN_FUSION")) { die("Access Denied"); }
if ($settings['maintenance'] != "1") {
$cond = ($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'");
$result = dbquery("SELECT * FROM ".DB_ONLINE." WHERE online_user=".$cond."");
if (dbrows($result) != 0) {
$result = dbquery("UPDATE ".DB_ONLINE." SET online_lastactive='".time()."' WHERE online_user=".$cond."");
} else {
$name = ($userdata['user_level'] != 0 ? $userdata['user_id'] : "0");
$result = dbquery("INSERT INTO ".DB_ONLINE." (online_user, online_ip, online_lastactive) VALUES ('$name', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_lastactive<".(time()-180)."");
openside("Online");
$result = dbquery(
"SELECT ton.*, tu.user_id,user_name FROM ".DB_ONLINE." ton
LEFT JOIN ".DB_USERS." tu ON ton.online_user=tu.user_id"
);
$guests = 0; $members = array();
while ($data = dbarray($result)) {
if ($data['online_user'] == "0") {
$guests++;
} else {
array_push($members, array($data['user_id'], $data['user_name']));
}
}
if (iSUPERADMIN) {
if ($settings['admin_activation']) {
echo "".THEME_BULLET." <a href='../administration/members.php".$aidlink."&sortby=all&status=2'>Unactivated Users (Admin): ".dbcount("(user_status)", DB_USERS, "user_status='2'")."</a><br />\n";
}
if ($settings['email_verification']) {
echo "".THEME_BULLET." Unactivated Users (Email): ".dbcount("(user_code)", DB_NEW_USERS, "user_code!=''")."<br />\n";
}
}
//Påloggede Medlemmer (tell antall i online tabellen som IKKE er gjester, dvs. IKKE 0 )
echo "".THEME_BULLET." Medlemmer: ".number_format(dbcount("(online_ip)", DB_ONLINE, "online_user!='0'"))."<br />\n";
// Viser antall i online tabellen minus de som er logget inn = gjester:
echo "".THEME_BULLET." Gjester: ".$guests."<br />\n";
closeside();
}
?>
0 replies
F
fetloser
F
  • Senior Member, joined since
  • Contributed 275 posts on the community forums.
  • Started 2 threads in the forums
answered
Senior Member

kjempebra :D
0 replies

Category Forum

User Administration - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 3 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

F
F
  • Senior Member, joined since
  • Contributed 275 posts on the community forums.
  • Started 2 threads in the forums
F
F
  • Junior Member, joined since
  • Contributed 43 posts on the community forums.
  • Started 3 threads in the forums
P
P
ponas 10
SUPERADMIN & CREATOR:
www.lhslbandy.com
  • Member, joined since
  • Contributed 59 posts on the community forums.
  • Started 21 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet