# Edit me to point to the config.php3 on your PC. include "config.php3"; #-----------------------------------------------------------------> # Sun Mar 19 14:05:56 EST 2000 # Version: 0.5.9 # Website: http://mythreads.sourceforge.net # # Desc: Main script for maintaining a links database # # # License: This code is released under the terms of the GNU GPL # version 2 or later. Please refer to www.gnu.org for a copy # of this license. # #-----------------------------------------------------------------> // PHP 5 fix $HTTP_GET_VARS = $_GET; $HTTP_POST_VARS = $_POST; $HTTP_COOKIE_VARS = $_COOKIE; # main() : This function controls the script functions. function main() { include("./lib/lib_main.php3"); global $tpl, $allow, $HTTP_GET_VARS, $HTTP_COOKIE_VARS, $HTTP_POST_VARS, $admin_username, $admin_password,$add_link,$sug_category; global $sp_max_top_links, $sp_max_new_links; DatabaseConnect(); if (isset ($HTTP_GET_VARS[mode])) { if ($HTTP_GET_VARS[mode] == 'search') { include('/home/www/domains/hippos.fi/hippos/include/gallery/header.php'); include("./lib/lib_search.php3"); include('/home/www/domains/hippos.fi/hippos/include/gallery/footer.php'); } else if (eregi("(add_link|update_link|add_category)",$HTTP_GET_VARS[mode])) { include('/home/www/domains/hippos.fi/hippos/include/gallery/header.php'); include("./lib/lib_addupdate.php3"); include('/home/www/domains/hippos.fi/hippos/include/gallery/footer.php'); } else if ($HTTP_GET_VARS[mode] == 'admin') { include("./lib/lib_admin.php3"); include('/home/www/domains/hippos.fi/hippos/include/gallery/footer.php'); exit; } else { showMainPage(); } } else if(isset ($HTTP_GET_VARS[count])) { countIt($HTTP_GET_VARS[count]); } else if (isset ($HTTP_GET_VARS[category])) { # Get the content before showing the webpage if ($HTTP_GET_VARS[category] == 'top_links') { $your_current_location = "Suosituimmat linkit"; $category_links=Top_Hits($sp_max_top_links); } else if ($HTTP_GET_VARS[category] == 'new_links') { $your_current_location = "Uusimmat linkit"; $category_links=Newly_Added($sp_max_new_links); } else { $categories = viewPage($HTTP_GET_VARS[category]); $your_current_location = display_category($HTTP_GET_VARS[category]); $category_links = display_category_links($HTTP_GET_VARS[category], $HTTP_GET_VARS[view]); } $searchFooter = Search_Footer(); # Sets a few variables before we parse the HTML template $tpl->assign( array( ADD_LINK => "$add_link"."&category=$HTTP_GET_VARS[category]" )); $tpl->assign( array( SUG_CATEGORY => "$sug_category"."&category=$HTTP_GET_VARS[category]" )); $tpl->assign( array( SUB_CATEGORIES => $categories )); $tpl->assign( array( SEARCH_FOOTER => $searchFooter )); $tpl->assign( array( CATEGORY_LINKS => $category_links )); $tpl->assign( array( INFO => $your_current_location )); include('/home/www/domains/hippos.fi/hippos/include/gallery/header.php'); showStartTemplate(); include('/home/www/domains/hippos.fi/hippos/include/gallery/footer.php'); } else { include('/home/www/domains/hippos.fi/hippos/include/gallery/header.php'); showMainPage(); include('/home/www/domains/hippos.fi/hippos/include/gallery/footer.php'); } } # End Main Function function DatabaseConnect() { /* global $database, $host, $username, $password; if (!($mylink = mysql_connect( $host, $username, $password))) { print "