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; }
Hi and thanks for your replies. Sorry about that, yes I am using links sql 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
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 :(