// phphoo3 - a yahoo-like link directory written for PHP3/4
// Copyright (C) 1999/2001 Rolf V. Ostergaard http://www.cable-modems.org/phpHoo/
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Refer to http://www.webreference.com/perl/xhoo/php1/ for phphoo, the
// first cut done by CDI.
$includepath = ("/home/traxdevr/config"); // Tried using this variable to no affect
include("/home/traxdevr/config/config.php"); // Have tried various, such as ../../config/config.php and using $DOCUMENT_ROOT
//Works fine when config is in same directory.
// Configuration information
require("mysql.php"); // Access to all the database functions
require("smtp.php"); // Access to mail class
// Open the database
$db = new MySQL;
if(!$db->init()) {
echo "Cannot open database
\n";
exit;
}
// Prepare SMTP class
$smtp = new smtp_class;
$smtp->host_name = "mail.traxdev.com";
$smtp->localhost = "localhost";
// Send mail function
function smtp_mail($from, $to, $subject, $body, $replyto = "", $bcc = "")
{
global $smtp;
$hdr = array(
"From: $from",
"To: $to",
"Subject: $subject"
);
if ($replyto) { $hdr[] = "Reply-to: $replyto"; }
if ($bcc) { $hdr[] = "Bcc: $bcc"; }
if (!$smtp->SendMessage($from, array($to), $hdr, $body)) {
echo "
Could not send the message to $to.\nError: ".$smtp->error."
\n"; } } // Expand CatID to whole trail function breadcrumbs($CatID="") { global $db; global $PHP_SELF; if(empty($CatID)) { return; } $db->get_ParentsInt($CatID); $path = $db->TRAIL; if(!empty($path)) { while ( list ( $key,$val ) = each ($path)) { $CatID = stripslashes($val["CatID"]); $CatName = stripslashes($val["CatName"]); $trail = "$CatName$trail"; } } else { $trail = ""; } return $trail; } function breadcrumbs_txt($CatID="") { global $db; global $PHP_SELF; if(empty($CatID)) { return; } $db->get_ParentsInt($CatID); $path = $db->TRAIL; if(!empty($path)) { while ( list ( $key,$val ) = each ($path)) { $CatID = stripslashes($val["CatID"]); $CatName = stripslashes($val["CatName"]); if ($trail) { $trail = "$CatName: $trail"; } else { $trail = $CatName; } } } else { $trail = "-"; } return $trail; } // Print page header based on template file function print_header($CatID="",$title="") { global $TEMPLATE_FILE; $trail = breadcrumbs($CatID); $filename = $TEMPLATE_FILE; $fd = fopen ($filename, "r"); $c = fread ($fd, filesize ($filename)); fclose ($fd); $c = eregi_replace("@PHPHOO_BODY@.*", "", $c); $c = str_replace("@TRAIL@", $trail, $c); $c = str_replace("@TITLE@", $title, $c); print ($c); } // Print page footer based on template file function print_footer() { global $db; global $TEMPLATE_FILE; $lnk_cnt = $db->get_approved_cnt(); $new_cnt = $db->get_not_approved_cnt(); $filename = $TEMPLATE_FILE; $fd = fopen ($filename, "r"); $c = fread ($fd, filesize ($filename)); fclose ($fd); $c = eregi_replace(".*@PHPHOO_BODY@", "", $c); $c = str_replace("@LNK_CNT@", $lnk_cnt, $c); $c = str_replace("@NEW_CNT@", $new_cnt, $c); print ($c); } function show_submissions_list($CatID) { global $PHP_SELF; global $db; global $SEE_ALL_SUBMISSIONS; global $TOP_CAT_NAME; if ($SEE_ALL_SUBMISSIONS) { $sub = $db->get_Submissions(); } else { // Need to replace with function to show only for this CatID $sub = $db->get_Submissions(); }; print "';
print "
| '; } } print "\n"; print " |
Bad LinkID, nothing returned