Idea: Related News SQL

Post your requests for addons here, and discuss any addons in development here, as well.
Once an addon has completed development, it will be released in the "Addon Release" forum.

Moderator: Spunkmeyer

Idea: Related News SQL

Postby Lawrence » Wed Mar 15, 2006 4:36 am

Here is something new that I am considering: Related News for CorantoSQL users. Similar to the old addon by Cerb, but written completely for CorantoSQL. You simply tell it how many articles you possibly want to be able to relate to one article, like say 20.

Then before you hit Submit when creating a new item, simply click on a button saying Related Articles, select how you want to relate (by Subject, Author, Keywords, etc ). Select the articles you want linked.

In each Coranto profile, select a style that you want to use to format each related article ( so you can have just a headline, blurb or whatever you want ). In the profiles selected template (.tmpl) file, just use the <RelatedArticles> tag and it will be replaced with the total output of the 'related article results' for that particular news item.

I want as much feedback as possible here :)
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby Psykosys » Thu Mar 16, 2006 6:24 am

That sounds incredibly useful! Would the algorithm work for relating by the actual news text? Either way, I'll definitely test it as soon as I get the new CSQL up and running.
Psykosys
 
Posts: 252
Joined: Tue Apr 15, 2003 10:37 pm
Location: Ithaca, NY

Postby bozoka45 » Sun Mar 19, 2006 4:22 am

Possilby something like this?
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby Lawrence » Mon Mar 20, 2006 4:27 am

Basically what I was thinking was having the addon add a new field called "Related Keywords" and use those to select what keywords you want to use when determining relevant articles.

Basically we would have a new profile type, called a Related News profile, where you can select, in addition to the normal profile options (template, style, category filtering), you can also choose the fields to utilize, how many results to display, minimum word length (if using the word filtering stuff, because no keywords were entered during Submit News).

If no keywords are given during Submit News. simply filter out every word in the article longer than X characters (to be determined in the select Related News profile)

To serve up the results, a hacked viewnews.cgi will be used. Basically, the SQL query will be based upon the keywords entered for the item (or the word filtering code, if no words were entered)

You could call the relatednewssql.cgi like this (just a preliminary mockup):

Code: Select all
http://www.site.com/relatednewssql.cgi?id=xxx&template=relatednewssql.tmpl


The addon could also be included via SSI and the like. The goal is to be easy to maintain, while being flexible and powerful.

All feedback and input welcome.
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby Lawrence » Mon Mar 20, 2006 4:31 am

Another feature would be an additional filter by author, so you could filter in related articles by the author as well.
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby Lawrence » Tue Mar 21, 2006 1:33 am

Another option I will consider implementing: show only relevant articles that are OLDER than the article :)
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby Parahead » Sat Mar 25, 2006 10:53 am

Lawrence wrote:To serve up the results, a hacked viewnews.cgi will be used. Basically, the SQL query will be based upon the keywords entered for the item (or the word filtering code, if no words were entered)

You could call the relatednewssql.cgi like this (just a preliminary mockup):

Code: Select all
http://www.site.com/relatednewssql.cgi?id=xxx&template=relatednewssql.tmpl
Question, why not use viewnews.cgi directly and have the RelatedNewsSQL like a normal addon, instead of having a hacked version of viewnews.cgi? Check out the Random News addon for an example...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Lawrence » Wed Mar 29, 2006 9:11 pm

Thanks for the idea... perhaps I can do it so we can hook the following into ProcessTMPL sub. This will call the GetRelatedArticles (not the REAL name) sub and get/process/return the results, after being passed the newsid (to lookup the original article and get related results) and the RelatedNewsSQL profile name (so we can format the resulting articles using the style and template info).

Code: Select all
my $processtmpl_code = <<'END_CODE';
if ($newsid){
# Get related articles

# Each template should have a area like this
# <RelatedNewsSQL_Items>
#    <RelatedNewsSQL prof="profile_name" newsid="<Field: newsid>">
# </RelatedNewsSQL_Items>

# Replace all occurances of the above
# With the actual results
$theresult =~ s/<RelatedNews_Items>(.*?)<RelatedNewsSQL(.*?)prof="(.*?)"(.*?)newsid="(.*?)">(.*?)</RelatedNews_Items>/GetRelatedArticles($3,$5)/gi;
}
END_CODE
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby nowysiwyg » Sat Apr 22, 2006 8:42 am

Hi,

I think there is another way of doing the related articles stuff that might be easier to implement. I am currently working on making this staff in PHP, however I (of course) will be very happy to see this as a generic addon to Coranto.

Here is how I will do that:

1. I will introduce another basic identifier to news postings apart from "Category". I will probably call it "Topics". Authors will be able to assign articles to existing topics or create new ones - values can be added on-the fly through the CustomFields add-on.

2. A special PHP routine on predefined areas of each page will check the database for the "topic" identified on the active page and will fetch the relevant rows.

3. The script will check news ids in the array, exclude current page from the list, and display the outcome.

I think that this "hand-picking" is simpler, more flexible, and resource efficient approach to this issue.
You are what YOU is.
nowysiwyg
 
Posts: 9
Joined: Mon Nov 11, 2002 1:04 pm
Location: Tbilisi, Georgia

Postby web » Sun Oct 14, 2007 6:23 pm

i've just find that theme. are there any results?
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm


Return to Addon Development and Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron