@@ -23,27 +23,27 @@ discard block |
||
23 | 23 | * Accessible to listing owners and administrators only. |
24 | 24 | */ |
25 | 25 | |
26 | -include __DIR__ . '/header.php'; |
|
26 | +include __DIR__.'/header.php'; |
|
27 | 27 | $myts = MyTextSanitizer::getInstance(); // MyTextSanitizer object |
28 | -require_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
29 | -require_once XOOPS_ROOT_PATH . '/class/module.errorhandler.php'; |
|
30 | -require_once XOOPS_ROOT_PATH . '/include/xoopscodes.php'; |
|
31 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
32 | -require_once __DIR__ . '/class/class.formimage.php'; |
|
33 | -require_once __DIR__ . '/class/class.image.php'; |
|
34 | -require_once __DIR__ . '/class/class.couponhandler.php'; |
|
28 | +require_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
29 | +require_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
|
30 | +require_once XOOPS_ROOT_PATH.'/include/xoopscodes.php'; |
|
31 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
32 | +require_once __DIR__.'/class/class.formimage.php'; |
|
33 | +require_once __DIR__.'/class/class.image.php'; |
|
34 | +require_once __DIR__.'/class/class.couponhandler.php'; |
|
35 | 35 | |
36 | 36 | $eh = new ErrorHandler; //ErrorHandler object |
37 | 37 | |
38 | 38 | $moddir = $xoopsModule->getVar('dirname'); |
39 | -$mytree = new XoopsTree($xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat'), 'cid', 'pid'); |
|
39 | +$mytree = new XoopsTree($xoopsDB->prefix($module->getVar('dirname', 'n').'_cat'), 'cid', 'pid'); |
|
40 | 40 | |
41 | 41 | //$moddir = $xoopsModule->getvar("dirname"); |
42 | -$couponid = isset($_GET['couponid']) ? (int)$_GET['couponid'] : 0; |
|
42 | +$couponid = isset($_GET['couponid']) ? (int) $_GET['couponid'] : 0; |
|
43 | 43 | if (isset($_POST['itemid'])) { |
44 | - $itemid = (int)$_POST['itemid']; |
|
44 | + $itemid = (int) $_POST['itemid']; |
|
45 | 45 | } elseif (isset($_GET['item'])) { |
46 | - $itemid = (int)$_GET['item']; |
|
46 | + $itemid = (int) $_GET['item']; |
|
47 | 47 | } else { |
48 | 48 | $itemid = 0; |
49 | 49 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if (isset($_POST['lbr'])) { |
57 | - $lbr = (int)$_POST['lbr']; |
|
57 | + $lbr = (int) $_POST['lbr']; |
|
58 | 58 | } else { |
59 | 59 | $lbr = 0; |
60 | 60 | } |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | $expire = time() + 3600 * 24 * 7; |
79 | 79 | } |
80 | 80 | } else { |
81 | - $itemid = isset($_POST['itemid']) ? (int)$_POST['itemid'] : (isset($_GET['item']) ? (int)$_GET['item'] : 0); |
|
82 | - $couponid = isset($_POST['couponid']) ? (int)$_POST['couponid'] : null; |
|
81 | + $itemid = isset($_POST['itemid']) ? (int) $_POST['itemid'] : (isset($_GET['item']) ? (int) $_GET['item'] : 0); |
|
82 | + $couponid = isset($_POST['couponid']) ? (int) $_POST['couponid'] : null; |
|
83 | 83 | $description = isset($_POST['description']) ? $_POST['description'] : ''; |
84 | 84 | $publish = isset($_POST['publish']) ? $_POST['publish'] : 0; |
85 | 85 | $image = isset($_POST['image']) ? $_POST['image'] : ''; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | if (!empty($_POST['submit'])) { |
97 | 97 | $coupon = new efqCouponHandler(); |
98 | 98 | if (isset($_POST['couponid'])) { |
99 | - $couponid = (int)$_POST['couponid']; |
|
99 | + $couponid = (int) $_POST['couponid']; |
|
100 | 100 | $message = _MD_COUPONEDITED; |
101 | 101 | } else { |
102 | 102 | $coupon->_new = true; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if (!$coupon->create()) { |
106 | 106 | $coupon->message = _MD_ERR_ADDCOUPON; |
107 | 107 | } |
108 | - redirect_header('listing.php?item=' . $itemid, 2, $coupon->message); |
|
108 | + redirect_header('listing.php?item='.$itemid, 2, $coupon->message); |
|
109 | 109 | exit(); |
110 | 110 | } elseif (!empty($_POST['delete'])) { |
111 | 111 | if (!empty($_POST['ok'])) { |
@@ -114,18 +114,18 @@ discard block |
||
114 | 114 | exit(); |
115 | 115 | } |
116 | 116 | $coupon = new efqCouponHandler(); |
117 | - $couponid = (int)$_POST['couponid']; |
|
117 | + $couponid = (int) $_POST['couponid']; |
|
118 | 118 | if ($coupon->delete($couponid)) { |
119 | - redirect_header('listing.php?item=' . $itemid, 2, _MD_COUPONDELETED); |
|
119 | + redirect_header('listing.php?item='.$itemid, 2, _MD_COUPONDELETED); |
|
120 | 120 | exit(); |
121 | 121 | } |
122 | 122 | } else { |
123 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
124 | - xoops_confirm(array('delete' => 'yes', 'couponid' => $couponid, 'ok' => 1), 'addcoupon.php?item=' . $itemid . '', _MD_COUPONRUSURE); |
|
125 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
123 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
124 | + xoops_confirm(array('delete' => 'yes', 'couponid' => $couponid, 'ok' => 1), 'addcoupon.php?item='.$itemid.'', _MD_COUPONRUSURE); |
|
125 | + require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
126 | 126 | exit(); |
127 | 127 | } |
128 | 128 | } |
129 | -include XOOPS_ROOT_PATH . '/header.php'; |
|
130 | -include __DIR__ . '/include/couponform.php'; |
|
131 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
129 | +include XOOPS_ROOT_PATH.'/header.php'; |
|
130 | +include __DIR__.'/include/couponform.php'; |
|
131 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -50,35 +50,35 @@ |
||
50 | 50 | |
51 | 51 | // Tables created by sql file (without prefix!) |
52 | 52 | $modversion['tables'] = array( |
53 | - $moduleDirName . '_' . 'cat', |
|
54 | - $moduleDirName . '_' . 'cat_txt', |
|
55 | - $moduleDirName . '_' . 'data', |
|
56 | - $moduleDirName . '_' . 'dir', |
|
57 | - $moduleDirName . '_' . 'item_x_cat', |
|
58 | - $moduleDirName . '_' . 'item_x_loc', |
|
59 | - $moduleDirName . '_' . 'items', |
|
60 | - $moduleDirName . '_' . 'item_text', |
|
61 | - $moduleDirName . '_' . 'item_img', |
|
62 | - $moduleDirName . '_' . 'itemtypes', |
|
63 | - $moduleDirName . '_' . 'fieldtypes', |
|
64 | - $moduleDirName . '_' . 'dtypes', |
|
65 | - $moduleDirName . '_' . 'dtypes_x_cat', |
|
66 | - $moduleDirName . '_' . 'coupon', |
|
67 | - $moduleDirName . '_' . 'loc',//In case not used in combo with destinations mod. |
|
68 | - $moduleDirName . '_' . 'loc_types',//In case not used in combo with destinations mod. |
|
69 | - $moduleDirName . '_' . 'loc_x_loctype',//In case not used in combo with destinations mod. |
|
70 | - $moduleDirName . '_' . 'votedata', |
|
53 | + $moduleDirName.'_'.'cat', |
|
54 | + $moduleDirName.'_'.'cat_txt', |
|
55 | + $moduleDirName.'_'.'data', |
|
56 | + $moduleDirName.'_'.'dir', |
|
57 | + $moduleDirName.'_'.'item_x_cat', |
|
58 | + $moduleDirName.'_'.'item_x_loc', |
|
59 | + $moduleDirName.'_'.'items', |
|
60 | + $moduleDirName.'_'.'item_text', |
|
61 | + $moduleDirName.'_'.'item_img', |
|
62 | + $moduleDirName.'_'.'itemtypes', |
|
63 | + $moduleDirName.'_'.'fieldtypes', |
|
64 | + $moduleDirName.'_'.'dtypes', |
|
65 | + $moduleDirName.'_'.'dtypes_x_cat', |
|
66 | + $moduleDirName.'_'.'coupon', |
|
67 | + $moduleDirName.'_'.'loc', //In case not used in combo with destinations mod. |
|
68 | + $moduleDirName.'_'.'loc_types', //In case not used in combo with destinations mod. |
|
69 | + $moduleDirName.'_'.'loc_x_loctype', //In case not used in combo with destinations mod. |
|
70 | + $moduleDirName.'_'.'votedata', |
|
71 | 71 | //$moduleDirName . '_' . = "loc_x_address_types", |
72 | - $moduleDirName . '_' . 'form_options', |
|
73 | - $moduleDirName . '_' . 'address_types', |
|
74 | - $moduleDirName . '_' . 'searchresults', |
|
75 | - $moduleDirName . '_' . 'subscr_offers', |
|
76 | - $moduleDirName . '_' . 'subscr_orders', |
|
77 | - $moduleDirName . '_' . 'subscr_payments', |
|
78 | - $moduleDirName . '_' . 'subscr_scheduler', |
|
79 | - $moduleDirName . '_' . 'subscr_notify', |
|
80 | - $moduleDirName . '_' . 'cat_tpl', |
|
81 | - $moduleDirName . '_' . 'tpl', |
|
72 | + $moduleDirName.'_'.'form_options', |
|
73 | + $moduleDirName.'_'.'address_types', |
|
74 | + $moduleDirName.'_'.'searchresults', |
|
75 | + $moduleDirName.'_'.'subscr_offers', |
|
76 | + $moduleDirName.'_'.'subscr_orders', |
|
77 | + $moduleDirName.'_'.'subscr_payments', |
|
78 | + $moduleDirName.'_'.'subscr_scheduler', |
|
79 | + $moduleDirName.'_'.'subscr_notify', |
|
80 | + $moduleDirName.'_'.'cat_tpl', |
|
81 | + $moduleDirName.'_'.'tpl', |
|
82 | 82 | ); |
83 | 83 | |
84 | 84 | // Admin things |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | * @author XOOPS Development Team, |
19 | 19 | */ |
20 | 20 | |
21 | -include __DIR__ . '/header.php'; |
|
22 | -require_once XOOPS_ROOT_PATH . '/class/module.errorhandler.php'; |
|
21 | +include __DIR__.'/header.php'; |
|
22 | +require_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
|
23 | 23 | $myts = MyTextSanitizer::getInstance(); // MyTextSanitizer object |
24 | 24 | $moddir = $xoopsModule->getVar('dirname'); |
25 | 25 | |
@@ -34,19 +34,19 @@ discard block |
||
34 | 34 | //Make sure only 1 anonymous from an IP in a single day. |
35 | 35 | $anonwaitdays = $xoopsModuleConfig['anonvotes_waitdays']; |
36 | 36 | $ip = getenv('REMOTE_ADDR'); |
37 | - $p_itemid = (int)$_POST['item']; |
|
38 | - $p_catid = (int)$_POST['catid']; |
|
39 | - $p_rating = (int)$_POST['rating']; |
|
37 | + $p_itemid = (int) $_POST['item']; |
|
38 | + $p_catid = (int) $_POST['catid']; |
|
39 | + $p_rating = (int) $_POST['rating']; |
|
40 | 40 | |
41 | 41 | // Check if Rating is Null |
42 | 42 | if ($p_rating == '--') { |
43 | - redirect_header('ratelisting.php?catid=' . $p_catid . '&item=' . $itemid . '', 2, _MD_NORATING); |
|
43 | + redirect_header('ratelisting.php?catid='.$p_catid.'&item='.$itemid.'', 2, _MD_NORATING); |
|
44 | 44 | exit(); |
45 | 45 | } |
46 | 46 | |
47 | 47 | // Check if Link POSTER is voting (UNLESS Anonymous users allowed to post) |
48 | 48 | if ($ratinguser != 0) { |
49 | - $result = $xoopsDB->query('select submitter from ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_items') . " where itemid=$p_itemid"); |
|
49 | + $result = $xoopsDB->query('select submitter from '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_items')." where itemid=$p_itemid"); |
|
50 | 50 | while (list($ratinguserDB) = $xoopsDB->fetchRow($result)) { |
51 | 51 | if ($ratinguserDB == $ratinguser) { |
52 | 52 | redirect_header('index.php', 4, _MD_CANTVOTEOWN); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | // Check if REG user is trying to vote twice. |
58 | - $result = $xoopsDB->query('select ratinguser from ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_votedata') . " where itemid=$p_itemid"); |
|
58 | + $result = $xoopsDB->query('select ratinguser from '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_votedata')." where itemid=$p_itemid"); |
|
59 | 59 | while (list($ratinguserDB) = $xoopsDB->fetchRow($result)) { |
60 | 60 | if ($ratinguserDB == $ratinguser) { |
61 | 61 | redirect_header('index.php', 4, _MD_VOTEONCE2); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | // Check if ANONYMOUS user is trying to vote more than once per day. |
68 | 68 | $yesterday = (time() - (86400 * $anonwaitdays)); |
69 | - $result = $xoopsDB->query('select count(*) FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_votedata') . " WHERE itemid=$p_itemid AND ratinguser=0 AND ratinghostname = '$ip' AND ratingtimestamp > $yesterday"); |
|
69 | + $result = $xoopsDB->query('select count(*) FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_votedata')." WHERE itemid=$p_itemid AND ratinguser=0 AND ratinghostname = '$ip' AND ratingtimestamp > $yesterday"); |
|
70 | 70 | list($anonvotecount) = $xoopsDB->fetchRow($result); |
71 | 71 | if ($anonvotecount > 0) { |
72 | 72 | redirect_header('index.php', 4, _MD_VOTEONCE2); |
@@ -78,20 +78,20 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | //Add to Line Item Rate to DB. |
81 | - $newid = $xoopsDB->genId($xoopsDB->prefix($module->getVar('dirname', 'n') . '_votedata') . '_ratingid_seq'); |
|
81 | + $newid = $xoopsDB->genId($xoopsDB->prefix($module->getVar('dirname', 'n').'_votedata').'_ratingid_seq'); |
|
82 | 82 | $datetime = time(); |
83 | - $sql = sprintf("INSERT INTO %s (ratingid, itemid, ratinguser, rating, ratinghostname, ratingtimestamp) VALUES (%u, %u, %u, %u, '%s', %u)", $xoopsDB->prefix($module->getVar('dirname', 'n') . '_votedata'), $newid, $p_itemid, $ratinguser, $p_rating, $ip, $datetime); |
|
83 | + $sql = sprintf("INSERT INTO %s (ratingid, itemid, ratinguser, rating, ratinghostname, ratingtimestamp) VALUES (%u, %u, %u, %u, '%s', %u)", $xoopsDB->prefix($module->getVar('dirname', 'n').'_votedata'), $newid, $p_itemid, $ratinguser, $p_rating, $ip, $datetime); |
|
84 | 84 | $xoopsDB->query($sql) or $eh->show('0013'); |
85 | 85 | |
86 | 86 | //Calculate Score & Add to Summary (for quick retrieval & sorting) to DB. |
87 | 87 | updaterating($p_itemid); |
88 | 88 | if (!empty($_POST['catid'])) { |
89 | - $p_catid = (int)$_POST['catid']; |
|
89 | + $p_catid = (int) $_POST['catid']; |
|
90 | 90 | } else { |
91 | 91 | $p_catid = 0; |
92 | 92 | } |
93 | 93 | if (!empty($_POST['dirid'])) { |
94 | - $p_dirid = (int)$_POST['dirid']; |
|
94 | + $p_dirid = (int) $_POST['dirid']; |
|
95 | 95 | } else { |
96 | 96 | $p_dirid = 0; |
97 | 97 | } |
@@ -100,24 +100,24 @@ discard block |
||
100 | 100 | } else { |
101 | 101 | $dirid = $p_dirid; |
102 | 102 | } |
103 | - $ratemessage = _MD_VOTEAPPRE . '<br>' . sprintf(_MD_THANKURATE, $xoopsConfig['sitename']); |
|
104 | - redirect_header('index.php?dirid=' . $dirid . '', 2, $ratemessage); |
|
103 | + $ratemessage = _MD_VOTEAPPRE.'<br>'.sprintf(_MD_THANKURATE, $xoopsConfig['sitename']); |
|
104 | + redirect_header('index.php?dirid='.$dirid.'', 2, $ratemessage); |
|
105 | 105 | exit(); |
106 | 106 | } else { |
107 | 107 | $GLOBALS['xoopsOption']['template_main'] = 'efqdiralpha1_ratelisting.tpl'; |
108 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
108 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
109 | 109 | if (isset($_GET['item'])) { |
110 | - $get_itemid = (int)$_GET['item']; |
|
110 | + $get_itemid = (int) $_GET['item']; |
|
111 | 111 | } else { |
112 | 112 | $get_itemid = '0'; |
113 | 113 | } |
114 | 114 | if (isset($_GET['catid'])) { |
115 | - $get_catid = (int)$_GET['catid']; |
|
115 | + $get_catid = (int) $_GET['catid']; |
|
116 | 116 | } else { |
117 | 117 | $get_catid = '0'; |
118 | 118 | } |
119 | 119 | |
120 | - $result = $xoopsDB->query('select title from ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_listings') . " where itemid=$get_itemid"); |
|
120 | + $result = $xoopsDB->query('select title from '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_listings')." where itemid=$get_itemid"); |
|
121 | 121 | list($title) = $xoopsDB->fetchRow($result); |
122 | 122 | $xoopsTpl->assign('listing', array('itemid' => $get_itemid, 'catid' => $get_catid, 'title' => $myts->htmlSpecialChars($title))); |
123 | 123 | $xoopsTpl->assign('moddir', $moddir); |
@@ -127,5 +127,5 @@ discard block |
||
127 | 127 | $xoopsTpl->assign('lang_donotvote', _MD_DONOTVOTE); |
128 | 128 | $xoopsTpl->assign('lang_rateit', _MD_RATEIT); |
129 | 129 | $xoopsTpl->assign('lang_cancel', _CANCEL); |
130 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
130 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
131 | 131 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | //build post string |
99 | 99 | |
100 | 100 | foreach ($data as $i => $v) { |
101 | - $postdata .= $i . '=' . urlencode($v) . '&'; |
|
101 | + $postdata .= $i.'='.urlencode($v).'&'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | $postdata .= 'cmd=_notify-validate'; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | //build post string |
125 | 125 | |
126 | 126 | foreach ($data as $i => $v) { |
127 | - $postdata .= $i . '=' . urlencode($v) . '&'; |
|
127 | + $postdata .= $i.'='.urlencode($v).'&'; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | $postdata .= 'cmd=_notify-validate'; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $postdata = ''; |
165 | 165 | //build post string |
166 | 166 | foreach ($data as $i => $v) { |
167 | - $postdata .= $i . '=' . urlencode($v) . '&'; |
|
167 | + $postdata .= $i.'='.urlencode($v).'&'; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $postdata .= 'cmd=_notify-validate'; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | //Create paypal connection |
181 | - $fp = @fsockopen($ssl . $web['host'], $web['port'], $errnum, $errstr, 30); |
|
181 | + $fp = @fsockopen($ssl.$web['host'], $web['port'], $errnum, $errstr, 30); |
|
182 | 182 | |
183 | 183 | //Error checking |
184 | 184 | if (!$fp) { |
@@ -188,9 +188,9 @@ discard block |
||
188 | 188 | fwrite($fp, "POST $web[path] HTTP/1.1\r\n"); |
189 | 189 | fwrite($fp, "Host: $web[host]\r\n"); |
190 | 190 | fwrite($fp, "Content-type: application/x-www-form-urlencoded\r\n"); |
191 | - fwrite($fp, 'Content-length: ' . strlen($postdata) . "\r\n"); |
|
191 | + fwrite($fp, 'Content-length: '.strlen($postdata)."\r\n"); |
|
192 | 192 | fwrite($fp, "Connection: close\r\n\r\n"); |
193 | - fwrite($fp, $postdata . "\r\n\r\n"); |
|
193 | + fwrite($fp, $postdata."\r\n\r\n"); |
|
194 | 194 | |
195 | 195 | //loop through the response from the server |
196 | 196 | while (!feof($fp)) { |
@@ -52,7 +52,7 @@ |
||
52 | 52 | |
53 | 53 | //Configuration Settings |
54 | 54 | $paypal['business'] = $xoopsModuleConfig['paypal_business_mail']; |
55 | -$paypal['site_url'] = '' . XOOPS_URL . '/modules/' . $moddir . '/'; |
|
55 | +$paypal['site_url'] = ''.XOOPS_URL.'/modules/'.$moddir.'/'; |
|
56 | 56 | $paypal['image_url'] = ''; |
57 | 57 | $paypal['success_url'] = 'ipn.php'; |
58 | 58 | //$paypal[success_url]="php_paypal/ipn/ipn.php"; |
@@ -18,18 +18,18 @@ discard block |
||
18 | 18 | * @author XOOPS Development Team, |
19 | 19 | */ |
20 | 20 | |
21 | -include __DIR__ . '/header.php'; |
|
22 | -$myts = MyTextSanitizer::getInstance();// MyTextSanitizer object |
|
23 | -require_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
24 | -require_once XOOPS_ROOT_PATH . '/class/module.errorhandler.php'; |
|
25 | -require_once XOOPS_ROOT_PATH . '/include/xoopscodes.php'; |
|
26 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
21 | +include __DIR__.'/header.php'; |
|
22 | +$myts = MyTextSanitizer::getInstance(); // MyTextSanitizer object |
|
23 | +require_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
24 | +require_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
|
25 | +require_once XOOPS_ROOT_PATH.'/include/xoopscodes.php'; |
|
26 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
27 | 27 | |
28 | 28 | $moddir = $xoopsModule->getVar('dirname'); |
29 | 29 | if (isset($_POST['dirid'])) { |
30 | - $dirid = (int)$_POST['dirid']; |
|
30 | + $dirid = (int) $_POST['dirid']; |
|
31 | 31 | } elseif (isset($_GET['dirid'])) { |
32 | - $dirid = (int)$_GET['dirid']; |
|
32 | + $dirid = (int) $_GET['dirid']; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $eh = new ErrorHandler; //ErrorHandler object |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | if (empty($xoopsUser) and !$xoopsModuleConfig['anonpost']) { |
44 | - redirect_header(XOOPS_URL . '/user.php', 2, _MD_MUSTREGFIRST); |
|
44 | + redirect_header(XOOPS_URL.'/user.php', 2, _MD_MUSTREGFIRST); |
|
45 | 45 | exit(); |
46 | 46 | } |
47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | $title = $myts->makeTboxData4Save($_POST['title']); |
55 | 55 | $date = time(); |
56 | - $newid = $xoopsDB->genId($xoopsDB->prefix($module->getVar('dirname', 'n') . '_items') . '_itemid_seq'); |
|
56 | + $newid = $xoopsDB->genId($xoopsDB->prefix($module->getVar('dirname', 'n').'_items').'_itemid_seq'); |
|
57 | 57 | if ($xoopsModuleConfig['autoapprove'] == 1) { |
58 | 58 | $status = 1; |
59 | 59 | } else { |
@@ -61,29 +61,29 @@ discard block |
||
61 | 61 | } |
62 | 62 | //itemtype = bronze, silver, gold etc., start with 0 as default. |
63 | 63 | $submitter = $xoopsUser->getVar('uid'); |
64 | - $newid = $xoopsDB->genId($xoopsDB->prefix($module->getVar('dirname', 'n') . '_items') . '_itemid_seq'); |
|
65 | - $sql = sprintf("INSERT INTO %s (itemid, uid, STATUS, created, title, hits, rating, votes, typeid, dirid) VALUES (%u, %u, %u, '%s', '%s', %u, %u, %u, '%s', %u)", $xoopsDB->prefix($module->getVar('dirname', 'n') . '_items'), $newid, $submitter, $status, time(), $title, 0, 0, 0, 0, $dirid); |
|
64 | + $newid = $xoopsDB->genId($xoopsDB->prefix($module->getVar('dirname', 'n').'_items').'_itemid_seq'); |
|
65 | + $sql = sprintf("INSERT INTO %s (itemid, uid, STATUS, created, title, hits, rating, votes, typeid, dirid) VALUES (%u, %u, %u, '%s', '%s', %u, %u, %u, '%s', %u)", $xoopsDB->prefix($module->getVar('dirname', 'n').'_items'), $newid, $submitter, $status, time(), $title, 0, 0, 0, 0, $dirid); |
|
66 | 66 | $xoopsDB->query($sql) or $eh->show('0013'); |
67 | 67 | if ($newid == 0) { |
68 | 68 | $itemid = $xoopsDB->getInsertId(); |
69 | 69 | } |
70 | - $allcatsresult = $xoopsDB->query('SELECT cid FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat') . " WHERE dirid='" . $dirid . '\' AND active=\'1\''); |
|
70 | + $allcatsresult = $xoopsDB->query('SELECT cid FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_cat')." WHERE dirid='".$dirid.'\' AND active=\'1\''); |
|
71 | 71 | $numrows = $xoopsDB->getRowsNum($allcatsresult); |
72 | 72 | $count = 0; |
73 | 73 | if ($numrows > 0) { |
74 | 74 | while (list($cid) = $xoopsDB->fetchRow($allcatsresult)) { |
75 | - if (isset($_POST['selected' . $cid . ''])) { |
|
76 | - $sql = sprintf("INSERT INTO %s (xid, cid, itemid, active, created) VALUES (%u, %u, %u, '%s', '%s')", $xoopsDB->prefix($module->getVar('dirname', 'n') . '_item_x_cat'), $newid, $cid, $itemid, 1, time()); |
|
75 | + if (isset($_POST['selected'.$cid.''])) { |
|
76 | + $sql = sprintf("INSERT INTO %s (xid, cid, itemid, active, created) VALUES (%u, %u, %u, '%s', '%s')", $xoopsDB->prefix($module->getVar('dirname', 'n').'_item_x_cat'), $newid, $cid, $itemid, 1, time()); |
|
77 | 77 | $xoopsDB->query($sql) or $eh->show('0013'); |
78 | 78 | ++$count; |
79 | 79 | } |
80 | 80 | } |
81 | 81 | if ($count == 0) { |
82 | - redirect_header(XOOPS_URL . "/modules/$moddir/submit.php?dirid=" . $post_dirid . '', 2, _MD_NOCATEGORYMATCH); |
|
82 | + redirect_header(XOOPS_URL."/modules/$moddir/submit.php?dirid=".$post_dirid.'', 2, _MD_NOCATEGORYMATCH); |
|
83 | 83 | exit(); |
84 | 84 | } |
85 | 85 | } else { |
86 | - redirect_header(XOOPS_URL . "/modules/$moddir/submit.php?dirid=" . $post_dirid . '', 2, _MD_NOCATEGORIESAVAILABLE); |
|
86 | + redirect_header(XOOPS_URL."/modules/$moddir/submit.php?dirid=".$post_dirid.'', 2, _MD_NOCATEGORIESAVAILABLE); |
|
87 | 87 | exit(); |
88 | 88 | } |
89 | 89 | |
@@ -106,16 +106,16 @@ discard block |
||
106 | 106 | redirect_header(XOOPS_URL."/modules/$moddir/edit.php?item=".$itemid."",2,_MD_SAVED); |
107 | 107 | }*/ |
108 | 108 | |
109 | - redirect_header(XOOPS_URL . "/modules/$moddir/edit.php?item=" . $itemid . '', 2, _MD_SAVED); |
|
109 | + redirect_header(XOOPS_URL."/modules/$moddir/edit.php?item=".$itemid.'', 2, _MD_SAVED); |
|
110 | 110 | exit(); |
111 | 111 | } else { |
112 | 112 | if (isset($_GET['dirid'])) { |
113 | - $get_dirid = (int)$_GET['dirid']; |
|
113 | + $get_dirid = (int) $_GET['dirid']; |
|
114 | 114 | } else { |
115 | - redirect_header(XOOPS_URL . "/modules/$moddir/index.php", 2, _MD_NODIRECTORYSELECTED); |
|
115 | + redirect_header(XOOPS_URL."/modules/$moddir/index.php", 2, _MD_NODIRECTORYSELECTED); |
|
116 | 116 | } |
117 | 117 | $GLOBALS['xoopsOption']['template_main'] = 'efqdiralpha1_submit.tpl'; |
118 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
118 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
119 | 119 | $xoopsTpl->assign('xoops_module_header', $xoops_module_header); |
120 | 120 | //Query datatypes that match the categories selected. If not category selected. |
121 | 121 | ob_start(); |
@@ -166,5 +166,5 @@ discard block |
||
166 | 166 | $xoopsTpl->assign('lang_notify', _MD_NOTIFYAPPROVE); |
167 | 167 | $xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC); |
168 | 168 | $xoopsTpl->assign('lang_cancel', _CANCEL); |
169 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
169 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
170 | 170 | } |
@@ -18,23 +18,23 @@ |
||
18 | 18 | * @author XOOPS Development Team, |
19 | 19 | */ |
20 | 20 | |
21 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
22 | -require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
21 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
22 | +require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
23 | 23 | |
24 | 24 | $uploaddirectory = '/uploads/'; |
25 | 25 | |
26 | 26 | $coupform = new XoopsThemeForm(_MD_COUPONFORM, 'couponform', $_SERVER['PHP_SELF'], 'POST', true); |
27 | -$linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/uploads/'); |
|
27 | +$linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH.'/uploads/'); |
|
28 | 28 | $coupform->addElement(new XoopsFormHidden('itemid', $itemid)); |
29 | 29 | $coupform->addElement(new XoopsFormText(_MD_COUPONHEADER, 'heading', 25, 30, $heading), true); |
30 | 30 | $coupform->addElement(new XoopsFormDhtmlTextArea(_MD_DESCRIPTIONC, 'description', $description)); |
31 | -$image_option = new XoopsFormSelect(_MD_COUPONIMGMGR . '<br>' . _MD_COUPONIMG . '<br>', 'image', $image); |
|
31 | +$image_option = new XoopsFormSelect(_MD_COUPONIMGMGR.'<br>'._MD_COUPONIMG.'<br>', 'image', $image); |
|
32 | 32 | $image_option->addOptionArray($linkimg_array); |
33 | 33 | $imgtray = new XoopsFormElementTray(_MD_COUPSEL, '<br>'); |
34 | 34 | |
35 | -$image_option->setExtra("onchange='showImgSelected(\"imagex\", \"image\", \"" . $uploaddirectory . '", "", "' . XOOPS_URL . "\")'"); |
|
35 | +$image_option->setExtra("onchange='showImgSelected(\"imagex\", \"image\", \"".$uploaddirectory.'", "", "'.XOOPS_URL."\")'"); |
|
36 | 36 | $imgtray->addElement($image_option, false); |
37 | -$imgtray->addElement(new XoopsFormLabel('', "<br><img src='" . $uploaddirectory . '/' . $image . '\' name=\'imagex\' id=\'imagex\' alt=\'\'>')); |
|
37 | +$imgtray->addElement(new XoopsFormLabel('', "<br><img src='".$uploaddirectory.'/'.$image.'\' name=\'imagex\' id=\'imagex\' alt=\'\'>')); |
|
38 | 38 | $coupform->addElement($imgtray); |
39 | 39 | $coupform->addElement(new XoopsFormRadioYN(_MD_CONVERTLBR, 'lbr', $lbr)); |
40 | 40 | $coupform->addElement(new XoopsFormDateTime(_MD_PUBLISHCOUPON, 'publish', 25, $publish)); |
@@ -61,28 +61,28 @@ discard block |
||
61 | 61 | { |
62 | 62 | $orderbyTrans = ''; |
63 | 63 | if ($orderby === 'hits ASC') { |
64 | - $orderbyTrans = '' . _MD_POPULARITYLTOM . ''; |
|
64 | + $orderbyTrans = ''._MD_POPULARITYLTOM.''; |
|
65 | 65 | } |
66 | 66 | if ($orderby === 'hits DESC') { |
67 | - $orderbyTrans = '' . _MD_POPULARITYMTOL . ''; |
|
67 | + $orderbyTrans = ''._MD_POPULARITYMTOL.''; |
|
68 | 68 | } |
69 | 69 | if ($orderby === 'title ASC') { |
70 | - $orderbyTrans = '' . _MD_TITLEATOZ . ''; |
|
70 | + $orderbyTrans = ''._MD_TITLEATOZ.''; |
|
71 | 71 | } |
72 | 72 | if ($orderby === 'title DESC') { |
73 | - $orderbyTrans = '' . _MD_TITLEZTOA . ''; |
|
73 | + $orderbyTrans = ''._MD_TITLEZTOA.''; |
|
74 | 74 | } |
75 | 75 | if ($orderby === 'date ASC') { |
76 | - $orderbyTrans = '' . _MD_DATEOLD . ''; |
|
76 | + $orderbyTrans = ''._MD_DATEOLD.''; |
|
77 | 77 | } |
78 | 78 | if ($orderby === 'date DESC') { |
79 | - $orderbyTrans = '' . _MD_DATENEW . ''; |
|
79 | + $orderbyTrans = ''._MD_DATENEW.''; |
|
80 | 80 | } |
81 | 81 | if ($orderby === 'rating ASC') { |
82 | - $orderbyTrans = '' . _MD_RATINGLTOH . ''; |
|
82 | + $orderbyTrans = ''._MD_RATINGLTOH.''; |
|
83 | 83 | } |
84 | 84 | if ($orderby === 'rating DESC') { |
85 | - $orderbyTrans = '' . _MD_RATINGHTOL . ''; |
|
85 | + $orderbyTrans = ''._MD_RATINGHTOL.''; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | return $orderbyTrans; |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | $startdate = (time() - (86400 * $count)); |
136 | 136 | if ($startdate < $time) { |
137 | 137 | if ($status == 2) { |
138 | - $new = ' <img src="' . XOOPS_URL . "/modules/$moddir/assets/images/newred.gif\" alt=\"" . _MD_NEWTHISWEEK . '">'; |
|
138 | + $new = ' <img src="'.XOOPS_URL."/modules/$moddir/assets/images/newred.gif\" alt=\""._MD_NEWTHISWEEK.'">'; |
|
139 | 139 | } elseif ($status == 3) { |
140 | - $new = ' <img src="' . XOOPS_URL . "/modules/$moddir/assets/images/update.gif\" alt=\"" . _MD_UPTHISWEEK . '">'; |
|
140 | + $new = ' <img src="'.XOOPS_URL."/modules/$moddir/assets/images/update.gif\" alt=\""._MD_UPTHISWEEK.'">'; |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | { |
153 | 153 | global $xoopsModuleConfig, $moddir; |
154 | 154 | if ($hits >= $xoopsModuleConfig['popular']) { |
155 | - return ' <img src="' . XOOPS_URL . "/modules/$moddir/assets/images/pop.gif\" alt=\"" . _MD_POPULAR . '">'; |
|
155 | + return ' <img src="'.XOOPS_URL."/modules/$moddir/assets/images/pop.gif\" alt=\""._MD_POPULAR.'">'; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | return ''; |
@@ -168,13 +168,13 @@ discard block |
||
168 | 168 | global $xoopsDB, $mytree; |
169 | 169 | $count = 0; |
170 | 170 | $arr = array(); |
171 | - $query = 'SELECT DISTINCT l.itemid FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_items') . ' l, ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_item_x_cat') . ' x WHERE x.itemid=l.itemid AND x.cid=' . $sel_id . ''; |
|
171 | + $query = 'SELECT DISTINCT l.itemid FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_items').' l, '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_item_x_cat').' x WHERE x.itemid=l.itemid AND x.cid='.$sel_id.''; |
|
172 | 172 | if ($status !== '') { |
173 | 173 | $query .= " AND l.status>='$status'"; |
174 | 174 | } else { |
175 | 175 | $query .= ''; |
176 | 176 | } |
177 | - $query .= " AND x.active >= '1'"; |
|
177 | + $query .= " AND x.active >= '1'"; |
|
178 | 178 | $result = $xoopsDB->query($query); |
179 | 179 | //print_r($xoopsDB->fetchArray($result)); |
180 | 180 | if (!$result) { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $arr = $mytree->getAllChildId($sel_id); |
187 | 187 | $size = count($arr); |
188 | 188 | for ($i = 0; $i < $size; ++$i) { |
189 | - $query2 = 'SELECT DISTINCT l.itemid FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_items') . ' l, ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_item_x_cat') . ' x WHERE l.itemid=x.itemid AND x.cid=' . $arr[$i] . ''; |
|
189 | + $query2 = 'SELECT DISTINCT l.itemid FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_items').' l, '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_item_x_cat').' x WHERE l.itemid=x.itemid AND x.cid='.$arr[$i].''; |
|
190 | 190 | if ($status !== '') { |
191 | 191 | $query2 .= " AND l.status>='$status'"; |
192 | 192 | } else { |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | global $xoopsDB, $mytree; |
213 | 213 | $count = 0; |
214 | 214 | $arr = array(); |
215 | - $query = 'SELECT count(*) FROM ' . $xoopsDB->prefix('links_links') . ' t, ' . $xoopsDB->prefix('links_x_loc_dest') . ' x WHERE x.ldestid=t.lid AND x.locdestid=' . $locdestid . ' AND t.cid=' . $sel_id . ''; |
|
215 | + $query = 'SELECT count(*) FROM '.$xoopsDB->prefix('links_links').' t, '.$xoopsDB->prefix('links_x_loc_dest').' x WHERE x.ldestid=t.lid AND x.locdestid='.$locdestid.' AND t.cid='.$sel_id.''; |
|
216 | 216 | // $query = "select DISTINCT count(lid) from ".$xoopsDB->prefix("links_links")." t, ".$xoopsDB->prefix("links_x_loc_dest")." x where x.ldestid=t.lid AND x.locdestid=".$locdestid." AND t.cid=".$sel_id.""; |
217 | 217 | // $query = "select count(*) from ".$xoopsDB->prefix("links_links")." where cid=".$sel_id.""; |
218 | 218 | if ($status !== '') { |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $arr = $mytree->getAllChildId($sel_id); |
225 | 225 | $size = count($arr); |
226 | 226 | for ($i = 0; $i < $size; ++$i) { |
227 | - $query2 = 'select count(*) ' . $xoopsDB->prefix('links_links') . ' t, ' . $xoopsDB->prefix('links_x_loc_dest') . ' x where x.ldestid=t.lid AND x.locdestid=' . $locdestid . ' AND t.cid=' . $arr[$i] . ''; |
|
227 | + $query2 = 'select count(*) '.$xoopsDB->prefix('links_links').' t, '.$xoopsDB->prefix('links_x_loc_dest').' x where x.ldestid=t.lid AND x.locdestid='.$locdestid.' AND t.cid='.$arr[$i].''; |
|
228 | 228 | if ($status !== '') { |
229 | 229 | $query2 .= " and status>=$status"; |
230 | 230 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | global $xoopsDB; |
246 | 246 | $myts = MyTextSanitizer::getInstance(); |
247 | - $result = $xoopsDB->query('SELECT name FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_dir') . " WHERE dirid = '" . $dirid . '\''); |
|
247 | + $result = $xoopsDB->query('SELECT name FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_dir')." WHERE dirid = '".$dirid.'\''); |
|
248 | 248 | $num_results = $GLOBALS['xoopsDB']->getRowsNum($result); |
249 | 249 | if (!$result) { |
250 | 250 | return 0; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | global $xoopsDB; |
267 | 267 | //$block = array(); |
268 | 268 | $myts = MyTextSanitizer::getInstance(); |
269 | - $result = $xoopsDB->query('SELECT title FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat') . " WHERE cid = '" . $cid . '\''); |
|
269 | + $result = $xoopsDB->query('SELECT title FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_cat')." WHERE cid = '".$cid.'\''); |
|
270 | 270 | $num_results = $GLOBALS['xoopsDB']->getRowsNum($result); |
271 | 271 | if (!$result) { |
272 | 272 | return 0; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | } else { |
292 | 292 | $isadmin = false; |
293 | 293 | } |
294 | - $result = $xoopsDB->query('SELECT xid, cid, itemid FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_item_x_cat') . ' WHERE itemid = ' . $get_itemid . " AND active='1'"); |
|
294 | + $result = $xoopsDB->query('SELECT xid, cid, itemid FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_item_x_cat').' WHERE itemid = '.$get_itemid." AND active='1'"); |
|
295 | 295 | $num_results = $GLOBALS['xoopsDB']->getRowsNum($result); |
296 | 296 | if (!$result) { |
297 | 297 | return 0; |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $output .= $path; |
307 | 307 | } |
308 | 308 | if ($isadmin) { |
309 | - $output .= '<br><a href="admin/categories.php?dirid=' . $get_dirid . '">' . _MD_EDITCATEGORIES . '</a>'; |
|
309 | + $output .= '<br><a href="admin/categories.php?dirid='.$get_dirid.'">'._MD_EDITCATEGORIES.'</a>'; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | //$output .= "<br><a href=\"editcategories.php?item=".$get_itemid."\">["._MD_EDIT_CATEGORIES."]</a>"; |
@@ -324,25 +324,25 @@ discard block |
||
324 | 324 | $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = '#DDE'; |
325 | 325 | $tblColors[$currentoption] = 'white'; |
326 | 326 | echo "<table width=100% class='outer'><tr><td align=right> |
327 | - <font size=2>" . $xoopsModule->name() . ':' . $breadcrumb . '</font> |
|
327 | + <font size=2>" . $xoopsModule->name().':'.$breadcrumb.'</font> |
|
328 | 328 | </td></tr></table><br>'; |
329 | 329 | echo '<div id="navcontainer"><ul style="padding: 3px 0; margin-left: |
330 | 330 | 0;font: bold 12px Verdana, sans-serif; ">'; |
331 | 331 | echo '<li style="list-style: none; margin: 0; display: inline; "> |
332 | 332 | <a href="index.php" style="padding: 3px 0.5em; |
333 | 333 | margin-left: 3px; |
334 | - border: 1px solid #778; background: ' . $tblColors[0] . '; |
|
335 | - text-decoration: none; ">' . _MD_A_MODADMIN_HOME . '</a></li>'; |
|
334 | + border: 1px solid #778; background: ' . $tblColors[0].'; |
|
335 | + text-decoration: none; ">' . _MD_A_MODADMIN_HOME.'</a></li>'; |
|
336 | 336 | echo '<li style="list-style: none; margin: 0; display: inline; "> |
337 | 337 | <a href="directories.php" style="padding: 3px 0.5em; |
338 | 338 | margin-left: 3px; |
339 | - border: 1px solid #778; background: ' . $tblColors[1] . '; |
|
340 | - text-decoration: none; ">' . _MD_A_DIRADMIN . '</a></li>'; |
|
339 | + border: 1px solid #778; background: ' . $tblColors[1].'; |
|
340 | + text-decoration: none; ">' . _MD_A_DIRADMIN.'</a></li>'; |
|
341 | 341 | echo '<li style="list-style: none; margin: 0; display: inline; "> |
342 | 342 | <a href="fieldtypes.php" style="padding: 3px 0.5em; |
343 | 343 | margin-left: 3px; |
344 | - border: 1px solid #778; background: ' . $tblColors[2] . '; |
|
345 | - text-decoration: none; ">' . _MD_A_FTYPESADMIN . '</a></li>'; |
|
344 | + border: 1px solid #778; background: ' . $tblColors[2].'; |
|
345 | + text-decoration: none; ">' . _MD_A_FTYPESADMIN.'</a></li>'; |
|
346 | 346 | // echo "<li style=\"list-style: none; margin: 0; display: inline; \"> |
347 | 347 | // <a href=\"addresstypes.php\" style=\"padding: 3px 0.5em; |
348 | 348 | // margin-left: 3px; |
@@ -351,8 +351,8 @@ discard block |
||
351 | 351 | echo '<li style="list-style: none; margin: 0; display: inline; "> |
352 | 352 | <a href="subscriptions.php" style="padding: 3px 0.5em; |
353 | 353 | margin-left: 3px; |
354 | - border: 1px solid #778; background: ' . $tblColors[4] . '; |
|
355 | - text-decoration: none; ">' . _MD_A_ASUBSCRIPTIONSADMIN . '</a></li>'; |
|
354 | + border: 1px solid #778; background: ' . $tblColors[4].'; |
|
355 | + text-decoration: none; ">' . _MD_A_ASUBSCRIPTIONSADMIN.'</a></li>'; |
|
356 | 356 | echo '</div></ul>'; |
357 | 357 | } |
358 | 358 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | { |
365 | 365 | global $xoopsDB; |
366 | 366 | $myts = MyTextSanitizer::getInstance(); |
367 | - $result = $xoopsDB->query('SELECT typename FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_itemtypes') . " WHERE typeid = '" . $typeid . '\''); |
|
367 | + $result = $xoopsDB->query('SELECT typename FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_itemtypes')." WHERE typeid = '".$typeid.'\''); |
|
368 | 368 | $num_results = $xoopsDB->getRowsNum($result); |
369 | 369 | $typename = ''; |
370 | 370 | if (!$result) { |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | { |
387 | 387 | global $xoopsDB; |
388 | 388 | $myts = MyTextSanitizer::getInstance(); |
389 | - $result = $xoopsDB->query('SELECT dirid FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat') . " WHERE cid = '" . $catid . '\''); |
|
389 | + $result = $xoopsDB->query('SELECT dirid FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_cat')." WHERE cid = '".$catid.'\''); |
|
390 | 390 | $num_results = $xoopsDB->getRowsNum($result); |
391 | 391 | $dirid = 0; |
392 | 392 | if (!$result) { |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | { |
409 | 409 | global $xoopsDB; |
410 | 410 | $myts = MyTextSanitizer::getInstance(); |
411 | - $result = $xoopsDB->query('SELECT txtid FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat_txt') . " WHERE cid = '" . $catid . '\''); |
|
411 | + $result = $xoopsDB->query('SELECT txtid FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_cat_txt')." WHERE cid = '".$catid.'\''); |
|
412 | 412 | $num_results = $xoopsDB->getRowsNum($result); |
413 | 413 | $txtid = false; |
414 | 414 | if (!$result) { |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | { |
431 | 431 | global $xoopsDB; |
432 | 432 | $myts = MyTextSanitizer::getInstance(); |
433 | - $result = $xoopsDB->query('SELECT c.tplid, t.name FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat_tpl') . ' c, ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_tpl') . " t WHERE c.tplid=t.tplid AND c.catid = '" . $get_catid . '\''); |
|
433 | + $result = $xoopsDB->query('SELECT c.tplid, t.name FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_cat_tpl').' c, '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_tpl')." t WHERE c.tplid=t.tplid AND c.catid = '".$get_catid.'\''); |
|
434 | 434 | $num_results = $xoopsDB->getRowsNum($result); |
435 | 435 | $tplname = ''; |
436 | 436 | if (!$result) { |
@@ -452,10 +452,10 @@ discard block |
||
452 | 452 | function getCatSelectArea($item = '0', $dirid = '0') |
453 | 453 | { |
454 | 454 | global $xoopsDB, $myts, $eh, $mytree, $moddir, $get_itemid; |
455 | - $sql = 'SELECT c.cid, c.title, c.pid, c.allowlist, x.active FROM ' |
|
456 | - . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat') |
|
455 | + $sql = 'SELECT c.cid, c.title, c.pid, c.allowlist, x.active FROM ' |
|
456 | + . $xoopsDB->prefix($module->getVar('dirname', 'n').'_cat') |
|
457 | 457 | . ' c LEFT JOIN ' |
458 | - . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_item_x_cat') |
|
458 | + . $xoopsDB->prefix($module->getVar('dirname', 'n').'_item_x_cat') |
|
459 | 459 | . ' x ON (c.cid=x.cid AND x.itemid=' |
460 | 460 | . $item |
461 | 461 | . ") WHERE c.dirid='" |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | $output = '<table>'; |
467 | 467 | if ($numrows > 0) { |
468 | 468 | $cats = ''; |
469 | - $output .= '<tr><td class="categoryHeader" colspan="2"><strong>' . _MD_CATTITLE . '</strong></td><td class="categoryHeader"><strong>' . _MD_SELECT . "</strong></td></tr>\n"; |
|
469 | + $output .= '<tr><td class="categoryHeader" colspan="2"><strong>'._MD_CATTITLE.'</strong></td><td class="categoryHeader"><strong>'._MD_SELECT."</strong></td></tr>\n"; |
|
470 | 470 | $brench = 0; |
471 | 471 | $tab = ''; |
472 | 472 | while (list($cid, $title, $pid, $allowlist, $active) = $xoopsDB->fetchRow($mainresult)) { |
@@ -477,15 +477,15 @@ discard block |
||
477 | 477 | } else { |
478 | 478 | $checked = ''; |
479 | 479 | } |
480 | - $checkbox = '<input type="checkbox" name="selected' . $cid . "\"$checked"; |
|
480 | + $checkbox = '<input type="checkbox" name="selected'.$cid."\"$checked"; |
|
481 | 481 | } else { |
482 | 482 | $checkbox = ' '; |
483 | 483 | } |
484 | - $output .= '<tr><td><strong>' . $tab . '' . $title . "</strong></td><td> </td><td>$checkbox</td></tr>\n"; |
|
484 | + $output .= '<tr><td><strong>'.$tab.''.$title."</strong></td><td> </td><td>$checkbox</td></tr>\n"; |
|
485 | 485 | $output .= getCatSelectAreaChildren($cid, 0, $dirid); |
486 | 486 | } |
487 | 487 | } else { |
488 | - $output .= '<tr><td>' . _MD_NORESULTS . '</td></tr>'; |
|
488 | + $output .= '<tr><td>'._MD_NORESULTS.'</td></tr>'; |
|
489 | 489 | } |
490 | 490 | $output .= '</table>'; |
491 | 491 | |
@@ -503,14 +503,14 @@ discard block |
||
503 | 503 | $tab = ' '; |
504 | 504 | $level = $level; |
505 | 505 | $output = ''; |
506 | - $plus = '<img src="' . XOOPS_URL . '/images/arrow.gif">'; |
|
506 | + $plus = '<img src="'.XOOPS_URL.'/images/arrow.gif">'; |
|
507 | 507 | for ($i = 0; $i < $level; ++$i) { |
508 | 508 | $tab .= ' '; |
509 | 509 | } |
510 | - $sql = 'SELECT DISTINCT c.cid, c.title, c.pid, c.allowlist, x.active FROM ' |
|
511 | - . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat') |
|
510 | + $sql = 'SELECT DISTINCT c.cid, c.title, c.pid, c.allowlist, x.active FROM ' |
|
511 | + . $xoopsDB->prefix($module->getVar('dirname', 'n').'_cat') |
|
512 | 512 | . ' c LEFT JOIN ' |
513 | - . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_item_x_cat') |
|
513 | + . $xoopsDB->prefix($module->getVar('dirname', 'n').'_item_x_cat') |
|
514 | 514 | . " x ON (c.cid=x.cid AND x.itemid='" |
515 | 515 | . $get_itemid |
516 | 516 | . '\') WHERE c.dirid=\'' |
@@ -528,11 +528,11 @@ discard block |
||
528 | 528 | } else { |
529 | 529 | $checked = ''; |
530 | 530 | } |
531 | - $checkbox = '<input type="checkbox" name="selected' . $cid . "\"$checked"; |
|
531 | + $checkbox = '<input type="checkbox" name="selected'.$cid."\"$checked"; |
|
532 | 532 | } else { |
533 | 533 | $checkbox = ' '; |
534 | 534 | } |
535 | - $output .= '<tr><td><strong>' . $tab . '' . $plus . ' ' . $title . "</td><td> </strong></td><td align=\"center\">$checkbox</td></tr>\n"; |
|
535 | + $output .= '<tr><td><strong>'.$tab.''.$plus.' '.$title."</td><td> </strong></td><td align=\"center\">$checkbox</td></tr>\n"; |
|
536 | 536 | $newlevel = $level + 1; |
537 | 537 | $output .= getCatSelectAreaChildren($cid, $newlevel); |
538 | 538 | } |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | $block = array(); |
552 | 552 | $myts = MyTextSanitizer::getInstance(); |
553 | 553 | $dirid = 0; |
554 | - $result = $xoopsDB->query('SELECT dirid FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_items') . ' WHERE itemid = ' . $item . ''); |
|
554 | + $result = $xoopsDB->query('SELECT dirid FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_items').' WHERE itemid = '.$item.''); |
|
555 | 555 | $num_results = $xoopsDB->getRowsNum($result); |
556 | 556 | if (!$result) { |
557 | 557 | return 0; |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | $block = array(); |
575 | 575 | $myts = MyTextSanitizer::getInstance(); |
576 | 576 | $userid = 0; |
577 | - $result = $xoopsDB->query('SELECT uid FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_items') . ' WHERE itemid = ' . $item . ''); |
|
577 | + $result = $xoopsDB->query('SELECT uid FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_items').' WHERE itemid = '.$item.''); |
|
578 | 578 | $num_results = $xoopsDB->getRowsNum($result); |
579 | 579 | if (!$result) { |
580 | 580 | return 0; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | function updaterating($sel_id) |
595 | 595 | { |
596 | 596 | global $xoopsDB; |
597 | - $query = 'SELECT rating FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_votedata') . ' WHERE itemid = ' . $sel_id . ''; |
|
597 | + $query = 'SELECT rating FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_votedata').' WHERE itemid = '.$sel_id.''; |
|
598 | 598 | $voteresult = $xoopsDB->query($query); |
599 | 599 | $votesDB = $xoopsDB->getRowsNum($voteresult); |
600 | 600 | $totalrating = 0; |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | } |
604 | 604 | $finalrating = $totalrating / $votesDB; |
605 | 605 | $finalrating = number_format($finalrating, 4); |
606 | - $query = 'UPDATE ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_items') . " SET rating=$finalrating, votes=$votesDB WHERE itemid = $sel_id"; |
|
606 | + $query = 'UPDATE '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_items')." SET rating=$finalrating, votes=$votesDB WHERE itemid = $sel_id"; |
|
607 | 607 | $xoopsDB->query($query) or exit(); |
608 | 608 | } |
609 | 609 | |
@@ -619,9 +619,9 @@ discard block |
||
619 | 619 | $dirid = 0; |
620 | 620 | $addressarray = array(); |
621 | 621 | if ($typeid == '0') { |
622 | - $result = $xoopsDB->query('SELECT typeid, address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country, typename, uselocyn FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_address_types') . " WHERE defaultyn = '1'"); |
|
622 | + $result = $xoopsDB->query('SELECT typeid, address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country, typename, uselocyn FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_address_types')." WHERE defaultyn = '1'"); |
|
623 | 623 | } else { |
624 | - $result = $xoopsDB->query('SELECT typeid, address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country, typename, uselocyn FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_address_types') . " WHERE typeid = '$typeid'"); |
|
624 | + $result = $xoopsDB->query('SELECT typeid, address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country, typename, uselocyn FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_address_types')." WHERE typeid = '$typeid'"); |
|
625 | 625 | } |
626 | 626 | $num_results = $xoopsDB->getRowsNum($result); |
627 | 627 | if (!$result) { |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | global $xoopsDB; |
661 | 661 | $myts = MyTextSanitizer::getInstance(); |
662 | 662 | $addressarray = array(); |
663 | - $result = $xoopsDB->query('SELECT address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_addresses') . " WHERE addrid = '$addrid'"); |
|
663 | + $result = $xoopsDB->query('SELECT address, address2, zip, postcode, lat, lon, phone, fax, mobile, city, country FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_addresses')." WHERE addrid = '$addrid'"); |
|
664 | 664 | $num_results = $xoopsDB->getRowsNum($result); |
665 | 665 | if ($num_results == 0) { |
666 | 666 | $addressarray = array('address' => '', 'address2' => '', 'zip' => '', 'postcode' => '', 'lat' => '', 'lon' => '', 'phone' => '', 'fax' => '', 'mobile' => '', 'city' => '', 'country' => ''); |
@@ -695,20 +695,20 @@ discard block |
||
695 | 695 | } else { |
696 | 696 | $isadmin = false; |
697 | 697 | } |
698 | - $sql = 'SELECT cid, title, pid, allowlist FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat') . " WHERE dirid='" . $get_dirid . '\' AND pid=\'0\' AND active=\'1\''; |
|
698 | + $sql = 'SELECT cid, title, pid, allowlist FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_cat')." WHERE dirid='".$get_dirid.'\' AND pid=\'0\' AND active=\'1\''; |
|
699 | 699 | $mainresult = $xoopsDB->query($sql); |
700 | 700 | $numrows = $xoopsDB->getRowsNum($mainresult); |
701 | 701 | $output = ''; |
702 | 702 | if ($numrows > 0) { |
703 | 703 | $cats = ''; |
704 | - $output = '<table class="categoryTable"><tr><td class="categoryHeader" colspan="2"><strong>' . _MD_CATTITLE . '</strong></td><td class="categoryHeader"><strong>' . _MD_SELECT . "</strong></td></tr>\n"; |
|
704 | + $output = '<table class="categoryTable"><tr><td class="categoryHeader" colspan="2"><strong>'._MD_CATTITLE.'</strong></td><td class="categoryHeader"><strong>'._MD_SELECT."</strong></td></tr>\n"; |
|
705 | 705 | $brench = 0; |
706 | 706 | $tab = ''; |
707 | 707 | $selectablecat = false; |
708 | 708 | while (list($cid, $title, $pid, $allowlist) = $xoopsDB->fetchRow($mainresult)) { |
709 | 709 | //For each cid, get all 'first children' using getFirstChildId() function |
710 | 710 | if ($allowlist != '0') { |
711 | - $checkbox = '<input type="checkbox" name="selected' . $cid . '"'; |
|
711 | + $checkbox = '<input type="checkbox" name="selected'.$cid.'"'; |
|
712 | 712 | $selectablecat = true; |
713 | 713 | //$checked = ""; |
714 | 714 | } else { |
@@ -716,23 +716,23 @@ discard block |
||
716 | 716 | $checkbox = ' '; |
717 | 717 | } |
718 | 718 | //$cats .= $cid."|"; |
719 | - $output .= '<tr><td><strong>' . $tab . '' . $title . "</strong></td><td> </td><td align=\"center\">$checkbox</td></tr>\n"; |
|
719 | + $output .= '<tr><td><strong>'.$tab.''.$title."</strong></td><td> </td><td align=\"center\">$checkbox</td></tr>\n"; |
|
720 | 720 | $output .= getCatSelectAreaChildren2($cid); |
721 | 721 | if ($output !== '') { |
722 | 722 | $selectablecat = true; |
723 | 723 | } |
724 | 724 | } |
725 | 725 | } else { |
726 | - redirect_header(XOOPS_URL . "/modules/$moddir/index.php?dirid=$get_dirid", 2, _MD_NOACTIVECATEGORIES); |
|
726 | + redirect_header(XOOPS_URL."/modules/$moddir/index.php?dirid=$get_dirid", 2, _MD_NOACTIVECATEGORIES); |
|
727 | 727 | exit(); |
728 | 728 | //$output = ""._MD_NORESULTS.""; |
729 | 729 | } |
730 | 730 | if ($isadmin) { |
731 | - $output .= '<tr><td><br><a href="admin/categories.php?dirid=' . $get_dirid . '">' . _MD_EDITCATEGORIES . '</a></td></tr>'; |
|
731 | + $output .= '<tr><td><br><a href="admin/categories.php?dirid='.$get_dirid.'">'._MD_EDITCATEGORIES.'</a></td></tr>'; |
|
732 | 732 | } |
733 | 733 | $output .= '</table>'; |
734 | 734 | if ($selectablecat === false) { |
735 | - redirect_header(XOOPS_URL . "/modules/$moddir/index.php?dirid=$get_dirid", 2, _MD_NOACTIVECATEGORIES); |
|
735 | + redirect_header(XOOPS_URL."/modules/$moddir/index.php?dirid=$get_dirid", 2, _MD_NOACTIVECATEGORIES); |
|
736 | 736 | exit(); |
737 | 737 | } |
738 | 738 | |
@@ -750,21 +750,21 @@ discard block |
||
750 | 750 | $tab = ' '; |
751 | 751 | $level = $level; |
752 | 752 | $output = ''; |
753 | - $plus = '<img src="' . XOOPS_URL . '/images/arrow.gif">'; |
|
753 | + $plus = '<img src="'.XOOPS_URL.'/images/arrow.gif">'; |
|
754 | 754 | for ($i = 0; $i < $level; ++$i) { |
755 | 755 | $tab .= ' '; |
756 | 756 | } |
757 | - $sql = 'SELECT cid, title, pid, allowlist FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_cat') . " WHERE dirid='" . (int)$get_dirid . '\' AND pid=\'' . (int)$childid . '\' AND active=\'1\''; |
|
757 | + $sql = 'SELECT cid, title, pid, allowlist FROM '.$xoopsDB->prefix($module->getVar('dirname', 'n').'_cat')." WHERE dirid='".(int) $get_dirid.'\' AND pid=\''.(int) $childid.'\' AND active=\'1\''; |
|
758 | 758 | $childresult = $xoopsDB->query($sql); |
759 | 759 | $numrows = $xoopsDB->getRowsNum($childresult); |
760 | 760 | if ($numrows > 0) { |
761 | 761 | while (list($cid, $title, $pid, $allowlist) = $xoopsDB->fetchRow($childresult)) { |
762 | 762 | if ($allowlist != '0') { |
763 | - $checkbox = '<input type="checkbox" name="selected' . $cid . '"'; |
|
763 | + $checkbox = '<input type="checkbox" name="selected'.$cid.'"'; |
|
764 | 764 | } else { |
765 | 765 | $checkbox = ' '; |
766 | 766 | } |
767 | - $output .= '<tr><td><strong>' . $tab . '' . $plus . ' ' . $title . "</td><td> </strong></td><td align=\"center\">$checkbox</td></tr>\n"; |
|
767 | + $output .= '<tr><td><strong>'.$tab.''.$plus.' '.$title."</td><td> </strong></td><td align=\"center\">$checkbox</td></tr>\n"; |
|
768 | 768 | $newlevel = $level + 1; |
769 | 769 | $output .= getCatSelectAreaChildren($cid, $newlevel, $get_dirid); |
770 | 770 | } |
@@ -18,26 +18,26 @@ discard block |
||
18 | 18 | * @author XOOPS Development Team, |
19 | 19 | */ |
20 | 20 | |
21 | -require_once __DIR__ . '/admin_header.php'; |
|
21 | +require_once __DIR__.'/admin_header.php'; |
|
22 | 22 | //include __DIR__ . '/../../../include/cp_header.php'; |
23 | 23 | |
24 | -include __DIR__ . '/../include/functions.php'; |
|
25 | -require_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
26 | -require_once XOOPS_ROOT_PATH . '/include/xoopscodes.php'; |
|
27 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
28 | -require_once XOOPS_ROOT_PATH . '/class/module.errorhandler.php'; |
|
24 | +include __DIR__.'/../include/functions.php'; |
|
25 | +require_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
26 | +require_once XOOPS_ROOT_PATH.'/include/xoopscodes.php'; |
|
27 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
28 | +require_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php'; |
|
29 | 29 | $myts = MyTextSanitizer::getInstance(); |
30 | 30 | $eh = new ErrorHandler; |
31 | -$mytree = new XoopsTree($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_cat'), 'cid', 'pid'); |
|
32 | -$mytree2 = new XoopsTree($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_fieldtypes'), 'typeid', 0); |
|
31 | +$mytree = new XoopsTree($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_cat'), 'cid', 'pid'); |
|
32 | +$mytree2 = new XoopsTree($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_fieldtypes'), 'typeid', 0); |
|
33 | 33 | |
34 | 34 | $moddir = $xoopsModule->getVar('dirname'); |
35 | 35 | |
36 | 36 | if (isset($_GET['dirid'])) { |
37 | - $get_dirid = (int)$_GET['dirid']; |
|
37 | + $get_dirid = (int) $_GET['dirid']; |
|
38 | 38 | } |
39 | 39 | if (isset($_GET['typeid'])) { |
40 | - $get_typeid = (int)$_GET['typeid']; |
|
40 | + $get_typeid = (int) $_GET['typeid']; |
|
41 | 41 | } |
42 | 42 | $fieldtypes = array( |
43 | 43 | '0' => '---', |
@@ -63,17 +63,17 @@ discard block |
||
63 | 63 | $adminObject = \Xmf\Module\Admin::getInstance(); |
64 | 64 | $adminObject->displayNavigation(basename(__FILE__)); |
65 | 65 | //adminmenu(2, _MD_A_FTYPESADMIN); |
66 | - echo '<h4>' . _MD_FTYPECONF . '</h4>'; |
|
66 | + echo '<h4>'._MD_FTYPECONF.'</h4>'; |
|
67 | 67 | echo "<table width='100%' border='0' cellspacing='1' class='outer'>"; |
68 | - $result = $xoopsDB->query('SELECT typeid, title, fieldtype, descr, ext, activeyn FROM ' . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_fieldtypes') . ' ORDER BY fieldtype ASC') or $eh->show('0013'); |
|
68 | + $result = $xoopsDB->query('SELECT typeid, title, fieldtype, descr, ext, activeyn FROM '.$xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_fieldtypes').' ORDER BY fieldtype ASC') or $eh->show('0013'); |
|
69 | 69 | $numrows = $xoopsDB->getRowsNum($result); |
70 | - echo '<tr><th>' . _MD_TITLE . '</th><th>' . _MD_TYPE . '</th><th>' . _MD_EXT . '</th><th>' . _MD_ACTIVE . "</th></tr>\n"; |
|
70 | + echo '<tr><th>'._MD_TITLE.'</th><th>'._MD_TYPE.'</th><th>'._MD_EXT.'</th><th>'._MD_ACTIVE."</th></tr>\n"; |
|
71 | 71 | if ($numrows > 0) { |
72 | 72 | while (list($typeid, $title, $type, $descr, $ext, $status) = $xoopsDB->fetchRow($result)) { |
73 | 73 | if ($status != '0') { |
74 | - $statusyn = '' . _MD_YES . ''; |
|
74 | + $statusyn = ''._MD_YES.''; |
|
75 | 75 | } else { |
76 | - $statusyn = '' . _MD_NO . ''; |
|
76 | + $statusyn = ''._MD_NO.''; |
|
77 | 77 | } |
78 | 78 | echo '<tr><td class="even" valign="top"><a href="' |
79 | 79 | . XOOPS_URL |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | echo "</td></tr>\n"; |
84 | 84 | } |
85 | 85 | } else { |
86 | - echo '<tr><td>' . _MD_NORESULTS . '</td></tr>'; |
|
86 | + echo '<tr><td>'._MD_NORESULTS.'</td></tr>'; |
|
87 | 87 | } |
88 | 88 | echo '</table>'; |
89 | 89 | echo '<br>'; |
90 | - echo '<h4>' . _MD_CREATE_NEWFTYPE . '</h4>'; |
|
90 | + echo '<h4>'._MD_CREATE_NEWFTYPE.'</h4>'; |
|
91 | 91 | echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>"; |
92 | 92 | $form = new XoopsThemeForm(_MD_NEWFTYPEFORM, 'submitform', 'fieldtypes.php'); |
93 | 93 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $ext_text = new XoopsFormText('', 'ext', 80, 150, ''); |
102 | 102 | $ext_text->setExtra('disabled=true'); |
103 | 103 | $ext_text->setExtra('style=\'background-color:lightgrey\''); |
104 | - $ext_button = new XoopsFormLabel('', '<INPUT type="button" value="' . _MD_SET_EXT . "\", onClick=\"openExtManager('submitform','" . XOOPS_URL . '/modules/' . $moddir . "/admin/extensionmanager.php','field_type', '" . _MD_SELECT_FORMTYPE . '\')">'); |
|
104 | + $ext_button = new XoopsFormLabel('', '<INPUT type="button" value="'._MD_SET_EXT."\", onClick=\"openExtManager('submitform','".XOOPS_URL.'/modules/'.$moddir."/admin/extensionmanager.php','field_type', '"._MD_SELECT_FORMTYPE.'\')">'); |
|
105 | 105 | $ext_tray->addElement($ext_text); |
106 | 106 | $ext_tray->addElement($ext_button); |
107 | 107 | $form->addElement($ext_tray); |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | global $xoopsDB, $mytree, $mytree2, $xoopsUser, $get_typeid, $moddir, $eh, $fieldtypes; |
140 | 140 | xoops_cp_header(); |
141 | 141 | //adminmenu(2, _MD_A_FTYPESADMIN); |
142 | - echo '<h4>' . _MD_VIEW_FIELDTYPE . '</h4>'; |
|
142 | + echo '<h4>'._MD_VIEW_FIELDTYPE.'</h4>'; |
|
143 | 143 | echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>"; |
144 | - $result = $xoopsDB->query('SELECT typeid, title, fieldtype, descr, ext, activeyn FROM ' . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_fieldtypes') . " WHERE typeid='" . $get_typeid . '\'') or $eh->show('0013'); |
|
144 | + $result = $xoopsDB->query('SELECT typeid, title, fieldtype, descr, ext, activeyn FROM '.$xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_fieldtypes')." WHERE typeid='".$get_typeid.'\'') or $eh->show('0013'); |
|
145 | 145 | $numrows = $xoopsDB->getRowsNum($result); |
146 | 146 | if ($numrows > 0) { |
147 | 147 | while (list($typeid, $title, $fieldtype, $descr, $ext, $activeyn) = $xoopsDB->fetchRow($result)) { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $ext_tray = new XoopsFormElementTray(_MD_EXT, ''); |
157 | 157 | $ext_text = new XoopsFormText('', 'ext', 80, 150, "$ext"); |
158 | 158 | $ext_text->setExtra('style=\'background-color:lightgrey\''); |
159 | - $ext_button = new XoopsFormLabel('', '<INPUT type="button" value="' . _MD_SET_EXT . "\", onClick=\"openExtManager('submitform','" . XOOPS_URL . '/modules/' . $moddir . "/admin/extensionmanager.php','field_type', '" . _MD_SELECT_FORMTYPE . '\')">'); |
|
159 | + $ext_button = new XoopsFormLabel('', '<INPUT type="button" value="'._MD_SET_EXT."\", onClick=\"openExtManager('submitform','".XOOPS_URL.'/modules/'.$moddir."/admin/extensionmanager.php','field_type', '"._MD_SELECT_FORMTYPE.'\')">'); |
|
160 | 160 | $ext_tray->addElement($ext_text); |
161 | 161 | $ext_tray->addElement($ext_button); |
162 | 162 | $form->addElement($ext_tray); |
@@ -204,12 +204,12 @@ discard block |
||
204 | 204 | $p_ext = ''; |
205 | 205 | } |
206 | 206 | if (isset($_POST['status'])) { |
207 | - $p_status = (int)$_POST['status']; |
|
207 | + $p_status = (int) $_POST['status']; |
|
208 | 208 | } else { |
209 | 209 | $p_status = 0; |
210 | 210 | } |
211 | - $newid = $xoopsDB->genId($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_fieldtypes') . '_typeid_seq'); |
|
212 | - $sql = sprintf("INSERT INTO %s (typeid, title, fieldtype, descr, ext, activeyn) VALUES (%u, '%s', '%s', '%s', '%s', '%s')", $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_fieldtypes'), $newid, $p_title, $p_fieldtype, $p_descr, $p_ext, $p_status); |
|
211 | + $newid = $xoopsDB->genId($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_fieldtypes').'_typeid_seq'); |
|
212 | + $sql = sprintf("INSERT INTO %s (typeid, title, fieldtype, descr, ext, activeyn) VALUES (%u, '%s', '%s', '%s', '%s', '%s')", $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_fieldtypes'), $newid, $p_title, $p_fieldtype, $p_descr, $p_ext, $p_status); |
|
213 | 213 | $xoopsDB->query($sql) or $eh->show('0013'); |
214 | 214 | redirect_header('fieldtypes.php', 2, _MD_SAVED); |
215 | 215 | exit(); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | { |
220 | 220 | global $xoopsDB, $_POST, $myts, $eh; |
221 | 221 | if (isset($_POST['typeid'])) { |
222 | - $p_typeid = (int)$_POST['typeid']; |
|
222 | + $p_typeid = (int) $_POST['typeid']; |
|
223 | 223 | } else { |
224 | 224 | exit(); |
225 | 225 | } |
@@ -232,11 +232,11 @@ discard block |
||
232 | 232 | $p_ext = ''; |
233 | 233 | } |
234 | 234 | if (isset($_POST['status'])) { |
235 | - $p_status = (int)$_POST['status']; |
|
235 | + $p_status = (int) $_POST['status']; |
|
236 | 236 | } else { |
237 | 237 | $p_status = 0; |
238 | 238 | } |
239 | - $sql = 'UPDATE ' . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_fieldtypes') . " SET title = '$p_title', fieldtype='$p_fieldtype', ext='$p_ext', activeyn='$p_status' WHERE typeid = $p_typeid"; |
|
239 | + $sql = 'UPDATE '.$xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_fieldtypes')." SET title = '$p_title', fieldtype='$p_fieldtype', ext='$p_ext', activeyn='$p_status' WHERE typeid = $p_typeid"; |
|
240 | 240 | $xoopsDB->query($sql) or $eh->show('0013'); |
241 | 241 | redirect_header("fieldtypes.php?op=view&typeid=$p_typeid", 2, _MD_SAVED); |
242 | 242 | exit(); |
@@ -246,29 +246,29 @@ discard block |
||
246 | 246 | { |
247 | 247 | global $xoopsDB, $myts, $eh; |
248 | 248 | if (isset($_POST['dirid'])) { |
249 | - $p_dirid = (int)$_POST['dirid']; |
|
249 | + $p_dirid = (int) $_POST['dirid']; |
|
250 | 250 | } else { |
251 | 251 | exit(); |
252 | 252 | } |
253 | 253 | $p_title = $myts->makeTboxData4Save($_POST['title']); |
254 | - $p_active = (int)$_POST['active']; |
|
255 | - $p_pid = (int)$_POST['pid']; |
|
256 | - $p_allowlist = (int)$_POST['allowlist']; |
|
257 | - $p_showpopular = (int)$_POST['showpopular']; |
|
254 | + $p_active = (int) $_POST['active']; |
|
255 | + $p_pid = (int) $_POST['pid']; |
|
256 | + $p_allowlist = (int) $_POST['allowlist']; |
|
257 | + $p_showpopular = (int) $_POST['showpopular']; |
|
258 | 258 | if (isset($_POST['descr'])) { |
259 | 259 | $p_descr = $myts->makeTareaData4Save($_POST['descr']); |
260 | 260 | } else { |
261 | 261 | $p_descr = ''; |
262 | 262 | } |
263 | - $newid = $xoopsDB->genId($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_cat') . '_cid_seq'); |
|
264 | - $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid) VALUES (%u, %u, '%s', %u, %u)", $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_cat'), $newid, $p_dirid, $p_title, $p_active, $p_pid); |
|
263 | + $newid = $xoopsDB->genId($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_cat').'_cid_seq'); |
|
264 | + $sql = sprintf("INSERT INTO %s (cid, dirid, title, active, pid) VALUES (%u, %u, '%s', %u, %u)", $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_cat'), $newid, $p_dirid, $p_title, $p_active, $p_pid); |
|
265 | 265 | //echo $sql; |
266 | 266 | $xoopsDB->query($sql) or $eh->show('0013'); |
267 | 267 | if ($newid == 0) { |
268 | 268 | $cid = $xoopsDB->getInsertId(); |
269 | 269 | } |
270 | - $newid = $xoopsDB->genId($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_cat_txt') . '_txtid_seq'); |
|
271 | - $sql2 = sprintf("INSERT INTO %s (txtid, cid, TEXT, active, created) VALUES (%u, %u, '%s', %u, '%s')", $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_cat_txt'), $newid, $cid, $p_descr, '1', time()); |
|
270 | + $newid = $xoopsDB->genId($xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_cat_txt').'_txtid_seq'); |
|
271 | + $sql2 = sprintf("INSERT INTO %s (txtid, cid, TEXT, active, created) VALUES (%u, %u, '%s', %u, '%s')", $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_cat_txt'), $newid, $cid, $p_descr, '1', time()); |
|
272 | 272 | //echo $sql2; |
273 | 273 | $xoopsDB->query($sql2) or $eh->show('0013'); |
274 | 274 | redirect_header("categories.php?op=edit&cid=$newid", 0, _MD_CAT_UPDATED); |
@@ -298,19 +298,19 @@ discard block |
||
298 | 298 | function getCatOverview() |
299 | 299 | { |
300 | 300 | global $xoopsDB, $myts, $eh, $mytree, $get_dirid, $moddir; |
301 | - $mainresult = $xoopsDB->query('SELECT cid, title, active, pid FROM ' . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_cat') . " WHERE dirid='" . $get_dirid . '\' AND pid=\'0\''); |
|
301 | + $mainresult = $xoopsDB->query('SELECT cid, title, active, pid FROM '.$xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_cat')." WHERE dirid='".$get_dirid.'\' AND pid=\'0\''); |
|
302 | 302 | $numrows = $xoopsDB->getRowsNum($mainresult); |
303 | 303 | $output = ''; |
304 | 304 | if ($numrows > 0) { |
305 | - $output = '<th>' . _MD_CATTITLE . '</th><th>' . _MD_ACTIVEYN . '</th><th>' . _MD_PARENTCAT . "</th>\n"; |
|
305 | + $output = '<th>'._MD_CATTITLE.'</th><th>'._MD_ACTIVEYN.'</th><th>'._MD_PARENTCAT."</th>\n"; |
|
306 | 306 | $brench = 0; |
307 | 307 | $tab = ''; |
308 | 308 | while (list($cid, $title, $activeyn, $pid) = $xoopsDB->fetchRow($mainresult)) { |
309 | - $output .= '<tr><td>' . $tab . '<a href="' . XOOPS_URL . "/modules/$moddir/admin/categories.php?op=edit&cid=$cid\">" . $title . '</a></td><td>' . $activeyn . "</td></tr>\n"; |
|
309 | + $output .= '<tr><td>'.$tab.'<a href="'.XOOPS_URL."/modules/$moddir/admin/categories.php?op=edit&cid=$cid\">".$title.'</a></td><td>'.$activeyn."</td></tr>\n"; |
|
310 | 310 | $output .= getChildrenCategories($cid); |
311 | 311 | } |
312 | 312 | } else { |
313 | - $output = '' . _MD_NORESULTS . ''; |
|
313 | + $output = ''._MD_NORESULTS.''; |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | return $output; |
@@ -322,17 +322,17 @@ discard block |
||
322 | 322 | $firstchildcats = $mytree->getFirstChildId($childid); |
323 | 323 | $tab = ''; |
324 | 324 | $output = ''; |
325 | - $plus = '<img src="' . XOOPS_URL . "\images\arrow.jpg\">"; |
|
325 | + $plus = '<img src="'.XOOPS_URL."\images\arrow.jpg\">"; |
|
326 | 326 | for ($i = 0; $i < $level; ++$i) { |
327 | 327 | $tab .= ' '; |
328 | 328 | } |
329 | 329 | foreach ($firstchildcats as $childid) { |
330 | - $childresult = $xoopsDB->query('SELECT cid, title, active, pid FROM ' . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_cat') . " WHERE pid='" . $childid . '\''); |
|
330 | + $childresult = $xoopsDB->query('SELECT cid, title, active, pid FROM '.$xoopsDB->prefix($xoopsModule->getVar('dirname', 'n').'_cat')." WHERE pid='".$childid.'\''); |
|
331 | 331 | //$childresult = $xoopsDB->query("SELECT cid, title, active, pid FROM ".$xoopsDB->prefix("efqdiralpha1_cat")." WHERE dirid='".$dirid."' AND pid='".$childid."'"); |
332 | 332 | $numrows = $xoopsDB->getRowsNum($childresult); |
333 | 333 | if ($numrows > 0) { |
334 | 334 | while (list($cid, $title, $activeyn, $pid) = $xoopsDB->fetchRow($childresult)) { |
335 | - $output .= '<tr><td>' . $tab . '' . $plus . '</td><td>' . $title . '</td><td>' . $activeyn . "</td></tr>\n"; |
|
335 | + $output .= '<tr><td>'.$tab.''.$plus.'</td><td>'.$title.'</td><td>'.$activeyn."</td></tr>\n"; |
|
336 | 336 | $newlevel = ++$level; |
337 | 337 | $output .= getChildrenCategories($cid, $newlevel); |
338 | 338 | } |