# LastLink 1.0 - a Links-mod for showing the most recently added link on the homepage # Templates Version (untested in a non-templates environment, but see hint below) # # All credits for this mod goes to Jerry Su aka Widgetz . # John Gotze wrote these instructions. This mod requires you to edit: * nph-build.cgi * site_html_templates.pl * and the home.html template Open nph-build.cgi and find sub build_home_page. Insert the following code after: print "\tOpening page: $build_root_path/$build_index\n"; [code] open (DB, "<$db_file_name") or &cgierr("unable to open database:$db_file_name.\nReason: $!"); @lastlink = ; chomp @lastlink; close DB; @lastlink = &split_decode($lastlink[$#lastlink]); %last = &array_to_hash (@lastlink); [/code] Now open site_html_templates.pl and find sub site_html_home. For every field you want to use, you need insert code like this: last_title => $lastlink[$db_title], That one obviously get's the title. You end up with something like: [code] sub site_html_home { # -------------------------------------------------------- # This routine will build a home page. It is not meant to have any # links on it, only subcategories. return &load_template ('home.html', { category => $category, grand_total => $grand_total, last_title => $lastlink[$db_title], last_url => $lastlink[$db_url], last_description => $lastlink[$db_description], %globals }); } [/code] OK, script editing done. Now edit your home.html template. Insert something like: [code] New link: <%last_title%> - <%last_description%>. [/code] somewhere in the template. Save. Now Build pages. Look at your homepage. Is the new link there? Not? ... bullocks! (it worked for me) Try $last{'Title'} and stuff to get the info. /Widgetz