Twitter SMFHacks Facebook SMFHacks SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
June 18, 2013, 07:33:55 pm

Login with username, password and session length
Members
Total Members: 10807
Latest: GoldDigger1950
Stats
Total Posts: 32558
Total Topics: 5507
Online Today: 80
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 63
Total: 63
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: How do you get the software to check user information as soon as they log in?  (Read 1327 times)
shuban
Full Member
***
Offline Offline

Posts: 164


View Profile WWW
« on: June 24, 2012, 10:03:14 pm »

I created this usergroup badge which gives usergroups in #18 a badge

Code:
$badgeAction = 'dgold_group';
if (in_array(18, $user_info['groups']) && !in_array($badgeAction,$currentBadges))
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}

}

Problem is, it only sends a pm to the person when they either finish making a post or make a change to their profile.

How do I get the software to check if changes have been made as soon as the person logs into the forum? Or, as soon as they see the index of the forum.

Does it have something to do with this being placed somewhere?

Code:
// Badge Awards
global $sourcedir, $modSettings;
if (!empty($modSettings['badgeawards_enable']))
{

global $sourcedir, $user_info;
require_once($sourcedir . '/badgeawards.php');
Badges_CheckMember($memID);
}
// End Badge Awards
« Last Edit: June 24, 2012, 10:14:50 pm by shuban » Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11051


View Profile
« Reply #1 on: June 25, 2012, 11:51:27 am »

I woudld do a check code right before this line

In Sources/LogInOut.php

Code:
// Just log you back out if it's in maintenance mode and you AREN'T an admin.


Add this
Code:
// Badge Awards
global $sourcedir, $modSettings;
if (!empty($modSettings['badgeawards_enable']))
{

global $sourcedir, $user_info;
require_once($sourcedir . '/badgeawards.php');
Badges_CheckMember($user_settings['ID_MEMBER']);
}
// End Badge Awards
Logged
shuban
Full Member
***
Offline Offline

Posts: 164


View Profile WWW
« Reply #2 on: June 25, 2012, 01:03:31 pm »

Unfortunately it didn't do the trick Undecided
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11051


View Profile
« Reply #3 on: June 25, 2012, 01:09:02 pm »

Only works if they use the login system. If they are logged in they have logout then relogin.
Logged
shuban
Full Member
***
Offline Offline

Posts: 164


View Profile WWW
« Reply #4 on: June 25, 2012, 01:13:35 pm »

Only works if they use the login system. If they are logged in they have logout then relogin.

I tried that too, I had the member login and logout, but still no email or badge award given. The person still has to create a post.

Could this code be placed in the main index or something? Undecided
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11051


View Profile
« Reply #5 on: June 25, 2012, 01:16:52 pm »

Yeah you can place the code in the main index but very bad for performance you site will use more resources and will be slower. That's why I only check at certain places and not all the time
Logged
shuban
Full Member
***
Offline Offline

Posts: 164


View Profile WWW
« Reply #6 on: June 25, 2012, 01:17:54 pm »

Yeah you can place the code in the main index but very bad for performance you site will use more resources and will be slower. That's why I only check at certain places and not all the time

So why isn't the loginOut.php not working? That seemed like a good idea. Does it work for you?
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11051


View Profile
« Reply #7 on: June 25, 2012, 01:20:29 pm »

No idea should work you can try other spots in that file.
Logged
FrizzleFried
Badge Awards Member
Full Member
*****
Offline Offline

Posts: 128



View Profile
« Reply #8 on: June 25, 2012, 02:01:56 pm »

Not sure if it's related or not... but there are two different login screens... one when you click login... another that comes up when you attempt to access a private site initially.  I know this because I was able to pull the news out of the action=LOGIN screen... and when people hit LOGIN and it took them to that screen,  the news wouldn't appear... BUT when people accessed my site directly (private site)... the first login screen that comes up doesn't have an ACTION associated with it ... it's different than the login screen with "LOGIN" action associated with it... because the news would appear.

Logged
shuban
Full Member
***
Offline Offline

Posts: 164


View Profile WWW
« Reply #9 on: June 25, 2012, 02:23:10 pm »

Not sure if it's related or not... but there are two different login screens... one when you click login... another that comes up when you attempt to access a private site initially.  I know this because I was able to pull the news out of the action=LOGIN screen... and when people hit LOGIN and it took them to that screen,  the news wouldn't appear... BUT when people accessed my site directly (private site)... the first login screen that comes up doesn't have an ACTION associated with it ... it's different than the login screen with "LOGIN" action associated with it... because the news would appear.



Thanks, Frizzle. I'm still trying to figure this out.
Logged

shuban
Full Member
***
Offline Offline

Posts: 164


View Profile WWW
« Reply #10 on: June 25, 2012, 09:31:39 pm »

I get errors when I place it in the position VBgamer suggested Undecided
Logged

shuban
Full Member
***
Offline Offline

Posts: 164


View Profile WWW
« Reply #11 on: June 26, 2012, 10:22:04 pm »

I ended up putting it inside the index.php file...

How much will it affect the performance? Undecided
Logged

SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 11051


View Profile
« Reply #12 on: June 26, 2012, 10:26:57 pm »

I ended up putting it inside the index.php file...

How much will it affect the performance? Undecided
A lot....since it is called on every request.
Logged
shuban
Full Member
***
Offline Offline

Posts: 164


View Profile WWW
« Reply #13 on: June 26, 2012, 10:45:11 pm »

I ended up putting it inside the index.php file...

How much will it affect the performance? Undecided
A lot....since it is called on every request.

I noticed lol, my CPU usage went to 100% as soon as I put it in. The results were desirable, but the tardiness wasn't. Undecided
Logged

Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[Today at 05:22:14 pm]

[Today at 07:27:33 am]

[Today at 06:10:04 am]

[June 17, 2013, 12:27:50 pm]

[June 16, 2013, 08:17:21 pm]

[June 16, 2013, 07:29:04 am]

[June 15, 2013, 08:34:38 pm]

[June 14, 2013, 10:28:18 pm]

[June 13, 2013, 11:00:52 pm]

[June 12, 2013, 03:37:47 am]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 1.644 seconds with 18 queries.