@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | use XoopsModules\Smartfaq; |
| 10 | 10 | use XoopsModules\Smartfaq\Constants; |
| 11 | 11 | |
| 12 | -require_once __DIR__ . '/admin_header.php'; |
|
| 12 | +require_once __DIR__.'/admin_header.php'; |
|
| 13 | 13 | $myts = \MyTextSanitizer::getInstance(); |
| 14 | 14 | |
| 15 | 15 | $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0; |
@@ -35,23 +35,23 @@ discard block |
||
| 35 | 35 | global $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
| 36 | 36 | echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; |
| 37 | 37 | echo '<tr>'; |
| 38 | - echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_FAQID . '</b></td>'; |
|
| 39 | - echo "<th width='20%' class='bg3' align='center'><b>" . _AM_SF_FAQCAT . '</b></td>'; |
|
| 40 | - echo "<th class='bg3' align='center'><b>" . _AM_SF_QUESTION . '</b></td>'; |
|
| 38 | + echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_FAQID.'</b></td>'; |
|
| 39 | + echo "<th width='20%' class='bg3' align='center'><b>"._AM_SF_FAQCAT.'</b></td>'; |
|
| 40 | + echo "<th class='bg3' align='center'><b>"._AM_SF_QUESTION.'</b></td>'; |
|
| 41 | 41 | |
| 42 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>'; |
|
| 43 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>'; |
|
| 42 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>'; |
|
| 43 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>'; |
|
| 44 | 44 | |
| 45 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
| 46 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_STATUS . '</b></td>'; |
|
| 45 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
| 46 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_STATUS.'</b></td>'; |
|
| 47 | 47 | //echo "<td width='30' class='bg3' align='center'><b>" . _AM_SF_ANSWERS . "</b></td>"; |
| 48 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 48 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
| 49 | 49 | echo '</tr>'; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Code for the page |
| 53 | -require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 54 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 53 | +require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
| 54 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 55 | 55 | |
| 56 | 56 | // Creating the category handler object |
| 57 | 57 | /** @var \XoopsModules\Smartfaq\CategoryHandler $categoryHandler */ |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | // Construction of lower table |
| 136 | 136 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
| 137 | -echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_ALLFAQS . '</h3>'; |
|
| 137 | +echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_ALLFAQS.'</h3>'; |
|
| 138 | 138 | echo "<div id='bottomtable'>"; |
| 139 | -echo '<span style="color: #567; margin: 3px 0 18px 0; font-size: small; display: block; ">' . _AM_SF_ALLFAQSMSG . '</span>'; |
|
| 139 | +echo '<span style="color: #567; margin: 3px 0 18px 0; font-size: small; display: block; ">'._AM_SF_ALLFAQSMSG.'</span>'; |
|
| 140 | 140 | |
| 141 | 141 | $showingtxt = ''; |
| 142 | 142 | $selectedtxt = ''; |
@@ -205,98 +205,98 @@ discard block |
||
| 205 | 205 | case Constants::SF_STATUS_ASKED: |
| 206 | 206 | $selectedtxt1 = 'selected'; |
| 207 | 207 | $caption = _AM_SF_ASKED; |
| 208 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_ASKED . ' '; |
|
| 208 | + $cond = ' WHERE status = '.Constants::SF_STATUS_ASKED.' '; |
|
| 209 | 209 | $status_explaination = _AM_SF_ASKED_EXP; |
| 210 | 210 | break; |
| 211 | 211 | |
| 212 | 212 | case Constants::SF_STATUS_OPENED: |
| 213 | 213 | $selectedtxt2 = 'selected'; |
| 214 | 214 | $caption = _AM_SF_OPENED; |
| 215 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_OPENED . ' '; |
|
| 215 | + $cond = ' WHERE status = '.Constants::SF_STATUS_OPENED.' '; |
|
| 216 | 216 | $status_explaination = _AM_SF_OPENED_EXP; |
| 217 | 217 | break; |
| 218 | 218 | |
| 219 | 219 | case Constants::SF_STATUS_ANSWERED: |
| 220 | 220 | $selectedtxt3 = 'selected'; |
| 221 | 221 | $caption = _AM_SF_ANSWERED; |
| 222 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_ANSWERED . ' '; |
|
| 222 | + $cond = ' WHERE status = '.Constants::SF_STATUS_ANSWERED.' '; |
|
| 223 | 223 | $status_explaination = _AM_SF_ANSWERED_EXP; |
| 224 | 224 | break; |
| 225 | 225 | |
| 226 | 226 | case Constants::SF_STATUS_SUBMITTED: |
| 227 | 227 | $selectedtxt4 = 'selected'; |
| 228 | 228 | $caption = _AM_SF_SUBMITTED; |
| 229 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_SUBMITTED . ' '; |
|
| 229 | + $cond = ' WHERE status = '.Constants::SF_STATUS_SUBMITTED.' '; |
|
| 230 | 230 | $status_explaination = _AM_SF_SUBMITTED_EXP; |
| 231 | 231 | break; |
| 232 | 232 | |
| 233 | 233 | case Constants::SF_STATUS_PUBLISHED: |
| 234 | 234 | $selectedtxt5 = 'selected'; |
| 235 | 235 | $caption = _AM_SF_PUBLISHED; |
| 236 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_PUBLISHED . ' '; |
|
| 236 | + $cond = ' WHERE status = '.Constants::SF_STATUS_PUBLISHED.' '; |
|
| 237 | 237 | $status_explaination = _AM_SF_PUBLISHED_EXP; |
| 238 | 238 | break; |
| 239 | 239 | |
| 240 | 240 | case Constants::SF_STATUS_NEW_ANSWER: |
| 241 | 241 | $selectedtxt6 = 'selected'; |
| 242 | 242 | $caption = _AM_SF_NEW_ANSWER; |
| 243 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_NEW_ANSWER . ' '; |
|
| 243 | + $cond = ' WHERE status = '.Constants::SF_STATUS_NEW_ANSWER.' '; |
|
| 244 | 244 | $status_explaination = _AM_SF_NEW_ANSWER_EXP; |
| 245 | 245 | break; |
| 246 | 246 | |
| 247 | 247 | case Constants::SF_STATUS_OFFLINE: |
| 248 | 248 | $selectedtxt7 = 'selected'; |
| 249 | 249 | $caption = _AM_SF_OFFLINE; |
| 250 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_OFFLINE . ' '; |
|
| 250 | + $cond = ' WHERE status = '.Constants::SF_STATUS_OFFLINE.' '; |
|
| 251 | 251 | $status_explaination = _AM_SF_OFFLINE_EXP; |
| 252 | 252 | break; |
| 253 | 253 | |
| 254 | 254 | case Constants::SF_STATUS_REJECTED_QUESTION: |
| 255 | 255 | $selectedtxt8 = 'selected'; |
| 256 | 256 | $caption = _AM_SF_REJECTED_QUESTION; |
| 257 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_REJECTED_QUESTION . ' '; |
|
| 257 | + $cond = ' WHERE status = '.Constants::SF_STATUS_REJECTED_QUESTION.' '; |
|
| 258 | 258 | $status_explaination = _AM_SF_REJECTED_QUESTION_EXP; |
| 259 | 259 | break; |
| 260 | 260 | |
| 261 | 261 | case Constants::SF_STATUS_REJECTED_SMARTFAQ: |
| 262 | 262 | $selectedtxt9 = 'selected'; |
| 263 | 263 | $caption = _AM_SF_REJECTED_SMARTFAQ; |
| 264 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_REJECTED_SMARTFAQ . ' '; |
|
| 264 | + $cond = ' WHERE status = '.Constants::SF_STATUS_REJECTED_SMARTFAQ.' '; |
|
| 265 | 265 | $status_explaination = _AM_SF_REJECTED_SMARTFAQ_EXP; |
| 266 | 266 | break; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /* -- Code to show selected terms -- */ |
| 270 | -echo "<form name='pick' id='pick' action='" . $_SERVER['PHP_SELF'] . "' method='POST' style='margin: 0;'>"; |
|
| 270 | +echo "<form name='pick' id='pick' action='".$_SERVER['PHP_SELF']."' method='POST' style='margin: 0;'>"; |
|
| 271 | 271 | |
| 272 | 272 | echo " |
| 273 | 273 | <table width='100%' cellspacing='1' cellpadding='2' border='0' style='border-left: 1px solid silver; border-top: 1px solid silver; border-right: 1px solid silver;'> |
| 274 | 274 | <tr> |
| 275 | - <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . _AM_SF_SHOWING . ' ' . $caption . "</span></td> |
|
| 276 | - <td align='right'>" . _AM_SF_SELECT_SORT . " |
|
| 275 | + <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . _AM_SF_SHOWING.' '.$caption."</span></td> |
|
| 276 | + <td align='right'>" . _AM_SF_SELECT_SORT." |
|
| 277 | 277 | <select name='sortsel' onchange='submit()'> |
| 278 | - <option value='faq.faqid' $sorttxtfaqid>" . _AM_SF_ID . "</option> |
|
| 279 | - <option value='category.name' $sorttxtcategory>" . _AM_SF_CATEGORY . "</option> |
|
| 280 | - <option value='faq.question' $sorttxtquestion>" . _AM_SF_QUESTION . "</option> |
|
| 281 | - <option value='faq.datesub' $sorttxtcreated>" . _AM_SF_CREATED . "</option> |
|
| 282 | - <option value='faq.weight' $sorttxtweight>" . _AM_SF_WEIGHT . "</option> |
|
| 278 | + <option value='faq.faqid' $sorttxtfaqid>"._AM_SF_ID."</option> |
|
| 279 | + <option value='category.name' $sorttxtcategory>"._AM_SF_CATEGORY."</option> |
|
| 280 | + <option value='faq.question' $sorttxtquestion>"._AM_SF_QUESTION."</option> |
|
| 281 | + <option value='faq.datesub' $sorttxtcreated>"._AM_SF_CREATED."</option> |
|
| 282 | + <option value='faq.weight' $sorttxtweight>"._AM_SF_WEIGHT."</option> |
|
| 283 | 283 | </select> |
| 284 | 284 | <select name='ordersel' onchange='submit()'> |
| 285 | - <option value='ASC' $ordertxtasc>" . _AM_SF_ASC . "</option> |
|
| 286 | - <option value='DESC' $ordertxtdesc>" . _AM_SF_DESC . '</option> |
|
| 285 | + <option value='ASC' $ordertxtasc>"._AM_SF_ASC."</option> |
|
| 286 | + <option value='DESC' $ordertxtdesc>"._AM_SF_DESC.'</option> |
|
| 287 | 287 | </select> |
| 288 | - ' . _AM_SF_SELECT_STATUS . " : |
|
| 288 | + ' . _AM_SF_SELECT_STATUS." : |
|
| 289 | 289 | <select name='statussel' onchange='submit()'> |
| 290 | - <option value='0' $selectedtxt0>" . _AM_SF_ALL . " [$totalfaqs]</option> |
|
| 291 | - <option value='1' $selectedtxt1>" . _AM_SF_ASKED . " [$totalasked]</option> |
|
| 292 | - <option value='2' $selectedtxt2>" . _AM_SF_OPENED . " [$totalopened]</option> |
|
| 293 | - <option value='3' $selectedtxt3>" . _AM_SF_ANSWERED . " [$totalanswered]</option> |
|
| 294 | - <option value='4' $selectedtxt4>" . _AM_SF_SUBMITTED . " [$totalsubmitted]</option> |
|
| 295 | - <option value='5' $selectedtxt5>" . _AM_SF_PUBLISHED . " [$totalpublished]</option> |
|
| 296 | - <option value='6' $selectedtxt6>" . _AM_SF_NEWANSWER . " [$totalnewanswers]</option> |
|
| 297 | - <option value='7' $selectedtxt7>" . _AM_SF_OFFLINE . " [$totaloffline]</option> |
|
| 298 | - <option value='8' $selectedtxt8>" . _AM_SF_REJECTED_QUESTION . " [$totalrejectedquestion]</option> |
|
| 299 | - <option value='9' $selectedtxt9>" . _AM_SF_REJECTED_SMARTFAQ . " [$totalrejectedsmartfaq]</option> |
|
| 290 | + <option value='0' $selectedtxt0>"._AM_SF_ALL." [$totalfaqs]</option> |
|
| 291 | + <option value='1' $selectedtxt1>"._AM_SF_ASKED." [$totalasked]</option> |
|
| 292 | + <option value='2' $selectedtxt2>"._AM_SF_OPENED." [$totalopened]</option> |
|
| 293 | + <option value='3' $selectedtxt3>"._AM_SF_ANSWERED." [$totalanswered]</option> |
|
| 294 | + <option value='4' $selectedtxt4>"._AM_SF_SUBMITTED." [$totalsubmitted]</option> |
|
| 295 | + <option value='5' $selectedtxt5>"._AM_SF_PUBLISHED." [$totalpublished]</option> |
|
| 296 | + <option value='6' $selectedtxt6>"._AM_SF_NEWANSWER." [$totalnewanswers]</option> |
|
| 297 | + <option value='7' $selectedtxt7>"._AM_SF_OFFLINE." [$totaloffline]</option> |
|
| 298 | + <option value='8' $selectedtxt8>"._AM_SF_REJECTED_QUESTION." [$totalrejectedquestion]</option> |
|
| 299 | + <option value='9' $selectedtxt9>"._AM_SF_REJECTED_SMARTFAQ." [$totalrejectedsmartfaq]</option> |
|
| 300 | 300 | </select> |
| 301 | 301 | </td> |
| 302 | 302 | </tr> |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | $faqsObj = $faqHandler->getFaqsAdminSide($xoopsModuleConfig['perpage'], $startentry, $statusSelected, -1, $sortsel, $ordersel); |
| 312 | 312 | |
| 313 | 313 | // fetching all categories |
| 314 | -$allCats = $categoryHandler->getObjects(null, true); |
|
| 314 | +$allCats = $categoryHandler->getObjects(null, true); |
|
| 315 | 315 | //$totalItemsOnPage = count($faqsObj); |
| 316 | 316 | buildTable(); |
| 317 | 317 | |
@@ -334,65 +334,65 @@ discard block |
||
| 334 | 334 | switch ($faqsObj[$i]->status()) { |
| 335 | 335 | case Constants::SF_STATUS_ASKED: |
| 336 | 336 | $statustxt = _AM_SF_ASKED; |
| 337 | - $approve = "<a href='question.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/on.png' . "' title='" . _AM_SF_QUESTION_MODERATE . "' alt='" . _AM_SF_QUESTION_MODERATE . "'></a> "; |
|
| 337 | + $approve = "<a href='question.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/on.png'."' title='"._AM_SF_QUESTION_MODERATE."' alt='"._AM_SF_QUESTION_MODERATE."'></a> "; |
|
| 338 | 338 | $modify = ''; |
| 339 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>"; |
|
| 339 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>"; |
|
| 340 | 340 | break; |
| 341 | 341 | |
| 342 | 342 | case Constants::SF_STATUS_OPENED: |
| 343 | 343 | $statustxt = _AM_SF_OPENED; |
| 344 | 344 | $approve = ''; |
| 345 | - $modify = "<a href='question.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_QUESTION_EDIT . "' alt='" . _AM_SF_QUESTION_EDIT . "'></a> "; |
|
| 346 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>"; |
|
| 345 | + $modify = "<a href='question.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_QUESTION_EDIT."' alt='"._AM_SF_QUESTION_EDIT."'></a> "; |
|
| 346 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>"; |
|
| 347 | 347 | break; |
| 348 | 348 | |
| 349 | 349 | case Constants::SF_STATUS_ANSWERED: |
| 350 | 350 | $statustxt = _AM_SF_ANSWERED; |
| 351 | - $approve = "<a href='answer.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_ANSWERED_MODERATE . "' alt='" . _AM_SF_ANSWERED_MODERATE . "'></a> "; |
|
| 351 | + $approve = "<a href='answer.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_ANSWERED_MODERATE."' alt='"._AM_SF_ANSWERED_MODERATE."'></a> "; |
|
| 352 | 352 | $modify = ''; |
| 353 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>"; |
|
| 353 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>"; |
|
| 354 | 354 | break; |
| 355 | 355 | |
| 356 | 356 | case Constants::SF_STATUS_SUBMITTED: |
| 357 | 357 | $statustxt = _AM_SF_SUBMITTED; |
| 358 | - $approve = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_SUBMISSION_MODERATE . "' alt='" . _AM_SF_SUBMISSION_MODERATE . "'></a> "; |
|
| 359 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 358 | + $approve = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_SUBMISSION_MODERATE."' alt='"._AM_SF_SUBMISSION_MODERATE."'></a> "; |
|
| 359 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 360 | 360 | $modify = ''; |
| 361 | 361 | break; |
| 362 | 362 | |
| 363 | 363 | case Constants::SF_STATUS_PUBLISHED: |
| 364 | 364 | $statustxt = _AM_SF_PUBLISHED; |
| 365 | 365 | $approve = ''; |
| 366 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a> "; |
|
| 367 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 366 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a> "; |
|
| 367 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 368 | 368 | break; |
| 369 | 369 | |
| 370 | 370 | case Constants::SF_STATUS_NEW_ANSWER: |
| 371 | 371 | $statustxt = _AM_SF_NEWANSWER; |
| 372 | - $approve = "<a href='answer.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a> "; |
|
| 373 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 372 | + $approve = "<a href='answer.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a> "; |
|
| 373 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 374 | 374 | $modify = ''; |
| 375 | 375 | break; |
| 376 | 376 | |
| 377 | 377 | case Constants::SF_STATUS_OFFLINE: |
| 378 | 378 | $statustxt = _AM_SF_OFFLINE; |
| 379 | 379 | $approve = ''; |
| 380 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a> "; |
|
| 381 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 380 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a> "; |
|
| 381 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 382 | 382 | break; |
| 383 | 383 | |
| 384 | 384 | case Constants::SF_STATUS_REJECTED_QUESTION: |
| 385 | 385 | $statustxt = _AM_SF_REJECTED_QUESTION; |
| 386 | 386 | $approve = ''; |
| 387 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_REJECTED_EDIT . "' alt='" . _AM_SF_REJECTED_EDIT . "'></a> "; |
|
| 388 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>"; |
|
| 387 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_REJECTED_EDIT."' alt='"._AM_SF_REJECTED_EDIT."'></a> "; |
|
| 388 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>"; |
|
| 389 | 389 | break; |
| 390 | 390 | |
| 391 | 391 | case Constants::SF_STATUS_REJECTED_SMARTFAQ: |
| 392 | 392 | $statustxt = _AM_SF_REJECTED_SMARTFAQ; |
| 393 | 393 | $approve = ''; |
| 394 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_REJECTED_EDIT . "' alt='" . _AM_SF_REJECTED_EDIT . "'></a> "; |
|
| 395 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 394 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_REJECTED_EDIT."' alt='"._AM_SF_REJECTED_EDIT."'></a> "; |
|
| 395 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 396 | 396 | break; |
| 397 | 397 | |
| 398 | 398 | case 'default': |
@@ -406,14 +406,14 @@ discard block |
||
| 406 | 406 | //$modify = "<a href='faq.php?op=mod&faqid=" . $faqid . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/assets/images/icon/edit.gif' alt='" . _AM_SF_EDITART . "'></a> "; |
| 407 | 407 | |
| 408 | 408 | echo '<tr>'; |
| 409 | - echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>'; |
|
| 410 | - echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
|
| 411 | - echo "<td class='even' align='left'>" . $faqsObj[$i]->question(100) . '</td>'; |
|
| 409 | + echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>'; |
|
| 410 | + echo "<td class='even' align='left'>".$categoryObj->name().'</td>'; |
|
| 411 | + echo "<td class='even' align='left'>".$faqsObj[$i]->question(100).'</td>'; |
|
| 412 | 412 | |
| 413 | 413 | //mb--------------------------------------- |
| 414 | 414 | //adding name of the Question Submitter |
| 415 | 415 | $requester = Smartfaq\Utility::getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
| 416 | - echo "<td class='even' align='center'>" . $requester . '</td>'; |
|
| 416 | + echo "<td class='even' align='center'>".$requester.'</td>'; |
|
| 417 | 417 | |
| 418 | 418 | //adding name of the Answer Submitter |
| 419 | 419 | /** @var \XoopsModules\Smartfaq\AnswerHandler $answerHandler */ |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $criteria->add(new \Criteria('faqid', $faqsObj[$i]->faqid())); |
| 424 | 424 | $criteria->add(new \Criteria('status', true)); |
| 425 | 425 | |
| 426 | - $answerObjects =& $answerHandler->getObjects($criteria, true); |
|
| 426 | + $answerObjects = & $answerHandler->getObjects($criteria, true); |
|
| 427 | 427 | |
| 428 | 428 | foreach (array_keys($answerObjects) as $j) { |
| 429 | 429 | $answerObj = $answerObjects[$j]; |
@@ -436,20 +436,20 @@ discard block |
||
| 436 | 436 | } else { |
| 437 | 437 | $answerSubmitter = '--------'; |
| 438 | 438 | } |
| 439 | - echo "<td class='even' align='center'>" . $answerSubmitter . '</td>'; |
|
| 439 | + echo "<td class='even' align='center'>".$answerSubmitter.'</td>'; |
|
| 440 | 440 | |
| 441 | 441 | //mb--------------------------------------- |
| 442 | 442 | |
| 443 | - echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>'; |
|
| 444 | - echo "<td class='even' align='center'>" . $statustxt . '</td>'; |
|
| 443 | + echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>'; |
|
| 444 | + echo "<td class='even' align='center'>".$statustxt.'</td>'; |
|
| 445 | 445 | //echo "<td class='even' align='center'>" . $answers . "</td>"; |
| 446 | - echo "<td class='even' align='center'> " . $approve . $modify . $delete . '</td>'; |
|
| 446 | + echo "<td class='even' align='center'> ".$approve.$modify.$delete.'</td>'; |
|
| 447 | 447 | echo '</tr>'; |
| 448 | 448 | } |
| 449 | 449 | } else { |
| 450 | 450 | // that is, $numrows = 0, there's no entries yet |
| 451 | 451 | echo '<tr>'; |
| 452 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQSSEL . '</td>'; |
|
| 452 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQSSEL.'</td>'; |
|
| 453 | 453 | echo '</tr>'; |
| 454 | 454 | } |
| 455 | 455 | echo "</table>\n"; |
@@ -457,9 +457,9 @@ discard block |
||
| 457 | 457 | $pagenav = new \XoopsPageNav($numrows, $xoopsModuleConfig['perpage'], $startentry, 'startentry', "statussel=$statussel&sortsel=$sortsel&ordersel=$ordersel"); |
| 458 | 458 | |
| 459 | 459 | if (1 == $xoopsModuleConfig['useimagenavpage']) { |
| 460 | - echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderImageNav() . '</div>'; |
|
| 460 | + echo '<div style="text-align:right; background-color: white; margin: 10px 0;">'.$pagenav->renderImageNav().'</div>'; |
|
| 461 | 461 | } else { |
| 462 | - echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderNav() . '</div>'; |
|
| 462 | + echo '<div style="text-align:right; background-color: white; margin: 10px 0;">'.$pagenav->renderNav().'</div>'; |
|
| 463 | 463 | } |
| 464 | 464 | // ENDs code to show active entries |
| 465 | 465 | echo '</div>'; |
@@ -467,4 +467,4 @@ discard block |
||
| 467 | 467 | echo '</div>'; |
| 468 | 468 | echo '</div>'; |
| 469 | 469 | |
| 470 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 470 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -9,14 +9,14 @@ discard block |
||
| 9 | 9 | use XoopsModules\Smartfaq; |
| 10 | 10 | use XoopsModules\Smartfaq\Constants; |
| 11 | 11 | |
| 12 | -require_once __DIR__ . '/header.php'; |
|
| 12 | +require_once __DIR__.'/header.php'; |
|
| 13 | 13 | |
| 14 | 14 | global $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
| 15 | 15 | |
| 16 | 16 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl'; |
| 17 | 17 | |
| 18 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 19 | -require_once __DIR__ . '/footer.php'; |
|
| 18 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 19 | +require_once __DIR__.'/footer.php'; |
|
| 20 | 20 | |
| 21 | 21 | $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
| 22 | 22 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $last_qnaObj = $faqHandler->getLastPublishedByCat([Constants::SF_STATUS_OPENED]); |
| 64 | 64 | if (isset($last_qnaObj[$categoryid])) { |
| 65 | 65 | $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid')); |
| 66 | - $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>'); |
|
| 66 | + $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>'); |
|
| 67 | 67 | } |
| 68 | 68 | // Populating the smarty variables with informations related to the selected category |
| 69 | 69 | $category = $categoryObj->toArray(null, true); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $category['categoryPath'] = $categoryObj->getCategoryPath(false, true); |
| 72 | 72 | |
| 73 | 73 | // Creating the sub-categories objects that belong to the selected category |
| 74 | -$subcatsObj =& $categoryHandler->getCategories(0, 0, $categoryid); |
|
| 74 | +$subcatsObj = & $categoryHandler->getCategories(0, 0, $categoryid); |
|
| 75 | 75 | $total_subcats = count($subcatsObj); |
| 76 | 76 | $catQnasWithSub = 0; |
| 77 | 77 | if (0 != $total_subcats) { |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 83 | 83 | if (isset($last_qnaObj[$subcat_id])) { |
| 84 | 84 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 85 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
| 85 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
| 86 | 86 | } |
| 87 | 87 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
| 88 | 88 | $subcats[$subcat_id] = $subcat->toArray(null, true); |
| 89 | - $catQnasWithSub += $subcats[$subcat_id]['total']; |
|
| 89 | + $catQnasWithSub += $subcats[$subcat_id]['total']; |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | $xoopsTpl->assign('subcats', $subcats); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $memberHandler = xoops_getHandler('member'); |
| 103 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 103 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 104 | 104 | foreach ($faqsObj as $iValue) { |
| 105 | 105 | $faq = $iValue->toArray(null, $allcategories); |
| 106 | 106 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | // Language constants |
| 115 | -$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>'); |
|
| 115 | +$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>'); |
|
| 116 | 116 | $xoopsTpl->assign('modulename', $xoopsModule->dirname()); |
| 117 | 117 | |
| 118 | 118 | $xoopsTpl->assign('displaylastfaqs', true); |
@@ -129,19 +129,19 @@ discard block |
||
| 129 | 129 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
| 130 | 130 | |
| 131 | 131 | // The Navigation Bar |
| 132 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 133 | -$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
| 132 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 133 | +$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
| 134 | 134 | if (1 == $xoopsModuleConfig['useimagenavpage']) { |
| 135 | - $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'; |
|
| 135 | + $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'; |
|
| 136 | 136 | } else { |
| 137 | - $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 137 | + $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $xoopsTpl->assign('category', $category); |
| 141 | 141 | |
| 142 | 142 | // Page Title Hack by marcan |
| 143 | 143 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 144 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
| 144 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
| 145 | 145 | // End Page Title Hack by marcan |
| 146 | 146 | |
| 147 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 147 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $attachment_save = base64_encode(serialize($this->attachment_array)); |
| 101 | 101 | } |
| 102 | 102 | $this->setVar('attachment', $attachment_save); |
| 103 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid'); |
|
| 103 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid'); |
|
| 104 | 104 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 105 | 105 | //xoops_error($GLOBALS["xoopsDB"]->error()); |
| 106 | 106 | return false; |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | foreach ($attach_old as $key => $attach) { |
| 134 | 134 | if (in_array($key, $attach_array)) { |
| 135 | - @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attach['name_saved']); |
|
| 136 | - @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/thumbs/' . $attach['name_saved']); // delete thumbnails |
|
| 135 | + @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attach['name_saved']); |
|
| 136 | + @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/thumbs/'.$attach['name_saved']); // delete thumbnails |
|
| 137 | 137 | continue; |
| 138 | 138 | } |
| 139 | 139 | $this->attachment_array[$key] = $attach; |
@@ -190,24 +190,24 @@ discard block |
||
| 190 | 190 | if (is_array($attachments) && count($attachments) > 0) { |
| 191 | 191 | $iconHandler = sf_getIconHandler(); |
| 192 | 192 | $mime_path = $iconHandler->getPath('mime'); |
| 193 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php'; |
|
| 193 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php'; |
|
| 194 | 194 | $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!! |
| 195 | - $post_attachment .= '<br><strong>' . _MD_ATTACHMENT . '</strong>:'; |
|
| 195 | + $post_attachment .= '<br><strong>'._MD_ATTACHMENT.'</strong>:'; |
|
| 196 | 196 | $post_attachment .= '<br><hr size="1" noshade="noshade"><br>'; |
| 197 | 197 | foreach ($attachments as $key => $att) { |
| 198 | 198 | $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.'); |
| 199 | 199 | $filetype = $file_extension; |
| 200 | - if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) { |
|
| 201 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif'; |
|
| 200 | + if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) { |
|
| 201 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif'; |
|
| 202 | 202 | } else { |
| 203 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif'; |
|
| 203 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif'; |
|
| 204 | 204 | } |
| 205 | - $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $att['name_saved']); |
|
| 206 | - $file_size = number_format($file_size / 1024, 2) . ' KB'; |
|
| 205 | + $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$att['name_saved']); |
|
| 206 | + $file_size = number_format($file_size / 1024, 2).' KB'; |
|
| 207 | 207 | if ($xoopsModuleConfig['media_allowed'] && in_array(strtolower($file_extension), $image_extensions)) { |
| 208 | - $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '"><strong> ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>'; |
|
| 209 | - $post_attachment .= '<br>' . sf_attachmentImage($att['name_saved']); |
|
| 210 | - $isDisplayed = true; |
|
| 208 | + $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'"><strong> '.$att['name_display'].'</strong> <small>('.$file_size.')</small>'; |
|
| 209 | + $post_attachment .= '<br>'.sf_attachmentImage($att['name_saved']); |
|
| 210 | + $isDisplayed = true; |
|
| 211 | 211 | } else { |
| 212 | 212 | global $xoopsUser; |
| 213 | 213 | if (empty($xoopsModuleConfig['show_userattach'])) { |
@@ -364,9 +364,9 @@ discard block |
||
| 364 | 364 | $tags = []; |
| 365 | 365 | $tags['MODULE_NAME'] = $myts->displayTarea($smartModule->getVar('name')); |
| 366 | 366 | $tags['FAQ_NAME'] = $faqObj->question(); |
| 367 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid(); |
|
| 367 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid(); |
|
| 368 | 368 | $tags['CATEGORY_NAME'] = $faqObj->getCategoryName(); |
| 369 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid(); |
|
| 369 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid(); |
|
| 370 | 370 | $tags['FAQ_QUESTION'] = $faqObj->question(); |
| 371 | 371 | |
| 372 | 372 | // TODO : Not sure about the 'formpreview' ... |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | if (0 != $maxLength) { |
| 188 | 188 | if (!XOOPS_USE_MULTIBYTES) { |
| 189 | 189 | if (strlen($ret) >= $maxLength) { |
| 190 | - $ret = substr($ret, 0, $maxLength - 1) . '...'; |
|
| 190 | + $ret = substr($ret, 0, $maxLength - 1).'...'; |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -379,14 +379,14 @@ discard block |
||
| 379 | 379 | $theAnswers = $answerHandler->getAllAnswers($this->faqid(), Constants::SF_AN_STATUS_APPROVED, 1, 0); |
| 380 | 380 | //echo "test"; |
| 381 | 381 | //exit; |
| 382 | - $this->answer =& $theAnswers[0]; |
|
| 382 | + $this->answer = & $theAnswers[0]; |
|
| 383 | 383 | break; |
| 384 | 384 | |
| 385 | 385 | case Constants::SF_STATUS_ANSWERED: |
| 386 | 386 | $theAnswers = $answerHandler->getAllAnswers($this->faqid(), Constants::SF_AN_STATUS_PROPOSED, 1, 0); |
| 387 | 387 | //echo "test"; |
| 388 | 388 | //exit; |
| 389 | - $this->answer =& $theAnswers[0]; |
|
| 389 | + $this->answer = & $theAnswers[0]; |
|
| 390 | 390 | break; |
| 391 | 391 | |
| 392 | 392 | case Constants::SF_STATUS_PUBLISHED: |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | $tags['MODULE_NAME'] = $myts->displayTarea($smartModule->getVar('name')); |
| 473 | 473 | $tags['FAQ_NAME'] = $this->question(); |
| 474 | 474 | $tags['CATEGORY_NAME'] = $this->getCategoryName(); |
| 475 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid(); |
|
| 475 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid(); |
|
| 476 | 476 | $tags['FAQ_QUESTION'] = $this->question(); |
| 477 | 477 | $answerObj = $this->answer(); |
| 478 | 478 | if (is_object($answerObj)) { |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | foreach ($notifications as $notification) { |
| 485 | 485 | switch ($notification) { |
| 486 | 486 | case Constants::SF_NOT_FAQ_PUBLISHED: |
| 487 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $this->faqid(); |
|
| 487 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$this->faqid(); |
|
| 488 | 488 | |
| 489 | 489 | $notificationHandler->triggerEvent('global_faq', 0, 'published', $tags); |
| 490 | 490 | $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'published', $tags); |
@@ -492,20 +492,20 @@ discard block |
||
| 492 | 492 | break; |
| 493 | 493 | |
| 494 | 494 | case Constants::SF_NOT_FAQ_SUBMITTED: |
| 495 | - $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/faq.php?faqid=' . $this->faqid(); |
|
| 495 | + $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/faq.php?faqid='.$this->faqid(); |
|
| 496 | 496 | $notificationHandler->triggerEvent('global_faq', 0, 'submitted', $tags); |
| 497 | 497 | $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'submitted', $tags); |
| 498 | 498 | break; |
| 499 | 499 | |
| 500 | 500 | case Constants::SF_NOT_QUESTION_PUBLISHED: |
| 501 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/answer.php?faqid=' . $this->faqid(); |
|
| 501 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/answer.php?faqid='.$this->faqid(); |
|
| 502 | 502 | $notificationHandler->triggerEvent('global_question', 0, 'published', $tags); |
| 503 | 503 | $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'published', $tags); |
| 504 | 504 | $notificationHandler->triggerEvent('question', $this->faqid(), 'approved', $tags); |
| 505 | 505 | break; |
| 506 | 506 | |
| 507 | 507 | case Constants::SF_NOT_QUESTION_SUBMITTED: |
| 508 | - $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/question.php?op=mod&faqid=' . $this->faqid(); |
|
| 508 | + $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/question.php?op=mod&faqid='.$this->faqid(); |
|
| 509 | 509 | $notificationHandler->triggerEvent('global_question', 0, 'submitted', $tags); |
| 510 | 510 | $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'submitted', $tags); |
| 511 | 511 | break; |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | break; |
| 516 | 516 | |
| 517 | 517 | case Constants::SF_NOT_NEW_ANSWER_PROPOSED: |
| 518 | - $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/answer.php?op=mod&faqid=' . $this->faqid(); |
|
| 518 | + $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/answer.php?op=mod&faqid='.$this->faqid(); |
|
| 519 | 519 | $notificationHandler->triggerEvent('global_faq', 0, 'answer_proposed', $tags); |
| 520 | 520 | $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'answer_proposed', $tags); |
| 521 | 521 | break; |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | $text = _MD_SF_FAQCOMEFROM; |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | - return $text . $xoopsConfig['sitename'] . ' : <a href=' . XOOPS_URL . '/modules/smartfaq/faq.php?faqid=' . $this->faqid() . '>' . XOOPS_URL . '/modules/smartfaq/faq.php?faqid=' . $this->faqid() . '</a>'; |
|
| 632 | + return $text.$xoopsConfig['sitename'].' : <a href='.XOOPS_URL.'/modules/smartfaq/faq.php?faqid='.$this->faqid().'>'.XOOPS_URL.'/modules/smartfaq/faq.php?faqid='.$this->faqid().'</a>'; |
|
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | /** |
@@ -648,9 +648,9 @@ discard block |
||
| 648 | 648 | $faq['question'] = $this->question(); |
| 649 | 649 | $page = (Constants::SF_STATUS_OPENED == $this->status()) ? 'answer.php' : 'faq.php'; |
| 650 | 650 | |
| 651 | - $faq['questionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question($lastfaqsize) . '</a>'; |
|
| 651 | + $faq['questionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question($lastfaqsize).'</a>'; |
|
| 652 | 652 | if ($linkInQuestion) { |
| 653 | - $faq['fullquestionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question() . '</a>'; |
|
| 653 | + $faq['fullquestionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question().'</a>'; |
|
| 654 | 654 | } else { |
| 655 | 655 | $faq['fullquestionlink'] = $this->question(); |
| 656 | 656 | } |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | $categoryObj = $category[$this->categoryid()]; |
| 667 | 667 | } |
| 668 | 668 | $faq['categoryname'] = $categoryObj->getVar('name'); |
| 669 | - $faq['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $categoryObj->getVar('name') . '</a>'; |
|
| 669 | + $faq['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$categoryObj->getVar('name').'</a>'; |
|
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | return $faq; |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 29 | 29 | |
| 30 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php'; |
|
| 31 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php'; |
|
| 32 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhiddentoken.php'; |
|
| 33 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php'; |
|
| 34 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php'; |
|
| 35 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php'; |
|
| 30 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
|
| 31 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php'; |
|
| 32 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhiddentoken.php'; |
|
| 33 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php'; |
|
| 34 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php'; |
|
| 35 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php'; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Renders a form for setting module specific group permissions |
@@ -162,11 +162,11 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | $gpermHandler = xoops_getHandler('groupperm'); |
| 164 | 164 | $memberHandler = xoops_getHandler('member'); |
| 165 | - $glist =& $memberHandler->getGroupList(); |
|
| 165 | + $glist = & $memberHandler->getGroupList(); |
|
| 166 | 166 | foreach (array_keys($glist) as $i) { |
| 167 | 167 | // get selected item id(s) for each group |
| 168 | 168 | $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid); |
| 169 | - $ele = new Smartfaq\GroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected); |
|
| 169 | + $ele = new Smartfaq\GroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected); |
|
| 170 | 170 | $ele->setOptionTree($this->_itemTree); |
| 171 | 171 | |
| 172 | 172 | foreach ($this->_appendix as $key => $append) { |
@@ -193,18 +193,18 @@ discard block |
||
| 193 | 193 | $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
| 194 | 194 | $this->addElement($tray); |
| 195 | 195 | |
| 196 | - $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br>'; |
|
| 197 | - $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
| 198 | - $elements =& $this->getElements(); |
|
| 196 | + $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br>'; |
|
| 197 | + $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
| 198 | + $elements = & $this->getElements(); |
|
| 199 | 199 | foreach (array_keys($elements) as $i) { |
| 200 | 200 | if (!is_object($elements[$i])) { |
| 201 | 201 | $ret .= $elements[$i]; |
| 202 | 202 | } elseif (!$elements[$i]->isHidden()) { |
| 203 | - $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption(); |
|
| 203 | + $ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption(); |
|
| 204 | 204 | if ('' != $elements[$i]->getDescription()) { |
| 205 | - $ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>'; |
|
| 205 | + $ret .= '<br><br><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>'; |
|
| 206 | 206 | } |
| 207 | - $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n"; |
|
| 207 | + $ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n"; |
|
| 208 | 208 | } else { |
| 209 | 209 | $ret .= $elements[$i]->render(); |
| 210 | 210 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | use XoopsModules\Smartfaq; |
| 10 | 10 | |
| 11 | -require_once __DIR__ . '/header.php'; |
|
| 11 | +require_once __DIR__.'/header.php'; |
|
| 12 | 12 | |
| 13 | 13 | $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
| 14 | 14 | |
@@ -46,23 +46,23 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; |
| 48 | 48 | echo "<html>\n<head>\n"; |
| 49 | -echo '<title>' . _MD_SF_FAQCOMEFROM . ' ' . $xoopsConfig['sitename'] . "</title>\n"; |
|
| 50 | -echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "'>\n"; |
|
| 51 | -echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "'>\n"; |
|
| 52 | -echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "'>\n"; |
|
| 53 | -echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "'>\n"; |
|
| 54 | -echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "'>\n\n\n"; |
|
| 49 | +echo '<title>'._MD_SF_FAQCOMEFROM.' '.$xoopsConfig['sitename']."</title>\n"; |
|
| 50 | +echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."'>\n"; |
|
| 51 | +echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."'>\n"; |
|
| 52 | +echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."'>\n"; |
|
| 53 | +echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."'>\n"; |
|
| 54 | +echo "<meta name='GENERATOR' content='".XOOPS_VERSION."'>\n\n\n"; |
|
| 55 | 55 | |
| 56 | 56 | echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'> |
| 57 | 57 | <div style='width: 650px; border: 1px solid #000; padding: 20px;'> |
| 58 | - <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>" . $faqObj->question() . "</h2></div> |
|
| 59 | - <div align='center'>" . $who_where . "</div> |
|
| 58 | + <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL."/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>".$faqObj->question()."</h2></div> |
|
| 59 | + <div align='center'>" . $who_where."</div> |
|
| 60 | 60 | <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div> |
| 61 | 61 | <div></div> |
| 62 | - <b><p>" . $faqObj->question() . '</p></b> |
|
| 63 | - <p>' . $answerObj->answer() . "</p> |
|
| 62 | + <b><p>" . $faqObj->question().'</p></b> |
|
| 63 | + <p>' . $answerObj->answer()."</p> |
|
| 64 | 64 | <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div> |
| 65 | - <p>" . $comeFrom . '</p> |
|
| 65 | + <p>" . $comeFrom.'</p> |
|
| 66 | 66 | </div> |
| 67 | 67 | <br>'; |
| 68 | 68 | |
@@ -28,24 +28,24 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | global $xoopsModuleConfig; |
| 30 | 30 | |
| 31 | - $img_path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments']; |
|
| 32 | - $img_url = XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments']; |
|
| 33 | - $thumb_path = $img_path . '/thumbs'; |
|
| 34 | - $thumb_url = $img_url . '/thumbs'; |
|
| 31 | + $img_path = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments']; |
|
| 32 | + $img_url = XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments']; |
|
| 33 | + $thumb_path = $img_path.'/thumbs'; |
|
| 34 | + $thumb_url = $img_url.'/thumbs'; |
|
| 35 | 35 | |
| 36 | - $thumb = $thumb_path . '/' . $source; |
|
| 37 | - $image = $img_path . '/' . $source; |
|
| 38 | - $thumb_url = $thumb_url . '/' . $source; |
|
| 39 | - $image_url = $img_url . '/' . $source; |
|
| 36 | + $thumb = $thumb_path.'/'.$source; |
|
| 37 | + $image = $img_path.'/'.$source; |
|
| 38 | + $thumb_url = $thumb_url.'/'.$source; |
|
| 39 | + $image_url = $img_url.'/'.$source; |
|
| 40 | 40 | |
| 41 | 41 | $imginfo = @getimagesize($image); |
| 42 | - $img_info = (count($imginfo) > 0) ? $imginfo[0] . 'X' . $imginfo[1] . ' px' : ''; |
|
| 42 | + $img_info = (count($imginfo) > 0) ? $imginfo[0].'X'.$imginfo[1].' px' : ''; |
|
| 43 | 43 | |
| 44 | 44 | if ($xoopsModuleConfig['max_image_width'] > 0 && $xoopsModuleConfig['max_image_height'] > 0) { |
| 45 | 45 | if ($imginfo[0] > $xoopsModuleConfig['max_image_width'] |
| 46 | 46 | || $imginfo[1] > $xoopsModuleConfig['max_image_height']) { |
| 47 | 47 | //if (!file_exists($thumb_path.'/'.$source) && $imginfo[0] > $xoopsModuleConfig['max_img_width']) { |
| 48 | - if (!file_exists($thumb_path . '/' . $source)) { |
|
| 48 | + if (!file_exists($thumb_path.'/'.$source)) { |
|
| 49 | 49 | sf_createThumbnail($source, $xoopsModuleConfig['max_image_width']); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -54,27 +54,27 @@ discard block |
||
| 54 | 54 | || $imginfo[1] > $xoopsModuleConfig['max_image_height']) { |
| 55 | 55 | $pseudo_width = $xoopsModuleConfig['max_image_width']; |
| 56 | 56 | $pseudo_height = $xoopsModuleConfig['max_image_width'] * ($imginfo[1] / $imginfo[0]); |
| 57 | - $pseudo_size = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'"; |
|
| 57 | + $pseudo_size = "width='".$pseudo_width."px' height='".$pseudo_height."px'"; |
|
| 58 | 58 | } |
| 59 | 59 | // irmtfan to fix Undefined variable: pseudo_height |
| 60 | 60 | if (!empty($pseudo_height) && $xoopsModuleConfig['max_image_height'] > 0 |
| 61 | 61 | && $pseudo_height > $xoopsModuleConfig['max_image_height']) { |
| 62 | 62 | $pseudo_height = $xoopsModuleConfig['max_image_height']; |
| 63 | 63 | $pseudo_width = $xoopsModuleConfig['max_image_height'] * ($imginfo[0] / $imginfo[1]); |
| 64 | - $pseudo_size = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'"; |
|
| 64 | + $pseudo_size = "width='".$pseudo_width."px' height='".$pseudo_height."px'"; |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if (file_exists($thumb)) { |
| 69 | - $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">'; |
|
| 70 | - $attachmentImage .= '<img src="' . $thumb_url . '" alt="' . $source . ' ' . $img_info . '">'; |
|
| 69 | + $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">'; |
|
| 70 | + $attachmentImage .= '<img src="'.$thumb_url.'" alt="'.$source.' '.$img_info.'">'; |
|
| 71 | 71 | $attachmentImage .= '</a>'; |
| 72 | 72 | } elseif (!empty($pseudo_size)) { |
| 73 | - $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">'; |
|
| 74 | - $attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '">'; |
|
| 73 | + $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">'; |
|
| 74 | + $attachmentImage .= '<img src="'.$image_url.'" '.$pseudo_size.' alt="'.$source.' '.$img_info.'">'; |
|
| 75 | 75 | $attachmentImage .= '</a>'; |
| 76 | 76 | } elseif (file_exists($image)) { |
| 77 | - $attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '">'; |
|
| 77 | + $attachmentImage = '<img src="'.$image_url.'" alt="'.$source.' '.$img_info.'">'; |
|
| 78 | 78 | } else { |
| 79 | 79 | $attachmentImage = ''; |
| 80 | 80 | } |
@@ -91,10 +91,10 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | global $xoopsModuleConfig; |
| 93 | 93 | |
| 94 | - $img_path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments']; |
|
| 95 | - $thumb_path = $img_path . '/thumbs'; |
|
| 96 | - $src_file = $img_path . '/' . $source; |
|
| 97 | - $new_file = $thumb_path . '/' . $source; |
|
| 94 | + $img_path = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments']; |
|
| 95 | + $thumb_path = $img_path.'/thumbs'; |
|
| 96 | + $src_file = $img_path.'/'.$source; |
|
| 97 | + $new_file = $thumb_path.'/'.$source; |
|
| 98 | 98 | //$imageLibs = sf_getImageLibs(); |
| 99 | 99 | |
| 100 | 100 | if (!filesize($src_file) || !is_readable($src_file)) { |
@@ -120,14 +120,14 @@ discard block |
||
| 120 | 120 | if (1 == $xoopsModuleConfig['image_lib'] or 0 == $xoopsModuleConfig['image_lib']) { |
| 121 | 121 | if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) { |
| 122 | 122 | $cur_dir = __DIR__; |
| 123 | - $src_file_im = '"' . $cur_dir . '\\' . str_replace('/', '\\', $src_file) . '"'; |
|
| 124 | - $new_file_im = '"' . $cur_dir . '\\' . str_replace('/', '\\', $new_file) . '"'; |
|
| 123 | + $src_file_im = '"'.$cur_dir.'\\'.str_replace('/', '\\', $src_file).'"'; |
|
| 124 | + $new_file_im = '"'.$cur_dir.'\\'.str_replace('/', '\\', $new_file).'"'; |
|
| 125 | 125 | } else { |
| 126 | 126 | $src_file_im = @escapeshellarg($src_file); |
| 127 | 127 | $new_file_im = @escapeshellarg($new_file); |
| 128 | 128 | } |
| 129 | - $path = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'] . '/'; |
|
| 130 | - $magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . ''; |
|
| 129 | + $path = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'].'/'; |
|
| 130 | + $magick_command = $path.'convert -quality 85 -antialias -sample '.$newWidth.'x'.$newHeight.' '.$src_file_im.' +profile "*" '.str_replace('\\', '/', $new_file_im).''; |
|
| 131 | 131 | |
| 132 | 132 | @passthru($magick_command); |
| 133 | 133 | if (file_exists($new_file)) { |
@@ -136,13 +136,13 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (2 == $xoopsModuleConfig['image_lib'] or 0 == $xoopsModuleConfig['image_lib']) { |
| 139 | - $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'] . '/'; |
|
| 139 | + $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'].'/'; |
|
| 140 | 140 | if (preg_match("/\.png/i", $source)) { |
| 141 | - $cmd = $path . "pngtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "pnmtopng > $new_file"; |
|
| 141 | + $cmd = $path."pngtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."pnmtopng > $new_file"; |
|
| 142 | 142 | } elseif (preg_match("/\.(jpg|jpeg)/i", $source)) { |
| 143 | - $cmd = $path . "jpegtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "ppmtojpeg -quality=90 > $new_file"; |
|
| 143 | + $cmd = $path."jpegtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."ppmtojpeg -quality=90 > $new_file"; |
|
| 144 | 144 | } elseif (preg_match("/\.gif/i", $source)) { |
| 145 | - $cmd = $path . "giftopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | ppmquant 256 | " . $path . "ppmtogif > $new_file"; |
|
| 145 | + $cmd = $path."giftopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path."ppmtogif > $new_file"; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | @exec($cmd, $output, $retval); |
@@ -22,25 +22,25 @@ discard block |
||
| 22 | 22 | $moduleDirName = basename(dirname(__DIR__)); |
| 23 | 23 | $moduleDirNameUpper = strtoupper($moduleDirName); |
| 24 | 24 | return (object)[ |
| 25 | - 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
|
| 25 | + 'name' => strtoupper($moduleDirName).' Module Configurator', |
|
| 26 | 26 | 'paths' => [ |
| 27 | 27 | 'dirname' => $moduleDirName, |
| 28 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
| 29 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
| 30 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
| 31 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 32 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
| 28 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
| 29 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
| 30 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
| 31 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 32 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
| 33 | 33 | ], |
| 34 | 34 | 'uploadFolders' => [ |
| 35 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
| 36 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category', |
|
| 37 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots', |
|
| 35 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
| 36 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category', |
|
| 37 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots', |
|
| 38 | 38 | //XOOPS_UPLOAD_PATH . '/flags' |
| 39 | 39 | ], |
| 40 | 40 | 'copyBlankFiles' => [ |
| 41 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
| 42 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category', |
|
| 43 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots', |
|
| 41 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
| 42 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category', |
|
| 43 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots', |
|
| 44 | 44 | //XOOPS_UPLOAD_PATH . '/flags' |
| 45 | 45 | ], |
| 46 | 46 | |
@@ -75,6 +75,6 @@ discard block |
||
| 75 | 75 | '/images', |
| 76 | 76 | ], |
| 77 | 77 | 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
| 78 | - <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>', |
|
| 78 | + <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>', |
|
| 79 | 79 | ]; |
| 80 | 80 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | use XoopsModules\Smartfaq; |
| 10 | 10 | |
| 11 | -require_once __DIR__ . '/header.php'; |
|
| 11 | +require_once __DIR__.'/header.php'; |
|
| 12 | 12 | |
| 13 | 13 | $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
| 14 | 14 | |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl'; |
| 37 | 37 | |
| 38 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 39 | -require_once __DIR__ . '/footer.php'; |
|
| 38 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 39 | +require_once __DIR__.'/footer.php'; |
|
| 40 | 40 | |
| 41 | 41 | // At which record shall we start |
| 42 | 42 | $start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | $lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize']; |
| 78 | 78 | // Creating the sub-categories objects that belong to the selected category |
| 79 | -$subcatsObj =& $categoryHandler->getCategories(0, 0, $categoryid); |
|
| 79 | +$subcatsObj = & $categoryHandler->getCategories(0, 0, $categoryid); |
|
| 80 | 80 | $total_subcats = count($subcatsObj); |
| 81 | 81 | $total_faqs = 0; |
| 82 | 82 | if (0 != $total_subcats) { |
@@ -86,12 +86,12 @@ discard block |
||
| 86 | 86 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 87 | 87 | if (isset($last_qnaObj[$subcat_id])) { |
| 88 | 88 | $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 89 | - $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
| 89 | + $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]); |
| 93 | 93 | $subcats[$subcat_id] = $subcatsObj[$i]->toArray(); |
| 94 | - $total_faqs += $totalQnas[$subcat_id]; |
|
| 94 | + $total_faqs += $totalQnas[$subcat_id]; |
|
| 95 | 95 | //}replacé ligne 92 |
| 96 | 96 | } |
| 97 | 97 | $xoopsTpl->assign('subcats', $subcats); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $memberHandler = xoops_getHandler('member'); |
| 117 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 117 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 118 | 118 | // Adding the Q&As of the selected category |
| 119 | 119 | foreach ($faqsObj as $iValue) { |
| 120 | 120 | $faq = $iValue->toArray(null, $categoryObj); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | if (isset($last_qnaObj) && $last_qnaObj) { |
| 142 | 142 | $category['last_faqid'] = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid'); |
| 143 | - $category['last_question_link'] = "<a href='faq.php?faqid=" . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid') . "'>" . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize) . '</a>'; |
|
| 143 | + $category['last_question_link'] = "<a href='faq.php?faqid=".$last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')."'>".$last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize).'</a>'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -165,26 +165,26 @@ discard block |
||
| 165 | 165 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
| 166 | 166 | |
| 167 | 167 | // The Navigation Bar |
| 168 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 169 | -$pagenav = new \XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
| 168 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 169 | +$pagenav = new \XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
| 170 | 170 | if (1 == $xoopsModuleConfig['useimagenavpage']) { |
| 171 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 171 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 172 | 172 | } else { |
| 173 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 173 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | $xoopsTpl->assign('category', $category); |
| 177 | 177 | |
| 178 | 178 | // Page Title Hack by marcan |
| 179 | 179 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 180 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
| 180 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
| 181 | 181 | // End Page Title Hack by marcan |
| 182 | 182 | |
| 183 | 183 | //code to include smartie |
| 184 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
| 185 | - require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
| 184 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
| 185 | + require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
| 186 | 186 | $xoopsTpl->assign('smarttie', 1); |
| 187 | 187 | } |
| 188 | 188 | //end code for smarttie |
| 189 | 189 | |
| 190 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 190 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|