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:2371


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:2371


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:2371


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:2371


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:2371


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

RE: Change Skin on URL by rdickey
We are looking for something simular. We have some modules that like to display the admin skin when...
Changing "Register" to "Sign up" by evo
HiI recently started using DNN for my programming needs (I have been programming in ASP for the last...
Problem with Andreas_01 skin in IExplorer by mendialb
Hi. i have a problem with Andreas_01 skin in IExplorer; with Firefox it's ok but when open the site ...
RE: [Server Error]This error can be caused by a virtual directory not being configured as an application in IIS. by mnaoj
Error 1 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond ...
RE: skin/container error load by islandman
Hi There newbie for most of the technical stuff. directories etc... I am using skins from ALLDNNS...
search redirect to another portal by sanju_k1421
In my site i got two protals  greek// english    when i click search of english  its redirected to g...
can search work to search in current paonlyge by sanju_k1421
hi  In my site i m using Input Search  module  when i click on search  it search the whole site  and...
Error - The ScriptManager must appear before any controls that need it by SimonTurner
Hi Guys,Ive been having the below problem for a few days now and am really in need of some expert ad...
Restricting DateEditControl till date by coder247
Hi All,   We are using the DateEditControl (for obvious reasons!!) in our application. But we want t...
RE: Email Set UP per Portal by jncraig
I think that the answer depends on how email is configured at your host. You'll probably have to co...
RE: skin/container error load by jncraig
I would suggest checking permissions for directories. Does this occur only when you upload a skin...
RE: Add New Profile Properties by jncraig
Hmmm ... I don't have an answer. Does anyone else?
RE: No Access for me too by ristori
it is ok now. Thanks for this action.
skin/container error load by islandman
Has anyone else run across this error when loading skins or containers from site settings?I am using...
Email Set UP per Portal by islandman
How do I set up a unique email address per domain name off 1 hosting environment. for example...m...
RE: localhost Install issues by cdees
Lee: I wanted to follow up on this for anyone following this thread. I have been unable to solve t...
RE: Add New Profile Properties by WSI
HI Joe, The DNN version is 4.5.5. Thanks, Cliff
Change Skin on URL by vinita
Hi,Can the skin be changed based on the url used to access a portal. Multiple portal aliases may be ...
problem creating child portal by kabamaro
  Hello all i have 4 Aliases for my parent portal , lets call them X,y,Z,WIn all Aliases i can creat...
problem creating child portal by kabamaro
  Hello all i have 4 Aliases for my parent portal , lets call them X,y,Z,WIn all Aliases i can creat...
AppTheory
RSS Feeds