Gossamer Forum
Home : Products : Gossamer Links : Discussions :

template of this url?

Quote Reply
template of this url?
I'm trying to edit the template for the following page(s), Can anyone tell me whats the template name?

http://www.ukresident.com/.../2004-10-26_661.html

Quote Reply
Re: [ukresident] template of this url? In reply to
Are you using Links2, and not LinksSQL? I ask due to your number of links (58,000+!). If you're using the flatfile version, you may hold the record! The following is for Links2...

The overall template is new.html, but the part you probably want to change is created in nph-build.cgi, in the sub build_new_page routine. The look of each link is pulled from the link.html template. You can change the red parts without causing any problems:


sub build_new_page {
# --------------------------------------------------------
# Creates a "What's New" page. Set $build_span_pages to 1 in links.cfg
# and it will create a seperate page for each date.
#
my (%link_output, $category_clean, $long_date, $category, $date,
$number_links, $main_link_results, $main_total, %span_totals);
local ($total, $link_results, $title_linked);
# Let's build the What's New directory.
if ($build_new_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}

# Now we go through all the new_links (which are organized by category), and
# build the html in array indexed by date then category.
$total = 0;
CATEGORY: foreach $category (sort keys %new_links) {
LINK: for ($i = 0; $i < ($#{$new_links{$category}}+1) / ($#db_cols + 1); $i++) {
$total++;
%tmp = &array_to_hash ($i, @{$new_links{$category}});
${$link_output{$tmp{'Date'}}}{$category} .= &site_html_link (%tmp) . "\n";
$span_totals{$tmp{'Date'}}++;
}
}

# Then we go through each date, and build the links for that date. If we are spanning
# pages, we will create a seperate page for each date and need to set up a few other
# variables (like title and total). We will also want to reset links_results each time.
DATE: foreach $date (sort { &date_to_unix($b) <=> &date_to_unix($a) } keys %link_output) {
$long_date = &long_date ($date);
if ($build_span_pages) {
$link_results = "";
$total = $span_totals{$date};
$title_linked = &build_linked_title ("New/$date");
}
else {
$link_results .= "<p><strong>$long_date</strong>\n<blockquote>";
}
CATEGORY: foreach $category (sort keys %{$link_output{$date}}) {
$category_clean = &build_clean ($category);
$link_results .= qq|<P><A HREF="$build_root_url/$category/$build_index">$category_clean</A>\n|;
$link_results .= ${$link_output{$date}}{$category};
}
# Crete the new page, and do a bit of HTML work for the main page.
if ($build_span_pages) {
open (NEW, ">$build_new_path/$date$build_extension") or cgierr ("unable to open what's new page: $build_new_path/$build_index. Reason: $!");
$use_html ?
print qq|\tNew Links for <a href="$build_new_url/$date$build_extension" TARGET="_blank">$date</a>: $total\n| :
print qq|\tNew Links for $date: $total\n|;
print NEW &site_html_new;
close NEW;
$main_link_results .= qq|<li><a href="$build_new_url/$date$build_extension">$long_date</a> ($total).|;
$main_total += $total;
}
else {
$link_results .= "</blockquote>";
}
}

if ($build_span_pages) {
$link_results = "<ul>$main_link_results</ul>";
$total = $main_total;
}
$title_linked = &build_linked_title ("New");
# Build the main What's New page.
open (NEW, ">$build_new_path/$build_index") or cgierr ("unable to open what's new page: $build_new_path/$build_index. Reason: $!");
print "\tTotal New Links: $total\n";
print NEW &site_html_new(@new_links);
close NEW;
}


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Mar 21, 2005, 3:06 PM
Quote Reply
Re: [PerlFlunkie] template of this url? In reply to
he's using Links SQL for sure (look at the templates...)

I'm moving this thread to the Links SQL forums.

--Philip
Links 2.0 moderator
Quote Reply
Re: [sponge] template of this url? In reply to
Hi and thanks for your replies. Sorry about that, yes I am using links sql Blush What I wanted to do is ad some ads at the top just befor the results, where can I place the script? Sorry if I'm being thick about this but unfortunately I am Unsure
Quote Reply
Re: [ukresident] template of this url? In reply to
It corresponds to the "new.html" template in Links SQL as well.

Regards,
Peter Puglisi
www.ausfreedom.com
Ultimate Freedom is our game.
Quote Reply
Re: [rocco] template of this url? In reply to
New.html covers this:

http://www.ukresident.com/links/New/

But it doesn't cover this:

http://www.ukresident.com/.../2004-10-26_661.html

Perlflunkie is right it is the nph-build but I'm not sure how to go about editing it, I can't access it through the CP

Last edited by:

ukresident: Mar 22, 2005, 8:42 AM
Quote Reply
Re: [ukresident] template of this url? In reply to
Hi,

Quote:
New.html covers this:

http://www.ukresident.com/links/New/

But it doesn't cover this:

http://www.ukresident.com/.../2004-10-26_661.html

It does =) new.html handles both the root page, as well as the sub-new pages.

On new.html, try adding;

<%GT::Template::dump%>

..and then rebuild your site. Have a look for something like links_results_loop or similar. Thats probably what you want to use, in a <%loop ..%> format. Afraid I don't have the exact format to hand :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Mar 22, 2005, 9:34 AM
Quote Reply
Re: [Andy] template of this url? In reply to
Hi,

Where exactly in new.html do I add <%GT::Template::dump%> ? and after I build where do I go to edit the subject template?
Quote Reply
Re: [ukresident] template of this url? In reply to
Hi,

Quote:
Where exactly in new.html do I add <%GT::Template::dump%> ?

Anywhere =) Normally, I just do it at the very end of the template.

Quote:
and after I build where do I go to edit the subject template?

The subject template? Mmm.. Build > User Language?

Cheersz

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] template of this url? In reply to
Thanks Andy,

I just added <%GT::Template::dump%> to the new.html template and started building

to clarify my second question, where do I then go to edit

http://www.ukresident.com/.../2004-10-26_661.html

Thanks again Smile

Last edited by:

ukresident: Apr 11, 2005, 12:11 AM
Quote Reply
Re: [Andy] template of this url? In reply to
On new.html, try adding;

<%GT::Template::dump%>

That didn't work,it messed up my page I had to remove it.Frown
Quote Reply
Re: [ukresident] template of this url? In reply to
1) Make the change again.
2) Run from DYNAMIC mode (i.e page.cgi?d=1, and NOT a "build")
3) Browse to the "New" section, and then look at the tags.

<%GT::Template::dump%> is definatly the tag you want.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] template of this url? In reply to
Thanks Andy but this is way above my head. Can I pay someone to do it for me?
Quote Reply
Re: [ukresident] template of this url? In reply to
Hi,

Send over LSQL admin panel details (url/user/pass), and I'll take a peek for you.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!