Gossamer Forum
Home : Products : Links 2.0 : Customization :

For Alex, Widgetz and oldmoney re:last link 1.99

Quote Reply
For Alex, Widgetz and oldmoney re:last link 1.99
Is there a way to have this information on my home page? Links script is not my home page. Whether through ssi or whatever. Would also like to be able to have it as multi-column.

LMK,
Derek
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
The quick and dirty answer would be to copy the last link codes and create a separate cgi file. Add the required files. Also make sure that you also include other sub-routines that the last link sub-routine calls in this file.

You will have to change some of the codes to print to a "log" file.

Then save the file as a .cgi script.

You can call this script via SSI in the following manner:

Code:
<!--#exec cgi="/cgi-bin/links/lastlink.cgi"-->

What you could do is combine the Site of the Day Mod with the Last Link Mod. This will give you what you want.

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
I did this on my site. (check my homepage)
this is a hack of a hack
it builds a seperate page which lists the newest links, which can then be called via ssi to any page

in nph-build.cgi

just before
# Create Home Page
Add this

Code:
# Create Newest Include
$use_html ?
print qq|Building <A HREF="$build_root_url/newest_include.html">Newest include</A> . . .\n| :
print qq|Building Total Links . . .\n|;
&build_newest_include;
print "\tDone\n\n";



at the very bottom just before 1; Add this

Code:
sub build_newest_include {
# --------------------------------------------------------
my ($subcat, @rootcat);
local ($total);

print "\tOpening page: $build_root_path/newest_include.html\n";

my $LastX = 4;
open (DB, "<$db_file_name") or &cgierr("unable to open database:$db_file_name.\nReason: $!");
my @lines = <DB>;
close DB;
for ($i=$#lines; $i>=$#lines - $LastX; $i--) {
chomp $lines[$i];
@tmp = &split_decode ($lines[$i]);
%tmp = &array_to_hash (0, @tmp);
$lastlinkInclude .= &site_html_link (%tmp);
}

open (newest_include, ">$build_root_path/newest_include.html") or &cgierr ("unable to open home page: $build_root_path/newest_include.html. Reason: $!");

print newest_include &site_newest_include;
close newest_include;
print "\tClosing page.\n";
}


in site_html_template.pl
just before sub site_html_home { add
Code:
sub site_newest_include {
# --------------------------------------------------------
# This routine will build the newest links for the homepage via ssi

return &load_template ('newest.html', {
lastlinkInclude => $lastlinkInclude,
%globals
});
}


you need to make a template called newest.html
mine just says <%lastlinkInclude%> but you could make it anything just as long as you put <%lastlinkInclude%> where you want the links to be

now include it into your homepage like this

<!--#include virtual="PathToLinksDir/pages/newest_include.html"-->


hope I didn't leave out anything Smile


------------------
bartour.hypermart.net


[This message has been edited by Mutt (edited December 16, 1999).]

[This message has been edited by Mutt (edited December 16, 1999).]
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
That's pretty much what I need, except, I would like to have it in 2 columns rather than just straight down in 1 column.
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
How can I make this only display the sites name? Maybe the ratings, but definately not the descriptions?

Also when it builds the output page, it's building it with a table that is 610 pixels wide. I can't find where this table is being inserted from.


Any help would be appreciated...


------------------
Micah Kritzman


[This message has been edited by Micah Kritzman (edited April 26, 2000).]
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
Uh...all you have to do is put the tags that you want to print in the newest.html template file.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
Thanks for your response AnthroRules.

When you say

"Uh...all you have to do is put the tags that you want to print in the newest.html template file."

I am assuming that you are talking about the HTML not the output of <%lastlinkInclude%>


All I have right now is:

<%lastlinkInclude%>

It puts the 5 most recent posts with title, description, new, rate it embedded in a table.

(<TABLE WIDTH="610" BORDER="0" CELLSPACING="0" CELLPADDING="0"> )

2 questions here:

1: How can I make it only show the title or perhaps title and new or title and rate it.

2: How can I get rid of the: <TABLE WIDTH="610" BORDER="0" CELLSPACING="0" CELLPADDING="0">

I just want the raw link output in the <UL><LI> format.



------------------
Micah Kritzman
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
*sigh*

Are you using the codes in this Topic to create the "newest.html" template file???

If so, then you put the tags that you want to use in that template file.

And if you are using the "newest.html" template file, then all you have to do is use the following codes:

Code:
<%include newest.html%>

NOT

Code:
<%lastlinkInclude%>

If you are only using the standard Last Link Mod, then all you have to do is simply add the following tag:

Code:
<%lastlink%>

WITHOUT THE Include.

1: How can I make it only show the title or perhaps title and new or title and rate it.

Edit the newest.html template file that is discussed in this Topic.

2: How can I get rid of the: <TABLE WIDTH="610" BORDER="0" CELLSPACING="0" CELLPADDING="0">

I am assuming that these codes are coming from the link.html file -OR- the home.html file. Find the codes in these files or in the newest.html file and delete them.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
Thanks AnthroRules,

Damn you are fast Smile

I just figured out what was going on and I came back to edit my messge and low and behold, you get here first...

Ok, when I build the pages, and the newest_include.html is being built, it's using the links.html template to build.

Now I am not a programmer so I don't know unless I ask. Would it be dificult to have this build the links from another template, maybe newest_links.html?

Secondly, anyone want to hack this?

Thanks again AnthroRules....

------------------
Micah Kritzman
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
 
What you will need to do is look at the creating a new sub in the site_html_templates.pl section. Then in the Last Link codes in your nph-build.cgi file, replace &site_html_link with something like &site_html_lastlink. And the new sub you create in the site_html_templates.pl file should be called sub site_html_lastlink routine. And you should load lastlink.html file in this new sub-routine. And in the lastlink.html file is where you put the appropriate codes...

----This is a recording-----

This has been "hacked" more than once before and I provided codes and instructions in other Topics in this Forum. (Similar to the instructions I just wrote.)

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
Thanks Again,

Your message just confused the hell out of me, but this is what I like about computers.

More education Smile

I will let you know when I get it working.



------------------
Micah Kritzman
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
Thus, if I used standard LastLink Mod,
how can I display the sites name/title only,
without the descriptions? like Micah Kritzman asked.

Thanks for any help.

-- Dick Hui
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
  
Code:
$lastlink .= &site_html_link (%tmp);

with the following codes:

Code:
$lastlink .= &site_html_lastlink (%tmp);

2) Then in your site_html_templates.pl file, add the following sub-routine:

Code:
sub site_html_lastlink {
# --------------------------------------------------------
# This routine builds special list of links for Last Link

my %rec = @_;
return &load_template ('lastlink.html', {
%rec,
%globals
});
}

3) Then add a new template file in your template directory called lastlink.html. In this template file, you only have to add the following tags:

Code:
<a href="<%URL%>"><%Title%></a>
<br>

You can replace the <%URL%> with your jump.cgi link that you use in your link.html file if you prefer.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.




[This message has been edited by AnthroRules (edited April 27, 2000).]
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
Thank You very much, Eliot.
It works, help me much. ^.^
Quote Reply
Re: For Alex, Widgetz and oldmoney re:last link 1.99 In reply to
Good...finally.

You're welcome.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.