Gossamer Forum
Home : Products : Links 2.0 : Customization :

NEW MOD - NewX

Quote Reply
NEW MOD - NewX
I just made a quick mod to show the newest X links on your homepage or wherever you want.

It is attached to this post.

All you need to do is upload the file to the same directory as the other Links2 cgi's like add.cgi etc....and chmod it to 755.

Then in links.cfg add a new variable:

$max_new = X;

X being the number of new links you want to show.

Then include the file into your page using SSI ...eg

<!--#exec cgi="/cgi-bin/links/topx.cgi"-->

If you are using html pages then you can upload a .htaccess file with the following contents which should allow the SSI to work with the html page.....

AddType text/html .html
AddHandler server-parsed .html

That goes into the same directory as the html page not topx.cgi

Anyway feel free to make any contructive comments.
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
This looks just what I'm after, but the attachment won't donload. I get...

A fatal error has occured:
Permission denied at /home/gossamer-threads/perl/gforum/admin/GForum/Post/View.pm line 470.

Please enable debugging in setup for more details.

Can you fix it?

Quote Reply
Re: [mrtrippy] NEW MOD - NewX In reply to
You should be able to download now :)
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
Thanks
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
Hello,
i followed the instructions but i get
Quote:
[an error occurred while processing this directive]
when calling the html page.
Any help on this?
LoucianFrown
Quote Reply
Re: [loucian] NEW MOD - NewX In reply to
Did you upload the .htaccess file into the directory where topx.cgi is?

Try renaming the file to .shtml to see if that works.

Make sure topx.cgi is chmodded to 755

Make sure apache is setup to allow you to override the settings for server-side parsing with .htaccess
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
I did what you said but none of these work!
See it here
http://satellitehit.virtualave.net/topx.html

Please help
Loucian
Quote Reply
Re: [loucian] NEW MOD - NewX In reply to
That example url uses .html - did you try with .shtml?

If .shtml doesn't work then your account may not support SSI

...either that or your server doesn't have tail installed.

Last edited by:

PaulW: Nov 24, 2001, 4:51 AM
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
Yes i tried .shtml.Thank you,
Is there any other mod that do xnewsites without ssi?
Loucian
Quote Reply
Re: [loucian] NEW MOD - NewX In reply to
Have you tried a simple SSI file to check that it works?

Try....

#!/usr/bin/perl

print "Contennt-type: text/html\n\n";
print "This is SSI";
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
Just because i am new to this...where do i add
Quote:
#!/usr/bin/perl

print "Contennt-type: text/html\n\n";
print "This is SSI";

I have add it to my topx.cgi deleting all the other code but i still get the top 5 new links.
What is the next step?





Loucian
Quote Reply
Re: [loucian] NEW MOD - NewX In reply to
>>I have add it to my topx.cgi deleting all the other code but i still get the top 5 new links.
<<

Sorry not sure what you mean. I thought you were getting an error?
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
Yes i am getting an error in the page i want the new links to be dispalyed, but it works fine if i type the url of the topx.cgi file directly.
Have you understand me?
Loucian
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
As usual this is a great MOD from you. my only and proberly dumm question is how i use my stylesheet within the MOD ? Crazy



God love simple things - Like Links
Quote Reply
Re: [Webpoint] NEW MOD - NewX In reply to
In the code where it says:

print qq|<tr><td>$i.</td><td><a href="$_[$db_url]">$_[$db_title]</a></td></tr>|;

Just change it to something like:

print qq|<tr><td class="yourclass">$i.</td><td class="yourclass"><a href="$_[$db_url]">$_[$db_title]</a></td></tr>|;

Remember you can use any of the record fields, I just used title and url as as example. You could add $_[$db_hits], $_[$db_rating], $_[$db_votes] etc...
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
Hi PaulW.

Is it possible to remove the numers ( 1-X ) from the result ?


God love simple things - Like Links
Quote Reply
Re: [Webpoint] NEW MOD - NewX In reply to
Sure, just get rid of:

<td class="yourclass">$i.</td>
Quote Reply
Re: [PaulW] NEW MOD - NewX In reply to
Thanks a lot.

Feel free to see the result at : http://www.rejsebeskrivelser.dk/ Right side at the middel.

God love simple things - Like Links
Quote Reply
Re: [Webpoint] NEW MOD - NewX In reply to
Many servers don't allow you to execute cgi scripts from ssi:

in my case for example I was getting an error when using:

<!--#exec cgi="/cgi-bin/links/topx.cgi"-->

But the script works fine when I used:

<!--#include file="cgi-bin/directories/animation/topx.cgi" -->



maybe this would work for you guys, just thought I'd offer ;)
Quote Reply
Re: [Paul] NEW MOD - NewX In reply to
Hello,

Would it be possible to use this mod but to have the output of the links direct you to the detailed page for each link instead of taking the user directly to the listed site?

Thanks for your time,
Chris
Quote Reply
Re: [sitehostz] NEW MOD - NewX In reply to
This is a quick answer, with looking at the code...

Change

print qq|<tr><td>$i.</td><td><a href="$_[$db_url]">$_[$db_title]</a></td></tr>|;


to <%db_cgi_url%>/jump.cgi?ID=<%ID%> or something... I have not used this mod, so am not familiar with it...


Leonard
aka PerlFlunkie
Quote Reply
Re: [sitehostz] NEW MOD - NewX In reply to
you could use something like

<A HREF="">$_[$db_title]</A"]http://www.yoursite.com/cgi-bin/links/jump.cgi?ID=$_[$db_key]">$_[$db_title]</A>

But the jump.cgi would take you to the website.

to make it work, search for info.cgi ( I think sponge did it ). the code is out there.

Then change the line the loads the html page to something like

print &site_html_detailed (%rec);

Then call info.cgo by using

<A HREF="">$_[$db_title]</A"]http://www.yoursite.com/cgi-bin/links/info.cgi?ID=$_[$db_key]">$_[$db_title]</A>

in you newx


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [Paul] NEW MOD - NewX In reply to
I installed this mod and it works GREAT. Thanks so much.

I do have a question as to a further mod here. Is it possible to sort the results into alphabetical order rather than ID #?

I run a links database for a chamber of commerce and we would like to see an alpha listing versus ID # as Title sorts are easier to look at.

Thanks

James
Quote Reply
Re: [justjames] NEW MOD - NewX In reply to
I have adapted this mod to be non-ssi, see it here:

http://www.gossamer-threads.com/...i?post=266435#266435


Leonard
aka PerlFlunkie