|
3 | 3 | * Add default templates including default system template |
4 | 4 | * |
5 | 5 | */ |
6 | | - |
7 | 6 | echo '<h2>Default template</h2>'; |
8 | | - |
9 | 7 | $systemtemplate = '<div style="margin:0; text-align:center; width:100%; background:#EEE;min-width:240px;height:100%;"><br /> |
10 | 8 | <div style="width:96%;margin:0 auto; border-top:6px solid #369;border-bottom: 6px solid #369;background:#DEF;" > |
11 | 9 | <h3 style="margin-top:5px;background-color:#69C; font-weight:normal; color:#FFF; text-align:center; margin-bottom:5px; padding:10px; line-height:1.2; font-size:21px; text-transform:capitalize;">[SUBJECT]</h3> |
12 | 10 | <div style="text-align:justify;background:#FFF;padding:20px; border-top:2px solid #369;min-height:200px;font-size:13px; border-bottom:2px solid #369;">[CONTENT]<div style="clear:both"></div></div> |
13 | 11 | <div style="clear:both;background:#69C;font-weight:normal; padding:10px;color:#FFF;text-align:center;font-size:11px;margin:5px 0px">[FOOTER]<br/>[SIGNATURE]</div> |
14 | 12 | </div> |
15 | 13 | <br /></div>'; |
16 | | - |
17 | | -$template1 = '<div style="margin:0; text-align:center; width:100%; background:black;min-width:240px;height:100%;"><br /> |
18 | | - <div style="width:96%;margin:0 auto; border-top:6px solid #369;border-bottom: 6px solid #369;background:#DEF;" > |
19 | | - <h3 style="margin-top:5px;background-color:#69C; font-weight:normal; color:#FFF; text-align:center; margin-bottom:5px; padding:10px; line-height:1.2; font-size:21px; text-transform:capitalize;">[SUBJECT]</h3> |
20 | | - <div style="text-align:justify;background:#FFF;padding:20px; border-top:2px solid #369;min-height:200px;font-size:13px; border-bottom:2px solid #369;">[CONTENT]<div style="clear:both"></div></div> |
21 | | - <div style="clear:both;background:#69C;font-weight:normal; padding:10px;color:#FFF;text-align:center;font-size:11px;margin:5px 0px">[FOOTER]<br/>[SIGNATURE]</div> |
22 | | - </div> |
23 | | -<br /></div>'; |
24 | | - |
25 | | -$template2 = '<div style="margin:0; text-align:center; width:100%; background:red;min-width:240px;height:100%;"><br /> |
26 | | - <div style="width:96%;margin:0 auto; border-top:6px solid #369;border-bottom: 6px solid #369;background:#DEF;" > |
27 | | - <div style="text-align:justify;background:#FFF;padding:20px; border-top:2px solid #369;min-height:200px;font-size:13px; border-bottom:2px solid #369;">[CONTENT]<div style="clear:both"></div></div> |
28 | | - <div style="clear:both;background:#69C;font-weight:normal; padding:10px;color:#FFF;text-align:center;font-size:11px;margin:5px 0px">[FOOTER]<br/>[SIGNATURE]</div> |
29 | | - </div> |
30 | | -<br /></div>'; |
31 | | - |
| 14 | +$template1 = '<div style="max-width:800px;width:100%;background:#FFF;display:block;margin:0px auto;font-family: Arial,sans-serif;text-align:center;padding:30px 0"> |
| 15 | +
|
| 16 | +<table style="width:100%;" cellpadding=0 cellspacing=0> |
| 17 | +<tbody> |
| 18 | +<tr> |
| 19 | +<td style="text-align:left;width:70%"> |
| 20 | + <div style="display:inline-block;max-width:100%;font-size:30px;margin-bottom:10px"><a href="[WEBSITE]" style="color:#FF9900;text-decoration:none"><img src="[LOGO:400]" style="width:100%" alt="NEWSLETTER" /></a></div> |
| 21 | +</td> |
| 22 | +<td style="text-align:right;padding-bottom:6px" valign="bottom"> |
| 23 | + <div style="width:30px;height:30px;background:#FF9900;display:inline-block;margin-right:7px;margin-bottom:0px;float:right"></div> |
| 24 | + <div style="width:8px;height:8px;background:#000000;display:inline-block;margin-right:7px;margin-bottom:7px"></div><br /> |
| 25 | + <div style="width:15px;height:15px;background:#000000;display:inline-block;margin-right:7px;"></div> |
| 26 | +</td> |
| 27 | +</tr> |
| 28 | +</tbody> |
| 29 | +</table> |
| 30 | +
|
| 31 | +<table style="background:#3366FF;color:#FFFFFF;width:100%;" cellpadding=0 cellspacing=0> |
| 32 | +<tbody> |
| 33 | +<tr> |
| 34 | + <td rowspan="2" style="width:15px;padding:0;margin:0;background:#FFF;border-left:7px solid #3366FF;height:150px"></td> |
| 35 | + <td rowspan="2" style="width:6px;padding:0;margin:0;background:#FFF;border-left:7px solid #3366FF;height:150px"></td> |
| 36 | + <td style="text-align:right;vertical-align:top;padding-top:7px" valign="top;"> |
| 37 | + <div style="width:8px;height:8px;background:#FFFFFF;display:inline-block;margin-right:7px;float:right"></div> |
| 38 | + <div style="width:15px;height:15px;background:#FFFFFF;display:inline-block;margin-right:7px;float:right"></div> |
| 39 | + </td> |
| 40 | +</tr> |
| 41 | +<tr> |
| 42 | + <td style="padding:10px 20px;text-align:right;font-size:30px;vertical-align:bottom" valign="bottom">[SUBJECT]</td> |
| 43 | +</tr> |
| 44 | +</tbody> |
| 45 | +</table> |
| 46 | +
|
| 47 | +<hr style="border:0px;border-bottom: 5px solid #FF9900;margin:5px 0" /> |
| 48 | +
|
| 49 | +
|
| 50 | +<table style="background:#EEEEEE;color:#333333;width:100%;margin:10px 0;"> |
| 51 | +<tbody><tr><td style="padding:30px 5%;font-size:16px">[CONTENT]</td></tr></tbody> |
| 52 | +</table> |
| 53 | +
|
| 54 | +<hr style="border:0px;border-bottom: 5px solid #3366FF;margin:5px 0px" /> |
| 55 | +
|
| 56 | +<table style="background:#FF9900;width:100%;padding:0;margin:0" cellpadding=0 cellspacing=0> |
| 57 | +<tbody><tr> |
| 58 | + <td style="color:#000000;font-size:11px;padding:0;margin:0;padding:20px">[FOOTER]</td> |
| 59 | + <td rowspan="2" style="width:6px;padding:0;margin:0;background:#FFFFFF;border-right:7px solid #FF9900;height:100px"></td> |
| 60 | + <td rowspan="2" style="width:15px;padding:0;margin:0;background:#FFFFFF;border-right:7px solid #FF9900;height:100px"></td> |
| 61 | +</tr></tbody> |
| 62 | +</table> |
| 63 | +
|
| 64 | +<hr style="border:0px;border-bottom: 5px solid #000000;margin:5px 0" /> |
| 65 | +
|
| 66 | +<table style="width:100%" cellpadding=0 cellspacing=0;> |
| 67 | +<tbody><tr> |
| 68 | +<td> |
| 69 | + <div style="width:8px;height:8px;background:#3366FF;display:inline-block;margin-right:10px"></div> |
| 70 | + <div style="width:8px;height:8px;background:#3366FF;display:inline-block;margin-right:10px"></div> |
| 71 | + <div style="width:8px;height:8px;background:#3366FF;display:inline-block;margin-right:10px"></div> |
| 72 | +</td> |
| 73 | +<td style="text-align:right"> |
| 74 | + <a href="[FORWARDURL]" style="font-size:11px;font-weight:bold;text-decoration:none;color:#FF9900">FORWARD THIS MESSAGE</a> |
| 75 | +</td> |
| 76 | +</tr></tbody> |
| 77 | +</table> |
| 78 | +</div> |
| 79 | +'; |
| 80 | +$template2 = '<p><style type="text/css">#ushuaia h1{font-size:36px}#ushuaia h2{font-size:30px}#ushuaia h3{font-size:24px}#ushuaia h4{font-size:21px}#ushuaia h1,#ushuaia h2,#ushuaia h3,#ushuaia h4,#ushuaia b,#ushuaia a {font-family:\'Times New Roman\', Georgia, serif !Important;color:#000 !important} #ushuaia p{font-family:\'Times New Roman\',Georgia,serif !important;color:#000 !important}</style></p> |
| 81 | +<div style="margin:0; text-align:center; width:98%; background:#EEE;min-width:240px;height:100%;" id="ushuaia"> |
| 82 | +<div style="width:98%;margin:0 auto;border:10px dashed #000;"> |
| 83 | +<table height="100%" align="center" width="98%"> |
| 84 | + <tbody> |
| 85 | + <tr> |
| 86 | + <td height="100px" bgcolor="#EEE" style="border-bottom:1px dotted #888"> |
| 87 | + <h3 style="margin:10px;text-align:center;font-weight:normal; line-height:1; font-size:70px;">[SUBJECT]</h3> |
| 88 | + </td> |
| 89 | + </tr> |
| 90 | + <tr> |
| 91 | + <td bgcolor="#FFF" style="color:#666;margin:10px"> |
| 92 | + <div style="margin:30px;color:#000 !Important">[CONTENT]</div> |
| 93 | + </td> |
| 94 | + </tr> |
| 95 | + <tr> |
| 96 | + <td style="background:#CCC;padding:10px;color:#000;text-align:center;font-size:14px;margin:1px 0px;border-top:1px dotted #666">[FOOTER]</td> |
| 97 | + </tr> |
| 98 | + <tr> |
| 99 | + <td style="background:#666;padding:5px;color:#FFF;text-align:center;font-size:11px;margin:1px 0px">[SIGNATURE]</td> |
| 100 | + </tr> |
| 101 | + </tbody> |
| 102 | +</table> |
| 103 | +</div> |
| 104 | +<p> </p> |
| 105 | +</div>'; |
| 106 | +$template3 = '<p><style type="text/css">#baires h1,#baires h2,#baires h3,#baires h4,#baires b,#baires a {color:#000 !important} #baires p{color:#666 !important}#baires_footer a{color:#EEE !important}</style></p> |
| 107 | +<div style="margin:0; text-align:center; width:100%; background:#EEE;min-width:240px;height:100%;" id="baires"> |
| 108 | +<div style="width:96%;margin:0 auto; border:10px double #000;"> |
| 109 | +<div style="background:#000;padding:5px 0px 5px 15px;color:#777;letter-spacing:20px;text-align:center;font-size:15px;margin:1px 0px">NEWSLETTER</div> |
| 110 | +<table height="100%" width="100%" style="font-family:Times New Roman, Garamond, serif;"> |
| 111 | + <tbody> |
| 112 | + <tr> |
| 113 | + <td bgcolor="#666" align="right" width="35" valign="top"><br /> |
| 114 | + <h3 style="margin:10px;text-align:right;font-weight:normal; color:#FFF !important; line-height:1.2; font-size:30px;">[SUBJECT]</h3> |
| 115 | + </td> |
| 116 | + <td bgcolor="#FFF" style="color:#666;margin:10px"> |
| 117 | + <div style="margin:10px">[CONTENT]</div> |
| 118 | + </td> |
| 119 | + </tr> |
| 120 | + <tr> |
| 121 | + <td style="background:#000;padding:5px;height:50px;color:#FFF !important" id="baires_footer" colspan="2">[FOOTER]</td> |
| 122 | + </tr> |
| 123 | + <tr> |
| 124 | + <td style="background:#333;height:20px;text-align:center" colspan="2">[SIGNATURE]</td> |
| 125 | + </tr> |
| 126 | + </tbody> |
| 127 | +</table> |
| 128 | +</div> |
| 129 | +</div>'; |
32 | 130 | echo formStart(); |
33 | | - |
34 | 131 | echo '<div> |
35 | 132 | <input type="radio" name="template" value="systemtemplate" checked> System Template<br> |
36 | 133 | <input type="radio" name="template" value="template1"> Template 1<br> |
37 | 134 | <input type="radio" name="template" value="template2"> Template 2<br> |
| 135 | + <input type="radio" name="template" value="template3"> Template 3<br> |
38 | 136 | <input type="submit" value="Submit" name="Submit"> |
39 | 137 | </form> |
40 | 138 | </div> |
41 | | -
|
42 | 139 | '; |
43 | | - |
44 | 140 | if (isset($_POST['Submit'])) { |
45 | | - |
46 | 141 | $radioVal = $_POST['template']; |
47 | | - |
48 | | - switch ($radioVal) { |
49 | | - |
50 | | - case 'systemtemplate': |
51 | | - |
52 | | - $title = "System Template"; |
53 | | - $content = $systemtemplate; |
54 | | - |
55 | | - break; |
56 | | - |
57 | | - case 'template1': |
58 | | - |
59 | | - $title = "Template one"; |
60 | | - $content = $template1; |
61 | | - |
62 | | - break; |
63 | | - |
64 | | - case 'template2': |
65 | | - |
66 | | - $title = "Template two"; |
67 | | - $content = $template2; |
68 | | - |
69 | | - break; |
70 | | - } |
71 | | - |
| 142 | + switch ($radioVal) { |
| 143 | + case 'systemtemplate': |
| 144 | + $title = "System Template"; |
| 145 | + $content = $systemtemplate; |
| 146 | + break; |
| 147 | + case 'template1': |
| 148 | + $title = "Template one"; |
| 149 | + $content = $template1; |
| 150 | + break; |
| 151 | + case 'template2': |
| 152 | + $title = "Template two"; |
| 153 | + $content = $template2; |
| 154 | + break; |
| 155 | + case 'template3': |
| 156 | + $title = "Template three"; |
| 157 | + $content = $template3; |
| 158 | + break; |
| 159 | + } |
72 | 160 | $exists = Sql_Fetch_Row_Query(sprintf('select * from %s where title = "%s"', |
73 | 161 | $GLOBALS['tables']['template'], $title)); |
74 | | - |
75 | 162 | if ($exists[0]) { |
76 | 163 | echo '<p>' . s('This default template already exists') . '</p>'; |
77 | 164 | echo '<p>' . PageLinkButton('templates', s('Go back to templates')) . '</p>'; |
78 | 165 | } else { |
79 | | - |
80 | 166 | Sql_Query(sprintf('insert into %s (title,template,listorder) values("%s","%s",0)', |
81 | 167 | $GLOBALS['tables']['template'], $title, addslashes($content))); |
82 | 168 | $newid = Sql_Insert_Id(); |
83 | | - |
84 | 169 | if ($title === 'System Template') { |
85 | 170 | saveConfig('systemmessagetemplate', $newid); |
86 | 171 | } |
87 | | - |
88 | 172 | echo '<p>' . s('The selected default template has been added as template with ID') . ' ' . $newid . ' </p>'; |
89 | 173 | echo '<p>' . PageLinkButton('templates', s('Go back to templates')) . '</p>'; |
90 | 174 | echo '<p>' . PageLinkButton('template&id=' . $newid, s('Edit the added template')) . '</p>'; |
91 | 175 | } |
92 | | - |
93 | 176 | } |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
|
0 commit comments