FORUMS

 Forum Index > FlashYourWeb Development > FlashYourWeb - Design & Support New Topic Post Reply
 Geeklog Newsletter Plugin
 |  Printable Version
Anonymous: Laugh
 October 18 2009 08:45 AM  


Bug him again about it, sometimes it takes a few nudges Big Grin


 
Quote
cordiste
 November 04 2009 03:53 AM  
Forum Junior
Junior

Status: offline

Registered: 10/15/09
Posts: 19

I'll need one more translated line.... "Sorry no archives yet" or similar.


Hello,

I forgot to set the forum auto notification so I discover your response today...

The translation could be

PHP Formatted Code
Désolé, il n'y a pas encore de newsletter dans nos archives.


Another great feature would be a multi newsletter system, so user could sign for newsletter 1 or/and newsletter 2

::Ben


Support and French community [ www.geeklog.fr ]
 
Profile Email Website
Quote
suprsidr
 November 04 2009 19:33 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1068

Ok, new version 1.0.7 up.

Thanks Ben for the translation, I added 2 more lines that need your language skills Wink
'user_menu_subscribe' => 'Subscribe to Newsletter',
'user_menu_unsubscribe' => 'Unsubscribe from Newsletter'
if you could.

You can now blacklist and whitelist in the newsletter admin and you can even black/white list whole domains with an Astrix ie. *@somedomain.com

I ended up adding a user menu subscribe/unsubscribe instead of the profile display - since Dirk chose not to address my concerns for 4 months.

Enjoy
-s


There will always be...
 
Profile Email Website
Quote
cordiste
 November 04 2009 20:39 PM  
Forum Junior
Junior

Status: offline

Registered: 10/15/09
Posts: 19

Hello,

Thanks for the new release.

French translation


'user_menu_subscribe' => 'S'abonner à la Newsletter',
'user_menu_unsubscribe' => 'Se désabonner de la Newsletter'


::Ben


Support and French community [ www.geeklog.fr ]
 
Profile Email Website
Quote
suprsidr
 November 16 2009 09:30 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1068

Version 1.0.8 is up, sorry about all the bugs I let slip last time - We should never let our work sit unfinished for four months Wink

v.1.0.8:

  • Updates properly - sorry about that Wink
  • Properly creates the subscription block.
  • Adds import current users functionality.
  • Add new configuration option to subscribe new users.

All users are encouraged to update.

Ben, a little more translation Smile

-s



There will always be...
 
Profile Email Website
Quote
suprsidr
 November 18 2009 04:41 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1068

Question via comments:

when I can change default charset of newsletter mail to cp1251?


path_to_geeklog/plugins/newsletter/functions.inc line ~1355:
PHP Formatted Code

function NL_mailIt($nl_id, $title, $content, $test=false)
{
    global $_CONF, $_USER, $_TABLES, $LANG_NL;

    require_once $_CONF['path'].'plugins/newsletter/class.phpmailer.php';

    $mail = new PHPMailer();

    $mail->From     = $_CONF['noreply_mail'];
    $mail->FromName = $_CONF['site_name'];
    $mail->Subject = $title;
 


You can add your charset here like:
PHP Formatted Code

function NL_mailIt($nl_id, $title, $content, $test=false)
{
    global $_CONF, $_USER, $_TABLES, $LANG_NL;

    require_once $_CONF['path'].'plugins/newsletter/class.phpmailer.php';

    $mail = new PHPMailer();

    $mail->From     = $_CONF['noreply_mail'];
    $mail->FromName = $_CONF['site_name'];
    $mail->Subject = $title;
    $mail->CharSet = 'cp1251';
 

Future versions certainly could get that from geeklog itself.
This plugin uses CodeWorx phpmailer which seems far more reliable then geeklog's built-in mail functions.

-s


There will always be...
 
Profile Email Website
Quote
cordiste
 November 18 2009 04:56 AM  
Forum Junior
Junior

Status: offline

Registered: 10/15/09
Posts: 19

Hello.

To get that from geeklog, you could use

PHP Formatted Code

    $mail->CharSet = COM_getCharset();
 


::Ben


Support and French community [ www.geeklog.fr ]
 
Profile Email Website
Quote
suprsidr
 November 18 2009 05:04 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1068

Thanks Ben Smile

I noticed you had taken down your newsletter block on yoursite.
I know I had broken some functionality with my sloppy release.
Hopefully this release fixes any issues you had and you'll continue with your translation contributions.

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: lwc
 November 18 2009 07:00 AM  


Another problem is many domains (read: the free ones) don't accept more than X messages from one sender at a time. That's why a mailing list software like phplist allows to limit the number of messages per each domain in one sending. Until I found this setting in phplist, domains like Gmail simply bounced my messages back (after sending to more than X users). So this option is very important. Please have it.


 
Quote
Anonymous: Pushkar
 November 18 2009 07:10 AM  


Thank you very much!!!! Big Grin


 
Quote
suprsidr
 November 18 2009 07:57 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1068

@lwc
I was just reading about those issues this morning.
http://phpmailer.worxware.com/index.php?pg=tips
http://phpmailer.worxware.com/index.php?pg=tip_spf

But we're not sending in "one big send" these actually get sent one-by-one albeit very quickly.
I have not yet run into the issue you described. But have seen spam issues which relate more to mail server settings then the actual application itself. For example DNS PTR and the above SPF record.

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: lwc
 November 18 2009 12:45 PM  


Of course it's one by one when we're talking about a mailing list. For example, if you send to a Gmail user, then to another Gmail user, then to another...eventually Gmail starts bouncing your messages.

I am not - I repeat, not - talking about Gmail putting it in a spam folder. I am talking about actually bouncing DNS/SPF/anything-you-want approved messages back with a message that says something like "you simply can't send to so many of our users in such a short time". The more subscribers you have with the same domains, the more likely you are to fall into this problem.


 
Quote
Laugh
 November 18 2009 13:40 PM  
Forum Newbie
Newbie

Status: offline

Registered: 06/29/09
Posts: 3

Quote by: lwc

Of course it's one by one when we're talking about a mailing list. For example, if you send to a Gmail user, then to another Gmail user, then to another...eventually Gmail starts bouncing your messages.

I am not - I repeat, not - talking about Gmail putting it in a spam folder. I am talking about actually bouncing DNS/SPF/anything-you-want approved messages back with a message that says something like "you simply can't send to so many of our users in such a short time". The more subscribers you have with the same domains, the more likely you are to fall into this problem.



This reminds me of the problem I have with my link exchange plugin. Though mine dealt with running out of processing time if you checked more than 5 to 10 links. I wanted to sit down and write a plugin that other plugins (or geeklog) could send batch jobs to, that the plugin could then initiate in the background at a predetermine time.

I never did sit down and figure out what the best way to do this was.


 
Profile Email Website
Quote
suprsidr
 November 18 2009 13:55 PM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1068

How much time between "batches"?

If it were only 10, 20 or even 30 seconds, the admin could sit and wait:
"Please wait while we process your request...."
And use ajax with setInterval or setTimeout.
But if you are talking minutes or hours, cron only.

-s


There will always be...
 
Profile Email Website
Quote
Anonymous: lwc
 November 18 2009 15:15 PM  


phplist let's you do define whatever you want and just reloads by itself to start a new batch (even if it takes hours).

But keep in mind it's not a simple delay. The whole point is to delay the same domains, not to delay in general (that's an unrelated feature).


 
Quote
Laugh
 November 18 2009 16:43 PM  
Forum Newbie
Newbie

Status: offline

Registered: 06/29/09
Posts: 3

Quote by: suprsidr

How much time between "batches"?

If it were only 10, 20 or even 30 seconds, the admin could sit and wait:
"Please wait while we process your request...."
And use ajax with setInterval or setTimeout.
But if you are talking minutes or hours, cron only.

-s




LWC mentioned delays in general. I know some hosts only allow you to send so many emails every hour (or whatever).

But to answer your question

My schedule was from 1 to 30 days and then I needed the plugin to check about 3 to 4 links at a time (of about 150 in total) to ensure it didn't extend beyond the PHP execution time limit. I didn't want to use cron jobs because they can be a pain to setup for some people and they cannot be configured by the plugin (this was a plugin I was going to release but never did). I also had to make sure the website didn't freeze up whenever the batch was triggered

What I ended up doing was bury a transparent image in the html code to trigger the batch. This way the site would continue to load and the getimage.php file would check to see if a scheduled event was needed to run.
PHP Formatted Code
<img src="/linkex/getimage.php?return_image=1" width="1" height="1">
 


It not an ideal solution (4 years ago) but it worked.


 
Profile Email Website
Quote
cordiste
 November 18 2009 22:43 PM  
Forum Junior
Junior

Status: offline

Registered: 10/15/09
Posts: 19

Hello,

I'm using cron to send lot of emails (email to user, newsletter...). The mail form (advanced editor) send message in the DB and the cron send email every X minutes. You can set the number of email sent during each job in the code.

Feel free to use some of this code in the newletter plugin if you need.

send_hello_cron.php

PHP Formatted Code

<?php

/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | hello 1.0.0                                                          |
// +---------------------------------------------------------------------------+
// | send_hello_cron.php                                                                 |
// |                                                                           |
// | Geeklog hello send page                                          |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2000-2008 by the following authors:                         |
// |                                                                           |
// | Authors: :Ben                                                         |
// +---------------------------------------------------------------------------+
// |                                                                           |
// | This program is free software; you can redistribute it and/or             |
// | modify it under the terms of the GNU General Public License               |
// | as published by the Free Software Foundation; either version 2            |
// | of the License, or (at your option) any later version.                    |
// |                                                                           |
// | This program is distributed in the hope that it will be useful,           |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
// | GNU General Public License for more details.                              |
// |                                                                           |
// | You should have received a copy of the GNU General Public License         |
// | along with this program; if not, write to the Free Software Foundation,   |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//


// Set this to true if you want to log debug messages to error.log
$_HELLO_VERBOSE = false;

require_once '/path/to/public_html/lib-common.php';


function HELLO_mail ( $to, $subject, $message, $from = '', $html = false, $priority = 0, $cc = '', $altBody = '' )
{
    global $_CONF;

    $subject = substr( $subject, 0, strcspn( $subject, "\r\n" ));
    $subject = COM_emailEscape( $subject );

    if( function_exists( 'CUSTOM_mail' ))
    {
        return CUSTOM_mail( $to, $subject, $message, $from, $html, $priority, $cc );
    }

    require_once $_CONF['path'] . 'plugins/hello/lib/phpmailer/class.phpmailer.php';

    $mail = new PHPMailer();
    $mail->SetLanguage('en',$_CONF['path'].'plugins/hello/lib/phpmailer/language/');
    $mail->CharSet = COM_getCharset();
    if ($_CONF['mail_backend'] == 'smtp' ) {
        $mail->IsSMTP();
        $mail->Host     = $_CONF['mail_smtp_host'];
        $mail->Port     = $_CONF['mail_smtp_port'];
        if ( $_CONF['mail_smtp_secure'] != 'none' ) {
            $mail->SMTPSecure = $_CONF['mail_smtp_secure'];
        }
        if ( $_CONF['mail_smtp_auth'] ) {
            $mail->SMTPAuth   = true;
            $mail->Username = $_CONF['mail_smtp_username'];
            $mail->Password = $_CONF['mail_smtp_password'];
        }
        $mail->Mailer = "smtp";

    } elseif ($_CONF['mail_backend'] == 'sendmail') {
        $mail->Mailer = "sendmail";
        $mail->Sendmail = $_CONF['mail_sendmail_path'];
    } else {
        $mail->Mailer = "mail";
    }
    $mail->WordWrap = 76;
    $mail->IsHTML($html);
    $mail->MsgHTML($message);
    if ( $altBody != '' ) {
        $mail->AltBody = $altBody;
    }

    $mail->Subject = $subject;

    if (is_array($from) && isset($from[0]) && $from[0] != '' ) {
        if ( $_CONF['use_from_site_mail'] == 1 ) {
            $mail->From = $_CONF['site_mail'];
            $mail->AddReplyTo($from[0]);
        } else {
            $mail->From = $from[0];
        }
    } else {
        $mail->From = $_CONF['site_mail'];
    }

    if ( is_array($from) && isset($from[1]) && $from[1] != '' ) {
        $mail->FromName = $from[1];
    } else {
        $mail->FromName = $_CONF['site_name'];
    }
    if ( is_array($to) && isset($to[0]) && $to[0] != '' ) {
        if ( isset($to[1]) && $to[1] != '' ) {
            $mail->AddAddress($to[0],$to[1]);
        } else {
            $mail->AddAddress($to[0]);
        }
    } else {
        // assume old style....
        $mail->AddAddress($to);
    }

    if ( isset($cc[0]) && $cc[0] != '' ) {
        if ( isset($cc[1]) && $cc[1] != '' ) {
            $mail->AddCC($cc[0],$cc[1]);
        } else {
            $mail->AddCC($cc[0]);
        }
    } else {
        // assume old style....
        if ( isset($cc) && $cc != '' ) {
            $mail->AddCC($cc);
        }
    }

    if ( $priority ) {
        $mail->Priority = 1;
    }

    if(!$mail->Send()) {
        COM_errorLog("Email Error: " . $mail->ErrorInfo);
        return false;
    }
    return true;
}

function send_hello ()
{
    global $_CONF, $_TABLES, $_USER;
       
        $retval = '';

    //Set time limit (260)
    set_time_limit (260);

    $heure_script = date ('YmdHi', time ());
       
        //Set emails limit here (220)
    $requete ="SELECT * FROM {$_TABLES['hello_file_envoi']} WHERE date <= " . $heure_script . " limit 0,220";
        $result_objet_cherche = DB_query($requete);
        $liste_destinataire = array();
        while ($objet_cherche = mysql_fetch_array($result_objet_cherche))
        {
                $id_client = $objet_cherche['id'];
                $destinataire = $objet_cherche['destinataire'];
                $sujet = $objet_cherche['subject'];
                $message = $objet_cherche['content'];
                $html = true;
                $priority = $objet_cherche['priority'];
                // Send email
                HELLO_mail($destinataire, $sujet, $message, $from, $html, $priority, $cc = '', $altBody = '');
                // Delete hello
                DB_query("DELETE FROM {$_TABLES['hello_file_envoi']} WHERE id='" . $objet_cherche['id'] . "' ");
        }
        // Optimisation
        DB_query("OPTIMIZE TABLE {$_TABLES['hello_file_envoi']}");
}

// MAIN

send_hello ();

?>
 


email_group.php

PHP Formatted Code

<?php

/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
// | hello 1.0.0                                                          |
// +---------------------------------------------------------------------------+
// | index.php                                                                 |
// |                                                                           |
// | Geeklog hello administration page                                          |
// +---------------------------------------------------------------------------+
// | Copyright (C) 2000-2008 by the following authors:                         |
// |                                                                           |
// | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
// |          Mark Limburg      - mlimburg AT users DOT sourceforge DOT net    |
// |          Jason Whittenburg - jwhitten AT securitygeeks DOT com            |
// |          Dirk Haun         - dirk AT haun-online DOT de                   |
// |          : :Ben                 http://geeklog.fr                                        |
// +---------------------------------------------------------------------------+
// |                                                                           |
// | This program is free software; you can redistribute it and/or             |
// | modify it under the terms of the GNU General Public License               |
// | as published by the Free Software Foundation; either version 2            |
// | of the License, or (at your option) any later version.                    |
// |                                                                           |
// | This program is distributed in the hope that it will be useful,           |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
// | GNU General Public License for more details.                              |
// |                                                                           |
// | You should have received a copy of the GNU General Public License         |
// | along with this program; if not, write to the Free Software Foundation,   |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//


// Set this to true if you want to log debug messages to error.log
$_HELLO_VERBOSE = false;

require_once '../../../lib-common.php';
require_once '../../auth.inc.php';


$display = '';

if (!SEC_hasRights ('hello.edit')) {
    $display .= COM_siteHeader ('menu', $MESSAGE[30]);
    $display .= COM_startBlock ($MESSAGE[30], '',
                                COM_getBlockTemplate ('_msg_block', 'header'));
    $display .= $MESSAGE[36];
    $display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
    $display .= COM_siteFooter ();
    COM_accessLog ("User {$_USER['username']} tried to illegally access the hello administration screen.");
    echo $display;
    exit;
}

/**
* Shows the form the admin uses to send Geeklog members a message. Right now
* you can only email an entire group.
*
* @return   string      HTML for the email form
*
*/

function display_mailform ()
{
    global $_CONF, $_TABLES, $_USER, $LANG31, $LANG24;

    $retval = '';

    if ($_CONF['advanced_editor'] == 1) {
        $postmode = 'html';
    } elseif (empty ($postmode)) {
        $postmode = $_CONF['postmode'];
    }
       
    $mail_templates = new Template ($_CONF['path'] . 'plugins/hello/templates/admin/');
    if (($_CONF['advanced_editor'] == 1)) {
        $mail_templates->set_file('form','mailform_advanced.thtml');
    } else {
        $mail_templates->set_file('form','mailform.thtml');
        }
    $mail_templates->set_var('geeklogStyleBasePath',$_CONF['site_url'] . '/fckeditor');
       
    if ($postmode == 'html') {
        $mail_templates->set_var ('show_texteditor', 'none');
        $mail_templates->set_var ('show_htmleditor', '');
    } else {
        $mail_templates->set_var ('show_texteditor', '');
        $mail_templates->set_var ('show_htmleditor', 'none');
    }
    $mail_templates->set_var('lang_postmode', $LANG24[4]);
    $mail_templates->set_var('postmode_options', COM_optionList($_TABLES['postmodes'],'code,name',$postmode));
    $mail_templates->set_var ('site_url', $_CONF['site_url']);
    $mail_templates->set_var ('site_admin_url', $_CONF['site_admin_url']);
    $mail_templates->set_var ('layout_url', $_CONF['layout_url']);
    $mail_templates->set_var ('startblock_email', COM_startBlock ($LANG31[1],
            '', COM_getBlockTemplate ('_admin_block', 'header')));
    $mail_templates->set_var ('php_self', $_CONF['site_admin_url'] . '/plugins/hello/email_group.php');
    $mail_templates->set_var ('lang_note', $LANG31[19]);
    $mail_templates->set_var ('lang_to', $LANG31[18]);
    $mail_templates->set_var ('lang_selectgroup', $LANG31[25]);
    $group_options = '';
    $result = DB_query("SELECT grp_id, grp_name FROM {$_TABLES['groups']} WHERE grp_name <> 'All Users'");
    $nrows = DB_numRows ($result);
    $groups = array ();
    for ($i = 0; $i < $nrows; $i++) {
        $A = DB_fetchArray ($result);
        $groups[$A['grp_id']] = ucwords ($A['grp_name']);
    }
    asort ($groups);
    foreach ($groups as $groupID => $groupName) {
        $group_options .= '<option value="' . $groupID . '">' . $groupName
                       . '</option>';
    }
    $mail_templates->set_var ('group_options', $group_options);
    $mail_templates->set_var ('lang_from', $LANG31[2]);
    $mail_templates->set_var ('site_name', $_CONF['site_name']);
    $mail_templates->set_var ('lang_replyto', $LANG31[3]);
    $mail_templates->set_var ('site_mail', $_CONF['site_mail']);
    $mail_templates->set_var ('lang_subject', $LANG31[4]);
    $mail_templates->set_var ('lang_body', $LANG31[5]);
    $mail_templates->set_var ('lang_sendto', $LANG31[6]);
    $mail_templates->set_var ('lang_allusers', $LANG31[7]);
    $mail_templates->set_var ('lang_admin', $LANG31[8]);
    $mail_templates->set_var ('lang_options', $LANG31[9]);
    $mail_templates->set_var ('lang_HTML', $LANG31[10]);
    $mail_templates->set_var ('lang_urgent', $LANG31[11]);
    $mail_templates->set_var ('lang_ignoreusersettings', $LANG31[14]);
    $mail_templates->set_var ('lang_send', $LANG31[12]);
    $mail_templates->set_var ('end_block', COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer')));
    $mail_templates->set_var ('xhtml', XHTML);
    $mail_templates->set_var('gltoken_name', CSRF_TOKEN);
    $mail_templates->set_var('gltoken', SEC_createToken());

    $mail_templates->parse ('output', 'form');
    $retval = $mail_templates->finish ($mail_templates->get_var ('output'));

    return $retval;
}

/**
* This function actually sends the messages to the specified group
*
* @param    array   $vars   Same as $_POST, holds all the email info
* @return   string          HTML with success or error message
*
*/

function send_messages($vars)
{
    global $_CONF, $_TABLES, $LANG31, $LANG_HELLO01;

    require_once($_CONF['path_system'] . 'lib-user.php');

    $retval = '';

    if (empty ($vars['fra']) OR empty ($vars['fraepost']) OR
            empty ($vars['subject']) OR empty ($vars['content']) OR
            empty ($vars['to_group'])) {
        $retval .= COM_startBlock ($LANG31[1], '',
                        COM_getBlockTemplate ('_msg_block', 'header'));
        $retval .= $LANG31[26];
        $retval .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));

        return $retval;
    }

    // Urgent message!
    if (isset ($vars['priority'])) {
        $priority = 1;
    } else {
        $priority = 0;
    }

    $groupList = implode (',', USER_getChildGroups($vars['to_group']));

    $retval .= COM_startBlock ($LANG31[1]);

    // Enregistre le hello
       
        $creation = date ('YmdHi', time ());
        $subject = mysql_real_escape_string($vars['subject']);
       
        //Group name
        $group_name = DB_query("SELECT grp_name FROM {$_TABLES['groups']} WHERE grp_id =" . $vars['to_group'] . " ");
    $group_name = DB_fetchArray ($group_name);
        $email_group = $group_name[0];
       
        $content = ($vars['content']);
       
        // Programme la diffusion              
            $groupList = implode (',', USER_getChildGroups($vars['to_group']));

    if (isset ($vars['overstyr'])) {
        $sql = "SELECT DISTINCT username,fullname,email FROM {$_TABLES['users']},{$_TABLES['group_assignments']} WHERE uid > 1";
        $sql .= " AND {$_TABLES['users']}.status = 3 AND ((email is not null) and (email != ''))";
        $sql .= " AND {$_TABLES['users']}.uid = ug_uid AND ug_main_grp_id IN ({$groupList})";
    } else {
        $sql = "SELECT DISTINCT username,fullname,email,emailfromadmin FROM {$_TABLES['users']},{$_TABLES['userprefs']},{$_TABLES['group_assignments']} WHERE {$_TABLES['users']}.uid > 1";
        $sql .= " AND {$_TABLES['users']}.status = 3 AND ((email is not null) and (email != ''))";
        $sql .= " AND {$_TABLES['users']}.uid = {$_TABLES['userprefs']}.uid AND emailfromadmin = 1";
        $sql .= " AND ug_uid = {$_TABLES['users']}.uid AND ug_main_grp_id IN ({$groupList})";
    }

    $result = DB_query ($sql);
    $nrows = DB_numRows ($result);
       
        $quantity = $nrows;

        $sql_ajout_hello = "INSERT INTO {$_TABLES['hello']} (subject, creation, email_group, quantity, content) VALUES ('$subject', '$creation', '$email_group', '$quantity','$content')";
        DB_query ($sql_ajout_hello);

    $retval .= '<h1>' . $LANG_HELLO01['email_save'] . '</h1>'
       
    $from = COM_formatEmailAddress ($vars['fra'], $vars['fraepost']);
    $subject = COM_stripslashes ($vars['subject']);
    $message = COM_stripslashes ($vars['content']);
       
        if (isset ($vars['priority'])) {
        $priority = 1;
        } else {
        $priority = 0;
        }

    // Loop through and send the messages in the DB!
    $successes = 0;
    $failures = 0;
    for ($i = 0; $i < $nrows; $i++) {
        $A = DB_fetchArray ($result);
        if (empty ($A['fullname'])) {
            $to = COM_formatEmailAddress ($A['username'], $A['email']);
        } else {
            $to = COM_formatEmailAddress ($A['fullname'], $A['email']);
        }

        $expediteur = $from;
            $destinataire  = $to;
            $date = date ('YmdHi', time ());
            $hello_id = 'id';
       
            $sql_ajout_hello = "INSERT INTO {$_TABLES['hello_file_envoi']} (expediteur, destinataire, date, hello_id, subject, content, priority) VALUES ('$expediteur', '$destinataire', '$date', '$hello_id', '$subject', '$content', '$priority')";
            if (DB_query ($sql_ajout_hello)) {
                    $successes = $successes + 1;
                } else {
                    $failures = $failures + 1;
                }
    }

        if ($successes >= 1) {
        $retval .= $i . ' ' . $LANG_HELLO01['email_schedule'] . '<br />' . $vars['priority'];
        }
        if ($failures > 0) {
            $retval .= 'Oups... There was ' . $failures . ' failure(s)';
        }
 
    $retval .= COM_endBlock ();

    return $retval;
}

/**
 * Returns admin menu display
 *
 * Generates the admin menu from the template and returns the result as a string of HTML
 *
 * @return string HTML of admin menu
 * @todo add support for pending (physical) transaction, not fully implemented
 */

function hello_admin_menu() {
    global $_CONF, $_TABLES, $LANG_HELLO01;

    $display = COM_startBlock($LANG_HELLO01['menu_label']);

    // generate the menu from the template
    $menu = new Template($_CONF['path'] . 'plugins/hello/templates/admin');
    $menu->set_file(array('menu' => 'admin_menu.thtml'));
    $menu->set_var('site_url', $_CONF['site_url']);
    $menu->set_var('homepage_label', $LANG_HELLO01['homepage_label']);
    $menu->set_var('send_email_group', $LANG_HELLO01['send_email_group']);
    $menu->set_var('read_email', $LANG_HELLO01['read_email']);
    $menu->set_var('configuration', $LANG_HELLO01['configuration']);
       
    $display .= $menu->parse('output', 'menu');

    $display .= COM_endBlock();

    // return results
    return $display;
}

// MAIN

$display .= COM_siteHeader ('menu', $LANG31[1]);
$display .= hello_admin_menu();

if (isset($_POST['mail']) && ($_POST['mail'] == 'mail') && SEC_checkToken()) {
    $display .= send_messages ($_POST);
} else {
    $display .= display_mailform ();
}

$display .= COM_siteFooter ();

echo $display;

?>
 


Support and French community [ www.geeklog.fr ]
 
Profile Email Website
Quote
cordiste
 November 19 2009 05:59 AM  
Forum Junior
Junior

Status: offline

Registered: 10/15/09
Posts: 19

Hello,

This is the french translation for Newsletter v 1.0.8

PHP Formatted Code

<?php

###############################################################################
# french_france_utf-8.php
# This is the english language file for the Newsletter plugin Vers. 1.08
#
# Copyright (C) 2001 Tony Bibbs
# tony@tonybibbs.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
###############################################################################

global $LANG32;

###############################################################################
# Array Format:
# $LANGXX[YY]:  $LANG - variable name
#                     XX - file id number
#                     YY - phrase id number
###############################################################################

$LANG_NL = array(
    'newpage' => 'Nouvelle Page',
    'adminhome' => 'Panneau administration',
    'newsletter' => 'Newsletter',
    'newslettereditor' => 'Editeur de Newsletter',
    'writtenby' => 'Auteur',
    'date' => 'Mise à jour',
    'title' => 'Titre',
    'content' => 'Contenu',
    'hits' => 'Visites',
    'newsletterlist' => 'Liste des Newsletters',
    'block_title' => 'Newsletter',
    'block_text' => "<img style=\"border:0px solid; float:right;height:40px;width:40px;\" src=\"{$_CONF['site_url']}/newsletter/images/newsletter.png\"/>Merci de saisir votre adresse email pour vous inscrire à la newsletter.",
    'block_button_text' => 'Envoyer',
    'block_link_text' => 'Archives',
    'success_title' => 'Merci',
    'list_title' => 'Archives des Newsletters',
    'add_success' => 'Votre adresse email à bien été ajoutée à notre liste.',
    'url' => 'URL',
    'edit' => 'Editer',
    'lastupdated' => 'Dernière mise à jour',
    'pageformat' => 'Format de page',
    'leftrightblocks' => 'Block à gauche et à droite',
    'blankpage' => 'Page blanche',
    'noblocks' => 'Pas de block',
    'leftblocks' => 'Blocks à gauche',
    'addtomenu' => 'Ajouter au Menu',
    'label' => 'Label',
    'nopages' => 'Il n\'y a pas encore de newsletter',
    'save' => 'sauvegarde',
    'preview' => 'preview',
    'delete' => 'supprimer',
    'cancel' => 'annuler',
    'email' => 'Email',
    'access_denied' => 'Accès non autorisé',
    'access_denied_msg' => 'Vous essayez d\'accéder à une partie administrative de ce site sans y être autorisé. Cette tentative à été enregistrée.',
    'all_html_allowed' => 'Tout le HTML est permis',
    'results' => 'Résultats des Newsletters',
    'author' => 'Auteur',
    'no_title_or_content' => 'Vous au moins devez compléter les champs <b>Titre</b> et <b>Contenu</b>.',
    'no_such_page_anon' => 'Merci de vous identifier.',
    'no_page_access_msg' => "Cela peut être par-ce que vous n'êtes pas identifié, ou que vous n'êtes pas un membre du site {$_CONF['site_name']}. Merci de a href=\"{$_CONF['site_url']}/users.php?mode=new\">créer un compte<</a> sur {$_CONF['site_name']} pour pouvoir accéder à l'espace membre.",
    'php_msg' => 'PHP: ',
    'php_warn' => 'Attention: Le code PHP de vos page sera evalué si vous activez cette option. A utiliser avec précaution!!',
    'exit_msg' => 'Type de sortie: ',
    'exit_info' => 'Activer pour afficher le message de connexion nécessaire. Laissez non coché pour un message et une vérification normale de la sécurité.',
    'deny_msg' => 'L\'accès à cette page n\'est pas possible. Soit elle à été déplacé ou supprimée, soit vous n\'avez pas la permission suffisante pour l\'afficher.',
    'stats_headline' => 'Les 10 Newsletter les plus consultées',
    'stats_page_title' => 'Titre',
    'stats_hits' => 'Hits',
    'stats_no_hits' => 'Soit il n\'y a pas de newsletter disponible sur ce site, soit personne n\'en à encore vu une.',
    'id' => 'ID',
    'duplicate_id' => 'L\'ID que vous avez choisi pour cette newsletter est déjà utilisée. Merci dans choisir une autre.',
    'instructions' => 'Pour modifier ou supprimer une newsletter, cliquez sur l\'icon d\'édition ci-dessous. Pour voir une newsletter, cliquez sur le titre de la page que vous souhaitez voir. Pour créer une nouvelle newsletter, cliquez sur "Ajouter" ci-dessus. Cliquez sur l\'icon de copie pour dupliquer une newsletter existante.',
    'centerblock' => 'Block central: ',
    'centerblock_msg' => 'Lorsque cette option est cochée, cette Newsletter sera affichée dans un block central sur la page principale dus site.',
    'topic' => 'Catégorie: ',
    'position' => 'Position: ',
    'all_topics' => 'Toutes',
    'no_topic' => 'Accueil uniquement',
    'position_top' => 'Haut de la page',
    'position_feat' => 'Après l\'article en vedette',
    'position_bottom' => 'Bas de page',
    'position_entire' => 'Page complète',
    'head_centerblock' => 'Block central',
    'centerblock_no' => 'Non',
    'centerblock_top' => 'Haut',
    'centerblock_feat' => 'Article Vedette',
    'centerblock_bottom' => 'Bas',
    'centerblock_entire' => 'Page complète',
    'inblock_msg' => 'Dans un block: ',
    'inblock_info' => 'Afficher la Newsletter dans un block.',
    'title_edit' => 'Editer la newsletter',
    'title_copy' => 'Faire une copie de la newsletter',
    'title_display' => 'Voir la newsletter',
    'select_php_none' => 'Ne pas exécuter le PHP',
    'select_php_return' => 'exécuter le PHP (return)',
    'select_php_free' => 'exécuter le PHP',
    'php_not_activated' => 'L\'utilsiation du PHP dans les newsletters est activé. Merci de vous reporter à la <a href="' . $_CONF['site_url'] . '/docs/newsletter.html#php">documentation</a> pour plus de détails.',
    'printable_format' => 'Format imprimante',
    'edit' => 'Editer',
    'copy' => 'Copier',
    'limit_results' => 'Limiter les résultats',
    'search' => 'Chercher',
    'submit' => 'Envoyer',
    'sendnow' => 'Envoyer cette newsletter maintenant?',
    'sendtest' => 'Envoyer un test à votre adresse email?',
    'send' => 'Envoyer maintenant',
    'sent_time' => 'Dernière expédition',
    'removed_title' => 'Désinscription',
    'removed_msg' => 'L\'adresse email %s à bien été supprimée de la liste.',
    'import_checkbox' => 'Ajouter à la Blacklist',
    'blacklisted_title' => 'Blacklisté',
    'blacklisted_msg' => 'L\'adresse email %s a été ajoutée à notre blacklist.',
    'whitelisted_title' => 'Whitelisté',
    'whitelisted_msg' => 'L\'adresse email %s a été ajoutée à notre whitelist.',
    'trouble_viewing' => 'Si vous avez du mal à lire cette newsletter, vous pouvez la retrouver sur notre site en <a href="%s/newsletter/index.php?page=%s">cliquant ici</a>.<br />',
    'unsubscribe' => 'Se dés-inscrire',
    'subscriberlist' => 'Souscripteurs',
    'list_status' => 'Status de la liste',
    'list_status_hover_message' => 'Ajouter à %slist',
    'email_format_error' => '<strong>Erreur</strong>: Une adresse email non valide à été saisie.',
    'email_store_error' => '<strong>Erreur</strong>: Oups je n\'ai pas réussi à enregistrer votre adresse email.',
    'email_success' => 'Merci pour votre inscription!',
    'email_missing' => 'Merci de saisir une adresse email.',
    'adding_msg' => 'Adresse email ajoutée...',
    'block_text_small' => 'Inscrivez vous à la newsletter!',
    'import' => 'Importer',
    'export' => 'Exporter',
    'clear' => 'Vider la liste des souscripteurs',
    'import_temp_text' => 'Copier/Coller votre liste d\'importation ici.',
    'delimiter' => 'Delimiteur',
    'importer' => 'Newsletter Importation de liste Email',
    'import_complete' => 'Importation Complète',
    'user_edit_checkbox_label' => 'Souscrire à la Newsletter',
    'sorry_no_archives_yet' => 'Désolé, il n\'y a pas encore de newsletter dans nos archives.',
    'user_menu_subscribe' => 'S\'abonner à la Newsletter',
    'user_menu_unsubscribe' => 'Se désabonner de la Newsletter',
    'import_current_users' => 'Importer les utilisateurs',
    'are_you_sure'=> 'Etes vous sûre de vouloir supprimer les souscripteurs?',
    'truncate_complete' => 'Souscripteurs effacés',
    'blacklisted_emails' => 'Blacklisted Emails: ',
    'blacklisted_domains' => 'Blacklisted Domains: ',
    'whitelisted_emails' => 'Whitelisted Emails: ',
    'newsletter_admin' => 'Newsletter Administration',
    'config' => 'Configuration',
    'config_location_message' => 'Les options de configuration de la Newsletter sont maintenant disponible via le <a href="%s/configuration.php">panneau de configuration</a>.'
);


// Messages for the plugin upgrade
$PLG_newsletter_MESSAGE3001 = 'La mise à jour du Plugin n\'est pas supportée :(';
$PLG_newsletter_MESSAGE3002 = $LANG32[9];


// Localization of the Admin Configuration UI
$LANG_configsections['newsletter'] = array(
    'label' => 'Newsletter',
    'title' => 'Newsletter Configuration'
);

$LANG_confignames['newsletter'] = array(
    'allow_php' => 'Permettre le PHP?',
    'sort_by' => 'Trier les blocks centraux par',
    'sort_menu_by' => 'Trier les labels du menu par',
    'delete_pages' => 'Supprimer les newsletter avec leur propriétaire?',
    'in_block' => 'Afficher les newsletter dans un block par défaut?',
    'show_hits' => 'Montrer le nombres de visites?',
    'show_date' => 'Montrer la date de modification?',
    'filter_html' => 'Filtrer le HTML?',
    'censor' => 'Censuré le contenu?',
    'default_permissions' => 'Permissions par défaut des newsletters',
    'aftersave' => 'Après la sauvegarde',
    'atom_max_items' => 'Max. Pages dans le flux des Webservices',
    'subscribe_new_users' => 'Les membres souscrivent à la newsletter lorsqu\'ils s\'inscrivent sur le site'
);

$LANG_configsubgroups['newsletter'] = array(
    'sg_main' => 'Paramêtres principaux'
);

$LANG_fs['newsletter'] = array(
    'fs_main' => 'Newsletter Paramêtres principaux',
    'fs_permissions' => 'Permissions par défaut'
);

// Note: entries 0, 1, 9, and 12 are the same as in $LANG_configselects['Core']
$LANG_configselects['newsletter'] = array(
    0 => array('Oui' => 1, 'Non' => 0),
    1 => array('Oui' => TRUE, 'Non' => FALSE),
    2 => array('Date' => 'date', 'ID' => 'id', 'Titre' => 'title'),
    3 => array('Date' => 'date', 'ID' => 'id', 'Titre' => 'title', 'Label' => 'label'),
    9 => array('Afficherla newsletter' => 'item', 'Afficher la liste' => 'list', 'Afficher la page d\'accueil' => 'home', 'Afficher la page d\'administration' => 'admin'),
    12 => array('Pas d\'accès' => 0, 'Lecture seule' => 2, 'Lecture-Ecriture' => 3)
);

?>
 


::Ben


Support and French community [ www.geeklog.fr ]
 
Profile Email Website
Quote
suprsidr
 November 19 2009 06:19 AM  
Forum Admin
Admin

Status: offline

Registered: 12/20/06
Posts: 1068

Thanks Ben,
I've swapped out the available archive w/ the new translation onboard Smile
Hopefully this release has fixed any issues for you.

And I'm currently working on an example php/ajax timer.

-s


There will always be...
 
Profile Email Website
Quote
cordiste
 November 19 2009 06:53 AM  
Forum Junior
Junior

Status: offline

Registered: 10/15/09
Posts: 19

Hi,

Yes this archive seems to do is job, but maybe I need more testing...

If there is one newsletter only available for Logged-in Users, anonymous don't see any message on /newsletter/index.php?view=list like "It appears that there are no newsletters" or something like "You must sign in to see the newsletter". It could be a feature in a next version.

Thanks,

::Ben


Support and French community [ www.geeklog.fr ]
 
Profile Email Website
Quote
Content generated in: 4.05 seconds
New Topic Post Reply



 All times are PDT. The time is now 04:45 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
HTML Allowed 
Censored Content