| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | function sb_com_update($art_id, $total_num) |
||
| 14 | { |
||
| 15 | //HACK |
||
| 16 | //get soapbox moduleConfig |
||
| 17 | global $xoopsModule; |
||
| 18 | $hModConfig = xoops_getHandler('config'); |
||
| 19 | $soapModuleConfig = $hModConfig->getConfigList((int)$xoopsModule->getVar('mid')); |
||
|
|
|||
| 20 | $globaldisplaycomments = 0; |
||
| 21 | if (isset($soapModuleConfig['globaldisplaycomments'])) { |
||
| 22 | $globaldisplaycomments = $soapModuleConfig['globaldisplaycomments']; |
||
| 23 | } |
||
| 24 | if (0 === $globaldisplaycomments) { |
||
| 25 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
||
| 26 | $sql = 'UPDATE ' . $db->prefix('sbarticles') . ' SET commentable = ' . (int)$total_num . ' WHERE articleID = ' . (int)$art_id; |
||
| 27 | $db->query($sql); |
||
| 28 | } |
||
| 38 |