11
nmbsailorgal
Solution for xdirectory blank contact page (code, not htaccess)

Well, i'm a stubborn newbie. Couldn't wait for a reply and poked and picked and got this bit of code to work. It may not be right, but it works on my site.
Complete code for the contact.php page in xdirectory:
//
// ------------------------------------------------------------------------- //
// E-Xoops: Content Management for the Masses //
// < http://www.e-xoops.com > //
// ------------------------------------------------------------------------- //
// Original Author: Pascal Le Boustouller
// Author Website : pascal.e-xoops@perso-search.com
// Licence Type : GPL
// ------------------------------------------------------------------------- //
if ($_POST['submit']) {
include("header.php");
global $xoopsConfig, $xoopsDB, $myts, $meta, $message;
$lid = $_POST['id'];
$result = $xoopsDB->query("SELECT title, email FROM ".$xoopsDB->prefix("xdir_links")." WHERE lid = '$lid'");
while(list($title, $email) = $xoopsDB->fetchRow($result)) {
if ($_POST['tele']) {
$teles = "Phone: ".$_POST['tele'];
} else {
$teles = "";
}

$message .= "Message from ".$_POST['namep']."\ne-Mail: ".$_POST['post']." ".$meta['title']."\n";
$message .= $_POST['namep']." wrote:\n";
$message .= $_POST['messtext']."\n\n\n";
$message .= "This message was sent by ".$_POST['namep']." using the e-Mail form on {X_SITENAME}. \n\n\n";

$subject = "Email Submission from {X_SITENAME}";
$mail =& getMailer();
$mail->useMail();
$mail->setFromEmail($_POST['post']);
$mail->setToEmails($email);
$mail->setSubject($subject);
$mail->setBody($message);
$mail->send();
echo $mail->getErrors();
}
redirect_header("index.php",1,_CLA_MESSEND);
exit();

} else {
$lid = $_GET['lid'];
include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
OpenTable();

$result = $xoopsDB->query("SELECT title, email FROM ".$xoopsDB->prefix("xdir_links")." WHERE lid = '$lid'");
while(list($title, $email) = $xoopsDB->fetchRow($result)) {

echo "";


echo "

";
echo "Send a message to:
$title
";
echo "";
echo "";
echo "";

if($xoopsUser) {
$idd =$xoopsUser->getVar("name", "E");
$idde =$xoopsUser->getVar("email", "E");
}

echo "
















Your Name:
Your e-Mail:
Your Phone:
Message:


";

CloseTable();
include(XOOPS_ROOT_PATH."/footer.php");
}
}
?>

Login

Who's Online

674 user(s) are online (53 user(s) are browsing Support Forums)


Members: 0


Guests: 674


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits