NationStates Jolt Archive


Question about the code

Bugaboo2
14-06-2004, 08:57
I have a website that requires people to login, like nationstates does. I'd love to have them autologin to a phpbb forum as well, also like nationstates does. Does anyone know where I can find code to do this? I assume it's done with php and not perl, right? Is it a phpbb Mod?
[violet]
14-06-2004, 14:18
The NationStates game code simply sets a cookie that simulates the phpBB autologin. It's done in Perl but could be easily (more easily, actually) done in PHP.

In Perl the relevent bit of code looks like this:

[code:1:c534d94760]
# Simulate PHP's "serialize()" function.
$cookiestring = 'a:2:{s:11:"autologinid";s:' .
length($forum_password) . ':"' .
$forum_password .
'";s:6:"userid";i:' .
$forum_id .
';}';
[/code:1:c534d94760]