Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Recommend_It plugin - a simple request

Quote Reply
Recommend_It plugin - a simple request
Pleeeeeeease add a table to the stats so that we can see which link ID or Title has been recommended.

Knowing that people are using the system is great but not knowing what they are recommending is driving me Crazy!

Wink
Quote Reply
Re: [MJB] Recommend_It plugin - a simple request In reply to
It's relatively easy to modify the plugin yourself:

Add a new column to the Rec_Stats table, for example 'RecID'.

In recommend_it.cgi, look in sub main and add this line after the other lines marked $stats_hash:

$stats_hash->{'RecID'} = $id;

That should be all that is required, unless I have forgotten something else I modified to get it working. If you want to view the link ID from the Recommend It stats in the admin you need to modify the plugin file, Recommend_It.pm. There is a an extra line required to get the ID from the database:

my $link_id = $hit->{'RecID'};

You then need to modify the results table and add an extra column (add an extra heading cell and then an extra results table cell for $link_ID).

Hope that helps Wink.
Quote Reply
Re: [aus_dave] Recommend_It plugin - a simple request In reply to
I've tried that but it just returns a blank entry. What I don't understand is how it passes the link ID from the form to the database.

I'm also a little confused with your coding as all your values are different - $id, $link_id, $link_ID
Quote Reply
Re: [MJB] Recommend_It plugin - a simple request In reply to
I'm away from my computer at the moment so I can't check the variables and where they are used - it's a pretty simple modification though.

If it doesn't already have it, the recommend it form needs to pass the ID via a hidden field, like so:

<input type="hidden" name="ID" value="<%ID%>">

You pass the ID from the form and then put it in the database. This figure is already in the plugin though (that's the whole point of it), you just insert it in the database as outlined above.
Quote Reply
Re: [aus_dave] Recommend_It plugin - a simple request In reply to
Got it now. For some reason my SQL database won't play ball if I edit it directly. I uninstalled the plugin, edited the Install.pm file with the extra database RECID field and reinstalled it. Once I'd done that the database accepted the extra field and it worked fine. Crazy
Quote Reply
Re: [aus_dave] Recommend_It plugin - a simple request In reply to
Another little extra that I've added:

If you want to see which link has been recommended rather than just the link ID:

Code:
Replace:

$link_ID

with (alter to your URL):

<a href="/cgi-bin/links/recommend_it.cgi?ID=$link_ID" target="_new">$link_ID</a>

Last edited by:

MJB: Mar 29, 2006, 1:31 PM
Quote Reply
Re: [MJB] Recommend_It plugin - a simple request In reply to
In Reply To:
For some reason my SQL database won't play ball if I edit it directly
That's not usually a problem, but if you add or reorder columns you need to resync the database (Resync Database link at the base of the Database/Links/ Properties page).

I usually add columns from within Links and then work on the data and column order in a front-end client.
Quote Reply
Re: [MJB] Recommend_It plugin - a simple request In reply to
There is a plug in by Pugdog that does that with no mods, we are using it on the site.

Check out ultranerds.com it should be somewhere on there.
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory