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

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

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

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

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

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

Expanded sections (Advance settings) collapses automatically! by maxdagenais
Hi, Recently our production DNN install (DNN 4.8.4) with 50+ portals started misbehaving as ...
WOW GOLD by wowgolds987
Buy [url=http://www.mmoinn.com]wow power leveling[/url], you can get the most wow money, Why not! Mm...
Changing the House Menu?? by ollep
Hi Lee   I can’t see sub-menu’s in some of the horizontal House Menu skins?   I recall you where...
RE: Pop up window by yerann
Thank you for the reply.  Yes this is the module I was looking for. 
RE: around every module by leesykes
Are you using containers? I seem to recall this prob occurs if you do not use a container. I use a t...
around every module by databanq
It seems like DNN adds a span-tag around all of my modules, and inside this tag it adds a div tag. T...
RE: Events calendar by leesykes
Would love to do that, but not going this year, it was one or the other and decided to give europe a...
RE: Events calendar by mgordon
Thanks Lee.  I'll do that.On a separate note.  Will you be in Vegas for the DevConnections conferenc...
RE: Installation of Modules Errors by leesykes
I would contact your hosting provider and ask them to re-enable permissions on your DNN installation...
RE: Issue 32 - Powerful Efficient Techniques for DotNetNuke Administration using SQL by leesykes
not sure, could you post you web.config connection string for your local installation? anyone else a...
RE: Events calendar by leesykes
not dnn specific, you could post a request in the forum here, or look outside of DNN on the outsourc...
RE: Admin upload skins? by leesykes
Yes the whole install section has been redone - only host will now have access for installing. Skins...
RE: Events calendar by mgordon
I have never checked that out, but maybe it's time to start doing so.  Thanks Lee.  Do you have any ...
RE: Events calendar by leesykes
have you tried any of the dnn job sites like dnnguru.com - I get emails often from indian developers...
RE: Admin upload skins? by jncraig
To answer the question: this is a setting that can be configured on the host settings page. Also...
RE: Events calendar by mgordon
I have taken a look at it.  It does not do what we're looking to do.
RE: Events calendar by jncraig
Has anyone taken a look at the new Engage Events module?
RE: Events calendar by leesykes
I can not see a way to achieve this, perhaps you will need to look for a 3rd party events module
RE: Events calendar by mjbieg
Thanks, Mark - I will keep looking and I find something, I will post it.
RE: Events calendar by mgordon
Hi,I've been trying to find something like this for a looooong time now.  Unfortunately, you can't g...
DotNetNuke Modules
RSS Feeds