Skip to content

Commit

Permalink
Fixed some errors in the UI (DNN Form Pattern)
Browse files Browse the repository at this point in the history
Fixed a bug not showing the correct favicon
Fixed an error which occured while retrieving some RSS feeds (e.g. blogs-feed on dotnetnuke.com).
Fixed an error with ambiguous NewsId when opening "Manage BBNews".
  • Loading branch information
Torsten Weggen committed Jan 21, 2014
1 parent e6246cc commit 331eae9
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 44 deletions.
1 change: 1 addition & 0 deletions BBNews.csproj
Expand Up @@ -243,6 +243,7 @@
<Content Include="Installation\CleanUp\CleanUp.01.00.00.txt" />
<Content Include="Installation\Config\Config.txt" />
<Content Include="Installation\License.txt" />
<Content Include="Installation\ReleaseNotes\Release.01.01.04.txt" />
<Content Include="Installation\ReleaseNotes\Release.01.01.02.txt" />
<Content Include="Installation\ReleaseNotes\Release.01.01.01.txt" />
<Content Include="Installation\ReleaseNotes\Release.01.01.00.txt" />
Expand Down
3 changes: 2 additions & 1 deletion Components/BBNewsController.cs
Expand Up @@ -256,6 +256,7 @@ public void ReadFeed(int FeedId)
rssStream = wrp.GetResponseStream();

settings = new XmlReaderSettings();
settings.ProhibitDtd = false;

rssReader = XmlReader.Create(rssStream, settings);
feed = SyndicationFeed.Load(rssReader);
Expand All @@ -276,7 +277,7 @@ public void ReadFeed(int FeedId)
{
n = s.Read(bytes, 0, bloc);
}
catch (IOException iox)
catch (IOException)
{
break;
}
Expand Down
27 changes: 19 additions & 8 deletions Components/NewsInfo.cs
Expand Up @@ -27,6 +27,7 @@
using System.Text.RegularExpressions;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Entities.Users;
using DotNetNuke.Services.Tokens;

Expand Down Expand Up @@ -146,29 +147,39 @@ public string GetProperty(string propertyName, string format, CultureInfo format
case "pubdate":
return Pubdate.ToString(String.IsNullOrEmpty(format) ? "d" : format, formatProvider);
case "source":
Uri url;
if (!String.IsNullOrEmpty(Link))
{
try
{
Uri url = new Uri(Link);
url = new Uri(Link);
return PropertyAccess.FormatString(url.Host, format);
}
catch (Exception)
{
return "";
}
}
return "";
else
{
url = new Uri("http://" + PortalSettings.Current.PortalAlias.HTTPAlias);
return PropertyAccess.FormatString(url.Host, format);
}
case "favicon":
Uri urlFav;
if (feed.FeedUrl != String.Empty)
{
Uri urlfav = new Uri(feed.FeedUrl);
return "<img src=\"http://" + urlfav.Host +
"/favicon.ico\"" +
(String.IsNullOrEmpty(format) ? "" : " width=\"" + format + "\"") +
" style=\"vertical-align: middle;\" />";
urlFav = new Uri(feed.FeedUrl);
}
return "";
else
{
urlFav = new Uri("http://" + PortalSettings.Current.PortalAlias.HTTPAlias);
}
return "<img src=\"http://" + urlFav.Host +
"/favicon.ico\"" +
(String.IsNullOrEmpty(format) ? "" : " width=\"" + format + "\"") +
" style=\"vertical-align: middle;\" />";

case "feedid":
return FeedId.ToString(String.IsNullOrEmpty(format) ? "g" : format, formatProvider);
case "feedname":
Expand Down
6 changes: 3 additions & 3 deletions Components/SqlDataProvider.cs
Expand Up @@ -213,12 +213,12 @@ public override IDataReader GetNews(int PortalId, int CategoryId, int TopN, Date

string topClause = (TopN > 0 ? "TOP " + TopN.ToString() : "");
string selCmd =
"WITH NewsRN AS ( SELECT ROW_NUMBER() OVER (ORDER BY PubDate DESC, NewsId DESC) AS RowNum, NewsId FROM " +
"WITH NewsRN AS ( SELECT ROW_NUMBER() OVER (ORDER BY News.PubDate DESC, News.NewsId DESC) AS RowNum, News.NewsId FROM " +
GetFullyQualifiedName("News") + " News WHERE " + where +")"+
"SELECT " + topClause + " News.*, NewsRN.RowNum FROM " + GetFullyQualifiedName("News") + " News" +
" INNER JOIN NewsRN ON NewsRN.NewsId = News.NewsId" +
" WHERE " + String.Format(" RowNum BETWEEN {0} AND {1}", (pageNum - 1) * pageSize + 1, pageNum * pageSize) +
" ORDER BY Pubdate DESC, NewsId DESC";
" ORDER BY News.Pubdate DESC, News.NewsId DESC";

return (IDataReader) SqlHelper.ExecuteReader(ConnectionString, CommandType.Text, selCmd, sqlParams.ToArray());
}
Expand Down Expand Up @@ -260,7 +260,7 @@ public override IDataReader GetNews(int PortalId, int CategoryId, int TopN, Date
"%' OR News.News LIKE '%" + search + "%' )";
}

selCmd += " WHERE " + where + " ORDER BY Pubdate DESC, NewsId DESC";
selCmd += " WHERE " + where + " ORDER BY Pubdate DESC, News.NewsId DESC";
return (IDataReader)SqlHelper.ExecuteReader(ConnectionString, CommandType.Text, selCmd, sqlParams.ToArray());
}
}
Expand Down
18 changes: 10 additions & 8 deletions EditNews.ascx
Expand Up @@ -110,26 +110,28 @@
</div>
<div class="dnnFormItem">
<dnn:Label id="lblPubDate" runat="server" controlname="dpPubDate" suffix=":" />
<dnn:DnnDatePicker runat="server" ID="dpPubDate" CssClass="dnnFormInput" />
<dnn:DnnTimePicker runat="server" ID="tpPubDate" CssClass="dnnFormItem" DateInput="dpPubDate"/>
<div>
<dnn:DnnDatePicker runat="server" ID="dpPubDate" CssClass="dnnFormInput" />
<dnn:DnnTimePicker runat="server" ID="tpPubDate" CssClass="dnnFormItem" DateInput="dpPubDate"/>
</div>
</div>
<div class="dnnFormItem">
<dnn:Label ID="lblAuthor" runat="server" controlname="txtAuthor" suffix=":" />
<fieldset>
<div class="dnnFormItem">
<dnn:Label runat="server" id="lblAuthorName" controlname="txtAuthorName" suffix=":" />
<asp:Label runat="server" id="lblAuthorName" resourcekey="lblAuthorName.Text" CssClass="dnnLeft" Width="80px"/>
<asp:TextBox runat="server" id="txtAuthorName" CssClass="dnnFormInput" Columns="40" />
</div>
<div class="dnnFormItem">
<dnn:Label runat="server" id="lblAuthorUrl" controlname="txtAuthorUrl" suffix=":" />
<asp:Label runat="server" id="lblAuthorUrl" resourcekey="lblAuthorUrl.Text" CssClass="dnnLeft" Width="80px"/>
<asp:TextBox runat="server" id="txtAuthorUrl" CssClass="dnnFormInput" Columns="40" />
</div>
<div class="dnnFormItem">
<dnn:Label runat="server" id="lblAuthorEmail" controlname="txtAuthorEmail" suffix=":" />
<asp:Label runat="server" id="lblAuthorEmail" resourcekey="lblAuthorEmail.Text" CssClass="dnnLeft" Width="80px"/>
<asp:TextBox runat="server" id="txtAuthorEmail" CssClass="dnnFormInput" Columns="40" />
</div>
<div class="dnnFormItem">
<dnn:Label runat="server" id="lblAuthorNick" controlname="txtAuthorNick" suffix=":" />
<asp:Label runat="server" id="lblAuthorNick" resourcekey="lblAuthorNick.Text" CssClass="dnnLeft" Width="80px"/>
<asp:TextBox runat="server" id="txtAuthorNick" CssClass="dnnFormInput" Columns="40" />
</div>
</fieldset>
Expand All @@ -144,13 +146,13 @@
</div>
<div class="dnnFormItem">
<dnn:Label ID="lblSummary" runat="server" controlname="txtSummary" suffix=":" />
<div class="dnnRight">
<div class="dnnLeft" style="width:200px;">
<dnn:texteditor ID="txtSummary" runat="server" TextRenderMode="Raw" HtmlEncode="False" defaultmode="Rich" choosemode="False" chooserender="False" Width="550" Height="350"/>
</div>
</div>
<div class="dnnFormItem">
<dnn:Label ID="lblNews" runat="server" controlname="txtNews" suffix=":" />
<div class="dnnRight">
<div class="dnnLeft" style="width:200px;">
<dnn:texteditor ID="txtNews" runat="server" TextRenderMode="Raw" HtmlEncode="False" defaultmode="Rich" choosemode="False" chooserender="False" Width="550" Height="350"/>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions EditNews.ascx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions EditScheduler.ascx
Expand Up @@ -17,23 +17,27 @@
</div>
<div class="dnnFormItem">
<dnn:Label ID="plTimeLapse" runat="server" ControlName="txtTimeLapse" />
<asp:TextBox ID="txtTimeLapse" runat="server" MaxLength="10" />
<asp:DropDownList ID="ddlTimeLapseMeasurement" runat="server">
<asp:ListItem resourcekey="Seconds" Value="s" />
<asp:ListItem resourcekey="Minutes" Value="m" />
<asp:ListItem resourcekey="Hours" Value="h" />
<asp:ListItem resourcekey="Days" Value="d" />
</asp:DropDownList>
<div>
<asp:TextBox ID="txtTimeLapse" runat="server" MaxLength="10" style="width:50px"/>
<asp:DropDownList ID="ddlTimeLapseMeasurement" runat="server">
<asp:ListItem resourcekey="Seconds" Value="s" />
<asp:ListItem resourcekey="Minutes" Value="m" />
<asp:ListItem resourcekey="Hours" Value="h" />
<asp:ListItem resourcekey="Days" Value="d" />
</asp:DropDownList>
</div>
</div>
<div class="dnnFormItem">
<dnn:Label ID="plRetryTimeLapse" runat="server" ControlName="txtRetryTimeLapse" />
<asp:TextBox ID="txtRetryTimeLapse" runat="server" MaxLength="10" />
<asp:DropDownList ID="ddlRetryTimeLapseMeasurement" runat="server">
<asp:ListItem resourcekey="Seconds" Value="s" />
<asp:ListItem resourcekey="Minutes" Value="m" />
<asp:ListItem resourcekey="Hours" Value="h" />
<asp:ListItem resourcekey="Days" Value="d" />
</asp:DropDownList>
<div>
<asp:TextBox ID="txtRetryTimeLapse" runat="server" MaxLength="10" style="width:50px"/>
<asp:DropDownList ID="ddlRetryTimeLapseMeasurement" runat="server">
<asp:ListItem resourcekey="Seconds" Value="s" />
<asp:ListItem resourcekey="Minutes" Value="m" />
<asp:ListItem resourcekey="Hours" Value="h" />
<asp:ListItem resourcekey="Days" Value="d" />
</asp:DropDownList>
</div>
</div>
<div class="dnnFormItem">
<dnn:Label ID="plRetainHistoryNum" runat="server" ControlName="ddlRetainHistoryNum" />
Expand Down
2 changes: 1 addition & 1 deletion Installation/ReleaseNotes/Release.01.01.03.txt
Expand Up @@ -4,6 +4,6 @@
<ul>
<li>Fixed an error with Settings if a portal is located in a subdirectory (e.g. http://localhost/dnntest )</li>
<li>Some files for selecting templates were missing in version 1.1.2. These are now included, so selecting and editing templates should be fine now</li>
<li>Fixed an error which occured while retrieving some RSS feeds (e.g. blogs-feed on dotnetnuke.com).
<li>Fixed an error which occured while retrieving some RSS feeds (e.g. blogs-feed on dotnetnuke.com).<li>
</ul>

13 changes: 13 additions & 0 deletions Installation/ReleaseNotes/Release.01.01.04.txt
@@ -0,0 +1,13 @@
<h2>Release Notes bitboxx bbnews 01.01.04</h2>
<p>bbnews 01.01.04 will work for any DNN version <strong>6.1.0</strong> and up.
<h3>BUG FIXES</h3>
<ul>
<li>Fixed some errors in the UI (DNN Form Pattern)</li>
<li>Fixed a bug not showing the correct favicon</li>
<li>Fixed an error which occured while retrieving some RSS feeds (e.g. blogs-feed on dotnetnuke.com).<li>
<li>Fixed an error with ambiguous NewsId when opening "Manage BBNews".<li>
</ul>
<h3>ENHANCEMENTS</h3>
<ul>
<li>Added a class ("bbNewsCell") to the news area for better styling</li>
</ul>
3 changes: 2 additions & 1 deletion Module.css
@@ -1 +1,2 @@
.dnnBBNewsSettings .dnnFormItem .dnnNumberInput { min-width: 100px;width: 100px!important;}
.dnnBBNewsSettings .dnnFormItem .dnnNumberInput { min-width: 100px;width: 100px!important;}
.bbNewsCell { padding-bottom: 10px; vertical-align: top;}
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Expand Up @@ -40,6 +40,6 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.1.3.0")]
[assembly: AssemblyFileVersion("1.1.3.0")]
[assembly: AssemblyVersion("1.1.4.0")]
[assembly: AssemblyFileVersion("1.1.4.0")]

2 changes: 1 addition & 1 deletion Settings.ascx.cs
Expand Up @@ -24,6 +24,7 @@
using System.Collections.Generic;
using System.Web.UI.WebControls;
using Bitboxx.DNNModules.BBNews.Components;
using DotNetNuke.Common;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Exceptions;

Expand Down Expand Up @@ -226,6 +227,5 @@ protected void rblView_SelectedIndexChanged(object sender, EventArgs e)
}

}

}

2 changes: 1 addition & 1 deletion View.ascx
Expand Up @@ -14,7 +14,7 @@
<tr id="Tr1" runat="server"><td id="itemPlaceholder" /></tr>
</GroupTemplate>
<ItemTemplate>
<td id="newsCell" runat="server" style="vertical-align:top">
<td id="newsCell" runat="server" class="bbNewsCell">
<asp:PlaceHolder ID="newsPlaceHolder" runat="server" />
</td>
</ItemTemplate>
Expand Down

0 comments on commit 331eae9

Please sign in to comment.