Initial commit of our WIP

This is very likely break the dev site
This commit is contained in:
ploug@umbraco.dk
2015-01-26 13:13:06 +01:00
parent 12f9dd9da6
commit 56a2ace7d2
120 changed files with 2877 additions and 6688 deletions
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using uForum.Businesslogic;
using uForum.Models;
using System.Data.SqlClient;
using umbraco.cms.businesslogic.member;
using umbraco.presentation.nodeFactory;
@@ -3,10 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using uForum.Businesslogic;
using uForum.Models;
using System.Data.SqlClient;
using umbraco.cms.businesslogic.member;
using System.Web;
using Umbraco.Core.Models;
namespace NotificationsCore.NotificationTypes
{
@@ -22,43 +23,44 @@ namespace NotificationsCore.NotificationTypes
try
{
Comment com = (Comment)args[0];
Topic topic = (Topic)args[1];
IMember mem = (IMember)args[2];
if (com.IsSpam)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, string.Format("[Notifications] Comment Id {{0}} is marked as spam, no notification sent{0}", com.Id));
return true;
}
//SMTP SETTINGS
SmtpClient c = new SmtpClient(details.SelectSingleNode("//smtp").InnerText);
c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);
//SENDER ADDRESS
MailAddress from = new MailAddress(
details.SelectSingleNode("//from/email").InnerText,
details.SelectSingleNode("//from/name").InnerText);
var subject = details.SelectSingleNode("//subject").InnerText;
var body = details.SelectSingleNode("//body").InnerText;
var topic = Topic.GetTopic(com.TopicId);
subject = string.Format(subject, topic.Title);
var member = (Member)args[2];
//Notification details
var domain = details.SelectSingleNode("//domain").InnerText;
var subject = string.Format(details.SelectSingleNode("//subject").InnerText, topic.Title);
var body = details.SelectSingleNode("//body").InnerText;
body = string.Format(body, topic.Title, "http://" + domain + args[1], mem.Name, HttpUtility.HtmlDecode(umbraco.library.StripHtml(com.Body)));
body = string.Format(body, topic.Title, "http://" + domain + args[1], member.Text, HttpUtility.HtmlDecode(umbraco.library.StripHtml(com.Body)));
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);
//connect to DB
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);
SqlCommand comm = new SqlCommand("Select memberId from forumTopicSubscribers where topicId = @topicId", conn);
comm.Parameters.AddWithValue("@topicId", topic.Id);
conn.Open();
SqlDataReader dr = comm.ExecuteReader();
//shit this must be so fucking slow
SqlDataReader dr = comm.ExecuteReader();
while (dr.Read())
{
int mid = dr.GetInt32(0);
try
{
+2 -2
View File
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Web;
using uForum.Businesslogic;
namespace NotificationsWeb.BusinessLogic
{
@@ -34,6 +33,7 @@ namespace NotificationsWeb.BusinessLogic
}
/*
public static List<uForum.Businesslogic.Forum> GetSubscribedForums(int memberId)
{
List<uForum.Businesslogic.Forum> lt = new List<uForum.Businesslogic.Forum>();
@@ -64,6 +64,6 @@ namespace NotificationsWeb.BusinessLogic
}
dr.Close();
return lt;
}
}*/
}
}
+38 -107
View File
@@ -1,144 +1,75 @@
using System;
using System.Collections.Generic;
using System.Text;
using uForum.Businesslogic;
using NotificationsCore;
using umbraco.presentation.nodeFactory;
using umbraco.cms.businesslogic.member;
using Umbraco.Core;
using uForum.Services;
using uForum;
namespace NotificationsWeb.EventHandlers
{
public class Forum : umbraco.BusinessLogic.ApplicationBase
public class Forum : ApplicationEventHandler
{
public Forum()
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "NotificationsWeb.EventHandlers.Forum class events - starting");
//sub comment author to topic
CommentService.Created += CommentService_Created;
Comment.AfterCreate += new EventHandler<CreateEventArgs>(Comment_AfterCreate);
//sub owner to topic
TopicService.Created += TopicService_Created;
Topic.AfterCreate += new EventHandler<CreateEventArgs>(Topic_AfterCreate);
//If its a project forum, subscribe the owner to all topics
ForumService.Created += ForumService_Created;
uForum.Businesslogic.Forum.AfterCreate += new EventHandler<CreateEventArgs>(Forum_AfterCreate);
uForum.Businesslogic.Forum.BeforeDelete += new EventHandler<DeleteEventArgs>(Forum_BeforeDelete);
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "NotificationsWeb.EventHandlers.Forum class events - finishing");
//remove all forum subs
ForumService.Deleted += ForumService_Deleted;
}
void Forum_BeforeDelete(object sender, DeleteEventArgs e)
void ForumService_Deleted(object sender, uForum.ForumEventArgs e)
{
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "Forum_BeforeDelete in NotificationsWeb.EventHandlers.Forum() class is starting");
BusinessLogic.Forum.RemoveAllSubscriptions(((uForum.Businesslogic.Forum)sender).Id);
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "Forum_BeforeDelete in NotificationsWeb.EventHandlers.Forum() class is finishing");
BusinessLogic.Forum.RemoveAllSubscriptions(e.Forum.Id);
}
void Forum_AfterCreate(object sender, CreateEventArgs e)
void ForumService_Created(object sender, uForum.ForumEventArgs e)
{
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "Forum_AfterCreate in NotificationsWeb.EventHandlers.Forum() class is starting");
//subscribe project owner to created forum
uForum.Businesslogic.Forum f = (uForum.Businesslogic.Forum)sender;
Node n = new Node(f.ParentId);
if (n.NodeTypeAlias == "Project")
var content = Umbraco.Web.UmbracoContext.Current.Application.Services.ContentService.GetById(e.Forum.ParentId);
if (content.ContentType.Alias == "Project")
{
NotificationsWeb.BusinessLogic.Forum.Subscribe(
f.Id, Convert.ToInt32(n.GetProperty("owner").Value));
var owner = content.GetValue<int>("owner");
NotificationsWeb.BusinessLogic.Forum.Subscribe(e.Forum.Id, owner);
}
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "Forum_AfterCreate in NotificationsWeb.EventHandlers.Forum() class is finishing");
}
void Comment_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e)
void TopicService_Created(object sender, uForum.TopicEventArgs e)
{
Comment c = (Comment)sender;
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, c.Id, "Comment_AfterCreate in NotificationsWeb.EventHandlers.Forum() class is starting");
NotificationsWeb.BusinessLogic.ForumTopic.Subscribe
(c.TopicId, c.MemberId);
//send notifications
InstantNotification not = new InstantNotification();
Member m = new Member(c.MemberId);
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewComment", c, NiceCommentUrl(c.TopicId,c,10),m);
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, c.Id, "Comment_AfterCreate in NotificationsWeb.EventHandlers.Forum() class is finishing");
}
private static string NiceCommentUrl(int topicId, Comment c, int itemsPerPage)
{
string url = uForum.Library.Xslt.NiceTopicUrl(topicId);
if (!string.IsNullOrEmpty(url))
{
int position = c.Position - 1;
int page = (int)(position / itemsPerPage);
url += "?p=" + page.ToString() + "#comment" + c.Id.ToString();
}
return url;
}
void Topic_AfterCreate(object sender, CreateEventArgs e)
{
//subscribe topic created to notification
Topic t = (Topic)sender;
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, t.Id, "Topic_AfterCreate in NotificationsWeb.EventHandlers.Forum() class is starting");
NotificationsWeb.BusinessLogic.ForumTopic.Subscribe
(t.Id, t.MemberId);
Member m = new Member(t.MemberId);
NotificationsWeb.BusinessLogic.ForumTopic.Subscribe(e.Topic.Id, e.Topic.MemberId);
//send notification
InstantNotification not = new InstantNotification();
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewTopic", t, NiceTopicUrl(t),m);
//data for notification:
var member = e.Topic.AuthorAsMember();
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, t.Id, "Topic_AfterCreate in NotificationsWeb.EventHandlers.Forum() class is finishing");
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewTopic", e.Topic, member);
}
private static string NiceTopicUrl(Topic t)
void CommentService_Created(object sender, uForum.CommentEventArgs e)
{
if (t.Exists)
{
string _url = umbraco.library.NiceUrl(t.ParentId);
//Subscribe to topic
NotificationsWeb.BusinessLogic.ForumTopic.Subscribe(e.Comment.TopicId, e.Comment.MemberId);
if (umbraco.GlobalSettings.UseDirectoryUrls)
{
return "/" + _url.Trim('/') + "/" + t.Id.ToString() + "-" + t.UrlName;
}
else
{
return "/" + _url.Substring(0, _url.LastIndexOf('.')).Trim('/') + "/" + t.Id.ToString() + "-" + t.UrlName + ".aspx";
}
}
else
{
return "";
}
//data for notification:
var member = e.Comment.AuthorAsMember();
var topic = TopicService.Instance.GetById(e.Comment.TopicId);
//send notifications
InstantNotification not = new InstantNotification();
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "NewComment", e.Comment, topic, member);
}
}
}
-56
View File
@@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.XPath;
using System.Xml;
using NotificationsWeb.BusinessLogic;
namespace NotificationsWeb.Library
{
[Umbraco.Core.Macros.XsltExtension("Notifications")]
public class Xslt
{
public static bool IsSubscribedToForum(int forumId, int memberId)
{
return (BusinessLogic.Data.SqlHelper.ExecuteScalar<int>("SELECT 1 FROM forumSubscribers WHERE forumId = @forumId and memberId = @memberId",
BusinessLogic.Data.SqlHelper.CreateParameter("@forumId", forumId),
BusinessLogic.Data.SqlHelper.CreateParameter("@memberId", memberId)) > 0);
}
public static bool IsSubscribedToForumTopic(int topicId, int memberId)
{
return (BusinessLogic.Data.SqlHelper.ExecuteScalar<int>("SELECT 1 FROM forumTopicSubscribers WHERE topicId = @topicId and memberId = @memberId",
BusinessLogic.Data.SqlHelper.CreateParameter("@topicId", topicId),
BusinessLogic.Data.SqlHelper.CreateParameter("@memberId", memberId)) > 0);
}
public static XPathNodeIterator SubscribedForums(int memberId)
{
XmlDocument xd = new XmlDocument();
XmlNode x = xd.CreateElement("forums");
List<uForum.Businesslogic.Forum> forums = ForumTopic.GetSubscribedForums(memberId);
foreach (uForum.Businesslogic.Forum f in forums)
{
x.AppendChild(f.ToXml(xd,false));
}
return x.CreateNavigator().Select(".");
}
public static XPathNodeIterator SubscribedTopics(int memberId)
{
XmlDocument xd = new XmlDocument();
XmlNode x = xd.CreateElement("topics");
List<uForum.Businesslogic.Topic> topics = ForumTopic.GetSubscribedTopics(memberId);
foreach (uForum.Businesslogic.Topic t in topics)
{
x.AppendChild(t.ToXml(xd));
}
return x.CreateNavigator().Select(".");
}
}
}
+3 -1
View File
@@ -238,7 +238,6 @@
<Compile Include="BusinessLogic\ForumTopic.cs" />
<Compile Include="Config.cs" />
<Compile Include="EventHandlers\Forum.cs" />
<Compile Include="Library\Xslt.cs" />
<Compile Include="Pages\SheduledTaskTrigger.aspx.cs">
<DependentUpon>SheduledTaskTrigger.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -267,6 +266,9 @@
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Library\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
@@ -6,8 +6,8 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using NotificationsCore;
using uForum.Businesslogic;
using umbraco.cms.businesslogic.web;
using uForum.Services;
namespace NotificationsWeb.Pages
{
@@ -15,7 +15,6 @@ namespace NotificationsWeb.Pages
{
protected void Page_Load(object sender, EventArgs e)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications] sheduled trigger");
SendMarkAsSolutionReminders();
SendProjectVoteReminders();
}
@@ -43,17 +42,18 @@ namespace NotificationsWeb.Pages
SqlDataReader dr = comm.ExecuteReader();
while (dr.Read())
using (var ts = new TopicService())
{
InstantNotification not = new InstantNotification();
while (dr.Read())
{
InstantNotification not = new InstantNotification();
int topicId = dr.GetInt32(0);
int memberId = dr.GetInt32(1);
int topicId = dr.GetInt32(0);
int memberId = dr.GetInt32(1);
Topic t = Topic.GetTopic(topicId);
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "MarkAsSolutionReminderSingle", topicId, memberId, NiceTopicUrl(t));
var topic = ts.GetById(topicId);
not.Invoke(Config.ConfigurationFile, Config.AssemblyDir, "MarkAsSolutionReminderSingle", topic, memberId);
}
}
}
@@ -114,37 +114,15 @@ namespace NotificationsWeb.Pages
catch (Exception ex)
{
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications] " + ex.Message);
}
finally
{
if(conn != null)
conn.Close();
}
}
}
private static string NiceTopicUrl(Topic t)
{
if (t.Exists)
{
string _url = umbraco.library.NiceUrl(t.ParentId);
if (umbraco.GlobalSettings.UseDirectoryUrls)
{
return "/" + _url.Trim('/') + "/" + t.Id.ToString() + "-" + t.UrlName;
}
else
{
return "/" + _url.Substring(0, _url.LastIndexOf('.')).Trim('/') + "/" + t.Id.ToString() + "-" + t.UrlName + ".aspx";
}
}
else
{
return "";
}
}
}
}
@@ -0,0 +1,22 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by Fontastic.me</metadata>
<defs>
<font id="our-umbraco" horiz-adv-x="512">
<font-face font-family="our-umbraco" units-per-em="512" ascent="480" descent="-32"/>
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#97;" d="M270 464c18 0 34-2 48-5 15-3 28-9 37-17 11-8 19-20 24-32 7-15 8-31 8-50 0-22-5-42-16-58-11-16-25-27-48-33l0-2c24-3 42-13 56-30 13-16 21-39 21-67 0-16-2-32-6-47-5-14-12-27-23-38-9-11-24-19-40-27-16-7-37-10-61-10l-140 0 0 416z m-32-171c24 0 40 5 52 13 11 8 16 22 16 41 0 19-5 34-15 42-9 8-25 13-46 13l-31 0 0-109z m8-184c21 0 37 5 50 13 13 9 19 25 19 49 0 13-1 23-5 31-3 8-8 14-12 19-7 5-13 8-21 9-8 2-16 4-26 4l-37 0 0-125z"/>
<glyph unicode="&#98;" d="M210 459l16 2 0-50-15-1c-17-2-29-8-33-21-4-8-7-18-7-32l0-23c0-20-3-38-9-51-5-11-13-21-23-27 11-6 19-16 24-27 7-13 10-29 10-50l0-29c0-16 3-27 11-33 8-7 18-11 29-11l13-2 0-50-16 2c-29 3-53 11-72 24-21 14-31 37-31 67l0 42c0 13-1 21-5 27-6 11-19 18-40 19l-14-1 0 46 14 2c20 3 34 9 40 19 4 5 5 14 5 27l0 32c0 27 7 51 21 67 14 18 42 29 82 32z m254-179l0-48-14-2c-20-1-34-8-40-19-4-6-5-16-5-27l0-40c0-30-11-53-32-67-19-13-42-19-71-23l-17-1 0 49 13 2c11 2 22 5 30 13 8 6 11 17 11 32l0 29c0 20 3 38 10 49 6 11 14 21 24 27-10 7-18 16-24 28-7 12-10 30-10 51l0 24c0 14-1 27-5 33-6 12-17 18-35 18l-14 2 0 49 16-1c41-4 70-16 86-37 11-15 16-34 16-61l0-32c0-13 2-21 5-27 6-11 19-18 40-19z"/>
<glyph unicode="&#99;" d="M48 157l0 35 416 0 0-35z m0-55l0 36 416 0 0-36z m0-54l0 35 416 0 0-35z m0 270l0 36 416 0 0-36z m0-54l0 35 416 0 0-35z m0-54l0 35 416 0 0-35z m30 232l356 0 0-60-356 0z"/>
<glyph unicode="&#100;" d="M112 157l0 35 253 0 0-35z m0-55l0 36 294 0 0-36z m0-54l0 35 294 0 0-35z m0 381l0 35 254 0 0-35z m0-55l0 36 294 0 0-36z m0-54l0 35 294 0 0-35z m-64-51l50 0 0-26-50 0z m307 0l50 0 0-26-50 0z m-61 0l50 0 0-26-50 0z m-62 0l50 0 0-26-50 0z m-61 0l50 0 0-26-50 0z m-62 0l49 0 0-26-49 0z m304 0l49 0 0-26-49 0z"/>
<glyph unicode="&#101;" d="M93 78l-3 4c-21 20-31 46-31 75 0 29 10 53 31 73l75 76c21 20 45 30 75 30 21 0 42-5 59-19 3-2 7-3 8-7l7-6 3-3-47-45-3 3c-8 8-17 11-29 11-11 0-20-3-28-11l-76-75c-8-8-11-18-11-29 0-11 3-21 11-29l4-3c8-8 17-11 28-11 12 0 21 3 29 11l32 32c7 7 15 10 23 10 9 0 16-3 22-10 6-6 10-14 10-22 0-8-4-16-10-23l-32-32c-21-20-45-30-75-30-27 0-51 11-72 30z m104 128l-3 4 46 46 3-3c8-8 18-11 29-11 11 0 21 3 29 11l75 75c8 8 11 18 11 29 0 11-3 21-11 27l-3 3c-10 8-19 13-29 13-11 0-21-3-29-11l-30-32c-7-7-15-10-23-10-9 0-16 3-22 10-6 6-10 14-10 22 0 8 4 16 10 23l32 32c18 20 43 30 72 30 29 0 54-10 74-30l3-4c21-20 32-44 32-73 0-29-11-55-32-74l-75-75c-21-22-45-32-74-32-29 0-54 10-75 30z"/>
<glyph unicode="&#102;" d="M354 464l-88-416-92 0 88 416z"/>
<glyph unicode="&#103;" d="M69 106c0-4 0-7 1-10 2-5 7-8 12-8 3 0 6 2 9 5 3 1 5 6 5 9 0 7-3 12-8 13-3 2-8 2-14 2l0 13c6 0 11 1 12 1 5 2 7 7 7 11 0 4-2 7-3 8-2 2-5 4-8 4-5 0-8-2-12-5-1-3-3-7-1-11l-18 0c0 4 0 8 2 12 1 5 5 8 8 12 3 1 6 3 9 4 4 2 8 2 13 2 10 0 16-3 23-8 6-5 8-11 8-19 0-7-2-10-5-15-2-3-5-4-7-4 2 0 4-2 8-5 5-5 8-10 8-18 0-8-3-16-8-22-6-7-14-10-25-10-13 0-23 5-27 15-4 4-5 9-5 17l16 0z m-15 123c4 6 10 13 20 21 8 6 14 11 17 14 3 3 5 8 5 13 0 5 0 8-3 11-2 3-5 3-10 3-6 0-9-1-11-6 0-2-2-7-2-11l-19 0c0 8 2 16 5 20 5 10 14 15 27 15 11 0 19-3 26-8 6-7 9-13 9-23 0-6-1-12-6-19-3-3-8-8-14-11l-8-8c-5-3-8-6-10-8-2-2-3-3-5-5l43 0 0-16-67 0c0 7 0 13 3 18z m2 189l0 12c5 2 10 2 13 2 3 2 6 3 8 5 3 3 3 5 5 8 0 1 0 3 0 3l16 0 0-96-20 0 0 66z m123-63l0 88 285 0 0-88z m0-139l0 88 285 0 0-88z m0-139l0 88 285 0 0-88z"/>
<glyph unicode="&#104;" d="M464 405l0-293-416 0 0 293z m-37-39l-341 0 0-219 341 0z m-150-97c0 0 37-32 110-96l-277 0 0 29 56 104 82-88z m40 41c0 8 3 15 8 20 5 4 11 8 19 8 8 0 14-4 19-8 5-5 8-12 8-20 0-8-3-14-8-19-5-5-11-8-19-8-8 0-14 3-19 8-7 5-8 11-8 19z"/>
<glyph unicode="&#105;" d="M227 432l5 0 0-69-3-1c-23-8-39-20-47-34-8-14-12-32-12-53l62 0 0-150-139 0 0 147c0 2 0 3 0 5 0 19 3 37 9 54 7 19 16 35 28 48 12 15 27 26 43 35 16 10 35 15 54 18z m155-104c-8-14-12-32-12-53l62 0 0-150-141 0 0 147c0 2 0 3 0 5 0 19 3 37 10 54 6 19 16 35 29 48 11 15 27 26 43 35 17 10 35 16 56 18l3 0 0-69-3-1c-23-7-39-18-47-34z"/>
<glyph unicode="&#106;" d="M53 256c0 58 21 107 61 147 40 40 88 61 145 61 0 0 2 0 2 0 59 0 109-21 149-64l49 50 0-144-144 0 50 49c-29 31-64 45-106 45l-1 0c-40 0-74-14-103-43-29-29-41-63-41-103l0-1c0-40 14-74 43-101 29-29 62-42 101-42 0 0 1 0 1 0l0-62c0 0-1 0-1 0-58 0-106 21-146 61-38 40-59 89-59 147z"/>
<glyph unicode="&#107;" d="M126 430c10-9 15-20 15-33 0-13-5-24-15-32-9-8-19-13-32-13-12 0-24 5-32 13-9 9-14 21-14 32 0 11 5 24 13 33 9 10 19 15 32 15 13 0 24-5 33-15z m-65-132c-8-10-13-21-13-34 0-13 5-24 13-34 9-9 19-14 32-14 13 0 24 5 33 14 10 10 15 21 15 34 0 13-5 24-15 32-9 10-20 13-33 13-13 0-23-3-32-11z m0-143c-8-9-13-21-13-33 0-13 5-24 13-32 9-10 19-13 32-13 13 0 24 5 33 13 10 9 15 19 15 32 0 12-5 24-15 33-9 10-20 15-33 15-13 0-23-5-32-15z m118 199l0 88 285 0 0-88z m0-140l0 88 285 0 0-88z m0-139l0 88 285 0 0-88z"/>
<glyph unicode="&#108;" d="M459 254c0-57-21-105-61-145-40-40-88-61-145-61 0 0-2 0-2 0l0 64c0 0 2 0 2 0 40 0 73 14 101 42 28 28 43 62 43 100l0 2c0 40-15 74-42 102-29 29-62 44-102 44l-2 0c-41 0-77-15-105-45l49-50-144 0 0 144 51-51c40 42 90 64 149 64 0 0 2 0 2 0 57 0 105-21 145-61 40-41 61-89 61-149z"/>
</font></defs></svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

+1
View File
@@ -0,0 +1 @@
<svg width="58" height="58" viewBox="0 0 58 58" xmlns="http://www.w3.org/2000/svg"><title>Slice 1</title><desc>Created with Sketch.</desc><g fill="none" stroke="#fff" stroke-width="4"><circle cx="29" cy="29" r="27"/><path d="M28.94 42C27.75 42 15 35.437 15 25.694 15 22.374 17.417 18 22.443 18c4.204 0 6.082 3.897 6.498 4.302.3-.405 2.413-4.302 6.617-4.302C40.583 18 43 22.375 43 25.694 43 35.437 30.13 42 28.94 42z"/></g></svg>

After

Width:  |  Height:  |  Size: 428 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 60 60" enable-background="new 0 0 60 60"><circle stroke="#ddd" stroke-width="6" stroke-miterlimit="10" cx="23.5" cy="23.5" r="18.5" fill="none"/><path fill="#ddd" stroke="#ddd" stroke-width="6" stroke-miterlimit="10" d="M35 36l21 21"/></svg>

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

+334
View File
@@ -0,0 +1,334 @@
jQuery(document).ready(function (){
// Quick menu
$( ".user, .close" ).click(function() {
$("body").toggleClass( "quickmenu" );
console.log('hello');
});
// Frontpage search
$('.search-input').focus( function () {
$('.search-all').addClass('open');
});
$('.search-all-close').on('click', function () {
$('.search-all').removeClass('open');
});
// Front page map
var map, map2;
var centerPos = new google.maps.LatLng(51.512161,-0.088721);
var style =
[
[ // mapStyle 0
{
"featureType": "landscape",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "water",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"stylers": [
{
"hue": "#00aaff"
},
{
"saturation": -100
},
{
"gamma": 2.15
},
{
"lightness": 12
}
]
},
{
"featureType": "road",
"elementType": "labels.text.fill",
"stylers": [
{
"visibility": "on"
},
{
"lightness": 24
}
]
},
{
"featureType": "road",
"elementType": "geometry",
"stylers": [
{
"lightness": 57
}
]
}
],
[ // mapStyle 1
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
}
]
},
{
"featureType": "landscape",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 20
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 29
},
{
"weight": 0.2
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 18
}
]
},
{
"featureType": "road.local",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 16
}
]
},
{
"featureType": "poi",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 21
}
]
},
{
"elementType": "labels.text.stroke",
"stylers": [
{
"visibility": "on"
},
{
"color": "#000000"
},
{
"lightness": 16
}
]
},
{
"elementType": "labels.text.fill",
"stylers": [
{
"saturation": 36
},
{
"color": "#000000"
},
{
"lightness": 30
}
]
},
{
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"elementType": "geometry",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 19
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 20
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#000000"
},
{
"lightness": 17
},
{
"weight": 1.2
}
]
}
]
];
var mapStyle = $('#map').attr('data-mapStyle'),
options = {
center: centerPos,
zoom: 11,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
},
disableDoubleClickZoom: true,
mapTypeControl: false,
scaleControl: false,
scrollwheel: false,
panControl: false,
streetViewControl: false,
draggable : true,
overviewMapControl: false,
overviewMapControlOptions: {
opened: false,
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map($('#map')[0], options);
map.setOptions({
styles: style[mapStyle]
});
});
var classOnScrollObject = function (selector, className, scrollDistance) {
this.item = $(selector);
this.itemClass = className;
this.scrollDistance = scrollDistance;
this.classApplied = false;
this.scrollContainer = $(window);
this.fromTop = this.scrollContainer.scrollTop();
};
classOnScrollObject.prototype.applyClass = function() {
this.fromTop = this.scrollContainer.scrollTop();
if (this.fromTop > this.scrollDistance && this.classApplied === false) {
this.classApplied = true;
this.item.addClass(this.itemClass);
} else if (this.fromTop < this.scrollDistance && this.classApplied === true) {
this.classApplied = false;
this.item.removeClass(this.itemClass);
}
};
function classOnScroll (selector, className, scrollDistance) {
var newClassOnScroll = new classOnScrollObject(selector, className, scrollDistance);
newClassOnScroll.applyClass();
newClassOnScroll.scrollContainer.scroll(function () {
newClassOnScroll.applyClass();
});
}
+101
View File
@@ -0,0 +1,101 @@
(function () {
var converter = new Markdown.getSanitizingConverter();
var editor = new Markdown.Editor(converter);
var state = {};
editor.run();
var thisEditor = $('#markdown-editor'),
thisButtonRow = $('.wmd-button-row'),
thisEditorInput = $('.wmd-input'),
thisEditorPreview = $('.wmd-preview'),
thisEditorDraft = $('.draft'),
thisEditorSpacer = $('.markdown-spacer'),
thisEditorMobilePreview = $('#mobile-preview');
$('a.forum-reply').on('click', function (e) {
e.preventDefault();
state = $(this).data();
initEditor($(this));
// thisEditorDraft.removeClass('show');
showEditor();
});
$('.markdown-close').on('click', function () {
thisEditor.removeClass('write');
thisEditorSpacer.removeClass('write');
if ($.trim(thisEditorPreview.text()) != "") {
thisEditorDraft.addClass('show');
}
});
$("#topic-submit").on("click", function (event) {
event.preventDefault();
submit();
});
thisEditorInput.on('scroll', function () {
var inputScroll = thisEditorInput.scrollTop(),
scrolledPercentage = (inputScroll / 300) * 100,
previewScrollHeight = document.getElementById('wmd-preview').scrollHeight,
previewScroll = (previewScrollHeight / 100) * scrolledPercentage + 2;
console.log(previewScroll);
thisEditorPreview.scrollTop(previewScroll);
});
thisEditorDraft.on('click', function () {
thisEditorDraft.removeClass('show');
showEditor();
});
function initEditor(ent) {
var replyTo = ent.closest('.actions').prevAll('.meta').find('a').text();
$('.reply-name').html(replyTo);
}
function submit() {
var type = "Post";
if (state.id) {
type = "Put";
} else {
state.id = "";
}
var url = "/umbraco/api/forum/" + state.controller + "/" + state.id;
state.body = thisEditorInput.val();
$.ajax({
url: url,
type: type,
data: state
}).done(function () {
// Do something better then showing an alert...
alert("DONE!");
});
}
function showEditor() {
thisEditor.addClass('write');
thisEditorSpacer.addClass('write');
setTimeout(function () {
thisEditorInput.focus().delay(600);
}, 1000);
}
thisEditorMobilePreview.on('click', function () {
thisEditor.toggleClass('mobile-preview');
switch ($(this).attr('value')) {
case 'Preview':
$(this).attr('value', 'Editor');
break;
case 'Editor':
$(this).attr('value', 'Preview');
break;
}
});
})();
+45 -2
View File
@@ -318,6 +318,33 @@
<Content Include="App_Browsers\w3cvalidator.browser" />
<Content Include="App_Data\access.xml" />
<Content Include="App_Data\YouTrack\dummy.txt" />
<Content Include="Assets\css\style.min.css" />
<Content Include="Assets\images\breadcrumb.png" />
<Content Include="Assets\images\close.png" />
<Content Include="Assets\images\compass.png" />
<Content Include="Assets\images\documentation\cells.png" />
<Content Include="Assets\images\documentation\dirty-shade.png" />
<Content Include="Assets\images\documentation\editor.png" />
<Content Include="Assets\images\documentation\Grid-layout-NO-SIDEBAR-rows.jpg" />
<Content Include="Assets\images\documentation\Grid-layout-rows.jpg" />
<Content Include="Assets\images\documentation\Grid-layout-scenarios.jpg" />
<Content Include="Assets\images\documentation\layouts.png" />
<Content Include="Assets\images\documentation\para.png" />
<Content Include="Assets\images\documentation\rows.png" />
<Content Include="Assets\images\documentation\settings.png" />
<Content Include="Assets\images\editor.png" />
<Content Include="Assets\images\forum.gif" />
<Content Include="Assets\images\forum.png" />
<Content Include="Assets\images\imagegen %281%29.png" />
<Content Include="Assets\images\imagegen %282%29.png" />
<Content Include="Assets\images\imagegen %283%29.png" />
<Content Include="Assets\images\imagegen %285%29.png" />
<Content Include="Assets\images\imagegen.png" />
<Content Include="Assets\images\package2.png" />
<Content Include="Assets\images\solved.gif" />
<Content Include="Assets\images\tools.png" />
<Content Include="Assets\js\app.min.js" />
<Content Include="Assets\js\editor.min.js" />
<Content Include="bin\legacy\Lucene.Net.dll" />
<Content Include="config\404handlers.config" />
<Content Include="config\applications.config" />
@@ -1747,6 +1774,19 @@
<Content Include="usercontrols\umbracoContour\EditForm.ascx" />
<Content Include="usercontrols\umbracoContour\Installer.ascx" />
<Content Include="usercontrols\umbracoContour\RenderForm.ascx" />
<Content Include="Views\MacroPartials\Forum\TopicForm.cshtml" />
<Content Include="Views\MacroPartials\Members\HeaderProfile.cshtml" />
<Content Include="Views\MacroPartials\Members\QuickMenu.cshtml" />
<Content Include="Views\MacroPartials\Members\JsValues.cshtml" />
<Content Include="Views\Partials\Forum\Comment.cshtml" />
<Content Include="Assets\css\fonts\our-icon\our-umbraco.eot" />
<Content Include="Assets\css\fonts\our-icon\our-umbraco.svg" />
<Content Include="Assets\css\fonts\our-icon\our-umbraco.ttf" />
<Content Include="Assets\css\fonts\our-icon\our-umbraco.woff" />
<Content Include="Assets\images\logo.svg" />
<Content Include="Assets\images\magnifier.svg" />
<Content Include="Views\MacroPartials\Navigation\TopNavigation.cshtml" />
<None Include="Views\Partials\Forum\MemberBadge.cshtml" />
<Content Include="Views\Web.config" />
<Content Include="web.config">
<SubType>Designer</SubType>
@@ -4600,6 +4640,10 @@
<Content Include="Views\Partials\Grid\Editors\Media.cshtml" />
<Content Include="Views\Partials\Grid\Editors\Rte.cshtml" />
<Content Include="Views\Partials\Grid\Editors\Textstring.cshtml" />
<Content Include="Views\MacroPartials\Forum\Latest.cshtml" />
<Content Include="Views\MacroPartials\Forum\Forum.cshtml" />
<Content Include="Views\MacroPartials\Forum\Thread.cshtml" />
<Content Include="Views\Partials\Forum\Question.cshtml" />
<None Include="web.Debug.config">
<DependentUpon>web.config</DependentUpon>
</None>
@@ -4663,13 +4707,12 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="App_Code\" />
<Folder Include="App_Plugins\" />
<Folder Include="css\img\Cached\" />
<Folder Include="Old_App_Code\" />
<Folder Include="umbraco\dashboard\air\" />
<Folder Include="umbraco\dashboard\swfs\" />
<Folder Include="usercontrols\Deli\Admin\" />
<Folder Include="Views\MacroPartials\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
@@ -0,0 +1,48 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using uForum;
@{
var topics = uForum.Services.TopicService.Instance.GetLatestTopics(50, 1);
}
<!-- FORUM LIST START -->
<table class="table table-striped topic-list">
<!-- FORUM LIST HEADER START -->
<thead>
<tr>
<th class="topic">Topic</th>
<th class="category">Category</th>
<th class="posts">Posts</th>
<th class="activity">Activity</th>
</tr>
</thead>
<!-- FORUM LIST HEADER END -->
<!-- FORUM LIST OF THREADS START -->
<tbody>
<!-- FORUM THREAD START -->
@foreach (var topic in topics.Items)
{
<tr class="@Umbraco.If(topic.Answer > 0, "solved")">
@{
var forum = Umbraco.TypedContent(topic.ParentId);
}
<td class="topic">
<a href="@topic.Url">@topic.Title</a>
<span>last edited by <a href="#">@topic.LastActiveMember().Name</a></span>
</td>
<td class="category frontend"><a href="@forum.Url">@forum.Name</a></td>
<td class="posts">@topic.Replies</td>
<td class="activity" title="@topic.Updated.ToShortDateString() - @topic.Updated.ToShortTimeString()">@topic.Updated.ConvertToRelativeTime()</td>
</tr>
}
</tbody>
<!-- FORUM LIST OF THREADS START -->
</table>
<!-- FORUM LIST END -->
@@ -0,0 +1,16 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using uForum;
@{
var topics = uForum.Services.TopicService.Instance().GetLatestTopics();
}
<ul>
@foreach (var topic in topics)
{
<li>
@topic.Title
</li>
}
</ul>
@@ -0,0 +1,28 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using uForum;
@{
var topic = uForum.Services.TopicService.Instance.CurrentTopic( this.Context );
var comments = uForum.Services.CommentService.Instance.GetComments(topic.Id);
var topicAuthor = topic.Author();
var forum = Umbraco.TypedContent(topic.ParentId);
}
<ul class="comments">
@Html.Partial("forum/question", topic)
@foreach (var comment in comments)
{
Html.RenderPartial("forum/comment", comment, new ViewDataDictionary { { "level", 1 }, { "answer", topic.Answer } });
if (comment.HasChildren)
{
var children = uForum.Services.CommentService.Instance.GetChildComments(comment.Id);
foreach (var child in children)
{
Html.RenderPartial("forum/comment", child, new ViewDataDictionary { { "level", 2 }, { "answer", topic.Answer } });
}
}
}
</ul>
@@ -0,0 +1,35 @@
<div class="markdown-spacer"></div>
<div id="markdown-editor" class="markdown-editor">
<div class="container">
<div class="row reply-to">
<div class="col-sm-6">
<p>Write your reply to: <a class="reply-name" href=""></a></p>
</div>
</div>
<div class="row hidden-xs">
<div class="col-md-12">
<div id="wmd-button-bar"></div>
</div>
</div>
<div class="row input-row">
<div id="input-container" class="col-md-6">
<label>Editor</label>
<textarea name="" id="wmd-input" cols="30" rows="10" class="wmd-input markdown-control"></textarea>
</div>
<div id="preview-container" class="col-md-6">
<label>Preview</label>
<div id="wmd-preview" class="wmd-panel wmd-preview markdown-syntax"></div>
</div>
</div>
<div class="row">
<div class="col-sm-3 col-xs-6 visible-xs visible-sm">
<input type="button" value="Preview" id="mobile-preview" class="markdown-control">
</div>
<div class="col-sm-3 col-xs-6">
<input type="button" value="Post Reply" id="topic-submit" class="markdown-control">
</div>
</div>
</div>
<span class="markdown-close"></span>
<div class="draft">Draft</div>
</div>
@@ -0,0 +1,10 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using uForum;
@if(Members.IsLoggedIn()){
<div class="user">
<img src="@Members.GetCurrentMember().Avatar()" alt="">
</div>
}else{
<a href="/members/login">Sign in</a> <a href="/members/register">Register</a>
}
@@ -0,0 +1,16 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using uForum;
@if(Members.IsLoggedIn()){
var profile = Members.GetCurrentMemberProfileModel();
var member = Members.GetCurrentMember();
<script type="text/javascript">
var umb_member_name = '@member.Name';
var umb_member_email = '@profile.Email';
var umb_member_icon = '@member.Avatar()';
</script>
}
@@ -0,0 +1,67 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
<div class="quick-menu">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="close">
<img src="assets/images/close.png" alt="">
</div>
<div class="user-image">
<img src="https://s3.amazonaws.com/uifaces/faces/twitter/anoff/128.jpg" alt="">
</div>
<div class="user-profile">
<h2>Darth Vader</h2>
<div class="karma">
2410
</div>
<div class="user-twitter">
<a href="#">@@Darth</a>
</div>
</div>
<small>
Activity in threads you participated in
</small>
<div class="user-latest-posts">
<a href="#" class="forum-thread">
<div class="row">
<div class="col-xs-12">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
<a href="#" class="forum-thread">
<div class="row">
<div class="col-xs-12">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
<a href="#" class="forum-thread">
<div class="row">
<div class="col-xs-12">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,32 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using uForum
@*
Macro to display child pages below the root page of a standard website.
Also highlights the current active page/section in the navigation with
the css class "current".
*@
@{
@* Get the root of the website *@
var root = CurrentPage.AncestorOrSelf(1);
}
<ul>
@foreach (var page in root.Children.Where("Visible"))
{
<li class="@(page.IsAncestorOrSelf(CurrentPage) ? "current" : null)">
<a href="@page.Url">@page.Name</a>
</li>
}
<li>
@if(Members.IsLoggedIn()){
<div class="user">
<img src="@Members.GetCurrentMember().Avatar()" alt="">
</div>
}else{
<a href="/members/login">Sign in</a> <a href="/members/register">Register</a>
}
</li>
</ul>
@@ -0,0 +1,67 @@
@inherits Umbraco.Web.Mvc.UmbracoViewPage<uForum.Models.Comment>
@using uForum;
@{
var answer = (int)ViewData["answer"];
var commentAuthor = Model.Author();
}
<li class="comment @Umbraco.If(Model.ParentCommentId > 0, "level-2") @Umbraco.If(Model.Id == answer, "solution")" id="comment-@Model.Id">
<div class="meta">
<div class="profile">
<a href="#">@commentAuthor.Name</a> has in total, @commentAuthor.Karma() karma points <span class="roles">Admin</span>
</div>
<div class="time">
@Model.Created.ConvertToRelativeTime()
</div>
</div>
<div class="comment-inner">
<a href="#" class="photo">
<img src="@commentAuthor.Avatar()">
</a>
<div class="body markdown-syntax">
@Model.Body.Sanitize()
</div>
</div>
@if(Members.IsLoggedIn()){
var mem = Members.GetCurrentMember();
<div class="actions">
<div class="link">
<a href="#">
<img src="https://cdn0.iconfinder.com/data/icons/entypo/80/link5-16.png" alt=""> Copy link
</a>
</div>
@if(Members.IsAdmin() || mem.Id == Model.MemberId){
<div class="solved">
<a href="#"> <img src="https://cdn0.iconfinder.com/data/icons/very-basic-android-l-lollipop-icon-pack/24/checkmark-16.png" alt=""> Mark as solution</a>
</div>
}
@if(mem.Id != Model.MemberId){
<div class="karma">
<a href="#"><img src="https://cdn0.iconfinder.com/data/icons/very-basic-android-l-lollipop-icon-pack/24/like_outline-16.png" alt=""> Give Karma</a>
</div>
}
@if(Model.ParentCommentId <= 0){
<div class="reply">
<a href="#" data-topic="@Model.TopicId" data-parent="@Model.Id" data-controller="comment" class="forum-reply">
<img src="https://cdn2.iconfinder.com/data/icons/freecns-cumulus/16/519627-127_ArrowLeft-16.png" alt=""> Reply
</a>
</div>
}
</div>
}
</li>
@@ -0,0 +1,19 @@
@model IMember
@using uForum;
<div class="author vcard">
<div class="memberBadge rounded">
<a href="/member/@Model.Id}">
<img alt="Avatar" class="photo" src="@Model.Avatar()" style="width: 32px; height: 32px;" />
</a>
<span class="posts">
@Model.ForumPosts()
<small>posts</small>
</span>
<span class="karma">
@Model.Karma()
<small>karma</small>
</span>
</div>
</div>
@@ -0,0 +1,59 @@
@inherits Umbraco.Web.Mvc.UmbracoViewPage<uForum.Models.Topic>
@using uForum;
@{
var topicAuthor = Model.Author();
var forum = Umbraco.TypedContent(Model.ParentId);
}
<li class="comment question"> <!-- Start of question -->
<div class="meta">
<div class="profile">
<a href="#">@topicAuthor.Name</a> has in total, @topicAuthor.Karma() karma points
</div>
<div class="time">
@Model.Created.ConvertToRelativeTime()
</div>
</div>
<div class="comment-inner">
<a href="#" class="photo">
<img src="@topicAuthor.Avatar()">
<span class="karma">Recieved 5 <br>Karma points</span>
</a>
<div class="body-meta">
<div class="topic">
<h2>@Model.Title</h2>
</div>
<div class="categories">
<div class="category core">
<a href="@forum.Url">@forum.Name</a>
</div>
@if(Model.Version > 0){
<div class="version">
<a href="#">Umbraco @Model.Version</a>
</div>
}
</div>
</div>
<div class="body">
@Model.Body.Sanitize()
</div>
</div>
<div class="actions">
<div class="link">
<a href="#">
<img src="https://cdn0.iconfinder.com/data/icons/entypo/80/link5-16.png" alt=""> Copy link
</a>
</div>
<div class="reply">
<a href="#" data-topic="@Model.Id" data-controller="comment" class="forum-reply">
<img src="https://cdn2.iconfinder.com/data/icons/freecns-cumulus/16/519627-127_ArrowLeft-16.png" alt=""> Reply
</a>
</div>
</div>
</li> <!-- End of question -->
@@ -111,7 +111,7 @@
<templates>
<!-- To switch the default rendering engine to MVC, change this value from WebForms to Mvc -->
<defaultRenderingEngine>Mvc</defaultRenderingEngine>
<defaultRenderingEngine>Webforms</defaultRenderingEngine>
</templates>
+470 -79
View File
@@ -2,96 +2,487 @@
<asp:Content ContentPlaceHolderId="Main" runat="server">
<div id="dashboard" class="subpage">
<%if (!string.IsNullOrWhiteSpace(Request.QueryString["topicNotFound"])) { %>
<div class="error" style="margin-top:15px;"><p><strong>The forum post that you requested could not be found or was marked as spam.</strong></p></div>
<% } %>
<div style="text-align: center">
<h1>The friendliest CMS community on the planet</h1>
<div style="margin-bottom: 40px;">
<p>
our.umbraco.org is the central hub for the friendly umbraco community. Search for documentation, get
help and guidance from seasoned experts, download and collaborate on plugins and extensions.
</p>
<%if(!umbraco.library.IsLoggedOn()){ %>
<p><a href="/member/signup">Register an account</a> <em> or </em> <a href="/member/login">Login</a></p>
<%}%>
</div>
</div>
<div style="width: 315px; float: left; overflow: hidden; clear: none; ">
<div class="spotlight" id="latestForumTopics">
<h4><span class="entry-title">Forum talk</span> <a class="rss_small" href="/rss/activetopics">rss</a></h4>
<div id="data_forum"><small>Loading forum list...</small></div>
<a class="more" href="/forum">More..</a>
</div>
</div>
<div style="width: 315px; overflow: hidden; clear: none; float: left; margin-left: 17px">
<section class="docs">
<div class="container">
<div class="row">
<div class="spotlight">
<h4>New projects <a class="rss_small" href="/rss/projects">rss</a></h4>
<div id="data_projects"><small>Loading the newest projects...</small></div>
<a class="more" href="/projects">More..</a>
</div>
<div class="col-md-6">
<div class="beginners">
<a href="#"><img src="/assets/images/editor.png" alt=""></a>
<h2>Code base</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco.</p>
<a href="#">Go to documentation &rarr;</a>
</div>
</div>
<div class="spotlight">
<h4>Featured documentation</h4>
<div id="data_wiki"><small>Loading featured documentation...</small></div>
<a class="more" href="/documentation">More..</a>
</div>
</div>
<div class="col-md-6">
<div class="advanced">
<a href="#"><img src="/assets/images/tools.png" alt=""></a>
<h2>Tools</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco.</p>
<div style="width: 315px; float: right; clear: none; overflow: hidden;">
<a href="#">Go to advanced documentation &rarr;</a>
</div>
</div>
<div class="spotlight">
<h4>Community blogs <a class="rss_small" href="/rss/communityblogs">rss</a></h4>
<div id="data_blogs"><small>Loading blog list...</small></div>
</div>
</div>
</div>
</section>
<div class="spotlight">
<h4>Twitter <a class="rss_small" href="https://twitter.com/search?q=umbraco&src=typd" target="_blank">rss</a></h4>
<umbraco:Macro Alias="TwitterSearch" runat="server" />
</div>
<section class="forum">
<div class="container">
<div class="row">
</div>
<div class="col-md-12">
<h1 class="text-center">Forum Activity</h1>
</div>
<div class="col-md-6">
<small>
Recent threads
</small>
<a href="#" class="forum-thread">
<div class="row">
<div class="hidden-xs col-md-2">
<img src="https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg" alt="">
</div>
<div class="col-xs-12 col-md-10">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
<a href="#" class="forum-thread">
<div class="row">
<div class="hidden-xs col-md-2">
<img src="https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg" alt="">
</div>
<div class="col-xs-12 col-md-10">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
<a href="#" class="forum-thread">
<div class="row">
<div class="hidden-xs col-md-2">
<img src="https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg" alt="">
</div>
<div class="col-xs-12 col-md-10">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<small>
Activity in threads you participated in
</small>
<a href="#" class="forum-thread">
<div class="row">
<div class="hidden-xs col-md-2">
<img src="https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg" alt="">
</div>
<div class="col-xs-12 col-md-10">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
<a href="#" class="forum-thread">
<div class="row">
<div class="hidden-xs col-md-2">
<img src="https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg" alt="">
</div>
<div class="col-xs-12 col-md-10">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
<a href="#" class="forum-thread">
<div class="row">
<div class="hidden-xs col-md-2">
<img src="https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg" alt="">
</div>
<div class="col-xs-12 col-md-10">
<div class="forum-thread-text">
<h3>RE: Allow user to change site design</h3>
<p>Posted in Using Umbraco 7 by Dennis Aaen</p>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-12 goto-forum">
<a href="#">Go to Forum &rarr;</a>
</div>
</div>
</div>
</section>
<section class="people">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>People on Our</h1>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/enda/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/idiot/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/mghoz/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/pixeliris/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/kfriedson/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/andrewaashen/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/riklomas/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/alexcican/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/nettatheninja/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/scott_allison/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/enda/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/kevin_granger/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/juanpablob/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/steveodom/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/claynewton/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/raquelromanp/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/manugamero/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/nicolaballotta/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/stan/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/peejfancher/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/ffbel/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/anoff/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/joreira/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/idiot/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/idiot/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/mghoz/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/enda/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/andrewaashen/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/riklomas/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/alexcican/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/nettatheninja/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/scott_allison/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/enda/128.jpg" alt=""></a>
</div>
<div class="col-xs-3 col-md-1">
<a href="#"><img class=" user-profile" src="https://s3.amazonaws.com/uifaces/faces/twitter/kevin_granger/128.jpg" alt=""></a>
</div>
<a class="button green large" href="#">Go to People &rarr;</a>
</div>
</div>
</section>
<section class="events">
<div class="event-map">
<div id="map" data-mapStyle="0"></div>
<div class="event-info">
<img src="/assets/images/compass.png" alt="">
<h1>Activity on Our</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud.</p>
<a href="#">Sign up &rarr;</a>
</div>
</div>
</section>
</div>
</asp:Content>
<asp:Content ContentPlaceHolderID="Search" runat="server" >
<!-- Search start -->
<div id="search-all" class="search-all">
<form class="search-all-form" action="">
<div class="search-fieldset">
<input class="search-input" type="search" placeholder="Search..">
<input class="search-submit" type="submit" value="&#xe085;">
</div>
<span class="search-all-close"></span>
</form>
<div class="search-all-results equalizer">
<div class="search-column">
<h2>DOCUMENTATION</h2>
<a href="#" class="search-result equal">
<div class="search-meta">
<h3>Master Template The Navigation Menu</h3>
<p>Now let fix the navigation menu there are two ways of doing this you could have Umbraco dynamically create a navigation menu from the pages...</p>
</div>
</a>
<a href="#" class="search-result equal">
<div class="search-meta">
<h3>Master Template The Navigation Menu</h3>
<p>Now let fix the navigation menu there are two ways of doing this you could have Umbraco dynamically create a navigation menu from the pages...</p>
</div>
</a>
<a href="#" class="search-result equal">
<div class="search-meta">
<h3>Master Template The Navigation Menu</h3>
<p>Now let fix the navigation menu there are two ways of doing this you could have Umbraco dynamically create a navigation menu from the pages...</p>
</div>
</a>
<a href="#" class="search-result equal">
<div class="search-meta">
<h3>Master Template The Navigation Menu</h3>
<p>Now let fix the navigation menu there are two ways of doing this you could have Umbraco dynamically create a navigation menu from the pages...</p>
</div>
</a>
<a href="#" class="search-result equal">
<div class="search-meta">
<h3>Master Template The Navigation Menu</h3>
<p>Now let fix the navigation menu there are two ways of doing this you could have Umbraco dynamically create a navigation menu from the pages...</p>
</div>
</a>
</div>
<div class="search-column">
<h2>FORUM</h2>
<a href="#" class="search-result equal">
<img src="assets/images/forum.gif" alt="Forum post, not solved" />
<div class="search-meta">
<h3>When saving a Stylesheet that is too big, we get a permission Error in the back office</h3>
<p>Tagged with: span</p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/solved.gif" alt="Forum post, solved" />
<div class="search-meta">
<h3>When saving a Stylesheet that is too big, we get a permission Error in the back office</h3>
<p>Tagged with: span</p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/forum.gif" alt="Forum post, not solved" />
<div class="search-meta">
<h3>When saving a Stylesheet that is too big, we get a permission Error in the back office</h3>
<p>Tagged with: span</p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/solved.gif" alt="Forum post, solved" />
<div class="search-meta">
<h3>When saving a Stylesheet that is too big, we get a permission Error in the back office</h3>
<p>Tagged with: span</p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/forum.gif" alt="Forum post, not solved" />
<div class="search-meta">
<h3>When saving a Stylesheet that is too big, we get a permission Error in the back office</h3>
<p>Tagged with: span</p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/forum.gif" alt="Forum post, not solved" />
<div class="search-meta">
<h3>When saving a Stylesheet that is too big, we get a permission Error in the back office</h3>
<p>Tagged with: span</p>
</div>
</a>
</div>
<div class="search-column">
<h2>PACKAGES</h2>
<a href="#" class="search-result equal">
<img src="assets/images/imagegen.png" alt="TooltipStylesInspiration" />
<div class="search-meta">
<h3>Simple Store</h3>
<p>Version: <span>1.1</span>, by<span>Mikkel Holck Madsen</span></p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/imagegen.png" alt="TooltipStylesInspiration" />
<div class="search-meta">
<h3>Simple Store</h3>
<p>Version: <span>1.1</span>, by<span>Mikkel Holck Madsen</span></p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/imagegen (1).png" alt="TooltipStylesInspiration" />
<div class="search-meta">
<h3>Merchello - PayPal Express Payment Provider</h3>
<p>Version: <span>1.1</span>, by<span>Mikkel Holck Madsen</span></p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/imagegen.png" alt="TooltipStylesInspiration" />
<div class="search-meta">
<h3>Simple Store</h3>
<p>Version: <span>1.1</span>, by<span>Mikkel Holck Madsen</span></p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/imagegen.png" alt="TooltipStylesInspiration" />
<div class="search-meta">
<h3>Simple Store</h3>
<p>Version: <span>1.1</span>, by<span>Mikkel Holck Madsen</span></p>
</div>
</a>
<a href="#" class="search-result equal">
<img src="assets/images/imagegen.png" alt="TooltipStylesInspiration" />
<div class="search-meta">
<h3>Simple Store</h3>
<p>Version: <span>1.1</span>, by<span>Mikkel Holck Madsen</span></p>
</div>
</a>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
$.post("/html/forum",
function(data){
jQuery("#data_forum").html(data);
});
$.post("/html/projects",
function(data){
jQuery("#data_projects").html(data);
});
$.post("/html/wiki",
function(data){
jQuery("#data_wiki").html(data);
});
$.post("/html/blogs",
function(data){
jQuery("#data_blogs").html(data);
});
});
</script>
<div class="search-text">
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
</div>
</div>
</div>
</div>
<!-- Search end -->
</asp:Content>
@@ -1,8 +1,20 @@
<%@ Master Language="C#" MasterPageFile="/masterpages/Forum.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
<div style="padding: 35px 0px 25px 0px">
<umbraco:Macro linkToCurrent="1" Alias="Breadcrumb" runat="server"></umbraco:Macro>
</div>
<umbraco:Macro Alias="Forum-commentsList" runat="server"></umbraco:Macro>
<umbraco:Macro Alias="Forum-createComment" runat="server"></umbraco:Macro>
</asp:Content>
<%@ Master Language="C#" MasterPageFile="~/masterpages/ForumMaster.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
<div class="forum-single-thread">
<!-- FORUM HEADER START -->
<div class="forum-archive-header">
<!-- FORUM BREADCRUMB START -->
<umbraco:Macro linkToCurrent="1" Alias="Breadcrumb" runat="server"></umbraco:Macro>
<!-- FORUM BREADCRUMB END -->
<div class="clear"></div>
</div>
<!-- FORUM HEADER END -->
<umbraco:Macro Alias="[Forum]Thread" runat="server"></umbraco:Macro>
</div>
</asp:Content>
@@ -1,44 +1,39 @@
<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
<%@ Register Src="~/usercontrols/DocumentationShowMarkdown.ascx" TagPrefix="markdown" TagName="Doc" %>
<%@ Register Src="~/usercontrols/DocumentationBreadcrumb.ascx" TagPrefix="markdown" TagName="Breadcrumb"%>
<asp:Content ContentPlaceHolderId="main" runat="server">
<div id="wiki" class="subpage">
<div id="body">
<asp:ContentPlaceHolder Id="Main" runat="server">
<div style="margin-top: 25px;">
<markdown:Breadcrumb runat="server" />
</div>
<div id="markdown-docs">
<markdown:Doc ID="Markdown" MarkdownFilePath="documentation\index.md" PrefixLinks="True" AddHeader="False" runat="server" />
</div>
<br style="clear: both"/>
<div class="divider"></div>
</asp:ContentPlaceHolder>
</div>
<umbraco:Macro runat="server" language="cshtml">
@if(Model.Parent.NodeTypeAlias != "Project"){
<div style="margin-top: 20px; padding: 7px;" class="notice">
<h2>The documenation Wiki?</h2>
<p>
<em>As we have started to focus our documentation efforts on the documentation github project, we will be removing the wiki from our.umbraco.org</em>
</p>
<p>
The wiki will still be available, but editing will be turned off,
and the wiki links are also removed from the site navigation and search results.
</p>
<p>
<strong>Umbraco Documentation Team</strong>
</p>
</div>
}
</umbraco:Macro>
</div>
</asp:Content>
<asp:Content ContentPlaceHolderId="Head" runat="server">
<!-- Documentation styles -->
<link media="screen" type="text/css" rel="stylesheet" href="/css/docs.css" />
<%@ Master Language="C#" MasterPageFile="~/masterpages/DocumentationMaster.master" AutoEventWireup="true" %>
<%@ Register Src="~/usercontrols/DocumentationShowMarkdown.ascx" TagPrefix="markdown" TagName="Doc" %>
<%@ Register Src="~/usercontrols/DocumentationBreadcrumb.ascx" TagPrefix="markdown" TagName="Breadcrumb"%>
<asp:Content ContentPlaceHolderId="main" runat="server">
<div id="wiki" class="subpage">
<div id="body">
<asp:ContentPlaceHolder Id="Main" runat="server">
<div style="margin-top: 25px;">
<markdown:Breadcrumb runat="server" />
</div>
<div id="markdown-docs">
<markdown:Doc ID="Markdown" MarkdownFilePath="documentation\index.md" PrefixLinks="True" AddHeader="False" runat="server" />
</div>
<br style="clear: both"/>
<div class="divider"></div>
</asp:ContentPlaceHolder>
</div>
<umbraco:Macro runat="server" language="cshtml">
@if(Model.Parent.NodeTypeAlias != "Project"){
<div style="margin-top: 20px; padding: 7px;" class="notice">
<h2>The documenation Wiki?</h2>
<p>
<em>As we have started to focus our documentation efforts on the documentation github project, we will be removing the wiki from our.umbraco.org</em>
</p>
<p>
The wiki will still be available, but editing will be turned off,
and the wiki links are also removed from the site navigation and search results.
</p>
<p>
<strong>Umbraco Documentation Team</strong>
</p>
</div>
}
</umbraco:Macro>
</div>
</asp:Content>
@@ -0,0 +1,9 @@
<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
<asp:content ContentPlaceHolderId="Main" runat="server">
<div class="page">
<div class="documentation">
<asp:contentplaceholder id="main" runat="server" />
</div>
</div>
</asp:content>
@@ -1,47 +1,43 @@
<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
<%@ Master Language="C#" MasterPageFile="~/masterpages/DocumentationMaster.master" AutoEventWireup="true" %>
<%@ Register Src="~/usercontrols/DocumentationShowMarkdown.ascx" TagPrefix="markdown" TagName="Doc" %>
<%@ Register Src="~/usercontrols/DocumentationBreadcrumb.ascx" TagPrefix="markdown" TagName="Breadcrumb"%>
<%@ Register Src="~/usercontrols/DocumentationBreadcrumb.ascx" TagPrefix="markdown" TagName="Breadcrumb" %>
<%@ Register Src="~/usercontrols/DocumentationEditButton.ascx" TagPrefix="markdown" TagName="DocumentationEditButton" %>
<asp:Content ContentPlaceHolderId="main" runat="server">
<div id="documentation" class="subpage">
<umbraco:Macro runat="server" language="cshtml">
@if(Model.NodeTypeAlias != "Projects"){
<div style="margin-top: 20px; padding: 7px;" class="notice">
<strong>Please note</strong>: this is work in progress. Broken links, placeholder text, and a few things
not working can be expected. <a href="https://github.com/umbraco/Umbraco4Docs"><strong>You can help out. get involved!</strong></a>
<asp:Content ContentPlaceHolderID="main" runat="server">
<span class="sidebar-bg"></span>
<span class="content-bg"></span>
<div class="container">
<div class="row">
<nav class="sidebar col-md-4">
<div class="row">
<div class="col-md-12">
</div>
</div>
}
</umbraco:Macro>
</nav>
<div class="content markdown-syntax col-md-8 col-md-offset-4">
<div class="row">
<div class="col-md-12">
<div id="body">
<markdown:DocumentationEditButton runat="server" ID="DocumentationEditButton" />
<div>
<umbraco:Macro linkToCurrent="1" Alias="Breadcrumb" runat="server"></umbraco:Macro>
</div>
<div id="toc">
<a href="#" class="toggle">Table of contents <small>(click to show/hide)</small></a>
<ul></ul>
</div>
<div id="body">
<asp:ContentPlaceHolder Id="Main" runat="server">
<div style="margin-top: 25px;">
<markdown:Breadcrumb runat="server" />
<div id="markdown-docs">
<markdown:Doc ID="Markdown" runat="server" AddHeader="False" PrefixLinks="False" />
</div>
<br style="clear: both">
<div class="divider"></div>
</div>
</div>
</div>
<div id="markdown-docs">
<markdown:Doc ID="Markdown" runat="server" AddHeader="False" PrefixLinks="False" />
</div>
<br style="clear: both"/>
<div class="divider"></div>
</asp:ContentPlaceHolder>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="/scripts/wiki/toc.js?u=yes"></script>
</asp:Content>
<asp:Content ContentPlaceHolderId="Head" runat="server">
<!-- Documentation styles -->
<link media="screen" type="text/css" rel="stylesheet" href="/css/docs.css?u=y" />
</asp:Content>
@@ -1,13 +0,0 @@
<%@ Master Language="C#" MasterPageFile="/masterpages/Forum.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
<div style="margin-top: 25px;">
<umbraco:Macro linkToCurrent="1" Alias="Breadcrumb" runat="server"></umbraco:Macro>
</div>
<h1>Edit Reply</h1>
<div id="editorSideBar" style="float: right; width: 250px; margin-left: 30px;">
<div class="notice">
<p>You are currently editing a reply you previously posted, the reply will state that you edited it.</p>
</div>
</div>
<umbraco:Macro Alias="Forum-createComment" runat="server"></umbraco:Macro>
</asp:Content>
@@ -1,18 +0,0 @@
<%@ Master Language="C#" MasterPageFile="/masterpages/Forum.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
<div style="margin-top: 25px;">
<umbraco:Macro linkToCurrent="1" Alias="Breadcrumb" runat="server"></umbraco:Macro>
</div>
<h1>Edit your topic</h1>
<div id="editorSideBar" style="float: right; width: 250px; margin-left: 30px;">
<div class="notice">
<p>
You are currently editing a topic you previously posted.
</p>
<p>
The topic will state it was edited.
</p>
</div>
</div>
<umbraco:Macro Alias="Forum-createTopic" runat="server"></umbraco:Macro>
</asp:Content>
+32 -35
View File
@@ -1,38 +1,35 @@
<%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %>
<script runat="server">
protected override void OnInit(EventArgs e)
{
umbraco.library.RegisterStyleSheetFile("Markdown.Styles", "/css/forum/pagedown.css");
umbraco.library.RegisterJavaScriptFile("Markdown.Converter", "/scripts/forum/Markdown.Converter.js");
umbraco.library.RegisterJavaScriptFile("Markdown.Sanitizer", "/scripts/forum/Markdown.Sanitizer.js");
if (umbraco.library.IsLoggedOn())
{
umbraco.library.RegisterJavaScriptFile("Markdown.Editor", "/scripts/forum/Markdown.Editor.js");
}
<%@ Master Language="C#" MasterPageFile="~/masterpages/ForumMaster.master" AutoEventWireup="true" %>
umbraco.library.RegisterJavaScriptFile("Markdown.App", "/scripts/forum/Markdown.App.js");
base.OnInit(e);
}
</script>
<asp:Content ContentPlaceHolderID="main" runat="server">
<umbraco:Macro Alias="Util-AddGooglePrettify" runat="server"></umbraco:Macro>
<div id="body" class="subpage">
<div id="forum">
<asp:ContentPlaceHolder ID="Main" runat="server">
<div style="padding-top: 25px">
<umbraco:Macro Alias="Breadcrumb" runat="server"></umbraco:Macro>
</div>
<h1>
<umbraco:Item Field="pageName" runat="server"></umbraco:Item>
</h1>
<small>
<umbraco:Item Field="forumDescription" recursive="true" runat="server"></umbraco:Item>
</small>
<umbraco:Macro Alias="Forum-overview" runat="server"></umbraco:Macro>
<umbraco:Macro Alias="Forum-topicsList" runat="server"></umbraco:Macro>
</asp:ContentPlaceHolder>
<div class="forum-archive">
<!-- FORUM HEADER START -->
<div class="forum-archive-header">
<!-- FORUM BREADCRUMB START -->
<umbraco:Macro linkToCurrent="1" Alias="Breadcrumb" runat="server"></umbraco:Macro>
<!-- FORUM BREADCRUMB END -->
<!-- FORUM SORTING START -->
<div class="sorting">
<ul>
<li>
Category
<ul>
<li class="frontend"><a href="#"></a>Frontend</li>
<li class="core"><a href="#"></a>Core</li>
<li class="azure"><a href="#"></a>Azure</li>
</ul>
</li>
</ul>
</div>
<!-- FORUM SORTING END -->
<div class="clear"></div>
</div>
<!-- FORUM HEADER END -->
<!-- FORUM TOPICS -->
<umbraco:Macro Alias="[Forum]Forum" runat="server"></umbraco:Macro>
</div>
</div>
</asp:Content>
</asp:Content>
@@ -0,0 +1,10 @@
<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
<asp:content ContentPlaceHolderId="Main" runat="server">
<!-- FORUM OVERVIEW START -->
<section class="forum-overview">
<asp:contentplaceholder id="main" runat="server"/>
</section>
<umbraco:Macro Alias="[Forum]Form" runat="server"></umbraco:Macro>
</asp:content>
+140 -159
View File
@@ -1,183 +1,164 @@
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head runat="server">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="alternate" type="application/rss+xml" title="Latest packages" href="http://our.umbraco.org/rss/projects" />
<link rel="alternate" type="application/rss+xml" title="Package updates" href="http://our.umbraco.org/rss/projectsupdate" />
<link rel="alternate" type="application/rss+xml" title="Active forum topics" href="http://our.umbraco.org/rss/activetopics" />
<link rel="alternate" type="application/rss+xml" title="Community blogs" href="http://pipes.yahoo.com/pipes/pipe.run?_id=8llM7pvk3RGFfPy4pgt1Yg&_render=rss" />
<link rel="search" type="application/opensearchdescription+xml" title="our.umbraco.org" href="/scripts/OpenSearch.xml">
<link rel="shortcut icon" type="image/x-icon" href="/css/img/our.favicon.png"/>
<link rel="shortcut icon" type="image/x-icon" href="/css/img/our.favicon.png" />
<title><umbraco:Macro Alias="Title" runat="server"></umbraco:Macro></title>
<link rel="stylesheet" type="text/css" href="/css/community.css?v=11&update=yes" />
<link rel="stylesheet" type="text/css" href="/css/forum.css?v=3" />
<link rel="stylesheet" type="text/css" href="/css/wiki.css?v=5" />
<link rel="stylesheet" type="text/css" href="/css/new-deli.css?v=4" />
<link rel="stylesheet" type="text/css" href="/css/fonts.css?v=5" />
<link rel="stylesheet" type="text/css" href="/css/jquery.tabs.css?v=4" />
<link rel="stylesheet" type="text/css" href="/css/events.css?v=4" />
<link rel="stylesheet" type="text/css" href="/css/notifications.css?v=4&u=yes" />
<meta name="description" content="">
<meta name="author" content="">
<meta name="robots" content="noindex">
<!-- New MBD Styles -->
<link media="screen" type="text/css" rel="stylesheet" href="/css/new-projects-mbd.css?v=4" />
<link href='http://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/assets/css/style.min.css" />
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="/css/new-projects-mbd-ie.css?v=3">
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script>
<![endif]-->
<!-- MBD iPad CSS -->
<link rel="stylesheet" type="text/css" href="/css/mbd.forum.iPad.css?v=4" media="screen and (min-device-width: 768px) and (max-device-width: 1024px)"/>
<!-- iOS Icons -->
<link rel="apple-touch-icon-precomposed" href="/touch-icon-iphone-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/touch-icon-ipad-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/touch-icon-iphone4-precomposed.png" />
<script type="text/javascript" src="/scripts/mapr/jquery-1.6.4.js"></script>
<script type="text/javascript" src="/scripts/community.js?v=3"></script>
<script type="text/javascript" src="/scripts/powers/uPowers.js?v=6"></script>
<script type="text/javascript" src="/scripts/jquery.validation.js?v=3"></script>
<script type="text/javascript" src="/scripts/notifications/notifications.js?ay=y&v=3"></script>
<script src="/scripts/libs/jquery-ui-1.7.1.custom.min.js?v=3" type="text/javascript"></script>
<script type="text/javascript" src="/scripts/libs/SimpleModal.js?v=3"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="/scripts/new-mbd.js?v=3"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['corechart']});
<umbraco:Macro Alias="[Members]JsValues" runat="server" />
<asp:ContentPlaceHolder ID="Head" runat="server"></asp:ContentPlaceHolder>
<script>
var _prum = [['id', '529dbcf6abe53d055a000000'],
['mark', 'firstbyte', (new Date()).getTime()]];
(function () {
var s = document.getElementsByTagName('script')[0]
, p = document.createElement('script');
p.async = 'async';
p.src = '//rum-static.pingdom.net/prum.min.js';
s.parentNode.insertBefore(p, s);
})();
</script>
<umbraco:Macro Alias="Member-JsValues" runat="server"></umbraco:Macro>
<asp:ContentPlaceHolder Id="Head" runat="server"></asp:ContentPlaceHolder>
<script>
var _prum = [['id', '529dbcf6abe53d055a000000'],
['mark', 'firstbyte', (new Date()).getTime()]];
(function() {
var s = document.getElementsByTagName('script')[0]
, p = document.createElement('script');
p.async = 'async';
p.src = '//rum-static.pingdom.net/prum.min.js';
s.parentNode.insertBefore(p, s);
</head>
<body>
<umbraco:Macro Alias="[Members]QuickMenu" runat="server"></umbraco:Macro>
<header>
<div class="navigation">
<div class="container">
<div class="row">
<div class="col-md-3">
<a class="logo" href="index.html">Our Umbraco
</a>
</div>
<nav class="col-md-9">
<umbraco:Macro Alias="[Navigation]TopNavigation" runat="server" />
</nav>
</div>
</div>
</div>
<asp:ContentPlaceHolder ID="Search" runat="server" />
</header>
<form runat="server">
<asp:ContentPlaceHolder ID="Main" runat="server" />
</form>
<footer>
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-3">
<ul>
<strong>Klara</strong>
<li><a href="#">Lore</a></li>
<li><a href="#">Lora</a></li>
<li><a href="#">Klaurmsi</a></li>
<li><a href="#">Wrapuerdu</a></li>
</ul>
</div>
<div class="col-xs-6 col-md-3">
<ul>
<strong>Klara</strong>
<li><a href="#">Lore</a></li>
<li><a href="#">Lora</a></li>
<li><a href="#">Klaurmsi</a></li>
<li><a href="#">Wrapuerdu</a></li>
</ul>
</div>
<div class="col-xs-6 col-md-3">
<ul>
<strong>Klara</strong>
<li><a href="#">Lore</a></li>
<li><a href="#">Lora</a></li>
<li><a href="#">Klaurmsi</a></li>
<li><a href="#">Wrapuerdu</a></li>
</ul>
</div>
<div class="col-xs-6 col-md-3">
<ul>
<strong>Klara</strong>
<li><a href="#">Lore</a></li>
<li><a href="#">Lora</a></li>
<li><a href="#">Klaurmsi</a></li>
<li><a href="#">Wrapuerdu</a></li>
</ul>
</div>
</div>
</div>
</footer>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.js"> </script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Editor.js">> </script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Sanitizer.js"> </script>
<script src="/assets/js/app.min.js"></script>
<script src="/assets/js/editor.min.js"></script>
<script type="text/javascript">
classOnScroll('header', 'sticky', 10);
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-120590-4']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="main">
<form runat="server">
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager>
<div id="topNotificationContainer">
<div class="topNotification">
<span class="notifyClose">
x
</span>
First time here? Check out the <a href="#">FAQ</a>
</div>
</div>
<asp:ContentPlaceHolder Id="Top" runat="server">
<div id="top">
<div id="memberInfo">
<div class="wrapper">
<div id="memberHeaderProfile">
<umbraco:Macro ProfilePage="1057" LoginPage="1056" CreatePage="1071" BlockedPage="5571" Alias="MemberTopProfile" runat="server"></umbraco:Macro>
</div>
</div>
</div>
<div class="wrapper">
<a href="/" id="logo" title="Our umbraco dot org">our.umbraco.org</a>
<umbraco:Macro Alias="TopNavigation" runat="server"></umbraco:Macro>
</div>
</div>
<umbraco:Macro Alias="SearchField" runat="server"></umbraco:Macro>
</asp:ContentPlaceHolder>
<umbraco:Item field="mainNotification" insertTextBefore="&lt;div id=&quot;alertBar&quot;&gt;" insertTextAfter="&lt;/div&gt;" recursive="true" runat="server"></umbraco:Item>
<div id="contentArea">
<asp:ContentPlaceHolder Id="SpecialContent" runat="server"/>
<asp:ContentPlaceHolder Id="Main" runat="server">
<div id="body" class="subpage wrapper">
<div style="margin-top: 25px;">
<umbraco:Macro Alias="Breadcrumb" runat="server"></umbraco:Macro>
</div>
<h1><umbraco:Item field="alternativeHeadline" useIfEmpty="pageName" runat="server"></umbraco:Item></h1>
<umbraco:Item field="bodyText" runat="server"></umbraco:Item>
</div>
</asp:ContentPlaceHolder>
</div>
<div class="push"></div>
</form>
</div>
<div id="footer">
Our.umbraco.org is the community mothership for <a href="http://umbraco.org" title="Go to umbraco.org">Umbraco, the open source asp.net cms</a>.
With a <a href="/forum">friendly forum</a> for all your questions, a comprehensive <a href="/documentation">documentation wiki</a> and the a ton of <a href="/projects">packages, extensions and extras</a> from the community.
</div>
<div id="votingModal" style="display: none;">
<h3></h3><p></p>
<textarea rows="4" cols="10"></textarea>
<small>Please enter atleast 50 characters (<em class="counter">50</em> remaining)
<input type="button" value="submit" /> <em> or </em> <a href="#" class="simplemodal-close">cancel</a>
</small>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-120590-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<asp:ContentPlaceHolder Id="EndScripts" runat="server">
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="EndScripts" runat="server" />
</body>
</html>
</body>
</html>
</asp:Content>
@@ -1,46 +0,0 @@
<%@ Master Language="C#" MasterPageFile="~/masterpages/Forum.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
<div style="margin-top: 25px;">
<umbraco:Macro linkToCurrent="1" Alias="Breadcrumb" runat="server"></umbraco:Macro>
</div>
<umbraco:Macro runat="server" Language="cshtml">
@if(Model.Parent.NodeTypeAlias != "Release")
{
<h1>Create a new topic in '@Model.Name'</h1>
} else {
<h1>Submit a proposal for release @Model.Parent.Name</h1>
}
</umbraco:Macro>
<div id="editorSideBar" style="float: right; width: 250px; margin-left: 30px;">
<umbraco:Macro runat="server" Language="cshtml">
@if(Model.Parent.NodeTypeAlias != "Release")
{
<div class="box" id="topicsBox" style="display: none">
<h4>Similiar topics</h4>
<small style="padding: 10px; display: block">Maybe your question has already been posted?<br /><strong>Don't worry, the links below open in a new window, you won't loose your post.</strong></small>
<span id="suggestedTopics"></span>
</div>
<div class="notice">
<p>Enter a topic title and your desired topic. <em>if</em> you are looking for help regarding a bug, please post all available information about the umbraco installation in question such as:</p>
<ul>
<li>Umbraco Version</li>
<li>asp.net version</li>
<li>Windows and iis version</li>
<li>Stacktrace</li>
<li>A detailed description of what you did before the issue happened</li>
</ul>
<h4>Issues without proper information will be deleted</h4>
</div>
} else{
<div class="notice" style="padding: 0 1em;">
<h3>IMPORTANT!!!</h3>
<p><strong>Please do not enter feature requests or bugs here. Feature requests must be submitted via the bug tracker.</strong></p>
<p>A proposal is to say "I can build that, this is how I will do it and if you need a helping hand". Then the community can comment with input like "have you thought about this technology to produce feature x", "isn't this already covered by doing this ...", etc.</p>
</div>
}
</umbraco:Macro>
</div>
<div id="editor" style="width: 670px">
<umbraco:Macro Alias="Forum-createTopic" runat="server"></umbraco:Macro>
</div>
</asp:Content>
@@ -1,5 +0,0 @@
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
</asp:Content>
+15 -1
View File
@@ -1 +1,15 @@
<%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %>
<%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %>
<asp:content ContentPlaceHolderId="Main" runat="server">
<div id="body" class="page wrapper">
<div style="margin-top: 25px;">
<umbraco:Macro Alias="Breadcrumb" runat="server"></umbraco:Macro>
</div>
<h1><umbraco:Item field="pageName" runat="server"></umbraco:Item></h1>
<umbraco:Item field="bodyText" runat="server"></umbraco:Item>
</div>
</asp:content>
-75
View File
@@ -1,75 +0,0 @@
<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderId="SpecialContent" runat="server">
<!-- Insert "SpecialContent" markup here -->
</asp:Content>
<asp:Content ContentPlaceHolderId="Head" runat="server">
<script src="/scripts/mapr/jquery.signalR.js" type="text/javascript"></script>
<script src="/scripts/mapr/mapR.js" type="text/javascript"></script>
<script src="/signalr/hubs" type="text/javascript"></script>
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAA0NU1XDEzOML2eyLWhmJ9LBSxfxjTTu64lrS209cfOxNPw1orBxShNTRVj48sdN3ldWVic17nG0GLeA"></script>
<script type="text/javascript" src="http://tile.cloudmade.com/wml/latest/web-maps-lite.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
init_maps();
});
var cloudmade;
var map;
function init_maps(){
cloudmade = new CM.Tiles.CloudMade.Web({key: 'f6690526ff844cc783025e8234a4f0fa', styleId:23746});
map = new CM.Map('map', cloudmade);
var lat = 51.514;
var lng = -0.137;
if (google.loader.ClientLocation) {
lat = google.loader.ClientLocation.latitude;
lng = google.loader.ClientLocation.longitude;
}
map.setCenter(new CM.LatLng(lat,lng), 4);
//map.disableScrollWheelZoom();
}
function renderPin(act){
alert(act);
var location = new CM.LatLng(act.Lat, act.Long);
var CloudMadeIcon = new CM.Icon();
CloudMadeIcon.image = "/images/dropPointer.png";
CloudMadeIcon.iconSize = new CM.Size(8, 13);
CloudMadeIcon.iconAnchor = new CM.Point(4, 13);
var marker= new CM.Marker(location, { title: act.Text, icon: CloudMadeIcon} );
map.addOverlay(marker);
var html = "<div class='makr'><img width='32' height='32' src='" + act.Icon + "'>" +
"<h3 style='text-align: center'><a href='" + act.Url + "'>" + act.Text + "</a></h3>" +
"<small>" + act.Description + "</small>" +
"</div>"
marker.bindInfoWindow(html);
marker.openInfoWindow(html);
}
</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="Main" runat="server">
<div id="map" style="width: 100%; height: 800px"></div>
</asp:Content>
@@ -1,4 +1,4 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ExamineIndexAdmin.ascx.cs" Inherits="usercontrols.Umbraco.ExamineIndexAdmin"%>
<%@ Control Language="C#" AutoEventWireup="true" Inherits="usercontrols.Umbraco.ExamineIndexAdmin" Codebehind="ExamineIndexAdmin.ascx.cs" %>
<asp:Repeater ID="indexManager" runat="server">
<HeaderTemplate>Index manager<br /></HeaderTemplate>
<ItemTemplate>
+7 -1
View File
@@ -19,18 +19,22 @@
<section name="ImageGenConfiguration" type="ImageGen.ImageGenConfigurationHandler,ImageGen" />
<section name="clientDependency" type="ClientDependency.Core.Config.ClientDependencySection, ClientDependency.Core" requirePermission="false" />
</configSections>
<umbracoConfiguration>
<settings configSource="config\umbracoSettings.config" />
<BaseRestExtensions configSource="config\BaseRestExtensions.config" />
<FileSystemProviders configSource="config\FileSystemProviders.config" />
<dashBoard configSource="config\Dashboard.config" />
</umbracoConfiguration>
<urlrewritingnet configSource="config\UrlRewriting.config" />
<microsoft.scripting configSource="config\scripting.config" />
<clientDependency configSource="config\ClientDependency.config" />
<Examine configSource="config\ExamineSettings.config" />
<ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
<log4net configSource="config\log4net.config" />
<appSettings>
<add key="umbracoConfigurationStatus" value="7.2.1" />
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/Hiccup.aspx,~/signalR,~/VSEnterpriseHelper.axd" />
@@ -56,6 +60,7 @@
<add key="enableSimpleMembership" value="false" />
<add key="autoFormsAuthentication" value="false" />
<add key="log4net.Config" value="config\log4net.config" />
<!-- Deli settings -->
<add key="deliProjectRoot" value="1113" />
<add key="deliCartRoot" value="17819" />
@@ -67,6 +72,7 @@
<add key="deli_VAT" value="0.25" />
<add key="impersonateUrl" value="http://our.umbraco.org/member/profile" />
<!-- End Deli settings -->
<!-- uRelease configuration -->
<add key="uReleaseProjectId" value="u4" />
<add key="uReleaseUsername" value="robotto" />
@@ -100,7 +106,7 @@
<!-- REMOVE FOR BETA -->
<!-- added by NH to test foreign membership providers-->
<connectionStrings>
<add name="umbracoDbDSN" connectionString="server=.\SQLExpress;database=our.umbraco.org.clean.v7;user id=sa;password=abc123" providerName="System.Data.SqlClient" />
<add name="umbracoDbDSN" connectionString="server=.\SQLExpress;database=our;user id=web;password=farmer" providerName="System.Data.SqlClient" />
<add name="Marketplace.Data.Properties.Settings.ourConnectionString" connectionString="Data Source=.\SQLExpress;Initial Catalog=our.umbraco.org.clean.v7;User ID=sa;Password=abc123" providerName="System.Data.SqlClient" />
<!--<add name="Elmah.SqlErrorLog" connectionString="Data Source=.\SQLExpress;Initial Catalog=our.umbraco.org.elmah.live;user id=sa;password=abc123" providerName="System.Data.SqlClient" />-->
</connectionStrings>
+1 -2
View File
@@ -27,8 +27,7 @@
<xsl:if test="$currentPage/@level &gt; $minLevel">
<ul id="breadcrumb">
<li>
<a href="/">Home</a>
<xsl:if test="$linkToCurrent = 1 or $currentPage/@level &gt; 2">&separator;</xsl:if>
<a href="/">Our</a>
</li>
<xsl:for-each select="$currentPage/ancestor::*[@isDoc and @level &gt; $minLevel][not(umbracoNaviHide = 1)]">
<li>
-4
View File
@@ -18,8 +18,6 @@
<xsl:template match="/">
<!-- The fun starts here -->
<ul id="topNavigation">
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<xsl:attribute name="class">
@@ -35,8 +33,6 @@
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
@@ -37,7 +37,6 @@
<xsl:if test="uForum:UseMarkdownEditor()">
<xsl:value-of select="umbraco.library:RegisterStyleSheetFile('Markdown.Styles', '/css/forum/pagedown.css')"/>
<xsl:value-of select="umbraco.library:RegisterJavaScriptFile('Markdown.Converter', '/scripts/forum/Markdown.Converter.js')"/>
<xsl:value-of select="umbraco.library:RegisterJavaScriptFile('Markdown.Sanitizer', '/scripts/forum/Markdown.Sanitizer.js')"/>
<xsl:value-of select="umbraco.library:RegisterJavaScriptFile('Markdown.Editor', '/scripts/forum/Markdown.Editor.js')"/>
@@ -45,7 +44,7 @@
<script type="text/javascript">
uForum.ForumEditor("commentBody");
jQuery(document).ready(function(){
<xsl:choose>
<xsl:when test="uForum:UseMarkdownEditor()">
@@ -18,19 +18,19 @@ namespace our
HttpRequest req = ctx.Request;
string path = req.PhysicalPath;
string contentType = "image/jpeg";
if (!File.Exists(path))
{
//return default image
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = contentType;
ctx.Response.WriteFile(ctx.Server.MapPath("~/media/avatar/default.jpg"));
ctx.Response.ContentType = "image/gif";
ctx.Response.WriteFile(ctx.Server.MapPath("~/media/avatar/default.gif"));
}
else
{
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = contentType;
ctx.Response.ContentType = "image/jpeg";
ctx.Response.WriteFile(path);
}
+55 -53
View File
@@ -7,9 +7,10 @@ using System.Web;
using Examine;
using Examine.LuceneEngine;
using System.Data;
using uForum.Businesslogic;
using System.Xml;
using System.Text;
using uForum.Models;
using uForum.Services;
namespace our
{
@@ -35,32 +36,33 @@ namespace our
{
var data = new List<SimpleDataSet>();
foreach (Topic currentTopic in Topic.GetAll().Where(x => x.IsSpam != true))
using(var ts = new TopicService())
using (var cs = new CommentService())
{
//First generate the accumulated comment text:
string commentText = String.Empty;
foreach (Comment currentComment in currentTopic.Comments.Where(x => x.IsSpam != true))
foreach (var currentTopic in ts.GetAll())
{
commentText += umbraco.library.StripHtml(currentComment.Body);
}
//First generate the accumulated comment text:
string commentText = String.Empty;
foreach (var currentComment in cs.GetComments(currentTopic.Id))
commentText += umbraco.library.StripHtml(currentComment.Body);
//Add the item to the index..
data.Add(new SimpleDataSet()
{
//Create the node definition, ensure that it is the same type as referenced in the config
NodeDefinition = new IndexedNode()
//Add the item to the index..
data.Add(new SimpleDataSet()
{
NodeId = currentTopic.Id,
Type = "ForumPosts"
},
//add the data to the row
RowData = new Dictionary<string, string>()
//Create the node definition, ensure that it is the same type as referenced in the config
NodeDefinition = new IndexedNode()
{
NodeId = currentTopic.Id,
Type = "ForumPosts"
},
//add the data to the row
RowData = new Dictionary<string, string>()
{
{ "Title", SanitizeXmlString(currentTopic.Title.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))},
{ "Body", SanitizeXmlString(currentTopic.Body.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))},
{ "Created", currentTopic.Created.ToString()},
{ "Exists", currentTopic.Exists.ToString()},
{ "LatestComment", currentTopic.LatestComment.ToString()},
{ "LatestReplyAuthor", currentTopic.LatestReplyAuthor.ToString()},
{ "Locked", currentTopic.Locked.ToString()},
@@ -72,11 +74,14 @@ namespace our
{"nodeTypeAlias","forumPost"},
{ "CommentsContent", SanitizeXmlString(commentText.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))}
}
});
});
}
return data;
}
return data;
}
public SimpleDataSet CreateNewDocument()
@@ -88,11 +93,6 @@ namespace our
//First generate the accumulated comment text:
string commentText = String.Empty;
foreach (Comment currentComment in forumTopic.Comments.Where(x => x.IsSpam != true))
{
commentText += umbraco.library.StripHtml(currentComment.Body);
}
return new SimpleDataSet()
{
NodeDefinition = new IndexedNode() { NodeId = (++m_CurrentId), Type = "ForumPosts" },
@@ -101,7 +101,6 @@ namespace our
{ "Title", SanitizeXmlString(forumTopic.Title.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))},
{ "Body", SanitizeXmlString(forumTopic.Body.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))},
{ "Created", forumTopic.Created.ToString()},
{ "Exists", forumTopic.Exists.ToString()},
{ "LatestComment", forumTopic.LatestComment.ToString()},
{ "LatestReplyAuthor", forumTopic.LatestReplyAuthor.ToString()},
{ "Locked", forumTopic.Locked.ToString()},
@@ -122,36 +121,39 @@ namespace our
lock (m_Locker)
{
//JobDetailItem jobDetails = new JobDetailItem();
Topic forumTopic = Topic.GetTopic(id);
//First generate the accumulated comment text:
string commentText = String.Empty;
foreach (Comment currentComment in forumTopic.Comments.Where(x => x.IsSpam != true))
using(var ts = new TopicService())
using (var cs = new CommentService())
{
commentText += umbraco.library.StripHtml(currentComment.Body);
}
return new SimpleDataSet()
{
NodeDefinition = new IndexedNode() { NodeId = (id), Type = "ForumPosts" },
RowData = new Dictionary<string, string>()
var forumTopic = ts.GetById(id);
//First generate the accumulated comment text:
string commentText = String.Empty;
foreach (var currentComment in cs.GetComments(forumTopic.Id))
commentText += umbraco.library.StripHtml(currentComment.Body);
return new SimpleDataSet()
{
{ "Title", SanitizeXmlString(forumTopic.Title.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))},
{ "Body", SanitizeXmlString(forumTopic.Body.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))},
{ "Created", forumTopic.Created.ToString()},
{ "Exists", forumTopic.Exists.ToString()},
{ "LatestComment", forumTopic.LatestComment.ToString()},
{ "LatestReplyAuthor", forumTopic.LatestReplyAuthor.ToString()},
{ "Locked", forumTopic.Locked.ToString()},
{ "MemberId", forumTopic.MemberId.ToString()},
{ "ParentId", forumTopic.ParentId.ToString()},
{ "Replies", forumTopic.Replies.ToString()},
{ "Updated", forumTopic.Updated.ToString()},
{ "UrlName", forumTopic.UrlName.ToString()},
{"nodeTypeAlias","forumPost"},
{ "CommentsContent", SanitizeXmlString(commentText.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))}
}
};
NodeDefinition = new IndexedNode() { NodeId = (id), Type = "ForumPosts" },
RowData = new Dictionary<string, string>()
{
{ "Title", SanitizeXmlString(forumTopic.Title.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))},
{ "Body", SanitizeXmlString(forumTopic.Body.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))},
{ "Created", forumTopic.Created.ToString()},
{ "LatestComment", forumTopic.LatestComment.ToString()},
{ "LatestReplyAuthor", forumTopic.LatestReplyAuthor.ToString()},
{ "Locked", forumTopic.Locked.ToString()},
{ "MemberId", forumTopic.MemberId.ToString()},
{ "ParentId", forumTopic.ParentId.ToString()},
{ "Replies", forumTopic.Replies.ToString()},
{ "Updated", forumTopic.Updated.ToString()},
{ "UrlName", forumTopic.UrlName.ToString()},
{"nodeTypeAlias","forumPost"},
{ "CommentsContent", SanitizeXmlString(commentText.Replace("<![CDATA[", string.Empty).Replace("]]>",string.Empty))}
}
};
}
}
}
+7 -46
View File
@@ -7,7 +7,6 @@ using System.Web;
using Examine;
using Examine.LuceneEngine;
using Examine.LuceneEngine.Providers;
using uForum.Businesslogic;
using our;
using umbraco.BusinessLogic;
@@ -17,63 +16,25 @@ namespace our
{
public ForumIndexer()
{
//WB added to show these events are firing...
Log.Add(LogTypes.Debug, -1, "ForumIndexer class events - starting");
//WB 17/4/11 - Comment out events to see if this fixes karma points & email problems
Topic.AfterCreate += new EventHandler<CreateEventArgs>(Topic_AfterCreate);
Topic.AfterUpdate += new EventHandler<UpdateEventArgs>(Topic_AfterUpdate);
Topic.BeforeDelete += new EventHandler<DeleteEventArgs>(Topic_BeforeDelete);
//WB added to show these events have finished firing...
Log.Add(LogTypes.Debug, -1, "ForumIndexer class events - finished");
uForum.Services.TopicService.Created += TopicService_Updated;
uForum.Services.TopicService.Updated += TopicService_Updated;
uForum.Services.TopicService.Deleting += TopicService_Deleted;
}
void Topic_BeforeDelete(object sender, DeleteEventArgs e)
{
Topic t = (Topic)sender;
var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection["ForumIndexer"];
indexer.DeleteFromIndex(t.Id.ToString());
}
static void Topic_AfterUpdate(object sender, UpdateEventArgs e)
void TopicService_Deleted(object sender, uForum.TopicEventArgs e)
{
Topic currentTopic = (Topic)sender;
//WB added to show this event is firing...
Log.Add(LogTypes.Debug, currentTopic.Id, "Topic_AfterUpdate in ForumIndexer() class is starting");
var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection["ForumIndexer"];
var dataSet = ((CustomDataService)indexer.DataService).CreateNewDocument(currentTopic.Id);
var xml = dataSet.RowData.ToExamineXml(dataSet.NodeDefinition.NodeId, dataSet.NodeDefinition.Type);
indexer.ReIndexNode(xml, "documents");
//WB added to show this event is firing...
Log.Add(LogTypes.Debug, currentTopic.Id, "Topic_AfterUpdate in ForumIndexer() class is finishing");
indexer.DeleteFromIndex(e.Topic.Id.ToString());
}
static void Topic_AfterCreate(object sender, CreateEventArgs e)
void TopicService_Updated(object sender, uForum.TopicEventArgs e)
{
Topic currentTopic = (Topic)sender;
//WB added to show this event is firing...
Log.Add(LogTypes.Debug, currentTopic.Id, "Topic_AfterCreate in ForumIndexer() class is starting");
var indexer = (SimpleDataIndexer)ExamineManager.Instance.IndexProviderCollection["ForumIndexer"];
var dataSet = ((CustomDataService)indexer.DataService).CreateNewDocument(currentTopic.Id);
var dataSet = ((CustomDataService)indexer.DataService).CreateNewDocument(e.Topic.Id);
var xml = dataSet.RowData.ToExamineXml(dataSet.NodeDefinition.NodeId, dataSet.NodeDefinition.Type);
indexer.ReIndexNode(xml, "documents");
//WB added to show this event is firing...
Log.Add(LogTypes.Debug, currentTopic.Id, "Topic_AfterCreate in ForumIndexer() class is finishing");
}
}
}
+11 -19
View File
@@ -57,21 +57,17 @@ namespace our.Rest
//Check if member is an admin (in group 'admin')
if (Utills.IsAdmin(_currentMember))
{
//Lets check the memberID of the member we are blocking passed into /base is a valid member..
if (Utills.IsMember(memberId))
{
//Yep - it's valid, lets get that member
Member MemberToBlock = Utills.GetMember(memberId);
//Yep - it's valid, lets get that member
Member MemberToBlock = Utills.GetMember(memberId);
//Now we have the member - lets update the 'blocked' property on the member
MemberToBlock.getProperty("blocked").Value = true;
//Now we have the member - lets update the 'blocked' property on the member
MemberToBlock.getProperty("blocked").Value = true;
//Save the changes
MemberToBlock.Save();
//Save the changes
MemberToBlock.Save();
//It's all good...
return "true";
}
//It's all good...
return "true";
}
//Member not authorised or memberID passed in is not valid
@@ -89,9 +85,7 @@ namespace our.Rest
//Check if member is an admin (in group 'admin')
if (Utills.IsAdmin(_currentMember))
{
//Lets check the memberID of the member we are blocking passed into /base is a valid member..
if (Utills.IsMember(memberId))
{
//Yep - it's valid, lets get that member
Member MemberToBlock = Utills.GetMember(memberId);
@@ -103,7 +97,7 @@ namespace our.Rest
//It's all good...
return "true";
}
}
//Member not authorised or memberID passed in is not valid
@@ -119,8 +113,6 @@ namespace our.Rest
if (Utills.IsHq(_currentMember))
{
//Lets check the memberID of the member we are blocking passed into /base is a valid member..
if (Utills.IsMember(memberId))
{
//Yep - it's valid, lets get that member
var member = Utills.GetMember(memberId);
@@ -131,7 +123,7 @@ namespace our.Rest
//It's all good...
return "true";
}
}
//Member not authorised or memberID passed in is not valid
+18 -10
View File
@@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Web;
using uForum.Services;
using uPowers.BusinessLogic;
using uForum.Businesslogic;
namespace our.custom_Handlers {
@@ -37,17 +37,25 @@ namespace our.custom_Handlers {
uPowers.BusinessLogic.Action a = (uPowers.BusinessLogic.Action)sender;
if (a.Alias == "LikeComment" || a.Alias == "DisLikeComment") {
Comment c = new Comment(e.ItemId);
if (c != null) {
e.ReceiverId = c.MemberId;
}
} else if (a.Alias == "TopicSolved") {
Topic t = Topic.GetTopic(new Comment(e.ItemId).TopicId);
bool hasAnswer = (our.Data.SqlHelper.ExecuteScalar<int>("SELECT answer FROM forumTopics where id = @id", Data.SqlHelper.CreateParameter("@id", t.Id)) > 0);
e.Cancel = hasAnswer;
using (var ts = new TopicService())
using(var cs = new CommentService())
{
if (a.Alias == "LikeComment" || a.Alias == "DisLikeComment")
{
var c = cs.GetById(e.ItemId);
if (c != null)
{
e.ReceiverId = c.MemberId;
}
}
else if (a.Alias == "TopicSolved")
{
var t = ts.GetById(e.ItemId);
e.Cancel = t.Answer > 0;
}
}
}
}
@@ -2,68 +2,52 @@
using System.Collections.Generic;
using System.Linq;
using System.Web;
using uForum.Services;
using umbraco.cms.businesslogic.member;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web;
using uForum;
namespace our.custom_Handlers {
public class ForumPostsCounter : umbraco.BusinessLogic.ApplicationBase {
public class ForumPostsCounter : ApplicationEventHandler {
public ForumPostsCounter() {
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "ForumPostsCounter class events - starting");
uForum.Businesslogic.Topic.AfterCreate += new EventHandler<uForum.Businesslogic.CreateEventArgs>(Topic_AfterCreate);
uForum.Businesslogic.Comment.AfterCreate += new EventHandler<uForum.Businesslogic.CreateEventArgs>(Comment_AfterCreate);
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "ForumPostsCounter class events - finishing");
/*
* This handler updates the members forum posts counter
* So the forum doesnt know about where and how the member stores these counts
*/
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
TopicService.Created += TopicService_Created;
CommentService.Created += CommentService_Created;
}
void Comment_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e) {
uForum.Businesslogic.Comment c = (uForum.Businesslogic.Comment)sender;
void CommentService_Created(object sender, uForum.CommentEventArgs e)
{
if (e.Comment != null && e.Comment.MemberId > 0)
{
var ms = UmbracoContext.Current.Application.Services.MemberService;
var member = ms.GetById(e.Comment.MemberId);
member.IncreaseForumPostCount();
ms.Save(member);
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, c.Id, "Comment_AfterCreate in ForumPostsCounter() class is starting");
Member mem = new Member(c.MemberId);
int posts = 0;
int.TryParse(mem.getProperty("forumPosts").Value.ToString(), out posts);
mem.getProperty("forumPosts").Value = (posts + 1);
mem.Save();
mem.XmlGenerate(new System.Xml.XmlDocument());
//Performs the action NewTopic in case we want to reward people for creating new posts.
uPowers.BusinessLogic.Action a = new uPowers.BusinessLogic.Action("NewComment");
a.Perform(mem.Id, c.Id, "New comment created");
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, c.Id, "Comment_AfterCreate in ForumPostsCounter() class is finishing");
uPowers.BusinessLogic.Action a = new uPowers.BusinessLogic.Action("NewComment");
a.Perform(member.Id, e.Comment.Id, "New comment created");
}
}
void TopicService_Created(object sender, uForum.TopicEventArgs e)
{
if (e.Topic != null && e.Topic.MemberId > 0)
{
var ms = UmbracoContext.Current.Application.Services.MemberService;
var member = ms.GetById(e.Topic.MemberId);
member.IncreaseForumPostCount();
ms.Save(member);
void Topic_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e) {
uForum.Businesslogic.Topic t = (uForum.Businesslogic.Topic)sender;
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, t.Id, "Topic_AfterCreate in ForumPostsCounter() class is starting");
Member mem = new Member(t.MemberId);
int posts = 0;
int.TryParse(mem.getProperty("forumPosts").Value.ToString(), out posts);
mem.getProperty("forumPosts").Value = (posts + 1);
mem.Save();
mem.XmlGenerate(new System.Xml.XmlDocument());
//Performs the action NewTopic in case we want to reward people for creating new posts.
uPowers.BusinessLogic.Action a = new uPowers.BusinessLogic.Action("NewTopic");
a.Perform(mem.Id, t.Id, "New topic created");
//WB added to show these events are firing...
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, t.Id, "Topic_AfterCreate in ForumPostsCounter() class is finishing");
uPowers.BusinessLogic.Action a = new uPowers.BusinessLogic.Action("NewTopic");
a.Perform(member.Id, e.Topic.Id, "New topic created");
}
}
}
@@ -1,60 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace our.custom_Handlers {
public class SanitizerHandler : umbraco.BusinessLogic.ApplicationBase {
public SanitizerHandler() {
uForum.Businesslogic.Topic.BeforeCreate += new EventHandler<uForum.Businesslogic.CreateEventArgs>(Topic_BeforeCreate);
uForum.Businesslogic.Topic.BeforeUpdate += new EventHandler<uForum.Businesslogic.UpdateEventArgs>(Topic_BeforeUpdate);
//uForum.Businesslogic.Comment.BeforeCreate += new EventHandler<uForum.Businesslogic.CreateEventArgs>(Comment_BeforeCreate);
//uForum.Businesslogic.Comment.BeforeUpdate += new EventHandler<uForum.Businesslogic.UpdateEventArgs>(Comment_BeforeUpdate);
uWiki.Businesslogic.WikiPage.BeforeCreate += new EventHandler<uWiki.Businesslogic.CreateEventArgs>(WikiPage_BeforeCreate);
uWiki.Businesslogic.WikiPage.BeforeUpdate += new EventHandler<uWiki.Businesslogic.UpdateEventArgs>(WikiPage_BeforeUpdate);
}
void WikiPage_BeforeUpdate(object sender, uWiki.Businesslogic.UpdateEventArgs e) {
SanitizeWiki((uWiki.Businesslogic.WikiPage)sender);
}
void WikiPage_BeforeCreate(object sender, uWiki.Businesslogic.CreateEventArgs e) {
SanitizeWiki((uWiki.Businesslogic.WikiPage)sender);
}
void Comment_BeforeUpdate(object sender, uForum.Businesslogic.UpdateEventArgs e) {
SanitizeComment((uForum.Businesslogic.Comment)sender);
}
void Comment_BeforeCreate(object sender, uForum.Businesslogic.CreateEventArgs e) {
SanitizeComment((uForum.Businesslogic.Comment)sender);
}
void Topic_BeforeUpdate(object sender, uForum.Businesslogic.UpdateEventArgs e) {
SanitizeTopic((uForum.Businesslogic.Topic)sender);
}
void Topic_BeforeCreate(object sender, uForum.Businesslogic.CreateEventArgs e) {
SanitizeTopic((uForum.Businesslogic.Topic)sender);
}
private void SanitizeTopic(uForum.Businesslogic.Topic t) {
//t.Body = our.Utills.Sanitize(t.Body);
t.Title = our.Utills.Sanitize(t.Title);
}
private void SanitizeComment(uForum.Businesslogic.Comment c) {
c.Body = our.Utills.Sanitize(c.Body);
}
private void SanitizeWiki(uWiki.Businesslogic.WikiPage wp) {
wp.Body = our.Utills.Sanitize(wp.Body);
wp.Title = our.Utills.Sanitize(wp.Title);
}
}
}
+21 -18
View File
@@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Web;
using uForum.Services;
using uPowers.BusinessLogic;
using uForum.Businesslogic;
namespace our.custom_Handlers {
@@ -23,31 +23,34 @@ namespace our.custom_Handlers {
void TopicSolved(object sender, ActionEventArgs e) {
uPowers.BusinessLogic.Action a = (uPowers.BusinessLogic.Action)sender;
if (a.Alias == "TopicSolved") {
Comment c = new Comment(e.ItemId);
if (c != null) {
Topic t = Topic.GetTopic(c.TopicId);
using(var cs = new CommentService())
using (var ts = new TopicService())
{
var c = cs.GetById(e.ItemId);
if (c != null)
{
var t = ts.GetById(c.TopicId);
int answer = our.Data.SqlHelper.ExecuteScalar<int>("SELECT answer FROM forumTopics where id = @id", Data.SqlHelper.CreateParameter("@id", t.Id));
//if performer and author of the topic is the same... go ahead..
if (e.PerformerId == t.MemberId && t.Answer == 0)
{
//if performer and author of the topic is the same... go ahead..
//receiver of points is the comment author.
e.ReceiverId = c.MemberId;
if (e.PerformerId == t.MemberId && answer == 0) {
//remove any previous votes by the author on this comment to ensure the solution is saved instead of just the vote
a.ClearVotes(e.PerformerId, e.ItemId);
//receiver of points is the comment author.
e.ReceiverId = c.MemberId;
//this uses a non-standard coloumn in the forum schema, so this is added manually..
t.Answer = c.Id;
ts.Save(t, false);
}
//remove any previous votes by the author on this comment to ensure the solution is saved instead of just the vote
a.ClearVotes(e.PerformerId, e.ItemId);
//this uses a non-standard coloumn in the forum schema, so this is added manually..
our.Data.SqlHelper.ExecuteNonQuery("UPDATE forumTopics SET answer = @answer WHERE id = @id", Data.SqlHelper.CreateParameter("@id", t.Id), Data.SqlHelper.CreateParameter("@answer", c.Id));
}
}
}
}
@@ -69,7 +72,7 @@ namespace our.custom_Handlers {
uPowers.BusinessLogic.Action a = (uPowers.BusinessLogic.Action)sender;
if (a.Alias == "LikeTopic" || a.Alias == "DisLikeTopic") {
Topic t = Topic.GetTopic(e.ItemId);
var t = uForum.Services.TopicService.Instance.GetById(e.ItemId);
e.ReceiverId = t.MemberId;
}
}
+2 -93
View File
@@ -44,94 +44,6 @@ namespace our {
/*
public static string Sanitize(string html) {
var tagname = "";
Match tag;
var tags = _tags.Matches(html);
List<ReplacePoint> replacePoints = new List<ReplacePoint>();
// iterate through all HTML tags in the input
for (int i = tags.Count - 1; i > -1; i--) {
tag = tags[i];
tagname = tag.Value.ToLower();
if (!_whitelist.IsMatch(tagname)) {
// not on our whitelist? Replace < and > with html entities
//html = html.Remove(tag.Index, tag.Length);
try {
replacePoints.Add(new ReplacePoint(
html.IndexOf('<', tag.Index, tag.Length),
html.LastIndexOf('>', tag.Index, tag.Length)));
} catch { }
} else if (tagname.StartsWith("<img")) {
// detailed <img> tag checking
if (!IsMatch(tagname,
@"<img\s
src=""https?://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+""
(\swidth=""\d{1,3}"")?
(\sheight=""\d{1,3}"")?
(\salt=""[^""]*"")?
(\stitle=""[^""]*"")?
\s?/?>")) {
try {
replacePoints.Add(new ReplacePoint(
html.IndexOf('<', tag.Index, tag.Length),
html.IndexOf('>', tag.Index, tag.Length)));
} catch { }
}
} else if (tagname.StartsWith("<a") && tagname.Contains("{")) {
try {
replacePoints.Add(new ReplacePoint(
html.IndexOf('<', tag.Index, tag.Length),
html.IndexOf('>', tag.Index, tag.Length)));
} catch { }
}
}
char[] htmlchars = html.ToCharArray();
foreach (ReplacePoint rp in replacePoints) {
if (rp.open > -1) {
htmlchars[rp.open] = '°';
}
if (rp.close > -1) {
htmlchars[rp.close] = '³';
}
}
html = string.Empty;
foreach (char character in htmlchars) {
html += character;
}
html = html.Replace("°", "&lt;");
html = html.Replace("³", "&gt;");
html = html.Replace("[code]", "<pre>");
html = html.Replace("[/code]", "</pre>");
return html;
}
*/
/// <summary>
/// Utility function to match a regex pattern: case, whitespace, and line insensitive
/// </summary>
@@ -148,10 +60,6 @@ namespace our {
return m;
}
public static bool IsMember(int id) {
return (uForum.Businesslogic.Data.SqlHelper.ExecuteScalar<int>("select count(nodeid) from cmsMember where nodeid = '" + id + "'") > 0);
}
public static bool IsAdmin(int id)
{
Member m = new Member(id);
@@ -239,6 +147,7 @@ namespace our {
}
/*
public static XPathNodeIterator ProjectsContributing(int memberId)
{
return uForum.Businesslogic.Data.GetDataSet
@@ -249,7 +158,7 @@ namespace our {
{
return uForum.Businesslogic.Data.GetDataSet
("SELECT * FROM projectContributors WHERE projectId = " + projectId, "contributors");
}
}*/
}
public struct ReplacePoint {
+8 -47
View File
@@ -250,7 +250,6 @@
<Compile Include="custom Handlers\memberSave.cs" />
<Compile Include="custom Handlers\ProjectsEnsureGuid.cs" />
<Compile Include="custom Handlers\projectVote.cs" />
<Compile Include="custom Handlers\Sanitizer.cs" />
<Compile Include="custom Handlers\TopicVote.cs" />
<Compile Include="Hiccup.cs">
<SubType>ASPXCodeBehind</SubType>
@@ -274,27 +273,6 @@
<Compile Include="usercontrols\acceptTos.ascx.designer.cs">
<DependentUpon>acceptTos.ascx</DependentUpon>
</Compile>
<Compile Include="usercontrols\ForumSpamListComments.ascx.cs">
<DependentUpon>ForumSpamListComments.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="usercontrols\ForumSpamListComments.ascx.designer.cs">
<DependentUpon>ForumSpamListComments.ascx</DependentUpon>
</Compile>
<Compile Include="usercontrols\ForumSpamListTopics.ascx.cs">
<DependentUpon>ForumSpamListTopics.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="usercontrols\ForumSpamListTopics.ascx.designer.cs">
<DependentUpon>ForumSpamListTopics.ascx</DependentUpon>
</Compile>
<Compile Include="usercontrols\ForumSpamCleaner.ascx.cs">
<DependentUpon>ForumSpamCleaner.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="usercontrols\ForumSpamCleaner.ascx.designer.cs">
<DependentUpon>ForumSpamCleaner.ascx</DependentUpon>
</Compile>
<Compile Include="usercontrols\EventEditor.ascx.cs">
<DependentUpon>EventEditor.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -323,13 +301,6 @@
<Compile Include="usercontrols\Forgotpassword.ascx.designer.cs">
<DependentUpon>Forgotpassword.ascx</DependentUpon>
</Compile>
<Compile Include="usercontrols\HeaderLogin.ascx.cs">
<DependentUpon>HeaderLogin.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="usercontrols\HeaderLogin.ascx.designer.cs">
<DependentUpon>HeaderLogin.ascx</DependentUpon>
</Compile>
<Compile Include="usercontrols\InsertImage.ascx.cs">
<DependentUpon>InsertImage.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -398,31 +369,25 @@
<Content Include="usercontrols\acceptTos.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\ForumSpamListComments.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\ForumSpamListTopics.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\ForumSpamCleaner.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\ExamineSearchResults.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\Forgotpassword.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\HeaderLogin.ascx">
<Content Include="usercontrols\Login.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\Login.ascx" />
<Content Include="usercontrols\ProjectCollabRequest.ascx" />
<Content Include="usercontrols\ProjectEditor.ascx" />
<Content Include="usercontrols\ProjectEditor.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\ProjectFileUpload.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\ProjectForums.ascx" />
<Content Include="usercontrols\ProjectForums.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="usercontrols\Signup.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
@@ -446,13 +411,9 @@
<Name>uPowers</Name>
</ProjectReference>
<ProjectReference Include="..\uRepo\uRepo.csproj">
<Project>{47FD2B14-1653-4052-AD53-1871A8F85E0E}</Project>
<Project>{47fd2b14-1653-4052-ad53-1871a8f85e0e}</Project>
<Name>uRepo</Name>
</ProjectReference>
<ProjectReference Include="..\uSearch\uSearch.csproj">
<Project>{6B5FE138-1713-4A97-AE6D-01B9293AC825}</Project>
<Name>uSearch</Name>
</ProjectReference>
<ProjectReference Include="..\uWiki\uWiki.csproj">
<Project>{996601FA-5C0E-46A6-B39D-2863BADC80D8}</Project>
<Name>uWiki</Name>
@@ -93,7 +93,8 @@ namespace our.usercontrols
return result["url"];
}
else if (result["__IndexType"] == "documents")
return uForum.Library.Xslt.NiceTopicUrl(result.Id);
return "TODO";
//return uForum.Library.NiceTopicUrl(result.Id);
else
return string.Empty;
}
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using System.Web.UI.WebControls;
using uForum.Businesslogic;
using uForum;
using umbraco.cms.businesslogic.member;
namespace uForum.usercontrols
@@ -16,8 +16,9 @@ namespace uForum.usercontrols
protected void NotSpamComment(Object sender, CommandEventArgs e)
{
var id = int.Parse(e.CommandArgument.ToString());
var comment = Comment.GetComment(id, true);
var comment = Services.CommentService.Instance().GetById(id);
comment.IsSpam = false;
comment.Save(true);
// Set reputation to at least 50 so their next posts won't be automatically marked as spam
@@ -1,17 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HeaderLogin.ascx.cs" Inherits="our.usercontrols.HeaderLogin" %>
<asp:PlaceHolder ID="ph_main" runat="server">
<span class="memberProfileInfo">
<asp:Literal ID="lt_LoggedInmsg" runat="server">You are logged in as <strong>%name%</strong> &mdash; Your karma: <span title="Your karma: %karma%">%karma%</span></asp:Literal>
<asp:Literal ID="lt_notLoggedInmsg" runat="server">You are not logged in</asp:Literal>
</span>
<asp:HyperLink ID="hl_profile" CssClass="memberLoginLink" runat="server">Your profile</asp:HyperLink>
<asp:LinkButton ID="lb_logout" OnClick="logout_click" CssClass="memberLoginLink" runat="server">Log out</asp:LinkButton>
<asp:HyperLink ID="hl_login" CssClass="memberLoginLink" runat="server">Log in</asp:HyperLink>
<asp:HyperLink ID="hl_create" CssClass="memberCreateLink" runat="server">Create a profile</asp:HyperLink>
</asp:PlaceHolder>
@@ -1,251 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using umbraco;
using umbraco.cms.businesslogic.member;
using umbraco.BusinessLogic;
namespace our.usercontrols
{
public partial class HeaderLogin : System.Web.UI.UserControl
{
public int ProfilePage { get; set; }
public int LoginPage { get; set; }
public int CreatePage { get; set; }
public int BlockedPage { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
//kill member cookies with an invalid id-guid combo
KillInvalidMemberCookies();
if (Member.IsLoggedOn())
uForum.Library.Utills.CheckForSpam(Member.GetCurrentMember());
toggleControls(Member.IsLoggedOn());
hl_login.NavigateUrl = umbraco.library.NiceUrl(LoginPage) + "?redirectUrl=" + Server.UrlEncode(Request.Url.ToString());
hl_profile.NavigateUrl = umbraco.library.NiceUrl(ProfilePage);
hl_create.NavigateUrl = umbraco.library.NiceUrl(CreatePage);
RegisterIP();
}
private void KillInvalidMemberCookies()
{
//WB updated as in 4.7 RC the member cookie merged into one cookie now
/*
string UmbracoMemberIdCookieKey = "umbracoMemberId";
string UmbracoMemberGuidCookieKey = "umbracoMemberGuid";
string UmbracoMemberLoginCookieKey = "umbracoMemberLogin";
*/
string umbracoMemberCookieKey = "UMB_MEMBER";
string umbracoMemberCookieValue = StateHelper.GetCookieValue(umbracoMemberCookieKey);
if (HasCookieValue(umbracoMemberCookieKey))
{
//WB split the cookie values with 4.7 RC cookie change
string[] umbracoMemberCookieValueSplit = umbracoMemberCookieValue.Split(new Char[] { '+' });
string UmbracoMemberIdCookieValue = umbracoMemberCookieValueSplit[0].ToString();
string UmbracoMemberGuidCookieValue = umbracoMemberCookieValueSplit[1].ToString();
string UmbracoMemberLoginCookieValue = umbracoMemberCookieValueSplit[2].ToString();
int currentMemberId = 0;
string currentGuid = "";
/*
int.TryParse(StateHelper.GetCookieValue(UmbracoMemberIdCookieKey), out currentMemberId);
currentGuid = StateHelper.GetCookieValue(UmbracoMemberGuidCookieKey);
*/
int.TryParse(UmbracoMemberIdCookieValue, out currentMemberId);
currentGuid = UmbracoMemberGuidCookieValue;
if (currentMemberId > 0 && !memberValid(currentMemberId, currentGuid))
{
/*
//not valid
KillCookie(UmbracoMemberGuidCookieKey,"umbraco.com");
KillCookie(UmbracoMemberLoginCookieKey, "umbraco.com");
KillCookie(UmbracoMemberIdCookieKey,"umbraco.com");
*/
//WB updated as in 4.7 RC the member cookie merged into one cookie now
KillCookie(umbracoMemberCookieKey, "umbraco.com");
KillCookie(FormsAuthentication.FormsCookieName, "umbraco.com");
FormsAuthentication.SignOut();
Response.Redirect("/", true);
}
}
}
public bool HasCookieValue(string name)
{
if(Request.Cookies[name] == null)
{
return false;
}
if(string.IsNullOrEmpty(Request.Cookies[name].Value))
{
return false;
}
return true;
}
private void KillCookie(string name, string domain)
{
HttpCookie cookie = new HttpCookie(name, "0");
cookie.Domain = domain;
cookie.Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(cookie);
}
private static bool memberValid(int id, string uniqueID)
{
if (HttpContext.Current.Session["validmember"] == null)
{
HttpContext.Current.Session["validmember"] = umbraco.BusinessLogic.Application.SqlHelper.ExecuteScalar<int>("select count(id) from umbracoNode where id = @id and uniqueID = @uniqueID",
umbraco.BusinessLogic.Application.SqlHelper.CreateParameter("@id", id),
umbraco.BusinessLogic.Application.SqlHelper.CreateParameter("@uniqueID", uniqueID.ToUpper())) == 1;
}
return (bool)HttpContext.Current.Session["validmember"];
}
protected void logout_click(object sender, EventArgs e)
{
if (umbraco.library.IsLoggedOn())
{
umbraco.cms.businesslogic.member.Member mem = umbraco.cms.businesslogic.member.Member.GetCurrentMember();
umbraco.cms.businesslogic.member.Member.RemoveMemberFromCache(mem);
umbraco.cms.businesslogic.member.Member.ClearMemberFromClient(mem);
uForum.Businesslogic.ForumEditor.ClearEditorChoiceCookie();
Response.Redirect(umbraco.presentation.nodeFactory.Node.GetCurrent().Url);
}
}
private void RegisterIP()
{
if (umbraco.library.IsLoggedOn())
{
string ip = HttpContext.Current.Request.UserHostAddress;
umbraco.cms.businesslogic.member.Member mem = umbraco.cms.businesslogic.member.Member.GetCurrentMember();
if (mem != null)
{
if (mem.getProperty("ip") != null && mem.getProperty("ip").Value.ToString() != ip)
{
mem.getProperty("ip").Value = ip;
mem.Save();
}
if (mem.getProperty("blocked") != null && mem.getProperty("blocked").Value.ToString() == "1")
{
umbraco.cms.businesslogic.member.Member.RemoveMemberFromCache(mem);
umbraco.cms.businesslogic.member.Member.ClearMemberFromClient(mem);
Response.Redirect(umbraco.library.NiceUrl(BlockedPage));
}
// if terms of service is not accepted and we're not on the Terms of Service page, redirect
if (!Request.Url.PathAndQuery.ToLower().StartsWith("/termsofservice") && mem.getProperty("tos") != null && mem.getProperty("tos").Value.ToString() == "")
{
Response.Redirect("/termsofservice");
}
}
}
}
public static bool IsMember(int id)
{
return (uForum.Businesslogic.Data.SqlHelper.ExecuteScalar<int>("select count(nodeid) from cmsMember where nodeid = '" + id + "'") > 0);
}
private void toggleControls(bool state)
{
bool _state = state;
Member m = umbraco.cms.businesslogic.member.Member.GetCurrentMember();
HttpCookie c = Request.Cookies["umbracoMemberId"];
int cMid = 0;
if (c != null && int.TryParse(c.Value, out cMid))
{
if (cMid > 0 && !IsMember(cMid))
{
foreach (string name in Request.Cookies.AllKeys)
{
Request.Cookies[name].Expires = DateTime.Now;
}
}
}
if (m == null)
{
_state = false;
/*
foreach (HttpCookie hc in Request.Cookies.) {
hc.Expires = DateTime.Now;
}
*/
//FormsAuthentication.SignOut();
}
else
{
//WB 17/4/11 - When I deployed latest DLL for logging events this line caused a YSOD
//I dont think this cookie no longer exists, as in 4.7 the cookie member items seperated into different cookies
//Page.Trace.Write(Request.Cookies["UMB_MEMBER"].Value);
//WB 17/4/11 - replace with 3 indivudal calls
//Page.Trace.Write(Request.Cookies["umbracoMemberId"].Value);
//Page.Trace.Write(Request.Cookies["umbracoMemberGuid"].Value);
//Page.Trace.Write(Request.Cookies["umbracoMemberLogin"].Value);
}
lb_logout.Visible = _state;
hl_login.Visible = !_state;
lt_LoggedInmsg.Visible = _state;
lt_notLoggedInmsg.Visible = !_state;
hl_profile.Visible = _state;
hl_create.Visible = !_state;
if (_state)
{
lt_LoggedInmsg.Text = lt_LoggedInmsg.Text.Replace("%name%", m.Text);
if (m.HasProperty("reputationCurrent"))
{
lt_LoggedInmsg.Text = lt_LoggedInmsg.Text.Replace("%karma%",
m.getProperty("reputationCurrent").Value.ToString());
}
}
}
}
}
@@ -1,78 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace our.usercontrols {
public partial class HeaderLogin {
/// <summary>
/// ph_main control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.PlaceHolder ph_main;
/// <summary>
/// lt_LoggedInmsg control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal lt_LoggedInmsg;
/// <summary>
/// lt_notLoggedInmsg control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal lt_notLoggedInmsg;
/// <summary>
/// hl_profile control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hl_profile;
/// <summary>
/// lb_logout control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lb_logout;
/// <summary>
/// hl_login control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hl_login;
/// <summary>
/// hl_create control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hl_create;
}
}
@@ -9,21 +9,12 @@ namespace our.usercontrols
{
protected void Page_Load(object sender, EventArgs e)
{
if (uForum.Businesslogic.ForumEditor.UseMarkdownEditor())
{
InsertImageMarkdown1.Visible = true;
InsertImageMarkdown2.Visible = true;
InsertImageMarkdown3.Visible = true;
InsertImageRte.Visible = false;
}
else
{
InsertImageMarkdown1.Visible = false;
InsertImageMarkdown2.Visible = false;
InsertImageMarkdown3.Visible = false;
InsertImageRte.Visible = true;
}
}
}
protected void btnUpload_Click(object sender, EventArgs e)
{
+1 -2
View File
@@ -24,8 +24,7 @@ namespace our.usercontrols {
if (m != null) {
umbraco.cms.businesslogic.member.Member.AddMemberToCache(m, false, new TimeSpan(30, 0, 0, 0));
uForum.Businesslogic.ForumEditor.SetEditorChoiceFromMemberProfile(m.Id);
if (!string.IsNullOrEmpty(redirectUrl))
Response.Redirect(redirectUrl);
@@ -4,13 +4,15 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using uForum.Models;
using uForum.Services;
using umbraco.cms.businesslogic.member;
using umbraco.cms.businesslogic.web;
using uForum.Businesslogic;
using umbraco.presentation.nodeFactory;
namespace our.usercontrols {
public partial class ProjectForums : System.Web.UI.UserControl {
protected void Page_Load(object sender, EventArgs e) {
if (!Page.IsPostBack) {
@@ -24,30 +26,36 @@ namespace our.usercontrols {
if ((int)d.getProperty("owner").Value == m.Id) {
holder.Visible = true;
rp_forums.DataSource = uForum.Businesslogic.Forum.Forums(pId);
rp_forums.DataBind();
int fId = 0;
if (!string.IsNullOrEmpty(Request.QueryString["forum"]) && int.TryParse(Request.QueryString["forum"], out fId)) {
uForum.Businesslogic.Forum f = new Forum(fId);
tb_desc.Text = f.Description;
tb_name.Text = f.Title;
bt_submit.CommandArgument = f.Id.ToString();
bt_delete.CommandArgument = f.Id.ToString();
bt_submit.CommandName = "edit";
ph_add.Visible = true;
ph_edit.Visible = true;
using (var fs = new ForumService())
{
rp_forums.DataSource = fs.GetForums(pId);
rp_forums.DataBind();
} else if (!string.IsNullOrEmpty(Request.QueryString["add"])) {
ph_add.Visible = true;
ph_edit.Visible = false;
int fId = 0;
if (!string.IsNullOrEmpty(Request.QueryString["forum"]) && int.TryParse(Request.QueryString["forum"], out fId))
{
var f = fs.GetById(fId);
tb_desc.Text = f.Description;
tb_name.Text = f.Title;
bt_submit.CommandArgument = f.Id.ToString();
bt_delete.CommandArgument = f.Id.ToString();
bt_submit.CommandName = "edit";
ph_add.Visible = true;
ph_edit.Visible = true;
}
else if (!string.IsNullOrEmpty(Request.QueryString["add"]))
{
ph_add.Visible = true;
ph_edit.Visible = false;
}
}
}
}
@@ -59,7 +67,7 @@ namespace our.usercontrols {
protected void bindForum(object sender, RepeaterItemEventArgs e) {
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) {
uForum.Businesslogic.Forum f = (uForum.Businesslogic.Forum)e.Item.DataItem;
var f = (Forum)e.Item.DataItem;
Literal _title = (Literal)e.Item.FindControl("lt_titel");
Literal _desc = (Literal)e.Item.FindControl("lt_desc");
Literal _link = (Literal)e.Item.FindControl("lt_link");
@@ -120,12 +128,14 @@ namespace our.usercontrols {
}
var forum = new uForum.Businesslogic.Forum(fId);
if (forum.Exists)
using (var fs = new ForumService())
{
forum.Delete();
var f = fs.GetById(fnode.Id);
if (f != null)
fs.Delete(f);
}
@@ -173,6 +173,7 @@ namespace our.usercontrols
if (spamResult != null && spamResult.TotalScore >= int.Parse(ConfigurationManager.AppSettings["PotentialSpammerThreshold"]))
{
spamResult.MemberId = _member.Id;
uForum.Library.Utills.AddMemberToPotentialSpamGroup(_member);
uForum.Library.Utills.SendPotentialSpamMemberMail(spamResult);
}
+84
View File
@@ -0,0 +1,84 @@
using System.Linq;
using System.Web;
using System.Web.Http;
using umbraco.cms.businesslogic.web;
using umbraco.NodeFactory;
using Umbraco.Web.WebApi;
namespace uForum.Api
{
public class ForumAdminController : UmbracoApiController
{
private const string ModeratorRoles = "admin,HQ,Core,MVP";
[HttpGet]
[MemberAuthorize(AllowGroup = "admin")]
public string DeleteTopic(int topicId)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
topic.Delete();
return "true";
}
[HttpGet]
[MemberAuthorize(AllowGroup = ModeratorRoles)]
public string MarkTopicAsSpam(int topicId)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
topic.MarkAsSpam();
return "true";
}
[HttpGet]
[MemberAuthorize(AllowGroup = ModeratorRoles)]
public string MarkTopicAsHam(int topicId)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
topic.MarkAsHam();
return "true";
}
[HttpGet]
[MemberAuthorize(AllowGroup = "admin")]
public string MoveTopic(int topicId, int newForumId)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
topic.Move(newForumId);
return Xslt.NiceTopicUrl(topic.Id);
}
[HttpGet]
[MemberAuthorize(AllowGroup = "admin")]
public string DeleteComment(int commentId)
{
var comment = new Businesslogic.Comment(commentId);
comment.Delete();
return "true";
}
[HttpGet]
[MemberAuthorize(AllowGroup = ModeratorRoles)]
public string MarkCommentAsSpam(int commentId)
{
var comment = new Businesslogic.Comment(commentId);
comment.MarkAsSpam();
return "true";
}
[HttpGet]
[MemberAuthorize(AllowGroup = ModeratorRoles)]
public string MarkCommentAsHam(int commentId)
{
var comment = new Businesslogic.Comment(commentId);
comment.MarkAsHam();
return "true";
}
}
}
+84 -126
View File
@@ -1,164 +1,122 @@
using System.Linq;
using System.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using uForum.Library;
using umbraco.cms.businesslogic.web;
using umbraco.NodeFactory;
using uForum.Models;
using uForum.Services;
using Umbraco.Web.WebApi;
namespace uForum.Api
{
[MemberAuthorize( AllowType="member" )]
public class ForumController : UmbracoApiController
{
private const string ModeratorRoles = "admin,HQ,Core,MVP";
[HttpGet]
public string TopicUrl(int topicId)
{
HttpContext.Current.Response.Redirect(Xslt.NiceTopicUrl(topicId));
HttpContext.Current.Response.End();
return "";
}
{
/* COMMENTS */
[HttpPost]
public string NewTopic(int forumId)
public void Comment(CommentViewModel model)
{
var node = new Node(forumId);
var currentMemberId = Members.GetCurrentMember().Id;
if (currentMemberId > 0 && Access.HasAccces(node.Id, currentMemberId))
using (var cs = new CommentService())
{
var title = HttpContext.Current.Request["title"];
var body = HttpContext.Current.Request["body"];
var tags = HttpContext.Current.Request["tags"];
var topic = Businesslogic.Topic.Create(forumId, title, body, currentMemberId);
return Xslt.NiceTopicUrl(topic.Id);
var c = new Comment();
c.Body = model.Body;
c.MemberId = Members.GetCurrentMemberId();
c.Created = DateTime.Now;
c.ParentCommentId = model.Parent;
c.TopicId = model.Topic;
cs.Save(c);
}
return "0";
}
[HttpPost]
public string EditTopic(int topicId)
[HttpPut]
public void Comment(int id, CommentViewModel model)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
if (topic.Editable(Members.GetCurrentMember().Id) == false)
return "0";
var title = HttpContext.Current.Request["title"];
var body = HttpContext.Current.Request["body"];
var tags = HttpContext.Current.Request["tags"];
topic.Body = body;
topic.Title = title;
//topic.Tags = tags;
topic.Save(false);
return Xslt.NiceTopicUrl(topic.Id);
}
[HttpPost]
public string NewComment(int topicId, int itemsPerPage)
{
var currentMemberId = Members.GetCurrentMember().Id;
if (currentMemberId > 0 && topicId > 0)
using (var cs = new CommentService())
{
var body = HttpContext.Current.Request["body"];
var comment = Businesslogic.Comment.Create(topicId, body, currentMemberId);
var c = cs.GetById(id);
if (c == null)
throw new Exception("Comment not found");
return Xslt.NiceCommentUrl(comment.TopicId, comment.Id, itemsPerPage);
if(c.MemberId != Members.GetCurrentMemberId())
throw new Exception("You cannot edit this comment");
c.Body = model.Body;
cs.Save(c);
}
return "";
}
[HttpPost]
public string EditComment(int commentId, int itemsPerPage)
[HttpDelete]
public void Comment(int id)
{
var comment = new Businesslogic.Comment(commentId);
if (comment.Editable(Members.GetCurrentMember().Id))
using (var cs = new CommentService())
{
var body = HttpContext.Current.Request["body"];
comment.Body = body;
comment.Save();
var c = cs.GetById(id);
return Xslt.NiceCommentUrl(comment.TopicId, comment.Id, itemsPerPage);
if (c == null)
throw new Exception("Comment not found");
if (c.MemberId != Members.GetCurrentMemberId())
throw new Exception("You cannot delete this comment");
cs.Delete(c);
}
return "";
}
[HttpGet]
[MemberAuthorize(AllowGroup = "admin")]
public string DeleteTopic(int topicId)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
topic.Delete();
return "true";
/* TOPICS */
[HttpPost]
public void Topic(TopicViewModel model)
{
using (var ts = new TopicService())
{
var t = new Topic();
t.Body = model.Body;
t.MemberId = Members.GetCurrentMemberId();
t.Created = DateTime.Now;
t.ParentId = model.Forum;
ts.Save(t);
}
}
[HttpGet]
[MemberAuthorize(AllowGroup = ModeratorRoles)]
public string MarkTopicAsSpam(int topicId)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
topic.MarkAsSpam();
return "true";
[HttpPut]
public void Topic(int id, TopicViewModel model)
{
using (var cs = new TopicService())
{
var c = cs.GetById(id);
if (c == null)
throw new Exception("Topic not found");
if (c.MemberId != Members.GetCurrentMemberId())
throw new Exception("You cannot edit this topic");
c.Body = model.Body;
cs.Save(c);
}
}
[HttpGet]
[MemberAuthorize(AllowGroup = ModeratorRoles)]
public string MarkTopicAsHam(int topicId)
[HttpDelete]
public void Topic(int id)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
topic.MarkAsHam();
using (var cs = new TopicService())
{
var c = cs.GetById(id);
return "true";
}
if (c == null)
throw new Exception("Topic not found");
[HttpGet]
[MemberAuthorize(AllowGroup = "admin")]
public string MoveTopic(int topicId, int newForumId)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
topic.Move(newForumId);
if (c.MemberId != Members.GetCurrentMemberId())
throw new Exception("You cannot delete this topic");
return Xslt.NiceTopicUrl(topic.Id);
}
[HttpGet]
[MemberAuthorize(AllowGroup = "admin")]
public string DeleteComment(int commentId)
{
var comment = new Businesslogic.Comment(commentId);
comment.Delete();
return "true";
}
[HttpGet]
[MemberAuthorize(AllowGroup = ModeratorRoles)]
public string MarkCommentAsSpam(int commentId)
{
var comment = new Businesslogic.Comment(commentId);
comment.MarkAsSpam();
return "true";
}
[HttpGet]
[MemberAuthorize(AllowGroup = ModeratorRoles)]
public string MarkCommentAsHam(int commentId)
{
var comment = new Businesslogic.Comment(commentId);
comment.MarkAsHam();
return "true";
cs.Delete(c);
}
}
}
}
+62
View File
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using uForum.Models;
using uForum.Services;
using Umbraco.Web.WebApi;
namespace uForum.Api
{
[MemberAuthorize(AllowType = "member")]
public class TopicController : UmbracoApiController
{
public void Post(TopicViewModel model)
{
using (var ts = new TopicService())
{
var t = new Topic();
t.Body = model.Body;
t.MemberId = Members.GetCurrentMemberId();
t.Created = DateTime.Now;
t.ParentId = model.Forum;
ts.Save(t);
}
}
public void Put(int id, TopicViewModel model)
{
using (var cs = new TopicService())
{
var c = cs.GetById(id);
if (c == null)
throw new Exception("Topic not found");
if (c.MemberId != Members.GetCurrentMemberId())
throw new Exception("You cannot edit this topic");
c.Body = model.Body;
cs.Save(c);
}
}
//api/topic
public void Delete(int id)
{
using (var cs = new TopicService())
{
var c = cs.GetById(id);
if (c == null)
throw new Exception("Topic not found");
if (c.MemberId != Members.GetCurrentMemberId())
throw new Exception("You cannot delete this topic");
cs.Delete(c);
}
}
}
}
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace uForum
{
public static class EventExtensions
{
public static void Raise<T>(this EventHandler<T> handler, object sender, T args) where T : EventArgs
{
if (handler != null) handler(sender, args);
}
//returns true if there is no handler or if the handler doesnt set Cancel to true
public static bool RaiseAndContinue<T>(this EventHandler<T> handler, object sender, T args) where T : CancelEventArgs
{
if (handler == null)
return true;
handler(sender, args);
return (args.Cancel != true);
}
}
}
+7
View File
@@ -17,6 +17,13 @@ namespace uForum
public string CancellationReason { get; set; }
}
public class ForumEventArgs : System.ComponentModel.CancelEventArgs
{
public Models.Forum Forum { get; set; }
public string CancellationReason { get; set; }
}
/* Events */
public class CreateEventArgs : System.ComponentModel.CancelEventArgs { }
public class UpdateEventArgs : System.ComponentModel.CancelEventArgs { }
-63
View File
@@ -1,63 +0,0 @@
//using System.Linq;
//using System.Web;
//using System.Xml;
//using umbraco;
//namespace uForum
//{
// public class ForumChangeTemplate : UmbracoDefault
// {
// public ForumChangeTemplate()
// {
// AfterRequestInit += HandleAfterRequestInit;
// }
// private static void HandleAfterRequestInit(object sender, RequestInitEventArgs eventArgs)
// {
// HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler", "init");
// var url = HttpContext.Current.Request.RawUrl;
// url = url.Replace(".aspx", string.Empty);
// if (url.Length <= 0)
// return;
// 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 = requestHandler.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);
// HttpContext.Current.Trace.Write("umbraco.faltTemplateHandler", topicId + " " + urlNode.Name);
// }
// if (urlNode == null || topicId == "" || urlNode.Name != "Forum")
// return;
// var page = (UmbracoDefault) sender;
// page.MasterPageFile = template.GetMasterPageName(eventArgs.Page.Template, "displaytopic");
// HttpContext.Current.Items["RedirectID"] = int.Parse(urlNode.Attributes.GetNamedItem("id").Value);
// 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"]));
// }
// }
//}
+115
View File
@@ -0,0 +1,115 @@
using HtmlAgilityPack;
using MarkdownSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using uForum.Library;
using uForum.Models;
using uForum.Services;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
namespace uForum
{
public static class ForumExtensions
{
public static IEnumerable<Comment> ChildComments(this Comment comment)
{
if (comment.HasChildren)
{
using (var cs = new CommentService())
{
return cs.GetChildComments(comment.Id);
}
}
return new List<Comment>();
}
public static string ConvertToRelativeTime(this DateTime date)
{
var TS = DateTime.Now.Subtract(date);
var span = int.Parse(Math.Round(TS.TotalSeconds, 0).ToString());
if (span < 60)
return "1 minute ago";
if (span >= 60 && span < 3600)
return string.Concat(Math.Round(TS.TotalMinutes), " minutes ago");
if (span >= 3600 && span < 7200)
return "1 hour ago";
if (span >= 3600 && span < 86400)
return string.Concat(Math.Round(TS.TotalHours), " hours ago");
if (span >= 86400 && span < 172800)
return "1 day ago";
if (span >= 172800 && span < 604800)
return string.Concat(Math.Round(TS.TotalDays), " days ago");
if (span >= 604800 && span < 1209600)
return "1 week ago";
if (span >= 1209600 && span < 2592000)
return string.Concat(Math.Round(TS.TotalDays), " days ago");
if (span >= 2592000 && span < 26920000)
return "Several months ago";
return "More then a year ago";
}
public static HtmlString Sanitize(this string html){
// Run it through Markdown first
var md = new Markdown();
html = md.Transform(html);
// Linkify images if they are shown as resized versions (only relevant for new Markdown comments)
var doc = new HtmlDocument();
doc.LoadHtml(html);
var root = doc.DocumentNode;
if (root != null)
{
var images = root.SelectNodes("//img");
if (images != null)
{
var replace = false;
foreach (var image in images)
{
var src = image.GetAttributeValue("src", "");
var orgSrc = src.Replace("rs/", "");
if (src == orgSrc || image.ParentNode.Name == "a") continue;
var a = doc.CreateElement("a");
a.SetAttributeValue("href", orgSrc);
a.SetAttributeValue("target", "_blank");
a.AppendChild(image.Clone());
image.ParentNode.ReplaceChild(a, image);
replace = true;
}
if (replace)
{
html = root.OuterHtml;
}
}
}
return new HtmlString(Utills.Sanitize(html));
}
}
}
-208
View File
@@ -1,208 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.Xml.XPath;
namespace uForum.Library {
/// <summary>
/// This class contains raw xml from the database server, so extra coloumns addded etc, will be included in these feeds.
/// These are uncached feeds, so should only be used with macros that
/// </summary>
[Umbraco.Core.Macros.XsltExtension("uForum.raw")]
public class RawXml {
public static XPathNodeIterator TopicsWithParticipation(int memberId, int maxItems, int page) {
// Check for paging
int pageSize = maxItems;
int pageStart = page;
int pageEnd = ((page + 1) * pageSize);
if (pageStart > 0)
{
pageStart = (page * pageSize) + 1;
}
string sql = @"WITH Topics AS
(
SELECT forumTopics.*, ROW_NUMBER() OVER (ORDER BY updated DESC) AS RowNumber
from forumTopics
where id IN(
SELECT forumTopics.id
FROM [forumTopics]
LEFT JOIN forumComments ON forumComments.topicId = forumTopics.id
where forumTopics.memberId = " + memberId + " OR forumComments.memberId = " + memberId + @"
)
)
SELECT id, parentId, RowNumber, memberId, title, body, created, updated, locked, latestReplyAuthor, latestComment, replies, score, urlname, answer
FROM Topics
WHERE RowNumber BETWEEN " + pageStart + " AND " + pageEnd + @"
ORDER BY RowNumber ASC;";
return Businesslogic.Data.GetDataSet(sql, "topic");
}
public static XPathNodeIterator CountTopicsWithParticipation(int memberId)
{
string sql = @"SELECT count(DISTINCT forumTopics.id)
FROM [forumTopics]
LEFT JOIN forumComments ON forumComments.topicId = forumTopics.id
where forumTopics.memberId = " + memberId + " OR forumComments.memberId = " + memberId;
var x = Businesslogic.Data.GetDataSet(sql, "yourTopicsCount");
return x;
}
public static XPathNodeIterator TopicsWithAuthor(int memberId) {
return Businesslogic.Data.GetDataSet("SELECT * FROM forumTopics where (isSpam IS NULL OR isSpam != 1) AND memberid = " + memberId.ToString(), "topic");
}
public static XPathNodeIterator Comment(int commentId)
{
return Businesslogic.Data.GetDataSet("SELECT * FROM forumComments where (isSpam IS NULL OR isSpam != 1) AND where id = " + commentId.ToString(), "comment");
}
public static XPathNodeIterator Topic(int topicId)
{
var topic = Businesslogic.Topic.GetTopic(topicId);
var topicXml = topic.ToXml(new XmlDocument());
return topicXml.CreateNavigator().Select(".");
}
public static XPathNodeIterator Forum(int forumId) {
return Businesslogic.Data.GetDataSet("SELECT * FROM forumForums where id = " + forumId.ToString(), "forum");
}
public static XPathNodeIterator Topics(int forumId, int maxItems, int page) {
// Check for paging
int pageSize = maxItems;
int pageStart = page;
int pageEnd = ((page + 1) * pageSize);
if (pageStart > 0) {
pageStart = (page * pageSize) + 1;
}
string sql = @"WITH Topics AS
(
SELECT id, parentId, memberId, title, body, created, updated, locked, latestReplyAuthor, latestComment, replies, score, urlname, answer,
ROW_NUMBER() OVER (ORDER BY updated DESC) AS RowNumber
FROM dbo.forumTopics
WHERE (isSpam IS NULL OR isSpam != 1) AND parentId = " + forumId.ToString() + @"
)
SELECT id, parentId, RowNumber, memberId, title, body, created, updated, locked, latestReplyAuthor, latestComment, replies, score, urlname, answer
FROM Topics
WHERE RowNumber BETWEEN " + pageStart.ToString() + " AND " + pageEnd.ToString() + @"
ORDER BY RowNumber ASC;";
return Businesslogic.Data.GetDataSet(sql, "topic");
}
public static XPathNodeIterator CommentsByDate(int topicId, int maxItems, int page, string order) {
// Check for paging
int pageSize = maxItems;
int pageStart = page;
int pageEnd = ((page + 1) * pageSize);
if (pageStart > 0) {
pageStart = (page * pageSize) + 1;
}
string sql = string.Format(@"WITH Comments AS
(
SELECT id, topicId, memberId, body, created, score, position, isSpam,
ROW_NUMBER() OVER (ORDER BY created {0}) AS RowNumber
FROM dbo.forumComments
WHERE topicId = {1}
)
SELECT id, topicId, memberId, body, created, score, position, RowNumber, isSpam
FROM Comments
WHERE RowNumber BETWEEN {2} AND {3}
ORDER BY RowNumber ASC;", order, topicId, pageStart, pageEnd);
return Businesslogic.Data.GetDataSet(sql, "comment");
}
public static XPathNodeIterator CommentsByScore(int topicId, int maxItems, int page, string order) {
// Check for paging
int pageSize = maxItems;
int pageStart = page;
int pageEnd = ((page + 1) * pageSize);
if (pageStart > 0) {
pageStart = (page * pageSize) + 1;
}
string sql = @"WITH Comments AS
(
SELECT id, topicId, memberId, body, created, score, position,
ROW_NUMBER() OVER (ORDER BY score " + order + @") AS RowNumber
FROM dbo.forumComments
WHERE (isSpam IS NULL OR isSpam != 1) AND topicId = " + topicId.ToString() + @"
)
SELECT id, topicId, memberId, body, created, score, position, RowNumber
FROM Comments
WHERE RowNumber BETWEEN " + pageStart.ToString() + " AND " + pageEnd.ToString() + @"
ORDER BY RowNumber ASC;";
return Businesslogic.Data.GetDataSet(sql, "comment");
}
public static XPathNodeIterator AllForums() {
return Businesslogic.Data.GetDataSet("SELECT * FROM forumForums", "forum");
}
public static XPathNodeIterator Forums(int parentId) {
return Businesslogic.Data.GetDataSet("SELECT * FROM forumForums where parentId = " + parentId.ToString(), "forum");
}
public static XPathNodeIterator LatestTopicsSinceDate(int maxItems, int page, DateTime sinceDate) {
// Check for paging
int pageSize = maxItems;
int pageStart = page;
int pageEnd = ((page + 1) * pageSize);
if (pageStart > 0) {
pageStart = (page * pageSize) + 1;
}
string sql = @"WITH Topics AS
(
SELECT dbo.forumTopics.id, dbo.forumTopics.parentId, dbo.forumTopics.memberId, dbo.forumTopics.title, dbo.forumTopics.body, dbo.forumTopics.created, dbo.forumTopics.updated, dbo.forumTopics.locked, dbo.forumTopics.latestReplyAuthor, dbo.forumTopics.replies, dbo.forumTopics.score, dbo.forumTopics.urlname, dbo.forumTopics.answer, dbo.forumTopics.latestComment,
ROW_NUMBER() OVER (ORDER BY dbo.forumTopics.updated DESC) AS RowNumber
FROM dbo.forumTopics INNER JOIN dbo.ForumForums on dbo.forumTopics.ParentId = dbo.ForumForums.Id WHERE (dbo.forumTopics.isSpam IS NULL OR dbo.forumTopics.isSpam != 1) AND dbo.forumforums.parentId != 1057 AND dbo.ForumTopics.updated > " + sinceDate.ToShortDateString() + @"
)
SELECT id, parentId, RowNumber, memberId, title, body, created, updated, locked, latestReplyAuthor, replies, score, urlname, answer, latestComment
FROM Topics
WHERE RowNumber BETWEEN " + pageStart.ToString() + " AND " + pageEnd.ToString() + @"
ORDER BY RowNumber ASC;";
return Businesslogic.Data.GetDataSet(sql, "topic");
}
public static XPathNodeIterator LatestTopics(int maxItems, int page) {
return LatestTopicsSinceDate(maxItems, page, DateTime.MinValue);
}
}
}
+21 -27
View File
@@ -8,7 +8,6 @@ using System.Web;
using System.Web.Security;
using RestSharp;
using RestSharp.Deserializers;
using uForum.Businesslogic;
using umbraco;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.member;
@@ -67,11 +66,6 @@ namespace uForum.Library
return null;
}
public static bool IsMember(int id)
{
return (Businesslogic.Data.SqlHelper.ExecuteScalar<int>("select count(nodeid) from cmsMember where nodeid = '" + id + "'") > 0);
}
public static bool IsModerator()
{
var isModerator = false;
@@ -82,40 +76,40 @@ namespace uForum.Library
{
var moderatorRoles = new[] { "admin", "HQ", "Core", "MVP" };
isModerator = moderatorRoles.Any(moderatorRole => Xslt.IsMemberInGroup(moderatorRole, currentMemberId));
isModerator = moderatorRoles.Any(moderatorRole => IsMemberInGroup(moderatorRole, currentMemberId));
}
return isModerator;
}
public static bool CanSeeTopic(int topicId)
public static bool IsMemberInGroup(string GroupName, int memberid)
{
var topic = Topic.GetTopic(topicId);
if (topic != null && topic.IsSpam == false)
return true;
Member m;
try
{
m = Utills.GetMember(memberid);
}
catch (Exception ex)
{
Log.Add(LogTypes.Error, new User(0), -1, string.Format("Utills.GetMember({0}) failed - {1} {2} {3}", memberid, ex.Message, ex.StackTrace, ex.InnerException));
return false;
}
var currentMember = Member.GetCurrentMember();
if (topic != null && currentMember != null && topic.IsSpam)
if (IsModerator() || topic.MemberId == currentMember.Id)
foreach (MemberGroup mg in m.Groups.Values)
{
if (mg.Text == GroupName)
return true;
}
return false;
}
public static bool CanSeeComment(int commentId)
public static bool IsInGroup(string GroupName)
{
var comment = new Comment(commentId);
if (comment.IsSpam == false)
return true;
var currentMember = Member.GetCurrentMember();
if (currentMember != null && comment.IsSpam)
if (IsModerator() || comment.MemberId == currentMember.Id)
return true;
return false;
if (umbraco.library.IsLoggedOn())
return IsMemberInGroup(GroupName, Member.CurrentMemberId());
else
return false;
}
public static void AddMemberToPotentialSpamGroup(Member member)

Some files were not shown because too many files have changed in this diff Show More