1
Cozzie
Where is the html template? Please help
  • 2007/9/19 9:57

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


I trying to update the contact form on the module mxdirectory. I can change the contact.php page, no problems - but I can't find a contact.html template anywhere!!!

There's gotta be one right?? But there isn't in the templates folder of the module.

Contact.php is the page to send an email to a company in the directory. There is the same problem for submit.php which is the page to add a listing - there's no html template page anywhere.

I've really, really gotta change the page layout asap - can someody help me please!!!!!

Thanks!

2
zyspec
Re: Where is the html template? Please help
  • 2007/9/19 12:06

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Both submit.php and contact.php use the XoopsForm class. This class takes care of creating and displaying the actual html.

In submit.php (MX-Directory ver 3.01) you'll find most of the form creation code starts at around line 210.

In contact.php it starts around line 46...

3
Cozzie
Re: Where is the html template? Please help
  • 2007/9/21 10:43

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Thanks a lot zyspec! That clarifies things.

But I'm still stuck!!

I'm trying to put a contact form on each article of the smartsection module.

As smart section doesn't have this I'm trying to adapt the contact form on mxdirectory (the business listing module).

But every time I submit the contact form I get this message:

Error: Number %s, please contact the site administrator

This may be a bit vague, but do you know what I'm doing wrong?

I've changed the $result to get the relevant values from the smartsection database and I've changed $lid to $itemid (as used by smartsection) - but its not working.

Is it possible to set up a contact form in this way?

Thanks a lot for any suggestions

4
Cozzie
Re: Where is the html template? Please help
  • 2007/9/22 8:48

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Mmmmm, can't get the form to work. So I have adapted the much simpler contact.php form of xdirectory.

Now, when I submit a message its says it has now been sent successfully, but no email arrives (I'm trying to send to myself).

Is anyone able to take a quick look at the code I'm using and tell me why its not working???


Quote:

if ($submit) {
include("header.php");
global $xoopsConfig, $xoopsDB, $myts, $meta;

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


if ($tele) {
$teles = "Phone: $tele";
} else {
$teles = "";
}

$message .= "Message from $namep\ne-Mail: $post ".$meta['title']."\n$teles\n\n";
$message .= "$namep wrote:\n";
$message .= "$messtext\n\n\n";
$message .= "This message was sent by $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);
$mail->setToEmails($email);
$mail->setSubject($subject);
$mail->setBody($message);
$mail->send();
echo $mail->getErrors();
}
redirect_header("index.php",1,_CLA_MESSEND);
exit();

} else {

include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
OpenTable();

$result = $xoopsDB->query("SELECT title, email FROM ".$xoopsDB->prefix("coursesearch_items")." WHERE itemid = '$id'");
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");
}
}
?>


Thanks a lot for any help, its really appreciated (and needed!)

5
kodepree
Re: Where is the html template? Please help
  • 2008/4/15 21:04

  • kodepree

  • Just popping in

  • Posts: 2

  • Since: 2005/3/8 2


Hi Cozzie,

I had the same problem with sending e-mail from MX-directory version 3.01. I just could'nt fix it and stopped searching.

As you supposed I took the contact.php from X-directory and without any change, it worked just fine! I translated the English descriptions in the file and that was it. I hope you succeeded too ;)

Ko de Pree

Login

Who's Online

415 user(s) are online (262 user(s) are browsing Support Forums)


Members: 0


Guests: 415


more...

Donat-O-Meter

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

Latest GitHub Commits