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

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

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

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

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

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

News&Articles Module by gabrieleseven
Hello, I've created a Portal for news and info about the world of music. I need a module that allow ...
RE: Install DNN.4 on Win 2003 and SQL2000 by jncraig
1. Add a portalalias for your new site's URL before you do anything. 2. Make a backup of your dat...
RE: Custom Module Development by jncraig
I would recommend adefwebserver.com for good information on writing modules. Without looking over...
RE: Dynamic page navigation by jncraig
I take it that you have developed 10 separate pages? Are these pages with a custom module or with c...
RE: Pop up window by jncraig
I believe that ZLDNN (zldnn.com) has a module that will pop up a page or a module. I've not tried i...
Dynamic page navigation by coder247
Hi all,          We are developing a web app using DNN and we've a requirement like this. There are ...
Custom Module Development by neenu
I created my own module using DAL,by adding 4 class files in app_code directory, say alistinfo.vb,al...
Pop up window by yerann
Whenever a page loads in DNN i would like a pop up window to display.  This pop window ask the user ...
RE: Customise registration page by nichord
Thanks Rob... I would have never found this one on my own.And many thanks to you Lee... My print com...
Install DNN.4 on Win 2003 and SQL2000 by amine97
Hi all,I will be working on creating a website on my development server Windows 2003 and SQL Server ...
RE: Dynamically Add modules by jncraig
You can include a module on multiple pages within a portal by selecting "add existing module" on the...
music player, music charts by mrvorazan
hey,i havev to create a music portal, so i need a module to upload music files by users, they have t...
Dynamically Add modules by UmaRam
Hi, Please advice how to add an existing module in a page to another page in the same portal and ...
Dynamically add module by UmaRam
Hi, Please advice how to add an existing module in a page to another page in the same portal and ...
RE: VWD 2008 & SQL Express 2008? by rc_kemal
It is very difficult to convert the database from sql2008 express to sql2005 express. To answer my o...
RE: User Registration Questions by jncraig
I would recommend that you NOT begin your DotNetNuke life by starting to modify any of the code. Ye...
RE: Dotted Lines Around Navigation by HUGHD37IUOE
Here it is: http://www.iuoe.org
RE: Installing on XP Home by nexduke
Hi Yes, I'm using SQL Server Express 2005, what would you suggest I do if it is a configuaration ...
RE: Exporting and transferring Modules. by ollep
Thanks Lee! Yes I will check out the Forum – and the hosts before I sign up.   I expect to see an...
User Registration Questions by stevennestler
Hi.I'm new to DNN, and just watched my first set of videos on this site, for customizing registratio...
DotNetNuke Modules
RSS Feeds