@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @since 2.0.0 |
16 | 16 | */ |
17 | 17 | |
18 | -include __DIR__ . '/mainfile.php'; |
|
18 | +include __DIR__.'/mainfile.php'; |
|
19 | 19 | |
20 | 20 | $xoopsPreload = XoopsPreload::getInstance(); |
21 | 21 | $xoopsPreload->triggerEvent('core.lostpass.start'); |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | $areyou = substr($getuser[0]->getVar('pass'), 0, 5); |
43 | 43 | if ($code != '' && $areyou == $code) { |
44 | 44 | $newpass = xoops_makepass(); |
45 | - $xoopsMailer =& xoops_getMailer(); |
|
45 | + $xoopsMailer = & xoops_getMailer(); |
|
46 | 46 | $xoopsMailer->useMail(); |
47 | 47 | $xoopsMailer->setTemplate('lostpass2.tpl'); |
48 | 48 | $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']); |
49 | 49 | $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
50 | - $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
50 | + $xoopsMailer->assign('SITEURL', XOOPS_URL.'/'); |
|
51 | 51 | $xoopsMailer->assign('IP', $_SERVER['REMOTE_ADDR']); |
52 | 52 | $xoopsMailer->assign('NEWPWD', $newpass); |
53 | 53 | $xoopsMailer->setToUsers($getuser[0]); |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | redirect_header('user.php', 3, sprintf(_US_PWDMAILED, $getuser[0]->getVar('uname')), false); |
74 | 74 | // If no Code, send it |
75 | 75 | } else { |
76 | - $xoopsMailer =& xoops_getMailer(); |
|
76 | + $xoopsMailer = & xoops_getMailer(); |
|
77 | 77 | $xoopsMailer->useMail(); |
78 | 78 | $xoopsMailer->setTemplate('lostpass1.tpl'); |
79 | 79 | $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']); |
80 | 80 | $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
81 | - $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
81 | + $xoopsMailer->assign('SITEURL', XOOPS_URL.'/'); |
|
82 | 82 | $xoopsMailer->assign('IP', $_SERVER['REMOTE_ADDR']); |
83 | - $xoopsMailer->assign('NEWPWD_LINK', XOOPS_URL . '/lostpass.php?email=' . $email . '&code=' . $areyou); |
|
83 | + $xoopsMailer->assign('NEWPWD_LINK', XOOPS_URL.'/lostpass.php?email='.$email.'&code='.$areyou); |
|
84 | 84 | $xoopsMailer->setToUsers($getuser[0]); |
85 | 85 | $xoopsMailer->setFromEmail($xoopsConfig['adminmail']); |
86 | 86 | $xoopsMailer->setFromName($xoopsConfig['sitename']); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @since 2.0.0 |
16 | 16 | */ |
17 | 17 | |
18 | -include __DIR__ . '/mainfile.php'; |
|
18 | +include __DIR__.'/mainfile.php'; |
|
19 | 19 | $xoopsPreload = XoopsPreload::getInstance(); |
20 | 20 | $xoopsPreload->triggerEvent('core.readpmsg.start'); |
21 | 21 | |
@@ -50,60 +50,60 @@ discard block |
||
50 | 50 | $criteria->setStart($start); |
51 | 51 | $criteria->setSort('msg_time'); |
52 | 52 | $pm_arr = $pm_handler->getObjects($criteria); |
53 | - echo '<div><h4>' . _PM_PRIVATEMESSAGE . "</h4></div><br><a href='userinfo.php?uid=" . $xoopsUser->getVar('uid') . "' title=''>" . _PM_PROFILE . "</a> <span class='bold'>»</span> <a href='viewpmsg.php' title=''>" . _PM_INBOX . "</a> <span class='bold'>»</span> \n"; |
|
53 | + echo '<div><h4>'._PM_PRIVATEMESSAGE."</h4></div><br><a href='userinfo.php?uid=".$xoopsUser->getVar('uid')."' title=''>"._PM_PROFILE."</a> <span class='bold'>»</span> <a href='viewpmsg.php' title=''>"._PM_INBOX."</a> <span class='bold'>»</span> \n"; |
|
54 | 54 | if (empty($pm_arr)) { |
55 | - echo '<br><br>' . _PM_YOUDONTHAVE; |
|
55 | + echo '<br><br>'._PM_YOUDONTHAVE; |
|
56 | 56 | } else { |
57 | 57 | if (!$pm_handler->setRead($pm_arr[0])) { |
58 | 58 | //echo "failed"; |
59 | 59 | } |
60 | - echo $pm_arr[0]->getVar('subject') . "<br><form action='readpmsg.php' method='post' name='delete" . $pm_arr[0]->getVar('msg_id') . "'><table cellpadding='4' cellspacing='1' class='outer width100 bnone'><tr><th colspan='2'>" . _PM_FROM . "</th></tr><tr class='even'>\n"; |
|
60 | + echo $pm_arr[0]->getVar('subject')."<br><form action='readpmsg.php' method='post' name='delete".$pm_arr[0]->getVar('msg_id')."'><table cellpadding='4' cellspacing='1' class='outer width100 bnone'><tr><th colspan='2'>"._PM_FROM."</th></tr><tr class='even'>\n"; |
|
61 | 61 | $poster = new XoopsUser($pm_arr[0]->getVar('from_userid')); |
62 | 62 | if (!$poster->isActive()) { |
63 | 63 | $poster = false; |
64 | 64 | } |
65 | 65 | echo "<td valign='top'>"; |
66 | 66 | if ($poster != false) { // we need to do this for deleted users |
67 | - echo "<a href='userinfo.php?uid=" . $poster->getVar('uid') . "' title=''>" . $poster->getVar('uname') . "</a><br>\n"; |
|
67 | + echo "<a href='userinfo.php?uid=".$poster->getVar('uid')."' title=''>".$poster->getVar('uname')."</a><br>\n"; |
|
68 | 68 | if ($poster->getVar('user_avatar') != '') { |
69 | - echo "<img src='uploads/" . $poster->getVar('user_avatar') . "' alt='' /><br>\n"; |
|
69 | + echo "<img src='uploads/".$poster->getVar('user_avatar')."' alt='' /><br>\n"; |
|
70 | 70 | } |
71 | 71 | if ($poster->getVar('user_from') != '') { |
72 | - echo _PM_FROMC . '' . $poster->getVar('user_from') . "<br><br>\n"; |
|
72 | + echo _PM_FROMC.''.$poster->getVar('user_from')."<br><br>\n"; |
|
73 | 73 | } |
74 | 74 | if ($poster->isOnline()) { |
75 | - echo "<span class='red bold'>" . _PM_ONLINE . "</span><br><br>\n"; |
|
75 | + echo "<span class='red bold'>"._PM_ONLINE."</span><br><br>\n"; |
|
76 | 76 | } |
77 | 77 | } else { |
78 | 78 | echo $xoopsConfig['anonymous']; // we need to do this for deleted users |
79 | 79 | } |
80 | 80 | $iconName = htmlspecialchars($pm_arr[0]->getVar('msg_image', 'E'), ENT_QUOTES); |
81 | 81 | if ($iconName != '') { |
82 | - echo "</td><td><img src='images/subject/" . $iconName . "' alt='' /> " . _PM_SENTC . '' . formatTimestamp($pm_arr[0]->getVar('msg_time')); |
|
82 | + echo "</td><td><img src='images/subject/".$iconName."' alt='' /> "._PM_SENTC.''.formatTimestamp($pm_arr[0]->getVar('msg_time')); |
|
83 | 83 | } else { |
84 | - echo '</td><td>' . _PM_SENTC . '' . formatTimestamp($pm_arr[0]->getVar('msg_time')); |
|
84 | + echo '</td><td>'._PM_SENTC.''.formatTimestamp($pm_arr[0]->getVar('msg_time')); |
|
85 | 85 | } |
86 | 86 | |
87 | - echo '<hr /><br><strong>' . $pm_arr[0]->getVar('subject') . "</strong><br><br>\n"; |
|
88 | - echo $pm_arr[0]->getVar('msg_text') . "<br><br></td></tr><tr class='foot'><td class='width20 txtleft' colspan='2'>"; |
|
87 | + echo '<hr /><br><strong>'.$pm_arr[0]->getVar('subject')."</strong><br><br>\n"; |
|
88 | + echo $pm_arr[0]->getVar('msg_text')."<br><br></td></tr><tr class='foot'><td class='width20 txtleft' colspan='2'>"; |
|
89 | 89 | // we don't want to reply to a deleted user! |
90 | 90 | if ($poster != false) { |
91 | - echo "<button type='button' class='btn btn-default' onclick='openWithSelfMain(\"" . XOOPS_URL . '/pmlite.php?reply=1&msg_id=' . $pm_arr[0]->getVar('msg_id') . "\",\"pmlite\",565,500);' title='" . _PM_REPLY . "'><span class='fa fa-fw fa-reply'></span></button>\n"; |
|
91 | + echo "<button type='button' class='btn btn-default' onclick='openWithSelfMain(\"".XOOPS_URL.'/pmlite.php?reply=1&msg_id='.$pm_arr[0]->getVar('msg_id')."\",\"pmlite\",565,500);' title='"._PM_REPLY."'><span class='fa fa-fw fa-reply'></span></button>\n"; |
|
92 | 92 | } |
93 | 93 | echo "<input type='hidden' name='delete' value='1' />"; |
94 | 94 | echo $GLOBALS['xoopsSecurity']->getTokenHTML(); |
95 | - echo "<input type='hidden' name='msg_id' value='" . $pm_arr[0]->getVar('msg_id') . "' />"; |
|
96 | - echo "<button type='button' class='btn btn-default' onclick='document.delete" . $pm_arr[0]->getVar('msg_id') . ".submit();' title='" . _PM_DELETE . "'><span class='fa fa-fw fa-remove'></span></button>"; |
|
95 | + echo "<input type='hidden' name='msg_id' value='".$pm_arr[0]->getVar('msg_id')."' />"; |
|
96 | + echo "<button type='button' class='btn btn-default' onclick='document.delete".$pm_arr[0]->getVar('msg_id').".submit();' title='"._PM_DELETE."'><span class='fa fa-fw fa-remove'></span></button>"; |
|
97 | 97 | echo "</td></tr><tr><td class='txtright' colspan='2'>"; |
98 | 98 | $previous = $start - 1; |
99 | 99 | $next = $start + 1; |
100 | 100 | if ($previous >= 0) { |
101 | - echo "<a href='readpmsg.php?start=" . $previous . '&total_messages=' . $total_messages . "' title=''>" . _PM_PREVIOUS . '</a> | '; |
|
101 | + echo "<a href='readpmsg.php?start=".$previous.'&total_messages='.$total_messages."' title=''>"._PM_PREVIOUS.'</a> | '; |
|
102 | 102 | } else { |
103 | - echo _PM_PREVIOUS . ' | '; |
|
103 | + echo _PM_PREVIOUS.' | '; |
|
104 | 104 | } |
105 | 105 | if ($next < $total_messages) { |
106 | - echo "<a href='readpmsg.php?start=" . $next . '&total_messages=' . $total_messages . "' title=''>" . _PM_NEXT . '</a>'; |
|
106 | + echo "<a href='readpmsg.php?start=".$next.'&total_messages='.$total_messages."' title=''>"._PM_NEXT.'</a>'; |
|
107 | 107 | } else { |
108 | 108 | echo _PM_NEXT; |
109 | 109 | } |
@@ -15,26 +15,26 @@ |
||
15 | 15 | * @since 2.0.0 |
16 | 16 | */ |
17 | 17 | |
18 | -include __DIR__ . '/mainfile.php'; |
|
18 | +include __DIR__.'/mainfile.php'; |
|
19 | 19 | |
20 | 20 | header('Content-Type: text/html'); |
21 | -echo '<html><head><title>' . htmlspecialchars($xoopsConfig['sitename']) . "</title> |
|
21 | +echo '<html><head><title>'.htmlspecialchars($xoopsConfig['sitename'])."</title> |
|
22 | 22 | <meta name='HandheldFriendly' content='True' /> |
23 | 23 | <meta name='PalmComputingPlatform' content='True' /> |
24 | 24 | </head> |
25 | 25 | <body>"; |
26 | 26 | |
27 | -$sql = 'SELECT storyid, title FROM ' . $xoopsDB->prefix('stories') . ' WHERE published>0 AND published<' . time() . ' ORDER BY published DESC'; |
|
27 | +$sql = 'SELECT storyid, title FROM '.$xoopsDB->prefix('stories').' WHERE published>0 AND published<'.time().' ORDER BY published DESC'; |
|
28 | 28 | $result = $xoopsDB->query($sql, 10, 0); |
29 | 29 | //TODO Remove this hardcoded string |
30 | 30 | if (!$result) { |
31 | 31 | echo 'An error occured'; |
32 | 32 | } else { |
33 | - echo "<img src='images/logo.gif' alt='" . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "' border='0' /><br>"; |
|
34 | - echo '<h2>' . htmlspecialchars($xoopsConfig['slogan']) . '</h2>'; |
|
33 | + echo "<img src='images/logo.gif' alt='".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)."' border='0' /><br>"; |
|
34 | + echo '<h2>'.htmlspecialchars($xoopsConfig['slogan']).'</h2>'; |
|
35 | 35 | echo '<div>'; |
36 | 36 | while (false !== (list($storyid, $title) = $xoopsDB->fetchRow($result))) { |
37 | - echo "<a href='" . XOOPS_URL . "/modules/news/print.php?storyid=$storyid'>" . htmlspecialchars($title) . '</a><br>'; |
|
37 | + echo "<a href='".XOOPS_URL."/modules/news/print.php?storyid=$storyid'>".htmlspecialchars($title).'</a><br>'; |
|
38 | 38 | } |
39 | 39 | echo '</div>'; |
40 | 40 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if ($action === 'search') { |
93 | 93 | include $GLOBALS['xoops']->path('header.php'); |
94 | 94 | include $GLOBALS['xoops']->path('include/searchform.php'); |
95 | - $xoopsTpl->assign('form', $search_form->render()); |
|
95 | + $xoopsTpl->assign('form', $search_form->render()); |
|
96 | 96 | include $GLOBALS['xoops']->path('footer.php'); |
97 | 97 | exit(); |
98 | 98 | } |
@@ -139,28 +139,28 @@ discard block |
||
139 | 139 | } |
140 | 140 | $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); |
141 | 141 | include $GLOBALS['xoops']->path('header.php'); |
142 | - $xoopsTpl->assign('results', true); |
|
142 | + $xoopsTpl->assign('results', true); |
|
143 | 143 | $nomatch = true; |
144 | - $keywords = ''; |
|
145 | - $error_length = ''; |
|
146 | - $error_keywords = ''; |
|
144 | + $keywords = ''; |
|
145 | + $error_length = ''; |
|
146 | + $error_keywords = ''; |
|
147 | 147 | if ($andor !== 'exact') { |
148 | 148 | foreach ($queries as $q) { |
149 | - $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
149 | + $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
150 | 150 | } |
151 | 151 | if (!empty($ignored_queries)) { |
152 | - $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
|
152 | + $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
|
153 | 153 | foreach ($ignored_queries as $q) { |
154 | - $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
154 | + $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | } else { |
158 | - $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
158 | + $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
159 | 159 | } |
160 | - $xoopsTpl->assign('keywords', $keywords); |
|
161 | - $xoopsTpl->assign('error_length', $error_length); |
|
162 | - $xoopsTpl->assign('error_keywords', $error_keywords); |
|
163 | - $results_arr = array(); |
|
160 | + $xoopsTpl->assign('keywords', $keywords); |
|
161 | + $xoopsTpl->assign('error_length', $error_length); |
|
162 | + $xoopsTpl->assign('error_keywords', $error_keywords); |
|
163 | + $results_arr = array(); |
|
164 | 164 | foreach ($mids as $mid) { |
165 | 165 | $mid = (int)$mid; |
166 | 166 | if (in_array($mid, $available_modules)) { |
@@ -169,57 +169,57 @@ discard block |
||
169 | 169 | $count = count($results); |
170 | 170 | if (is_array($results) && $count > 0) { |
171 | 171 | $nomatch = false; |
172 | - $module_name = $module->getVar('name'); |
|
172 | + $module_name = $module->getVar('name'); |
|
173 | 173 | for ($i = 0; $i < $count; ++$i) { |
174 | 174 | if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
175 | - $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
175 | + $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
176 | 176 | } else { |
177 | - $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
|
177 | + $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
|
178 | 178 | } |
179 | - $results_arr[$i]['image_title'] = $module->getVar('name'); |
|
179 | + $results_arr[$i]['image_title'] = $module->getVar('name'); |
|
180 | 180 | if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
181 | 181 | $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
182 | 182 | } |
183 | - $results_arr[$i]['link'] = $results[$i]['link']; |
|
184 | - $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
183 | + $results_arr[$i]['link'] = $results[$i]['link']; |
|
184 | + $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
185 | 185 | |
186 | 186 | $results[$i]['uid'] = @(int)$results[$i]['uid']; |
187 | 187 | if (!empty($results[$i]['uid'])) { |
188 | 188 | $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
189 | - $results_arr[$i]['uname'] = $uname; |
|
190 | - $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
189 | + $results_arr[$i]['uname'] = $uname; |
|
190 | + $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
191 | + } |
|
192 | + if (!empty($results[$i]['time'])){ |
|
193 | + $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
|
191 | 194 | } |
192 | - if (!empty($results[$i]['time'])){ |
|
193 | - $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
|
194 | - } |
|
195 | 195 | } |
196 | 196 | if ($count >= 5) { |
197 | 197 | $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
198 | 198 | $search_url .= "&mid={$mid}&action=showall&andor={$andor}"; |
199 | - $search_arr['module_show_all'] = htmlspecialchars($search_url); |
|
199 | + $search_arr['module_show_all'] = htmlspecialchars($search_url); |
|
200 | 200 | } |
201 | - $search_arr['module_name'] = $module_name; |
|
202 | - $search_arr['module_data'] = $results_arr; |
|
203 | - $xoopsTpl->append_by_ref('search', $search_arr); |
|
204 | - unset($results_arr, $search_arr); |
|
201 | + $search_arr['module_name'] = $module_name; |
|
202 | + $search_arr['module_data'] = $results_arr; |
|
203 | + $xoopsTpl->append_by_ref('search', $search_arr); |
|
204 | + unset($results_arr, $search_arr); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | unset($results, $module, $module_name); |
208 | 208 | } |
209 | 209 | |
210 | 210 | if ($nomatch) { |
211 | - $xoopsTpl->assign('nomatch', _SR_NOMATCH); |
|
211 | + $xoopsTpl->assign('nomatch', _SR_NOMATCH); |
|
212 | 212 | } |
213 | 213 | include $GLOBALS['xoops']->path('include/searchform.php'); |
214 | - $xoopsTpl->assign('form', $search_form->render()); |
|
214 | + $xoopsTpl->assign('form', $search_form->render()); |
|
215 | 215 | break; |
216 | 216 | |
217 | 217 | case 'showall': |
218 | 218 | case 'showallbyuser': |
219 | 219 | include $GLOBALS['xoops']->path('header.php'); |
220 | - $xoopsTpl->assign('showallbyuser', true); |
|
220 | + $xoopsTpl->assign('showallbyuser', true); |
|
221 | 221 | /* @var $module_handler XoopsModuleHandler */ |
222 | - $module_handler = xoops_getHandler('module'); |
|
222 | + $module_handler = xoops_getHandler('module'); |
|
223 | 223 | $module = $module_handler->get($mid); |
224 | 224 | $results = $module->search($queries, $andor, 20, $start, $uid); |
225 | 225 | $count = count($results); |
@@ -231,43 +231,43 @@ discard block |
||
231 | 231 | $has_next = true; |
232 | 232 | } |
233 | 233 | if ($action === 'showall') { |
234 | - $xoopsTpl->assign('showall', true); |
|
235 | - $keywords = ''; |
|
234 | + $xoopsTpl->assign('showall', true); |
|
235 | + $keywords = ''; |
|
236 | 236 | if ($andor !== 'exact') { |
237 | 237 | foreach ($queries as $q) { |
238 | - $keywords .= htmlspecialchars(stripslashes($q)); |
|
238 | + $keywords .= htmlspecialchars(stripslashes($q)); |
|
239 | 239 | } |
240 | 240 | } else { |
241 | - $keywords .= htmlspecialchars(stripslashes($queries[0])); |
|
241 | + $keywords .= htmlspecialchars(stripslashes($queries[0])); |
|
242 | 242 | } |
243 | - $xoopsTpl->assign('keywords', $keywords); |
|
243 | + $xoopsTpl->assign('keywords', $keywords); |
|
244 | 244 | } |
245 | - $xoopsTpl->assign('showing', sprintf(_SR_SHOWING, $start + 1, $start + $count)); |
|
246 | - $xoopsTpl->assign('module_name', $module->getVar('name')); |
|
247 | - $results_arr = array(); |
|
245 | + $xoopsTpl->assign('showing', sprintf(_SR_SHOWING, $start + 1, $start + $count)); |
|
246 | + $xoopsTpl->assign('module_name', $module->getVar('name')); |
|
247 | + $results_arr = array(); |
|
248 | 248 | for ($i = 0; $i < $count; ++$i) { |
249 | 249 | if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
250 | - $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
250 | + $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
251 | 251 | } else { |
252 | - $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
|
252 | + $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
|
253 | 253 | } |
254 | - $results_arr['image_title'] = $module->getVar('name'); |
|
254 | + $results_arr['image_title'] = $module->getVar('name'); |
|
255 | 255 | if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
256 | 256 | $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
257 | 257 | } |
258 | - $results_arr['link'] = $results[$i]['link']; |
|
259 | - $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
258 | + $results_arr['link'] = $results[$i]['link']; |
|
259 | + $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
260 | 260 | $results['uid'] = @(int)$results[$i]['uid']; |
261 | 261 | if (!empty($results[$i]['uid'])) { |
262 | 262 | $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
263 | - $results_arr['uname'] = $uname; |
|
264 | - $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
263 | + $results_arr['uname'] = $uname; |
|
264 | + $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
265 | + } |
|
266 | + if (!empty($results[$i]['time'])){ |
|
267 | + $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
|
265 | 268 | } |
266 | - if (!empty($results[$i]['time'])){ |
|
267 | - $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
|
268 | - } |
|
269 | - $xoopsTpl->append_by_ref('results_arr', $results_arr); |
|
270 | - unset($results_arr); |
|
269 | + $xoopsTpl->append_by_ref('results_arr', $results_arr); |
|
270 | + unset($results_arr); |
|
271 | 271 | } |
272 | 272 | $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
273 | 273 | $search_url .= "&mid={$mid}&action={$action}&andor={$andor}"; |
@@ -277,15 +277,15 @@ discard block |
||
277 | 277 | if ($start > 0) { |
278 | 278 | $prev = $start - 20; |
279 | 279 | $search_url_prev = $search_url . "&start={$prev}"; |
280 | - $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
|
280 | + $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
|
281 | 281 | } |
282 | 282 | if (false !== $has_next) { |
283 | 283 | $next = $start + 20; |
284 | 284 | $search_url_next = $search_url . "&start={$next}"; |
285 | - $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
|
285 | + $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
|
286 | 286 | } |
287 | 287 | } else { |
288 | - $xoopsTpl->assign('nomatch', true); |
|
288 | + $xoopsTpl->assign('nomatch', true); |
|
289 | 289 | } |
290 | 290 | include $GLOBALS['xoops']->path('include/searchform.php'); |
291 | 291 | $search_form->display(); |
@@ -125,170 +125,170 @@ |
||
125 | 125 | } |
126 | 126 | } |
127 | 127 | switch ($action) { |
128 | - case 'results': |
|
129 | - /* @var $module_handler XoopsModuleHandler */ |
|
130 | - $module_handler = xoops_getHandler('module'); |
|
131 | - $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); |
|
132 | - $criteria->add(new Criteria('isactive', 1)); |
|
133 | - $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN')); |
|
134 | - $modules = $module_handler->getObjects($criteria, true); |
|
135 | - $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); |
|
136 | - if (empty($mids) || !is_array($mids)) { |
|
137 | - unset($mids); |
|
138 | - $mids = array_keys($modules); |
|
139 | - } |
|
140 | - $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); |
|
141 | - include $GLOBALS['xoops']->path('header.php'); |
|
142 | - $xoopsTpl->assign('results', true); |
|
143 | - $nomatch = true; |
|
144 | - $keywords = ''; |
|
145 | - $error_length = ''; |
|
146 | - $error_keywords = ''; |
|
147 | - if ($andor !== 'exact') { |
|
148 | - foreach ($queries as $q) { |
|
149 | - $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
128 | + case 'results': |
|
129 | + /* @var $module_handler XoopsModuleHandler */ |
|
130 | + $module_handler = xoops_getHandler('module'); |
|
131 | + $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); |
|
132 | + $criteria->add(new Criteria('isactive', 1)); |
|
133 | + $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN')); |
|
134 | + $modules = $module_handler->getObjects($criteria, true); |
|
135 | + $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); |
|
136 | + if (empty($mids) || !is_array($mids)) { |
|
137 | + unset($mids); |
|
138 | + $mids = array_keys($modules); |
|
150 | 139 | } |
151 | - if (!empty($ignored_queries)) { |
|
152 | - $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
|
153 | - foreach ($ignored_queries as $q) { |
|
154 | - $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
140 | + $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); |
|
141 | + include $GLOBALS['xoops']->path('header.php'); |
|
142 | + $xoopsTpl->assign('results', true); |
|
143 | + $nomatch = true; |
|
144 | + $keywords = ''; |
|
145 | + $error_length = ''; |
|
146 | + $error_keywords = ''; |
|
147 | + if ($andor !== 'exact') { |
|
148 | + foreach ($queries as $q) { |
|
149 | + $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
150 | + } |
|
151 | + if (!empty($ignored_queries)) { |
|
152 | + $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
|
153 | + foreach ($ignored_queries as $q) { |
|
154 | + $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
155 | + } |
|
155 | 156 | } |
157 | + } else { |
|
158 | + $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
156 | 159 | } |
157 | - } else { |
|
158 | - $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
159 | - } |
|
160 | - $xoopsTpl->assign('keywords', $keywords); |
|
161 | - $xoopsTpl->assign('error_length', $error_length); |
|
162 | - $xoopsTpl->assign('error_keywords', $error_keywords); |
|
163 | - $results_arr = array(); |
|
164 | - foreach ($mids as $mid) { |
|
165 | - $mid = (int)$mid; |
|
166 | - if (in_array($mid, $available_modules)) { |
|
167 | - $module = $modules[$mid]; |
|
168 | - $results = $module->search($queries, $andor, 5, 0); |
|
169 | - $count = count($results); |
|
170 | - if (is_array($results) && $count > 0) { |
|
171 | - $nomatch = false; |
|
172 | - $module_name = $module->getVar('name'); |
|
173 | - for ($i = 0; $i < $count; ++$i) { |
|
174 | - if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
|
175 | - $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
176 | - } else { |
|
177 | - $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
|
178 | - } |
|
179 | - $results_arr[$i]['image_title'] = $module->getVar('name'); |
|
180 | - if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
|
181 | - $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
182 | - } |
|
183 | - $results_arr[$i]['link'] = $results[$i]['link']; |
|
184 | - $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
160 | + $xoopsTpl->assign('keywords', $keywords); |
|
161 | + $xoopsTpl->assign('error_length', $error_length); |
|
162 | + $xoopsTpl->assign('error_keywords', $error_keywords); |
|
163 | + $results_arr = array(); |
|
164 | + foreach ($mids as $mid) { |
|
165 | + $mid = (int)$mid; |
|
166 | + if (in_array($mid, $available_modules)) { |
|
167 | + $module = $modules[$mid]; |
|
168 | + $results = $module->search($queries, $andor, 5, 0); |
|
169 | + $count = count($results); |
|
170 | + if (is_array($results) && $count > 0) { |
|
171 | + $nomatch = false; |
|
172 | + $module_name = $module->getVar('name'); |
|
173 | + for ($i = 0; $i < $count; ++$i) { |
|
174 | + if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
|
175 | + $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
176 | + } else { |
|
177 | + $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
|
178 | + } |
|
179 | + $results_arr[$i]['image_title'] = $module->getVar('name'); |
|
180 | + if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
|
181 | + $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
182 | + } |
|
183 | + $results_arr[$i]['link'] = $results[$i]['link']; |
|
184 | + $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
185 | 185 | |
186 | - $results[$i]['uid'] = @(int)$results[$i]['uid']; |
|
187 | - if (!empty($results[$i]['uid'])) { |
|
188 | - $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
|
189 | - $results_arr[$i]['uname'] = $uname; |
|
190 | - $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
186 | + $results[$i]['uid'] = @(int)$results[$i]['uid']; |
|
187 | + if (!empty($results[$i]['uid'])) { |
|
188 | + $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
|
189 | + $results_arr[$i]['uname'] = $uname; |
|
190 | + $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
191 | + } |
|
192 | + if (!empty($results[$i]['time'])){ |
|
193 | + $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
|
194 | + } |
|
191 | 195 | } |
192 | - if (!empty($results[$i]['time'])){ |
|
193 | - $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
|
194 | - } |
|
195 | - } |
|
196 | - if ($count >= 5) { |
|
197 | - $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
198 | - $search_url .= "&mid={$mid}&action=showall&andor={$andor}"; |
|
199 | - $search_arr['module_show_all'] = htmlspecialchars($search_url); |
|
196 | + if ($count >= 5) { |
|
197 | + $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
198 | + $search_url .= "&mid={$mid}&action=showall&andor={$andor}"; |
|
199 | + $search_arr['module_show_all'] = htmlspecialchars($search_url); |
|
200 | + } |
|
201 | + $search_arr['module_name'] = $module_name; |
|
202 | + $search_arr['module_data'] = $results_arr; |
|
203 | + $xoopsTpl->append_by_ref('search', $search_arr); |
|
204 | + unset($results_arr, $search_arr); |
|
200 | 205 | } |
201 | - $search_arr['module_name'] = $module_name; |
|
202 | - $search_arr['module_data'] = $results_arr; |
|
203 | - $xoopsTpl->append_by_ref('search', $search_arr); |
|
204 | - unset($results_arr, $search_arr); |
|
205 | - } |
|
206 | - } |
|
207 | - unset($results, $module, $module_name); |
|
208 | - } |
|
206 | + } |
|
207 | + unset($results, $module, $module_name); |
|
208 | + } |
|
209 | 209 | |
210 | - if ($nomatch) { |
|
211 | - $xoopsTpl->assign('nomatch', _SR_NOMATCH); |
|
212 | - } |
|
213 | - include $GLOBALS['xoops']->path('include/searchform.php'); |
|
214 | - $xoopsTpl->assign('form', $search_form->render()); |
|
215 | - break; |
|
216 | - |
|
217 | - case 'showall': |
|
218 | - case 'showallbyuser': |
|
219 | - include $GLOBALS['xoops']->path('header.php'); |
|
220 | - $xoopsTpl->assign('showallbyuser', true); |
|
221 | - /* @var $module_handler XoopsModuleHandler */ |
|
222 | - $module_handler = xoops_getHandler('module'); |
|
223 | - $module = $module_handler->get($mid); |
|
224 | - $results = $module->search($queries, $andor, 20, $start, $uid); |
|
225 | - $count = count($results); |
|
226 | - if (is_array($results) && $count > 0) { |
|
227 | - $next_results = $module->search($queries, $andor, 1, $start + 20, $uid); |
|
228 | - $next_count = count($next_results); |
|
229 | - $has_next = false; |
|
230 | - if (is_array($next_results) && $next_count == 1) { |
|
231 | - $has_next = true; |
|
210 | + if ($nomatch) { |
|
211 | + $xoopsTpl->assign('nomatch', _SR_NOMATCH); |
|
232 | 212 | } |
233 | - if ($action === 'showall') { |
|
234 | - $xoopsTpl->assign('showall', true); |
|
235 | - $keywords = ''; |
|
236 | - if ($andor !== 'exact') { |
|
237 | - foreach ($queries as $q) { |
|
238 | - $keywords .= htmlspecialchars(stripslashes($q)); |
|
213 | + include $GLOBALS['xoops']->path('include/searchform.php'); |
|
214 | + $xoopsTpl->assign('form', $search_form->render()); |
|
215 | + break; |
|
216 | + |
|
217 | + case 'showall': |
|
218 | + case 'showallbyuser': |
|
219 | + include $GLOBALS['xoops']->path('header.php'); |
|
220 | + $xoopsTpl->assign('showallbyuser', true); |
|
221 | + /* @var $module_handler XoopsModuleHandler */ |
|
222 | + $module_handler = xoops_getHandler('module'); |
|
223 | + $module = $module_handler->get($mid); |
|
224 | + $results = $module->search($queries, $andor, 20, $start, $uid); |
|
225 | + $count = count($results); |
|
226 | + if (is_array($results) && $count > 0) { |
|
227 | + $next_results = $module->search($queries, $andor, 1, $start + 20, $uid); |
|
228 | + $next_count = count($next_results); |
|
229 | + $has_next = false; |
|
230 | + if (is_array($next_results) && $next_count == 1) { |
|
231 | + $has_next = true; |
|
232 | + } |
|
233 | + if ($action === 'showall') { |
|
234 | + $xoopsTpl->assign('showall', true); |
|
235 | + $keywords = ''; |
|
236 | + if ($andor !== 'exact') { |
|
237 | + foreach ($queries as $q) { |
|
238 | + $keywords .= htmlspecialchars(stripslashes($q)); |
|
239 | + } |
|
240 | + } else { |
|
241 | + $keywords .= htmlspecialchars(stripslashes($queries[0])); |
|
239 | 242 | } |
240 | - } else { |
|
241 | - $keywords .= htmlspecialchars(stripslashes($queries[0])); |
|
243 | + $xoopsTpl->assign('keywords', $keywords); |
|
242 | 244 | } |
243 | - $xoopsTpl->assign('keywords', $keywords); |
|
244 | - } |
|
245 | - $xoopsTpl->assign('showing', sprintf(_SR_SHOWING, $start + 1, $start + $count)); |
|
246 | - $xoopsTpl->assign('module_name', $module->getVar('name')); |
|
247 | - $results_arr = array(); |
|
248 | - for ($i = 0; $i < $count; ++$i) { |
|
249 | - if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
|
250 | - $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
251 | - } else { |
|
252 | - $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
|
245 | + $xoopsTpl->assign('showing', sprintf(_SR_SHOWING, $start + 1, $start + $count)); |
|
246 | + $xoopsTpl->assign('module_name', $module->getVar('name')); |
|
247 | + $results_arr = array(); |
|
248 | + for ($i = 0; $i < $count; ++$i) { |
|
249 | + if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
|
250 | + $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
251 | + } else { |
|
252 | + $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
|
253 | + } |
|
254 | + $results_arr['image_title'] = $module->getVar('name'); |
|
255 | + if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
|
256 | + $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
257 | + } |
|
258 | + $results_arr['link'] = $results[$i]['link']; |
|
259 | + $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
260 | + $results['uid'] = @(int)$results[$i]['uid']; |
|
261 | + if (!empty($results[$i]['uid'])) { |
|
262 | + $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
|
263 | + $results_arr['uname'] = $uname; |
|
264 | + $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
265 | + } |
|
266 | + if (!empty($results[$i]['time'])){ |
|
267 | + $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
|
268 | + } |
|
269 | + $xoopsTpl->append_by_ref('results_arr', $results_arr); |
|
270 | + unset($results_arr); |
|
253 | 271 | } |
254 | - $results_arr['image_title'] = $module->getVar('name'); |
|
255 | - if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
|
256 | - $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
272 | + $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
273 | + $search_url .= "&mid={$mid}&action={$action}&andor={$andor}"; |
|
274 | + if ($action === 'showallbyuser') { |
|
275 | + $search_url .= "&uid={$uid}"; |
|
257 | 276 | } |
258 | - $results_arr['link'] = $results[$i]['link']; |
|
259 | - $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
260 | - $results['uid'] = @(int)$results[$i]['uid']; |
|
261 | - if (!empty($results[$i]['uid'])) { |
|
262 | - $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
|
263 | - $results_arr['uname'] = $uname; |
|
264 | - $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
277 | + if ($start > 0) { |
|
278 | + $prev = $start - 20; |
|
279 | + $search_url_prev = $search_url . "&start={$prev}"; |
|
280 | + $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
|
265 | 281 | } |
266 | - if (!empty($results[$i]['time'])){ |
|
267 | - $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
|
268 | - } |
|
269 | - $xoopsTpl->append_by_ref('results_arr', $results_arr); |
|
270 | - unset($results_arr); |
|
271 | - } |
|
272 | - $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
273 | - $search_url .= "&mid={$mid}&action={$action}&andor={$andor}"; |
|
274 | - if ($action === 'showallbyuser') { |
|
275 | - $search_url .= "&uid={$uid}"; |
|
276 | - } |
|
277 | - if ($start > 0) { |
|
278 | - $prev = $start - 20; |
|
279 | - $search_url_prev = $search_url . "&start={$prev}"; |
|
280 | - $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
|
281 | - } |
|
282 | - if (false !== $has_next) { |
|
283 | - $next = $start + 20; |
|
284 | - $search_url_next = $search_url . "&start={$next}"; |
|
285 | - $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
|
282 | + if (false !== $has_next) { |
|
283 | + $next = $start + 20; |
|
284 | + $search_url_next = $search_url . "&start={$next}"; |
|
285 | + $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
|
286 | + } |
|
287 | + } else { |
|
288 | + $xoopsTpl->assign('nomatch', true); |
|
286 | 289 | } |
287 | - } else { |
|
288 | - $xoopsTpl->assign('nomatch', true); |
|
289 | - } |
|
290 | - include $GLOBALS['xoops']->path('include/searchform.php'); |
|
291 | - $search_form->display(); |
|
292 | - break; |
|
290 | + include $GLOBALS['xoops']->path('include/searchform.php'); |
|
291 | + $search_form->display(); |
|
292 | + break; |
|
293 | 293 | } |
294 | 294 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @author Taiwen Jiang <[email protected]> |
24 | 24 | * @todo Modularize; Both search algorithms and interface will be redesigned |
25 | 25 | */ |
26 | -include __DIR__ . '/mainfile.php'; |
|
26 | +include __DIR__.'/mainfile.php'; |
|
27 | 27 | |
28 | 28 | xoops_loadLanguage('search'); |
29 | 29 | /* @var $config_handler XoopsConfigHandler */ |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $xoopsConfigSearch = $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); |
32 | 32 | |
33 | 33 | if ($xoopsConfigSearch['enable_search'] != 1) { |
34 | - header('Location: ' . XOOPS_URL . '/index.php'); |
|
34 | + header('Location: '.XOOPS_URL.'/index.php'); |
|
35 | 35 | exit(); |
36 | 36 | } |
37 | 37 | $action = 'search'; |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | $module_handler = xoops_getHandler('module'); |
131 | 131 | $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); |
132 | 132 | $criteria->add(new Criteria('isactive', 1)); |
133 | - $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN')); |
|
133 | + $criteria->add(new Criteria('mid', '('.implode(',', $available_modules).')', 'IN')); |
|
134 | 134 | $modules = $module_handler->getObjects($criteria, true); |
135 | 135 | $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); |
136 | 136 | if (empty($mids) || !is_array($mids)) { |
137 | 137 | unset($mids); |
138 | 138 | $mids = array_keys($modules); |
139 | 139 | } |
140 | - $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); |
|
140 | + $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS.': '.implode(' ', $queries); |
|
141 | 141 | include $GLOBALS['xoops']->path('header.php'); |
142 | 142 | $xoopsTpl->assign('results', true); |
143 | 143 | $nomatch = true; |
@@ -146,16 +146,16 @@ discard block |
||
146 | 146 | $error_keywords = ''; |
147 | 147 | if ($andor !== 'exact') { |
148 | 148 | foreach ($queries as $q) { |
149 | - $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
149 | + $keywords .= htmlspecialchars(stripslashes($q)).' '; |
|
150 | 150 | } |
151 | 151 | if (!empty($ignored_queries)) { |
152 | 152 | $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
153 | 153 | foreach ($ignored_queries as $q) { |
154 | - $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
154 | + $error_keywords .= htmlspecialchars(stripslashes($q)).' '; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | } else { |
158 | - $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
158 | + $keywords .= '"'.htmlspecialchars(stripslashes($queries[0])).'"'; |
|
159 | 159 | } |
160 | 160 | $xoopsTpl->assign('keywords', $keywords); |
161 | 161 | $xoopsTpl->assign('error_length', $error_length); |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | $module_name = $module->getVar('name'); |
173 | 173 | for ($i = 0; $i < $count; ++$i) { |
174 | 174 | if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
175 | - $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
175 | + $results_arr[$i]['image_link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['image']; |
|
176 | 176 | } else { |
177 | 177 | $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
178 | 178 | } |
179 | 179 | $results_arr[$i]['image_title'] = $module->getVar('name'); |
180 | 180 | if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
181 | - $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
181 | + $results[$i]['link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['link']; |
|
182 | 182 | } |
183 | 183 | $results_arr[$i]['link'] = $results[$i]['link']; |
184 | 184 | $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
@@ -187,14 +187,14 @@ discard block |
||
187 | 187 | if (!empty($results[$i]['uid'])) { |
188 | 188 | $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
189 | 189 | $results_arr[$i]['uname'] = $uname; |
190 | - $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
190 | + $results_arr[$i]['uname_link'] = XOOPS_URL.'/userinfo.php?uid='.$results[$i]['uid']; |
|
191 | 191 | } |
192 | - if (!empty($results[$i]['time'])){ |
|
192 | + if (!empty($results[$i]['time'])) { |
|
193 | 193 | $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
194 | 194 | } |
195 | 195 | } |
196 | 196 | if ($count >= 5) { |
197 | - $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
197 | + $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries))); |
|
198 | 198 | $search_url .= "&mid={$mid}&action=showall&andor={$andor}"; |
199 | 199 | $search_arr['module_show_all'] = htmlspecialchars($search_url); |
200 | 200 | } |
@@ -247,13 +247,13 @@ discard block |
||
247 | 247 | $results_arr = array(); |
248 | 248 | for ($i = 0; $i < $count; ++$i) { |
249 | 249 | if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
250 | - $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
250 | + $results_arr['image_link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['image']; |
|
251 | 251 | } else { |
252 | 252 | $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
253 | 253 | } |
254 | 254 | $results_arr['image_title'] = $module->getVar('name'); |
255 | 255 | if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
256 | - $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
256 | + $results[$i]['link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['link']; |
|
257 | 257 | } |
258 | 258 | $results_arr['link'] = $results[$i]['link']; |
259 | 259 | $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
@@ -261,27 +261,27 @@ discard block |
||
261 | 261 | if (!empty($results[$i]['uid'])) { |
262 | 262 | $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
263 | 263 | $results_arr['uname'] = $uname; |
264 | - $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
264 | + $results_arr['uname_link'] = XOOPS_URL.'/userinfo.php?uid='.$results[$i]['uid']; |
|
265 | 265 | } |
266 | - if (!empty($results[$i]['time'])){ |
|
266 | + if (!empty($results[$i]['time'])) { |
|
267 | 267 | $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
268 | 268 | } |
269 | 269 | $xoopsTpl->append_by_ref('results_arr', $results_arr); |
270 | 270 | unset($results_arr); |
271 | 271 | } |
272 | - $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
272 | + $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries))); |
|
273 | 273 | $search_url .= "&mid={$mid}&action={$action}&andor={$andor}"; |
274 | 274 | if ($action === 'showallbyuser') { |
275 | 275 | $search_url .= "&uid={$uid}"; |
276 | 276 | } |
277 | 277 | if ($start > 0) { |
278 | 278 | $prev = $start - 20; |
279 | - $search_url_prev = $search_url . "&start={$prev}"; |
|
279 | + $search_url_prev = $search_url."&start={$prev}"; |
|
280 | 280 | $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
281 | 281 | } |
282 | 282 | if (false !== $has_next) { |
283 | 283 | $next = $start + 20; |
284 | - $search_url_next = $search_url . "&start={$next}"; |
|
284 | + $search_url_next = $search_url."&start={$next}"; |
|
285 | 285 | $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
286 | 286 | } |
287 | 287 | } else { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @since 2.0.0 |
22 | 22 | * @author Kazumi Ono <[email protected]> |
23 | 23 | */ |
24 | -include __DIR__ . '/mainfile.php'; |
|
24 | +include __DIR__.'/mainfile.php'; |
|
25 | 25 | $xoopsPreload = XoopsPreload::getInstance(); |
26 | 26 | $xoopsPreload->triggerEvent('core.user.start'); |
27 | 27 | |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | $GLOBALS['xoopsOption']['template_main'] = 'system_userform.tpl'; |
62 | 62 | include $GLOBALS['xoops']->path('header.php'); |
63 | 63 | $xoopsTpl->assign('xoops_pagetitle', _LOGIN); |
64 | - $xoTheme->addMeta('meta', 'keywords', _USERNAME . ', ' . _US_PASSWORD . ', ' . _US_LOSTPASSWORD); |
|
65 | - $xoTheme->addMeta('meta', 'description', _US_LOSTPASSWORD . ' ' . _US_NOPROBLEM); |
|
64 | + $xoTheme->addMeta('meta', 'keywords', _USERNAME.', '._US_PASSWORD.', '._US_LOSTPASSWORD); |
|
65 | + $xoTheme->addMeta('meta', 'description', _US_LOSTPASSWORD.' '._US_NOPROBLEM); |
|
66 | 66 | $xoopsTpl->assign('lang_login', _LOGIN); |
67 | 67 | $xoopsTpl->assign('lang_username', _USERNAME); |
68 | 68 | if (!empty($clean_redirect)) { |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | if (!$isExternal) { |
94 | - header('Location: ' . $redirect); |
|
94 | + header('Location: '.$redirect); |
|
95 | 95 | exit(); |
96 | 96 | } |
97 | 97 | } |
98 | - header('Location: ' . XOOPS_URL . '/userinfo.php?uid=' . $xoopsUser->getVar('uid')); |
|
98 | + header('Location: '.XOOPS_URL.'/userinfo.php?uid='.$xoopsUser->getVar('uid')); |
|
99 | 99 | exit(); |
100 | 100 | } |
101 | 101 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $online_handler->destroy($xoopsUser->getVar('uid')); |
114 | 114 | } |
115 | 115 | $xoopsPreload->triggerEvent('core.behavior.user.logout'); |
116 | - $message = _US_LOGGEDOUT . '<br>' . _US_THANKYOUFORVISIT; |
|
116 | + $message = _US_LOGGEDOUT.'<br>'._US_THANKYOUFORVISIT; |
|
117 | 117 | redirect_header('index.php', 1, $message); |
118 | 118 | } |
119 | 119 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | if (!$clean_ok) { |
140 | 140 | include $GLOBALS['xoops']->path('header.php'); |
141 | - xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL . '<br>' . _US_REMOVEINFO); |
|
141 | + xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL.'<br>'._US_REMOVEINFO); |
|
142 | 142 | include $GLOBALS['xoops']->path('footer.php'); |
143 | 143 | } else { |
144 | 144 | $del_uid = $xoopsUser->getVar('uid'); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @author Taiwen Jiang <[email protected]> |
18 | 18 | */ |
19 | 19 | |
20 | -include_once dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
20 | +include_once dirname(dirname(__DIR__)).'/mainfile.php'; |
|
21 | 21 | |
22 | 22 | if (!is_object($GLOBALS['xoopsUser'])) { |
23 | 23 | redirect_header(XOOPS_URL, 3, _NOPERM); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | if (is_object($pm) && ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) && ($pm->getVar('to_userid') != $GLOBALS['xoopsUser']->getVar('uid'))) { |
35 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . '/index.php', 2, _NOPERM); |
|
35 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['xoopsModule']->getVar('dirname', 'n').'/index.php', 2, _NOPERM); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | if (is_object($pm) && !empty($_POST['action'])) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | $res_message = isset($res_message) ? $res_message : ($res ? _PM_ACTION_DONE : _PM_ACTION_ERROR); |
94 | - redirect_header('viewpmsg.php?op=' . htmlspecialchars($_REQUEST['op']), 2, $res_message); |
|
94 | + redirect_header('viewpmsg.php?op='.htmlspecialchars($_REQUEST['op']), 2, $res_message); |
|
95 | 95 | } |
96 | 96 | $start = !empty($_GET['start']) ? (int)$_GET['start'] : 0; |
97 | 97 | $total_messages = !empty($_GET['total_messages']) ? (int)$_GET['total_messages'] : 0; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if (is_object($pm) && !empty($pm)) { |
132 | 132 | if ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) { |
133 | 133 | $reply_button = new XoopsFormButton('', 'send', _PM_REPLY); |
134 | - $reply_button->setExtra("onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . '/modules/pm/pmlite.php?reply=1&msg_id=' . $pm->getVar('msg_id') . "\", \"pmlite\", 565,500);'"); |
|
134 | + $reply_button->setExtra("onclick='javascript:openWithSelfMain(\"".XOOPS_URL.'/modules/pm/pmlite.php?reply=1&msg_id='.$pm->getVar('msg_id')."\", \"pmlite\", 565,500);'"); |
|
135 | 135 | $pmform->addElement($reply_button); |
136 | 136 | } |
137 | 137 | $pmform->addElement(new XoopsFormButton('', 'delete_message', _PM_DELETE, 'submit')); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public static function eventCorePmliteStart($args) |
34 | 34 | { |
35 | - header('location: ./modules/pm/pmlite.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING'])); |
|
35 | + header('location: ./modules/pm/pmlite.php'.(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING'])); |
|
36 | 36 | exit(); |
37 | 37 | } |
38 | 38 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function eventCoreReadpmsgStart($args) |
43 | 43 | { |
44 | - header('location: ./modules/pm/readpmsg.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING'])); |
|
44 | + header('location: ./modules/pm/readpmsg.php'.(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING'])); |
|
45 | 45 | exit(); |
46 | 46 | } |
47 | 47 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public static function eventCoreViewpmsgStart($args) |
52 | 52 | { |
53 | - header('location: ./modules/pm/viewpmsg.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING'])); |
|
53 | + header('location: ./modules/pm/viewpmsg.php'.(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING'])); |
|
54 | 54 | exit(); |
55 | 55 | } |
56 | 56 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | define('_PM_MAILNOTIFY', "%s-You've got a new PM from %s"); |
68 | 68 | define('_PM_MAILMESSAGE', "Hello!\nA New PM has arrived from %s\n\nTitle of PM is\n%s\n\nYou can view the PM here\n%s\n\n-----------\nYou are receiving this message because you selected to be notified when you receive a new PM\n\nYou can change your PM-Config\n%s\n\nPlease do not reply to this message\n\n---------\nBest Regards\n%s\n%s\n%s"); |
69 | 69 | define('_PM_EMAIL', 'Forward to email'); |
70 | -define('_PM_EMAIL_DESC', 'Dear %s, this is a message transfered from your account at ' . $GLOBALS['xoopsConfig']['sitename']); |
|
70 | +define('_PM_EMAIL_DESC', 'Dear %s, this is a message transfered from your account at '.$GLOBALS['xoopsConfig']['sitename']); |
|
71 | 71 | define('_PM_EMAIL_FROM', 'From %s'); |
72 | 72 | define('_PM_EMAIL_TO', 'To %s'); |
73 | 73 | define('_PM_EMAIL_SUBJECT', '[message]%s'); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | global $xoopsDB; |
25 | 25 | |
26 | 26 | // Check pm table version |
27 | - $sql = 'SHOW COLUMNS FROM ' . $xoopsDB->prefix('priv_msgs'); |
|
27 | + $sql = 'SHOW COLUMNS FROM '.$xoopsDB->prefix('priv_msgs'); |
|
28 | 28 | if (!$result = $xoopsDB->queryF($sql)) { |
29 | 29 | return false; |
30 | 30 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | if (($rows = $xoopsDB->getRowsNum($result)) == 12) { |
33 | 33 | return true; |
34 | 34 | } elseif ($rows == 8) { |
35 | - return $xoopsDB->queryFromFile(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'n') . '/sql/mysql.upgrade.sql'); |
|
35 | + return $xoopsDB->queryFromFile(XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname', 'n').'/sql/mysql.upgrade.sql'); |
|
36 | 36 | } else { |
37 | 37 | return false; |
38 | 38 | } |