Skip to content

Commit 044e401

Browse files
committed
fixed rss feed urls
1 parent 71ce768 commit 044e401

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

yafsrc/YAF.Core/URLBuilder/AdvancedUrlRewriter.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,17 @@ public override string BuildUrl(string url)
137137

138138
if (parser["f"].IsSet())
139139
{
140-
description += UrlRewriteHelper.GetForumName(parser["f"].ToType<int>());
140+
description += "_{0}".FormatWith(UrlRewriteHelper.GetForumName(parser["f"].ToType<int>()));
141141
}
142142

143143
if (parser["t"].IsSet())
144144
{
145-
description += UrlRewriteHelper.GetTopicName(parser["t"].ToType<int>());
145+
description += "_{0}".FormatWith(UrlRewriteHelper.GetTopicName(parser["t"].ToType<int>()));
146+
}
147+
148+
if (parser["c"].IsSet())
149+
{
150+
description += "_{0}".FormatWith(UrlRewriteHelper.GetCategoryName(parser["c"].ToType<int>()));
146151
}
147152

148153
if (parser["ft"].IsSet())

yafsrc/YAF.Core/URLBuilder/StandardUrlRewriter.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public override string BuildUrl(string url)
6262
var parser = new SimpleURLParameterParser(url);
6363

6464
// create "rewritten" url...
65-
newUrl = before + Config.UrlRewritingPrefix;
65+
newUrl = "{0}{1}".FormatWith(before, Config.UrlRewritingPrefix);
6666

6767
var useKey = string.Empty;
6868
var description = string.Empty;
@@ -117,20 +117,24 @@ public override string BuildUrl(string url)
117117
case "rsstopic":
118118
if (parser["pg"].IsSet())
119119
{
120-
useKey = "pg";
121-
description = parser[useKey].ToEnum<YafRssFeeds>().ToString().ToLower();
120+
description = parser["pg"].ToEnum<YafRssFeeds>().ToString().ToLower();
122121
}
123122

124123
if (parser["f"].IsSet())
125124
{
126-
description += UrlRewriteHelper.GetForumName(parser["f"].ToType<int>());
125+
description += "_{0}".FormatWith(UrlRewriteHelper.GetForumName(parser["f"].ToType<int>()));
127126
}
128127

129128
if (parser["t"].IsSet())
130129
{
131-
description += UrlRewriteHelper.GetTopicName(parser["t"].ToType<int>());
130+
description += "_{0}".FormatWith(UrlRewriteHelper.GetTopicName(parser["t"].ToType<int>()));
132131
}
133132

133+
if (parser["c"].IsSet())
134+
{
135+
description += "_{0}".FormatWith(UrlRewriteHelper.GetCategoryName(parser["c"].ToType<int>()));
136+
}
137+
134138
if (parser["ft"].IsSet())
135139
{
136140
description += parser["ft"].ToType<int>() == YafSyndicationFormats.Atom.ToInt()

yafsrc/YetAnotherForum.NET/UrlRewriter.config

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<rewrite url="^~/(.+)?yaf_postsm([0-9]+)find([-a-z]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=posts&amp;m=$2&amp;find=$3&amp;$7" processing="stop" />
1212
<rewrite url="^~/(.+)?yaf_postsm([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=posts&amp;m=$2&amp;$6" processing="stop" />
1313
<rewrite url="^~/(.+)?yaf_profile([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=profile&amp;u=$2&amp;$6" processing="stop" />
14-
<rewrite url="^~/(.+)?yaf_rsstopic([0-9]+)ft([0-9]+)t([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;pg=$2&amp;ft=$3&amp;t=$4&amp;$7" processing="stop" />
15-
<rewrite url="^~/(.+)?yaf_rsstopic([0-9]+)ft([0-9]+)f([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;pg=$2&amp;ft=$3&amp;f=$4&amp;$7" processing="stop" />
16-
<rewrite url="^~/(.+)?yaf_rsstopic([0-9]+)ft([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;pg=$2&amp;ft=$3&amp;$7" processing="stop" />
14+
<rewrite url="^~/(.+)?yaf_rsstopicft([0-9]+)t([0-9]+)(_([-a-z0-9]+))(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;ft=$2&amp;t=$3&amp;$9" processing="stop" />
15+
<rewrite url="^~/(.+)?yaf_rsstopicft([0-9]+)f([0-9]+)(_([-a-z0-9]+))(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;ft=$2&amp;f=$3&amp;$9" processing="stop" />
16+
<rewrite url="^~/(.+)?yaf_rsstopicft([0-9]+)(_([-a-z0-9]+))(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;ft=$2&amp;$8" processing="stop" />
1717
<rewrite url="^~/(.+)?yaf_([-0-9a-z_]+?)\.aspx\?(.+)?$" to="~/$1Default.aspx?g=$2&amp;$3" processing="stop" />
1818
<rewrite url="^~/(.+)?yaf_([-0-9a-z_]+?)\.aspx$" to="~/$1Default.aspx?g=$2" processing="stop" />
1919
<!-- Advanced URL Rewriting Format -->
@@ -30,9 +30,10 @@
3030
<rewrite url="^~/(.+)?profile/([0-9]+)-(([-a-z0-9]+))?(\?(.+))?$" to="~/$1Default.aspx?g=profile&amp;u=$2&amp;$6" processing="stop" />
3131
<rewrite url="^~/(.+)?admin/([-a-z0-9]+)?/([-a-z0-9]+)?(\?(.+))?$" to="~/$1Default.aspx?g=admin_$2_$3&amp;$5" processing="stop" />
3232
<rewrite url="^~/(.+)?admin/([-a-z0-9]+)?(\?(.+))?$" to="~/$1Default.aspx?g=admin_$2&amp;$4" processing="stop" />
33-
<rewrite url="^~/(.+)?rsstopic/([0-9]+)ft([0-9]+)t([0-9]+)-(([-a-z0-9]+))?(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;pg=$2&amp;ft=$3&amp;t=$4&amp;$7" processing="stop" />
34-
<rewrite url="^~/(.+)?rsstopic/([0-9]+)ft([0-9]+)f([0-9]+)-(([-a-z0-9]+))?(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;pg=$2&amp;ft=$3&amp;f=$4&amp;$7" processing="stop" />
35-
<rewrite url="^~/(.+)?rsstopic/([0-9]+)ft([0-9]+)-(([-a-z0-9]+))?(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;pg=$2&amp;ft=$3&amp;$7" processing="stop" />
33+
<rewrite url="^~/(.+)?rsstopic/ft([0-9]+)t([0-9]+)-(([-a-z0-9]+))(_([-a-z0-9]+))?(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;ft=$2&amp;t=$3&amp;pg=$5&amp;$7" processing="stop" />
34+
<rewrite url="^~/(.+)?rsstopic/ft([0-9]+)f([0-9]+)-(([-a-z0-9]+))(_([-a-z0-9]+))?(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;ft=$2&amp;f=$3&amp;pg=$5&amp;$7" processing="stop" />
35+
<rewrite url="^~/(.+)?rsstopic/ft([0-9]+)-(([-a-z0-9]+))_([-a-z0-9]+)(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;ft=$2&amp;pg=$3&amp;$7" processing="stop" />
36+
<rewrite url="^~/(.+)?rsstopic/ft([0-9]+)-(([-a-z0-9]+))-([-a-z0-9]+)(\?(.+))?$" to="~/$1Default.aspx?g=rsstopic&amp;ft=$2&amp;pg=$3&amp;$7" processing="stop" />
3637
<if url="^((?!\.ashx|\.asmx|\.axd|\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|install|error|auth\.aspx|default\.aspx|popup\.aspx|advanced\.aspx|digest\.aspx).)*$">
3738
<rewrite url="^~/(.+)?\?(.+)?$" to="~/Default.aspx?g=$1&amp;$2" processing="stop" />
3839
<rewrite url="^~/(.+)?\.aspx$" to="~/Default.aspx?g=$1" processing="stop" />

0 commit comments

Comments
 (0)