Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: humbleworld on August 27, 2009, 03:29:41 AM

Title: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: humbleworld on August 27, 2009, 03:29:41 AM
Okay, here's what I noticed lately in my forum site. Each post is being grabbed by another site, but there's no credit given to my site as the source. Of course, this forum post grabber has been automated probably using the RSS feed of my forum site.

Is there a MOD that would add the forum URL of each post so that when forum harvester grabs a post from my forum, the source is being automatically acknowledged?

I know this mod is available in Wordpress.
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: Arantor on August 27, 2009, 03:43:01 AM
There isn't a mod but I don't believe it would be that hard to add one.

Would the link link back to the thread overall, or to the specific post in question?
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: Arantor on August 27, 2009, 04:50:02 AM
Don't worry about the previous question.

Mod is written, supports both options from the admin panel, currently awaiting approval - but will be http://custom.simplemachines.org/mods/index.php?mod=2112 once it is approved.
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: chrishicks on August 27, 2009, 06:06:10 AM
tagging for later...
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: humbleworld on August 27, 2009, 10:58:57 PM
Quote from: Arantor on August 27, 2009, 03:43:01 AM
There isn't a mod but I don't believe it would be that hard to add one.

Would the link link back to the thread overall, or to the specific post in question?

I would prefer the link back points to the specific post in question. I notice that the grabbed posts rank higher than source posts in search engine results. This is bad.
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: Arantor on August 27, 2009, 11:03:43 PM
Quote from: Arantor on August 27, 2009, 04:50:02 AM
Mod is written, supports both options from the admin panel, currently awaiting approval - but will be http://custom.simplemachines.org/mods/index.php?mod=2112 once it is approved.

You can pick which it does.
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: Arantor on September 06, 2009, 06:26:54 AM
This was approved yesterday - or maybe the day before, I forget exactly when it was approved.

http://custom.simplemachines.org/mods/index.php?mod=2112
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: humbleworld on September 17, 2009, 08:37:45 PM
Thank you so much, Arantor. You are the man of the hour!
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: humbleworld on September 17, 2009, 10:28:38 PM
I'm back. I tested the mod.

In every post it shows at the end: Linkback: URL

Can it be possible to make it just a clickable linkbank with the word "Link to this post". So that if I click the "link to the post" it goes to the post itself.
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: Arantor on September 18, 2009, 03:29:44 AM
In Sources/Display.php, find this:
// Add linkback
if(!empty($modSettings['linkbackStyle']) && $modSettings['linkbackStyle'] == 1) { // default to per post; 0 = post, 1 = topic
$message['body'] .= "\n\n[size=1]" . $txt['linkback'] . ': ' . $scripturl . ((!empty($modSettings['queryless_urls']) && $modSettings['queryless_urls']) ? '/topic,' . $topic . '.0.html' : '?topic=' . $topic . '.0') . '[/size]';
} else {
$message['body'] .= "\n\n[size=1]" . $txt['linkback'] . ': ' . $scripturl . ((!empty($modSettings['queryless_urls']) && $modSettings['queryless_urls']) ? '/topic,' . $topic . '.msg' . $message['id_msg'] . '.html#msg' . $message['id_msg'] : '?topic=' . $topic . '.msg' . $message['id_msg'] . '#msg' . $message['id_msg']) . '[/size]';
}


Replace with:
// Add linkback
if(!empty($modSettings['linkbackStyle']) && $modSettings['linkbackStyle'] == 1) { // default to per post; 0 = post, 1 = topic
$message['body'] .= "\n\n[size=1][url=" . $scripturl . ((!empty($modSettings['queryless_urls']) && $modSettings['queryless_urls']) ? '/topic,' . $topic . '.0.html' : '?topic=' . $topic . '.0') . ']' . $txt['linkback'] . '[/url][/size]';
} else {
$message['body'] .= "\n\n[size=1][url=" . $scripturl . ((!empty($modSettings['queryless_urls']) && $modSettings['queryless_urls']) ? '/topic,' . $topic . '.msg' . $message['id_msg'] . '.html#msg' . $message['id_msg'] : '?topic=' . $topic . '.msg' . $message['id_msg'] . '#msg' . $message['id_msg']) . ']' . $txt['linkback'] . '[/url][/size]';
}


You may need to change the definition of $txt['linkback'] to suit your preference in Themes/default/languages/Modifications.english.php too - by default it simply says Linkback.
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: humbleworld on September 18, 2009, 04:24:12 AM
Thank you very much, Arantor! I will test it. Thanks! Thanks!
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: humbleworld on September 18, 2009, 04:37:49 AM
Arantor,

The linkback does not appear in RSS grabbed posts. Some forum grabbers use the RSS of SMF to steal content.

How to have the linkback appear in RSS?
Title: Re: Mod to Diplay Forum Info at End of Each Post that is grabbed by Other Sites
Post by: Arantor on September 18, 2009, 04:48:33 AM
It should be possible to add it to the RSS feed; I'll look at that later on today for you.