as in regard to the contact form...
I took the guts from catads module contact scripts and got this:
http://7.pdvop2sz.z8.ru/modules/profile/userinfo.php?uid=1 (please click email icon to see it in action) but as you can see it doesnt load the form. here is a working sample in catads module:
http://7.pdvop2sz.z8.ru/modules/catads/adsitem.php?ads_id=12. I seem to change all variables but it doesn't work. Could you please check the final scripts? Seems like it requires 2 files: contact.php and form_contact.inc.php.
contact.php
le="color: #000000"><?php $op = 'form'; foreach ($_POST as $k => $v) {${$k} = $v;} foreach ($_GET as $k => $v) {${$k} = $v;} if ( isset($preview)) { $op = 'preview'; } elseif ( isset($post) ) { $op = 'post'; } function displaypost($title, $content) { echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"><tr><td class="head">'.$title.'</td></tr><tr><td><br />'.$content.'<br /></td></tr></table>'; } switch($op) { case "post": global $xoopsConfig; include("../../mainfile.php"); $ts =& MyTextSanitizer::getInstance(); $fullmsg = _MD_CATADS_FROMUSER." $name_user "._MD_CATADS_YOURADS." ".$xoopsConfig['sitename']." :nn"; $fullmsg .= $title."n"; $fullmsg .= "-----------------------------------------------------------------n"; $fullmsg .= "$messagenn"; $fullmsg .= "-----------------------------------------------------------------nn"; $fullmsg .= _MD_CATADS_CANJOINT." $email_user"; if ($phone !='') $fullmsg .= 'n'._MD_CATADS_ORAT." $phone"; $xoopsMailer =& getMailer(); $xoopsMailer->useMail(); $xoopsMailer->setFromEmail($email_user); $xoopsMailer->setFromName($xoopsConfig['sitename']); $xoopsMailer->setToEmails($email_author); $xoopsMailer->setSubject(_MD_CATADS_CONTACTAFTERADS); $xoopsMailer->setBody($fullmsg); $msgsend = "<div style='text-align:center;'><br /><br />"; if ( !$xoopsMailer->send()) { $msgsend .= $xoopsMailer->getErrors(); } else { $msgsend .= "<h4>"._MD_CATADS_MSGSEND."</h4>"; } $msgsend .= "<br /><br /><a href="javascript:window.close();">"._PM_ORCLOSEWINDOW."</a></div>"; echo $msgsend; break; case "preview": include("../../mainfile.php"); $ts =& MyTextSanitizer::getInstance(); xoops_header(); $p_title = $title; // $p_title = $myts->makeTboxData4Preview($p_title); $p_title = $ts->htmlSpecialChars($ts->stripSlashesGPC($p_title)); $p_msg = _MD_CATADS_FROMUSER." $name_user "._MD_CATADS_YOURADS." ".$xoopsConfig['sitename']." :<br />"; $p_msg .= $title.'<br />'; $p_msg .= "-----------------------------------------------------------------<br />"; $p_msg .= $message.'<br /><br />'; $p_msg .= "-----------------------------------------------------------------<br />"; $p_msg .= _MD_CATADS_CANJOINT." $email_user"; if ($phone !='') $p_msg .= '<br />'._MD_CATADS_ORAT." $phone"; $p_msg .= '<br />'; displaypost($p_title, $p_msg); $title = $ts->htmlSpecialChars($ts->stripSlashesGPC($title)); $message = $ts->htmlSpecialChars($ts->stripSlashesGPC($message)); include "include/form_contact.inc.php"; xoops_footer(); break; case "form": default: include("../../mainfile.php"); xoops_header(); $member_handler =& xoops_gethandler('member'); $thisUser =& $member_handler->getUser($uid); // initialisation variables $message = ''; $phone = ''; $name_user = ''; $email_user =''; $email_author = $thisUser->getVar('email', 'E'); $title = "Regarding your profile on FreelancerSupport.com"; if($xoopsUser) { $name_user = ($xoopsUser->getVar('name')!='')? $xoopsUser->getVar("name") : $xoopsUser->getVar("uname"); $email_user = $xoopsUser->getVar("email", "E"); } include "include/form_contact.inc.php"; xoops_footer(); break; }
form_contact.inc.php:
le="color: #000000"><?php include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; $form_contact = new XoopsThemeForm(_MD_CATADS_CONTACTAUTOR, "form_contact", "contact.php"); $title_text = new XoopsFormText(_MD_CATADS_TITLE, "title", 52, 100, $title); $form_contact->addElement($title_text, true); $name_text = new XoopsFormText(_MD_CATADS_YOURNAME.'*', "name_user", 50, 100, $name_user); $form_contact->addElement($name_text, true); $email_text = new XoopsFormText(_MD_CATADS_YOUREMAIL.'*', "email_user", 50, 100, $email_user); $form_contact->addElement($email_text,true); $phone_text = new XoopsFormText(_MD_CATADS_YOURPHONE, "phone", 20, 20,$phone); $form_contact->addElement($phone_text, false); $annonce_text = new XoopsFormTextArea(_MD_CATADS_YOURMESSAGE.'*', "message", $message); $form_contact->addElement($annonce_text, true); $button_tray = new XoopsFormElementTray('' ,''); $button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit')); $button_tray->addElement(new XoopsFormButton('', 'post', _SEND, 'submit')); $button_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); $button_cancel->setExtra("' onclick='javascript:window.close();'"); $button_tray->addElement($button_cancel); $form_contact->addElement($button_tray); $form_contact->addElement(new XoopsFormHidden('email_author', $email_author)); $form_contact->display();
maybe I missed something...