[x] Navigation

[x] Languages

[x] Design
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.

neues modul zur anbindung an majordomo

This forum is locked: you cannot post, reply to, or edit topics.    This topic is locked: you cannot edit posts or make replies.    Printer Friendly Page     Forum Index ›  Sonstige Module

View previous topic :: View next topic  
Author Message
lexi_
Doppel-Null-Agent
Doppel-Null-Agent

Offline Offline
Joined: Jul 07, 2004
Posts: 178

PostPosted: 25.10.2004 14:24
Post subject: neues modul zur anbindung an majordomo

hallo,
dies ist eine modifizierte datei aus dem Modul "Contact". Wenn ich sie als index.php laufen lasse funzt sie einwandfrei, wenn ich sie aber als andere Datei (writemessage.php) funktioniert sie nicht mehr Sad was genau muß ich beachten in dieser datei beim umbenennen und was muß ich in der index.php beachten ?
mfg lexi




Array:
<?php

/************************************************************************/
/* CPG-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Module Copyright (c) 2004 by Akamu - CPG Dev Team http://cpgnuke.com */
/* Last modification notes:                                             */
/* Security Fix added real ip of sender for tracing spam                */
/* CHARSET encoding added to allow for the varying charsets             */
/* $Id: index.php,v 1.7 2004/07/16 11:32:43 djmaze Exp $                */
/*                                                                      */
/************************************************************************/
if (!defined('CPG_NUKE')) {
    die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- "._ContentLANG;
$abweisen = _NO_GROUPMAIL;

require("includes/class.phpmailer.php");
$mail = new PHPMailer();

$pagetitle = "- "._GROUPMAIL;
$index = 1;
define("_SEND_TO", "Send To:");
/**********************************/

include("header.php");
require_once("includes/nbbcode.php");
global $userinfo, $user, $MAIN_CFG;
$sender_name = '';
$sender_email = '';



if (is_user($user)) {
    if ($userinfo['name'] != '') {
        $sender_name = $userinfo['name'];
    } else {
        $sender_name = $userinfo['username'];
    }
    $sender_email = $userinfo['user_email'];
}

$bb = '';
if ( $MAIN_CFG['email']['allow_html_email'] || (is_admin($admin)) ) {
    $bb = bbcode_table('message', 'email_mod',0);
} else {
    $bb = '';
}

$recip = '';
if (is_admin($admin)) {
    $sender_email = $adminmail;
    $sender_name = $sitename;
    $recip = '<label for="send_to"><strong>'._SEND_TO.'</strong></label><br /><input type="text" name="send_to" size="30"><br />';
} else {
    $recip = '';
}
$form_block = "
<p align=\"center\"><fieldset><legend=\"title\"><b>$sitename: "._GROUPMAIL."</b> 
  <form name=\"email_mod\" method=\"post\" ACTION=\"".getlink()."\" enctype=\"multipart/form-data\" accept-charset=\""._CHARSET."\">
  <input type=\"hidden\" name=\"sender_email\" value=\"$sender_email\" size=\"30\">
  <br />
  <label for=\"subject\"><strong>"._SUBJECT.":</strong></label><br />
  <input type=\"text\" name=\"subject\" value=\"$subject\" size=\"90\">
  <br />
  <br />
  $recip <strong>"._MESSAGE.":</strong><br />
  $bb<br />
  <textarea name=\"message\" cols=\"90\" rows=\"25\" wrap=\"virtual\">$message</textarea>
  <br />
  <br \>
  <br \>
  <input type=\"hidden\" name=\"opi\" value=\"ds\">
  <input type=\"submit\" name=\"submit\" value=\""._SEND."\"> &nbsp; &nbsp; &nbsp; &nbsp;<input type=\"reset\" name=\"reset\" value=\""._RESET."\">
</form></fieldset>";




OpenTable();

if($userinfo[newsletter] == 0){

                 printf ("<br>"); 
                 printf ("<br>");
                 printf ("<br>");
                 printf ("<br>");
                 printf ("<br>");
                 printf ("<br>");
         printf("%s",$abweisen);
                 printf ("<br>"); 
                 printf ("<br>");
                 printf ("<br>");
                 printf ("<br>");
                 printf ("<br>");
                 printf ("<br>");
}


if ($opi != "ds"&& $userinfo[newsletter] == 1) {
    echo "$form_block";
} elseif ($opi == "ds") {
            if ($sender_name == "") {
        $name_err = "<center><font class=\"option\"><b><i>"._ENT_NAME_LABEL."</i></b></font></center><br />";
        $send = "no";
    } 
    if ($sender_email == "") {
        $email_err = "<center><font class=\"option\"><b><i>"._ENT_EMAIL_LABEL."</i></b></font></center><br />";
        $send = "no";
    } 
    if ($message == "") {
        $message_err = "<center><font class=\"option\"><b><i>"._ENT_MESSAGE_LABEL."</i></b></font></center><br />";
        $send = "no";
    } 
    if ($send != "no") {
        $sender_name = removecrlf($sender_name);
        $sender_email = removecrlf($sender_email);
       $msg .= " ".stripslashes($message)."\n";
       $mail->SetLanguage();
        if($MAIN_CFG['email']['smtp_on']){
            $mail->IsSMTP();   // set mailer to use SMTP
            $mail->Host = $MAIN_CFG['email']['smtphost'];
            if ($MAIN_CFG['email']['smtp_auth']){
                $mail->SMTPAuth = true;     // turn on SMTP authentication
                $mail->Username = $MAIN_CFG['email']['smtp_uname'];  // SMTP username
                $mail->Password = $MAIN_CFG['email']['smtp_pass']; // SMTP password
            }
        }
        $mail->From = $sender_email;
        $mail->FromName = $sender_name;
        $mail->AddAddress("testmail@lexipage.de");
        if ( $MAIN_CFG['email']['allow_html_email'] || is_admin($admin) ) {
            $msg = decode_bbcode($msg);
            $mail->IsHTML(true);
            $mail->AltBody = strip_tags($msg);
        }
        $mail->AddReplyTo("testmail@lexipage.de ", "GWCB");
        $mail->Priority = 3;
        $mail->Encoding = "8bit";
        $mail->CharSet = _CHARSET;
        $mail->Subject = "[testmail]  $subject";
        $mail->Body    = $msg;
        $mail->kopf   = $header;
        $mail->AltBody = strip_tags($msg);
    if(!$mail->Send()){
            echo "Message could not be sent. <p>";
            echo "Mailer Error: " . $mail->ErrorInfo;
        }else {
            echo '<p align="center">'._SUCCESS_MESSAGE_SENT.'<br />';
            echo "$subject<br />";
            echo "$msg<br />";    
            echo '<p align="center">'._MAHALO.'</center></p>';
        }
    } elseif ($send == "no") {
        OpenTable2();
        echo "$name_err";
        echo "$email_err";
        echo "$message_err";
        CloseTable2();
        echo "<br /><br />";
        echo "$form_block";
    } 
}

CloseTable();
include("footer.php");

?>

hier die index.php
Array:
<?php
//version 1.0.0A


if (!defined('CPG_NUKE')) {
    die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- "._GROUPMAIL;
$index = 1;




include('header.php');
$titel="<center><h4>"._TITEL."</h4></center>";
$br="<br>";
function writemessage() {
    global $module_name;
    include('header.php');
    include("modules/$module_name/writemessage.php");
    display_writemessage();
    include('footer.php');
	}

OpenTable();


        echo "$titel"
                 ."$br"
                 ."$br"
                 ."<center><font class=\"content\"> <a href=\"".getlink("&amp;file=writemessage")."\">"._GROUPMAIL."</a> "."</font></center>\n"
                 ."$br"
                 ."$br";
        echo "<table>"
			 ."<tr><td>$username</td><td>$user_email</td><td>$subject</td><td>$body_begin</td><td>$date</td></tr>"
             ."</table>";

  
                 



CloseTable();
include("footer.php");



?>
demo link:http://lexipage.de
writemessage als eigen ständiges modul:www.lexipage.de/index....itemessage
als Modul Groupmail (index.php,groupmail.php) www.lexipage.de/index....=Groupmail
um auf die module zugreifen zu können müßt ihr unter your account im newsletter eingetragen sein. die sprache hab ich noch nicht angepasst


lexi_'s server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Server SUSE 9.3 / PHP 4.3.10 / Mysql 4.1.10a / cpg 9.2.0.RC2
Back to top
View user's profile Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.    This topic is locked: you cannot edit posts or make replies.    Printer Friendly Page    Forum Index ›  Sonstige Module
Page 1 of 1
All times are GMT + 1 Hour



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum




Interactive software released under GNU GPL, Code Credits, Privacy Policy