You need to Register for free and Login to post a message in the forum.

Forum

Subject: Subscriber token?
Prev Next
You are not authorized to post a reply.

Author Messages
johnr
DNN Creative Magazine Subscriber
Nuke Newbie
Nuke Newbie
Posts:3

16 Jul 2008 10:56 PM  
Is there a token that will allow me to determine if a user has the Subscriber role? Maybe something like this:  [ Membership: IsSubscriber ]  ??

I was thinking of doing something like this:

if ( user is not a subscriber ) {
   embed movie 1
} else {
   embed movie2
}

any ideas would be great.  Thanks.
 
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2357


17 Jul 2008 8:31 AM  
Do you want to do this in a Text/HTML module, a module's code, or in your skin?


Joe Craig
DNN Creative Support
Subscribe to the website
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2357


17 Jul 2008 8:33 AM  
For Text/HTML usage, look at Token Replacement in DotNetNuke for ideas and for a list of tokens.

Joe Craig
DNN Creative Support
Subscribe to the website
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2357


17 Jul 2008 8:34 AM  
Oh ... for ideas, if you want to embed the movie in a Text/HTML file, you can actually use two modules. Put the one for subscribers in one module, and put the one for non-subscribers in another module. Then set the view permissions for those modules to the correct roles.

Joe Craig
DNN Creative Support
Subscribe to the website
johnr
DNN Creative Magazine Subscriber
Nuke Newbie
Nuke Newbie
Posts:3

17 Jul 2008 11:06 AM  

I am having trouble with the two module solution because subscribers are also registered users.  So, both modules show up and thus both movies display for subscribers.  The non-premium movie should not display for subscribers.

This is why I thought I could use a bit of javascript in a txt/html module. Currently within a txt/html module I am passing some variables to my flash movie.

embed src="/Portals/0/movie.swf?var1=ch01&var2=2&var3=[User:FirstName]


I would like to be able to send the flash movie a tag that indicated if the user is a subscriber from an txt/html module.  This is where I am a bit stuck.

var4= [subscriber or not??]

jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2357


17 Jul 2008 7:57 PM  
If you can't solve the problem using the tools that are available, you can probably put together a small module that would do this.  By doing this in a module, you'll have access to security roles and could construct what you need.

Attached is a zip file that I threw together as an example, but it's based on something that actually works.  In this case, the game file changes daily and has the date encoded into it.

The file is Gameyymdd.ext, and the codebehind for this module shows how to construct the filename and get it into the right place.

You could use a similar technique to determine the user's security roles, and thereby determine which movie to show ...

If you aren't a programmer, you might want to show this to someone who is.  They should be able to create what you need from this example in a couple of hours ...

Attachment: 1717573424971.zip


Joe Craig
DNN Creative Support
Subscribe to the website
johnr
DNN Creative Magazine Subscriber
Nuke Newbie
Nuke Newbie
Posts:3

18 Jul 2008 2:57 PM  

ok... at first I was a bit intimidated by the prospect of making a module!  Geez... it is "SuperSimple" to do that.  Thank you for the files to look at... I was able to do what you suggested and here is the code:

public string title{
  
get{
            
return this.ModuleConfiguration.ModuleTitle;   }
}
public string status{
 
get {
          
return UserInfo.IsInRole("Subscribers").ToString();   }
}

I needed input from the module so I just grabbed it from the title which will be hidden anyway.  Then in the control:

<embed width="660" height="600" type="application/x-shockwave-flash" quality="1" wmode="transparent" menu="true" loop="true" play="true" scale="ShowAll"     
      src
="Portals/0/Algebra/movie.swf?var1=<%=title%>&var2=<%=status%>">
embed>


Now my movie has the title and subscriber status... I can redirect with the actionscript.  Issue is resolved... thank you very much    John

jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2357


19 Jul 2008 7:37 AM  
I'm glad that was useful.

If you "module" doesn't do any data access, the code if really simple. I tend to call these modulettes.

Joe Craig
DNN Creative Support
Subscribe to the website
You are not authorized to post a reply.



ActiveForums 3.7

Latest Forum Posts

Web.config Error by derpir
HelloI got this error, does this seem familiar to you? Can anyone say how to fix this error?Error 98...
No Access for me too by ristori
I suscribe for the magazine novembre 2008 13. I receive this ticket from Paypal : Prix de l...
How can I list our offices by country by bluehoops
Hi everyone!Apologies if this is a simple question, but it is driving me nuts.I run a small ISV and ...
RE: DNN Creative vs FireFoX V3 by DavidWSnow
It now looks like the error'ing extension is StumbleUpon and it effects FireFox on some, but not all...
Issue 39 Authentication by DavidWSnow
I was glad to see you address this topic. When LiveId was first added to DNN, I tried to implement i...
RE: (catalook) Itempane changes on product pages ?? by Vilaplana
Hi, I think the problem is been caused by your skin and not by Catalook itself.  In the main page, C...
Yahoo Answers by cdtguru
Hey, i was wondering if anyone knew of a module that would create a similar system to Yahoo Answers...
(catalook) Itempane changes on product pages ?? by Gaz35
Hi , hi , I don’t know if you can help me , here is the site in question http...
RE: Virtual Pc 2007 help by jeff@zina.com
You need to get the Virtual PC's network set up.  Might check the Virtual PC news group: http://www...
DNNCreative Just Keeps Getting Better by jeff@zina.com
Kudos on issue 39, the article on importing large quantities of data was both timely for me and spot...
RE: Videos by clippy
Hello from France My question is about the videos for beginners, and specially n° 3; I'm working...
skinning trouble by derpir
HelloI have uploaded a skin to my DNN-website, but I want to make som changes. I have made some chan...
RE: Column width in UDT by VickySwift
In case anyone else is looking for the answer to this, I have been able to add the headers back in b...
RE: search not working by jncraig
Did you either reindex the site to turn on the scheduled task to do it?
RE: Template Issue by jncraig
No, you need to install your custom modules before you use the template.
RE: error message in registration page by jncraig
I'm not sure that you can avoid them, short of rewriting the module.You might want to investigate Dy...
Template Issue by Bobbyjosephg
Hi,   Today I have come up with a problem with templates.I was successful in exporting a template an...
RE: search not working by sanju_k1421
I checked     host==>admin search  page   that is set both limits min //max  page     still i m n...
RE: error message in registration page by coder247
but how do I avoid the error messages provided by default in dnn?
RE: Style sheet does nothing by andorz
Oh. I was told to do that in my thread at the dotnetnuke.com forum. http://www.dotnetnuke.com/Commun...
AppTheory
RSS Feeds