Module Request: Link Collector
Posted: 16 July 2004 10:18 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  03-22-2004

Rather than just have recent links with your entry links. What about having recent links with all the links mentioned in particular entries.

A similar plugin is available for movable type called LinksMentioned

What da ya think? Doable?

Profile
 
 
Posted: 16 July 2004 11:09 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  75
Joined  02-24-2004

Yes, it’s doable.  I’m not sure about what the plugin does exactly. Should it simply give a list of links that were used in your latest entries?

Profile
 
 
Posted: 17 July 2004 05:24 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  03-22-2004

Yes. Say if you were using your blog for more of a news blog where you would mention several links in your entry.

The plugin would list and link the titles of the links used in your latest entries.
Might also have a link checker feature to check the validity of itself.

Profile
 
 
Posted: 18 July 2004 02:47 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  75
Joined  02-24-2004

Ok It took me longer than I expected but I wrote the plugin. Took me a while to figure out the best way to implement it. I’ll post it in two seconds after I write the documentation… You’ll need to test it out for me to see if there’s any bugs and to give any further suggestions.

By the way, I don’t think the link checking feature is a good idea for the following reasons…

Checking multiple links at once time will slow the page down.
If the page is cached, the links won’t be checked anyway.
The plugin only uses links that are extracted for recently posted entries, so if a link is dead or misspelled you can simple fix it viva EE’s control panel.

Profile
 
 
Posted: 19 July 2004 02:57 AM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  75
Joined  02-24-2004

Links Mentioned

Profile
 
 
Posted: 20 July 2004 07:28 PM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

Methinks something needs to be submitted to the Plugins site… [grin]

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 21 July 2004 12:55 PM   [ Ignore ]   [ # 6 ]  
Grad Student
Rank
Total Posts:  75
Joined  02-24-2004

Will do smile

Profile
 
 
Posted: 27 July 2004 09:49 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  759
Joined  03-22-2004

Cheers works a treat smile

Profile
 
 
Posted: 29 July 2004 12:23 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  64
Joined  01-31-2002

thanx for this, it works perfect.
a little request: category and entry_id as parameters would extend the power of this plugin

Profile
 
 
Posted: 29 July 2004 04:07 AM   [ Ignore ]   [ # 9 ]  
Grad Student
Rank
Total Posts:  64
Joined  01-31-2002

with a few php-knowledge i tried to get an entry_id as parameter in the following way, but there is a problem with the {url}, maybe it`s a trivial thing i don`t see, so i post it here.

... the links_mentioned-tag in my template:

{exp:links_mentioned weblog=“plattform” eentry_id=”{entry_id}” fields=“links” extractn=“600” limit=“10”}
<li><a href=”{url}”>{label}</a></li>
{/exp:links_mentioned}

...in pi.links_mentioned.php (####):

class Links_Mentioned
{
var $weblog = ‘’;
var $fields = ‘’;

var $eentry_id = ‘’;  ####

var $search_limit = 10;
var $limit = 10;
var $exclude = array();

var $link_params = array();
var $return_data = ‘’;

function links_mentioned()
{
global $TMPL, $DB, $FNS, $LOC;

/*———————————————————-
Fetch Template Parameters
————————————————————-*/

$this->weblog   = ( ! $TMPL->fetch_param(‘weblog’))  ? $this->weblog : $TMPL->fetch_param(‘weblog’);
$this->fields   = ( ! $TMPL->fetch_param(‘fields’))  ? $this->fields : $TMPL->fetch_param(‘fields’);

$this->eentry_id   = ( ! $TMPL->fetch_param(‘eentry_id’))  ? $this->eentry_id : $TMPL->fetch_param(‘eentry_id’);  ####

$this->limit   = ( ! $TMPL->fetch_param(‘limit’))  ? $this->limit   : (int) $TMPL->fetch_param(‘limit’);
$this->exclude = ( ! $TMPL->fetch_param(‘exclude’)) ? $this->exclude : explode(’|’, $TMPL->fetch_param(‘exclude’));
$this->search_limit = ( ! $TMPL->fetch_param(‘search_limit’))  ? $this->search_limit
: (int) $TMPL->fetch_param(‘search_limit’);

$eentry_id = $TMPL->fetch_param(‘eentry_id’);  ####

...then


/*———————————————————-
Get the field data
————————————————————-*/

$sql = “SELECT “;

foreach ($fields as $val)
{
$sql .= ” exp_weblog_data.” . $val . “,”;
}

$sql = substr($sql, 0, -1);

$sql .= ” FROM exp_weblog_data
INNER JOIN exp_weblog_titles ON (exp_weblog_titles.entry_id = exp_weblog_data.entry_id)
WHERE exp_weblog_data.weblog_id = ’” . $weblog_id . “‘

    AND exp_weblog_titles.status = ‘open’
AND exp_weblog_data.entry_id = ’” . $eentry_id . ”’  ####

ORDER BY exp_weblog_data.entry_id DESC
LIMIT 0, ” . $this->search_limit;


... so, what it did: limits the output to the entry but with the {url} from (i assume) the first found in another place.

<li><a href=“http://www.humanrights.at”>geawaltüberwinden.org</a></li>

<li><a href=“http://www.humanrights.at”>tolerantschools.org</a></li>

... where it should be this.


<li><a href=“http://www.gewaltueberwinden.org” >geawaltüberwinden.org</a></li>

<li><a href=“http://www.tolerantschools.org” >tolerantschools.org</a></li>

any suggestions?

Profile
 
 
Posted: 01 August 2004 05:00 PM   [ Ignore ]   [ # 10 ]  
Grad Student
Rank
Total Posts:  75
Joined  02-24-2004

Have’nt had much time but i’ll add it soon.

Profile
 
 
Posted: 02 August 2004 04:42 AM   [ Ignore ]   [ # 11 ]  
Grad Student
Rank
Total Posts:  64
Joined  01-31-2002

thx, redo. no problem.

Profile
 
 
Posted: 09 August 2004 04:49 PM   [ Ignore ]   [ # 12 ]  
Grad Student
Rank
Total Posts:  75
Joined  02-24-2004

Links Mentioned Version 2.0

Added two new parameters with piping enabed:

entry_id=
category=

Added two new tags

{title}
{title_or_label}

Added conditionals scripting support.

Profile
 
 
Posted: 09 August 2004 11:54 PM   [ Ignore ]   [ # 13 ]  
Grad Student
Rank
Total Posts:  64
Joined  01-31-2002

perfect. thx & best wishes!

Profile
 
 
Posted: 17 August 2004 01:40 AM   [ Ignore ]   [ # 14 ]  
Grad Student
Rank
Total Posts:  64
Joined  01-31-2002

the plugin works fine, one problem when using inside {exp:weblog:entries}-tag is, that the “url”-declaration is also used as the authors-url-variable and overwritten by this.
i found following solution:
replace every “url” in pi.links_mentioned.php with “Lurl” (or whatever unique) and use the tag like this:

{exp:links_mentioned weblog=“plattform” fields=“links” limit=“10” entry_id=”{entry_id}” }
<li><a href=”{Lurl}” target=“_blank” >{label}</a></li>
{/exp:links_mentioned}

thanx redo for your help. the plugin is very useful for my cases.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64978 Total Logged-in Users: 22
Total Topics: 82016 Total Anonymous Users: 22
Total Replies: 440814 Total Guests: 183
Total Posts: 522830    
Members ( View Memberlist )