1 | <?php
|
---|
2 |
|
---|
3 | load_plugin_textdomain('xpressme', 'wp-content/plugins/xpressme/language');
|
---|
4 |
|
---|
5 | class XPressME_Class{
|
---|
6 | var $pluginName = 'xpressme';
|
---|
7 | var $is_use_xoops_upload_path;
|
---|
8 | var $is_theme_sidebar_disp;
|
---|
9 | var $is_save_post_revision;
|
---|
10 | var $is_postnavi_title_disp;
|
---|
11 | var $is_left_postnavi_old;
|
---|
12 | var $old_post_link_text;
|
---|
13 | var $newer_post_link_text;
|
---|
14 | var $is_left_page_navi_old;
|
---|
15 | var $old_page_link_text;
|
---|
16 | var $newer_page_link_text;
|
---|
17 | var $is_author_view_count;
|
---|
18 | var $is_sql_debug;
|
---|
19 | var $groupe_role;
|
---|
20 | var $is_use_d3forum;
|
---|
21 | var $d3forum_module_dir;
|
---|
22 | var $d3forum_forum_id;
|
---|
23 | var $d3forum_external_link_format;
|
---|
24 | var $is_content_excerpt;
|
---|
25 | var $ascii_judged_rate;
|
---|
26 | var $excerpt_length_word;
|
---|
27 | var $excerpt_length_character;
|
---|
28 | var $excerpt_more_link_text;
|
---|
29 | var $more_link_text;
|
---|
30 | var $viewer_type;
|
---|
31 | var $is_multi_user;
|
---|
32 | var $meta_keyword_type;
|
---|
33 | var $meta_description_type;
|
---|
34 | var $meta_robot_type;
|
---|
35 | var $is_dashboard_blog_disp;
|
---|
36 | var $is_dashboard_forum_disp;
|
---|
37 | var $theme_select;
|
---|
38 | //constructor
|
---|
39 | function XPressME_Class()
|
---|
40 | {
|
---|
41 | global $xoops_db;
|
---|
42 |
|
---|
43 | $this->setdefault(); //not setting propaty load
|
---|
44 | $this->SettingValueRead();
|
---|
45 | }
|
---|
46 |
|
---|
47 | //Set Default Value
|
---|
48 | function setDefault()
|
---|
49 | {
|
---|
50 | global $xoops_config;
|
---|
51 | if($xoops_config->is_wpmu)
|
---|
52 | $this->is_use_xoops_upload_path = false;
|
---|
53 | else
|
---|
54 | $this->is_use_xoops_upload_path = true;
|
---|
55 | $this->is_use_xoops_upload_path = true;
|
---|
56 | $this->is_theme_sidebar_disp = false;
|
---|
57 | $this->is_save_post_revision = true;
|
---|
58 | $this->is_postnavi_title_disp = true;
|
---|
59 | $this->is_left_postnavi_old = true;
|
---|
60 | $this->old_post_link_text = __('Older Post', 'xpressme');
|
---|
61 | $this->newer_post_link_text = __('Newer Post', 'xpressme');
|
---|
62 | $this->is_left_page_navi_old = true;
|
---|
63 | $this->old_page_link_text = __('Older Entries', 'xpressme');
|
---|
64 | $this->newer_page_link_text = __('Newer Entries', 'xpressme');
|
---|
65 | $this->is_author_view_count = false;
|
---|
66 | $this->is_sql_debug = false;
|
---|
67 | $this->is_use_d3forum = false;
|
---|
68 | $this->d3forum_module_dir = '';
|
---|
69 | $this->d3forum_forum_id = '';
|
---|
70 | $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent';
|
---|
71 | $this->is_d3forum_flat = true;
|
---|
72 | $this->is_d3forum_desc = true;
|
---|
73 | $this->d3forum_views_num = 10;
|
---|
74 | $this->is_content_excerpt = true;
|
---|
75 | $this->ascii_judged_rate = 90;
|
---|
76 | $this->excerpt_length_word = 40;
|
---|
77 | $this->excerpt_length_character = 120;
|
---|
78 | $this->excerpt_more_link_text = __('Read the rest of this entry »', 'xpressme');
|
---|
79 | $this->more_link_text = __('Read the rest of this entry »', 'xpressme');
|
---|
80 | $this->viewer_type = 'xoops';
|
---|
81 | $this->is_multi_user = false;
|
---|
82 | $this->meta_keyword_type = 'xoops';
|
---|
83 | $this->meta_description_type = 'xoops';
|
---|
84 | $this->meta_robot_type = 'xoops';
|
---|
85 | $this->is_dashboard_blog_disp = true;
|
---|
86 | $this->is_dashboard_forum_disp = true;
|
---|
87 | $this->theme_select = 'use_wordpress_select';
|
---|
88 | }
|
---|
89 |
|
---|
90 | function SettingValueRead()
|
---|
91 | {
|
---|
92 | global $xoops_db;
|
---|
93 | $options = get_option('xpressme_option');
|
---|
94 | if (!$options) {
|
---|
95 | $this->setDefault();
|
---|
96 | $this->SettingValueWrite('add_new');
|
---|
97 | } else {
|
---|
98 | foreach ($options as $option_name => $option_value){
|
---|
99 | $this-> {$option_name} = $option_value;
|
---|
100 | }
|
---|
101 | }
|
---|
102 | if (!empty($xoops_db)) // at install trap
|
---|
103 | $this->GroupeRoleRead();
|
---|
104 | }
|
---|
105 |
|
---|
106 | // mode 0:add 1:update
|
---|
107 | function SettingValueWrite($mode)
|
---|
108 | {
|
---|
109 | global $xoops_config;
|
---|
110 | if($xoops_config->is_wpmu) $this->is_use_xoops_upload_path = false;
|
---|
111 |
|
---|
112 | $write_options = array (
|
---|
113 | 'is_use_xoops_upload_path' => $this->is_use_xoops_upload_path ,
|
---|
114 | 'is_theme_sidebar_disp' => $this->is_theme_sidebar_disp ,
|
---|
115 | 'is_save_post_revision' => $this->is_save_post_revision ,
|
---|
116 | 'is_postnavi_title_disp' => $this->is_postnavi_title_disp ,
|
---|
117 | 'is_left_postnavi_old' => $this->is_left_postnavi_old ,
|
---|
118 | 'old_post_link_text' => $this->old_post_link_text ,
|
---|
119 | 'newer_post_link_text' => $this->newer_post_link_text,
|
---|
120 | 'is_left_page_navi_old' => $this->is_left_page_navi_old ,
|
---|
121 | 'old_page_link_text' => $this->old_page_link_text ,
|
---|
122 | 'newer_page_link_text' => $this->newer_page_link_text,
|
---|
123 | 'is_author_view_count' => $this->is_author_view_count,
|
---|
124 | 'is_sql_debug' => $this->is_sql_debug,
|
---|
125 | 'is_use_d3forum' => $this->is_use_d3forum,
|
---|
126 | 'd3forum_module_dir' => $this->d3forum_module_dir,
|
---|
127 | 'd3forum_forum_id' => $this->d3forum_forum_id,
|
---|
128 | 'd3forum_external_link_format' => $this->d3forum_external_link_format,
|
---|
129 | 'is_d3forum_flat' => $this->is_d3forum_flat,
|
---|
130 | 'is_d3forum_desc' => $this->is_d3forum_desc,
|
---|
131 | 'd3forum_views_num' =>$this->d3forum_views_num,
|
---|
132 | 'is_content_excerpt' => $this->is_content_excerpt,
|
---|
133 | 'ascii_judged_rate' => $this->ascii_judged_rate,
|
---|
134 | 'excerpt_length_word' => $this->excerpt_length_word,
|
---|
135 | 'excerpt_length_character' => $this->excerpt_length_character,
|
---|
136 | 'excerpt_more_link_text' => $this->excerpt_more_link_text,
|
---|
137 | 'more_link_text' => $this->more_link_text,
|
---|
138 | 'viewer_type' => $this->viewer_type,
|
---|
139 | 'is_multi_user' => $this->is_multi_user,
|
---|
140 | 'meta_keyword_type' => $this->meta_keyword_type,
|
---|
141 | 'meta_description_type' => $this->meta_description_type,
|
---|
142 | 'meta_robot_type' => $this->meta_robot_type,
|
---|
143 | 'is_dashboard_blog_disp' => $this->is_dashboard_blog_disp,
|
---|
144 | 'is_dashboard_forum_disp' => $this->is_dashboard_forum_disp,
|
---|
145 | 'theme_select' => $this->theme_select
|
---|
146 | );
|
---|
147 | if ($mode == 'add_new') {
|
---|
148 | add_option('xpressme_option', $write_options);
|
---|
149 | } else {
|
---|
150 | update_option("xpressme_option", $write_options);
|
---|
151 | }
|
---|
152 | }
|
---|
153 |
|
---|
154 | function GroupeRoleRead() {
|
---|
155 | global $xoops_db;
|
---|
156 |
|
---|
157 | // table sync
|
---|
158 | $table = get_wp_prefix() . 'group_role';
|
---|
159 | $xoops_group = get_xoops_prefix() . 'groups';
|
---|
160 | $xoops_group_permission = get_xoops_prefix() . 'group_permission';
|
---|
161 |
|
---|
162 | $module_id = get_xpress_modid();
|
---|
163 |
|
---|
164 | $sql= "SELECT * FROM $table";
|
---|
165 | $before_groupes = $xoops_db->get_results($sql);
|
---|
166 |
|
---|
167 | $sql = "DELETE FROM $table";
|
---|
168 | $xoops_db->query($sql);
|
---|
169 |
|
---|
170 | $sql = "SELECT * FROM $xoops_group_permission WHERE gperm_itemid = $module_id";
|
---|
171 | $gperms = $xoops_db->get_results($sql);
|
---|
172 |
|
---|
173 | $sql = "SELECT * FROM $xoops_group WHERE group_type <> 'Anonymous'";
|
---|
174 | $groupes = $xoops_db->get_results($sql);
|
---|
175 | $insert_sql = '';
|
---|
176 | foreach ($groupes as $groupe) {
|
---|
177 | $parmsql = "SELECT * FROM $xoops_group_permission WHERE gperm_itemid = $module_id AND gperm_groupid = $groupe->groupid";
|
---|
178 | $gperms = $xoops_db->get_results($parmsql);
|
---|
179 | $parmission = '';
|
---|
180 | foreach ($gperms as $gperm) {
|
---|
181 | $parmission = $gperm->gperm_name;
|
---|
182 | if ($parmission == 'module_admin') break;
|
---|
183 | }
|
---|
184 |
|
---|
185 | if (!empty($parmission)){
|
---|
186 | $role = '';
|
---|
187 | foreach ($before_groupes as $before_groupe) {
|
---|
188 | if ($groupe->groupid == $before_groupe->groupid) {
|
---|
189 | $role = $before_groupe->role;
|
---|
190 | $login_all = $before_groupe->login_all;
|
---|
191 | }
|
---|
192 | }
|
---|
193 | if ($parmission == 'module_admin') $role = 'administrator';
|
---|
194 |
|
---|
195 | $insert_sql = "INSERT INTO $table ";
|
---|
196 | $insert_sql .= "(groupid , name , description , group_type , role , login_all) ";
|
---|
197 | $insert_sql .= "VALUES (";
|
---|
198 | $insert_sql .= $groupe->groupid . ', ';
|
---|
199 | $insert_sql .= "'" . $groupe->name . "' , ";
|
---|
200 | $insert_sql .= "'" . $groupe->description . "' , ";
|
---|
201 | $insert_sql .= "'" . $parmission . "' , ";
|
---|
202 | $insert_sql .= "'" . $role . "' , '";
|
---|
203 | $insert_sql .= $login_all . "')";
|
---|
204 | $xoops_db->query($insert_sql);
|
---|
205 | }
|
---|
206 | }
|
---|
207 |
|
---|
208 | $sql= "SELECT * FROM $table";
|
---|
209 |
|
---|
210 | $this->groupe_role = $xoops_db->get_results($sql);
|
---|
211 | $sql= "SELECT * FROM $table";
|
---|
212 | }
|
---|
213 |
|
---|
214 | function ReadPostData($post_data = null)
|
---|
215 | {
|
---|
216 | global $xoops_db;
|
---|
217 |
|
---|
218 | foreach ( (array) $post_data as $index_key => $value ){
|
---|
219 | if (preg_match('/^ch_/',$index_key)){ // case ch_
|
---|
220 | $indedx = preg_replace('/^ch_/', '', $index_key);
|
---|
221 | $set_value = stripslashes(trim($value));
|
---|
222 | // post d3forum
|
---|
223 | if ($indedx === 'd3forum') {
|
---|
224 | if ($value == 'none'){
|
---|
225 | $this->is_use_d3forum = false;
|
---|
226 | $this->d3forum_module_dir = '';
|
---|
227 | $this->d3forum_forum_id = '';
|
---|
228 | $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent';
|
---|
229 | } else {
|
---|
230 | $d3f_set = explode('|', $value);
|
---|
231 | $this->is_use_d3forum = true;
|
---|
232 | $this->d3forum_module_dir = $d3f_set[1];
|
---|
233 | $this->d3forum_forum_id = $d3f_set[2];
|
---|
234 | $this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent';
|
---|
235 | }
|
---|
236 | } else { //post other
|
---|
237 | if(empty($set_value)){
|
---|
238 | switch ($indedx) {
|
---|
239 | case 'old_post_link_text':
|
---|
240 | $set_value = __('Older Post', 'xpressme');
|
---|
241 | break;
|
---|
242 | case 'newer_post_link_text':
|
---|
243 | $set_value = __('Newer Post', 'xpressme');
|
---|
244 | break;
|
---|
245 | case 'old_page_link_text':
|
---|
246 | $set_value = __('Older Entries', 'xpressme');
|
---|
247 | break;
|
---|
248 | case 'newer_page_link_text':
|
---|
249 | $set_value = __('Newer Entries', 'xpressme');
|
---|
250 | break;
|
---|
251 | case 'excerpt_more_link_text':
|
---|
252 | $set_value = __('Read the rest of this entry »', 'xpressme');
|
---|
253 | break;
|
---|
254 | case 'theme_select':
|
---|
255 | $set_value = 'use_wordpress_select';
|
---|
256 | break;
|
---|
257 |
|
---|
258 | default:
|
---|
259 | }
|
---|
260 | }
|
---|
261 | $this->$indedx = $value;
|
---|
262 | }
|
---|
263 | } // end of case 'ch_'
|
---|
264 | } // end of loop
|
---|
265 |
|
---|
266 | global $xoops_config;
|
---|
267 | if($xoops_config->is_wpmu) $this->is_use_xoops_upload_path = false;
|
---|
268 |
|
---|
269 | $table = get_wp_prefix() . 'group_role';
|
---|
270 | // $sql= "SELECT * FROM $table";
|
---|
271 | // $this->groupe_role = $xoops_db->get_results($sql); // before Read
|
---|
272 |
|
---|
273 | foreach ($this->groupe_role as $groupe) {
|
---|
274 | $post_role_gid = 'role_gid_' . $groupe->groupid;
|
---|
275 | $login_all_gid = 'login_all_gid_' . $groupe->groupid;
|
---|
276 | if (isset($post_data[$post_role_gid])){
|
---|
277 | $role = stripslashes(trim($post_data[$post_role_gid]));
|
---|
278 | $login_all = stripslashes(trim($post_data[$login_all_gid]));
|
---|
279 | if (empty($login_all)) $login_all = '0';
|
---|
280 | $groupe->role = $role;
|
---|
281 | $groupe->login_all = $login_all;
|
---|
282 | $update_sql = "UPDATE $table ";
|
---|
283 | $update_sql .= 'SET ';
|
---|
284 | $update_sql .= "role = '$role' , ";
|
---|
285 | $update_sql .= "login_all = $login_all ";
|
---|
286 | $update_sql .= "WHERE (groupid = '$groupe->groupid' )";
|
---|
287 | $xoops_db->query($update_sql);
|
---|
288 | }
|
---|
289 | }
|
---|
290 | }
|
---|
291 |
|
---|
292 | function yes_no_radio_option($option_name,$option_desc,$yes = '',$no= '' , $disible=false){
|
---|
293 | if (empty( $yes )) $yes = __('YES','xpressme') ;
|
---|
294 | if (empty( $no )) $no = __('NO','xpressme') ;
|
---|
295 | $value = $this->{$option_name};
|
---|
296 | $ans_name = 'ch_' . $option_name;
|
---|
297 |
|
---|
298 | $form = "<tr>\n";
|
---|
299 | $form .= '<th><label for="images_to_link">' . $option_desc . "</label></th>\n";
|
---|
300 | $form .= "<td>\n";
|
---|
301 | $form .= $this->yes_no_radio_option_sub($option_name,$yes,$no,$disible);
|
---|
302 | $form .= "</td>\n";
|
---|
303 | $form .= "</tr>\n";
|
---|
304 |
|
---|
305 | return $form;
|
---|
306 |
|
---|
307 | }
|
---|
308 | function yes_no_radio_option_sub($option_name,$yes = '',$no= '',$disible=false){
|
---|
309 | if ($disible) $disible_str = ' disabled="disabled"'; else $disible_str = '';
|
---|
310 |
|
---|
311 | if (empty( $yes )) $yes = __('YES','xpressme') ;
|
---|
312 | if (empty( $no )) $no = __('NO','xpressme') ;
|
---|
313 | $value = $this->{$option_name};
|
---|
314 | $ans_name = 'ch_' . $option_name;
|
---|
315 | if ($value){
|
---|
316 | $form .= "<label><input type='radio' name='". $ans_name . "' value='1' checked='checked' $disible_str />" . $yes ."</label><br />\n";
|
---|
317 | $form .= "<label><input type='radio' name='". $ans_name . "' value='0' $disible_str />". $no . "</label>\n";
|
---|
318 | }else{
|
---|
319 | $form .= "<label><input type='radio' name='". $ans_name . "' value='1' $disible_str />" . $yes . "</label><br />\n";
|
---|
320 | $form .= "<label><input type='radio' name='". $ans_name . "' value='0' checked='checked' $disible_str />". $no ."</label>\n";
|
---|
321 | }
|
---|
322 | return $form;
|
---|
323 | }
|
---|
324 |
|
---|
325 |
|
---|
326 | function text_option($option_name,$option_desc){
|
---|
327 | $value = $this->{$option_name};
|
---|
328 | $ans_name = 'ch_' . $option_name;
|
---|
329 |
|
---|
330 | $form = "<tr>\n";
|
---|
331 | $form .= '<th><label for="images_to_link">' . $option_desc . "</label></th>\n";
|
---|
332 | $form .= "<td>\n";
|
---|
333 | $form .= $this->text_option_sub($option_name);
|
---|
334 | $form .= "</td>\n";
|
---|
335 | $form .= "</tr>\n";
|
---|
336 |
|
---|
337 | return $form;
|
---|
338 |
|
---|
339 | }
|
---|
340 |
|
---|
341 | function text_option_sub($option_name){
|
---|
342 | $value = $this->{$option_name};
|
---|
343 | $ans_name = 'ch_' . $option_name;
|
---|
344 |
|
---|
345 | $form = '<label> <input name="'. $ans_name . '" type="text" size="25" maxlength="50" value="' . $value . '" /></label>'."\n";
|
---|
346 | return $form;
|
---|
347 |
|
---|
348 | }
|
---|
349 |
|
---|
350 |
|
---|
351 | function single_post_navi_option(){
|
---|
352 | $form = '';
|
---|
353 | $form .= '<tr><th><label for="single_page_navi">' .__('Single Post Navi Setting', 'xpressme') . '</label></th>';
|
---|
354 | $form .= "<td>\n";
|
---|
355 | $form .= "<table>\n";
|
---|
356 | $form .= "<tr>\n";
|
---|
357 |
|
---|
358 | $form .= "<td>" . __('Adjustment of Navi link display position','xpressme') . "</td>\n";
|
---|
359 | $form .= "<td>\n";
|
---|
360 | $form .= $this->yes_no_radio_option_sub('is_left_postnavi_old',
|
---|
361 | __("'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right",'xpressme'),
|
---|
362 | __("'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right",'xpressme')
|
---|
363 | );
|
---|
364 | $form .= "</td>\n";
|
---|
365 | $form .= "</tr>\n";
|
---|
366 |
|
---|
367 | $form .= "<tr>\n";
|
---|
368 | $form .= "<td>" . __('Select Display name of PostNavi Link','xpressme') . "</td>\n";
|
---|
369 | $form .= "<td>\n";
|
---|
370 | $form .= $this->yes_no_radio_option_sub('is_postnavi_title_disp',
|
---|
371 | __('Title of post','xpressme'),
|
---|
372 | __('Title of Navi','xpressme')
|
---|
373 | );
|
---|
374 | $form .= "</td>\n";
|
---|
375 | $form .= "</tr>\n";
|
---|
376 |
|
---|
377 | $form .= "<tr>\n";
|
---|
378 | $form .= "<td>" . __('Display Navi Title of Old Post Link','xpressme') . "</td>\n";
|
---|
379 | $form .= "<td>\n";
|
---|
380 | $form .= $this->text_option_sub('old_post_link_text');
|
---|
381 | $form .= "</td>\n";
|
---|
382 | $form .= "</tr>\n";
|
---|
383 |
|
---|
384 | $form .= "<tr>\n";
|
---|
385 | $form .= "<td>" . __('Display Navi Title of Newer Post Link','xpressme') . "</td>\n";
|
---|
386 | $form .= "<td>\n";
|
---|
387 | $form .= $this->text_option_sub('newer_post_link_text');
|
---|
388 | $form .= "</td>\n";
|
---|
389 | $form .= "</tr>\n";
|
---|
390 |
|
---|
391 | $form .= "</table></td></tr>\n";
|
---|
392 | return $form;
|
---|
393 |
|
---|
394 | }
|
---|
395 |
|
---|
396 | function posts_page_navi_option(){
|
---|
397 | $form = '';
|
---|
398 | $form .= '<tr><th><label for="posts_page_navi">' .__('Posts List Page Navi Setting', 'xpressme') . '</label></th>';
|
---|
399 | $form .= "<td>\n";
|
---|
400 | $form .= "<table>\n";
|
---|
401 | $form .= "<tr>\n";
|
---|
402 |
|
---|
403 | $form .= "<td>" . __('Adjustment of Navi link display position','xpressme') . "</td>\n";
|
---|
404 | $form .= "<td>\n";
|
---|
405 | $form .= $this->yes_no_radio_option_sub('is_left_page_navi_old',
|
---|
406 | __("'Old Page Link' is displayed in the left, and 'Newer Page Link' is displayed in the right",'xpressme'),
|
---|
407 | __("'Newer Page Link' is displayed in the left, and 'Old Page Link' is displayed in the right",'xpressme')
|
---|
408 | );
|
---|
409 | $form .= "</td>\n";
|
---|
410 | $form .= "</tr>\n";
|
---|
411 |
|
---|
412 | $form .= "<tr>\n";
|
---|
413 | $form .= "<td>" . __('Display Navi Title of Old Page Link','xpressme') . "</td>\n";
|
---|
414 | $form .= "<td>\n";
|
---|
415 | $form .= $this->text_option_sub('old_page_link_text');
|
---|
416 | $form .= "</td>\n";
|
---|
417 | $form .= "</tr>\n";
|
---|
418 |
|
---|
419 | $form .= "<tr>\n";
|
---|
420 | $form .= "<td>" . __('Display Navi Title of Newer Page Link','xpressme') . "</td>\n";
|
---|
421 | $form .= "<td>\n";
|
---|
422 | $form .= $this->text_option_sub('newer_page_link_text');
|
---|
423 | $form .= "</td>\n";
|
---|
424 | $form .= "</tr>\n";
|
---|
425 |
|
---|
426 | $form .= "</table></td></tr>\n";
|
---|
427 | return $form;
|
---|
428 |
|
---|
429 | }
|
---|
430 |
|
---|
431 | function dashboard_display_option(){
|
---|
432 | $form = '';
|
---|
433 | $form .= '<tr><th><label for="posts_page_navi">' .__('Dashboard feed Display Setting', 'xpressme') . '</label></th>';
|
---|
434 | $form .= "<td>\n";
|
---|
435 | $form .= "<table>\n";
|
---|
436 |
|
---|
437 | $form .= "<tr>\n";
|
---|
438 |
|
---|
439 | $form .= "<td>" . __('Display XPressMe Integration Kit Blog','xpressme') . "</td>\n";
|
---|
440 | $form .= "<td>\n";
|
---|
441 | $form .= $this->yes_no_radio_option_sub('is_dashboard_blog_disp',
|
---|
442 | __('YES','xpressme'),
|
---|
443 | __('NO','xpressme')
|
---|
444 | );
|
---|
445 | $form .= "</td>\n";
|
---|
446 | $form .= "</tr>\n";
|
---|
447 |
|
---|
448 | $form .= "<tr>\n";
|
---|
449 |
|
---|
450 | $form .= "<td>" . __('Display XPressMe Integration Kit Forum','xpressme') . "</td>\n";
|
---|
451 | $form .= "<td>\n";
|
---|
452 | $form .= $this->yes_no_radio_option_sub('is_dashboard_forum_disp',
|
---|
453 | __('YES','xpressme'),
|
---|
454 | __('NO','xpressme')
|
---|
455 | );
|
---|
456 | $form .= "</td>\n";
|
---|
457 | $form .= "</tr>\n";
|
---|
458 |
|
---|
459 | $form .= "</table></td></tr>\n";
|
---|
460 | return $form;
|
---|
461 | }
|
---|
462 |
|
---|
463 | function groupe_role_option($disible=false){
|
---|
464 | global $wp_roles , $xoops_db;
|
---|
465 |
|
---|
466 | if ($disible) $disible_str = ' disabled="disabled"'; else $disible_str = '';
|
---|
467 | $form = '';
|
---|
468 | $form .= '<tr><th><label for="role">' .__('Role Setting at Login', 'xpressme') . '</label></th>';
|
---|
469 | $form .= '<td>';
|
---|
470 | $form .= "<table>\n";
|
---|
471 | $form .= '<tr><td>' . __('XOOPS Groupe', 'xpressme') . '</td><td>' . __('WordPress Role', 'xpressme') . '</td><td>' . __('Role is set at each login', 'xpressme') . "</td></tr>\n";
|
---|
472 | foreach ($this->groupe_role as $groupe) {
|
---|
473 | $form .= "<tr>";
|
---|
474 | $form .= "<td> $groupe->name </td>";
|
---|
475 | $form .= "<td>\n" . '<select name="role_gid_'.$groupe->groupid . '" id="role_gid_' . $groupe->groupid . '"' . $disible_str . '>' . "\n";;
|
---|
476 | $role_list = '';
|
---|
477 | $group_has_role = false;
|
---|
478 |
|
---|
479 | $select_value = $groupe->role;
|
---|
480 |
|
---|
481 |
|
---|
482 |
|
---|
483 | foreach($wp_roles->role_names as $role => $name) {
|
---|
484 | $name = translate_with_context($name);
|
---|
485 | if ( $role == $select_value) {
|
---|
486 | $selected = ' selected="selected"';
|
---|
487 | $group_has_role = true;
|
---|
488 | } else {
|
---|
489 | $selected = '';
|
---|
490 | }
|
---|
491 | if ($groupe->group_type != 'module_admin'|| !empty($selected)) {
|
---|
492 | $role_list .= "<option value=\"{$role}\"{$selected}>{$name}</option>\n";
|
---|
493 | }
|
---|
494 | }
|
---|
495 | if ($groupe->group_type != 'module_admin') {
|
---|
496 | if ( $group_has_role ) {
|
---|
497 | $role_list .= '<option value="default">' . __('Default Role of WordPress', 'xpressme') . "</option>\n";
|
---|
498 | $role_list .= '<option value="">' . __('Group User Doesn\'t Register', 'xpressme') . "</option>\n";
|
---|
499 | } else {
|
---|
500 | if ($select_value == 'default'){
|
---|
501 | $role_list .= '<option value="default" selected="selected">' . __('Default Role of WordPress', 'xpressme') . "</option>\n";
|
---|
502 | $role_list .= '<option value="">' . __('Group User Doesn\'t Register', 'xpressme') . "</option>\n";
|
---|
503 | } else {
|
---|
504 | $role_list .= '<option value="default">' . __('Default Role of WordPress', 'xpressme') . "</option>\n";
|
---|
505 | $role_list .= '<option value="" selected="selected">' . __('Group User Doesn\'t Register', 'xpressme') . "</option>\n";
|
---|
506 | }
|
---|
507 | }
|
---|
508 | }
|
---|
509 | $form .= $role_list . "</select>\n</td>";
|
---|
510 | if ($groupe->login_all){
|
---|
511 | $form .= '<td> <input type="checkbox" name="login_all_gid_' . $groupe->groupid . '" value="1" checked ></td>';
|
---|
512 | } else {
|
---|
513 | $form .= '<td> <input type="checkbox" name="login_all_gid_' . $groupe->groupid . '" value="1"></td>';
|
---|
514 | }
|
---|
515 | $form .= "</tr>\n";
|
---|
516 | }
|
---|
517 | if ($disible)
|
---|
518 | $form .= '<tr><p>' . __('Only the Admin can set Group Role Setting','xpressme') . "</p></tr>\n";
|
---|
519 | $form .= "</table></td></tr>\n";
|
---|
520 | return $form;
|
---|
521 |
|
---|
522 | }
|
---|
523 |
|
---|
524 | function d3forum_option($do_message = ''){
|
---|
525 | global $xoops_db,$xoops_config;
|
---|
526 |
|
---|
527 | $d3frum_list = array();
|
---|
528 | $module_dir_path = get_xoops_root_path();
|
---|
529 |
|
---|
530 | $forum_list = '<select name="ch_d3forum">' . "\n";
|
---|
531 |
|
---|
532 | if ($this->is_use_d3forum != true)
|
---|
533 | $selected = ' selected="selected"';
|
---|
534 | else
|
---|
535 | $selected = '';
|
---|
536 |
|
---|
537 | if ($xoops_config->is_wpmu) {
|
---|
538 | $forum_list .= '<option value="none"' . $selected . '>' . __('WordPress MU cannot integrate the comments.', 'xpressme') . "</option>\n";
|
---|
539 | } else {
|
---|
540 | $forum_list .= '<option value="none"' . $selected . '>' . __('Do Not Comment Integration.', 'xpressme') . "</option>\n";
|
---|
541 |
|
---|
542 | // Form making for forum selection of D3forum
|
---|
543 | $modules_table = get_xoops_prefix() .'modules';
|
---|
544 | $sql = "SELECT mid,name,isactive,dirname FROM $modules_table WHERE isactive = 1";
|
---|
545 | $modules = $xoops_db->get_results($sql);
|
---|
546 | foreach ($modules as $module) {
|
---|
547 | $file_path = $module_dir_path . '/modules/' . $module->dirname . '/mytrustdirname.php';
|
---|
548 | if (! file_exists($file_path)) continue;
|
---|
549 | $array_files = file($file_path);
|
---|
550 | // It is checked whether there is character string "$mytrustdirname ='d3forum'"in the file.
|
---|
551 | foreach ($array_files as $aeey_file){
|
---|
552 | if( preg_match( "/\s*(mytrustdirname)\s*(=)\s*([\"'])(d3forum)([\"'])/", $aeey_file ) ) {
|
---|
553 | $forums_tb = get_xoops_prefix() . $module->dirname . '_forums';
|
---|
554 | $cat_tb = get_xoops_prefix() . $module->dirname . '_categories';
|
---|
555 | $sql= "SELECT * FROM $forums_tb LEFT JOIN $cat_tb ON $forums_tb.cat_id = $cat_tb.cat_id";
|
---|
556 | $forums = $xoops_db->get_results($sql);
|
---|
557 | foreach ($forums as $forum) {
|
---|
558 | if (($module->dirname == $this->d3forum_module_dir) && ($forum->forum_id == $this->d3forum_forum_id))
|
---|
559 | $selected = ' selected="selected"';
|
---|
560 | else
|
---|
561 | $selected = '';
|
---|
562 | $forum_div = 'forum|' . $module->dirname . '|' . $forum->forum_id;
|
---|
563 | $forum_select = "$module->name($module->dirname) $forum->cat_title-$forum->forum_title(ID=$forum->forum_id)";
|
---|
564 | $forum_list .= '<option value="' . $forum_div . '" ' . $selected . '>' . $forum_select . "</option>\n";
|
---|
565 | }
|
---|
566 | break;
|
---|
567 | }
|
---|
568 | }
|
---|
569 | $forum_list .= '<br>';
|
---|
570 | }
|
---|
571 | }
|
---|
572 | $forum_list .= '</select>' . "\n";
|
---|
573 |
|
---|
574 | $form = '<tr>' . "\n";
|
---|
575 | $form .= '<th><label for="d3forum">' .__('Comment integration with D3Forum', 'xpressme') . '</label></th>' . "\n";
|
---|
576 | $form .= "<td>\n";
|
---|
577 | $form .= __('Select the forum of D3Forum that does the comment integration from the following lists.', 'xpressme') ."<br />\n";
|
---|
578 | $form .= $forum_list."\n";
|
---|
579 | $form .= '<br /><br />';
|
---|
580 | if ($this->is_use_d3forum) {
|
---|
581 | if ($this->is_use_d3forum) $disible = ''; else $disible = 'disabled';
|
---|
582 | $form .= __('Select the Type of display of D3Forum comment.', 'xpressme') . " \n&emsp";
|
---|
583 | if ($this->is_d3forum_flat){
|
---|
584 | $form .= "&ensp<label><input type='radio' name='ch_is_d3forum_flat' value='1' checked='checked' />" . __('Flat','xpressme') ."</label>\n";
|
---|
585 | $form .= "&ensp<label><input type='radio' name='ch_is_d3forum_flat' value='0' />". __('Threaded','xpressme') . "</label>\n";
|
---|
586 | }else{
|
---|
587 | $form .= "&ensp<label><input type='radio' name='ch_is_d3forum_flat' value='1' />" . __('Flat','xpressme') . "</label>\n";
|
---|
588 | $form .= "&ensp<label><input type='radio' name='ch_is_d3forum_flat' value='0' checked='checked' />". __('Threaded','xpressme') ."</label>\n";
|
---|
589 | }
|
---|
590 | $form .= '<br />';
|
---|
591 | $form .= __('Select the order of display of D3Forum comment.', 'xpressme') . " \n&emsp";
|
---|
592 | if ($this->is_d3forum_desc){
|
---|
593 | $form .= "&ensp<label><input type='radio' name='ch_is_d3forum_desc' value='1' checked='checked' />" . __('DESC','xpressme') ."</label>\n";
|
---|
594 | $form .= "&ensp<label><input type='radio' name='ch_is_d3forum_desc' value='0' />". __('ASC','xpressme') . "</label>\n";
|
---|
595 | }else{
|
---|
596 | $form .= "&ensp<label><input type='radio' name='ch_is_d3forum_desc' value='1' />" . __('DESC','xpressme') . "</label>\n";
|
---|
597 | $form .= "&ensp<label><input type='radio' name='ch_is_d3forum_desc' value='0' checked='checked' />". __('ASC','xpressme') ."</label>\n";
|
---|
598 | }
|
---|
599 | $form .= '<br />';
|
---|
600 | $form .= __('Number of displays of D3Forum comments.', 'xpressme') ." \n";
|
---|
601 | $form .= '&emsp<label> <input name="ch_d3forum_views_num" type="text" size="3" maxlength="3" value="' . $this->d3forum_views_num . '" /></label>'."\n";
|
---|
602 | $form .= '<div class="submit">'."\n";
|
---|
603 | $form .= __('The import and the export between Wordpress Comments and the D3Forum Posts can be done. ', 'xpressme') ."<br />\n";
|
---|
604 | $form .= '<input type="submit" value= "' . __('Export to D3Forum', 'xpressme') . '" name="export_d3f" ' . $disible . ' >' ."\n";
|
---|
605 | $form .= '<input type="submit" value= "' . __('Import from D3Forum', 'xpressme') . '" name="inport_d3f" ' . $disible . ' >' ."<br />\n";
|
---|
606 | $form .= '</div>'."\n";
|
---|
607 | if (!empty($do_message)){
|
---|
608 | $form .= '<div>' . $do_message . '</div>';
|
---|
609 | }
|
---|
610 | }
|
---|
611 | $form .= "</td>\n";
|
---|
612 | $form .= "</tr><tr>\n";
|
---|
613 | return $form;
|
---|
614 | }
|
---|
615 |
|
---|
616 | function excerpt_option(){
|
---|
617 | $form = '';
|
---|
618 | $form .= '<tr><th><label for="excerpt">' .__('Contents Excerpt Setting', 'xpressme') . '</label></th>';
|
---|
619 | $form .= "<td>\n";
|
---|
620 | $form .= "<table>\n";
|
---|
621 | $form .= "<tr>\n";
|
---|
622 |
|
---|
623 | $form .= "<td>" . __('Is the excerpt display done with the archive of contents?','xpressme') . "</td>\n";
|
---|
624 | $form .= "<td>\n";
|
---|
625 | $form .= $this->yes_no_radio_option_sub('is_content_excerpt');
|
---|
626 | $form .= "</td>\n";
|
---|
627 | $form .= "</tr>\n";
|
---|
628 |
|
---|
629 | $form .= "<tr>\n";
|
---|
630 | $form .= "<td>" . __('When ASCII character more than the set ratio is included, it is judged ASCII contents. ','xpressme') . "</td>\n";
|
---|
631 | $form .= "<td>\n";
|
---|
632 | $form .= $this->text_option_sub('ascii_judged_rate');
|
---|
633 | $form .= "</td>\n";
|
---|
634 | $form .= "</tr>\n";
|
---|
635 |
|
---|
636 | $form .= "<tr>\n";
|
---|
637 | $form .= "<td>" . __('Excerpt length of word for ASCII contents','xpressme') . "</td>\n";
|
---|
638 | $form .= "<td>\n";
|
---|
639 | $form .= $this->text_option_sub('excerpt_length_word');
|
---|
640 | $form .= "</td>\n";
|
---|
641 | $form .= "</tr>\n";
|
---|
642 |
|
---|
643 | $form .= "<tr>\n";
|
---|
644 | $form .= "<td>" . __('Excerpt length of character for multibyte contents','xpressme') . "</td>\n";
|
---|
645 | $form .= "<td>\n";
|
---|
646 | $form .= $this->text_option_sub('excerpt_length_character');
|
---|
647 | $form .= "</td>\n";
|
---|
648 | $form .= "</tr>\n";
|
---|
649 |
|
---|
650 | $form .= "<tr>\n";
|
---|
651 | $form .= "<td>" . __('This text is displayed in the link that reads contents not excerpted.(Is not displayed for the blank.)','xpressme') . "</td>\n";
|
---|
652 | $form .= "<td>\n";
|
---|
653 | $form .= $this->text_option_sub('excerpt_more_link_text');
|
---|
654 | $form .= "</td>\n";
|
---|
655 | $form .= "</tr>\n";
|
---|
656 |
|
---|
657 | $form .= "<tr>\n";
|
---|
658 | $form .= "<td>" . __('This text is displayed in the link that more tag (<!--more-->). ','xpressme') . "</td>\n";
|
---|
659 | $form .= "<td>\n";
|
---|
660 | $form .= $this->text_option_sub('more_link_text');
|
---|
661 | $form .= "</td>\n";
|
---|
662 | $form .= "</tr>\n";
|
---|
663 |
|
---|
664 | $form .= "</table></td></tr>\n";
|
---|
665 | return $form;
|
---|
666 | }
|
---|
667 |
|
---|
668 | function viewer_type_option(){
|
---|
669 | $form = "<tr>\n";
|
---|
670 | $form .= '<th><label for="viewer_type">' .__('Display Mode Setting', 'xpressme') . '</label></th>';
|
---|
671 | $form .= "<td>\n";
|
---|
672 |
|
---|
673 | $form .= __('Select the XPressME Display Mode.', 'xpressme') ."\n";
|
---|
674 | $form .= '<select name="ch_viewer_type">' . "\n";
|
---|
675 |
|
---|
676 | $form .= '<option value="xoops" ';
|
---|
677 | if ($this->viewer_type == 'xoops') $form .= ' selected="selected"';
|
---|
678 | $form .= '>'.__('Xoops Mode', 'xpressme') ."</option>\n";
|
---|
679 |
|
---|
680 | $form .= '<option value="wordpress" ';
|
---|
681 | if ($this->viewer_type == 'wordpress') $form .= ' selected="selected"';
|
---|
682 | $form .= '>'.__('WordPress Mode', 'xpressme') ."</option>\n";
|
---|
683 |
|
---|
684 | $form .= '<option value="user_select" ';
|
---|
685 | if ($this->viewer_type == 'user_select') $form .= ' selected="selected"';
|
---|
686 | $form .= '>'.__('User select', 'xpressme') ."</option>\n";
|
---|
687 |
|
---|
688 | $form .= "</select><br />\n";
|
---|
689 |
|
---|
690 | // Theme Select
|
---|
691 | $form .= __('Select the theme used in the XOOPS Mode.', 'xpressme') ."\n";
|
---|
692 | $form .= '<select name="ch_theme_select">' . "\n";
|
---|
693 |
|
---|
694 | $form .= '<option value="use_wordpress_select" ';
|
---|
695 | if ($this->theme_select == 'use_wordpress_select') $form .= ' selected="selected"';
|
---|
696 | $form .= '>'.__('Use WordPress Selected Themes', 'xpressme') ."</option>\n";
|
---|
697 |
|
---|
698 | $themes = get_themes();
|
---|
699 | $theme_names = array_keys($themes);
|
---|
700 | natcasesort($theme_names);
|
---|
701 | foreach ($theme_names as $theme_name) {
|
---|
702 | if ($theme_name == 'My Themes') continue;
|
---|
703 | $form .= '<option value="' . $theme_name .'" ';
|
---|
704 | if ($this->theme_select == $theme_name) $form .= ' selected="selected"';
|
---|
705 | $form .= '>'.$theme_name ."</option>\n";
|
---|
706 | }
|
---|
707 | $form .= "</select><br />\n";
|
---|
708 | $form .= "</td></tr>\n";
|
---|
709 | return $form;
|
---|
710 | }
|
---|
711 |
|
---|
712 | function header_meta_option(){
|
---|
713 | $form = "<tr>\n";
|
---|
714 | $form .= '<th><label for="header_type">' .__('Header Meta Option', 'xpressme') . '</label></th>';
|
---|
715 | $form .= "<td>\n";
|
---|
716 | $form .= "<table>\n";
|
---|
717 | $form .= "<tr>\n";
|
---|
718 |
|
---|
719 | $form .= "<td>" . __('Select the Header keyword.', 'xpressme') . "</td>\n";
|
---|
720 | $form .= "<td>\n";
|
---|
721 | $form .= '<select name="ch_meta_keyword_type">' . "\n";
|
---|
722 | $form .= '<option value="xoops" ';
|
---|
723 | if ($this->meta_keyword_type == 'xoops') $form .= ' selected="selected"';
|
---|
724 | $form .= '>'.__('Xoops KeyWord', 'xpressme') ."</option>\n";
|
---|
725 | $form .= '<option value="wordpress" ';
|
---|
726 | if ($this->meta_keyword_type == 'wordpress') $form .= ' selected="selected"';
|
---|
727 | $form .= '>'.__('WordPress KeyWord', 'xpressme') ."</option>\n";
|
---|
728 | $form .= '<option value="wordpress_xoops" ';
|
---|
729 | if ($this->meta_keyword_type == 'wordpress_xoops') $form .= ' selected="selected"';
|
---|
730 | $form .= '>'.__('WordPress & Xoops KeyWord', 'xpressme') ."</option>\n";
|
---|
731 | $form .= "</select><br />\n";
|
---|
732 | $form .= "</td>\n";
|
---|
733 | $form .= "</tr>\n";
|
---|
734 |
|
---|
735 | $form .= "<tr>\n";
|
---|
736 | $form .= "<td>" . __('Select the Header Description.', 'xpressme') . "</td>\n";
|
---|
737 | $form .= "<td>\n";
|
---|
738 | $form .= '<select name="ch_meta_description_type">' . "\n";
|
---|
739 | $form .= '<option value="xoops" ';
|
---|
740 | if ($this->meta_description_type == 'xoops') $form .= ' selected="selected"';
|
---|
741 | $form .= '>'.__('Xoops Description', 'xpressme') ."</option>\n";
|
---|
742 | $form .= '<option value="wordpress" ';
|
---|
743 | if ($this->meta_description_type == 'wordpress') $form .= ' selected="selected"';
|
---|
744 | $form .= '>'.__('WordPress Description', 'xpressme') ."</option>\n";
|
---|
745 | $form .= '<option value="wordpress_xoops" ';
|
---|
746 | if ($this->meta_description_type == 'wordpress_xoops') $form .= ' selected="selected"';
|
---|
747 | $form .= '>'.__('WordPress & Xoops Description', 'xpressme') ."</option>\n";
|
---|
748 | $form .= "</select><br />\n";
|
---|
749 | $form .= "</td>\n";
|
---|
750 | $form .= "</tr>\n";
|
---|
751 |
|
---|
752 | $form .= "<tr>\n";
|
---|
753 | $form .= "<td>" . __('Select the Header Robots Index.', 'xpressme') . "</td>\n";
|
---|
754 | $form .= "<td>\n";
|
---|
755 | $form .= '<select name="ch_meta_robot_type">' . "\n";
|
---|
756 | $form .= '<option value="xoops" ';
|
---|
757 | if ($this->meta_robot_type == 'xoops') $form .= ' selected="selected"';
|
---|
758 | $form .= '>'.__('Xoops Robots Index', 'xpressme') ."</option>\n";
|
---|
759 | $form .= '<option value="wordpress" ';
|
---|
760 | if ($this->meta_robot_type == 'wordpress') $form .= ' selected="selected"';
|
---|
761 | $form .= '>'.__('WordPress Robots Index', 'xpressme') ."</option>\n";
|
---|
762 | $form .= "</select><br />\n";
|
---|
763 | $form .= "</td>\n";
|
---|
764 | $form .= "</tr>\n";
|
---|
765 |
|
---|
766 | $form .= "</table>\n";
|
---|
767 |
|
---|
768 | $form .= "</tr>\n";
|
---|
769 | return $form;
|
---|
770 | }
|
---|
771 |
|
---|
772 | function xpress_upload_filter($uploads)
|
---|
773 | {
|
---|
774 | global $xoops_config;
|
---|
775 | if ($this->is_use_xoops_upload_path){
|
---|
776 | $wordpress_dir = ABSPATH ;
|
---|
777 | $xoops_dir = $xoops_config->xoops_upload_path . '/';
|
---|
778 | $wordpress_base_url = get_option( 'siteurl' );
|
---|
779 | $xoops_upload_url = $xoops_config->xoops_upload_url;
|
---|
780 |
|
---|
781 | @rmdir($uploads[path]); //remove wordpress side uploads_dir
|
---|
782 |
|
---|
783 | $uploads[path] = str_replace ($wordpress_dir, $xoops_dir, $uploads[path]);
|
---|
784 | $uploads[basedir] = str_replace ($wordpress_dir, $xoops_dir, $uploads[basedir]);
|
---|
785 | $uploads[url] = str_replace ($wordpress_base_url, $xoops_upload_url, $uploads[url]);
|
---|
786 | $uploads[baseurl] = str_replace ($wordpress_base_url, $xoops_upload_url, $uploads[baseurl]);
|
---|
787 |
|
---|
788 | // Make sure we have an uploads dir
|
---|
789 | if ( ! wp_mkdir_p( $uploads[path] ) ) {
|
---|
790 | $message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $uploads[path] );
|
---|
791 | return array( 'error' => $message );
|
---|
792 | }
|
---|
793 | }
|
---|
794 | return $uploads;
|
---|
795 | }
|
---|
796 |
|
---|
797 | // SQL DEBUG TEST
|
---|
798 | function is_sql_debug_permission()
|
---|
799 | {
|
---|
800 | global $current_user;
|
---|
801 |
|
---|
802 | if (!is_object($current_user)) return false;
|
---|
803 | if ($this->is_sql_debug && ($current_user->user_level >= 10))
|
---|
804 | return true;
|
---|
805 | else
|
---|
806 | return false;
|
---|
807 | }
|
---|
808 |
|
---|
809 | function xpress_sql_debug($query_strings)
|
---|
810 | {
|
---|
811 | if ($this->is_sql_debug_permission()){
|
---|
812 | if (empty($GLOBALS['XPress_SQL_Query'])) $GLOBALS['XPress_SQL_Query'] = '';
|
---|
813 | $GLOBALS['XPress_SQL_Query'] .= $query_strings . '<br /><br />';
|
---|
814 | }
|
---|
815 | return $query_strings;
|
---|
816 | }
|
---|
817 |
|
---|
818 | function displayDebugLog()
|
---|
819 | {
|
---|
820 | if ($this->is_sql_debug_permission()){
|
---|
821 | $content = '';
|
---|
822 | $content .= '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />';
|
---|
823 | $content .= '<meta http-equiv="content-language" content="'._LANGCODE.'" />' ;
|
---|
824 | $content .= '<title>XPressME SQL DEBUG</title>' ;
|
---|
825 | $content .= '</head><body>';
|
---|
826 | $content .= $GLOBALS['XPress_SQL_Query'];
|
---|
827 | $content .= '<div style="text-align:center;"><input class="formButton" value="CLOSE" type="button" onclick="javascript:window.close();" /></div></body></html>';
|
---|
828 |
|
---|
829 | echo '<script type="text/javascript">
|
---|
830 | <!--//
|
---|
831 | xpress_debug_window = window.open("", "xpress_debug", "width=680 , height=600 ,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no");
|
---|
832 | xpress_debug_window.document.clear();
|
---|
833 | xpress_debug_window.focus();
|
---|
834 | ';
|
---|
835 | $lines = preg_split("/(\r\n|\r|\n)( *)/", $content);
|
---|
836 | foreach ($lines as $line) {
|
---|
837 | echo 'xpress_debug_window.document.writeln("'.str_replace('"', '\"', $line).'");';
|
---|
838 | }
|
---|
839 | echo '
|
---|
840 | xpress_debug_window.document.close();
|
---|
841 | //-->
|
---|
842 | </script>';
|
---|
843 | }
|
---|
844 | }
|
---|
845 | }
|
---|
846 | ?> |
---|