@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
21 | -require_once XOOPS_ROOT_PATH . '/kernel/user.php'; |
|
22 | -require_once XOOPS_ROOT_PATH . '/kernel/group.php'; |
|
23 | -require_once XOOPS_ROOT_PATH . '/kernel/member.php'; |
|
21 | +require_once XOOPS_ROOT_PATH.'/kernel/user.php'; |
|
22 | +require_once XOOPS_ROOT_PATH.'/kernel/group.php'; |
|
23 | +require_once XOOPS_ROOT_PATH.'/kernel/member.php'; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * XOOPS member handler class. |
@@ -141,12 +141,12 @@ discard block |
||
141 | 141 | // send some notifications |
142 | 142 | $xoopsMailer = xoops_getMailer(); |
143 | 143 | $xoopsMailer->useMail(); |
144 | - $xoopsMailer->setTemplateDir(SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/mail_template'); |
|
144 | + $xoopsMailer->setTemplateDir(SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/mail_template'); |
|
145 | 145 | $xoopsMailer->setTemplate('smartobject_notify_user_added_by_admin.tpl'); |
146 | 146 | $xoopsMailer->assign('XOOPS_USER_PASSWORD', $password); |
147 | 147 | $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']); |
148 | 148 | $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
149 | - $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
149 | + $xoopsMailer->assign('SITEURL', XOOPS_URL.'/'); |
|
150 | 150 | $xoopsMailer->assign('NAME', $userObj->getVar('name')); |
151 | 151 | $xoopsMailer->assign('UNAME', $userObj->getVar('uname')); |
152 | 152 | $xoopsMailer->setToUsers($userObj); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if (strlen($name) > 0) { |
193 | 193 | $name = explode(' ', trim($name)); |
194 | 194 | if (count($name) > 1) { |
195 | - $basename = strtolower(substr($name[0], 0, 1) . $name[count($name) - 1]); |
|
195 | + $basename = strtolower(substr($name[0], 0, 1).$name[count($name) - 1]); |
|
196 | 196 | } else { |
197 | 197 | $basename = strtolower($name[0]); |
198 | 198 | } |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | while ($i < $count) { |
210 | 210 | $num = $this->genRandNumber(); |
211 | 211 | if ($onbasename < 0 && $hasbasename) { |
212 | - $names[] = xoops_substr($basename, 0, 58, '') . $num; |
|
212 | + $names[] = xoops_substr($basename, 0, 58, '').$num; |
|
213 | 213 | } else { |
214 | - $names[] = xoops_substr($emailname, 0, 58, '') . $num; |
|
214 | + $names[] = xoops_substr($emailname, 0, 58, '').$num; |
|
215 | 215 | } |
216 | 216 | $i = count($names); |
217 | 217 | $onbasename = ~$onbasename; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | { |
254 | 254 | static $randCalled = false; |
255 | 255 | if (!$randCalled) { |
256 | - mt_srand((double)microtime() * 1000000); |
|
256 | + mt_srand((double) microtime() * 1000000); |
|
257 | 257 | $randCalled = true; |
258 | 258 | } |
259 | 259 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
14 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartseoobject.php'; |
|
14 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartseoobject.php'; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Class SmartobjectCategory |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | global $myts; |
96 | 96 | $objectArray = parent::toArray(); |
97 | 97 | if ($objectArray['image']) { |
98 | - $objectArray['image'] = $this->getImageDir() . $objectArray['image']; |
|
98 | + $objectArray['image'] = $this->getImageDir().$objectArray['image']; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return $objectArray; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function getCategoryPath($withAllLink = true, $currentCategory = false) |
113 | 113 | { |
114 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php'; |
|
114 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php'; |
|
115 | 115 | $controller = new SmartObjectController($this->handler); |
116 | 116 | |
117 | 117 | if (!$this->_categoryPath) { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | exit; |
129 | 129 | } |
130 | 130 | $parentid = $parentObj->getVar('parentid'); |
131 | - $ret = $parentObj->getCategoryPath($withAllLink, $currentCategory) . ' > ' . $ret; |
|
131 | + $ret = $parentObj->getCategoryPath($withAllLink, $currentCategory).' > '.$ret; |
|
132 | 132 | } |
133 | 133 | $this->_categoryPath = $ret; |
134 | 134 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | { |
204 | 204 | if (!$this->allCategoriesId) { |
205 | 205 | $ret = array(); |
206 | - $sql = 'SELECT categoryid, parentid FROM ' . $this->table . ' AS ' . $this->_itemname . ' ORDER BY parentid'; |
|
206 | + $sql = 'SELECT categoryid, parentid FROM '.$this->table.' AS '.$this->_itemname.' ORDER BY parentid'; |
|
207 | 207 | |
208 | 208 | $result = $this->db->query($sql); |
209 | 209 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @subpackage SmartObjectTable |
10 | 10 | */ |
11 | 11 | |
12 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
12 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * SmartObjectTreeTable class |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $space .= ' '; |
100 | 100 | } |
101 | 101 | |
102 | - $aColumn['value'] = $space . $value; |
|
102 | + $aColumn['value'] = $space.$value; |
|
103 | 103 | $aColumn['class'] = $class; |
104 | 104 | $aColumn['width'] = $column->getWidth(); |
105 | 105 | $aColumn['align'] = $column->getAlign(); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php'; |
|
126 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php'; |
|
127 | 127 | $controller = new SmartObjectController($this->_objectHandler); |
128 | 128 | |
129 | 129 | if (in_array('edit', $this->_actions)) { |
@@ -18,15 +18,15 @@ discard block |
||
18 | 18 | */ |
19 | 19 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
20 | 20 | if (!defined('SMARTOBJECT_ROOT_PATH')) { |
21 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
21 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
22 | 22 | } |
23 | 23 | /** |
24 | 24 | * Include the language constants for the SmartObjectDBUpdater |
25 | 25 | */ |
26 | 26 | global $xoopsConfig; |
27 | -$common_file = SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/smartdbupdater.php'; |
|
27 | +$common_file = SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/smartdbupdater.php'; |
|
28 | 28 | if (!file_exists($common_file)) { |
29 | - $common_file = SMARTOBJECT_ROOT_PATH . 'language/english/smartdbupdater.php'; |
|
29 | + $common_file = SMARTOBJECT_ROOT_PATH.'language/english/smartdbupdater.php'; |
|
30 | 30 | } |
31 | 31 | include $common_file; |
32 | 32 | |
@@ -123,20 +123,20 @@ discard block |
||
123 | 123 | public function getExistingFieldsArray() |
124 | 124 | { |
125 | 125 | global $xoopsDB; |
126 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $this->name()); |
|
126 | + $result = $xoopsDB->query('SHOW COLUMNS FROM '.$this->name()); |
|
127 | 127 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
128 | 128 | $fields[$existing_field['Field']] = $existing_field['Type']; |
129 | 129 | if ($existing_field['Null'] !== 'YES') { |
130 | 130 | $fields[$existing_field['Field']] .= ' NOT NULL'; |
131 | 131 | } |
132 | 132 | if ($existing_field['Extra']) { |
133 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
133 | + $fields[$existing_field['Field']] .= ' '.$existing_field['Extra']; |
|
134 | 134 | } |
135 | 135 | if (!($existing_field['Default'] === null) |
136 | 136 | && ($existing_field['Default'] |
137 | 137 | || $existing_field['Default'] === '' |
138 | 138 | || $existing_field['Default'] == 0)) { |
139 | - $fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'"; |
|
139 | + $fields[$existing_field['Field']] .= " default '".$existing_field['Default']."'"; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | $query = sprintf('INSERT INTO %s VALUES (%s)', $this->name(), $data); |
223 | 223 | $ret = $xoopsDB->query($query); |
224 | 224 | if (!$ret) { |
225 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br>'; |
|
225 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()).'<br>'; |
|
226 | 226 | } else { |
227 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br>'; |
|
227 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA, $this->name()).'<br>'; |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
@@ -376,13 +376,13 @@ discard block |
||
376 | 376 | { |
377 | 377 | global $xoopsDB; |
378 | 378 | $query = $this->getStructure(); |
379 | - $query = 'CREATE TABLE `' . $this->name() . '` (' . $query . ") ENGINE=MyISAM COMMENT='The SmartFactory <www.smartfactory.ca>'"; |
|
379 | + $query = 'CREATE TABLE `'.$this->name().'` ('.$query.") ENGINE=MyISAM COMMENT='The SmartFactory <www.smartfactory.ca>'"; |
|
380 | 380 | //xoops_debug($query); |
381 | 381 | $ret = $xoopsDB->query($query); |
382 | 382 | if (!$ret) { |
383 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
383 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
384 | 384 | } else { |
385 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '<br>'; |
|
385 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE, $this->name()).'<br>'; |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | return $ret; |
@@ -400,11 +400,11 @@ discard block |
||
400 | 400 | $query = sprintf('DROP TABLE %s', $this->name()); |
401 | 401 | $ret = $xoopsDB->query($query); |
402 | 402 | if (!$ret) { |
403 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
403 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
404 | 404 | |
405 | 405 | return false; |
406 | 406 | } else { |
407 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '<br>'; |
|
407 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE, $this->name()).'<br>'; |
|
408 | 408 | |
409 | 409 | return true; |
410 | 410 | } |
@@ -430,9 +430,9 @@ discard block |
||
430 | 430 | $ret = $ret && $xoopsDB->query($query); |
431 | 431 | if ($alteredField['showerror']) { |
432 | 432 | if (!$ret) { |
433 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
433 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
434 | 434 | } else { |
435 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '<br>'; |
|
435 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()).'<br>'; |
|
436 | 436 | } |
437 | 437 | } |
438 | 438 | } |
@@ -455,9 +455,9 @@ discard block |
||
455 | 455 | //echo $query; |
456 | 456 | $ret = $ret && $xoopsDB->query($query); |
457 | 457 | if (!$ret) { |
458 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '<br>'; |
|
458 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()).'<br>'; |
|
459 | 459 | } else { |
460 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '<br>'; |
|
460 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()).'<br>'; |
|
461 | 461 | } |
462 | 462 | } |
463 | 463 | |
@@ -478,9 +478,9 @@ discard block |
||
478 | 478 | $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']); |
479 | 479 | $ret = $ret && $xoopsDB->query($query); |
480 | 480 | if (!$ret) { |
481 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
481 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
482 | 482 | } else { |
483 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
483 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
484 | 484 | } |
485 | 485 | } |
486 | 486 | |
@@ -501,9 +501,9 @@ discard block |
||
501 | 501 | //echo $query."<br>"; |
502 | 502 | $ret = $ret && $xoopsDB->query($query); |
503 | 503 | if (!$ret) { |
504 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
504 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
505 | 505 | } else { |
506 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
506 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | |
@@ -524,9 +524,9 @@ discard block |
||
524 | 524 | $query = sprintf('ALTER TABLE %s DROP %s', $this->name(), $droppedField); |
525 | 525 | $ret = $ret && $xoopsDB->query($query); |
526 | 526 | if (!$ret) { |
527 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
527 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
528 | 528 | } else { |
529 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br>'; |
|
529 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()).'<br>'; |
|
530 | 530 | } |
531 | 531 | } |
532 | 532 | |
@@ -613,11 +613,11 @@ discard block |
||
613 | 613 | $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to); |
614 | 614 | $ret = $xoopsDB->query($query); |
615 | 615 | if (!$ret) { |
616 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>'; |
|
616 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>'; |
|
617 | 617 | |
618 | 618 | return false; |
619 | 619 | } else { |
620 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>'; |
|
620 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>'; |
|
621 | 621 | |
622 | 622 | return true; |
623 | 623 | } |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | return false; |
738 | 738 | } |
739 | 739 | |
740 | - $table = new SmartDbTable($module . '_' . $item); |
|
740 | + $table = new SmartDbTable($module.'_'.$item); |
|
741 | 741 | $object = $moduleHandler->create(); |
742 | 742 | $objectVars = $object->getVars(); |
743 | 743 | |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | "; |
759 | 759 | } |
760 | 760 | } |
761 | - $structure .= 'PRIMARY KEY (`' . $moduleHandler->keyName . '`) |
|
761 | + $structure .= 'PRIMARY KEY (`'.$moduleHandler->keyName.'`) |
|
762 | 762 | '; |
763 | 763 | $table->setStructure($structure); |
764 | 764 | if (!$this->updateTable($table)) { |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | |
819 | 819 | ob_start(); |
820 | 820 | |
821 | - $table = new SmartDbTable($dirname . '_meta'); |
|
821 | + $table = new SmartDbTable($dirname.'_meta'); |
|
822 | 822 | if (!$table->exists()) { |
823 | 823 | $table->setStructure(" |
824 | 824 | `metakey` varchar(50) NOT NULL default '', |
@@ -836,20 +836,20 @@ discard block |
||
836 | 836 | if (!$dbVersion) { |
837 | 837 | $dbVersion = 0; |
838 | 838 | } |
839 | - $newDbVersion = constant(strtoupper($dirname . '_db_version')) ?: 0; |
|
840 | - echo 'Database version: ' . $dbVersion . '<br>'; |
|
841 | - echo 'New database version: ' . $newDbVersion . '<br>'; |
|
839 | + $newDbVersion = constant(strtoupper($dirname.'_db_version')) ?: 0; |
|
840 | + echo 'Database version: '.$dbVersion.'<br>'; |
|
841 | + echo 'New database version: '.$newDbVersion.'<br>'; |
|
842 | 842 | |
843 | 843 | if ($newDbVersion > $dbVersion) { |
844 | 844 | for ($i = $dbVersion + 1; $i <= $newDbVersion; ++$i) { |
845 | - $upgrade_function = $dirname . '_db_upgrade_' . $i; |
|
845 | + $upgrade_function = $dirname.'_db_upgrade_'.$i; |
|
846 | 846 | if (function_exists($upgrade_function)) { |
847 | 847 | $upgrade_function(); |
848 | 848 | } |
849 | 849 | } |
850 | 850 | } |
851 | 851 | |
852 | - echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>'; |
|
852 | + echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>'; |
|
853 | 853 | |
854 | 854 | // if there is a function to execute for this DB version, let's do it |
855 | 855 | //$function_ |
@@ -146,16 +146,16 @@ discard block |
||
146 | 146 | |
147 | 147 | $this->_itemname = $itemname; |
148 | 148 | $this->_moduleName = $modulename; |
149 | - $this->table = $db->prefix($modulename . '_' . $itemname); |
|
149 | + $this->table = $db->prefix($modulename.'_'.$itemname); |
|
150 | 150 | $this->keyName = $keyname; |
151 | - $this->className = ucfirst($modulename) . ucfirst($itemname); |
|
151 | + $this->className = ucfirst($modulename).ucfirst($itemname); |
|
152 | 152 | $this->identifierName = $idenfierName; |
153 | 153 | $this->summaryName = $summaryName; |
154 | - $this->_page = $itemname . '.php'; |
|
155 | - $this->_modulePath = XOOPS_ROOT_PATH . '/modules/' . $this->_moduleName . '/'; |
|
156 | - $this->_moduleUrl = XOOPS_URL . '/modules/' . $this->_moduleName . '/'; |
|
157 | - $this->_uploadPath = XOOPS_UPLOAD_PATH . '/' . $this->_moduleName . '/'; |
|
158 | - $this->_uploadUrl = XOOPS_UPLOAD_URL . '/' . $this->_moduleName . '/'; |
|
154 | + $this->_page = $itemname.'.php'; |
|
155 | + $this->_modulePath = XOOPS_ROOT_PATH.'/modules/'.$this->_moduleName.'/'; |
|
156 | + $this->_moduleUrl = XOOPS_URL.'/modules/'.$this->_moduleName.'/'; |
|
157 | + $this->_uploadPath = XOOPS_UPLOAD_PATH.'/'.$this->_moduleName.'/'; |
|
158 | + $this->_uploadUrl = XOOPS_UPLOAD_URL.'/'.$this->_moduleName.'/'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function addPermission($perm_name, $caption, $description = false) |
180 | 180 | { |
181 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectpermission.php'; |
|
181 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectpermission.php'; |
|
182 | 182 | |
183 | 183 | $this->permissionsArray[] = array( |
184 | 184 | 'perm_name' => $perm_name, |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $smartPermissionsHandler = new SmartobjectPermissionHandler($this); |
198 | 198 | $grantedItems = $smartPermissionsHandler->getGrantedItems($perm_name); |
199 | 199 | if (count($grantedItems) > 0) { |
200 | - $criteria->add(new Criteria($this->keyName, '(' . implode(', ', $grantedItems) . ')', 'IN')); |
|
200 | + $criteria->add(new Criteria($this->keyName, '('.implode(', ', $grantedItems).')', 'IN')); |
|
201 | 201 | |
202 | 202 | return true; |
203 | 203 | } else { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function getImageUrl() |
255 | 255 | { |
256 | - return $this->_uploadUrl . $this->_itemname . '/'; |
|
256 | + return $this->_uploadUrl.$this->_itemname.'/'; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -261,12 +261,12 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function getImagePath() |
263 | 263 | { |
264 | - $dir = $this->_uploadPath . $this->_itemname; |
|
264 | + $dir = $this->_uploadPath.$this->_itemname; |
|
265 | 265 | if (!file_exists($dir)) { |
266 | 266 | smart_admin_mkdir($dir); |
267 | 267 | } |
268 | 268 | |
269 | - return $dir . '/'; |
|
269 | + return $dir.'/'; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -359,13 +359,13 @@ discard block |
||
359 | 359 | if ($this->generalSQL) { |
360 | 360 | $sql = $this->generalSQL; |
361 | 361 | } elseif (!$sql) { |
362 | - $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname; |
|
362 | + $sql = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname; |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
366 | - $sql .= ' ' . $criteria->renderWhere(); |
|
366 | + $sql .= ' '.$criteria->renderWhere(); |
|
367 | 367 | if ($criteria->getSort() !== '') { |
368 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
368 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
369 | 369 | } |
370 | 370 | $limit = $criteria->getLimit(); |
371 | 371 | $start = $criteria->getStart(); |
@@ -394,12 +394,12 @@ discard block |
||
394 | 394 | $ret = array(); |
395 | 395 | |
396 | 396 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
397 | - $sql .= ' ' . $criteria->renderWhere(); |
|
397 | + $sql .= ' '.$criteria->renderWhere(); |
|
398 | 398 | if ($criteria->groupby) { |
399 | 399 | $sql .= $criteria->getGroupby(); |
400 | 400 | } |
401 | 401 | if ($criteria->getSort() !== '') { |
402 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
402 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | if ($debug) { |
@@ -472,18 +472,18 @@ discard block |
||
472 | 472 | $obj->assignVars($myrow); |
473 | 473 | if (!$id_as_key) { |
474 | 474 | if ($as_object) { |
475 | - $ret[] =& $obj; |
|
475 | + $ret[] = & $obj; |
|
476 | 476 | } else { |
477 | 477 | $ret[] = $obj->toArray(); |
478 | 478 | } |
479 | 479 | } else { |
480 | 480 | if ($as_object) { |
481 | - $value =& $obj; |
|
481 | + $value = & $obj; |
|
482 | 482 | } else { |
483 | 483 | $value = $obj->toArray(); |
484 | 484 | } |
485 | 485 | if ($id_as_key === 'parentid') { |
486 | - $ret[$obj->getVar('parentid', 'e')][$obj->getVar($this->keyName)] =& $value; |
|
486 | + $ret[$obj->getVar('parentid', 'e')][$obj->getVar($this->keyName)] = & $value; |
|
487 | 487 | } else { |
488 | 488 | $ret[$obj->getVar($this->keyName)] = $value; |
489 | 489 | } |
@@ -526,15 +526,15 @@ discard block |
||
526 | 526 | $criteria->setSort($this->getIdentifierName()); |
527 | 527 | } |
528 | 528 | |
529 | - $sql = 'SELECT ' . (is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName); |
|
529 | + $sql = 'SELECT '.(is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName); |
|
530 | 530 | if (!empty($this->identifierName)) { |
531 | - $sql .= ', ' . $this->getIdentifierName(); |
|
531 | + $sql .= ', '.$this->getIdentifierName(); |
|
532 | 532 | } |
533 | - $sql .= ' FROM ' . $this->table . ' AS ' . $this->_itemname; |
|
533 | + $sql .= ' FROM '.$this->table.' AS '.$this->_itemname; |
|
534 | 534 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
535 | - $sql .= ' ' . $criteria->renderWhere(); |
|
535 | + $sql .= ' '.$criteria->renderWhere(); |
|
536 | 536 | if ($criteria->getSort() !== '') { |
537 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
537 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
538 | 538 | } |
539 | 539 | $limit = $criteria->getLimit(); |
540 | 540 | $start = $criteria->getStart(); |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
572 | 572 | if ($criteria->groupby !== '') { |
573 | 573 | $groupby = true; |
574 | - $field = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
574 | + $field = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
575 | 575 | } |
576 | 576 | } |
577 | 577 | /** |
@@ -582,10 +582,10 @@ discard block |
||
582 | 582 | $sql = $this->generalSQL; |
583 | 583 | $sql = str_replace('SELECT *', 'SELECT COUNT(*)', $sql); |
584 | 584 | } else { |
585 | - $sql = 'SELECT ' . $field . 'COUNT(*) FROM ' . $this->table . ' AS ' . $this->_itemname; |
|
585 | + $sql = 'SELECT '.$field.'COUNT(*) FROM '.$this->table.' AS '.$this->_itemname; |
|
586 | 586 | } |
587 | 587 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
588 | - $sql .= ' ' . $criteria->renderWhere(); |
|
588 | + $sql .= ' '.$criteria->renderWhere(); |
|
589 | 589 | if ($criteria->groupby !== '') { |
590 | 590 | $sql .= $criteria->getGroupby(); |
591 | 591 | } |
@@ -628,13 +628,13 @@ discard block |
||
628 | 628 | if (is_array($this->keyName)) { |
629 | 629 | $clause = array(); |
630 | 630 | for ($i = 0, $iMax = count($this->keyName); $i < $iMax; ++$i) { |
631 | - $clause[] = $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
631 | + $clause[] = $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
632 | 632 | } |
633 | 633 | $whereclause = implode(' AND ', $clause); |
634 | 634 | } else { |
635 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
635 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
636 | 636 | } |
637 | - $sql = 'DELETE FROM ' . $this->table . ' WHERE ' . $whereclause; |
|
637 | + $sql = 'DELETE FROM '.$this->table.' WHERE '.$whereclause; |
|
638 | 638 | if (false !== $force) { |
639 | 639 | $result = $this->db->queryF($sql); |
640 | 640 | } else { |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 |
696 | 696 | */ |
697 | 697 | if (!is_a($obj, $this->className)) { |
698 | - $obj->setError(get_class($obj) . ' Differs from ' . $this->className); |
|
698 | + $obj->setError(get_class($obj).' Differs from '.$this->className); |
|
699 | 699 | |
700 | 700 | return false; |
701 | 701 | } |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | $fieldsToStoreInDB = array(); |
757 | 757 | foreach ($obj->cleanVars as $k => $v) { |
758 | 758 | if ($obj->vars[$k]['data_type'] == XOBJ_DTYPE_INT) { |
759 | - $cleanvars[$k] = (int)$v; |
|
759 | + $cleanvars[$k] = (int) $v; |
|
760 | 760 | } elseif (is_array($v)) { |
761 | 761 | $cleanvars[$k] = $this->db->quoteString(implode(',', $v)); |
762 | 762 | } else { |
@@ -769,13 +769,13 @@ discard block |
||
769 | 769 | if ($obj->isNew()) { |
770 | 770 | if (!is_array($this->keyName)) { |
771 | 771 | if ($cleanvars[$this->keyName] < 1) { |
772 | - $cleanvars[$this->keyName] = $this->db->genId($this->table . '_' . $this->keyName . '_seq'); |
|
772 | + $cleanvars[$this->keyName] = $this->db->genId($this->table.'_'.$this->keyName.'_seq'); |
|
773 | 773 | } |
774 | 774 | } |
775 | 775 | |
776 | - $sql = 'INSERT INTO ' . $this->table . ' (' . implode(',', array_keys($fieldsToStoreInDB)) . ') VALUES (' . implode(',', array_values($fieldsToStoreInDB)) . ')'; |
|
776 | + $sql = 'INSERT INTO '.$this->table.' ('.implode(',', array_keys($fieldsToStoreInDB)).') VALUES ('.implode(',', array_values($fieldsToStoreInDB)).')'; |
|
777 | 777 | } else { |
778 | - $sql = 'UPDATE ' . $this->table . ' SET'; |
|
778 | + $sql = 'UPDATE '.$this->table.' SET'; |
|
779 | 779 | foreach ($fieldsToStoreInDB as $key => $value) { |
780 | 780 | if ((!is_array($this->keyName) && $key == $this->keyName) |
781 | 781 | || (is_array($this->keyName) |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | if (isset($notfirst)) { |
786 | 786 | $sql .= ','; |
787 | 787 | } |
788 | - $sql .= ' ' . $key . ' = ' . $value; |
|
788 | + $sql .= ' '.$key.' = '.$value; |
|
789 | 789 | $notfirst = true; |
790 | 790 | } |
791 | 791 | if (is_array($this->keyName)) { |
@@ -794,12 +794,12 @@ discard block |
||
794 | 794 | if ($i > 0) { |
795 | 795 | $whereclause .= ' AND '; |
796 | 796 | } |
797 | - $whereclause .= $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
797 | + $whereclause .= $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
798 | 798 | } |
799 | 799 | } else { |
800 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
800 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
801 | 801 | } |
802 | - $sql .= ' WHERE ' . $whereclause; |
|
802 | + $sql .= ' WHERE '.$whereclause; |
|
803 | 803 | } |
804 | 804 | |
805 | 805 | if ($debug) { |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | */ |
873 | 873 | public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) |
874 | 874 | { |
875 | - $set_clause = $fieldname . ' = '; |
|
875 | + $set_clause = $fieldname.' = '; |
|
876 | 876 | if (is_numeric($fieldvalue)) { |
877 | 877 | $set_clause .= $fieldvalue; |
878 | 878 | } elseif (is_array($fieldvalue)) { |
@@ -880,9 +880,9 @@ discard block |
||
880 | 880 | } else { |
881 | 881 | $set_clause .= $this->db->quoteString($fieldvalue); |
882 | 882 | } |
883 | - $sql = 'UPDATE ' . $this->table . ' SET ' . $set_clause; |
|
883 | + $sql = 'UPDATE '.$this->table.' SET '.$set_clause; |
|
884 | 884 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
885 | - $sql .= ' ' . $criteria->renderWhere(); |
|
885 | + $sql .= ' '.$criteria->renderWhere(); |
|
886 | 886 | } |
887 | 887 | if (false != $force) { |
888 | 888 | $result = $this->db->queryF($sql); |
@@ -906,8 +906,8 @@ discard block |
||
906 | 906 | public function deleteAll(CriteriaElement $criteria = null) |
907 | 907 | { |
908 | 908 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
909 | - $sql = 'DELETE FROM ' . $this->table; |
|
910 | - $sql .= ' ' . $criteria->renderWhere(); |
|
909 | + $sql = 'DELETE FROM '.$this->table; |
|
910 | + $sql .= ' '.$criteria->renderWhere(); |
|
911 | 911 | if (!$this->db->query($sql)) { |
912 | 912 | return false; |
913 | 913 | } |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | */ |
941 | 941 | public function getModuleItemString() |
942 | 942 | { |
943 | - $ret = $this->_moduleName . '_' . $this->_itemname; |
|
943 | + $ret = $this->_moduleName.'_'.$this->_itemname; |
|
944 | 944 | |
945 | 945 | return $ret; |
946 | 946 | } |
@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | { |
953 | 953 | if (isset($object->vars['counter'])) { |
954 | 954 | $new_counter = $object->getVar('counter') + 1; |
955 | - $sql = 'UPDATE ' . $this->table . ' SET counter=' . $new_counter . ' WHERE ' . $this->keyName . '=' . $object->id(); |
|
955 | + $sql = 'UPDATE '.$this->table.' SET counter='.$new_counter.' WHERE '.$this->keyName.'='.$object->id(); |
|
956 | 956 | $this->query($sql, null, true); |
957 | 957 | } |
958 | 958 | } |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | public function getIdentifierName($withprefix = true) |
997 | 997 | { |
998 | 998 | if ($withprefix) { |
999 | - return $this->_itemname . '.' . $this->identifierName; |
|
999 | + return $this->_itemname.'.'.$this->identifierName; |
|
1000 | 1000 | } else { |
1001 | 1001 | return $this->identifierName; |
1002 | 1002 | } |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | { |
50 | 50 | global $xoopsModule, $xoopsConfig; |
51 | 51 | |
52 | - $fileName = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php'; |
|
52 | + $fileName = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php'; |
|
53 | 53 | if (file_exists($fileName)) { |
54 | 54 | require_once $fileName; |
55 | 55 | } else { |
56 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/modinfo.php'; |
|
56 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/modinfo.php'; |
|
57 | 57 | } |
58 | 58 | $this->_aboutTitle = $aboutTitle; |
59 | 59 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | //smart_adminMenu(-1, $this->_aboutTitle . " " . $versioninfo->getInfo('name')); |
107 | 107 | |
108 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
108 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
109 | 109 | |
110 | 110 | // --- |
111 | 111 | // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $this->_tpl = new XoopsTpl(); |
114 | 114 | // --- |
115 | 115 | |
116 | - $this->_tpl->assign('module_url', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/'); |
|
116 | + $this->_tpl->assign('module_url', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/'); |
|
117 | 117 | $this->_tpl->assign('module_image', $versioninfo->getInfo('image')); |
118 | 118 | $this->_tpl->assign('module_name', $versioninfo->getInfo('name')); |
119 | 119 | $this->_tpl->assign('module_version', $versioninfo->getInfo('version')); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | // Left headings... |
123 | 123 | if ($versioninfo->getInfo('author_realname') !== '') { |
124 | - $author_name = $versioninfo->getInfo('author') . ' (' . $versioninfo->getInfo('author_realname') . ')'; |
|
124 | + $author_name = $versioninfo->getInfo('author').' ('.$versioninfo->getInfo('author_realname').')'; |
|
125 | 125 | } else { |
126 | 126 | $author_name = $versioninfo->getInfo('author'); |
127 | 127 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | // For changelog thanks to 3Dev |
168 | 168 | global $xoopsModule; |
169 | - $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt'; |
|
169 | + $filename = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/changelog.txt'; |
|
170 | 170 | if (is_file($filename)) { |
171 | 171 | $filesize = filesize($filename); |
172 | 172 | $handle = fopen($filename, 'r'); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | // -------------------------------------------------------------------------// |
29 | 29 | |
30 | 30 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
31 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartmlobject.php'; |
|
31 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartmlobject.php'; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Class SmartobjectTag |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function getLanguages() |
71 | 71 | { |
72 | - require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
72 | + require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
73 | 73 | $aLanguages = XoopsLists::getLangList(); |
74 | 74 | $ret['default'] = _CO_SOBJECT_ALL; |
75 | 75 | foreach ($aLanguages as $lang) { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $ret = false; |
51 | 51 | foreach ($this->_infoArray['items'] as $k => $v) { |
52 | 52 | $search_str = str_replace('%u', '', $v['url']); |
53 | - if (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], $search_str) > 0) { |
|
53 | + if (strpos($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'], $search_str) > 0) { |
|
54 | 54 | $ret = $k; |
55 | 55 | break; |
56 | 56 | } |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function getPlugin($dirname) |
84 | 84 | { |
85 | - $pluginName = SMARTOBJECT_ROOT_PATH . 'plugins/' . $dirname . '.php'; |
|
85 | + $pluginName = SMARTOBJECT_ROOT_PATH.'plugins/'.$dirname.'.php'; |
|
86 | 86 | if (file_exists($pluginName)) { |
87 | 87 | require_once $pluginName; |
88 | - $function = 'smartobject_plugin_' . $dirname; |
|
88 | + $function = 'smartobject_plugin_'.$dirname; |
|
89 | 89 | if (function_exists($function)) { |
90 | 90 | $array = $function(); |
91 | 91 | $ret = new SmartPlugin($array); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function getPluginsArray() |
104 | 104 | { |
105 | - require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
105 | + require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
106 | 106 | |
107 | 107 | $moduleHandler = xoops_getHandler('module'); |
108 | 108 | $criteria = new CriteriaCompo(); |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | $modulesObj[$moduleObj->getVar('dirname')] = $moduleObj; |
114 | 114 | } |
115 | 115 | |
116 | - $aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH . 'plugins/'); |
|
116 | + $aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH.'plugins/'); |
|
117 | 117 | $ret = array(); |
118 | 118 | foreach ($aFiles as $file) { |
119 | 119 | if (substr($file, strlen($file) - 4, 4) === '.php') { |
120 | 120 | $pluginName = str_replace('.php', '', $file); |
121 | - $module_xoops_version_file = XOOPS_ROOT_PATH . "/modules/$pluginName/xoops_version.php"; |
|
121 | + $module_xoops_version_file = XOOPS_ROOT_PATH."/modules/$pluginName/xoops_version.php"; |
|
122 | 122 | if (file_exists($module_xoops_version_file) && isset($modulesObj[$pluginName])) { |
123 | 123 | $ret[$pluginName] = $modulesObj[$pluginName]->getVar('name'); |
124 | 124 | } |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | |
30 | 30 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
31 | 31 | |
32 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; |
|
33 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartplugins.php'; |
|
32 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
33 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartplugins.php'; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Class SmartobjectRating |
@@ -124,14 +124,14 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function getItemValue() |
126 | 126 | { |
127 | - $moduleUrl = XOOPS_URL . '/modules/' . $this->getVar('dirname', 'n') . '/'; |
|
127 | + $moduleUrl = XOOPS_URL.'/modules/'.$this->getVar('dirname', 'n').'/'; |
|
128 | 128 | $plugin = $this->getModulePlugin(); |
129 | 129 | $pluginItemInfo = $plugin->getItemInfo($this->getVar('item')); |
130 | 130 | if (!$pluginItemInfo) { |
131 | 131 | return ''; |
132 | 132 | } |
133 | 133 | $itemPath = sprintf($pluginItemInfo['url'], $this->getVar('itemid')); |
134 | - $ret = '<a href="' . $moduleUrl . $itemPath . '">' . $pluginItemInfo['caption'] . '</a>'; |
|
134 | + $ret = '<a href="'.$moduleUrl.$itemPath.'">'.$pluginItemInfo['caption'].'</a>'; |
|
135 | 135 | |
136 | 136 | return $ret; |
137 | 137 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | public function __construct(XoopsDatabase $db) |
175 | 175 | { |
176 | 176 | parent::__construct($db, 'rating', 'ratingid', 'rate', '', 'smartobject'); |
177 | - $this->generalSQL = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->db->prefix('users') . ' AS user ON ' . $this->_itemname . '.uid=user.uid'; |
|
177 | + $this->generalSQL = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname.' INNER JOIN '.$this->db->prefix('users').' AS user ON '.$this->_itemname.'.uid=user.uid'; |
|
178 | 178 | |
179 | 179 | $this->_rateOptions[1] = 1; |
180 | 180 | $this->_rateOptions[2] = 2; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public function getRatingAverageByItemId($itemid, $dirname, $item) |
219 | 219 | { |
220 | - $sql = 'SELECT AVG(rate), COUNT(ratingid) FROM ' . $this->table . " WHERE itemid=$itemid AND dirname='$dirname' AND item='$item' GROUP BY itemid"; |
|
220 | + $sql = 'SELECT AVG(rate), COUNT(ratingid) FROM '.$this->table." WHERE itemid=$itemid AND dirname='$dirname' AND item='$item' GROUP BY itemid"; |
|
221 | 221 | $result = $this->db->query($sql); |
222 | 222 | if (!$result) { |
223 | 223 | return 0; |