vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Interrupt Unsubscribed (or other) Users (https://vborg.vbsupport.ru/showthread.php?t=72778)

amykhar 12-10-2004 10:00 PM

Interrupt Unsubscribed (or other) Users
 
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/showthrea...t=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.

kall 12-12-2004 03:43 AM

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).

Brad 12-12-2004 03:45 AM

Nice work Amy! :D

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

Quote:

Originally Posted by kall
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

Quote:

Originally Posted by mcyates
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/showthrea...t=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!!!

Code:

// ###################### 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

Quote:

Originally Posted by mcyates
what exactly do i replace???? Not the clearest of instructions for a retard!!!

Code:

// ###################### 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

Quote:

Originally Posted by amykhar
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

Quote:

Originally Posted by mcyates
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

Quote:

Originally Posted by amykhar
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:

Code:

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

Quote:

Originally Posted by mcyates
I get this error when i put the "fixed" global.php on my server:

Code:

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

Quote:

Originally Posted by amykhar
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


All times are GMT. The time now is 10:16 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01761 seconds
  • Memory Usage 1,762KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete