Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Invitations not being renewed
Nyr
New
Hello,
I host an invite-only forum and in the dashboard invitations are set to two per regular user each month. Problem is, invitations are not being assigned each month, so users can't invite new people after they consume their initial invitations.
Is there maybe a maintenance script I should need to run with cron or something like that?
Tagged:
0
Comments
Welcome to the community!
What version of Vanilla are you running?
You shouldn't need to run anything special. Whenever a user tries to send an invite, it should reset their total invite count if needed.
Can you check the
GDN_Users
table and see if theDateSetInvitations
andCountInvitations
are being set correctly?Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Hello, @hgtonight thanks for helping.
I am running the latest stable: 2.0.18.8.
CountInvitations
is 0 for users who (I suppose) already sent their invitations, but look atDateSetInvitations
:http://cl.ly/image/3k1U033Q052l
Looks like there is something wrong there, yeah?
This looks like your server time is misconfigured (or something else).
What versions of PHP and MySql are you running? Are you running Apache?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thanks for your help, @hgtonight,
I am running lighttpd, not Apache.
Here you have the phpinfo output:
http://a.99.yt/phpinfo.php
I am not familiar with lighttpd.
To trouble shoot this, I would execute
echo Gdn_Format::Date('', 'n Y');
through the custom pages plugin or my theme hooks.It should output a date.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight
Gdn_Format::Date('', 'n Y');
printsn Y
Gdn_Format::Date('n Y');
prints2:42PM
Interesting...
What does
echo Gdn_Format::Date();
return?Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight
6:03PM
I am not really good with PHP, so I did a really dirty workaround using cron for now:
# Force giving two invites each month for each Vanilla user (dirty workaround) 20 3 1 * * mysql -u foro -pPASSWORD -Bse 'UPDATE foro.GDN_User SET CountInvitations=2 WHERE Banned=0 AND Admin=0' >/dev/null 2>&1
Yeah, it's horrible, but whatever. Thank you for the help, @hgtonight.
This is interesting, because I think you stumbled on to a bug.
Gdn_Format::Date($User->DateSetInvitations, 'n Y') != Gdn_Format::Date('', 'n Y')
will never return true; those statements will always be equal to each other. They both return'n Y'
all the time.I will file a bug and patch on GitHub.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Okay, let me know when you send the pull request, if possible
Here is the issue:
https://github.com/vanillaforums/Garden/issues/1621
Here is the diff:
https://github.com/hgtonight/Garden/commit/3a8a727255198e2b1d8a9f594eb0753fb294c496
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.