MyBB Central

Full Version: I never show in the Stats
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm sure this has to do with either cookies or something but I'll be damned if I can figure this out.

Of the three Mybb boards I am running one of them never shows me as having visited once I log out.

All three boards are on the same host/server, all their own domain.

I know that if two people on different computers in the same house with the same IP address post on the same board, only one of us will show up, right?

But on my hockey forum, we NEVER show up as having visited once logged out.

Also, your adverts in the side boxes - guests see that but logged in do not - Is that set up with the Ad Manager plugin? How'd you do that?

I would love to have side boxes show up for guests only and some for private/logged in only.
Are you talking about the online24 plugin? If you log out your session is destroyed and the plugin won't see you.

Quote:Also, your adverts in the side boxes - guests see that but logged in do not - Is that set up with the Ad Manager plugin? How'd you do that?

Small modification to the my_side_boxes.php file.

After:

$lang->load("portal");

Add:

Code:
if($mybb->user['usergroup'] != '8')
{
$sideadbox ="<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" class=\"tborder\">
<tr>
<td class=\"thead\"><strong>Great Deals and Offers</strong></td>
</tr>
<tr>
<td class=\"trow1\" align=\"center\">
<a href=\"http://www.servage.net/?coupon=wmf-biz\"><img src=\"http://www.webmasterforums.biz/banners/servage_1.gif\" alt=\"Servage Hosting\" border=\"0\" /></a>
<br /><br />
<a href=\"http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=labrocca-wmf\" target=\"_blank\"><img src=\"http://www.hostgator.com/affiliates/banners/160x60t.gif\" alt=\"Host Gator\" /></a>
<br /><br />
<a href=\"http://thinkhost.com/options/?p=496ab9798c6b1&amp;b=0b151ec3\"><img src=\"http://www.affiliates.thinkhost.com/apn/banners/125x125-thinkhost-a.gif\" alt=\"Thinkhost\" /></a><img style=\"border:0\" src=\"http://www.affiliates.thinkhost.net/apn/scripts/imp.php?p=496ab9798c6b1&amp;b=0b151ec3\" width=\"1\" height=\"1\" alt=\"\" />
<br />
</td>
</tr>
</table><br />";
}

It's actually only removed for subscribers.
Yes i'm talking about the online 24 stats. My other sites show who's visited that day. Same for me. But it never shows that I've even visited my own site on the hockey forum.

Thanks for the plugin mod - I'm still not quite understanding that - can you clarify:

The links i see in the code > are those the adverts I'm seeing on this board and they should be replaced with my advert links or whatever else I want in there?

Can I add as many separate 'boxes' with whatever content I want?
OK I think I got this code thing figured out. Question -

Can this be reversed so that only certain members CAN see it? I would need up to 4 separate groups to be able to view this particular 'box' once what I'm doing is sorted and ready to set up.
if($mybb->user['usergroup'] != '8')

Change to:

$canviewads = array("1","2","3");
if(in_array($canviewads, $mybb->user['usergroup']))

Try that...change 1,2,3 to the group ids you want to see the ads. Add as you see fit. Hopefully that will help you.
[Image: heart.gif] [Image: kiss.gif]
Thank you Jesse!
Keep this up and I'm going to fall in love with you!
OK something is missing - I'm getting an error on testing this on my test board.

Here's the error that shows at the top of the page when I activate the plugin after the code changes you gave me:

Code:
Warning [2] in_array(): Wrong datatype for second argument -Line: 118 - File: inc/plugins/my_side_boxes.php PHP 5.2.3 (Linux)

File                                          Line                    Function

[PHP]                                                               errorHandler->error
/inc/plugins/my_side_boxes.php                118                   in_array
[PHP]                                                             mysideboxes_index
/inc/class_plugins.php                        101              call_user_func_array
/index.php                                    347                 pluginSystem->run_hooks

Here is the code changes as you gave them to me in the plugin. I took out your ads and just put place holder text. I tried it with your ads (original code given) and the one shown - both with the same results.

Code:
$lang->load("portal");

$canviewads = array("1","2","3");
if (in_array($canviewads, $mybb->user['usergroup']))
{
$sideadbox ="<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" class=\"tborder\">
<tr>
<td class=\"thead\"><strong>TITLE HERE</strong></td>
</tr>
<tr>
<td class=\"trow1\" align=\"center\">
CONTENT HERE
<br />
</td>
</tr>
</table><br />";
}

Apparently something is missing in the index to make it work? I dunno I'm lost with this stuff. I thought it might be conflicting with the tweak you gave me yesterday but I disabled that and found it's the same error.
Shouldn't:

PHP Code:
in_array($canviewads$mybb->user['usergroup']) 

be:

PHP Code:
in_array($mybb->user['usergroup'], $canviewads

??

Thought it was meant to be in the order:

PHP Code:
in_array($needle$haystack
Oh I've no clue! That's why I asked for help!

The side box isn't even showing up when activated either. Sad

I tried this several ways too - the original guests see side box ads only and the new way for using the box for member view only.
Hey Matt,
I just switched that bit of code like you had it and it only gave me a blank white page. I reverted it back and it's all good - with those errors but all good.

I have this on my test board, if you want to see it, let me know and I'll pm you the addy. I don't want to make public that address. I did it once and had people joining. Yeah, I know, disable registrations but I am keeping the board with default settings for a reason.
in_array($mybb->user['usergroup'], $canviewads)

Yeah that's correct (needle,haystack).

I am not sure why it's not working for you but it should.

Post your edits please. Make sure you don't have 0 in the array.
Pages: 1 2