@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 31 | 31 | |
| 32 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; |
|
| 33 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartplugins.php'; |
|
| 32 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
| 33 | +include_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; |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 3 | 3 | |
| 4 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/basedurl.php'; |
|
| 4 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/basedurl.php'; |
|
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | 7 | * Class SmartobjectUrlLink |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | if ($this->singlewords) { |
| 79 | 79 | $keywords = explode(' ', $this->preg_keywords); |
| 80 | 80 | foreach ($keywords as $keyword) { |
| 81 | - $patterns[] = '/(?' . '>' . $keyword . '+)/si'; |
|
| 81 | + $patterns[] = '/(?'.'>'.$keyword.'+)/si'; |
|
| 82 | 82 | } |
| 83 | 83 | } else { |
| 84 | - $patterns[] = '/(?' . '>' . $this->preg_keywords . '+)/si'; |
|
| 84 | + $patterns[] = '/(?'.'>'.$this->preg_keywords.'+)/si'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $result = $replace_matches[0]; |
@@ -104,9 +104,9 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function highlight($buffer) |
| 106 | 106 | { |
| 107 | - $buffer = '>' . $buffer . '<'; |
|
| 107 | + $buffer = '>'.$buffer.'<'; |
|
| 108 | 108 | $this->preg_keywords = preg_replace('/[^\w ]/si', '', $this->keywords); |
| 109 | - $buffer = preg_replace_callback("/(\>(((?" . ">[^><]+)|(?R))*)\<)/is", array(&$this, 'replace'), $buffer); |
|
| 109 | + $buffer = preg_replace_callback("/(\>(((?".">[^><]+)|(?R))*)\<)/is", array(&$this, 'replace'), $buffer); |
|
| 110 | 110 | $buffer = substr($buffer, 1, -1); |
| 111 | 111 | |
| 112 | 112 | return $buffer; |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 14 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; |
|
| 14 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * SmartObject base SEO-enabled class |
@@ -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 | include_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 | - include_once(XOOPS_ROOT_PATH . '/class/xoopslists.php'); |
|
| 105 | + include_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 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 4 | 4 | |
| 5 | -include_once XOOPS_ROOT_PATH . '/class/tree.php'; |
|
| 5 | +include_once XOOPS_ROOT_PATH.'/class/tree.php'; |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Class smartobjecttree |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 14 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartseoobject.php'; |
|
| 14 | +include_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 | - include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php'; |
|
| 114 | + include_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 | |
@@ -80,9 +80,9 @@ |
||
| 80 | 80 | * @link http://smartfactory.ca The SmartFactory |
| 81 | 81 | * @package SmartObject |
| 82 | 82 | */ |
| 83 | -mt_srand((double)microtime() * 1000000); |
|
| 83 | +mt_srand((double) microtime() * 1000000); |
|
| 84 | 84 | |
| 85 | -include_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
| 85 | +include_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Class SmartUploader |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 14 | 14 | |
| 15 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
| 15 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
| 16 | 16 | |
| 17 | -include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php'; |
|
| 17 | +include_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php'; |
|
| 18 | 18 | |
| 19 | 19 | if (!defined('XOBJ_DTYPE_SIMPLE_ARRAY')) { |
| 20 | 20 | define('XOBJ_DTYPE_SIMPLE_ARRAY', 101); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function closeSection($section_name) |
| 115 | 115 | { |
| 116 | - $this->initVar('close_section_' . $section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true); |
|
| 116 | + $this->initVar('close_section_'.$section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -140,13 +140,13 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | parent::initVar($key, $data_type, $value, $required, $maxlength, $options); |
| 142 | 142 | if ($this->handler && (!$form_caption || $form_caption === '')) { |
| 143 | - $dyn_form_caption = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key); |
|
| 143 | + $dyn_form_caption = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key); |
|
| 144 | 144 | if (defined($dyn_form_caption)) { |
| 145 | 145 | $form_caption = constant($dyn_form_caption); |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | if ($this->handler && (!$form_dsc || $form_dsc === '')) { |
| 149 | - $dyn_form_dsc = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key . '_DSC'); |
|
| 149 | + $dyn_form_dsc = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key.'_DSC'); |
|
| 150 | 150 | if (defined($dyn_form_dsc)) { |
| 151 | 151 | $form_dsc = constant($dyn_form_dsc); |
| 152 | 152 | } |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | */ |
| 411 | 411 | public function getForm($form_caption, $form_name, $form_action = false, $submit_button_caption = _CO_SOBJECT_SUBMIT, $cancel_js_action = false, $captcha = false) |
| 412 | 412 | { |
| 413 | - include_once SMARTOBJECT_ROOT_PATH . 'class/form/smartobjectform.php'; |
|
| 413 | + include_once SMARTOBJECT_ROOT_PATH.'class/form/smartobjectform.php'; |
|
| 414 | 414 | $form = new SmartobjectForm($this, $form_name, $form_caption, $form_action, null, $submit_button_caption, $cancel_js_action, $captcha); |
| 415 | 415 | |
| 416 | 416 | return $form; |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | public function toArray() |
| 423 | 423 | { |
| 424 | 424 | $ret = array(); |
| 425 | - $vars =& $this->getVars(); |
|
| 425 | + $vars = & $this->getVars(); |
|
| 426 | 426 | foreach ($vars as $key => $var) { |
| 427 | 427 | $value = $this->getVar($key); |
| 428 | 428 | $ret[$key] = $value; |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | // Hightlighting searched words |
| 443 | - include_once(SMARTOBJECT_ROOT_PATH . 'class/smarthighlighter.php'); |
|
| 443 | + include_once(SMARTOBJECT_ROOT_PATH.'class/smarthighlighter.php'); |
|
| 444 | 444 | $highlight = smart_getConfig('module_search_highlighter', false, true); |
| 445 | 445 | |
| 446 | 446 | if ($highlight && isset($_GET['keywords'])) { |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | } |
| 472 | 472 | } else { |
| 473 | 473 | if ($prefix) { |
| 474 | - $err_str = '[' . $prefix . '] ' . $err_str; |
|
| 474 | + $err_str = '['.$prefix.'] '.$err_str; |
|
| 475 | 475 | } |
| 476 | 476 | parent::setErrors($err_str); |
| 477 | 477 | } |
@@ -798,8 +798,8 @@ discard block |
||
| 798 | 798 | $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); |
| 799 | 799 | continue 2; |
| 800 | 800 | } |
| 801 | - if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) { |
|
| 802 | - $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength'])); |
|
| 801 | + if (isset($v['maxlength']) && strlen($cleanv) > (int) $v['maxlength']) { |
|
| 802 | + $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int) $v['maxlength'])); |
|
| 803 | 803 | continue 2; |
| 804 | 804 | } |
| 805 | 805 | if (!$v['not_gpc']) { |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | break; |
| 829 | 829 | case XOBJ_DTYPE_INT: |
| 830 | 830 | case XOBJ_DTYPE_TIME_ONLY: |
| 831 | - $cleanv = (int)$cleanv; |
|
| 831 | + $cleanv = (int) $cleanv; |
|
| 832 | 832 | break; |
| 833 | 833 | |
| 834 | 834 | case XOBJ_DTYPE_CURRENCY: |
@@ -858,10 +858,10 @@ discard block |
||
| 858 | 858 | continue 2; |
| 859 | 859 | } |
| 860 | 860 | if ($cleanv !== '' && !preg_match("/^http[s]*:\/\//i", $cleanv)) { |
| 861 | - $cleanv = 'http://' . $cleanv; |
|
| 861 | + $cleanv = 'http://'.$cleanv; |
|
| 862 | 862 | } |
| 863 | 863 | if (!$v['not_gpc']) { |
| 864 | - $cleanv =& $ts->stripSlashesGPC($cleanv); |
|
| 864 | + $cleanv = & $ts->stripSlashesGPC($cleanv); |
|
| 865 | 865 | } |
| 866 | 866 | break; |
| 867 | 867 | case XOBJ_DTYPE_SIMPLE_ARRAY: |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | case XOBJ_DTYPE_STIME: |
| 874 | 874 | case XOBJ_DTYPE_MTIME: |
| 875 | 875 | case XOBJ_DTYPE_LTIME: |
| 876 | - $cleanv = !is_string($cleanv) ? (int)$cleanv : strtotime($cleanv); |
|
| 876 | + $cleanv = !is_string($cleanv) ? (int) $cleanv : strtotime($cleanv); |
|
| 877 | 877 | if (!($cleanv > 0)) { |
| 878 | 878 | $cleanv = strtotime($cleanv); |
| 879 | 879 | } |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | break; |
| 883 | 883 | } |
| 884 | 884 | } |
| 885 | - $this->cleanVars[$k] =& $cleanv; |
|
| 885 | + $this->cleanVars[$k] = & $cleanv; |
|
| 886 | 886 | unset($cleanv); |
| 887 | 887 | } |
| 888 | 888 | if (count($this->_errors) > 0) { |
@@ -1100,10 +1100,10 @@ discard block |
||
| 1100 | 1100 | } |
| 1101 | 1101 | break; |
| 1102 | 1102 | case XOBJ_DTYPE_SIMPLE_ARRAY: |
| 1103 | - $ret =& explode('|', $ret); |
|
| 1103 | + $ret = & explode('|', $ret); |
|
| 1104 | 1104 | break; |
| 1105 | 1105 | case XOBJ_DTYPE_ARRAY: |
| 1106 | - $ret =& unserialize($ret); |
|
| 1106 | + $ret = & unserialize($ret); |
|
| 1107 | 1107 | break; |
| 1108 | 1108 | case XOBJ_DTYPE_SOURCE: |
| 1109 | 1109 | switch (strtolower($format)) { |
@@ -1257,7 +1257,7 @@ discard block |
||
| 1257 | 1257 | */ |
| 1258 | 1258 | public function displaySingleObject($fetchOnly = false, $userSide = false, $actions = array(), $headerAsRow = true) |
| 1259 | 1259 | { |
| 1260 | - include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectsingleview.php'; |
|
| 1260 | + include_once SMARTOBJECT_ROOT_PATH.'class/smartobjectsingleview.php'; |
|
| 1261 | 1261 | $singleview = new SmartObjectSingleView($this, $userSide, $actions, $headerAsRow); |
| 1262 | 1262 | // add all fields mark as displayOnSingleView except the keyid |
| 1263 | 1263 | foreach ($this->vars as $key => $var) { |