Move uForum and adjust uForum namespaces to be correct
This commit is contained in:
@@ -233,16 +233,16 @@
|
||||
<Compile Include="SheduledNotification.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\uForum\uForum.csproj">
|
||||
<Project>{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}</Project>
|
||||
<Name>uForum</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OurUmbraco\OurUmbraco.csproj">
|
||||
<Project>{a8e5c936-ecab-45b3-bfda-d12f680eb2a6}</Project>
|
||||
<Name>OurUmbraco</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
||||
@@ -3,12 +3,12 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Net.Mail;
|
||||
using uForum.Models;
|
||||
using System.Data.SqlClient;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using umbraco.presentation.nodeFactory;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using System.Web;
|
||||
using OurUmbraco.Forum.Models;
|
||||
|
||||
namespace NotificationsCore.NotificationTypes
|
||||
{
|
||||
|
||||
@@ -3,10 +3,10 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Net.Mail;
|
||||
using uForum.Models;
|
||||
using System.Data.SqlClient;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using System.Web;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Core;
|
||||
|
||||
@@ -5,9 +5,9 @@ using NotificationsCore;
|
||||
using umbraco.presentation.nodeFactory;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using Umbraco.Core;
|
||||
using uForum.Services;
|
||||
using uForum;
|
||||
using NotificationsWeb.Services;
|
||||
using OurUmbraco.Forum;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace NotificationsWeb.EventHandlers
|
||||
@@ -29,13 +29,13 @@ namespace NotificationsWeb.EventHandlers
|
||||
ForumService.Deleted += ForumService_Deleted;
|
||||
}
|
||||
|
||||
void ForumService_Deleted(object sender, uForum.ForumEventArgs e)
|
||||
void ForumService_Deleted(object sender, ForumEventArgs e)
|
||||
{
|
||||
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
|
||||
ns.RemoveAllForumSubscriptions(e.Forum.Id);
|
||||
}
|
||||
|
||||
void ForumService_Created(object sender, uForum.ForumEventArgs e)
|
||||
void ForumService_Created(object sender, ForumEventArgs e)
|
||||
{
|
||||
var content = Umbraco.Web.UmbracoContext.Current.Application.Services.ContentService.GetById(e.Forum.ParentId);
|
||||
if (content.ContentType.Alias == "Project")
|
||||
@@ -47,7 +47,7 @@ namespace NotificationsWeb.EventHandlers
|
||||
}
|
||||
}
|
||||
|
||||
void TopicService_Created(object sender, uForum.TopicEventArgs e)
|
||||
void TopicService_Created(object sender, TopicEventArgs e)
|
||||
{
|
||||
|
||||
var ns = new NotificationService(ApplicationContext.Current.DatabaseContext);
|
||||
@@ -66,7 +66,7 @@ namespace NotificationsWeb.EventHandlers
|
||||
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewTopic", e.Topic, e.Topic.GetUrl(), memberName);
|
||||
}
|
||||
|
||||
void CommentService_Created(object sender, uForum.CommentEventArgs e)
|
||||
void CommentService_Created(object sender, CommentEventArgs e)
|
||||
{
|
||||
var ts = new TopicService(ApplicationContext.Current.DatabaseContext);
|
||||
|
||||
|
||||
@@ -247,9 +247,9 @@
|
||||
<Project>{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}</Project>
|
||||
<Name>Notification</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\uForum\uForum.csproj">
|
||||
<Project>{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}</Project>
|
||||
<Name>uForum</Name>
|
||||
<ProjectReference Include="..\OurUmbraco\OurUmbraco.csproj">
|
||||
<Project>{a8e5c936-ecab-45b3-bfda-d12f680eb2a6}</Project>
|
||||
<Name>OurUmbraco</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4730,10 +4730,6 @@
|
||||
<Project>{a625544f-660a-4c01-ba49-1b467d0322d9}</Project>
|
||||
<Name>our.umbraco.org</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\uForum\uForum.csproj">
|
||||
<Project>{547c2d0d-1b55-493b-ae0b-e031a5b8ee77}</Project>
|
||||
<Name>uForum</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\migrations\" />
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
@using uForum
|
||||
@using uForum.Extensions
|
||||
@using uForum.Library
|
||||
@using uForum.Models
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Library
|
||||
@using OurUmbraco.Forum.Models
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@using uForum.Extensions
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
|
||||
<div class="utility-actions">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using uForum;
|
||||
@using uForum.Services
|
||||
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Models
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using uForum.Extensions
|
||||
|
||||
@{
|
||||
var ts = new uForum.Services.TopicService(ApplicationContext.DatabaseContext);
|
||||
var ts = new TopicService(ApplicationContext.DatabaseContext);
|
||||
}
|
||||
|
||||
<div class="col-md-12 flex">
|
||||
@Column(ts.GetLatestTopics(6, 1))
|
||||
</div>
|
||||
|
||||
@helper Column(IEnumerable<uForum.Models.ReadOnlyTopic> topics)
|
||||
@helper Column(IEnumerable<ReadOnlyTopic> topics)
|
||||
{
|
||||
foreach (var topic in topics.ToArray())
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using System.Web.Mvc.Html
|
||||
@using uForum.Extensions
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Services
|
||||
|
||||
@{
|
||||
var topicService = new TopicService(ApplicationContext.DatabaseContext);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using uForum
|
||||
@using uForum.Extensions
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
var topicService = new TopicService(ApplicationContext.DatabaseContext);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using uForum.Extensions
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
var memberGuid = Request.QueryString["id"];
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using uForum;
|
||||
@using uForum.Extensions
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
|
||||
@if(Members.IsLoggedIn()){
|
||||
<div class="user">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using uForum;
|
||||
@using uForum.Extensions
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
|
||||
@if(Members.IsLoggedIn()){
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@using NotificationsWeb.Services
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using Marketplace.Interfaces
|
||||
@using Marketplace.Providers
|
||||
@using uForum.Extensions
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@{
|
||||
var memberId = Request["id"];
|
||||
int id = 0;
|
||||
@@ -15,7 +16,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
var ts = new uForum.Services.TopicService(UmbracoContext.Application.DatabaseContext);
|
||||
var ts = new TopicService(UmbracoContext.Application.DatabaseContext);
|
||||
|
||||
var topics = ts.GetLatestTopicsForMember(member.Id);
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using System.Drawing
|
||||
@using our
|
||||
@using uForum
|
||||
@using uForum.Extensions
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@{
|
||||
var topicService = new TopicService(ApplicationContext.DatabaseContext);
|
||||
Image avatarImage = null;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using our.Controllers
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Wiki.BusinessLogic
|
||||
@using uForum;
|
||||
@using uForum.Extensions
|
||||
@using uProject.Controllers
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using uForum
|
||||
@using uForum.Extensions
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Response.Clear();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using uForum
|
||||
@using uForum.Extensions
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Response.Clear();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using uForum
|
||||
@using uForum.Extensions
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Response.Clear();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using uForum
|
||||
@using uForum.Extensions
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Response.Clear();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using uForum
|
||||
@using uForum.Extensions
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Response.Clear();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@using our
|
||||
@using uForum.Extensions
|
||||
@using uForum.Services
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Forum.Services
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
|
||||
@if (Members.IsAdmin())
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<uForum.Models.ReadOnlyComment>
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<OurUmbraco.Forum.Models.ReadOnlyComment>
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Powers.Library
|
||||
@using uForum.Extensions
|
||||
|
||||
@{
|
||||
var currentMember = Members.GetCurrentMember();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@model IMember
|
||||
@using uForum;
|
||||
@using uForum.Extensions
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@model IMember
|
||||
|
||||
<div class="author vcard">
|
||||
<div class="memberBadge rounded">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<uForum.Models.Topic>
|
||||
@inherits Umbraco.Web.Mvc.UmbracoViewPage<OurUmbraco.Forum.Models.Topic>
|
||||
@using OurUmbraco.Forum.Extensions
|
||||
@using OurUmbraco.Powers.Library
|
||||
@using uForum.Extensions
|
||||
|
||||
@{
|
||||
var currentMember = Members.GetCurrentMember();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@using uForum.Businesslogic
|
||||
@using uForum.Library
|
||||
@using OurUmbraco.Forum.Library
|
||||
@using uForum.Businesslogic
|
||||
@using umbraco.cms.businesslogic.member
|
||||
@{
|
||||
if (uForum.Library.Utils.IsModerator() == false)
|
||||
if (Utils.IsModerator() == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,17 +7,16 @@ using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using HtmlAgilityPack;
|
||||
using uForum.Extensions;
|
||||
using uForum.Library;
|
||||
using uForum.Models;
|
||||
using uForum.Services;
|
||||
using OurUmbraco.Forum.Extensions;
|
||||
using OurUmbraco.Forum.Library;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using umbraco.BusinessLogic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace uForum.AntiSpam
|
||||
namespace OurUmbraco.Forum.AntiSpam
|
||||
{
|
||||
internal class SpamChecker
|
||||
{
|
||||
@@ -3,30 +3,25 @@ using System.Collections.Specialized;
|
||||
using System.Configuration;
|
||||
using System.Dynamic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using System.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
using uForum.AntiSpam;
|
||||
using uForum.Extensions;
|
||||
using uForum.Library;
|
||||
using uForum.Models;
|
||||
using uForum.Services;
|
||||
using OurUmbraco.Forum.AntiSpam;
|
||||
using OurUmbraco.Forum.Extensions;
|
||||
using OurUmbraco.Forum.Library;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using umbraco;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.cms.helpers;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Security;
|
||||
using Umbraco.Web.WebApi;
|
||||
|
||||
namespace uForum.Api
|
||||
namespace OurUmbraco.Forum.Api
|
||||
{
|
||||
[MemberAuthorize(AllowType = "member")]
|
||||
public class ForumController : ForumControllerBase
|
||||
@@ -1,7 +1,7 @@
|
||||
using uForum.Services;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using Umbraco.Web.WebApi;
|
||||
|
||||
namespace uForum.Api
|
||||
namespace OurUmbraco.Forum.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Base abstract controller that expose the forum services
|
||||
+76
-81
@@ -1,81 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using uForum.Extensions;
|
||||
using uForum.Services;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web.WebApi;
|
||||
|
||||
namespace uForum.Api
|
||||
{
|
||||
public class PublicForumController : ForumControllerBase
|
||||
{
|
||||
|
||||
/* TOPICS */
|
||||
[HttpGet]
|
||||
public IEnumerable<ExpandoObject> LatestPaged(int page, int cat)
|
||||
{
|
||||
var l = new List<ExpandoObject>();
|
||||
foreach (var topic in TopicService.GetLatestTopics(50, page, true, cat))
|
||||
{
|
||||
dynamic o = new ExpandoObject();
|
||||
|
||||
o.url = topic.GetUrl();
|
||||
o.title = topic.Title;
|
||||
o.replies = topic.Replies;
|
||||
o.hasAnswer = topic.Answer > 0;
|
||||
o.updated = topic.Updated.ConvertToRelativeTime();
|
||||
o.updatedLong = string.Format("{0:ddd, dd MMM yyyy} {0:HH:mm:ss} UTC+{1}", topic.Updated, TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now));
|
||||
if (topic.LatestReplyAuthor > 0)
|
||||
{
|
||||
o.memId = topic.LatestReplyAuthor;
|
||||
o.memName = topic.LastReplyAuthorName;
|
||||
//var mem = Members.GetById(topic.LatestReplyAuthor);
|
||||
//if (mem != null)
|
||||
//{
|
||||
// o.memId = mem.Id;
|
||||
// o.memName = mem.Name;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
o.memId = topic.MemberId;
|
||||
o.memName = topic.AuthorName;
|
||||
//var author = Members.GetById(topic.MemberId);
|
||||
//if (author != null)
|
||||
//{
|
||||
// o.memId = author.Id;
|
||||
// o.memName = author.Name;
|
||||
//}
|
||||
}
|
||||
|
||||
IPublishedContent forum;
|
||||
if (topic.ParentId > 0 && ((forum = Umbraco.TypedContent(topic.ParentId)) != null))
|
||||
{
|
||||
o.forumUrl = forum.Url;
|
||||
|
||||
o.forumName = Library.Utils.GetForumName(forum);
|
||||
}
|
||||
//var forum = Umbraco.TypedContent(topic.ParentId);
|
||||
//if (forum != null)
|
||||
//{
|
||||
// o.forumUrl = forum.Url;
|
||||
// o.forumName = forum.Name;
|
||||
//}
|
||||
|
||||
l.Add(o);
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public string CategoryUrl(int id)
|
||||
{
|
||||
return Umbraco.TypedContent(id).Url;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Web.Http;
|
||||
using OurUmbraco.Forum.Extensions;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace OurUmbraco.Forum.Api
|
||||
{
|
||||
public class PublicForumController : ForumControllerBase
|
||||
{
|
||||
|
||||
/* TOPICS */
|
||||
[HttpGet]
|
||||
public IEnumerable<ExpandoObject> LatestPaged(int page, int cat)
|
||||
{
|
||||
var l = new List<ExpandoObject>();
|
||||
foreach (var topic in TopicService.GetLatestTopics(50, page, true, cat))
|
||||
{
|
||||
dynamic o = new ExpandoObject();
|
||||
|
||||
o.url = topic.GetUrl();
|
||||
o.title = topic.Title;
|
||||
o.replies = topic.Replies;
|
||||
o.hasAnswer = topic.Answer > 0;
|
||||
o.updated = topic.Updated.ConvertToRelativeTime();
|
||||
o.updatedLong = string.Format("{0:ddd, dd MMM yyyy} {0:HH:mm:ss} UTC+{1}", topic.Updated, TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now));
|
||||
if (topic.LatestReplyAuthor > 0)
|
||||
{
|
||||
o.memId = topic.LatestReplyAuthor;
|
||||
o.memName = topic.LastReplyAuthorName;
|
||||
//var mem = Members.GetById(topic.LatestReplyAuthor);
|
||||
//if (mem != null)
|
||||
//{
|
||||
// o.memId = mem.Id;
|
||||
// o.memName = mem.Name;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
o.memId = topic.MemberId;
|
||||
o.memName = topic.AuthorName;
|
||||
//var author = Members.GetById(topic.MemberId);
|
||||
//if (author != null)
|
||||
//{
|
||||
// o.memId = author.Id;
|
||||
// o.memName = author.Name;
|
||||
//}
|
||||
}
|
||||
|
||||
IPublishedContent forum;
|
||||
if (topic.ParentId > 0 && ((forum = Umbraco.TypedContent(topic.ParentId)) != null))
|
||||
{
|
||||
o.forumUrl = forum.Url;
|
||||
|
||||
o.forumName = Library.Utils.GetForumName(forum);
|
||||
}
|
||||
//var forum = Umbraco.TypedContent(topic.ParentId);
|
||||
//if (forum != null)
|
||||
//{
|
||||
// o.forumUrl = forum.Url;
|
||||
// o.forumName = forum.Name;
|
||||
//}
|
||||
|
||||
l.Add(o);
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public string CategoryUrl(int id)
|
||||
{
|
||||
return Umbraco.TypedContent(id).Url;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using uForum.Models;
|
||||
using uForum.Services;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using Umbraco.Web.WebApi;
|
||||
|
||||
namespace uForum.Api
|
||||
namespace OurUmbraco.Forum.Api
|
||||
{
|
||||
[MemberAuthorize(AllowType = "member")]
|
||||
public class TopicController : ForumControllerBase
|
||||
+1
-2
@@ -1,13 +1,12 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using uForum.Library;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace uForum.EventHandlers
|
||||
namespace OurUmbraco.Forum.EventHandlers
|
||||
{
|
||||
public class MemberApprovedEventhandler : ApplicationEventHandler
|
||||
{
|
||||
+4
-5
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using uForum.Models;
|
||||
using uForum.Services;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace uForum.EventHandlers
|
||||
namespace OurUmbraco.Forum.EventHandlers
|
||||
{
|
||||
public class NewForumHandler : ApplicationEventHandler
|
||||
{
|
||||
@@ -39,11 +38,11 @@ namespace uForum.EventHandlers
|
||||
var fs = new ForumService(ApplicationContext.Current.DatabaseContext);
|
||||
foreach (var ent in e.PublishedEntities.Where(x => x.ContentType.Alias == "Forum"))
|
||||
{
|
||||
Forum f = fs.GetById(ent.Id);
|
||||
Models.Forum f = fs.GetById(ent.Id);
|
||||
|
||||
if (f == null)
|
||||
{
|
||||
f = new Forum();
|
||||
f = new Models.Forum();
|
||||
f.Id = ent.Id;
|
||||
f.ParentId = ent.ParentId;
|
||||
f.SortOrder = ent.SortOrder;
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace uForum
|
||||
namespace OurUmbraco.Forum
|
||||
{
|
||||
public class TopicEventArgs : System.ComponentModel.CancelEventArgs {
|
||||
public Models.Topic Topic { get; set; }
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace uForum.Extensions
|
||||
namespace OurUmbraco.Forum.Extensions
|
||||
{
|
||||
public static class EventExtensions
|
||||
{
|
||||
+4
-4
@@ -7,13 +7,13 @@ using System.Web;
|
||||
using System.Web.Security;
|
||||
using HtmlAgilityPack;
|
||||
using MarkdownSharp;
|
||||
using uForum.AntiSpam;
|
||||
using uForum.Library;
|
||||
using uForum.Models;
|
||||
using OurUmbraco.Forum.AntiSpam;
|
||||
using OurUmbraco.Forum.Library;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace uForum.Extensions
|
||||
namespace OurUmbraco.Forum.Extensions
|
||||
{
|
||||
public static class ForumExtensions
|
||||
{
|
||||
+1
-1
@@ -4,7 +4,7 @@ using Umbraco.Core.Models;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace uForum.Extensions
|
||||
namespace OurUmbraco.Forum.Extensions
|
||||
{
|
||||
public static class MemberForumExtensions
|
||||
{
|
||||
@@ -10,18 +10,14 @@ using System.Web;
|
||||
using System.Web.Security;
|
||||
using RestSharp;
|
||||
using RestSharp.Deserializers;
|
||||
using umbraco;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.editorControls.MultiNodeTreePicker;
|
||||
using umbraco.NodeFactory;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web;
|
||||
using Member = umbraco.cms.businesslogic.member.Member;
|
||||
using MemberGroup = umbraco.cms.businesslogic.member.MemberGroup;
|
||||
|
||||
namespace uForum.Library
|
||||
namespace OurUmbraco.Forum.Library
|
||||
{
|
||||
public class Utils
|
||||
{
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace uForum.Models
|
||||
namespace OurUmbraco.Forum.Models
|
||||
{
|
||||
[TableName("forumComments")]
|
||||
[PrimaryKey("id")]
|
||||
@@ -1,11 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace uForum.Models
|
||||
namespace OurUmbraco.Forum.Models
|
||||
{
|
||||
[DataContract( Name="comment")]
|
||||
public class CommentSaveModel
|
||||
@@ -1,11 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace uForum.Models
|
||||
namespace OurUmbraco.Forum.Models
|
||||
{
|
||||
[TableName("forumForums")]
|
||||
[PrimaryKey("id", autoIncrement = false)]
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace uForum.Models
|
||||
namespace OurUmbraco.Forum.Models
|
||||
{
|
||||
[TableName("forumComments")]
|
||||
[PrimaryKey("id")]
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace uForum.Models
|
||||
namespace OurUmbraco.Forum.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A topic with all of it's data including comments and author names
|
||||
@@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using umbraco;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace uForum.Models
|
||||
namespace OurUmbraco.Forum.Models
|
||||
{
|
||||
[TableName("forumTopics")]
|
||||
[PrimaryKey("id")]
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace uForum.Models
|
||||
namespace OurUmbraco.Forum.Models
|
||||
{
|
||||
class TopicCommentRelator
|
||||
{
|
||||
@@ -1,11 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace uForum.Models
|
||||
namespace OurUmbraco.Forum.Models
|
||||
{
|
||||
[DataContract(Name = "topic")]
|
||||
public class TopicSaveModel
|
||||
@@ -1,14 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using uForum.Extensions;
|
||||
using uForum.Models;
|
||||
using OurUmbraco.Forum.Extensions;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace uForum.Services
|
||||
namespace OurUmbraco.Forum.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for CRUD of comments - There aren't any query methods for comments here, comments are resolved with a Topic in a single query be displayed in the view
|
||||
@@ -1,14 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using uForum.Extensions;
|
||||
using uForum.Models;
|
||||
using OurUmbraco.Forum.Extensions;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace uForum.Services
|
||||
namespace OurUmbraco.Forum.Services
|
||||
{
|
||||
public class ForumService
|
||||
{
|
||||
@@ -20,20 +16,20 @@ namespace uForum.Services
|
||||
_databaseContext = dbContext;
|
||||
}
|
||||
|
||||
public IEnumerable<Forum> GetForums(int rootId)
|
||||
public IEnumerable<Models.Forum> GetForums(int rootId)
|
||||
{
|
||||
var sql = new Sql();
|
||||
sql.Where<Forum>(x => x.ParentId == rootId);
|
||||
sql.OrderBy<Forum>(x => x.SortOrder);
|
||||
return _databaseContext.Database.Fetch<Forum>(sql);
|
||||
sql.Where<Models.Forum>(x => x.ParentId == rootId);
|
||||
sql.OrderBy<Models.Forum>(x => x.SortOrder);
|
||||
return _databaseContext.Database.Fetch<Models.Forum>(sql);
|
||||
}
|
||||
|
||||
public Forum GetById(int nodeId)
|
||||
public Models.Forum GetById(int nodeId)
|
||||
{
|
||||
return _databaseContext.Database.SingleOrDefault<Forum>(nodeId);
|
||||
return _databaseContext.Database.SingleOrDefault<Models.Forum>(nodeId);
|
||||
}
|
||||
|
||||
public void Delete(Forum forum)
|
||||
public void Delete(Models.Forum forum)
|
||||
{
|
||||
var eventArgs = new ForumEventArgs() { Forum = forum };
|
||||
if (Deleting.RaiseAndContinue(this, eventArgs))
|
||||
@@ -45,7 +41,7 @@ namespace uForum.Services
|
||||
CancelledByEvent.Raise(this, eventArgs);
|
||||
}
|
||||
|
||||
public Forum Save(Forum forum)
|
||||
public Models.Forum Save(Models.Forum forum)
|
||||
{
|
||||
var newForum = _databaseContext.Database.ExecuteScalar<int>("SELECT COUNT(*) FROM forumForums WHERE id=@id", new {id = forum.Id}) == 0;
|
||||
var eventArgs = new ForumEventArgs() { Forum = forum };
|
||||
@@ -1,17 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using uForum.Extensions;
|
||||
using uForum.Models;
|
||||
using OurUmbraco.Forum.Extensions;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Persistence;
|
||||
|
||||
namespace uForum.Services
|
||||
namespace OurUmbraco.Forum.Services
|
||||
{
|
||||
public class TopicService
|
||||
{
|
||||
@@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace uForum
|
||||
namespace OurUmbraco.Forum
|
||||
{
|
||||
public class Singleton<T> where T : class, new()
|
||||
{
|
||||
@@ -1,183 +1,180 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Xml;
|
||||
using System.Web;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco;
|
||||
using umbraco.cms.businesslogic.template;
|
||||
using umbraco.interfaces;
|
||||
using umbraco.NodeFactory;
|
||||
|
||||
namespace uForum {
|
||||
public class iNotFoundHandler : umbraco.interfaces.INotFoundHandler {
|
||||
#region INotFoundHandler Members
|
||||
|
||||
private int _redirectID = -1;
|
||||
|
||||
public bool CacheUrl {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool Execute(string url) {
|
||||
|
||||
HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler","init");
|
||||
|
||||
bool _succes = false;
|
||||
url = url.Replace(".aspx", string.Empty);
|
||||
string currentDomain = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
|
||||
if (url.Length > 0) {
|
||||
if (url.Substring(0, 1) == "/")
|
||||
url = url.Substring(1, url.Length - 1);
|
||||
|
||||
XmlNode urlNode = null;
|
||||
string topicId = "";
|
||||
string topicTitle = "";
|
||||
|
||||
HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler url", url);
|
||||
|
||||
|
||||
// We're not at domain root
|
||||
if (url.IndexOf("/") != -1) {
|
||||
|
||||
string theRealUrl = url.Substring(0, url.LastIndexOf("/"));
|
||||
string realUrlXPath = CreateXPathQuery(theRealUrl, true);
|
||||
|
||||
urlNode = content.Instance.XmlContent.SelectSingleNode(realUrlXPath);
|
||||
topicTitle = url.Substring(url.LastIndexOf("/") + 1, url.Length - url.LastIndexOf(("/")) - 1).ToLower();
|
||||
topicId = topicTitle.Split('-')[0];
|
||||
topicTitle = topicTitle.Substring(topicTitle.IndexOf('-') + 1);
|
||||
|
||||
if(urlNode != null)
|
||||
HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler", topicId + " " + urlNode.Name);
|
||||
}
|
||||
|
||||
if (urlNode != null && topicId != "" && urlNode.Name == "Forum") {
|
||||
_redirectID = int.Parse(urlNode.Attributes.GetNamedItem("id").Value);
|
||||
|
||||
var cookie = new HttpCookie("altTemplate", "displaytopic");
|
||||
HttpContext.Current.Request.Cookies.Add(cookie);
|
||||
|
||||
HttpContext.Current.Items["altTemplate"] = "displaytopic";
|
||||
HttpContext.Current.Items["topicID"] = topicId;
|
||||
HttpContext.Current.Items["topicTitle"] = topicTitle.Replace('-',' ');
|
||||
|
||||
HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler",
|
||||
string.Format("Templated changed to: '{0}'",
|
||||
HttpContext.Current.Items["altTemplate"]));
|
||||
_succes = true;
|
||||
}
|
||||
}
|
||||
return _succes;
|
||||
}
|
||||
|
||||
public int redirectID {
|
||||
get {
|
||||
return _redirectID;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private const string PageXPathQueryStart = "/root";
|
||||
private const string UrlName = "@urlName";
|
||||
public static string CreateXPathQuery(string url, bool checkDomain)
|
||||
{
|
||||
|
||||
string _tempQuery = "";
|
||||
if (GlobalSettings.HideTopLevelNodeFromPath && checkDomain)
|
||||
{
|
||||
_tempQuery = "/root" + GetChildContainerName() + "/*";
|
||||
}
|
||||
else if (checkDomain)
|
||||
_tempQuery = "/root" + GetChildContainerName();
|
||||
|
||||
|
||||
string[] requestRawUrl = url.Split("/".ToCharArray());
|
||||
|
||||
// Check for Domain prefix
|
||||
string domainUrl = "";
|
||||
if (checkDomain && Domain.Exists(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]))
|
||||
{
|
||||
// we need to get the node based on domain
|
||||
INode n = new Node(Domain.GetRootFromDomain(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]));
|
||||
domainUrl = n.UrlName; // we don't use niceUrlFetch as we need more control
|
||||
if (n.Parent != null)
|
||||
{
|
||||
while (n.Parent != null)
|
||||
{
|
||||
n = n.Parent;
|
||||
domainUrl = n.UrlName + "/" + domainUrl;
|
||||
}
|
||||
}
|
||||
domainUrl = "/" + domainUrl;
|
||||
|
||||
// If at domain root
|
||||
if (url == "")
|
||||
{
|
||||
_tempQuery = "";
|
||||
requestRawUrl = domainUrl.Split("/".ToCharArray());
|
||||
HttpContext.Current.Trace.Write("requestHandler",
|
||||
"Redirecting to domain: " +
|
||||
HttpContext.Current.Request.ServerVariables["SERVER_NAME"] +
|
||||
", nodeId: " +
|
||||
Domain.GetRootFromDomain(
|
||||
HttpContext.Current.Request.ServerVariables["SERVER_NAME"]).
|
||||
ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
// if it matches a domain url, skip all other xpaths and use this!
|
||||
string langXpath = CreateXPathQuery(domainUrl + "/" + url, false);
|
||||
if (content.Instance.XmlContent.DocumentElement.SelectSingleNode(langXpath) != null)
|
||||
return langXpath;
|
||||
}
|
||||
}
|
||||
else if (url == "" && !GlobalSettings.HideTopLevelNodeFromPath)
|
||||
_tempQuery += "/*";
|
||||
|
||||
bool rootAdded = false;
|
||||
if (GlobalSettings.HideTopLevelNodeFromPath && requestRawUrl.Length == 1)
|
||||
{
|
||||
HttpContext.Current.Trace.Write("umbracoRequestHandler", "xpath: '" + _tempQuery + "'");
|
||||
if (_tempQuery == "")
|
||||
_tempQuery = "/root" + GetChildContainerName() + "/*";
|
||||
_tempQuery = "/root" + GetChildContainerName() + "/* [" + UrlName +
|
||||
" = \"" + requestRawUrl[0].Replace(".aspx", "").ToLower() + "\"] | " + _tempQuery;
|
||||
HttpContext.Current.Trace.Write("umbracoRequestHandler", "xpath: '" + _tempQuery + "'");
|
||||
rootAdded = true;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i <= requestRawUrl.GetUpperBound(0); i++)
|
||||
{
|
||||
if (requestRawUrl[i] != "")
|
||||
_tempQuery += GetChildContainerName() + "/* [" + UrlName + " = \"" + requestRawUrl[i].Replace(".aspx", "").ToLower() +
|
||||
"\"]";
|
||||
}
|
||||
|
||||
if (GlobalSettings.HideTopLevelNodeFromPath && requestRawUrl.Length == 2)
|
||||
{
|
||||
_tempQuery += " | " + PageXPathQueryStart + GetChildContainerName() + "/* [" + UrlName + " = \"" +
|
||||
requestRawUrl[1].Replace(".aspx", "").ToLower() + "\"]";
|
||||
}
|
||||
HttpContext.Current.Trace.Write("umbracoRequestHandler", "xpath: '" + _tempQuery + "'");
|
||||
|
||||
Debug.Write(_tempQuery + "(" + PageXPathQueryStart + ")");
|
||||
|
||||
if (checkDomain)
|
||||
return _tempQuery;
|
||||
else if (!rootAdded)
|
||||
return PageXPathQueryStart + _tempQuery;
|
||||
else
|
||||
return _tempQuery;
|
||||
}
|
||||
|
||||
private static string GetChildContainerName()
|
||||
{
|
||||
if (string.IsNullOrEmpty(UmbracoSettings.TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME) == false)
|
||||
return "/" + UmbracoSettings.TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME;
|
||||
return "";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
using System.Diagnostics;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using umbraco;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.interfaces;
|
||||
using umbraco.NodeFactory;
|
||||
|
||||
namespace OurUmbraco.Forum {
|
||||
public class iNotFoundHandler : umbraco.interfaces.INotFoundHandler {
|
||||
#region INotFoundHandler Members
|
||||
|
||||
private int _redirectID = -1;
|
||||
|
||||
public bool CacheUrl {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool Execute(string url) {
|
||||
|
||||
HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler","init");
|
||||
|
||||
bool _succes = false;
|
||||
url = url.Replace(".aspx", string.Empty);
|
||||
string currentDomain = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
|
||||
if (url.Length > 0) {
|
||||
if (url.Substring(0, 1) == "/")
|
||||
url = url.Substring(1, url.Length - 1);
|
||||
|
||||
XmlNode urlNode = null;
|
||||
string topicId = "";
|
||||
string topicTitle = "";
|
||||
|
||||
HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler url", url);
|
||||
|
||||
|
||||
// We're not at domain root
|
||||
if (url.IndexOf("/") != -1) {
|
||||
|
||||
string theRealUrl = url.Substring(0, url.LastIndexOf("/"));
|
||||
string realUrlXPath = CreateXPathQuery(theRealUrl, true);
|
||||
|
||||
urlNode = content.Instance.XmlContent.SelectSingleNode(realUrlXPath);
|
||||
topicTitle = url.Substring(url.LastIndexOf("/") + 1, url.Length - url.LastIndexOf(("/")) - 1).ToLower();
|
||||
topicId = topicTitle.Split('-')[0];
|
||||
topicTitle = topicTitle.Substring(topicTitle.IndexOf('-') + 1);
|
||||
|
||||
if(urlNode != null)
|
||||
HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler", topicId + " " + urlNode.Name);
|
||||
}
|
||||
|
||||
if (urlNode != null && topicId != "" && urlNode.Name == "Forum") {
|
||||
_redirectID = int.Parse(urlNode.Attributes.GetNamedItem("id").Value);
|
||||
|
||||
var cookie = new HttpCookie("altTemplate", "displaytopic");
|
||||
HttpContext.Current.Request.Cookies.Add(cookie);
|
||||
|
||||
HttpContext.Current.Items["altTemplate"] = "displaytopic";
|
||||
HttpContext.Current.Items["topicID"] = topicId;
|
||||
HttpContext.Current.Items["topicTitle"] = topicTitle.Replace('-',' ');
|
||||
|
||||
HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler",
|
||||
string.Format("Templated changed to: '{0}'",
|
||||
HttpContext.Current.Items["altTemplate"]));
|
||||
_succes = true;
|
||||
}
|
||||
}
|
||||
return _succes;
|
||||
}
|
||||
|
||||
public int redirectID {
|
||||
get {
|
||||
return _redirectID;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private const string PageXPathQueryStart = "/root";
|
||||
private const string UrlName = "@urlName";
|
||||
public static string CreateXPathQuery(string url, bool checkDomain)
|
||||
{
|
||||
|
||||
string _tempQuery = "";
|
||||
if (GlobalSettings.HideTopLevelNodeFromPath && checkDomain)
|
||||
{
|
||||
_tempQuery = "/root" + GetChildContainerName() + "/*";
|
||||
}
|
||||
else if (checkDomain)
|
||||
_tempQuery = "/root" + GetChildContainerName();
|
||||
|
||||
|
||||
string[] requestRawUrl = url.Split("/".ToCharArray());
|
||||
|
||||
// Check for Domain prefix
|
||||
string domainUrl = "";
|
||||
if (checkDomain && Domain.Exists(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]))
|
||||
{
|
||||
// we need to get the node based on domain
|
||||
INode n = new Node(Domain.GetRootFromDomain(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]));
|
||||
domainUrl = n.UrlName; // we don't use niceUrlFetch as we need more control
|
||||
if (n.Parent != null)
|
||||
{
|
||||
while (n.Parent != null)
|
||||
{
|
||||
n = n.Parent;
|
||||
domainUrl = n.UrlName + "/" + domainUrl;
|
||||
}
|
||||
}
|
||||
domainUrl = "/" + domainUrl;
|
||||
|
||||
// If at domain root
|
||||
if (url == "")
|
||||
{
|
||||
_tempQuery = "";
|
||||
requestRawUrl = domainUrl.Split("/".ToCharArray());
|
||||
HttpContext.Current.Trace.Write("requestHandler",
|
||||
"Redirecting to domain: " +
|
||||
HttpContext.Current.Request.ServerVariables["SERVER_NAME"] +
|
||||
", nodeId: " +
|
||||
Domain.GetRootFromDomain(
|
||||
HttpContext.Current.Request.ServerVariables["SERVER_NAME"]).
|
||||
ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
// if it matches a domain url, skip all other xpaths and use this!
|
||||
string langXpath = CreateXPathQuery(domainUrl + "/" + url, false);
|
||||
if (content.Instance.XmlContent.DocumentElement.SelectSingleNode(langXpath) != null)
|
||||
return langXpath;
|
||||
}
|
||||
}
|
||||
else if (url == "" && !GlobalSettings.HideTopLevelNodeFromPath)
|
||||
_tempQuery += "/*";
|
||||
|
||||
bool rootAdded = false;
|
||||
if (GlobalSettings.HideTopLevelNodeFromPath && requestRawUrl.Length == 1)
|
||||
{
|
||||
HttpContext.Current.Trace.Write("umbracoRequestHandler", "xpath: '" + _tempQuery + "'");
|
||||
if (_tempQuery == "")
|
||||
_tempQuery = "/root" + GetChildContainerName() + "/*";
|
||||
_tempQuery = "/root" + GetChildContainerName() + "/* [" + UrlName +
|
||||
" = \"" + requestRawUrl[0].Replace(".aspx", "").ToLower() + "\"] | " + _tempQuery;
|
||||
HttpContext.Current.Trace.Write("umbracoRequestHandler", "xpath: '" + _tempQuery + "'");
|
||||
rootAdded = true;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i <= requestRawUrl.GetUpperBound(0); i++)
|
||||
{
|
||||
if (requestRawUrl[i] != "")
|
||||
_tempQuery += GetChildContainerName() + "/* [" + UrlName + " = \"" + requestRawUrl[i].Replace(".aspx", "").ToLower() +
|
||||
"\"]";
|
||||
}
|
||||
|
||||
if (GlobalSettings.HideTopLevelNodeFromPath && requestRawUrl.Length == 2)
|
||||
{
|
||||
_tempQuery += " | " + PageXPathQueryStart + GetChildContainerName() + "/* [" + UrlName + " = \"" +
|
||||
requestRawUrl[1].Replace(".aspx", "").ToLower() + "\"]";
|
||||
}
|
||||
HttpContext.Current.Trace.Write("umbracoRequestHandler", "xpath: '" + _tempQuery + "'");
|
||||
|
||||
Debug.Write(_tempQuery + "(" + PageXPathQueryStart + ")");
|
||||
|
||||
if (checkDomain)
|
||||
return _tempQuery;
|
||||
else if (!rootAdded)
|
||||
return PageXPathQueryStart + _tempQuery;
|
||||
else
|
||||
return _tempQuery;
|
||||
}
|
||||
|
||||
private static string GetChildContainerName()
|
||||
{
|
||||
if (string.IsNullOrEmpty(UmbracoSettings.TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME) == false)
|
||||
return "/" + UmbracoSettings.TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME;
|
||||
return "";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,240 +1,240 @@
|
||||
/****** Object: Table [dbo].[umbracoNode] Script Date: 05/15/2009 05:27:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[umbracoNode](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[trashed] [bit] NOT NULL,
|
||||
[parentID] [int] NOT NULL,
|
||||
[nodeUser] [int] NULL,
|
||||
[level] [smallint] NOT NULL,
|
||||
[path] [nvarchar](150) COLLATE Danish_Norwegian_CI_AS NOT NULL,
|
||||
[sortOrder] [int] NOT NULL,
|
||||
[uniqueID] [uniqueidentifier] NULL,
|
||||
[text] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
|
||||
[nodeObjectType] [uniqueidentifier] NULL,
|
||||
[createDate] [datetime] NOT NULL,
|
||||
CONSTRAINT [PK_structure] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
)
|
||||
END
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND name = N'IX_umbracoNodeObjectType')
|
||||
CREATE NONCLUSTERED INDEX [IX_umbracoNodeObjectType] ON [dbo].[umbracoNode]
|
||||
(
|
||||
[nodeObjectType] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND name = N'IX_umbracoNodeParentId')
|
||||
CREATE NONCLUSTERED INDEX [IX_umbracoNodeParentId] ON [dbo].[umbracoNode]
|
||||
(
|
||||
[parentID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
GO
|
||||
/****** Object: Table [dbo].[forumForums] Script Date: 05/15/2009 05:27:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumForums]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[forumForums](
|
||||
[id] [int] NOT NULL,
|
||||
[latestTopic] [int] NOT NULL,
|
||||
[latestComment] [int] NOT NULL,
|
||||
[totalTopics] [int] NOT NULL,
|
||||
[totalComments] [int] NOT NULL,
|
||||
[latestAuthor] [int] NOT NULL,
|
||||
[latestPostDate] [datetime] NOT NULL,
|
||||
[sortOrder] [int] NOT NULL,
|
||||
[parentId] [int] NOT NULL,
|
||||
CONSTRAINT [PK_forumForums] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
)
|
||||
END
|
||||
GO
|
||||
/****** Object: Table [dbo].[forumTopics] Script Date: 05/15/2009 05:27:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumTopics]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[forumTopics](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[parentId] [int] NOT NULL,
|
||||
[memberId] [int] NOT NULL,
|
||||
[title] [nvarchar](70) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
[body] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
[created] [datetime] NOT NULL,
|
||||
[updated] [datetime] NOT NULL,
|
||||
[locked] [bit] NOT NULL,
|
||||
[latestReplyAuthor] [int] NOT NULL,
|
||||
[isSpam] [bit] NULL
|
||||
CONSTRAINT [PK_forumTopics] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
)
|
||||
END
|
||||
GO
|
||||
/****** Object: Table [dbo].[forumComments] Script Date: 05/15/2009 05:27:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumComments]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[forumComments](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[topicId] [int] NOT NULL,
|
||||
[memberId] [int] NOT NULL,
|
||||
[body] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
[created] [datetime] NOT NULL,
|
||||
[isSpam] [bit] NULL
|
||||
CONSTRAINT [PK_forumComments] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
)
|
||||
END
|
||||
GO
|
||||
/****** Object: Default [DF_forumTopics_created] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_created]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_created] DEFAULT (getdate()) FOR [created]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumTopics_updated] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_updated]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_updated] DEFAULT (getdate()) FOR [updated]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumTopics_locked] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_locked]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_locked] DEFAULT ((0)) FOR [locked]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumTopics_latestReplyAuthor] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_latestReplyAuthor]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_latestReplyAuthor] DEFAULT ((0)) FOR [latestReplyAuthor]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_latestTopic] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestTopic]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestTopic] DEFAULT ((0)) FOR [latestTopic]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_latestComment] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestComment]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestComment] DEFAULT ((0)) FOR [latestComment]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_totalTopics] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_totalTopics]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_totalTopics] DEFAULT ((0)) FOR [totalTopics]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_totalComments] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_totalComments]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_totalComments] DEFAULT ((0)) FOR [totalComments]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_latestAuthor] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestAuthor]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestAuthor] DEFAULT ((0)) FOR [latestAuthor]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_latestPostDate] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestPostDate]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestPostDate] DEFAULT (getdate()) FOR [latestPostDate]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_sortOrder] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_sortOrder]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_sortOrder] DEFAULT ((0)) FOR [sortOrder]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumComments_created] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumComments_created]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumComments]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumComments] ADD CONSTRAINT [DF_forumComments_created] DEFAULT (getdate()) FOR [created]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_umbracoNode_trashed] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_umbracoNode_trashed]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[umbracoNode] ADD CONSTRAINT [DF_umbracoNode_trashed] DEFAULT ((0)) FOR [trashed]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_umbracoNode_createDate] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_umbracoNode_createDate]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[umbracoNode] ADD CONSTRAINT [DF_umbracoNode_createDate] DEFAULT (getdate()) FOR [createDate]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: ForeignKey [FK_forumTopics_umbracoNode1] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_forumTopics_umbracoNode1]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
ALTER TABLE [dbo].[forumTopics] WITH CHECK ADD CONSTRAINT [FK_forumTopics_umbracoNode1] FOREIGN KEY([parentId])
|
||||
REFERENCES [dbo].[umbracoNode] ([id])
|
||||
ON DELETE CASCADE
|
||||
GO
|
||||
ALTER TABLE [dbo].[forumTopics] CHECK CONSTRAINT [FK_forumTopics_umbracoNode1]
|
||||
GO
|
||||
/****** Object: ForeignKey [FK_forumComments_forumTopics] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_forumComments_forumTopics]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumComments]'))
|
||||
ALTER TABLE [dbo].[forumComments] WITH CHECK ADD CONSTRAINT [FK_forumComments_forumTopics] FOREIGN KEY([topicId])
|
||||
REFERENCES [dbo].[forumTopics] ([id])
|
||||
ON DELETE CASCADE
|
||||
GO
|
||||
ALTER TABLE [dbo].[forumComments] CHECK CONSTRAINT [FK_forumComments_forumTopics]
|
||||
GO
|
||||
/****** Object: ForeignKey [FK_umbracoNode_umbracoNode] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_umbracoNode_umbracoNode]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
|
||||
ALTER TABLE [dbo].[umbracoNode] WITH CHECK ADD CONSTRAINT [FK_umbracoNode_umbracoNode] FOREIGN KEY([parentID])
|
||||
REFERENCES [dbo].[umbracoNode] ([id])
|
||||
GO
|
||||
ALTER TABLE [dbo].[umbracoNode] CHECK CONSTRAINT [FK_umbracoNode_umbracoNode]
|
||||
GO
|
||||
CREATE TABLE [dbo].[cmsTagToTopic](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[tagId] [int] NOT NULL,
|
||||
[topicId] [int] NOT NULL,
|
||||
[weight] [float] NOT NULL,
|
||||
CONSTRAINT [PK_cmsTagToTopic] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
/****** Object: Table [dbo].[umbracoNode] Script Date: 05/15/2009 05:27:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[umbracoNode](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[trashed] [bit] NOT NULL,
|
||||
[parentID] [int] NOT NULL,
|
||||
[nodeUser] [int] NULL,
|
||||
[level] [smallint] NOT NULL,
|
||||
[path] [nvarchar](150) COLLATE Danish_Norwegian_CI_AS NOT NULL,
|
||||
[sortOrder] [int] NOT NULL,
|
||||
[uniqueID] [uniqueidentifier] NULL,
|
||||
[text] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
|
||||
[nodeObjectType] [uniqueidentifier] NULL,
|
||||
[createDate] [datetime] NOT NULL,
|
||||
CONSTRAINT [PK_structure] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
)
|
||||
END
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND name = N'IX_umbracoNodeObjectType')
|
||||
CREATE NONCLUSTERED INDEX [IX_umbracoNodeObjectType] ON [dbo].[umbracoNode]
|
||||
(
|
||||
[nodeObjectType] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[umbracoNode]') AND name = N'IX_umbracoNodeParentId')
|
||||
CREATE NONCLUSTERED INDEX [IX_umbracoNodeParentId] ON [dbo].[umbracoNode]
|
||||
(
|
||||
[parentID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
GO
|
||||
/****** Object: Table [dbo].[forumForums] Script Date: 05/15/2009 05:27:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumForums]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[forumForums](
|
||||
[id] [int] NOT NULL,
|
||||
[latestTopic] [int] NOT NULL,
|
||||
[latestComment] [int] NOT NULL,
|
||||
[totalTopics] [int] NOT NULL,
|
||||
[totalComments] [int] NOT NULL,
|
||||
[latestAuthor] [int] NOT NULL,
|
||||
[latestPostDate] [datetime] NOT NULL,
|
||||
[sortOrder] [int] NOT NULL,
|
||||
[parentId] [int] NOT NULL,
|
||||
CONSTRAINT [PK_forumForums] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
)
|
||||
END
|
||||
GO
|
||||
/****** Object: Table [dbo].[forumTopics] Script Date: 05/15/2009 05:27:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumTopics]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[forumTopics](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[parentId] [int] NOT NULL,
|
||||
[memberId] [int] NOT NULL,
|
||||
[title] [nvarchar](70) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
[body] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
[created] [datetime] NOT NULL,
|
||||
[updated] [datetime] NOT NULL,
|
||||
[locked] [bit] NOT NULL,
|
||||
[latestReplyAuthor] [int] NOT NULL,
|
||||
[isSpam] [bit] NULL
|
||||
CONSTRAINT [PK_forumTopics] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
)
|
||||
END
|
||||
GO
|
||||
/****** Object: Table [dbo].[forumComments] Script Date: 05/15/2009 05:27:55 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[forumComments]') AND type in (N'U'))
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[forumComments](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[topicId] [int] NOT NULL,
|
||||
[memberId] [int] NOT NULL,
|
||||
[body] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
[created] [datetime] NOT NULL,
|
||||
[isSpam] [bit] NULL
|
||||
CONSTRAINT [PK_forumComments] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
)
|
||||
END
|
||||
GO
|
||||
/****** Object: Default [DF_forumTopics_created] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_created]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_created] DEFAULT (getdate()) FOR [created]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumTopics_updated] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_updated]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_updated] DEFAULT (getdate()) FOR [updated]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumTopics_locked] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_locked]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_locked] DEFAULT ((0)) FOR [locked]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumTopics_latestReplyAuthor] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumTopics_latestReplyAuthor]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumTopics] ADD CONSTRAINT [DF_forumTopics_latestReplyAuthor] DEFAULT ((0)) FOR [latestReplyAuthor]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_latestTopic] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestTopic]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestTopic] DEFAULT ((0)) FOR [latestTopic]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_latestComment] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestComment]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestComment] DEFAULT ((0)) FOR [latestComment]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_totalTopics] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_totalTopics]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_totalTopics] DEFAULT ((0)) FOR [totalTopics]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_totalComments] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_totalComments]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_totalComments] DEFAULT ((0)) FOR [totalComments]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_latestAuthor] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestAuthor]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestAuthor] DEFAULT ((0)) FOR [latestAuthor]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_latestPostDate] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_latestPostDate]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_latestPostDate] DEFAULT (getdate()) FOR [latestPostDate]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumForums_sortOrder] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumForums_sortOrder]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumForums]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumForums] ADD CONSTRAINT [DF_forumForums_sortOrder] DEFAULT ((0)) FOR [sortOrder]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_forumComments_created] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_forumComments_created]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumComments]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[forumComments] ADD CONSTRAINT [DF_forumComments_created] DEFAULT (getdate()) FOR [created]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_umbracoNode_trashed] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_umbracoNode_trashed]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[umbracoNode] ADD CONSTRAINT [DF_umbracoNode_trashed] DEFAULT ((0)) FOR [trashed]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: Default [DF_umbracoNode_createDate] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_umbracoNode_createDate]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
|
||||
Begin
|
||||
ALTER TABLE [dbo].[umbracoNode] ADD CONSTRAINT [DF_umbracoNode_createDate] DEFAULT (getdate()) FOR [createDate]
|
||||
|
||||
End
|
||||
GO
|
||||
/****** Object: ForeignKey [FK_forumTopics_umbracoNode1] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_forumTopics_umbracoNode1]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumTopics]'))
|
||||
ALTER TABLE [dbo].[forumTopics] WITH CHECK ADD CONSTRAINT [FK_forumTopics_umbracoNode1] FOREIGN KEY([parentId])
|
||||
REFERENCES [dbo].[umbracoNode] ([id])
|
||||
ON DELETE CASCADE
|
||||
GO
|
||||
ALTER TABLE [dbo].[forumTopics] CHECK CONSTRAINT [FK_forumTopics_umbracoNode1]
|
||||
GO
|
||||
/****** Object: ForeignKey [FK_forumComments_forumTopics] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_forumComments_forumTopics]') AND parent_object_id = OBJECT_ID(N'[dbo].[forumComments]'))
|
||||
ALTER TABLE [dbo].[forumComments] WITH CHECK ADD CONSTRAINT [FK_forumComments_forumTopics] FOREIGN KEY([topicId])
|
||||
REFERENCES [dbo].[forumTopics] ([id])
|
||||
ON DELETE CASCADE
|
||||
GO
|
||||
ALTER TABLE [dbo].[forumComments] CHECK CONSTRAINT [FK_forumComments_forumTopics]
|
||||
GO
|
||||
/****** Object: ForeignKey [FK_umbracoNode_umbracoNode] Script Date: 05/15/2009 05:27:55 ******/
|
||||
IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_umbracoNode_umbracoNode]') AND parent_object_id = OBJECT_ID(N'[dbo].[umbracoNode]'))
|
||||
ALTER TABLE [dbo].[umbracoNode] WITH CHECK ADD CONSTRAINT [FK_umbracoNode_umbracoNode] FOREIGN KEY([parentID])
|
||||
REFERENCES [dbo].[umbracoNode] ([id])
|
||||
GO
|
||||
ALTER TABLE [dbo].[umbracoNode] CHECK CONSTRAINT [FK_umbracoNode_umbracoNode]
|
||||
GO
|
||||
CREATE TABLE [dbo].[cmsTagToTopic](
|
||||
[id] [int] IDENTITY(1,1) NOT NULL,
|
||||
[tagId] [int] NOT NULL,
|
||||
[topicId] [int] NOT NULL,
|
||||
[weight] [float] NOT NULL,
|
||||
CONSTRAINT [PK_cmsTagToTopic] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
@@ -109,6 +109,10 @@
|
||||
<HintPath>..\packages\MarkdownDeep.NET.1.5\lib\.NetFramework 3.5\MarkdownDeep.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="MarkdownSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.2.8-build103\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@@ -157,6 +161,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
@@ -261,6 +266,31 @@
|
||||
<Compile Include="Events\Models\Event.cs" />
|
||||
<Compile Include="Events\Relations\Event.cs" />
|
||||
<Compile Include="Events\Relations\EventRelation.cs" />
|
||||
<Compile Include="Forum\AntiSpam\SpamChecker.cs" />
|
||||
<Compile Include="Forum\Api\ForumController.cs" />
|
||||
<Compile Include="Forum\Api\ForumControllerBase.cs" />
|
||||
<Compile Include="Forum\Api\PublicForumController.cs" />
|
||||
<Compile Include="Forum\Api\TopicController.cs" />
|
||||
<Compile Include="Forum\EventHandlers\MemberApprovedEventhandler.cs" />
|
||||
<Compile Include="Forum\EventHandlers\NewForumHandler.cs" />
|
||||
<Compile Include="Forum\Events.cs" />
|
||||
<Compile Include="Forum\Extensions\EventExtensions.cs" />
|
||||
<Compile Include="Forum\Extensions\ForumExtensions.cs" />
|
||||
<Compile Include="Forum\Extensions\MemberForumExtensions.cs" />
|
||||
<Compile Include="Forum\iNotFoundHandler.cs" />
|
||||
<Compile Include="Forum\Library\Utils.cs" />
|
||||
<Compile Include="Forum\Models\Comment.cs" />
|
||||
<Compile Include="Forum\Models\CommentSaveModel.cs" />
|
||||
<Compile Include="Forum\Models\Forum.cs" />
|
||||
<Compile Include="Forum\Models\ReadOnlyComment.cs" />
|
||||
<Compile Include="Forum\Models\ReadOnlyTopic.cs" />
|
||||
<Compile Include="Forum\Models\Topic.cs" />
|
||||
<Compile Include="Forum\Models\TopicCommentRelator.cs" />
|
||||
<Compile Include="Forum\Models\TopicSaveModel.cs" />
|
||||
<Compile Include="Forum\Services\CommentService.cs" />
|
||||
<Compile Include="Forum\Services\ForumService.cs" />
|
||||
<Compile Include="Forum\Services\TopicService.cs" />
|
||||
<Compile Include="Forum\Singleton.cs" />
|
||||
<Compile Include="Powers\Api\PowersController.cs" />
|
||||
<Compile Include="Powers\Buddha\Buddha.cs" />
|
||||
<Compile Include="Powers\BusinessLogic\Action.cs" />
|
||||
@@ -316,6 +346,7 @@
|
||||
<Compile Include="Wiki\WikiFileUploadHandler.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Forum\setuptables.sql" />
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
<Content Include="Powers\uPowers.config" />
|
||||
@@ -327,7 +358,6 @@
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Forum\" />
|
||||
<Folder Include="Repository\webservices\App_Data\" />
|
||||
<Folder Include="Wiki\usercontrols\scripts\" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Web.Hosting;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Script.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using OurUmbraco.Release.Controllers;
|
||||
using OurUmbraco.Release.Models;
|
||||
using RestSharp;
|
||||
using umbraco.NodeFactory;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<package id="JsonFx" version="2.0.1209.2802" targetFramework="net451" />
|
||||
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net451" />
|
||||
<package id="MarkdownDeep.NET" version="1.5" targetFramework="net451" />
|
||||
<package id="MarkdownSharp" version="1.13.0.0" targetFramework="net451" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net451" />
|
||||
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" targetFramework="net451" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net451" />
|
||||
|
||||
@@ -11,8 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
our.umbraco.org.vsmdi = our.umbraco.org.vsmdi
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "uForum", "uForum\uForum.csproj", "{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "our.umbraco.org", "our.umbraco.org\our.umbraco.org.csproj", "{A625544F-660A-4C01-BA49-1B467D0322D9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notification", "Notification\Notification.csproj", "{80E5F59D-A7A0-4CEE-AEB6-6C626C44B2B2}"
|
||||
@@ -50,16 +48,6 @@ Global
|
||||
{911907FB-3B9D-4E5F-9A45-16700A451A54}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{911907FB-3B9D-4E5F-9A45-16700A451A54}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{911907FB-3B9D-4E5F-9A45-16700A451A54}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A625544F-660A-4C01-BA49-1B467D0322D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A625544F-660A-4C01-BA49-1B467D0322D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A625544F-660A-4C01-BA49-1B467D0322D9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
|
||||
@@ -9,8 +9,7 @@ using System.Threading.Tasks;
|
||||
using Examine.SearchCriteria;
|
||||
using Lucene.Net.Documents;
|
||||
using our.Models;
|
||||
using uForum;
|
||||
using uForum.Extensions;
|
||||
using OurUmbraco.Forum.Extensions;
|
||||
using Umbraco.Web.WebApi;
|
||||
|
||||
namespace our.Api
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using OurUmbraco.Powers.BusinessLogic;
|
||||
using OurUmbraco.Powers.Library;
|
||||
using uForum.Services;
|
||||
using Umbraco.Core;
|
||||
using Action = OurUmbraco.Powers.BusinessLogic.Action;
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using Examine.LuceneEngine;
|
||||
using Examine.LuceneEngine.Providers;
|
||||
using our.Examine;
|
||||
using OurUmbraco.Forum;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using Umbraco.Core;
|
||||
//WB Added
|
||||
|
||||
@@ -13,19 +15,19 @@ namespace our.CustomHandlers
|
||||
|
||||
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
|
||||
{
|
||||
uForum.Services.TopicService.Created += TopicService_Updated;
|
||||
uForum.Services.TopicService.Updated += TopicService_Updated;
|
||||
uForum.Services.TopicService.Deleting += TopicService_Deleted;
|
||||
TopicService.Created += TopicService_Updated;
|
||||
TopicService.Updated += TopicService_Updated;
|
||||
TopicService.Deleting += TopicService_Deleted;
|
||||
}
|
||||
|
||||
|
||||
void TopicService_Deleted(object sender, uForum.TopicEventArgs e)
|
||||
void TopicService_Deleted(object sender, TopicEventArgs e)
|
||||
{
|
||||
var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection["ForumIndexer"];
|
||||
indexer.DeleteFromIndex(e.Topic.Id.ToString());
|
||||
}
|
||||
|
||||
void TopicService_Updated(object sender, uForum.TopicEventArgs e)
|
||||
void TopicService_Updated(object sender, TopicEventArgs e)
|
||||
{
|
||||
var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection["ForumIndexer"];
|
||||
var dataSet = ((ForumDataService)indexer.DataService).CreateNewDocument(e.Topic.Id);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using OurUmbraco.Powers.BusinessLogic;
|
||||
using uForum;
|
||||
using uForum.Extensions;
|
||||
using uForum.Services;
|
||||
using OurUmbraco.Forum;
|
||||
using OurUmbraco.Forum.Extensions;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using OurUmbraco.Powers.BusinessLogic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace our.CustomHandlers {
|
||||
CommentService.Created += CommentService_Created;
|
||||
}
|
||||
|
||||
void CommentService_Created(object sender, uForum.CommentEventArgs e)
|
||||
void CommentService_Created(object sender, CommentEventArgs e)
|
||||
{
|
||||
if (e.Comment != null && e.Comment.MemberId > 0)
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace our.CustomHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
void TopicService_Created(object sender, uForum.TopicEventArgs e)
|
||||
void TopicService_Created(object sender, TopicEventArgs e)
|
||||
{
|
||||
if (e.Topic != null && e.Topic.MemberId > 0)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Security;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using OurUmbraco.Powers.BusinessLogic;
|
||||
using OurUmbraco.Powers.Library;
|
||||
using uForum.Services;
|
||||
using Umbraco.Core;
|
||||
using Action = OurUmbraco.Powers.BusinessLogic.Action;
|
||||
|
||||
|
||||
@@ -4,11 +4,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Examine;
|
||||
using Examine.LuceneEngine;
|
||||
using uForum.Models;
|
||||
using uForum.Services;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using OurUmbraco.Forum.Services;
|
||||
//WB Added
|
||||
|
||||
using uForum;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace our.Examine
|
||||
|
||||
@@ -422,10 +422,6 @@
|
||||
<Project>{a8e5c936-ecab-45b3-bfda-d12f680eb2a6}</Project>
|
||||
<Name>OurUmbraco</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\uForum\uForum.csproj">
|
||||
<Project>{547C2D0D-1B55-493B-AE0B-E031A5B8EE77}</Project>
|
||||
<Name>uForum</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="usercontrols\EventEditor.ascx">
|
||||
|
||||
@@ -4,8 +4,8 @@ using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using uForum.Models;
|
||||
using uForum.Services;
|
||||
using OurUmbraco.Forum.Models;
|
||||
using OurUmbraco.Forum.Services;
|
||||
using umbraco.cms.businesslogic.member;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.presentation.nodeFactory;
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace our.usercontrols
|
||||
memberService.Save(currentMember);
|
||||
memberService.SavePassword(currentMember, tb_password.Text);
|
||||
|
||||
uForum.Library.Utils.CheckForSpam(currentMember);
|
||||
OurUmbraco.Forum.Library.Utils.CheckForSpam(currentMember);
|
||||
|
||||
Response.Redirect(library.NiceUrl(NextPage));
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace our.usercontrols
|
||||
if (member == null)
|
||||
{
|
||||
// If spammer then this will stop account creation
|
||||
var spamResult = uForum.Library.Utils.CheckForSpam(tb_email.Text, tb_name.Text, true);
|
||||
var spamResult = OurUmbraco.Forum.Library.Utils.CheckForSpam(tb_email.Text, tb_name.Text, true);
|
||||
if (spamResult != null && spamResult.Blocked)
|
||||
return;
|
||||
|
||||
@@ -140,12 +140,12 @@ namespace our.usercontrols
|
||||
spamResult.MemberId = member.Id;
|
||||
|
||||
memberService.AssignRole(member.Id, "potentialspam");
|
||||
uForum.Library.Utils.SendPotentialSpamMemberMail(spamResult);
|
||||
OurUmbraco.Forum.Library.Utils.SendPotentialSpamMemberMail(spamResult);
|
||||
}
|
||||
else
|
||||
{
|
||||
uForum.Library.Utils.SendActivationMail(member);
|
||||
uForum.Library.Utils.SendMemberSignupMail(member);
|
||||
OurUmbraco.Forum.Library.Utils.SendActivationMail(member);
|
||||
OurUmbraco.Forum.Library.Utils.SendMemberSignupMail(member);
|
||||
}
|
||||
memberService.AssignRole(member.Id, "notactivated");
|
||||
|
||||
|
||||
@@ -247,39 +247,11 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AntiSpam\SpamChecker.cs" />
|
||||
<Compile Include="Api\ForumController.cs" />
|
||||
<Compile Include="Api\ForumControllerBase.cs" />
|
||||
<Compile Include="Api\PublicForumController.cs" />
|
||||
<Compile Include="Api\TopicController.cs" />
|
||||
<Compile Include="EventHandlers\MemberApprovedEventhandler.cs" />
|
||||
<Compile Include="Extensions\EventExtensions.cs" />
|
||||
<Compile Include="Events.cs" />
|
||||
<Compile Include="Extensions\ForumExtensions.cs" />
|
||||
<Compile Include="iNotFoundHandler.cs" />
|
||||
<Compile Include="Library\Utils.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Extensions\MemberForumExtensions.cs" />
|
||||
<Compile Include="Models\Comment.cs" />
|
||||
<Compile Include="Models\CommentSaveModel.cs" />
|
||||
<Compile Include="Models\Forum.cs" />
|
||||
<Compile Include="Models\ReadOnlyComment.cs" />
|
||||
<Compile Include="Models\ReadOnlyTopic.cs" />
|
||||
<Compile Include="Models\Topic.cs" />
|
||||
<Compile Include="Models\TopicCommentRelator.cs" />
|
||||
<Compile Include="Models\TopicSaveModel.cs" />
|
||||
<Compile Include="EventHandlers\NewForumHandler.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\CommentService.cs" />
|
||||
<Compile Include="Services\ForumService.cs" />
|
||||
<Compile Include="Services\TopicService.cs" />
|
||||
<Compile Include="Singleton.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="setuptables.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||
|
||||
Reference in New Issue
Block a user