Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsLooking for an idea on how to create an "About Members Section"Looking for an idea on how to create an "About Members Section"
Previous
 
Next
New Post
4/12/2007 1:06 PM
 

I am trying to create a list of all the registered members in a form of:

[Display Name]
[City], Province [Country]
[Biography]

I have the SQL Stmt of the data select that I want to display as:

select DisplayName,
 (Select PropertyValue from userProfile where UserID = Users.UserID and PropertyDefinitionID = 65) as [City],
 (Select PropertyValue from userProfile where UserID = Users.UserID and PropertyDefinitionID = 66) as [Province],
 (Select PropertyValue from userProfile where UserID = Users.UserID and PropertyDefinitionID = 67) as [Country],
 (Select PropertyValue from userProfile where UserID = Users.UserID and PropertyDefinitionID = 74) as [Biography]
from users
 inner join UserRoles on users.userid = userroles.userid
 where userroles.RoleID = 7
order by LastName

 

The issue that I have is that the [Biography] is loaded with html tags, etc.  So I am looking for a way to display in a HTML layout. 

Any help is greatly appreciated.

Thanks

ttkachuk

 
New Post
4/12/2007 8:23 PM
 

I have a temporary solution that I have worked out, still looking for a better solution.  I build a SQL function and added that to my query to "remove all the tags"  Took an example from (http://www.thescripts.com/forum/thread591852.html) and modified to keep the <BR> and </p> and remove the rest.  I am sure I will have to keep modifing onward.

Modified query to be:

select DisplayName,
 (Select PropertyValue from userProfile where UserID = Users.UserID and PropertyDefinitionID = 65) as [City],
 (Select PropertyValue from userProfile where UserID = Users.UserID and PropertyDefinitionID = 66) as [Province],
 (Select PropertyValue from userProfile where UserID = Users.UserID and PropertyDefinitionID = 67) as [Country],
 dbo.RemoveHTMLTags (Select PropertyValue from userProfile where UserID = Users.UserID and PropertyDefinitionID = 74)) as [Biography]
from users
 inner join UserRoles on users.userid = userroles.userid
 where userroles.RoleID = 7
order by LastName

 

Function Added to DNN Db

alter function dbo.RemoveHTMLTags
(
@tmpstr as varchar(8000)
)
RETURNS varchar(8000)
AS
BEGIN
declare @i int

set @i = patindex('%&lt;br&gt;%', @tmpstr)
while @i > 0
begin
 set @tmpstr = stuff(@tmpstr, @i, charindex('&lt;br&gt;', @tmpstr, @i) - @i + 10, 'wsxcderfv')
 set @i = patindex('%&lt;br&gt;%', @tmpstr)
end

set @i = patindex('%&lt;/P&gt;%', @tmpstr)
while @i > 0
begin
 set @tmpstr = stuff(@tmpstr, @i, charindex('&lt;/P&gt;', @tmpstr, @i) - @i + 10, 'wsxcderfv')
 set @i = patindex('%&lt;/P&gt;%', @tmpstr)
end

set @i = patindex('%&amp;nbsp;%', @tmpstr)
while @i > 0
begin
 set @tmpstr = stuff(@tmpstr, @i, charindex('&amp;nbsp;', @tmpstr, @i) - @i + 10, ' ')
 set @i = patindex('%&amp;nbsp;%', @tmpstr)
end

set @i = patindex('%&lt;%&gt;%', @tmpstr)
while @i > 0
begin
 set @tmpstr = stuff(@tmpstr, @i, charindex('&gt;', @tmpstr, @i) - @i + 4, '')
 set @i = patindex('%&lt;%&gt;%', @tmpstr)
end

set @i = patindex('%wsxcderfv%', @tmpstr)
while @i > 0
begin
 set @tmpstr = stuff(@tmpstr, @i, charindex('wsxcderfv', @tmpstr, @i) - @i + 9, '<br>')
 set @i = patindex('%wsxcderfv%', @tmpstr)
end

return @tmpstr
END

 
New Post
4/12/2007 11:52 PM
 

This is a known issue (RPT-5449) but unfotunately its a little non-trivial to come up with a blanket fix that will work in all situations. In particular, there may be cases where the data should be HTML Decoded (as in the Biography) but there may also be cases where it should not be decoded (for example, if you intend to show the markup). In the mean time, you might check out the XSLT Visualizer, I believe the Help button under Reports Module Settings in the Module Settings page has a description of the XML format that is used by the XSLT Visualizer. That may allow you to do the HTML Decoding.


Andrew Nurse
DotNetNuke Core Team Member and Reports Module Project Lead
Microsoft Certified Professional Developer

 
New Post
4/13/2007 8:44 PM
 

I think you should add this in your code to eliminate the tags.

HttpUtility.HtmlDecode(Biography).

I think this will be helpful.

Thanks

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsLooking for an idea on how to create an "About Members Section"Looking for an idea on how to create an "About Members Section"


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out