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
$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 '';
}
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 = "";
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']." :
";
$p_msg .= $title.'
';
$p_msg .= "-----------------------------------------------------------------
";
$p_msg .= $message.'
';
$p_msg .= "-----------------------------------------------------------------
";
$p_msg .= _MD_CATADS_CANJOINT." $email_user";
if ($phone !='')
$p_msg .= '
'._MD_CATADS_ORAT." $phone";
$p_msg .= '
';
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:
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...