Eve For Enterprise    Eve Support Community    Forums  Hop To Forum Categories  OpenTopic  Hop To Forums  OpenTopic Assistance    Advertising to only a specific security group?
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Groupee Member
Picture of Roberto
Posted
Someone recently told me that there was a way of delivering banner (or popup) adverts per security group (eg. deliever them to free members but not to our paying GOLD members), but I can't find anything about it. Was he correct? (unfortunately he didn't tell me where he saw it frown ) Does anyone have a hack for how to do this?

In particular, is there a way for me to deliver one pop-up per session to non-registered viewers?

-James Corbett.
 
Posts: 384 | Location: England | Registered: November 16, 2000Reply With QuoteEdit or Delete MessageReport This Post
Groupee VIP
Posted Hide Post
Hello James

Security group info is set as part of the user preferences at login. This was used in the beta boards you tested to show a banner *only* to people who didn't belong to a specific security group. This would do what I think you want. I'll email you that link privately.

How is your javascript hacking ?? To make it work you need to figure out the id number of your gold security group. Subsititute it into the javascript code. Also edit the banner URLs to fit. Test like crazy before you unleash it on your users!!

Making a banner appear *once* per session involves setting a session cookie to flag a user as having seen the advert. You would need need to develop a little js code to detect it and render the banner accordingly.

The first task above is cut * paste once you have your security group id info. The latter is a little more advanced.

Let us know how it turns out.

Michael Farris
OpenTopic/UBB.x Product Manager
 
Posts: 3604 | Registered: February 23, 2000Reply With QuoteEdit or Delete MessageReport This Post
Groupee Member
Picture of Roberto
Posted Hide Post
Yes, that's exactly what I want Michael - thanks! cool

Please post or email the javascript code I require. I'm not a great programmer but don't have a problem with a small bit of tweaking smile

-James Corbett.
 
Posts: 384 | Location: England | Registered: November 16, 2000Reply With QuoteEdit or Delete MessageReport This Post
Groupee Member
Picture of Roberto
Posted Hide Post
Ok I've seen what I think is the javascript being used for this trick and it appears to be checking the ID of the security group. Soooo.... how do I determine the IDs of my security groups?

-James Corbett.
 
Posts: 384 | Location: England | Registered: November 16, 2000Reply With QuoteEdit or Delete MessageReport This Post

Posted Hide Post
Hi James,

You can get the security group id on the security group settings page. Look in the URL and you'll see a parameter &g=XXX where XXX is the security group id.

Regards,

Brian Lenz
Infopop Corporation
 
Posts: 2176 | Location: Seattle, WA | Registered: June 15, 2000Reply With QuoteEdit or Delete MessageReport This Post
Groupee VIP
Posted Hide Post
Hello James

Here's code -- without warranty smile

Add this to the After Body Tag area of your style.


<script language="JavaScript">

// copy the HTML code you want inserted between the single quotes below
insert_this_code = '< your code here >';


// choose true or false to show=true or hide=false the code to certain security groups
show_code_to_security_groups = false;


//You MUST find the security group ID number: the &g=NNNNNNN of your URL while viewing a Security Group in the CP
// Multiple group ids are separated by commas 'NNNNN,MMMMM,WWWWW'. No spaces.

security_grp_id_list = 'NNNNN';

/// Change nothing below this line

security_group_match = false;
security_grp_id_array = security_grp_id_list.split(",");
for (i=0;i<security_grp_id_array.length;i++){
if (document. cookie.indexOf(security_grp_id_array[i]) != -1) {
security_group_match = true;
break;
}
}

if ((security_group_match == true)&&(show_code_to_security_groups==true)) {
document.write(insert_this_code);
} else if ((show_code_to_security_groups == false) && (security_group_match == false)) {
document.write(insert_this_code);
}

</script>


This is a little different from the code on the beta site. You can use multiple security groups in a list and you can specify that the code *appears* to certain groups -- or that it is *hidden* from certain security groups.

PS -- you have to close up the space in document. cookie above to make the script work. OpenTopic block that pharse for security reasons.

Attached is the code in a txt file.

[This message was edited by Michael Farris on May 30, 2002 at 03:22 PM.]

Word Docsecurity.doc (20 Kb, 22 downloads) example
 
Posts: 3604 | Registered: February 23, 2000Reply With QuoteEdit or Delete MessageReport This Post
Groupee VIP
Picture of Brett Harris
Posted Hide Post
eek***Gapes slack-jawed in awe at Michael Farris' JavaScript Guru status*** eek
 
Posts: 3136 | Location: WA | Registered: August 08, 2000Reply With QuoteEdit or Delete MessageReport This Post
Groupee Member
Picture of Roberto
Posted Hide Post
Michael, I just couldn't get the code to work on my site. I created a new (clean) forum style with just the code you supplied (changed as necessary) and applied it to an existing forum. Yes I closed the space you specified too.

My IE 5.5 was displaying "Done, but with errors on page" in the status bar, so I suppose therein lies the source of the problem?

I realise there are more important things for you to worry about than supporting 'no-guarantee' hacks so there's no rush with replying..... I'll keep messing around with it.

-James Corbett.
 
Posts: 384 | Location: England | Registered: November 16, 2000Reply With QuoteEdit or Delete MessageReport This Post
Groupee VIP
Posted Hide Post
Hello Roberto

First my apology for not seeing your response. It got so far down the 'what's new' list I didn't see it.

My guess is that you've copied and pasted the code and left in the line breaks in the comment tags

Something like this

// a comment tag line
is here

will break things everytime

it has to be like this

// a comment tag line is here

The other common error is losing the two single quotes ' that mark the beginning and end of a value. Another is to use a ' in your HTML code. Don't use them at all or make sure to 'escape' them with a backslash: \' whenever they appear inside your HTML code.

Michael Farris
OpenTopic/UBB.x Product Manager
 
Posts: 3604 | Registered: February 23, 2000Reply With QuoteEdit or Delete MessageReport This Post
Groupee Newbie
Posted Hide Post
Hi,
The javascript might not be working because there appears to be a spurious space character inserted between 'document' and 'cookie'. That is, the code
 if (document. cookie.indexOf(security_grp_id_array[i]) != -1) 

should probably be
 if (***************.indexOf(security_grp_id_array[i]) != -1) 


Hope this helps.
 
Posts: 2 | Location: USA | Registered: August 05, 2002Reply With QuoteEdit or Delete MessageReport This Post
Groupee Newbie
Posted Hide Post
Oh dear. I've managed to miss reading the PS on Michael Farris's post, where he explains why the space is there (heh, what happens when you don't take it out is illustrated handily by my previous message).

Apologies for the 'spam' (I'd just edit the previous post, but I can't figure out how to do that on this bulletin board).
 
Posts: 2 | Location: USA | Registered: August 05, 2002Reply With QuoteEdit or Delete MessageReport This Post
Groupee VIP
Posted Hide Post
here's one. (I'm not good at scripting so I haven't taken a good look at the code)

is that code able to be setup for multiple security groups at once?

would it be so simple as doing some of the code twice in the page?
 
Posts: 1001 | Location: Liberty/Joplin, MO | Registered: October 24, 2001Reply With QuoteEdit or Delete MessageReport This Post

Posted Hide Post
Hi flyingember,

You definitely could follow the same logic for multiple security groups. Instead of checking for one single group ID, you'd simply check for multiple group IDs. It would just be a slight modification. So, the answer to your question is: YES! smile

Regards,

Brian Lenz
Infopop Corporation
 
Posts: 2176 | Location: Seattle, WA | Registered: June 15, 2000Reply With QuoteEdit or Delete MessageReport This Post

Picture of Graeme
Posted Hide Post
As I read MF's code above, it appears it already supports that feature - just separate the group ids with commas (so the comment says).

Graeme

Moderator: UBB.classic Assistance Forum

NOTE: Any email requests for support will be ignored.

"The ships hung in the sky in much the same way that bricks don't." --Douglas Adams
 
Posts: 11020 | Location: Seattle, WA | Registered: October 11, 2001Reply With QuoteEdit or Delete MessageReport This Post
Groupee Newbie
Posted Hide Post
I implemented the suggested javascript for hiding categories from certain security groups, and it worked fine on ubb.x. Unfortunately this functionality has been broken by the upgrade to Eve.

Does anyone have any idea how to fix this?

<script language="JavaScript">

function isInGroup(idlist)
{
security_group_match = false;
security_grp_id_array = idlist.split(",");
for (i = 0; i < security_grp_id_array.length; i++){
if (document.cookie.indexOf(security_grp_id_array[i]) != -1) {
security_group_match = true;
break;
}
}
return security_group_match;
}

function hideElement(elemid)
{
var elem = document.getElementById(elemid);
if (elem != null) elem.style.display = 'none';
}

// Set Steering Committee section visibility
if ( !isInGroup('4146002961,2036092271') ) {
hideElement('gs_desc_forum_list_1346002961');
hideElement('gs_frm_id_1346002961');
}

// Set Working Groups section visibility
if ( !isInGroup('4146002961,2036092271,5126008371') ) {
hideElement('gs_desc_forum_list_5716008371');
hideElement('gs_frm_id_5716008371');
}

</script>

Thanks,

Andrew
 
Posts: 1 | Location: New York, NY, USA | Registered: January 30, 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

Eve For Enterprise    Eve Support Community    Forums  Hop To Forum Categories  OpenTopic  Hop To Forums  OpenTopic Assistance    Advertising to only a specific security group?