Trackbacks URL

Topics: Business Logic Layer
Feb 6, 2008 at 11:45 PM
Hi,

There have been a lot of discussion about the "trackbacks" issue. However, it doesn't seem that BE.net provides trackback functionalities both incoming and outgoing. Actually, manual says it supports both incoming/outgoing trackback functionalities, but there is no trackback link provided, like other blogging engine such as WordPress.

According to the previous discussion, http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=10226, trackback functionality is working behind the scene. Well, I say, it only works fine when I am writing a new post other than using old post created one year ago! The only solution I can use the old post seems that I need to modify that. Even more, a friend of mine uses another blogging tool such as Textcube, http://www.textcube.org, can't send a trackback to my post because there is no trackback URL provided in BE.net.

If I want to provide a trackback link URL, where can I start?
Feb 6, 2008 at 11:53 PM
Is this what you are talking about ?

http://www.codeplex.com/blogengine/WorkItem/View.aspx?WorkItemId=5081
Feb 7, 2008 at 12:41 AM

percent20 wrote:
Is this what you are talking about ?

http://www.codeplex.com/blogengine/WorkItem/View.aspx?WorkItemId=5081


Yes, it is. I've been Googling for a while about how trackbacks work and I realised that, if Be.net works fine, sending auto trackback reading RDF definition of each post is possible. However, where is RDF definition in my post in BE.net? I couldn't find RDF tags set anywhere in a post HTML using Be.net.

As well as, already issued before, several blogging tools do not support RDF tags set need to use unique trackback URL like "http://mysite.com/tb/?post=1".

How can I figure it out?
Feb 7, 2008 at 1:35 AM

How can I figure it out?

I'm personally not sure how to fix this issue. I'd like it fixed too and have no idea how to go about it.
Feb 7, 2008 at 4:10 AM

percent20 wrote:

How can I figure it out?

I'm personally not sure how to fix this issue. I'd like it fixed too and have no idea how to go about it.


Well, eventually, I figured it out.


private void btnSave_Click(object sender, EventArgs e)
{
... ### CODES ### ...

post.Save();

Manager.Send(post);

Session.Remove("content");
Session.Remove("title");
Session.Remove("description");
Session.Remove("slug");
Session.Remove("tags");
Response.Redirect(post.RelativeLink.ToString());
}


I put the one line of code, "Manager.Send(post);", like above, on the event handler method, btnSaveClick in Addentry.aspx.cs. Finally, it works well.

However, it only accepts external links as trackback URLs. Sometimes, I need to refer to my own post written before. At this circumstance, the trackback functionality won't work. To figure this out, Send method in BlogEngine.Core/Ping/Manager.cs has to be modified like:


public static void Send(IPublishable item)
{
foreach (Uri url in GetUrlsFromContent(item.Content))
{
// if (url.Host == Utils.AbsoluteWebRoot.Host)
// continue;

### CODES ###
}


Like above, two lines in that method has to be commented.

As well as, there is still a problem left. Some blog service providers do not allow BE.net to grab sources. In other words, the following method displays error because of rejection or denial from the blog service provider.


private static string ReadFromWeb(Uri sourceUrl)
{
string html;
using (WebClient client = new WebClient())
{
client.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)");
html = client.DownloadString(sourceUrl);
}
return html;
}


I guess, for this circumstance, another consideration will be necessary. Anyway, based on this idea, I might be able to start. Have a good day!

Cheers,
Feb 19, 2008 at 12:51 PM
Hey justin.

I wanted to ask, in which file do you put the "Manager.Send(post)" line?

If its

admin/pages/add_entry.aspx.cs

I get an error message, when I build in vs08: "the name "Manager" does not exist in current context.

Help would be greatly appreciated.
Mar 2, 2008 at 10:38 PM

wotaewer wrote:
Hey justin.

I wanted to ask, in which file do you put the "Manager.Send(post)" line?

If its

admin/pages/add_entry.aspx.cs

I get an error message, when I build in vs08: "the name "Manager" does not exist in current context.

Help would be greatly appreciated.



Hi, wotaewer.

Sorry for my late reply.

Well, have you added two lines stated below:


using BlogEngine.Core;
using BlogEngine.Core.Ping;


in your Add_entry.aspx.cs ?

Once you added those two lines, you would figure it out.

Cheers,