Categories
Coding

How to Make Disqus Notify the Post Author When a New Comment Is Posted?

This is an interesting one. A new client is using the Disqus service to replace the default WordPress commenting system within their website. They noticed that post authors weren’t receiving notification emails when a new comment was added to their post.

After a bit of searching, I found the following blog post which confirms the issue and provides a simple workaround for it. Normally I’d never alter the code within a plugin (as it makes future updates a nightmare) but in this case, the pros outweigh the cons.

Update: 30 July 2014

As jeremyclarke pointed out, these days, rather than editing the Disqus plugin itself (which is a cardinal sin and should never be done) I would simply create a snippet, that hooks into the wp_insert_comment action or similar, and add it into my functions.php file or a custom plugin. Something along the lines of…

add_action( 'wp_insert_comment', 'disqus_notify_postauthor', 99, 2);

function disqus_notify_postauthor( $comment_id, $comment_object ) {
	wp_notify_postauthor( $comment_id );
}
Categories
Server

Hiding Fields in SharePoint 2010

This is a useful peice of PowerShell script to hide specific fields from the Edit form. ShowInEditForm can also be amended to ShowInNewForm.

$assignment = Start-SPAssignment
$web = Get-SPWeb http://mysharepointserver -AssignmentCollection $assignment
$field = $web.Lists["Announcements"].Fields["Body"]
$field.ShowInEditForm = $False
$field.Update()
Stop-SPAssignment $assignment

Categories
Announcements

Mevagissey Gig Club

It’s very interesting to see that, 11 years on, the Mevagissey Gig Club are still using my original design for their website, albeit a very modified version. It’s the simple things that make me smile.

Categories
Coding

Rounding to nearest X

An interesting forumla to remember for rounding numbers to the nearest X.

Int32 value = 43.7;
Int32 toNearest = 5;
Int32 result = Math.Round(value / toNearest) * toNearest;

Categories
Design & UI

SharePoint: University College Falmouth Intranet

These design solutions were created as part of the University’s move from a 10 year old, bespoke, Classic ASP driven Intranet (which I originally developed) to Microsoft SharePoint 2010. Their purpose was to act as a starting point for discussion among staff and students and to generate feedback.

Homepage

Sub Page

Categories
Server

SPListItem URLs

There seems to be no built-in function or property to quickly return the correct URL for a SharePoint list item. The obvious property, SPListItem.URL, always returns an invalid URL along the lines of http://sharepoint/Lists/MyList/155_.000. Not ideal.

To get around this and return a correctly formatted web address, you can use the following code:

item.Web.Url + "/" + item.ParentList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url + "?ID=" + item.ID

Categories
Coding

Adding Metadata Progmattically

Dim meta As HtmlMeta = New HtmlMeta()
meta.HttpEquiv = "refresh"
meta.Content = "600"
Page.Header.Controls.Add(meta)

Categories
Things of interest

Special investigation: It took just one hour for internet experts to find out almost every private detail of this woman’s life

While decluttering and sorting through the mountains of print-outs and magazines on my desk, I found a newspapepr article I’d set top one side. There’s nothing surprising in its content, but many people still don’t realise how much information about that is available on the internet.

Special investigation: It took just one hour for internet experts to find out almost every private detail of this woman’s life

(I’ve added the link here so I can throw away the newspapepr article!)

Categories
Announcements

Emilyn Claid

The website of Emilyn Claid, performer and Professor of Choreography at University College Falmouth, has now been relocated to a new domain and hosting company. The Flash-based website was originally developed by oneSquareYard.

Categories
Coding

19 ffmpeg commands for all needs

This post, from Cats Who Code, lists 19 very useful commands for ffmpeg.