We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27708 MODX Staff
    • 2,502 Posts
    flux,

    Great module!

    I have suggestion for the modification of the form template in the snippet so that it is valid XHTML as the template in the snippet will not validate.

    I have modifed the snippets.txt file as below the complete file is attached:
    <?php
    
    	$list .= '
    	<h2>'.$lang_mailinglist.'</h2>
    		
    	<form id="enSubscribe" action="" onsubmit="return validate_form(this);" method="post">
    	<div><label for="enFirstname">'.$lang_firstname.'</label>
    		<input type="text" name="firstname" id="enFirstname" size="50" maxlength="50" /></div>
    	<div><label for="enLastname">'.$lang_lastname.'</label>
    			<input type="text" name="lastname" id="enLastname" size="50" maxlength="50" /></div>
    	<div>		
    		<label for="enEmail">'.$lang_email.'</label>
    		<input type="text" name="email" id="enEmail" size="50" maxlength="50" />
    		<input type="hidden" name="op" value="set" /></div>
    	<div><input type="radio" name="option" value="subscribe" checked="checked" />'.$lang_subscribe.'
    		<input type="radio" name="option" value="unsubscribe" />'.$lang_unsubscribe.'</div>
    	<div><input type="submit" value="'.$lang_submit.'" /></div>
    	</form>';
    	echo $list;
    }
    ?>
    


    In order to make this work as you have designed (with breaks and such) one could change their main css file to do the following:

    #enSubscribe label{display:block;}


    A couple of thoughts as well. I would like to be able to put the nl subscribe form into a div in a sidebar so splitting subscription form and the management form into to forms with a parameter to distinguish between the two would be ideal.

    As an example it would be nice if I could just have someone put in their name and email address and then be redirected to the thank you/management page. This is a very common method vs having to send people to a subscribe page via a link in wayfinder.

    I will play with the snippet to see if it can be done. \

    Cheers,

    Jay
      Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
      • 27607
      • 5 Posts
      Hello,

      I have a dual language site. Is it possible to move language config for web front-end to a snippet call?

      Thanks in advance for your help!

      ps. By the way - I can send you language packs for russian utf-8 and latvian utf-8. I have translated only the front-end part though, as back end in english is much better.
        • 27607
        • 5 Posts
        I found out the answer, it’s very easy to change actually:

        change this in your snippet:

        include('assets/modules/easynewsletter/languages/'.mysql_result($result,$i,"lang_frontend").'.php');


        to:

        if (isset($lang)) { include('assets/modules/easynewsletter/languages/'.$lang.'.php'); } else 
        { include('assets/modules/easynewsletter/languages/'.mysql_result($result,$i,"lang_frontend").'.php'); }


        afterwards you can send this snippet call:

        [[easy newsletter? &lang=`english`]]
          • 8386 ☆ A M B ☆
          • 160 Posts
          Quote from: garryn at Oct 16, 2007, 07:38 AM

          The ’undefined variables’ error means that the variable is being used before it’s been declared. The items in question are caused by:

          1. $i - used when including the language file in both the snippet and module. For example, in the frontend:
          include('assets/modules/easynewsletter/languages/'.mysql_result($result,$i,"lang_frontend").'.php');


          But, $i doesn’t have a value at that point - I think $i can be replaced with 0 in this instance as there should only 1 record being returned in the recordset. (Haven’t tried it, so if someone could validate that wink )

          2. $lang_subscriber_action - used in backend.php but doesn’t have an entry in the language file. Place a definition in the language file and that error will disappear.

          Hope that helps,
          Garry

          Yes changing $i to $i=0 works well, there is also another problem which is $lang_links_header doesn’t exist in the language file so add it and write "Choose an option:" for the text.

          I have also created a new snippet which allows using chunks as templates. I have attached it below.
            • 14127
            • 7 Posts
            Nice little tool, very helpful but I have a question

            The text part of the multipart mail is send with html codes like shown below, how can I change that?

            Content-Type: text/plain; charset = "UTF-8"
            Content-Transfer-Encoding: 8bit

            Liebes Mitglied,

            da wir auf unserem Server umfangreiche &Auml;nderungen durchgef&uuml;hrt haben m&ouml;chten
              • 3875
              • 29 Posts
              Hi.
              I still can’t figure out how to insert absolute links in the easynewsletter module.
              When i create a newsletter, with links pointing to pages of my site, after saving it, my links aren’t absolute anymore.
              I can’t understand this, i’ve read all the php script and i just can’t see where the problem is.
              Does anyone had the same problem?
              thanks for helping.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Sounds like you’ve got TinyMCE configured to convert links to docrelative. This can be changed in the plugin’s Configuration tab.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 36451
                  • 264 Posts
                  Quote from: jhohn at Jan 17, 2008, 09:11 AM

                  The text part of the multipart mail is send with html codes like shown below, how can I change that?

                  Resources -> Plugins -> TinyMCE -> Configuration -> Entity Encoding -> Change "named" to "raw"
                  ( @ jhohn: So werden deutsche Umlaute dann plain in die MySQL Datenbank geschrieben. Beachte aber, daß jetzt auch der Rest Deiner Dokumente recht messy aussehen wird. Sei konsequent: Ändere jetzt die verquirksten Umlaute einfach überall, dann hast Du Ruhe. - @ all: Sorry for writing german here.)

                  @ booyaka:
                  Resources -> Plugins -> TinyMCE -> Configuration -> Path options -> Change "docrelative" to "fullpathurl"
                    • 3875
                    • 29 Posts
                    It works!
                    thank you very much!
                      • 15309
                      • 30 Posts
                      Hey man where is the Database schema for your script..?
                      I downloaded the zip file but there is no SQL file ..??