1
nmbsailorgal
Re: Anyone successfully running phpadsnew Xoops Module ?

I have it running on NorthMyrtleBeachOnline.com. It installed like a module, although I am about to try a fresh install. I create custom blocks where I want to display an ad and use the generated banner code in the custom block.



2
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 "<script>
function verify() {
var msg = \"Errors were found during the validation of this form!\\n__________________________________________________\\n\\n\";
var errors = \"FALSE\";


if (document.Cont.namep.value == \"\") {
errors = \"TRUE\";
msg += \"The Name field is a required field.\\n\";
}

if (document.Cont.post.value == \"\") {
errors = \"TRUE\";
msg += \"The e-Mail field is a required field.\\n\";
}

if (document.Cont.messtext.value == \"\") {
errors = \"TRUE\";
msg += \"The Message field is a required field.\\n\";
}


if (errors == \"TRUE\") {
msg += \"__________________________________________________\\n\\nPlease correct the errors listed above before submitting this form.\\n\";
alert(msg);
return false;
}
}
</script>";


echo "<B></B><BR><BR>";
echo "Send a message to:<br><font size=4>$title</font><BR>";
echo "<form onSubmit=\"return verify();\" method=\"post\" action=\"contact.php\" NAME=\"Cont\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$lid\">";
echo "<INPUT TYPE=\"hidden\" NAME=\"submit\" VALUE=\"1\">";

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

echo "<TABLE WIDTH=100% BORDER=0 CELLSPACING=1>
<TR>
<TD>Your Name: </TD>
<TD><input type=\"text\" name=\"namep\" size=\"42\" value=\"$idd\"></TD>
</TR>
<TR>
<TD>Your e-Mail: </TD>
<TD><input type=\"text\" name=\"post\" size=\"42\" value=\"$idde\"></font></TD>
</TR>
<TR>
<TD>Your Phone: </TD>
<TD><input type=\"text\" name=\"tele\" size=\"42\"></font></TD>
</TR>
<TR>
<TD>Message: </TD>
<TD><textarea rows=\"5\" name=\"messtext\" cols=\"40\"></textarea></TD>
</TR>
</TABLE>
<p><INPUT TYPE=\"submit\" VALUE=\"Send\">
</form>";

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



3
nmbsailorgal
Re:solution for xdirectory blank contact page

I would like to properly fix this contact.php form. I have fixed it enough to actually display the form but not send the email.

Here is the bit of code:

$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();

I am confused about whether to use $_GET or whatever for the $ variables. I am new to PHP programming, so please forgive my beginner question.



4
nmbsailorgal
Re: Can I delete the sql folders in the modules after setup is complete?

Great, excellent point and thanks for the prompt replies. I had not thought about the fact that if they were savvy enough to know the folder existed, then they would know where to get the module in the first place!



5
nmbsailorgal
Can I delete the sql folders in the modules after setup is complete?

I have been researching how to secure my site and read some excellent faqs regarding the Protector module and the related forums. I started thinking about the fact that all my modules still have the sql folder in them with the database structure just waiting for someone to stumble upon them.

Can I remove these files and the parent sql folder? I assume that if I do, uninstalling will not be possible, therefore I will need backups for them, correct?

Thanks for all the great info, coding, and the like! Great way to learn php and MySql!




TopTop



Login

Who's Online

133 user(s) are online (89 user(s) are browsing Support Forums)


Members: 0


Guests: 133


more...

Donat-O-Meter

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

Latest GitHub Commits