Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

How can i get secret crush to work with phpbb2?

TehBin
Minted
Posted on Feb 24, '07 at 02:09 am

I would liek it to track by username and IP instead of just the php session ID which isn’t really descriptive as to who it is. Can there be something implemented to better track phpbb2 users?

Shaun Inman
Mint/Pepper Developer
Posted on Feb 24, '07 at 08:44 am

You should check with the phpbb2 documentation or developers for a cookie name that identifies visitors better (there may not be one). Then add that cookie name to the “Additional Custom Cookies” field in the Secret Crush Preferences.

TehBin
Minted
Posted on Feb 24, '07 at 02:32 pm

Shaun, when i add the cookie name it just gives me the php session ID number :( This number is different everytime they login. Is there anything else that can be done?

Shaun Inman
Mint/Pepper Developer
Posted on Feb 25, '07 at 08:56 am

You’re likely getting a session id because that is what’s contained in the cookie you are providing to Secret Crush. You need to find a cookie that contains an identifiable name.

TehBin
Minted
Posted on Mar 01, '07 at 07:54 pm

what cookie name would you suggest? :(

look through your list of cookies that your site outputs, there is probably one called “user_id” or something like that

Shaun Inman
Mint/Pepper Developer
Posted on Mar 02, '07 at 10:43 am

Like I said in my original response:

…check with the phpbb2 documentation or developers for a cookie name that identifies visitors better (there may not be one)…

TehBin
Minted
Posted on Mar 12, '07 at 08:24 am

the only cookies are “sitename_data”, “sitename_sid”, “sitename_t”. “sitename_data” contains a long string of numbers, letters, and percent signs split up by SID and userID. “sitename_sid” gives a number that I believe is just the session ID. It seems the best I can do is relay a number. I guess I’ll just have to suck it up and realize they aren’t very compatible with each other.

Daniel
Minted
Posted on Mar 12, '07 at 12:56 pm

You could set a cookie with the information you’d like to have on your own - phpbb doesn’t include any personal data in the cookies.

I’m sure you can add another cookie including the login-name or the email-address by adding some php.

TehBin
Minted
Posted on Mar 12, '07 at 08:57 pm

If I only knew how to do that and then add that into phpbb code :( I must be one of the only people who bought mint solely to track phpbb2.

Shaun Inman
Mint/Pepper Developer
Posted on Mar 15, '07 at 02:50 pm

TehBin, I’ll try to make some time to look into this. It will probably require modifying phpBB or developing a plugin for it (if phpBB has support for something like that).

TehBin
Minted
Posted on Apr 19, '07 at 04:36 am

thank you Shaun….maybe phpBB3 will allow mint to work better with it? Hopefully phpBB3 will come out of beta soon (rumor has it that it will)

Shaun Inman
Mint/Pepper Developer
Posted on Apr 19, '07 at 09:23 am

Shoot, I did some research the day after my previous post in this topic but I must have gotten distracted and forgot to post it. Here it is—better late than never.

Secret Crush and PunBB

Add the following after line 34 in header.php:

// set for Secret Crush
setcookie('punbb_username', pun_htmlspecialchars($pun_user['username']), time() + 365 * 24 * 60 * 60, '/', $cookie_domain, false);

Then add ‘punbb_username’ to the Custom Cookies input in your Secret Crush Preferences

Secret Crush and phpBB 2

Add the following to the bottom of includes/page_header.php

// set for Secret Crush
setcookie('phpbb_username', $userdata['username'], time() + 365 * 24 * 60 * 60, '/', $cookiedomain, false);

Then add ‘phpbb_username’ to the Custom Cookies input in your Secret Crush Preferences

TehBin
Minted
Posted on May 22, '07 at 12:20 pm

darn it. I just saw your post now after upgrading to phpBB3. I will try this secret crush method once i figure out how to get phpBB3 to work with mint. Thanks shaun.

P.S. any chance you will post phpBB3 instructions on getting mint to work with it?

TehBin
Minted
Posted on May 30, '07 at 12:27 am

To get this to work in phpBB3 you need to put that bit of code shaun posted anywhere inside the page_header(); function in the /includes/functions.php (line ~ 3826)

It works great for me! Thanks again shaun.

mgoi
Minted
Posted on Sep 25, '07 at 10:44 am

I have tried the method suggested by Shaun, and it works! Thanks very much, this is much appreciated, I will be reporting about it on the phpbb forums.

I first tried it with Secret Crush, and I had some mixed results. Secret Crush would track only a few users, most others appearing as “Anonymous” (which is also the username phpbb assigns to you before you log in). I then tried it with Nametag, and it works perfectly.

There must be some differences in the way Nametag and Secret Crush deal with the cookie, [as already discussed in this thread] (http://www.haveamint.com/forum/trouble … #post_4249). If anyone has a suggestion on how to improve the way the cookie is handled by Secret Crush, that would be much appreciated. In my testing Nametag slows down pageloads more than using Secret Crush.

Thanks!

mgoi
Minted
Posted on Sep 27, '07 at 11:10 pm

Just an update to my last post. I have set the cookie as suggested by Shaun above. On phpbb 2.* the ‘username’ on which the cookie relies is assigned after login. At that stage the cookie reports the proper username. But after logout the username is switched back to “Anonymous”, and so is the cookie.

I have secret crush reporting most users as Anonymous, and only a very few correctly. I guess the ‘anonymous’ are those who do not remain logged in in after leaving the forum. Strangely enough Nametag gets it right.

I guess the trick would be to assign the cookie on login only. Let me see what I can come up with now..

nargz
Minted
Posted on Jul 18, '08 at 10:39 pm

I’m wondering how feasible/reasonable a suggestion this is at this point in time.

Since development for Nametags seems to have stopped (last build was early 2007) - would be reasonable if Shaun could ask permission to take the mantle of some of nametags useful features (like the ability to manually name the tags left on people).

I’m not sure on how secret crushes does it but from what I gather nametags sets a special cookie on a user if it’s not present but take the info from it if it is. Tagging it manually would have the visitor register even if they have a diff IP. It’s a hit or miss in my case, but it does seem to work more than it doesn’t.

In any case, since Crushes is officially supported (hence like Shaun’s point would be more actively developed) I was thinking if Shaun could just ask the permission of uFx to use some of the concepts and imporve secret crushes with it - because from the other threads the reason I see why shaun isn’t implementing it like nametags is partly because people tend to call “foul.” for replicating an already existing pepper.

//

I guess the short version is that both work great, but one has something the other doesn’t… which would be fine to use if both developers were still active… as it is only Shaun is, and it would be practical to just consolidate both into one CURRENT and supported pepper that does everything the users need.

I think it’s a reasonable suggestion… what do you think Shaun?

mgoi
Minted
Posted on Aug 27, '08 at 05:44 am

I would also support the addition of nametags and favorites to secret crush.

Back to my original issues regarding the handling of anonymous users by phpbb2, there is a solution for phpBB3 here: phpbb.com/community/viewtopic.php?f=71&t=716525

M

You must be logged in to reply. Login above or create an account