WP Easy Columns - Version 2.1

Version Description

  • Upgraded visual editor window to WP 3.6 compliance
  • Updated styles in the visual editor
  • Streamlined/optimized code
  • Updated CSS to auto-hyphenate long words to they conform to columns widths
  • Migrated shortcodes from 'wpcol_' to 'ezcol_' (no worries, it's backwards compatible)
Download this release

Release Info

Developer kcfried
Plugin Icon wp plugin WP Easy Columns
Version 2.1
Comparing to
See all releases

Code changes from version 2.0 to 2.1

css/easy-columns.css ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ** Easy Columns CSS: css to define column layouts for the WP-Colum plugin
3
+ ** for more info visit: http://www.patrickfriedl.com.com/wordpress/easy-columns
4
+ **
5
+ ** use percentage widths and margins for fluid
6
+ ** or unknown content widths and fixed
7
+ ** widths and margins for known content widths
8
+ **
9
+ ** for pixel widths:
10
+ ** div width = ((content width - padding - margin)/number of divs)
11
+ ** - margin - padding - border
12
+ **
13
+ ** for more information on calcluating your widths, check
14
+ ** out http://www.w3schools.com/css/css_boxmodel.asp
15
+ ** for info on the CSS box model
16
+ */
17
+ .ezcol-one-quarter,
18
+ .ezcol-one-half,
19
+ .ezcol-three-quarter,
20
+ .ezcol-one-third,
21
+ .ezcol-two-third,
22
+ .ezcol-one-fifth,
23
+ .ezcol-two-fifth,
24
+ .ezcol-three-fifth,
25
+ .ezcol-four-fifth
26
+ {
27
+ float: left;
28
+ margin-right: 4%;
29
+ position: relative;
30
+ word-wrap: break-word;
31
+ hyphens: auto;
32
+ -moz-box-sizing: border-box !important;
33
+ -webkit-box-sizing: border-box !important;
34
+ box-sizing: border-box !important;
35
+ text-rendering: optimizedLegibility;
36
+ -moz-font-feature-settings: "ss01=1, onum=1, tnum=1, liga=1, dlig=1, kern=1, frac=1";
37
+ -webkit-font-feature-settings: "ss01" 1, "onum" 1, "tnum" 1, "liga" 1, "dlig" 1, "kern" 1, "frac" 1;
38
+ -ms-font-feature-settings: "ss01" 1, "onum" 1, "tnum" 1, "liga" 1, "dlig" 1, "kern" 1, "frac" 1;
39
+ -o-font-feature-settings: "ss01" 1, "onum" 1, "tnum" 1, "liga" 1, "dlig" 1, "kern" 1, "frac" 1;
40
+ }
41
+ .ezcol-one-quarter {
42
+ width: 22%;
43
+ }
44
+ .ezcol-one-half {
45
+ width: 48%;
46
+ }
47
+ .ezcol-three-quarter {
48
+ width: 74%;
49
+ }
50
+ .ezcol-one-third {
51
+ width: 30.666%;
52
+ }
53
+ .ezcol-two-third {
54
+ width: 65.334%;
55
+ }
56
+ .ezcol-one-fifth {
57
+ width: 16.8%;
58
+ }
59
+ .ezcol-two-fifth{
60
+ width: 37.6%;
61
+ }
62
+ .ezcol-three-fifth {
63
+ width: 58.4%;
64
+ }
65
+ .ezcol-four-fifth {
66
+ width: 79.2%;
67
+ }
68
+ .ezcol-last {
69
+ float: right;
70
+ clear: right;
71
+ margin-right: 0;
72
+ }
73
+ .ezcol-last:after {
74
+ content: ".";
75
+ opacity: 0;
76
+ display: block;
77
+ height: 0;
78
+ clear: both;
79
+ }
80
+ .ezcol-both,
81
+ .ezcol-left,
82
+ .ezcol-right {
83
+ margin: 0;
84
+ padding: 0;
85
+ background: none;
86
+ }
87
+ .ezcol-divider {
88
+ clear: both !important;
89
+ display: block !important;
90
+ margin-bottom: 5px !important;
91
+ padding-top: 5px !important;
92
+ width: 100% !important;
93
+ background: none !important;
94
+ }
95
+ .ezcol-both {
96
+ clear: both !important;
97
+ }
98
+ .ezcol-left {
99
+ clear: left !important;
100
+ }
101
+ .ezcol-right {
102
+ clear: right !important;
103
+ }
css/wp-ez-columns.css DELETED
@@ -1,85 +0,0 @@
1
- /*
2
- ** WP-Ez-Columns CSS: css to define column layouts for the WP-Colum plugin
3
- ** for more info visit: http://www.affiliatetechhelp.com/wordpress/easy-columns
4
- **
5
- ** use percentage widths and margins for fluid
6
- ** or unknown content widths and fixed
7
- ** widths and margins for known content widths
8
- **
9
- ** for pixel widths:
10
- ** div width = ((content width - padding - margin)/number of divs)
11
- ** - margin - padding - border
12
- **
13
- ** for more information on calcluating your widths, check
14
- ** out http://www.w3schools.com/css/css_boxmodel.asp
15
- ** for info on the CSS box model
16
- */
17
- .wpcol-one-quarter,
18
- .wpcol-one-half,
19
- .wpcol-three-quarter,
20
- .wpcol-one-third,
21
- .wpcol-two-third,
22
- .wpcol-one-fifth,
23
- .wpcol-two-fifth,
24
- .wpcol-three-fifth,
25
- .wpcol-four-fifth
26
- {
27
- float: left;
28
- margin-right: 4%;
29
- position: relative;
30
- }
31
- .wpcol-one-quarter {
32
- width: 22%;
33
- }
34
- .wpcol-one-half {
35
- width: 48%;
36
- }
37
- .wpcol-three-quarter {
38
- width: 74%;
39
- }
40
- .wpcol-one-third {
41
- width: 30.666%;
42
- }
43
- .wpcol-two-third {
44
- width: 65.334%;
45
- }
46
- .wpcol-one-fifth {
47
- width: 16.8%;
48
- }
49
- .wpcol-two-fifth{
50
- width: 37.6%;
51
- }
52
- .wpcol-three-fifth {
53
- width: 58.4%;
54
- }
55
- .wpcol-four-fifth {
56
- width: 79.2%;
57
- }
58
- .wpcol-last {
59
- clear: right;
60
- margin-right: 0;
61
- }
62
- .wpcol-both,
63
- .wpcol-left,
64
- .wpcol-right {
65
- margin: 0;
66
- padding: 0;
67
- background: none;
68
- }
69
- .wpcol-divider {
70
- clear: both !important;
71
- display: block !important;
72
- margin-bottom: 5px !important;
73
- padding-top: 5px !important;
74
- width: 100% !important;
75
- background: none !important;
76
- }
77
- .wpcol-both {
78
- clear: both !important;
79
- }
80
- .wpcol-left {
81
- clear: left !important;
82
- }
83
- .wpcol-right {
84
- clear: right !important;
85
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
easy-columns-options.php CHANGED
@@ -13,12 +13,12 @@ function write_sel($n,$v){
13
  ?>
14
  <div class="wrap" style="max-width:950px !important;">
15
 
16
- <a href="http://www.affiliatetechhelp.com/wordpress/easy-columns" target="_blank">
17
- <img src="<?php echo $plugin_url; ?>/img/easy-column-logo.jpg" alt="Easy Columns - take control of your layout" style="margin:10px 0px 5px 0px;border:none;">
18
  </a>
19
 
20
  <div id="paypal-float" style="float:right;margin-top:10px;width:260px;padding-top:8px;">
21
- <img src="<?php echo $plugin_url; ?>/img/coffee.jpg" style="float:left;margin:-8px 8px 8px 0px;">
22
  Like Easy Columns?<br />
23
  Say, then how about a cup o' coffee?<br />
24
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
@@ -50,7 +50,7 @@ function write_sel($n,$v){
50
 
51
  <br />
52
 
53
- <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.affiliatetechhelp.com%2Fwordpress%2Feasy-columns&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=lucida+grande&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
54
 
55
  <div class="dbx-content">
56
 
@@ -71,7 +71,7 @@ function write_sel($n,$v){
71
  <strong>Use Custom Options?</strong>
72
  </td>
73
  <td valign="middle">
74
- <?php if($use_custom){ ?>
75
  <input type="checkbox" id="use_custom" name="use_custom" value="true" checked="checked">
76
  <?php } else { ?>
77
  <input type="checkbox" id="use_custom" name="use_custom" value="true">
@@ -103,25 +103,25 @@ function write_sel($n,$v){
103
  Width
104
  </td>
105
  <td valign="middle">
106
- <input type="text" id="quarter_width" name="quarter_width" value="<?php echo $quarter_width; ?>" size="6">
107
  &nbsp;
108
- <?php write_sel('quarter_width_type',$quarter_width_type); ?>
109
  </td>
110
  <td valign="middle">
111
  Width
112
  </td>
113
  <td valign="middle">
114
- <input type="text" id="onehalf_width" name="onehalf_width" value="<?php echo $onehalf_width; ?>" size="6">
115
  &nbsp;
116
- <?php write_sel('onehalf_width_type',$onehalf_width_type); ?>
117
  </td>
118
  <td valign="middle">
119
  Width
120
  </td>
121
  <td valign="middle">
122
- <input type="text" id="threequarter_width" name="threequarter_width" value="<?php echo $threequarter_width; ?>" size="6">
123
  &nbsp;
124
- <?php write_sel('threequarter_width_type',$threequarter_width_type); ?>
125
  </td>
126
  </tr>
127
 
@@ -130,25 +130,25 @@ function write_sel($n,$v){
130
  Margin
131
  </td>
132
  <td valign="middle">
133
- <input type="text" id="quarter_margin" name="quarter_margin" value="<?php echo $quarter_margin; ?>" size="6">
134
  &nbsp;
135
- <?php write_sel('quarter_margin_type',$quarter_margin_type); ?>
136
  </td>
137
  <td valign="middle">
138
  Margin
139
  </td>
140
  <td valign="middle">
141
- <input type="text" id="onehalf_margin" name="onehalf_margin" value="<?php echo $onehalf_margin; ?>" size="6">
142
  &nbsp;
143
- <?php write_sel('onehalf_margin_type',$onehalf_margin_type); ?>
144
  </td>
145
  <td valign="middle">
146
  Margin
147
  </td>
148
  <td valign="middle">
149
- <input type="text" id="threequarter_margin" name="threequarter_margin" value="<?php echo $threequarter_margin; ?>" size="6">
150
  &nbsp;
151
- <?php write_sel('threequarter_margin_type',$threequarter_margin_type); ?>
152
  </td>
153
  </tr>
154
 
@@ -173,17 +173,17 @@ function write_sel($n,$v){
173
  Width
174
  </td>
175
  <td valign="middle">
176
- <input type="text" id="onethird_width" name="onethird_width" value="<?php echo $onethird_width; ?>" size="6">
177
  &nbsp;
178
- <?php write_sel('onethird_width_type',$onethird_width_type); ?>
179
  </td>
180
  <td valign="middle">
181
  Width
182
  </td>
183
  <td valign="middle">
184
- <input type="text" id="twothird_width" name="twothird_width" value="<?php echo $twothird_width; ?>" size="6">
185
  &nbsp;
186
- <?php write_sel('twothird_width_type',$twothird_width_type); ?>
187
  </td>
188
  <td colspan="2">
189
  &nbsp;
@@ -194,17 +194,17 @@ function write_sel($n,$v){
194
  Margin
195
  </td>
196
  <td valign="middle">
197
- <input type="text" id="onethird_margin" name="onethird_margin" value="<?php echo $onethird_margin; ?>" size="6">
198
  &nbsp;
199
- <?php write_sel('onethird_margin_type',$onethird_margin_type); ?>
200
  </td>
201
  <td valign="middle">
202
  Margin
203
  </td>
204
  <td valign="middle">
205
- <input type="text" id="twothird_margin" name="twothird_margin" value="<?php echo $twothird_margin; ?>" size="6">
206
  &nbsp;
207
- <?php write_sel('twothird_margin_type',$twothird_margin_type); ?>
208
  </td>
209
  <td valign="middle" colspan="2">
210
  &nbsp;
@@ -232,25 +232,25 @@ function write_sel($n,$v){
232
  Width
233
  </td>
234
  <td valign="middle">
235
- <input type="text" id="onefifth_width" name="onefifth_width" value="<?php echo $onefifth_width; ?>" size="6">
236
  &nbsp;
237
- <?php write_sel('onefifth_width_type',$onefifth_width_type); ?>
238
  </td>
239
  <td valign="middle">
240
  Width
241
  </td>
242
  <td valign="middle">
243
- <input type="text" id="twofifth_width" name="twofifth_width" value="<?php echo $twofifth_width; ?>" size="6">
244
  &nbsp;
245
- <?php write_sel('twofifth_width_type',$twofifth_width_type); ?>
246
  </td>
247
  <td valign="middle">
248
  Width
249
  </td>
250
  <td valign="middle">
251
- <input type="text" id="threefifth_width" name="threefifth_width" value="<?php echo $threefifth_width; ?>" size="6">
252
  &nbsp;
253
- <?php write_sel('threefifth_width_type',$threefifth_width_type); ?>
254
  </td>
255
  </tr>
256
  <tr>
@@ -258,25 +258,25 @@ function write_sel($n,$v){
258
  Margin
259
  </td>
260
  <td valign="middle">
261
- <input type="text" id="onefifth_margin" name="onefifth_margin" value="<?php echo $onefifth_margin; ?>" size="6">
262
  &nbsp;
263
- <?php write_sel('onefifth_margin_type',$onefifth_margin_type); ?>
264
  </td>
265
  <td valign="middle">
266
  Margin
267
  </td>
268
  <td valign="middle">
269
- <input type="text" id="twofifth_margin" name="twofifth_margin" value="<?php echo $twofifth_margin; ?>" size="6">
270
  &nbsp;
271
- <?php write_sel('twofifth_margin_type',$twofifth_margin_type); ?>
272
  </td>
273
  <td valign="middle">
274
  Margin
275
  </td>
276
  <td valign="middle">
277
- <input type="text" id="threefifth_margin" name="threefifth_margin" value="<?php echo $threefifth_margin; ?>" size="6">
278
  &nbsp;
279
- <?php write_sel('threefifth_margin_type',$threefifth_margin_type); ?>
280
  </td>
281
  </tr>
282
 
@@ -291,9 +291,9 @@ function write_sel($n,$v){
291
  Width
292
  </td>
293
  <td valign="middle" colspan="5">
294
- <input type="text" id="fourfifth_width" name="fourfifth_width" value="<?php echo $fourfifth_width; ?>" size="6">
295
  &nbsp;
296
- <?php write_sel('fourfifth_width_type',$fourfifth_width_type); ?>
297
  </td>
298
  </tr>
299
  <tr>
@@ -301,9 +301,9 @@ function write_sel($n,$v){
301
  Margin
302
  </td>
303
  <td valign="middle" colspan="5">
304
- <input type="text" id="fourfifth_margin" name="fourfifth_margin" value="<?php echo $fourfifth_margin; ?>" size="6">
305
  &nbsp;
306
- <?php write_sel('fourfifth_margin_type',$fourfifth_margin_type); ?>
307
  </td>
308
  </tr>
309
 
@@ -317,55 +317,58 @@ function write_sel($n,$v){
317
 
318
  <h3>Column Shortcodes</h3>
319
  <strong>1/4 columns</strong><br />
320
- [wpcol_1quarter id="" class="" style=""][/wpcol_1quarter]<br />
321
- [wpcol_1quarter_end id="" class="" style=""][/wpcol_1quarter_end]<br />
322
  <br />
323
  <strong>1/2 columns</strong><br />
324
- [wpcol_1half id="" class="" style=""][/wpcol_1half]<br />
325
- [wpcol_1half_end id="" class="" style=""][/wpcol_1half_end]<br />
326
  <br />
327
  <strong>3/4 columns</strong><br />
328
- [wpcol_3quarter id="" class="" style=""][/wpcol_3quarter]<br />
329
- [wpcol_3quarter_end id="" class="" style=""][/wpcol_3quarter_end]<br />
330
  <br />
331
  <strong>1/3 columns</strong><br />
332
- [wpcol_1third id="" class="" style=""][/wpcol_1third]<br />
333
- [wpcol_1third_end id="" class="" style=""][/wpcol_1third_end]<br />
334
  <br />
335
  <strong>2/3 columns</strong><br />
336
- [wpcol_2third id="" class="" style=""][/wpcol_2third]<br />
337
- [wpcol_2third_end id="" class="" style=""][/wpcol_2third_end]<br />
338
  <br />
339
  <strong>1/5 columns</strong><br />
340
- [wpcol_1fifth id="" class="" style=""][/wpcol_1fifth]<br />
341
- [wpcol_1fifth_end id="" class="" style=""][/wpcol_1fifth_end]<br />
342
  <br />
343
  <strong>2/5 columns</strong><br />
344
- [wpcol_2fifth id="" class="" style=""][/wpcol_2fifth]<br />
345
- [wpcol_2fifth_end id="" class="" style=""][/wpcol_2fifth_end]<br />
346
  <br />
347
  <strong>3/5 columns</strong><br />
348
- [wpcol_3fifth id="" class="" style=""][/wpcol_3fifth]<br />
349
- [wpcol_3fifth_end id="" class="" style=""][/wpcol_3fifth_end]<br />
350
  <br />
351
  <strong>4/5 columns</strong><br />
352
- [wpcol_4fifth id="" class="" style=""][/wpcol_4fifth]<br />
353
- [wpcol_4fifth_end id="" class="" style=""][/wpcol_4fifth_end]<br />
354
  <br />
355
  <strong>special columns</strong><br />
356
- [wpdiv id="" class="" style=""][/wpdiv] (easily create DIVs in your content without editing HTML)<br />
357
  <br />
358
- [wpcol_divider] (clears all floats and creates a 2px high, 100% width div)<br />
359
- [wpcol_end_left] (clears left float)<br />
360
- [wpcol_end_right] (clears right float)<br />
361
- [wpcol_end_both] (clears both)
362
 
363
  <p>
364
  As you can see, column shortcodes take the attributes of "id", "class", and "style". This way you can
365
  have even more control over your columns, apply an additional class or use inline CSS.
366
  </p>
367
 
368
- <h5>Easy Columns plugin by <a href="http://www.affiliatetechhelp.com" target="_blank">AffiliateTechHelp.com</a></h5>
 
 
 
369
 
370
  </div><!-- dbx-content -->
371
 
13
  ?>
14
  <div class="wrap" style="max-width:950px !important;">
15
 
16
+ <a href="http://www.patrickfriedl.com.com/wordpress/easy-columns" target="_blank">
17
+ <img src="<?php echo EZC_PLUGIN_URL; ?>/img/easy-column-logo.jpg" alt="Easy Columns - take control of your layout" style="margin:10px 0px 5px 0px;border:none;">
18
  </a>
19
 
20
  <div id="paypal-float" style="float:right;margin-top:10px;width:260px;padding-top:8px;">
21
+ <img src="<?php echo EZC_PLUGIN_URL; ?>/img/coffee.jpg" style="float:left;margin:-8px 8px 8px 0px;">
22
  Like Easy Columns?<br />
23
  Say, then how about a cup o' coffee?<br />
24
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
50
 
51
  <br />
52
 
53
+ <!--<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.patrickfriedl.com.com%2Fwordpress%2Feasy-columns&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=lucida+grande&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>-->
54
 
55
  <div class="dbx-content">
56
 
71
  <strong>Use Custom Options?</strong>
72
  </td>
73
  <td valign="middle">
74
+ <?php if($this->options['use_custom']){ ?>
75
  <input type="checkbox" id="use_custom" name="use_custom" value="true" checked="checked">
76
  <?php } else { ?>
77
  <input type="checkbox" id="use_custom" name="use_custom" value="true">
103
  Width
104
  </td>
105
  <td valign="middle">
106
+ <input type="text" id="quarter_width" name="quarter_width" value="<?php echo $this->options['quarter_width']; ?>" size="6">
107
  &nbsp;
108
+ <?php write_sel('quarter_width_type',$this->options['quarter_width_type']); ?>
109
  </td>
110
  <td valign="middle">
111
  Width
112
  </td>
113
  <td valign="middle">
114
+ <input type="text" id="onehalf_width" name="onehalf_width" value="<?php echo $this->options['onehalf_width']; ?>" size="6">
115
  &nbsp;
116
+ <?php write_sel('onehalf_width_type',$this->options['onehalf_width_type']); ?>
117
  </td>
118
  <td valign="middle">
119
  Width
120
  </td>
121
  <td valign="middle">
122
+ <input type="text" id="threequarter_width" name="threequarter_width" value="<?php echo $this->options['threequarter_width']; ?>" size="6">
123
  &nbsp;
124
+ <?php write_sel('threequarter_width_type',$this->options['threequarter_width_type']); ?>
125
  </td>
126
  </tr>
127
 
130
  Margin
131
  </td>
132
  <td valign="middle">
133
+ <input type="text" id="quarter_margin" name="quarter_margin" value="<?php echo $this->options['quarter_margin']; ?>" size="6">
134
  &nbsp;
135
+ <?php write_sel('quarter_margin_type',$this->options['quarter_margin_type']); ?>
136
  </td>
137
  <td valign="middle">
138
  Margin
139
  </td>
140
  <td valign="middle">
141
+ <input type="text" id="onehalf_margin" name="onehalf_margin" value="<?php echo $this->options['onehalf_margin']; ?>" size="6">
142
  &nbsp;
143
+ <?php write_sel('onehalf_margin_type',$this->options['onehalf_margin_type']); ?>
144
  </td>
145
  <td valign="middle">
146
  Margin
147
  </td>
148
  <td valign="middle">
149
+ <input type="text" id="threequarter_margin" name="threequarter_margin" value="<?php echo $this->options['threequarter_margin']; ?>" size="6">
150
  &nbsp;
151
+ <?php write_sel('threequarter_margin_type',$this->options['threequarter_margin_type']); ?>
152
  </td>
153
  </tr>
154
 
173
  Width
174
  </td>
175
  <td valign="middle">
176
+ <input type="text" id="onethird_width" name="onethird_width" value="<?php echo $this->options['onethird_width']; ?>" size="6">
177
  &nbsp;
178
+ <?php write_sel('onethird_width_type',$this->options['onethird_width_type']); ?>
179
  </td>
180
  <td valign="middle">
181
  Width
182
  </td>
183
  <td valign="middle">
184
+ <input type="text" id="twothird_width" name="twothird_width" value="<?php echo $this->options['twothird_width']; ?>" size="6">
185
  &nbsp;
186
+ <?php write_sel('twothird_width_type',$this->options['twothird_width_type']); ?>
187
  </td>
188
  <td colspan="2">
189
  &nbsp;
194
  Margin
195
  </td>
196
  <td valign="middle">
197
+ <input type="text" id="onethird_margin" name="onethird_margin" value="<?php echo $this->options['onethird_margin']; ?>" size="6">
198
  &nbsp;
199
+ <?php write_sel('onethird_margin_type',$this->options['onethird_margin_type']); ?>
200
  </td>
201
  <td valign="middle">
202
  Margin
203
  </td>
204
  <td valign="middle">
205
+ <input type="text" id="twothird_margin" name="twothird_margin" value="<?php echo $this->options['twothird_margin']; ?>" size="6">
206
  &nbsp;
207
+ <?php write_sel('twothird_margin_type',$this->options['twothird_margin_type']); ?>
208
  </td>
209
  <td valign="middle" colspan="2">
210
  &nbsp;
232
  Width
233
  </td>
234
  <td valign="middle">
235
+ <input type="text" id="onefifth_width" name="onefifth_width" value="<?php echo $this->options['onefifth_width']; ?>" size="6">
236
  &nbsp;
237
+ <?php write_sel('onefifth_width_type',$this->options['onefifth_width_type']); ?>
238
  </td>
239
  <td valign="middle">
240
  Width
241
  </td>
242
  <td valign="middle">
243
+ <input type="text" id="twofifth_width" name="twofifth_width" value="<?php echo $this->options['twofifth_width']; ?>" size="6">
244
  &nbsp;
245
+ <?php write_sel('twofifth_width_type',$this->options['twofifth_width_type']); ?>
246
  </td>
247
  <td valign="middle">
248
  Width
249
  </td>
250
  <td valign="middle">
251
+ <input type="text" id="threefifth_width" name="threefifth_width" value="<?php echo $this->options['threefifth_width']; ?>" size="6">
252
  &nbsp;
253
+ <?php write_sel('threefifth_width_type',$this->options['threefifth_width_type']); ?>
254
  </td>
255
  </tr>
256
  <tr>
258
  Margin
259
  </td>
260
  <td valign="middle">
261
+ <input type="text" id="onefifth_margin" name="onefifth_margin" value="<?php echo $this->options['onefifth_margin']; ?>" size="6">
262
  &nbsp;
263
+ <?php write_sel('onefifth_margin_type',$this->options['onefifth_margin_type']); ?>
264
  </td>
265
  <td valign="middle">
266
  Margin
267
  </td>
268
  <td valign="middle">
269
+ <input type="text" id="twofifth_margin" name="twofifth_margin" value="<?php echo $this->options['twofifth_margin']; ?>" size="6">
270
  &nbsp;
271
+ <?php write_sel('twofifth_margin_type',$this->options['twofifth_margin_type']); ?>
272
  </td>
273
  <td valign="middle">
274
  Margin
275
  </td>
276
  <td valign="middle">
277
+ <input type="text" id="threefifth_margin" name="threefifth_margin" value="<?php echo $this->options['threefifth_margin']; ?>" size="6">
278
  &nbsp;
279
+ <?php write_sel('threefifth_margin_type',$this->options['threefifth_margin_type']); ?>
280
  </td>
281
  </tr>
282
 
291
  Width
292
  </td>
293
  <td valign="middle" colspan="5">
294
+ <input type="text" id="fourfifth_width" name="fourfifth_width" value="<?php echo $this->options['fourfifth_width']; ?>" size="6">
295
  &nbsp;
296
+ <?php write_sel('fourfifth_width_type',$this->options['fourfifth_width_type']); ?>
297
  </td>
298
  </tr>
299
  <tr>
301
  Margin
302
  </td>
303
  <td valign="middle" colspan="5">
304
+ <input type="text" id="fourfifth_margin" name="fourfifth_margin" value="<?php echo $this->options['fourfifth_margin']; ?>" size="6">
305
  &nbsp;
306
+ <?php write_sel('fourfifth_margin_type',$this->options['fourfifth_margin_type']); ?>
307
  </td>
308
  </tr>
309
 
317
 
318
  <h3>Column Shortcodes</h3>
319
  <strong>1/4 columns</strong><br />
320
+ [ezcol_1quarter id="" class="" style=""][/ezcol_1quarter]<br />
321
+ [ezcol_1quarter_end id="" class="" style=""][/ezcol_1quarter_end]<br />
322
  <br />
323
  <strong>1/2 columns</strong><br />
324
+ [ezcol_1half id="" class="" style=""][/ezcol_1half]<br />
325
+ [ezcol_1half_end id="" class="" style=""][/ezcol_1half_end]<br />
326
  <br />
327
  <strong>3/4 columns</strong><br />
328
+ [ezcol_3quarter id="" class="" style=""][/ezcol_3quarter]<br />
329
+ [ezcol_3quarter_end id="" class="" style=""][/ezcol_3quarter_end]<br />
330
  <br />
331
  <strong>1/3 columns</strong><br />
332
+ [ezcol_1third id="" class="" style=""][/ezcol_1third]<br />
333
+ [ezcol_1third_end id="" class="" style=""][/ezcol_1third_end]<br />
334
  <br />
335
  <strong>2/3 columns</strong><br />
336
+ [ezcol_2third id="" class="" style=""][/ezcol_2third]<br />
337
+ [ezcol_2third_end id="" class="" style=""][/ezcol_2third_end]<br />
338
  <br />
339
  <strong>1/5 columns</strong><br />
340
+ [ezcol_1fifth id="" class="" style=""][/ezcol_1fifth]<br />
341
+ [ezcol_1fifth_end id="" class="" style=""][/ezcol_1fifth_end]<br />
342
  <br />
343
  <strong>2/5 columns</strong><br />
344
+ [ezcol_2fifth id="" class="" style=""][/ezcol_2fifth]<br />
345
+ [ezcol_2fifth_end id="" class="" style=""][/ezcol_2fifth_end]<br />
346
  <br />
347
  <strong>3/5 columns</strong><br />
348
+ [ezcol_3fifth id="" class="" style=""][/ezcol_3fifth]<br />
349
+ [ezcol_3fifth_end id="" class="" style=""][/ezcol_3fifth_end]<br />
350
  <br />
351
  <strong>4/5 columns</strong><br />
352
+ [ezcol_4fifth id="" class="" style=""][/ezcol_4fifth]<br />
353
+ [ezcol_4fifth_end id="" class="" style=""][/ezcol_4fifth_end]<br />
354
  <br />
355
  <strong>special columns</strong><br />
356
+ [ezdiv id="" class="" style=""][/ezdiv] (easily create DIVs in your content without editing raw HTML!)<br />
357
  <br />
358
+ [ezcol_divider] (clears all floats and creates a 2px high, 100% width div)<br />
359
+ [ezcol_end_left] (clears left float)<br />
360
+ [ezcol_end_right] (clears right float)<br />
361
+ [ezcol_end_both] (clears both)
362
 
363
  <p>
364
  As you can see, column shortcodes take the attributes of "id", "class", and "style". This way you can
365
  have even more control over your columns, apply an additional class or use inline CSS.
366
  </p>
367
 
368
+ <h4>Easy Columns plugin by <a href="http://www.patrickfriedl.com" target="_blank">PatrickFriedl.com</a></h4>
369
+ <h4>If you like Easy Columns, be sure to check out our other plugins
370
+ <a href="http://www.fanpageconnect.com" target="_blank">Fanpage Connect</a> to create Facebook fanpages from your blog,
371
+ or <a href="http://www.wp-geolocation.com" target="_blank">WP-Geolocation</a> to personalize your content with a user's location.</h4>
372
 
373
  </div><!-- dbx-content -->
374
 
easy-columns.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
  /*
3
  Plugin Name: Easy Columns
4
- Plugin URI: http://www.affiliatetechhelp.com/wordpress/easy-columns
5
- Version: v2.0
6
- Author: <a href="http://www.affiliatetechhelp.com">Pat Friedl</a>
7
- Description: Easy Columns provides the shortcodes to create a grid system or magazine style columns for laying out your pages just the way you need them. Using shortcodes for 1/4, 1/2, 1/3, 2/3, 3/4, 1/5, 2/5, and 3/5 columns, you can insert <strong>at least thirty</strong> unique variations of columns on any page or post. Quickly add columns to your pages from the editor with an easy to use "pick n' click" interface! For usage and more information, visit <a href="http://www.affiliatetechhelp.com" target="_blank">affiliatetechhelp.com</a>.
8
 
9
- Copyright 2010 AffiliaTetechHelp.com (email: support[at]affiliatetechhelp[dot]com)
10
 
11
  This program is free software; you can redistribute it and/or modify
12
  it under the terms of the GNU General Public License as published by
@@ -28,49 +28,26 @@ if(!class_exists("EasyColumns")){
28
  class EasyColumns {
29
 
30
  var $plugin_url;
31
- var $EasyColumns_DB_option = 'easycol_options';
32
- var $EasyColumns_options;
33
-
34
- var $use_custom;
35
- var $quarter_width;
36
- var $quarter_width_type;
37
- var $quarter_margin;
38
- var $quarter_margin_type;
39
- var $onehalf_width;
40
- var $onehalf_width_type;
41
- var $onehalf_margin;
42
- var $onehalf_margin_type;
43
- var $threequarter_width;
44
- var $threequarter_width_type;
45
- var $threequarter_margin;
46
- var $threequarter_margin_type;
47
- var $onethird_width;
48
- var $onethird_width_type;
49
- var $onethird_margin;
50
- var $onethird_margin_type;
51
- var $twothird_width;
52
- var $twothird_width_type;
53
- var $twothird_margin;
54
- var $twothird_margin_type;
55
- var $fifth_width;
56
- var $fifth_width_type;
57
- var $fifth_margin;
58
- var $fifth_margin_type;
59
- var $twofifth_width;
60
- var $twofifth_width_type;
61
- var $twofifth_margin;
62
- var $twofifth_margin_type;
63
- var $threefifth_width;
64
- var $threefifth_width_type;
65
- var $threefifth_margin;
66
- var $threefifth_margin_type;
67
 
68
  function EasyColumns() { //constructor
69
 
70
- // define the plugin URL so we can add the CSS
71
- $this->plugin_url = $this->plugin_url = defined('WP_PLUGIN_URL') ? WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
72
 
73
- // define column shortcodes
 
 
 
 
 
 
 
 
 
 
 
74
  add_shortcode('wpcol_1half', array(&$this, 'wpcol_one_half'));
75
  add_shortcode('wpcol_1half_end', array(&$this, 'wpcol_one_half_end'));
76
  add_shortcode('wpcol_1third', array(&$this, 'wpcol_one_third'));
@@ -94,125 +71,113 @@ if(!class_exists("EasyColumns")){
94
  add_shortcode('wpcol_end_right', array(&$this, 'wpcol_end_column_right'));
95
  add_shortcode('wpcol_end_left', array(&$this, 'wpcol_end_column_left'));
96
  add_shortcode('wpcol_end_both', array(&$this, 'wpcol_end_column_both'));
97
- // add to tinyMCE
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  add_action('init', array(&$this, 'add_tinymce'));
99
  // add admin menu
100
  add_action('admin_menu', array(&$this, 'admin_menu'));
101
 
102
  // get the options
103
- $options = $this->get_options();
104
-
105
- // assign variables for column styles
106
- $this->use_custom = $options['use_custom'];
107
- $this->quarter_width = $options['quarter_width'];
108
- $this->quarter_width_type = $options['quarter_width_type'];
109
- $this->quarter_margin = $options['quarter_margin'];
110
- $this->quarter_margin_type = $options['quarter_margin_type'];
111
- $this->onehalf_width = $options['onehalf_width'];
112
- $this->onehalf_width_type = $options['onehalf_width_type'];
113
- $this->onehalf_margin = $options['onehalf_margin'];
114
- $this->onehalf_margin_type = $options['onehalf_margin_type'];
115
- $this->threequarter_width = $options['threequarter_width'];
116
- $this->threequarter_width_type = $options['threequarter_width_type'];
117
- $this->threequarter_margin = $options['threequarter_margin'];
118
- $this->threequarter_margin_type = $options['threequarter_margin_type'];
119
- $this->onethird_width = $options['onethird_width'];
120
- $this->onethird_width_type = $options['onethird_width_type'];
121
- $this->onethird_margin = $options['onethird_margin'];
122
- $this->onethird_margin_type = $options['onethird_margin_type'];
123
- $this->twothird_width = $options['twothird_width'];
124
- $this->twothird_width_type = $options['twothird_width_type'];
125
- $this->twothird_margin = $options['twothird_margin'];
126
- $this->twothird_margin_type = $options['twothird_margin_type'];
127
- $this->fifth_width = $options['onefifth_width'];
128
- $this->fifth_width_type = $options['onefifth_width_type'];
129
- $this->fifth_margin = $options['onefifth_margin'];
130
- $this->fifth_margin_type = $options['onefifth_margin_type'];
131
- $this->twofifth_width = $options['twofifth_width'];
132
- $this->twofifth_width_type = $options['twofifth_width_type'];
133
- $this->twofifth_margin = $options['twofifth_margin'];
134
- $this->twofifth_margin_type = $options['twofifth_margin_type'];
135
- $this->threefifth_width = $options['threefifth_width'];
136
- $this->threefifth_width_type = $options['threefifth_width_type'];
137
- $this->threefifth_margin = $options['threefifth_margin'];
138
- $this->threefifth_margin_type = $options['threefifth_margin_type'];
139
- $this->fourfifth_width = $options['fourfifth_width'];
140
- $this->fourfifth_width_type = $options['fourfifth_width_type'];
141
- $this->fourfifth_margin = $options['fourfifth_margin'];
142
- $this->fourfifth_margin_type = $options['fourfifth_margin_type'];
143
 
144
  } // end function EasyColumns
145
 
146
  function wpcol_one_half($atts, $content = null) {
147
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-one-half') . '>'.$this->wpcol_strip_autop($content).'</div>';
148
  }
149
 
150
  function wpcol_one_half_end($atts, $content = null) {
151
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-one-half wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
152
  }
153
 
154
  function wpcol_one_third($atts, $content = null) {
155
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-one-third') . '>'.$this->wpcol_strip_autop($content).'</div>';
156
  }
157
 
158
  function wpcol_one_third_end($atts, $content = null) {
159
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-one-third wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
160
  }
161
 
162
  function wpcol_two_third($atts, $content = null) {
163
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-two-third') . '>'.$this->wpcol_strip_autop($content).'</div>';
164
  }
165
 
166
  function wpcol_two_third_end($atts, $content = null) {
167
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-two-third wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
168
  }
169
 
170
  function wpcol_one_quarter($atts, $content = null) {
171
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-one-quarter') . '>'.$this->wpcol_strip_autop($content).'</div>';
172
  }
173
 
174
  function wpcol_one_quarter_end($atts, $content = null) {
175
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-one-quarter wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
176
  }
177
 
178
  function wpcol_three_quarter($atts, $content = null) {
179
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-three-quarter') . '>'.$this->wpcol_strip_autop($content).'</div>';
180
  }
181
 
182
  function wpcol_three_quarter_end($atts, $content = null) {
183
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-three-quarter wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
184
  }
185
 
186
  function wpcol_one_fifth($atts, $content = null) {
187
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-one-fifth') . '>'.$this->wpcol_strip_autop($content).'</div>';
188
  }
189
 
190
  function wpcol_one_fifth_end($atts, $content = null) {
191
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-one-fifth wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
192
  }
193
 
194
  function wpcol_two_fifth($atts, $content = null) {
195
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-two-fifth') . '>'.$this->wpcol_strip_autop($content).'</div>';
196
  }
197
 
198
  function wpcol_two_fifth_end($atts, $content = null) {
199
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-two-fifth wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
200
  }
201
 
202
  function wpcol_three_fifth($atts, $content = null) {
203
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-three-fifth') . '>'.$this->wpcol_strip_autop($content).'</div>';
204
  }
205
 
206
  function wpcol_three_fifth_end($atts, $content = null) {
207
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-three-fifth wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
208
  }
209
 
210
  function wpcol_four_fifth($atts, $content = null) {
211
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-four-fifth') . '>'.$this->wpcol_strip_autop($content).'</div>';
212
  }
213
 
214
  function wpcol_four_fifth_end($atts, $content = null) {
215
- return '<div' . $this->wpcol_div_atts($atts,'wpcol-four-fifth wpcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
216
  }
217
 
218
  function wpcol_div($atts, $content = null) {
@@ -220,19 +185,19 @@ if(!class_exists("EasyColumns")){
220
  }
221
 
222
  function wpcol_add_divider(){
223
- return '<div class="wpcol-divider"></div>';
224
  }
225
 
226
  function wpcol_end_column_left($atts, $content = null) {
227
- return '<div class="wpcol-left"></div>';
228
  }
229
 
230
  function wpcol_end_column_right($atts, $content = null) {
231
- return '<div class="wpcol-right"></div>';
232
  }
233
 
234
  function wpcol_end_column_both($atts, $content = null) {
235
- return '<div class="wpcol-both"></div>';
236
  }
237
 
238
  function wpcol_div_atts($atts,$col_type) {
@@ -266,92 +231,92 @@ if(!class_exists("EasyColumns")){
266
 
267
  function wpcol_add_css(){
268
  ?>
269
- <!-- Begin Easy Columns 1.0 by Pat Friedl http://www.affiliatetechhelp.com -->
270
- <link rel="stylesheet" href="<?php echo $this->plugin_url; ?>/css/wp-ez-columns.css?<?php echo time();?>" type="text/css" media="screen, projection" />
271
- <!-- End Easy Columns 1.0 -->
272
  <?php
273
  if($this->use_custom)
274
  {
275
- if($this->quarter_width != '' || $this->quarter_margin != '' ||
276
- $this->onehalf_width != '' || $this->onehalf_margin != '' ||
277
- $this->threequarter_width != '' || $this->threequarter_margin != '' ||
278
- $this->onethird_width != '' || $this->onethird_margin != '' ||
279
- $this->twothird_width != '' || $this->twothird_margin != '' ||
280
- $this->twothird_width != '' || $this->twothird_margin != '' ||
281
- $this->fifth_width != '' || $this->fifth_margin != '' ||
282
- $this->twofifth_width != '' || $this->twofifth_margin != '' ||
283
- $this->threefifth_width != '' || $this->threefifth_margin != '' ||
284
- $this->fourfifth_width != '' || $this->fourfifth_margin != '')
285
- {
 
286
  ?>
287
- <!-- Begin Easy Columns 1.2.1 Custom CSS -->
288
  <style type="text/css" media="screen, projection">
289
  <?php
290
- if($this->quarter_width != '' || $this->quarter_margin != '')
291
  {
292
- echo '.wpcol-one-quarter {';
293
- if($this->quarter_width != '') { echo 'width:'.$this->quarter_width.$this->quarter_width_type.'; '; }
294
- if($this->quarter_margin != '') { echo 'margin-right:'.$this->quarter_margin.$this->quarter_margin_type.';'; }
295
  echo '} ';
296
  }
297
- if($this->onehalf_width != '' || $this->onehalf_margin != '')
298
  {
299
- echo '.wpcol-one-half {';
300
- if($this->onehalf_width != '') { echo 'width:'.$this->onehalf_width.$this->onehalf_width_type.'; '; }
301
- if($this->onehalf_margin != '') { echo 'margin-right:'.$this->onehalf_margin.$this->onehalf_margin_type.';'; }
302
  echo '} ';
303
  }
304
- if($this->threequarter_width != '' || $this->threequarter_margin != '')
305
  {
306
- echo '.wpcol-three-quarter {';
307
- if($this->threequarter_width != '') { echo 'width:'.$this->threequarter_width.$this->threequarter_width_type.'; '; }
308
- if($this->threequarter_margin != '') { echo 'margin-right:'.$this->threequarter_margin.$this->threequarter_margin_type.';'; }
309
  echo '} ';
310
  }
311
- if($this->onethird_width != '' || $this->onethird_margin != '')
312
  {
313
- echo '.wpcol-one-third {';
314
- if($this->onethird_width != '') { echo 'width:'.$this->onethird_width.$this->onethird_width_type.'; '; }
315
- if($this->onethird_margin != '') { echo 'margin-right:'.$this->onethird_margin.$this->onethird_margin_type.';'; }
316
  echo '} ';
317
  }
318
- if($this->twothird_width != '' || $this->twothird_margin != '')
319
  {
320
- echo '.wpcol-two-third {';
321
- if($this->twothird_width != '') { echo 'width:'.$this->twothird_width.$this->twothird_width_type.'; '; }
322
- if($this->twothird_margin != '') { echo 'margin-right:'.$this->twothird_margin.$this->twothird_margin_type.';'; }
323
  echo '}';
324
  }
325
- if($this->fifth_width != '' || $this->fifth_margin != '')
326
  {
327
- echo '.wpcol-one-fifth {';
328
- if($this->fifth_width != '') { echo 'width:'.$this->fifth_width.$this->fifth_width_type.'; '; }
329
- if($this->fifth_margin != '') { echo 'margin-right:'.$this->fifth_margin.$this->fifth_margin_type.';'; }
330
  echo '}';
331
  }
332
- if($this->twofifth_width != '' || $this->twofifth_margin != '')
333
  {
334
- echo '.wpcol-two-fifth {';
335
- if($this->twofifth_width != '') { echo 'width:'.$this->twofifth_width.$this->twofifth_width_type.'; '; }
336
- if($this->twofifth_margin != '') { echo 'margin-right:'.$this->twofifth_margin.$this->twofifth_margin_type.';'; }
337
  echo '}';
338
  }
339
- if($this->threefifth_width != '' || $this->threefifth_margin != '')
340
  {
341
- echo '.wpcol-three-fifth {';
342
- if($this->threefifth_width != '') { echo 'width:'.$this->threefifth_width.$this->threefifth_width_type.'; '; }
343
- if($this->threefifth_margin != '') { echo 'margin-right:'.$this->threefifth_margin.$this->threefifth_margin_type.';'; }
344
  echo '}';
345
  }
346
- if($this->fourfifth_width != '' || $this->fourfifth_margin != '')
347
  {
348
- echo '.wpcol-four-fifth {';
349
- if($this->fourfifth_width != '') { echo 'width:'.$this->fourfifth_width.$this->fourfifth_width_type.'; '; }
350
- if($this->fourfifth_margin != '') { echo 'margin-right:'.$this->fourfifth_margin.$this->fourfifth_margin_type.';'; }
351
  echo '}';
352
  }
353
- ?>
354
  echo "\n";
 
355
  </style>
356
  <!-- End Easy Columns 1.2.1 Custom CSS -->
357
  <?php
@@ -360,6 +325,12 @@ if(!class_exists("EasyColumns")){
360
  }// end wpcol_add_css
361
 
362
  // begin functions for adding plugin to tinyMCE
 
 
 
 
 
 
363
  function add_tinymce() {
364
  if(!current_user_can('edit_posts') && ! current_user_can('edit_pages')) {
365
  return;
@@ -370,7 +341,7 @@ if(!class_exists("EasyColumns")){
370
  }
371
  }
372
  function add_tinymce_plugin($plugin_array) {
373
- $plugin_array['ezColumns'] = $this->plugin_url . '/tinymce/editor_plugin.js';
374
  return $plugin_array;
375
  }
376
  function add_tinymce_button($buttons) {
@@ -426,7 +397,7 @@ if(!class_exists("EasyColumns")){
426
  );
427
 
428
  // get saved options
429
- $saved = get_option($this->EasyColumns_DB_option);
430
 
431
  // assign options
432
  if(!empty($saved))
@@ -440,7 +411,7 @@ if(!class_exists("EasyColumns")){
440
  //update options if necessary
441
  if($saved != $options)
442
  {
443
- update_option($this->EasyColumns_DB_option,$options);
444
  }
445
 
446
  // return the options
@@ -452,55 +423,19 @@ if(!class_exists("EasyColumns")){
452
  */
453
  function handle_options()
454
  {
455
- $options = $this->get_options();
456
  if (isset($_POST['submitted'])) {
457
 
458
  //check security
459
  check_admin_referer('easycol-nonce');
460
-
461
  $options = array();
462
- if($_POST['use_custom'] != ''){
463
- $options['use_custom'] = true;
464
- } else {
465
- $options['use_custom'] = false;
466
  }
467
- $options['quarter_width'] = trim($_POST['quarter_width']);
468
- $options['quarter_width_type'] = $_POST['quarter_width_type'];
469
- $options['quarter_margin'] = trim($_POST['quarter_margin']);
470
- $options['quarter_margin_type'] = $_POST['quarter_margin_type'];
471
- $options['onehalf_width'] = trim($_POST['onehalf_width']);
472
- $options['onehalf_width_type'] = $_POST['onehalf_width_type'];
473
- $options['onehalf_margin'] = trim($_POST['onehalf_margin']);
474
- $options['onehalf_margin_type'] = $_POST['onehalf_margin_type'];
475
- $options['threequarter_width'] = trim($_POST['threequarter_width']);
476
- $options['threequarter_width_type'] = $_POST['threequarter_width_type'];
477
- $options['threequarter_margin'] = trim($_POST['threequarter_margin']);
478
- $options['threequarter_margin_type'] = $_POST['threequarter_margin_type'];
479
- $options['onethird_width'] = trim($_POST['onethird_width']);
480
- $options['onethird_width_type'] = $_POST['onethird_width_type'];
481
- $options['onethird_margin'] = trim($_POST['onethird_margin']);
482
- $options['onethird_margin_type'] = $_POST['onethird_margin_type'];
483
- $options['twothird_width'] = trim($_POST['twothird_width']);
484
- $options['twothird_width_type'] = $_POST['twothird_width_type'];
485
- $options['twothird_margin'] = trim($_POST['twothird_margin']);
486
- $options['twothird_margin_type'] = $_POST['twothird_margin_type'];
487
- $options['onefifth_width'] = trim($_POST['onefifth_width']);
488
- $options['onefifth_width_type'] = $_POST['onefifth_width_type'];
489
- $options['onefifth_margin'] = trim($_POST['onefifth_margin']);
490
- $options['onefifth_margin_type'] = $_POST['onefifth_margin_type'];
491
- $options['twofifth_width'] = trim($_POST['twofifth_width']);
492
- $options['twofifth_width_type'] = $_POST['twofifth_width_type'];
493
- $options['twofifth_margin'] = trim($_POST['twofifth_margin']);
494
- $options['twofifth_margin_type'] = $_POST['twofifth_margin_type'];
495
- $options['threefifth_width'] = trim($_POST['threefifth_width']);
496
- $options['threefifth_width_type'] = $_POST['threefifth_width_type'];
497
- $options['threefifth_margin'] = trim($_POST['threefifth_margin']);
498
- $options['threefifth_margin_type'] = $_POST['threefifth_margin_type'];
499
- $options['fourfifth_width'] = trim($_POST['fourfifth_width']);
500
- $options['fourfifth_width_type'] = $_POST['fourfifth_width_type'];
501
- $options['fourfifth_margin'] = trim($_POST['fourfifth_margin']);
502
- $options['fourfifth_margin_type'] = $_POST['fourfifth_margin_type'];
503
- update_option($this->EasyColumns_DB_option, $options);
504
 
505
  echo '<div class="updated fade"><p>Plugin settings saved.</p></div>';
506
  }
@@ -508,53 +443,12 @@ if(!class_exists("EasyColumns")){
508
  // URL for form submit, equals our current page
509
  $action_url = $_SERVER['REQUEST_URI'];
510
 
511
- // assign variables for the options page
512
- $use_custom = $options['use_custom'];
513
- $quarter_width = $options['quarter_width'];
514
- $quarter_width_type = $options['quarter_width_type'];
515
- $quarter_margin = $options['quarter_margin'];
516
- $quarter_margin_type = $options['quarter_margin_type'];
517
- $onehalf_width = $options['onehalf_width'];
518
- $onehalf_width_type = $options['onehalf_width_type'];
519
- $onehalf_margin = $options['onehalf_margin'];
520
- $onehalf_margin_type = $options['onehalf_margin_type'];
521
- $threequarter_width = $options['threequarter_width'];
522
- $threequarter_width_type = $options['threequarter_width_type'];
523
- $threequarter_margin = $options['threequarter_margin'];
524
- $threequarter_margin_type = $options['threequarter_margin_type'];
525
- $onethird_width = $options['onethird_width'];
526
- $onethird_width_type = $options['onethird_width_type'];
527
- $onethird_margin = $options['onethird_margin'];
528
- $onethird_margin_type = $options['onethird_margin_type'];
529
- $twothird_width = $options['twothird_width'];
530
- $twothird_width_type = $options['twothird_width_type'];
531
- $twothird_margin = $options['twothird_margin'];
532
- $twothird_margin_type = $options['twothird_margin_type'];
533
- $onefifth_width = $options['onefifth_width'];
534
- $onefifth_width_type = $options['onefifth_width_type'];
535
- $onefifth_margin = $options['onefifth_margin'];
536
- $onefifth_margin_type = $options['onefifth_margin_type'];
537
- $twofifth_width = $options['twofifth_width'];
538
- $twofifth_width_type = $options['twofifth_width_type'];
539
- $twofifth_margin = $options['twofifth_margin'];
540
- $twofifth_margin_type = $options['twofifth_margin_type'];
541
- $threefifth_width = $options['threefifth_width'];
542
- $threefifth_width_type = $options['threefifth_width_type'];
543
- $threefifth_margin = $options['threefifth_margin'];
544
- $threefifth_margin_type = $options['threefifth_margin_type'];
545
- $fourfifth_width = $options['fourfifth_width'];
546
- $fourfifth_width_type = $options['fourfifth_width_type'];
547
- $fourfifth_margin = $options['fourfifth_margin'];
548
- $fourfifth_margin_type = $options['fourfifth_margin_type'];
549
-
550
- $plugin_url = $this->plugin_url;
551
-
552
  // include the options page
553
  include('easy-columns-options.php');
554
  } // end handle_options
555
 
556
  /*
557
- add option page for Affiliate Cookie Jar
558
  */
559
  function admin_menu()
560
  {
@@ -567,14 +461,14 @@ if(!class_exists("EasyColumns")){
567
  function install()
568
  {
569
  // set default options
570
- $EasyColumns_options = $this->get_options();
571
  } // end install
572
 
573
  /*
574
  uninstall the plugin - removes options
575
  */
576
  function uninstall() {
577
- delete_option($this->EasyColumns_DB_option);
578
  } // end uninstall
579
 
580
 
@@ -584,15 +478,15 @@ if(!class_exists("EasyColumns")){
584
 
585
  // initialize the EasyColumns class
586
  if (class_exists("EasyColumns")) {
587
- $wp_wp_columns = new EasyColumns();
588
  }
589
 
590
  // set up actions and filters
591
- if (isset($wp_wp_columns)) {
592
- add_action('wp_head', array(&$wp_wp_columns, 'wpcol_add_css'), 100);
593
  if (function_exists('register_uninstall_hook'))
594
  {
595
- register_uninstall_hook(__FILE__, array(&$wp_wp_columns, 'uninstall'));
596
  }
597
  }
598
  ?>
1
  <?php
2
  /*
3
  Plugin Name: Easy Columns
4
+ Plugin URI: http://www.patrickfriedl.com/
5
+ Version: v2.1
6
+ Author: <a href="http://www.patrickfriedl.com">Pat Friedl</a>
7
+ Description: Easy Columns provides the shortcodes to create a grid system or magazine style columns for laying out your pages just the way you need them. Using shortcodes for 1/4, 1/2, 1/3, 2/3, 3/4, 1/5, 2/5, and 3/5 columns, you can insert <strong>at least thirty</strong> unique variations of columns on any page and even in posts! Quickly add columns to your pages from the editor with an easy to use "pick n' click" interface! For usage and more information, visit <a href="http://www.patrickfriedl.com" target="_blank">patrickfriedl.com</a>.
8
 
9
+ Copyright 2013 patrickfriedl.com (email: support[at]patrickfriedl[dot]com)
10
 
11
  This program is free software; you can redistribute it and/or modify
12
  it under the terms of the GNU General Public License as published by
28
  class EasyColumns {
29
 
30
  var $plugin_url;
31
+ var $ez_columns_options_name = 'easycol_options';
32
+ var $ez_columns_options;
33
+ var $options;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  function EasyColumns() { //constructor
36
 
37
+ global $post;
 
38
 
39
+ if (!defined('EZC_PLUGIN_NAME'))
40
+ define('EZC_PLUGIN_NAME', trim(dirname(plugin_basename(__FILE__)), '/'));
41
+ if (!defined('EZC_PLUGIN_DIR'))
42
+ define('EZC_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . EZC_PLUGIN_NAME);
43
+ if (!defined('EZC_PLUGIN_URL'))
44
+ define('EZC_PLUGIN_URL', WP_PLUGIN_URL . '/' . EZC_PLUGIN_NAME);
45
+ if (!defined('EZC_PLUGIN_VERSION'))
46
+ define('EZC_PLUGIN_VERSION','2.1');
47
+ if (!defined('EZC_PLUGIN_TYPE'))
48
+ define('EZC_PLUGIN_TYPE','free');
49
+
50
+ // define OLD column shortcodes
51
  add_shortcode('wpcol_1half', array(&$this, 'wpcol_one_half'));
52
  add_shortcode('wpcol_1half_end', array(&$this, 'wpcol_one_half_end'));
53
  add_shortcode('wpcol_1third', array(&$this, 'wpcol_one_third'));
71
  add_shortcode('wpcol_end_right', array(&$this, 'wpcol_end_column_right'));
72
  add_shortcode('wpcol_end_left', array(&$this, 'wpcol_end_column_left'));
73
  add_shortcode('wpcol_end_both', array(&$this, 'wpcol_end_column_both'));
74
+
75
+ // define NEW column shortcodes
76
+ add_shortcode('ezcol_1half', array(&$this, 'wpcol_one_half'));
77
+ add_shortcode('ezcol_1half_end', array(&$this, 'wpcol_one_half_end'));
78
+ add_shortcode('ezcol_1third', array(&$this, 'wpcol_one_third'));
79
+ add_shortcode('ezcol_1third_end', array(&$this, 'wpcol_one_third_end'));
80
+ add_shortcode('ezcol_2third', array(&$this, 'wpcol_two_third'));
81
+ add_shortcode('ezcol_2third_end', array(&$this, 'wpcol_two_third_end'));
82
+ add_shortcode('ezcol_1quarter', array(&$this, 'wpcol_one_quarter'));
83
+ add_shortcode('ezcol_1quarter_end', array(&$this, 'wpcol_one_quarter_end'));
84
+ add_shortcode('ezcol_3quarter', array(&$this, 'wpcol_three_quarter'));
85
+ add_shortcode('ezcol_3quarter_end', array(&$this, 'wpcol_three_quarter_end'));
86
+ add_shortcode('ezcol_1fifth', array(&$this, 'wpcol_one_fifth'));
87
+ add_shortcode('ezcol_1fifth_end', array(&$this, 'wpcol_one_fifth_end'));
88
+ add_shortcode('ezcol_2fifth', array(&$this, 'wpcol_two_fifth'));
89
+ add_shortcode('ezcol_2fifth_end', array(&$this, 'wpcol_two_fifth_end'));
90
+ add_shortcode('ezcol_3fifth', array(&$this, 'wpcol_three_fifth'));
91
+ add_shortcode('ezcol_3fifth_end', array(&$this, 'wpcol_three_fifth_end'));
92
+ add_shortcode('ezcol_4fifth', array(&$this, 'wpcol_four_fifth'));
93
+ add_shortcode('ezcol_4fifth_end', array(&$this, 'wpcol_four_fifth_end'));
94
+ add_shortcode('ezdiv', array(&$this, 'wpcol_div'));
95
+ add_shortcode('ezcol_divider', array(&$this, 'wpcol_add_divider'));
96
+ add_shortcode('ezcol_end_right', array(&$this, 'wpcol_end_column_right'));
97
+ add_shortcode('ezcol_end_left', array(&$this, 'wpcol_end_column_left'));
98
+ add_shortcode('ezcol_end_both', array(&$this, 'wpcol_end_column_both'));
99
+
100
+ // add to tinyMCE, include the window.php file
101
+ add_action('wp_ajax_easycolumns_tinymce', array(&$this,'ajax_tinymce'));
102
  add_action('init', array(&$this, 'add_tinymce'));
103
  // add admin menu
104
  add_action('admin_menu', array(&$this, 'admin_menu'));
105
 
106
  // get the options
107
+ $this->options = $this->get_options();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
  } // end function EasyColumns
110
 
111
  function wpcol_one_half($atts, $content = null) {
112
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-one-half') . '>'.$this->wpcol_strip_autop($content).'</div>';
113
  }
114
 
115
  function wpcol_one_half_end($atts, $content = null) {
116
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-one-half ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
117
  }
118
 
119
  function wpcol_one_third($atts, $content = null) {
120
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-one-third') . '>'.$this->wpcol_strip_autop($content).'</div>';
121
  }
122
 
123
  function wpcol_one_third_end($atts, $content = null) {
124
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-one-third ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
125
  }
126
 
127
  function wpcol_two_third($atts, $content = null) {
128
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-two-third') . '>'.$this->wpcol_strip_autop($content).'</div>';
129
  }
130
 
131
  function wpcol_two_third_end($atts, $content = null) {
132
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-two-third ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
133
  }
134
 
135
  function wpcol_one_quarter($atts, $content = null) {
136
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-one-quarter') . '>'.$this->wpcol_strip_autop($content).'</div>';
137
  }
138
 
139
  function wpcol_one_quarter_end($atts, $content = null) {
140
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-one-quarter ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
141
  }
142
 
143
  function wpcol_three_quarter($atts, $content = null) {
144
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-three-quarter') . '>'.$this->wpcol_strip_autop($content).'</div>';
145
  }
146
 
147
  function wpcol_three_quarter_end($atts, $content = null) {
148
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-three-quarter ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
149
  }
150
 
151
  function wpcol_one_fifth($atts, $content = null) {
152
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-one-fifth') . '>'.$this->wpcol_strip_autop($content).'</div>';
153
  }
154
 
155
  function wpcol_one_fifth_end($atts, $content = null) {
156
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-one-fifth ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
157
  }
158
 
159
  function wpcol_two_fifth($atts, $content = null) {
160
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-two-fifth') . '>'.$this->wpcol_strip_autop($content).'</div>';
161
  }
162
 
163
  function wpcol_two_fifth_end($atts, $content = null) {
164
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-two-fifth ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
165
  }
166
 
167
  function wpcol_three_fifth($atts, $content = null) {
168
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-three-fifth') . '>'.$this->wpcol_strip_autop($content).'</div>';
169
  }
170
 
171
  function wpcol_three_fifth_end($atts, $content = null) {
172
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-three-fifth ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
173
  }
174
 
175
  function wpcol_four_fifth($atts, $content = null) {
176
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-four-fifth') . '>'.$this->wpcol_strip_autop($content).'</div>';
177
  }
178
 
179
  function wpcol_four_fifth_end($atts, $content = null) {
180
+ return '<div' . $this->wpcol_div_atts($atts,'ezcol-four-fifth ezcol-last') . '>'.$this->wpcol_strip_autop($content).'</div>'.$this->wpcol_add_divider();
181
  }
182
 
183
  function wpcol_div($atts, $content = null) {
185
  }
186
 
187
  function wpcol_add_divider(){
188
+ return '<div class="ezcol-divider"></div>';
189
  }
190
 
191
  function wpcol_end_column_left($atts, $content = null) {
192
+ return '<div class="ezcol-left"></div>';
193
  }
194
 
195
  function wpcol_end_column_right($atts, $content = null) {
196
+ return '<div class="ezcol-right"></div>';
197
  }
198
 
199
  function wpcol_end_column_both($atts, $content = null) {
200
+ return '<div class="ezcol-both"></div>';
201
  }
202
 
203
  function wpcol_div_atts($atts,$col_type) {
231
 
232
  function wpcol_add_css(){
233
  ?>
234
+ <!-- Easy Columns <?php echo EZC_PLUGIN_VERSION; ?> by Pat Friedl http://www.patrickfriedl.com -->
235
+ <link rel="stylesheet" href="<?php echo EZC_PLUGIN_URL; ?>/css/easy-columns.css?<?php echo time();?>" type="text/css" media="screen, projection" />
 
236
  <?php
237
  if($this->use_custom)
238
  {
239
+ if(
240
+ isset($this->options['quarter_width']) || isset($this->options['quarter_margin']) ||
241
+ isset($this->options['onehalf_width']) || isset($this->options['onehalf_margin']) ||
242
+ isset($this->options['threequarter_width']) || isset($this->options['threequarter_margin']) ||
243
+ isset($this->options['onethird_width']) || isset($this->options['onethird_margin']) ||
244
+ isset($this->options['twothird_width']) || isset($this->options['twothird_margin']) ||
245
+ isset($this->options['twothird_width']) || isset($this->options['twothird_margin']) ||
246
+ isset($this->options['fifth_width']) || isset($this->options['fifth_margin']) ||
247
+ isset($this->options['twofifth_width']) || isset($this->options['twofifth_margin']) ||
248
+ isset($this->options['threefifth_width']) || isset($this->options['threefifth_margin']) ||
249
+ isset($this->options['fourfifth_width']) || isset($this->options['fourfifth_margin'])
250
+ ){
251
  ?>
252
+ <!-- Begin Easy Columns <?php echo EZC_PLUGIN_VERSION; ?> Custom CSS -->
253
  <style type="text/css" media="screen, projection">
254
  <?php
255
+ if(isset($this->options['quarter_width']) || isset($this->options['quarter_margin']))
256
  {
257
+ echo '.ezcol-one-quarter {';
258
+ if(isset($this->options['quarter_width'])) { echo 'width:'.$this->options['quarter_width'].$this->options['quarter_width_type'].';'; }
259
+ if(isset($this->options['quarter_margin'])) { echo 'margin-right:'.$this->options['quarter_margin'].$this->options['quarter_margin_type'].';'; }
260
  echo '} ';
261
  }
262
+ if(isset($this->options['onehalf_width']) || isset($this->options['onehalf_margin']))
263
  {
264
+ echo '.ezcol-one-half {';
265
+ if(isset($this->options['onehalf_width'])) { echo 'width:'.$this->options['onehalf_width'].$this->options['onehalf_width_type'].';'; }
266
+ if(isset($this->options['>onehalf_margin'])) { echo 'margin-right:'.$this->options['onehalf_margin'].$this->options['onehalf_margin_type'].';'; }
267
  echo '} ';
268
  }
269
+ if(isset($this->options['threequarter_width']) || isset($this->options['threequarter_margin']))
270
  {
271
+ echo '.ezcol-three-quarter {';
272
+ if(isset($this->options['threequarter_width'])) { echo 'width:'.$this->options['threequarter_width'].$this->options['threequarter_width_type'].';'; }
273
+ if(isset($this->options['threequarter_margin'])) { echo 'margin-right:'.$this->options['threequarter_margin'].$this->options['threequarter_margin_type'].';'; }
274
  echo '} ';
275
  }
276
+ if(isset($this->options['onethird_width']) || isset($this->options['onethird_margin']))
277
  {
278
+ echo '.ezcol-one-third {';
279
+ if(isset($this->options['onethird_width'])) { echo 'width:'.$this->options['onethird_width'].$this->options['onethird_width_type'].';'; }
280
+ if(isset($this->options['onethird_margin'])) { echo 'margin-right:'.$this->options['onethird_margin'].$this->options['onethird_margin_type'].';'; }
281
  echo '} ';
282
  }
283
+ if(isset($this->options['twothird_width']) || isset($this->options['twothird_margin']))
284
  {
285
+ echo '.ezcol-two-third {';
286
+ if(isset($this->options['twothird_width'])) { echo 'width:'.$this->options['twothird_width'].$this->options['twothird_width_type'].';'; }
287
+ if(isset($this->options['twothird_margin'])) { echo 'margin-right:'.$this->options['twothird_margin'].$this->options['twothird_margin_type'].';'; }
288
  echo '}';
289
  }
290
+ if(isset($this->options['fifth_width']) || isset($this->options['fifth_margin']))
291
  {
292
+ echo '.ezcol-one-fifth {';
293
+ if(isset($this->options['fifth_width'])) { echo 'width:'.$this->options['fifth_width'].$this->options['fifth_width_type'].';'; }
294
+ if(isset($this->options['fifth_margin'])) { echo 'margin-right:'.$this->options['fifth_margin'].$this->options['fifth_margin_type'].';'; }
295
  echo '}';
296
  }
297
+ if(isset($this->options['twofifth_width']) || isset($this->options['twofifth_margin']))
298
  {
299
+ echo '.ezcol-two-fifth {';
300
+ if(isset($this->options['twofifth_width'])) { echo 'width:'.$this->options['twofifth_width'].$this->options['twofifth_width_type'].';'; }
301
+ if(isset($this->options['twofifth_margin'])) { echo 'margin-right:'.$this->options['twofifth_margin'].$this->options['twofifth_margin_type'].';'; }
302
  echo '}';
303
  }
304
+ if(isset($this->options['threefifth_width']) || isset($this->options['threefifth_margin']))
305
  {
306
+ echo '.ezcol-three-fifth {';
307
+ if(isset($this->options['threefifth_width'])) { echo 'width:'.$this->options['threefifth_width'].$this->options['threefifth_width_type'].'; '; }
308
+ if(isset($this->options['threefifth_margin'])) { echo 'margin-right:'.$this->options['threefifth_margin'].$this->options['threefifth_margin_type'].';'; }
309
  echo '}';
310
  }
311
+ if(isset($this->options['fourfifth_width']) || isset($this->options['fourfifth_margin']))
312
  {
313
+ echo '.ezcol-four-fifth {';
314
+ if(isset($this->options['fourfifth_width'])) { echo 'width:'.$this->options['fourfifth_width'].$this->options['fourfifth_width_type'].';'; }
315
+ if(isset($this->options['fourfifth_margin'])) { echo 'margin-right:'.$this->options['fourfifth_margin'].$this->options['fourfifth_margin_type'].';'; }
316
  echo '}';
317
  }
 
318
  echo "\n";
319
+ ?>
320
  </style>
321
  <!-- End Easy Columns 1.2.1 Custom CSS -->
322
  <?php
325
  }// end wpcol_add_css
326
 
327
  // begin functions for adding plugin to tinyMCE
328
+ function ajax_tinymce() {
329
+ if ( !current_user_can('edit_pages') && !current_user_can('edit_posts') ){
330
+ die(__("You are not allowed to be here"));
331
+ }
332
+ include_once(EZC_PLUGIN_URL.'/tinymce/window.php?');
333
+ }
334
  function add_tinymce() {
335
  if(!current_user_can('edit_posts') && ! current_user_can('edit_pages')) {
336
  return;
341
  }
342
  }
343
  function add_tinymce_plugin($plugin_array) {
344
+ $plugin_array['ezColumns'] = EZC_PLUGIN_URL . '/tinymce/editor_plugin.js';
345
  return $plugin_array;
346
  }
347
  function add_tinymce_button($buttons) {
397
  );
398
 
399
  // get saved options
400
+ $saved = get_option($this->ez_columns_options_name);
401
 
402
  // assign options
403
  if(!empty($saved))
411
  //update options if necessary
412
  if($saved != $options)
413
  {
414
+ update_option($this->ez_columns_options_name,$options);
415
  }
416
 
417
  // return the options
423
  */
424
  function handle_options()
425
  {
426
+ $this->options = $this->get_options();
427
  if (isset($_POST['submitted'])) {
428
 
429
  //check security
430
  check_admin_referer('easycol-nonce');
 
431
  $options = array();
432
+
433
+ foreach($_POST as $key => $value){
434
+ $options[$key] = $value;
 
435
  }
436
+ $this->options = $options;
437
+ $this->options['use_custom'] = (isset($_POST['use_custom']))? true : false;
438
+ update_option($this->ez_columns_options_name, $this->options);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
 
440
  echo '<div class="updated fade"><p>Plugin settings saved.</p></div>';
441
  }
443
  // URL for form submit, equals our current page
444
  $action_url = $_SERVER['REQUEST_URI'];
445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  // include the options page
447
  include('easy-columns-options.php');
448
  } // end handle_options
449
 
450
  /*
451
+ add option page for Easy Columns
452
  */
453
  function admin_menu()
454
  {
461
  function install()
462
  {
463
  // set default options
464
+ $this->options = $this->get_options();
465
  } // end install
466
 
467
  /*
468
  uninstall the plugin - removes options
469
  */
470
  function uninstall() {
471
+ delete_option($this->ez_columns_options_name);
472
  } // end uninstall
473
 
474
 
478
 
479
  // initialize the EasyColumns class
480
  if (class_exists("EasyColumns")) {
481
+ $ez_columns = new EasyColumns();
482
  }
483
 
484
  // set up actions and filters
485
+ if (isset($ez_columns)) {
486
+ add_action('wp_head', array(&$ez_columns, 'wpcol_add_css'), 100);
487
  if (function_exists('register_uninstall_hook'))
488
  {
489
+ register_uninstall_hook(__FILE__, array(&$ez_columns, 'uninstall'));
490
  }
491
  }
492
  ?>
img/easy-column-logo.jpg CHANGED
Binary file
readme.txt CHANGED
@@ -1,86 +1,88 @@
1
  === WP Easy Columns ===
2
  Contributors: Pat Friedl
3
- Donate link: http://www.affiliatetechhelp.com/wordpress/easy-columns
4
- Tags: columns, column, grid layout, layout, magazine, page, posts, magazine columns, magazine layout, float div
5
-
6
  Requires at least: 2.7
7
- Tested up to: 3.2
8
- Stable tag: 2.0
9
 
10
- Easy Columns provides the shortcodes to create a grid system or magazine style columns for laying out your pages just the way you need them.
11
 
12
  == Description ==
13
 
14
- Easy Columns provides the shortcodes to create a grid system or magazine style columns for laying out your pages just the way you need them.
15
-
16
- Using shortcodes for 1/4, 1/2, 1/3, 2/3, 3/4, 1/5, 2/5, 3/5 and 4/5 columns, you can insert <strong>at least thirty</strong> unique variations of columns on any page or post.
17
 
18
- Quickly add columns to your pages from the editor with an easy to use "pick n' click" interface!
 
19
 
20
- For usage and more information, visit <a href="http://www.affiliatetechhelp.com" target="_blank">affiliatetechhelp.com</a>.
 
21
 
22
- <b>Example</b>
23
  To create content with 3 columns, you would use the shortcodes like this:
24
 
25
- [wpcol_1third]this is column 1[/wpcol_1third]
26
-
27
- [wpcol_1third]this is column 2[/wpcol_1third]
28
 
29
- [wpcol_1third_end]this is column 3[/wpcol_1third_end]
30
 
31
  == Installation ==
32
 
33
  1. Upload `wp-ez-columns` directory to the `/wp-content/plugins/` directory
34
- 2. Activate the plugin through the 'Plugins' menu in WordPress
35
- 3. Use any of the following shortcodes in your posts or pages:
 
36
  Available Shortcodes:
37
 
38
- 1/4 columns
39
- [wpcol_1quarter id="" class="" style=""][/wpcol_1quarter]
40
- [wpcol_1quarter_end id="" class="" style=""][/wpcol_1quarter_end]
41
 
42
- 1/2 columns
43
- [wpcol_1half id="" class="" style=""][/wpcol_1half]
44
- [wpcol_1half_end id="" class="" style=""][/wpcol_1half_end]
45
 
46
- 3/4 columns
47
- [wpcol_3quarter id="" class="" style=""][/wpcol_3quarter]
48
- [wpcol_3quarter_end id="" class="" style=""][/wpcol_3quarter_end]
49
 
50
- 1/3 columns
51
- [wpcol_1third id="" class="" style=""][/wpcol_1third]
52
- [wpcol_1third_end id="" class="" style=""][/wpcol_1third_end]
53
 
54
- 2/3 columns
55
- [wpcol_2third id="" class="" style=""][/wpcol_2third]
56
- [wpcol_2third_end id="" class="" style=""][/wpcol_2third_end]
57
 
58
- 1/5 columns
59
- [wpcol_1fifth id="" class="" style=""][/wpcol_1fifth]
60
- [wpcol_1fifth_end id="" class="" style=""][/wpcol_1fifth_end]
61
 
62
- 2/5 columns
63
- [wpcol_2fifth id="" class="" style=""][/wpcol_2fifth]
64
- [wpcol_2fifth_end id="" class="" style=""][/wpcol_2fifth_end]
65
 
66
- 3/5 columns
67
- [wpcol_3fifth id="" class="" style=""][/wpcol_3fifth]
68
- [wpcol_3fifth_end id="" class="" style=""][/wpcol_3fifth_end]
69
 
70
- 4/5 columns
71
- [wpcol_4fifth id="" class="" style=""][/wpcol_4fifth]
72
- [wpcol_4fifth_end id="" class="" style=""][/wpcol_4fifth_end]
73
 
74
- special columns
75
- [wpdiv id="" class="" style=""][/wpdiv]
76
  (easily create DIVs in your content without editing HTML)
77
 
78
- [wpcol_divider] (clears all floats and creates a 2px high, 100% width div)
79
- [wpcol_end_left] (clears left float)
80
- [wpcol_end_right] (clears right float)
81
- [wpcol_end_both] (clears both)
 
82
 
83
- ** Be sure to insert the "_end" column shortcode for your last column! **
84
 
85
  == Frequently Asked Questions ==
86
 
@@ -94,10 +96,28 @@ You can edit the wp-ez-columns.css file to customize the layouts. Be sure to bac
94
  Yes, as long as the content isn't larger than the column, otherwise the CSS will break and cause line breaks.
95
 
96
  = What good are columns? =
97
- Columns can be used in CMS layouts, magazine layouts and squeeze page layouts - it's only limited by your imagination.
 
 
 
 
 
 
 
 
98
 
99
  == Upgrade Notice ==
100
- * Additional shortcodes and fixes - please update!
 
 
 
 
 
 
 
 
 
 
101
 
102
  = 2.0 =
103
  * Upgraded visual editor window to WP 3.2 compliance
@@ -112,7 +132,6 @@ Columns can be used in CMS layouts, magazine layouts and squeeze page layouts -
112
  = 1.2 =
113
  * Additional shortcodes added. Please upgrade!
114
 
115
- == Changelog ==
116
  = 1.2 =
117
  * Added Support for 1/5, 2/5 and 3/5 columns.
118
 
1
  === WP Easy Columns ===
2
  Contributors: Pat Friedl
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=donations&business=T8V954QPLEW2J
4
+ Tags: columns, column, grid layout, box, boxes, feature box, layout, magazine, page, posts, magazine columns, magazine layout, float div
 
5
  Requires at least: 2.7
6
+ Tested up to: 3.6
7
+ Stable tag: 2.1
8
 
9
+ Easy Columns provides the shortcodes to create a grid system or magazine style columns for laying out your pages (or even posts!) just the way you need them.
10
 
11
  == Description ==
12
 
13
+ = What is Easy Columns? =
14
+ Easy Columns provides the shortcodes to create a grid system or magazine style columns for laying out your pages or posts on demand.
 
15
 
16
+ = Available Columns =
17
+ Using the shortcodes, you can get any combination of 1/4, 1/2, 1/3, 2/3, 3/4, 1/5, 2/5, 3/5 and 4/5 columns. You can insert <strong>at least thirty</strong> unique variations of columns on any page or post.
18
 
19
+ = Easy to Use =
20
+ Quickly add columns to your pages from the editor with an easy to use "pick n' click" interface. BEst of all, Easy Columns works with ANY theme!
21
 
22
+ = Example =
23
  To create content with 3 columns, you would use the shortcodes like this:
24
 
25
+ [ezcol_1third]this is column 1[/ezcol_1third]
26
+ [ezcol_1third]this is column 2[/ezcol_1third]
27
+ [ezcol_1third_end]this is column 3[/ezcol_1third_end]
28
 
29
+ The result are 3 columns about 33% in width of their container.
30
 
31
  == Installation ==
32
 
33
  1. Upload `wp-ez-columns` directory to the `/wp-content/plugins/` directory
34
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
35
+ 3. You can customize your columns in the settings menu under Settings > Easy Columns
36
+ 4. Use any of the following shortcodes in your posts or pages:
37
  Available Shortcodes:
38
 
39
+ = 1/4 columns =
40
+ [ezcol_1quarter id="" class="" style=""][/ezcol_1quarter]
41
+ [ezcol_1quarter_end id="" class="" style=""][/ezcol_1quarter_end]
42
 
43
+ = 1/2 columns =
44
+ [ezcol_1half id="" class="" style=""][/ezcol_1half]
45
+ [ezcol_1half_end id="" class="" style=""][/ezcol_1half_end]
46
 
47
+ = 3/4 columns =
48
+ [ezcol_3quarter id="" class="" style=""][/ezcol_3quarter]
49
+ [ezcol_3quarter_end id="" class="" style=""][/ezcol_3quarter_end]
50
 
51
+ = 1/3 columns =
52
+ [ezcol_1third id="" class="" style=""][/ezcol_1third]
53
+ [ezcol_1third_end id="" class="" style=""][/ezcol_1third_end]
54
 
55
+ = 2/3 columns =
56
+ [ezcol_2third id="" class="" style=""][/ezcol_2third]
57
+ [ezcol_2third_end id="" class="" style=""][/ezcol_2third_end]
58
 
59
+ = 1/5 columns =
60
+ [ezcol_1fifth id="" class="" style=""][/ezcol_1fifth]
61
+ [ezcol_1fifth_end id="" class="" style=""][/ezcol_1fifth_end]
62
 
63
+ = 2/5 columns =
64
+ [ezcol_2fifth id="" class="" style=""][/ezcol_2fifth]
65
+ [ezcol_2fifth_end id="" class="" style=""][/ezcol_2fifth_end]
66
 
67
+ = 3/5 columns =
68
+ [ezcol_3fifth id="" class="" style=""][/ezcol_3fifth]
69
+ [ezcol_3fifth_end id="" class="" style=""][/ezcol_3fifth_end]
70
 
71
+ = 4/5 columns =
72
+ [ezcol_4fifth id="" class="" style=""][/ezcol_4fifth]
73
+ [ezcol_4fifth_end id="" class="" style=""][/ezcol_4fifth_end]
74
 
75
+ = Special columns =
76
+ [ezdiv id="" class="" style=""][/ezdiv]
77
  (easily create DIVs in your content without editing HTML)
78
 
79
+ = Additional shortcodes =
80
+ [ezcol_divider] (clears all floats and creates a 2px high, 100% width div)
81
+ [ezcol_end_left] (clears left float)
82
+ [ezcol_end_right] (clears right float)
83
+ [ezcol_end_both] (clears both)
84
 
85
+ **Be sure to insert the "_end" column shortcode for your last column!**
86
 
87
  == Frequently Asked Questions ==
88
 
96
  Yes, as long as the content isn't larger than the column, otherwise the CSS will break and cause line breaks.
97
 
98
  = What good are columns? =
99
+ Columns can be used in CMS layouts, as feature boxes, in magazine layouts and **squeeze page layouts** - it's only limited by your imagination.
100
+
101
+ = Can You Create a Pro Version With Multiple Column Styles? =
102
+ Maybe! If you want that feature, send me an email. I get enough emails and I'll do it!
103
+
104
+ == Screenshots ==
105
+
106
+ 1. The Easy Columns settings page.
107
+ 2. The Easy Columns Visual Editor in Page/Post edit.
108
 
109
  == Upgrade Notice ==
110
+
111
+ Upgrade normally via your Wordpress admin -> Plugins panel.
112
+
113
+ == Changelog ==
114
+
115
+ = 2.1 =
116
+ * Upgraded visual editor window to WP 3.6 compliance
117
+ * Updated styles in the visual editor
118
+ * Streamlined/optimized code
119
+ * Updated CSS to auto-hyphenate long words to they conform to columns widths
120
+ * Migrated shortcodes from 'wpcol_' to 'ezcol_' (no worries, it's backwards compatible)
121
 
122
  = 2.0 =
123
  * Upgraded visual editor window to WP 3.2 compliance
132
  = 1.2 =
133
  * Additional shortcodes added. Please upgrade!
134
 
 
135
  = 1.2 =
136
  * Added Support for 1/5, 2/5 and 3/5 columns.
137
 
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
tinymce/editor_plugin.js CHANGED
@@ -17,9 +17,9 @@
17
 
18
  ed.addCommand('mceEZColumns', function() {
19
  ed.windowManager.open({
20
- file : url + '/window.php',
21
- width : 638 + ed.getLang('ezColumns.delta_width', 0),
22
- height : 438 + ed.getLang('ezColumns.delta_height', 0),
23
  inline : 1
24
  }, {
25
  plugin_url : url // Plugin absolute URL
@@ -47,10 +47,10 @@
47
  */
48
  getInfo : function() {
49
  return {
50
- longname : 'WP EZ Columns',
51
- author : 'AffiliateTechHelp.com',
52
- authorurl : 'http://affiliatetechhelp.com',
53
- infourl : 'http://affiliatetechhelp.com',
54
  version : "1.0"
55
  };
56
  }
17
 
18
  ed.addCommand('mceEZColumns', function() {
19
  ed.windowManager.open({
20
+ file : url + '/window.php?',
21
+ width : 764 + ed.getLang('ezColumns.delta_width', 0),
22
+ height : 500 + ed.getLang('ezColumns.delta_height', 0),
23
  inline : 1
24
  }, {
25
  plugin_url : url // Plugin absolute URL
47
  */
48
  getInfo : function() {
49
  return {
50
+ longname : 'Easy Columns',
51
+ author : 'PatFriedl.com',
52
+ authorurl : 'http://patfriedl.com',
53
+ infourl : 'http://patfriedl.com',
54
  version : "1.0"
55
  };
56
  }
tinymce/window.php CHANGED
@@ -1,48 +1,47 @@
1
  <?php
2
- /*
3
- wp ez columns tinymce
4
- */
5
- // look up for the path
6
- @ require('../../../../wp-config.php');
 
 
 
 
7
 
8
  // check for rights
9
  if ( !is_user_logged_in() || !current_user_can('edit_posts') )
10
  wp_die(__("You are not allowed to be here"));
11
-
12
- global $wpdb;
13
-
14
- // get the options
15
- //$options = get_option('wpezcol_options');
16
- //$options['ctr']
17
  ?>
18
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html xmlns="http://www.w3.org/1999/xhtml">
20
  <head>
21
- <title>WP Easy Columns</title>
22
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
23
  <style>
24
  .colPicker {
25
  float: left;
26
- width: 150px;
 
 
27
  }
28
  .colPicker tr {
29
  cursor: hand;
30
  }
31
  .colPicker td {
32
- background-color: #006599;
33
- color: #fff;
34
- text-align: center;
35
- font-family: arial,helvetica,sans-serif;
36
- font-size: 12px;
37
- font-weight: bold;
38
- padding: 4px;
39
- border-top: 1px solid #0097E2;
40
- border-left: 1px solid #0097E2;
41
- border-right: 1px solid #003E5E;
42
- border-bottom: 1px solid #003E5E;
43
- -moz-border-radius: 5px;
44
- border-radius: 5px;
45
  cursor: hand;
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
  </style>
48
  <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
@@ -60,145 +59,145 @@ function insertColumns(col) {
60
  {
61
  /* single columns */
62
  case 'quarter':
63
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
64
  break;
65
  case 'half':
66
- colTxt += '[wpcol_1half id="" class="" style=""]Half Column[/wpcol_1half] ';
67
  break;
68
  case 'threequarter':
69
- colTxt += '[wpcol_3quarter id="" class="" style=""]Three Quarter Column[/wpcol_3quarter] ';
70
  break;
71
  case 'third':
72
- colTxt += '[wpcol_1third id="" class="" style=""]Third Column[/wpcol_1third] ';
73
  break;
74
  case 'twothirds':
75
- colTxt += '[wpcol_2third id="" class="" style=""]Two Thirds Column[/wpcol_2third] ';
76
  break;
77
  case 'onefifth':
78
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
79
  break;
80
  case 'twofifths':
81
- colTxt += '[wpcol_2fifth id="" class="" style=""]Two Fifths Column[/wpcol_2fifth] ';
82
  break;
83
  case 'threefifths':
84
- colTxt += '[wpcol_3fifth id="" class="" style=""]Three Fifths Column[/wpcol_3fifth] ';
85
  break;
86
  case 'fourfifths':
87
- colTxt += '[wpcol_4fifth id="" class="" style=""]Four Fifths Column[/wpcol_4fifth] ';
88
  break;
89
 
90
  /* 1/3, 2/3 */
91
  case '3third':
92
- colTxt += '[wpcol_1third id="" class="" style=""]Third Column[/wpcol_1third] ';
93
- colTxt += '[wpcol_1third id="" class="" style=""]Third Column[/wpcol_1third] ';
94
- colTxt += '[wpcol_1third_end id="" class="" style=""]Third Column[/wpcol_1third_end] ';
95
  break;
96
  case '1third2third':
97
- colTxt += '[wpcol_1third id="" class="" style=""]Third Column[/wpcol_1third] ';
98
- colTxt += '[wpcol_2third_end id="" class="" style=""]Two Thirds Column[/wpcol_2third_end] ';
99
  break;
100
  case '2third1third':
101
- colTxt += '[wpcol_2third id="" class="" style=""]Two Thirds Column[/wpcol_2third] ';
102
- colTxt += '[wpcol_1third_end id="" class="" style=""]Third Column[/wpcol_1third_end] ';
103
  break;
104
 
105
  /* 1/4, 1/2, 3/4 */
106
  case '4quarter':
107
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
108
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
109
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
110
- colTxt += '[wpcol_1quarter_end id="" class="" style=""]Quarter Column[/wpcol_1quarter_end] ';
111
  break;
112
  case '1half2quarter':
113
- colTxt += '[wpcol_1half id="" class="" style=""]Half Column[/wpcol_1half] ';
114
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
115
- colTxt += '[wpcol_1quarter_end id="" class="" style=""]Quarter Column[/wpcol_1quarter_end] ';
116
  break;
117
  case 'quarterhalfquarter':
118
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
119
- colTxt += '[wpcol_1half id="" class="" style=""]Half Column[/wpcol_1half] ';
120
- colTxt += '[wpcol_1quarter_end id="" class="" style=""]Quarter Column[/wpcol_1quarter_end] ';
121
  break;
122
  case '2quarter1half':
123
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
124
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
125
- colTxt += '[wpcol_1half_end id="" class="" style=""]Half Column[/wpcol_1half_end] ';
126
  break;
127
  case '2half':
128
- colTxt += '[wpcol_1half id="" class="" style=""]Half Column[/wpcol_1half] ';
129
- colTxt += '[wpcol_1half_end id="" class="" style=""]Half Column[/wpcol_1half_end] ';
130
  break;
131
  case '1quarter3quarter':
132
- colTxt += '[wpcol_1quarter id="" class="" style=""]Quarter Column[/wpcol_1quarter] ';
133
- colTxt += '[wpcol_3quarter_end id="" class="" style=""]Three Quarter Column[/wpcol_3quarter_end] ';
134
  break;
135
  case '3quarter1quarter':
136
- colTxt += '[wpcol_3quarter id="" class="" style=""]Three Quarter Column[/wpcol_3quarter] ';
137
- colTxt += '[wpcol_1quarter_end id="" class="" style=""]Quarter Column[/wpcol_1quarter_end] ';
138
  break;
139
 
140
  /* 1/5, 2/5, 3/5, 4/5 */
141
  case '5fifth':
142
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
143
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
144
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
145
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
146
- colTxt += '[wpcol_1fifth_end id="" class="" style=""]One Fifth Column[/wpcol_1fifth_end] ';
147
  break;
148
  case '2fifth31fifth':
149
- colTxt += '[wpcol_2fifth id="" class="" style=""]Two Fifths Column[/wpcol_2fifth] ';
150
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
151
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
152
- colTxt += '[wpcol_1fifth_end id="" class="" style=""]One Fifth Column[/wpcol_1fifth_end] ';
153
  break;
154
  case '1fifth2fifth21fifth':
155
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
156
- colTxt += '[wpcol_2fifth id="" class="" style=""]Two Fifths Column[/wpcol_2fifth] ';
157
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
158
- colTxt += '[wpcol_1fifth_end id="" class="" style=""]One Fifth Column[/wpcol_1fifth_end] ';
159
  break;
160
  case '21fifth2fifth1fifth':
161
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
162
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
163
- colTxt += '[wpcol_2fifth id="" class="" style=""]Two Fifths Column[/wpcol_2fifth] ';
164
- colTxt += '[wpcol_1fifth_end id="" class="" style=""]One Fifth Column[/wpcol_1fifth_end] ';
165
  break;
166
  case '31fifth2fifth':
167
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
168
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
169
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
170
- colTxt += '[wpcol_2fifth_end id="" class="" style=""]Two Fifths Column[/wpcol_2fifth_end] ';
171
  break;
172
  case '3fifth21fifth':
173
- colTxt += '[wpcol_3fifth id="" class="" style=""]Three Fifths Column[/wpcol_3fifth] ';
174
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
175
- colTxt += '[wpcol_1fifth_end id="" class="" style=""]One Fifth Column[/wpcol_1fifth_end] ';
176
  break;
177
  case '1fifth3fifth1fifth':
178
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
179
- colTxt += '[wpcol_3fifth id="" class="" style=""]Three Fifths Column[/wpcol_3fifth] ';
180
- colTxt += '[wpcol_1fifth_end id="" class="" style=""]One Fifth Column[/wpcol_1fifth_end] ';
181
  break;
182
  case '21fifth3fifth':
183
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
184
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
185
- colTxt += '[wpcol_3fifth_end id="" class="" style=""]Three Fifths Column[/wpcol_3fifth_end] ';
186
  break;
187
  case '2fifth3fifth':
188
- colTxt += '[wpcol_2fifth id="" class="" style=""]Two Fifths Column[/wpcol_2fifth] ';
189
- colTxt += '[wpcol_3fifth_end id="" class="" style=""]Three Fifths Column[/wpcol_3fifth_end] ';
190
  break;
191
  case '3fifth2fifth':
192
- colTxt += '[wpcol_3fifth id="" class="" style=""]Three Fifths Column[/wpcol_3fifth] ';
193
- colTxt += '[wpcol_2fifth_end id="" class="" style=""]Two Fifths Column[/wpcol_2fifth_end] ';
194
  break;
195
  case '1fifth4fifth':
196
- colTxt += '[wpcol_1fifth id="" class="" style=""]One Fifth Column[/wpcol_1fifth] ';
197
- colTxt += '[wpcol_4fifth_end id="" class="" style=""]Four Fifths Column[/wpcol_4fifth_end] ';
198
  break;
199
  case '4fifth1fifth':
200
- colTxt += '[wpcol_4fifth id="" class="" style=""]Four Fifths Column[/wpcol_4fifth] ';
201
- colTxt += '[wpcol_1fifth_end id="" class="" style=""]One Fifth Column[/wpcol_1fifth_end] ';
202
  break;
203
  }
204
  insertText();
@@ -215,7 +214,7 @@ function insertDiv(){
215
  divID = document.getElementById('txtID').value;
216
  divClass = document.getElementById('txtClass').value;
217
  divStyle = document.getElementById('txtStyle').value;
218
- colTxt += '[wpdiv id="';
219
  if(divID != ''){
220
  colTxt += divID;
221
  }
@@ -227,7 +226,7 @@ function insertDiv(){
227
  if(divStyle != ''){
228
  colTxt += divStyle;
229
  }
230
- colTxt += '"]Custom Div[/wpdiv] ';
231
  insertText();
232
  }
233
 
@@ -238,16 +237,16 @@ function insertClear(){
238
  switch(classType)
239
  {
240
  case 'left':
241
- colTxt += '[wpcol_end_left]';
242
  break;
243
  case 'right':
244
- colTxt += '[wpcol_end_right]';
245
  break;
246
  case 'both':
247
- colTxt += '[wpcol_end_both]';
248
  break;
249
  case 'divider':
250
- colTxt += '[wpcol_divider]';
251
  break;
252
  }
253
  insertText();
@@ -291,14 +290,14 @@ select {
291
 
292
  <div class="panel">
293
 
294
- <table border="0" cellpadding="2" cellspacing="0" width="100%">
295
  <tr>
296
  <td class="hdrRow" colspan="3">
297
  <h3>Insert Column Combinations</h3>
298
  </td>
299
  </tr>
300
  </table>
301
-
302
  <!-- column combinations -->
303
  <table cellspacing="0" cellpadding="0" border="0">
304
  <tr>
@@ -307,17 +306,17 @@ select {
307
  <strong>1/3, 2/3, 3/3</strong><br />
308
  <table cellspacing="3" cellpadding="0" border="0" class="colPicker">
309
  <tr onclick="insertColumns('3third')">
310
- <td width="33%">1/3</td>
311
- <td width="33%">1/3</td>
312
- <td width="33%">1/3</td>
313
  </tr>
314
  <tr onclick="insertColumns('1third2third')">
315
- <td width="33%">1/3</td>
316
  <td colspan="2">2/3</td>
317
  </tr>
318
  <tr onclick="insertColumns('2third1third')">
319
- <td width="33%" colspan="2">2/3</td>
320
- <td width="33%">1/3</td>
321
  </tr>
322
  </table>
323
 
1
  <?php
2
+ while(!is_file('wp-config.php')){
3
+ if(is_dir('../')){ chdir('../'); }
4
+ else die('Could not find WordPress.');
5
+ }
6
+ include('wp-config.php');
7
+
8
+ wp_enqueue_script('jquery');
9
+ global $wp_scripts;
10
+ global $wpdb;
11
 
12
  // check for rights
13
  if ( !is_user_logged_in() || !current_user_can('edit_posts') )
14
  wp_die(__("You are not allowed to be here"));
 
 
 
 
 
 
15
  ?>
16
+ <!DOCTYPE html>
17
+ <html>
18
  <head>
19
+ <title>Easy Columns</title>
20
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
21
  <style>
22
  .colPicker {
23
  float: left;
24
+ width: 180px;
25
+ border-collapse: separate;
26
+ border-spacing: 0.9em;
27
  }
28
  .colPicker tr {
29
  cursor: hand;
30
  }
31
  .colPicker td {
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  cursor: hand;
33
+ background-color: #C3C3C3;
34
+ border-color: #333333;
35
+ border-radius: 7px 7px 7px 7px;
36
+ border-style: solid;
37
+ border-width: 1px;
38
+ box-shadow: 0 2px;
39
+ color: #4E4E4E;
40
+ font-family: arial,helvetica,sans-serif;
41
+ font-size: 12px;
42
+ font-weight: bold;
43
+ padding: 4px;
44
+ text-align: center;
45
  }
46
  </style>
47
  <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
59
  {
60
  /* single columns */
61
  case 'quarter':
62
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
63
  break;
64
  case 'half':
65
+ colTxt += '[ezcol_1half id="" class="" style=""]Half Column[/ezcol_1half] ';
66
  break;
67
  case 'threequarter':
68
+ colTxt += '[ezcol_3quarter id="" class="" style=""]Three Quarter Column[/ezcol_3quarter] ';
69
  break;
70
  case 'third':
71
+ colTxt += '[ezcol_1third id="" class="" style=""]Third Column[/ezcol_1third] ';
72
  break;
73
  case 'twothirds':
74
+ colTxt += '[ezcol_2third id="" class="" style=""]Two Thirds Column[/ezcol_2third] ';
75
  break;
76
  case 'onefifth':
77
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
78
  break;
79
  case 'twofifths':
80
+ colTxt += '[ezcol_2fifth id="" class="" style=""]Two Fifths Column[/ezcol_2fifth] ';
81
  break;
82
  case 'threefifths':
83
+ colTxt += '[ezcol_3fifth id="" class="" style=""]Three Fifths Column[/ezcol_3fifth] ';
84
  break;
85
  case 'fourfifths':
86
+ colTxt += '[ezcol_4fifth id="" class="" style=""]Four Fifths Column[/ezcol_4fifth] ';
87
  break;
88
 
89
  /* 1/3, 2/3 */
90
  case '3third':
91
+ colTxt += '[ezcol_1third id="" class="" style=""]Third Column[/ezcol_1third] ';
92
+ colTxt += '[ezcol_1third id="" class="" style=""]Third Column[/ezcol_1third] ';
93
+ colTxt += '[ezcol_1third_end id="" class="" style=""]Third Column[/ezcol_1third_end] ';
94
  break;
95
  case '1third2third':
96
+ colTxt += '[ezcol_1third id="" class="" style=""]Third Column[/ezcol_1third] ';
97
+ colTxt += '[ezcol_2third_end id="" class="" style=""]Two Thirds Column[/ezcol_2third_end] ';
98
  break;
99
  case '2third1third':
100
+ colTxt += '[ezcol_2third id="" class="" style=""]Two Thirds Column[/ezcol_2third] ';
101
+ colTxt += '[ezcol_1third_end id="" class="" style=""]Third Column[/ezcol_1third_end] ';
102
  break;
103
 
104
  /* 1/4, 1/2, 3/4 */
105
  case '4quarter':
106
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
107
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
108
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
109
+ colTxt += '[ezcol_1quarter_end id="" class="" style=""]Quarter Column[/ezcol_1quarter_end] ';
110
  break;
111
  case '1half2quarter':
112
+ colTxt += '[ezcol_1half id="" class="" style=""]Half Column[/ezcol_1half] ';
113
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
114
+ colTxt += '[ezcol_1quarter_end id="" class="" style=""]Quarter Column[/ezcol_1quarter_end] ';
115
  break;
116
  case 'quarterhalfquarter':
117
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
118
+ colTxt += '[ezcol_1half id="" class="" style=""]Half Column[/ezcol_1half] ';
119
+ colTxt += '[ezcol_1quarter_end id="" class="" style=""]Quarter Column[/ezcol_1quarter_end] ';
120
  break;
121
  case '2quarter1half':
122
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
123
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
124
+ colTxt += '[ezcol_1half_end id="" class="" style=""]Half Column[/ezcol_1half_end] ';
125
  break;
126
  case '2half':
127
+ colTxt += '[ezcol_1half id="" class="" style=""]Half Column[/ezcol_1half] ';
128
+ colTxt += '[ezcol_1half_end id="" class="" style=""]Half Column[/ezcol_1half_end] ';
129
  break;
130
  case '1quarter3quarter':
131
+ colTxt += '[ezcol_1quarter id="" class="" style=""]Quarter Column[/ezcol_1quarter] ';
132
+ colTxt += '[ezcol_3quarter_end id="" class="" style=""]Three Quarter Column[/ezcol_3quarter_end] ';
133
  break;
134
  case '3quarter1quarter':
135
+ colTxt += '[ezcol_3quarter id="" class="" style=""]Three Quarter Column[/ezcol_3quarter] ';
136
+ colTxt += '[ezcol_1quarter_end id="" class="" style=""]Quarter Column[/ezcol_1quarter_end] ';
137
  break;
138
 
139
  /* 1/5, 2/5, 3/5, 4/5 */
140
  case '5fifth':
141
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
142
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
143
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
144
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
145
+ colTxt += '[ezcol_1fifth_end id="" class="" style=""]One Fifth Column[/ezcol_1fifth_end] ';
146
  break;
147
  case '2fifth31fifth':
148
+ colTxt += '[ezcol_2fifth id="" class="" style=""]Two Fifths Column[/ezcol_2fifth] ';
149
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
150
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
151
+ colTxt += '[ezcol_1fifth_end id="" class="" style=""]One Fifth Column[/ezcol_1fifth_end] ';
152
  break;
153
  case '1fifth2fifth21fifth':
154
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
155
+ colTxt += '[ezcol_2fifth id="" class="" style=""]Two Fifths Column[/ezcol_2fifth] ';
156
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
157
+ colTxt += '[ezcol_1fifth_end id="" class="" style=""]One Fifth Column[/ezcol_1fifth_end] ';
158
  break;
159
  case '21fifth2fifth1fifth':
160
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
161
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
162
+ colTxt += '[ezcol_2fifth id="" class="" style=""]Two Fifths Column[/ezcol_2fifth] ';
163
+ colTxt += '[ezcol_1fifth_end id="" class="" style=""]One Fifth Column[/ezcol_1fifth_end] ';
164
  break;
165
  case '31fifth2fifth':
166
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
167
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
168
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
169
+ colTxt += '[ezcol_2fifth_end id="" class="" style=""]Two Fifths Column[/ezcol_2fifth_end] ';
170
  break;
171
  case '3fifth21fifth':
172
+ colTxt += '[ezcol_3fifth id="" class="" style=""]Three Fifths Column[/ezcol_3fifth] ';
173
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
174
+ colTxt += '[ezcol_1fifth_end id="" class="" style=""]One Fifth Column[/ezcol_1fifth_end] ';
175
  break;
176
  case '1fifth3fifth1fifth':
177
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
178
+ colTxt += '[ezcol_3fifth id="" class="" style=""]Three Fifths Column[/ezcol_3fifth] ';
179
+ colTxt += '[ezcol_1fifth_end id="" class="" style=""]One Fifth Column[/ezcol_1fifth_end] ';
180
  break;
181
  case '21fifth3fifth':
182
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
183
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
184
+ colTxt += '[ezcol_3fifth_end id="" class="" style=""]Three Fifths Column[/ezcol_3fifth_end] ';
185
  break;
186
  case '2fifth3fifth':
187
+ colTxt += '[ezcol_2fifth id="" class="" style=""]Two Fifths Column[/ezcol_2fifth] ';
188
+ colTxt += '[ezcol_3fifth_end id="" class="" style=""]Three Fifths Column[/ezcol_3fifth_end] ';
189
  break;
190
  case '3fifth2fifth':
191
+ colTxt += '[ezcol_3fifth id="" class="" style=""]Three Fifths Column[/ezcol_3fifth] ';
192
+ colTxt += '[ezcol_2fifth_end id="" class="" style=""]Two Fifths Column[/ezcol_2fifth_end] ';
193
  break;
194
  case '1fifth4fifth':
195
+ colTxt += '[ezcol_1fifth id="" class="" style=""]One Fifth Column[/ezcol_1fifth] ';
196
+ colTxt += '[ezcol_4fifth_end id="" class="" style=""]Four Fifths Column[/ezcol_4fifth_end] ';
197
  break;
198
  case '4fifth1fifth':
199
+ colTxt += '[ezcol_4fifth id="" class="" style=""]Four Fifths Column[/ezcol_4fifth] ';
200
+ colTxt += '[ezcol_1fifth_end id="" class="" style=""]One Fifth Column[/ezcol_1fifth_end] ';
201
  break;
202
  }
203
  insertText();
214
  divID = document.getElementById('txtID').value;
215
  divClass = document.getElementById('txtClass').value;
216
  divStyle = document.getElementById('txtStyle').value;
217
+ colTxt += '[ezdiv id="';
218
  if(divID != ''){
219
  colTxt += divID;
220
  }
226
  if(divStyle != ''){
227
  colTxt += divStyle;
228
  }
229
+ colTxt += '"]Custom Div[/ezdiv] ';
230
  insertText();
231
  }
232
 
237
  switch(classType)
238
  {
239
  case 'left':
240
+ colTxt += '[ezcol_end_left]';
241
  break;
242
  case 'right':
243
+ colTxt += '[ezcol_end_right]';
244
  break;
245
  case 'both':
246
+ colTxt += '[ezcol_end_both]';
247
  break;
248
  case 'divider':
249
+ colTxt += '[ezcol_divider]';
250
  break;
251
  }
252
  insertText();
290
 
291
  <div class="panel">
292
 
293
+ <table border="0" cellpadding="3" cellspacing="0" width="100%">
294
  <tr>
295
  <td class="hdrRow" colspan="3">
296
  <h3>Insert Column Combinations</h3>
297
  </td>
298
  </tr>
299
  </table>
300
+
301
  <!-- column combinations -->
302
  <table cellspacing="0" cellpadding="0" border="0">
303
  <tr>
306
  <strong>1/3, 2/3, 3/3</strong><br />
307
  <table cellspacing="3" cellpadding="0" border="0" class="colPicker">
308
  <tr onclick="insertColumns('3third')">
309
+ <td width="33.333%">1/3</td>
310
+ <td width="33.333%">1/3</td>
311
+ <td width="33.333%">1/3</td>
312
  </tr>
313
  <tr onclick="insertColumns('1third2third')">
314
+ <td width="33.333%">1/3</td>
315
  <td colspan="2">2/3</td>
316
  </tr>
317
  <tr onclick="insertColumns('2third1third')">
318
+ <td width="33.333%" colspan="2">2/3</td>
319
+ <td width="33.333%">1/3</td>
320
  </tr>
321
  </table>
322