@@ -28,15 +28,15 @@ discard block |
||
| 28 | 28 | Github\GithubClient |
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | -require __DIR__ . '/header.php'; |
|
| 31 | +require __DIR__.'/header.php'; |
|
| 32 | 32 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl'; |
| 33 | -include_once \XOOPS_ROOT_PATH . '/header.php'; |
|
| 33 | +include_once \XOOPS_ROOT_PATH.'/header.php'; |
|
| 34 | 34 | |
| 35 | 35 | // Permissions |
| 36 | 36 | $permGlobalView = $permissionsHandler->getPermGlobalView(); |
| 37 | 37 | if (!$permGlobalView) { |
| 38 | 38 | $GLOBALS['xoopsTpl']->assign('error', _NOPERM); |
| 39 | - require __DIR__ . '/footer.php'; |
|
| 39 | + require __DIR__.'/footer.php'; |
|
| 40 | 40 | } |
| 41 | 41 | $permGlobalRead = $permissionsHandler->getPermGlobalRead(); |
| 42 | 42 | $permReadmeUpdate = $permissionsHandler->getPermReadmeUpdate(); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | // Define Stylesheet |
| 52 | 52 | $GLOBALS['xoTheme']->addStylesheet($style, null); |
| 53 | -$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL . '/assets/css/tabs.css', null); |
|
| 53 | +$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL.'/assets/css/tabs.css', null); |
|
| 54 | 54 | $keywords = []; |
| 55 | 55 | // |
| 56 | 56 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | foreach (\array_keys($directoriesAll) as $i) { |
| 128 | 128 | $directories[$i] = $directoriesAll[$i]->getValuesDirectories(); |
| 129 | 129 | $dirName = $directoriesAll[$i]->getVar('dir_name'); |
| 130 | - $dirFilterRelease = (bool)$directoriesAll[$i]->getVar('dir_filterrelease'); |
|
| 130 | + $dirFilterRelease = (bool) $directoriesAll[$i]->getVar('dir_filterrelease'); |
|
| 131 | 131 | $repos = []; |
| 132 | 132 | $crRepositories = new \CriteriaCompo(); |
| 133 | 133 | //first block/parentheses |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | $directories[$i]['repos'] = $repos; |
| 204 | 204 | $directories[$i]['previousRepos'] = $start > 0; |
| 205 | - $directories[$i]['previousOp'] = '&start=' . ($start - $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 205 | + $directories[$i]['previousOp'] = '&start='.($start - $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 206 | 206 | $directories[$i]['nextRepos'] = ($repositoriesCount - $start) > $limit; |
| 207 | - $directories[$i]['nextOp'] = '&start=' . ($start + $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 207 | + $directories[$i]['nextOp'] = '&start='.($start + $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 208 | 208 | $GLOBALS['xoopsTpl']->assign('start', $start); |
| 209 | 209 | $GLOBALS['xoopsTpl']->assign('limit', $limit); |
| 210 | 210 | $GLOBALS['xoopsTpl']->assign('menu', $menu); |
@@ -214,8 +214,8 @@ discard block |
||
| 214 | 214 | unset($crDirectories, $directories); |
| 215 | 215 | // Display Navigation |
| 216 | 216 | if ($directoriesCount > $limit) { |
| 217 | - require_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 218 | - $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
| 217 | + require_once \XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 218 | + $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
| 219 | 219 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
| 220 | 220 | } |
| 221 | 221 | $GLOBALS['xoopsTpl']->assign('lang_thereare', \sprintf(\_MA_WGGITHUB_INDEX_THEREARE, $directoriesCount)); |
@@ -228,12 +228,12 @@ discard block |
||
| 228 | 228 | // Permissions |
| 229 | 229 | if (!$permGlobalRead) { |
| 230 | 230 | $GLOBALS['xoopsTpl']->assign('error', \_NOPERM); |
| 231 | - require __DIR__ . '/footer.php'; |
|
| 231 | + require __DIR__.'/footer.php'; |
|
| 232 | 232 | } |
| 233 | 233 | $dirName = Request::getString('dir_name', ''); |
| 234 | 234 | $start = 0; //reset to default |
| 235 | 235 | $limit = Request::getInt('limit', $helper->getConfig('userpager')); |
| 236 | - $redir = 'index.php?op=list_afterupdate&start=' . $start . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 236 | + $redir = 'index.php?op=list_afterupdate&start='.$start.'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 237 | 237 | $githubClient = GithubClient::getInstance(); |
| 238 | 238 | $result = $githubClient->executeUpdate($dirName); |
| 239 | 239 | if ($result) { |
@@ -247,14 +247,14 @@ discard block |
||
| 247 | 247 | // Permissions |
| 248 | 248 | if (!$permReadmeUpdate) { |
| 249 | 249 | $GLOBALS['xoopsTpl']->assign('error', \_NOPERM); |
| 250 | - require __DIR__ . '/footer.php'; |
|
| 250 | + require __DIR__.'/footer.php'; |
|
| 251 | 251 | } |
| 252 | 252 | $start = 0; //reset to default |
| 253 | 253 | $limit = Request::getInt('limit', $helper->getConfig('userpager')); |
| 254 | 254 | $repoId = Request::getInt('repo_id', 0); |
| 255 | 255 | $repoUser = Request::getString('repo_user', 'none'); |
| 256 | 256 | $repoName = Request::getString('repo_name', 'none'); |
| 257 | - $redir = 'index.php?op=list_afterupdate&start=' . $start . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 257 | + $redir = 'index.php?op=list_afterupdate&start='.$start.'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 258 | 258 | $result = $helper->getHandler('Readmes')->updateReadmes($repoId, $repoUser, $repoName); |
| 259 | 259 | if ($result) { |
| 260 | 260 | \redirect_header($redir, 2, \_MA_WGGITHUB_READGH_SUCCESS); |
@@ -268,11 +268,11 @@ discard block |
||
| 268 | 268 | // Breadcrumbs |
| 269 | 269 | $xoBreadcrumbs[] = ['title' => \_MA_WGGITHUB_INDEX]; |
| 270 | 270 | // Keywords |
| 271 | -wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords)); |
|
| 271 | +wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords)); |
|
| 272 | 272 | unset($keywords); |
| 273 | 273 | // Description |
| 274 | 274 | wggithubMetaDescription(\_MA_WGGITHUB_INDEX_DESC); |
| 275 | 275 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/index.php'); |
| 276 | 276 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL); |
| 277 | 277 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
| 278 | -require __DIR__ . '/footer.php'; |
|
| 278 | +require __DIR__.'/footer.php'; |
|
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $ret = wggithub_check_db($module); |
| 40 | 40 | |
| 41 | 41 | //check upload directory |
| 42 | - include_once __DIR__ . '/install.php'; |
|
| 42 | + include_once __DIR__.'/install.php'; |
|
| 43 | 43 | $ret = xoops_module_install_wggithub($module); |
| 44 | 44 | |
| 45 | 45 | $errors = $module->getErrors(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | global $xoopsDB; |
| 63 | 63 | $result = $xoopsDB->query( |
| 64 | - 'SELECT t1.tpl_id FROM ' . $xoopsDB->prefix('tplfile') . ' t1, ' . $xoopsDB->prefix('tplfile') . ' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id' |
|
| 64 | + 'SELECT t1.tpl_id FROM '.$xoopsDB->prefix('tplfile').' t1, '.$xoopsDB->prefix('tplfile').' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id' |
|
| 65 | 65 | ); |
| 66 | 66 | $tplids = []; |
| 67 | 67 | while (false !== (list($tplid) = $xoopsDB->fetchRow($result))) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | if (\count($tplids) > 0) { |
| 71 | 71 | $tplfileHandler = \xoops_getHandler('tplfile'); |
| 72 | - $duplicate_files = $tplfileHandler->getObjects(new \Criteria('tpl_id', '(' . \implode(',', $tplids) . ')', 'IN')); |
|
| 72 | + $duplicate_files = $tplfileHandler->getObjects(new \Criteria('tpl_id', '('.\implode(',', $tplids).')', 'IN')); |
|
| 73 | 73 | |
| 74 | 74 | if (\count($duplicate_files) > 0) { |
| 75 | 75 | foreach (\array_keys($duplicate_files) as $i) { |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | - $sql = 'SHOW INDEX FROM ' . $xoopsDB->prefix('tplfile') . " WHERE KEY_NAME = 'tpl_refid_module_set_file_type'"; |
|
| 80 | + $sql = 'SHOW INDEX FROM '.$xoopsDB->prefix('tplfile')." WHERE KEY_NAME = 'tpl_refid_module_set_file_type'"; |
|
| 81 | 81 | if (!$result = $xoopsDB->queryF($sql)) { |
| 82 | - xoops_error($xoopsDB->error() . '<br>' . $sql); |
|
| 82 | + xoops_error($xoopsDB->error().'<br>'.$sql); |
|
| 83 | 83 | |
| 84 | 84 | return false; |
| 85 | 85 | } |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | return true; |
| 94 | 94 | } |
| 95 | - $sql = 'ALTER TABLE ' . $xoopsDB->prefix('tplfile') . ' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )'; |
|
| 95 | + $sql = 'ALTER TABLE '.$xoopsDB->prefix('tplfile').' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )'; |
|
| 96 | 96 | if (!$result = $xoopsDB->queryF($sql)) { |
| 97 | - xoops_error($xoopsDB->error() . '<br>' . $sql); |
|
| 97 | + xoops_error($xoopsDB->error().'<br>'.$sql); |
|
| 98 | 98 | $module->setErrors("'tpl_refid_module_set_file_type' unique index is not added to 'tplfile' table. Warning: do not use XOOPS until you add this unique index."); |
| 99 | 99 | |
| 100 | 100 | return false; |
@@ -118,12 +118,12 @@ discard block |
||
| 118 | 118 | // update table (add new field) |
| 119 | 119 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
| 120 | 120 | $field = 'repo_release'; |
| 121 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 121 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 122 | 122 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 123 | 123 | if (!$numRows) { |
| 124 | 124 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 125 | 125 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 126 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 126 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 127 | 127 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 128 | 128 | $ret = false; |
| 129 | 129 | } |
@@ -132,12 +132,12 @@ discard block |
||
| 132 | 132 | // update table (add new field) |
| 133 | 133 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
| 134 | 134 | $field = 'repo_prerelease'; |
| 135 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 135 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 136 | 136 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 137 | 137 | if (!$numRows) { |
| 138 | 138 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 139 | 139 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 140 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 140 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 141 | 141 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 142 | 142 | $ret = false; |
| 143 | 143 | } |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | // update table (add new field) |
| 146 | 146 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
| 147 | 147 | $field = 'repo_readme'; |
| 148 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 148 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 149 | 149 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 150 | 150 | if (!$numRows) { |
| 151 | 151 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 152 | 152 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 153 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 153 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 154 | 154 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 155 | 155 | $ret = false; |
| 156 | 156 | } |
@@ -159,12 +159,12 @@ discard block |
||
| 159 | 159 | // update table (add new field) |
| 160 | 160 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories'); |
| 161 | 161 | $field = 'dir_filterrelease'; |
| 162 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 162 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 163 | 163 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 164 | 164 | if (!$numRows) { |
| 165 | 165 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `dir_online`;"; |
| 166 | 166 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 167 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 167 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 168 | 168 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 169 | 169 | $ret = false; |
| 170 | 170 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | PRIMARY KEY (`log_id`) |
| 187 | 187 | ) ENGINE=InnoDB;"; |
| 188 | 188 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 189 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 189 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 190 | 190 | $module->setErrors("Error when creating table '$table'."); |
| 191 | 191 | $ret = false; |
| 192 | 192 | } |
@@ -195,12 +195,12 @@ discard block |
||
| 195 | 195 | // update table (add new field) |
| 196 | 196 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories'); |
| 197 | 197 | $field = 'dir_content'; |
| 198 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 198 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 199 | 199 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 200 | 200 | if (!$numRows) { |
| 201 | 201 | $sql = "ALTER TABLE `$table` ADD `$field` INT(10) NOT NULL DEFAULT '0' AFTER `dir_type`;"; |
| 202 | 202 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 203 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 203 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 204 | 204 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 205 | 205 | $ret = false; |
| 206 | 206 | } |
@@ -209,12 +209,12 @@ discard block |
||
| 209 | 209 | // update table (add new field) |
| 210 | 210 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories'); |
| 211 | 211 | $field = 'dir_descr'; |
| 212 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 212 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 213 | 213 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 214 | 214 | if (!$numRows) { |
| 215 | 215 | $sql = "ALTER TABLE `$table` ADD `$field` TEXT NOT NULL AFTER `dir_type`;"; |
| 216 | 216 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 217 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 217 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 218 | 218 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 219 | 219 | $ret = false; |
| 220 | 220 | } |
@@ -223,12 +223,12 @@ discard block |
||
| 223 | 223 | // update table (add new field) |
| 224 | 224 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
| 225 | 225 | $field = 'rm_baseurl'; |
| 226 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'"); |
|
| 226 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'"); |
|
| 227 | 227 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 228 | 228 | if (!$numRows) { |
| 229 | 229 | $sql = "ALTER TABLE `$table` ADD `$field` VARCHAR(255) NOT NULL DEFAULT '' AFTER `rm_downloadurl`;"; |
| 230 | 230 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 231 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 231 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 232 | 232 | $module->setErrors("Error when adding '$field' to table '$table'."); |
| 233 | 233 | $ret = false; |
| 234 | 234 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $readmesObj->setVar('rm_content', $readme['content']); |
| 171 | 171 | $readmesObj->setVar('rm_encoding', $readme['encoding']); |
| 172 | 172 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
| 173 | - $readmesObj->setVar('rm_datecreated',time()); |
|
| 173 | + $readmesObj->setVar('rm_datecreated', time()); |
|
| 174 | 174 | $readmesObj->setVar('rm_submitter', $submitter); |
| 175 | 175 | // Insert Data |
| 176 | 176 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
| 233 | 233 | $baseurl = \substr($readme['html_url'], 0, \strrpos($readme['html_url'], '/') + 1); |
| 234 | 234 | $readmesObj->setVar('rm_baseurl', $baseurl); |
| 235 | - $readmesObj->setVar('rm_datecreated',time()); |
|
| 235 | + $readmesObj->setVar('rm_datecreated', time()); |
|
| 236 | 236 | $readmesObj->setVar('rm_submitter', $submitter); |
| 237 | 237 | // Insert Data |
| 238 | 238 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -266,10 +266,10 @@ discard block |
||
| 266 | 266 | public function updateRepoReadme() |
| 267 | 267 | { |
| 268 | 268 | // update repo_readme |
| 269 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . ' INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
|
| 270 | - $sql .= ' ON ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_id = ' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes') . '.rm_repoid '; |
|
| 271 | - $sql .= 'SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_readme = 1 '; |
|
| 272 | - $sql .= 'WHERE (((' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes') . '.rm_id)>0));'; |
|
| 269 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').' INNER JOIN '.$GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
|
| 270 | + $sql .= ' ON '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_id = '.$GLOBALS['xoopsDB']->prefix('wggithub_readmes').'.rm_repoid '; |
|
| 271 | + $sql .= 'SET '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_readme = 1 '; |
|
| 272 | + $sql .= 'WHERE ((('.$GLOBALS['xoopsDB']->prefix('wggithub_readmes').'.rm_id)>0));'; |
|
| 273 | 273 | $GLOBALS['xoopsDB']->queryF($sql); |
| 274 | 274 | |
| 275 | 275 | return true; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
| 138 | 138 | $utility = new \XoopsModules\Wggithub\Utility(); |
| 139 | 139 | $ret = $this->getValues($keys, $format, $maxDepth); |
| 140 | - $ret['id'] = $this->getVar('rm_id'); |
|
| 140 | + $ret['id'] = $this->getVar('rm_id'); |
|
| 141 | 141 | $repositoriesHandler = $helper->getHandler('Repositories'); |
| 142 | 142 | $repositoriesObj = $repositoriesHandler->get($this->getVar('rm_repoid')); |
| 143 | 143 | $repoName = '*****missing repo_name*****'; |
@@ -166,12 +166,12 @@ discard block |
||
| 166 | 166 | "src='assets/" |
| 167 | 167 | ]; |
| 168 | 168 | $arrReplace = [ |
| 169 | - 'src="' . $baseUrl . '.gitbook/assets/', |
|
| 170 | - "src='" . $baseUrl . '.gitbook/assets/', |
|
| 171 | - 'src="' . $baseUrl . 'en/assets/', |
|
| 172 | - "src='" . $baseUrl . 'en/assets/', |
|
| 173 | - 'src="' . $baseUrl . 'assets/', |
|
| 174 | - "src='" . $baseUrl . 'assets/' |
|
| 169 | + 'src="'.$baseUrl.'.gitbook/assets/', |
|
| 170 | + "src='".$baseUrl.'.gitbook/assets/', |
|
| 171 | + 'src="'.$baseUrl.'en/assets/', |
|
| 172 | + "src='".$baseUrl.'en/assets/', |
|
| 173 | + 'src="'.$baseUrl.'assets/', |
|
| 174 | + "src='".$baseUrl.'assets/' |
|
| 175 | 175 | ]; |
| 176 | 176 | $contentClean = str_replace($arrSearch, $arrReplace, $contentEncoded); |
| 177 | 177 | } else { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $ret['submitter'] = \XoopsUser::getUnameFromId($this->getVar('rm_submitter')); |
| 187 | 187 | $ret['gitbook_link'] = ''; |
| 188 | 188 | if (strpos($ret['downloadurl'], 'XoopsDoc') > 0) { |
| 189 | - $ret['gitbook_link'] = 'https://xoops.gitbook.io/' . $repoName . '/'; |
|
| 189 | + $ret['gitbook_link'] = 'https://xoops.gitbook.io/'.$repoName.'/'; |
|
| 190 | 190 | } |
| 191 | 191 | return $ret; |
| 192 | 192 | } |