[mod] How do you set the default format to Text only?

3rd party code for phpList

Postby Cyric_ » 10:45am, Thu 13 Sep, 2007

phplist v 2.10.4
in "send a message" > "format" tab to have "HTML" checked by default instead of "text and HTML" :

file send_core.php :
line 75
Code: Select all
Sql_Query(sprintf('insert into %s (subject,status,entered,sendformat,embargo,repeatuntil,owner,template,tofield,replyto)
    values("(no subject)","draft",now(),"text and HTML",now(),now(),%d,%d,"","")

replace "text and HTML" with "HTML"

line 1007 add || !isset($_POST["sendformat"])to get this code :
Code: Select all
$formatting_content .= $_POST["sendformat"]=="HTML" || !isset($_POST["sendformat"]) ?"checked":"";


line 1021 delete || !isset($_POST["sendformat"]) to get
Code: Select all
$formatting_content .= $_POST["sendformat"]=="text and HTML"?"checked":"";


to get text checked by default it's almost the same
Cyric_
phpLister
 
Posts: 6
Joined: 8:28am, Wed 05 Sep, 2007

Postby H2B2 » 10:10pm, Thu 13 Sep, 2007

Nice mod Cyric_, and thanks for sharing. Would be a good idea to add a reference to your mod in the docs: http://docs.phplist.com/PhplistHacks
Feel free to to add it yourself.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby Cyric_ » 11:06am, Tue 18 Sep, 2007

done :)

cheers !
Cyric_
phpLister
 
Posts: 6
Joined: 8:28am, Wed 05 Sep, 2007

Re: [mod] How do you set the default format to Text only?

Postby SkippyleGrandGourou » 5:21pm, Tue 26 Aug, 2014

As of phplist 3.0.7, one only needs to modify send_core.php as follows :

Code: Select all
$ diff -u public_html/lists/admin/send_core.php.orig public_html/lists/admin/send_core.php
--- public_html/lists/admin/send_core.php.orig    2014-08-24 21:07:47.280242274 +0200
+++ public_html/lists/admin/send_core.php    2014-08-24 21:08:08.796242528 +0200
@@ -52,7 +52,7 @@
   . "    (subject, status, entered, sendformat, embargo"
   . "    , repeatuntil, owner, template, tofield, replyto,footer)"
   . " values"
-  . "    ('(no subject)', 'draft', current_timestamp, 'HTML'"
+  . "    ('(no subject)', 'draft', current_timestamp, 'text'"
   . "    , current_timestamp, current_timestamp, ?, ?, '', '', ? )";
   $query = sprintf($query, $GLOBALS['tables']['message']);
   Sql_Query_Params($query, array($_SESSION['logindetails']['id'], $defaulttemplate,$defaultfooter));
SkippyleGrandGourou
phpList newbie
 
Posts: 1
Joined: 5:18pm, Tue 26 Aug, 2014


Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 0 guests