View Full Version : Interrupt Unsubscribed (or other) Users
amykhar
12-10-2004, 10:00 PM
This hack is designed to insert a sales pitch to non-paying members every 10 pages that they view.
It requires that the is_member_of improvement hack be installed IF you plan to check for more than one usergroup. That hack can be found here:
https://vborg.vbsupport.ru/showthread.php?t=61149&highlight=is_member_of
It can be customized to interrupt users of any group you choose with any message you choose before allowing them to click a link and continue on.
Note that this hack is in beta. It seems to be running ok, but may have a bug or two. Install at your own risk. Please only install this if you understand how to run queries and modify php code and help fix any bugs that may arise.
No screen shot is included because the look of the interruption page depends entirely on your needs.
Oooh! Nice! Thank you for sharing!
In theory, this concept could be used to display an ad on a page every 'x' pageviews instead, yes?
(Instead of having adsense code on every showthread page, only have it on every 10 pages...that kind of thing).
Mephisteus
12-12-2004, 09:58 AM
I might have a use for this :) Nice work :)
sabret00the
12-12-2004, 10:53 AM
nice work :)
amykhar
12-12-2004, 01:27 PM
Oooh! Nice! Thank you for sharing!
In theory, this concept could be used to display an ad on a page every 'x' pageviews instead, yes?
(Instead of having adsense code on every showthread page, only have it on every 10 pages...that kind of thing).
Exactly. You control what usergroups see the intermittant page, how often it's displayed and what is on the page. There's a bunch of different uses for it.
mcyates
12-12-2004, 03:07 PM
its showing up for everyone. I have the following usergorups who shoul'd see the ads:
// Redirect unsubscribed users every 10 pages, starting at page 1
if (!is_member_of($bbuserinfo,2,5,6,7))
amykhar
12-12-2004, 03:55 PM
its showing up for everyone. I have the following usergorups who shoul'd see the ads:
// Redirect unsubscribed users every 10 pages, starting at page 1
if (!is_member_of($bbuserinfo,2,5,6,7))
Do you have the is_member_of improvement hack properly installed?
mcyates
12-12-2004, 04:10 PM
is_member_of improvement hack!!!!!
What's this? I don't have the "is_member_of improvement hack" installed?
mcyates
12-12-2004, 04:11 PM
It requires that the is_member_of improvement hack be installed IF you plan to check for more than one usergroup. That hack can be found here:
https://vborg.vbsupport.ru/showthread.php?t=61149&highlight=is_member_of
Ohhh, tell me in the txt file. didn't read it all. Would be better if you put that in the description of the hack In bold red!!! I'll install it now.
Thanks
mcyates
12-12-2004, 04:20 PM
what exactly do i replace???? Not the clearest of instructions for a retard!!!
// ###################### Start is member of #######################
// returns true/false if a $userinfo belongs to $usergroupid
// $userinfo must contain (userid, usergroupid, membergroupids)
function is_member_of($userinfo, $usergroupid)
{
static $user_memberships;
if ($userinfo['usergroupid'] == $usergroupid)
{
// user's primary usergroup is $usergroupid - return true
return true;
}
else if (!is_array($user_memberships["$userinfo[userid]"]))
{
// fetch membergroup ids
$user_memberships["$userinfo[userid]"] = fetch_membergroupids_array($userinfo);
}
// return true/false depending on membergroup ids
return in_array($usergroupid, $user_memberships["$userinfo[userid]"]);
}
amykhar
12-12-2004, 04:22 PM
what exactly do i replace???? Not the clearest of instructions for a retard!!!
// ###################### Start is member of #######################
// returns true/false if a $userinfo belongs to $usergroupid
// $userinfo must contain (userid, usergroupid, membergroupids)
function is_member_of($userinfo, $usergroupid)
{
static $user_memberships;
if ($userinfo['usergroupid'] == $usergroupid)
{
// user's primary usergroup is $usergroupid - return true
return true;
}
else if (!is_array($user_memberships["$userinfo[userid]"]))
{
// fetch membergroup ids
$user_memberships["$userinfo[userid]"] = fetch_membergroupids_array($userinfo);
}
// return true/false depending on membergroup ids
return in_array($usergroupid, $user_memberships["$userinfo[userid]"]);
}
You'll need to request support for that hack in its thread. But, you are meant to replace the entire function.
But, if you are new to hacking, you shouldn't be installing hacks from the beta forum.
mcyates
12-12-2004, 05:01 PM
You'll need to request support for that hack in its thread. But, you are meant to replace the entire function.
But, if you are new to hacking, you shouldn't be installing hacks from the beta forum.
I've been installing the hacks for about 1 1/2 now. Its still showing i've replaced it all. The previous hack wasn't that well explained for me. But its still showing. Would you mind looking at my files?
global.php
functions.php
sessions.php
amykhar
12-12-2004, 05:04 PM
I've been installing the hacks for about 1 1/2 now. Its still showing i've replaced it all. The previous hack wasn't that well explained for me. But its still showing. Would you mind looking at my files?
global.php
functions.php
sessions.php
send them to me via pm or email. Don't attach them here.
But, you really really shouldn't even be in the beta forum if you are at this level of hacking.
mcyates
12-12-2004, 05:05 PM
send them to me via pm or email. Don't attach them here.
But, you really really shouldn't even be in the beta forum if you are at this level of hacking.
Sorry, i'll send them over.
mcyates
12-12-2004, 05:25 PM
I get this error when i put the "fixed" global.php on my server:
Parse error: parse error, unexpected T_LOGICAL_AND in /usr/home/yates238/public_html/global.php on line 638
As thid is not suppored should i just leave it untill you release it fully?
amykhar
12-12-2004, 05:29 PM
I get this error when i put the "fixed" global.php on my server:
Parse error: parse error, unexpected T_LOGICAL_AND in /usr/home/yates238/public_html/global.php on line 638
As thid is not suppored should i just leave it untill you release it fully?
It's supported, just not to the level you need. So, yes, you should wait until it's out of beta.
mcyates
12-12-2004, 05:31 PM
It's supported, just not to the level you need. So, yes, you should wait until it's out of beta.
ok thanks anyway for the help and time you've given me. Cheers
mcyates
12-12-2004, 05:40 PM
actually its working. I put my old global.php file back and its working. Shows up for the guests and thats it. Great "beta" hack.
Thanks yet again
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.