Changeset 3090592
- Timestamp:
- 05/22/2024 06:45:38 AM (23 months ago)
- Location:
- realbig-media/trunk
- Files:
-
- 12 added
- 8 deleted
- 8 edited
-
README.MD (modified) (2 diffs)
-
README.txt (modified) (2 diffs)
-
RFWP_AdminPage.php (modified) (2 diffs)
-
assets/css (added)
-
assets/css/page.css (added)
-
assets/images (added)
-
assets/images/realbig_plugin_hover_old.png (added)
-
assets/images/realbig_plugin_standart.svg (added)
-
assets/images/realbig_plugin_standart_old.png (added)
-
assets/js (added)
-
assets/js/RFWP_BlockInserting.js (added)
-
assets/js/asyncBlockInserting.js (added)
-
assets/js/readyAdGather.js (added)
-
assets/js/synchronizationJS.js (added)
-
assets/js/webnawozComp.js (added)
-
assets/page.css (deleted)
-
assets/realbig_plugin_hover_old.png (deleted)
-
assets/realbig_plugin_standart.svg (deleted)
-
assets/realbig_plugin_standart_old.png (deleted)
-
asyncBlockInserting.js (deleted)
-
readyAdGather.js (deleted)
-
realbigForWP.php (modified) (6 diffs)
-
synchronising.php (modified) (4 diffs)
-
synchronizationJS.js (deleted)
-
templates/adminPage.php (modified) (1 diff)
-
textEditing.php (modified) (17 diffs)
-
update.php (modified) (1 diff)
-
webnawozComp.js (deleted)
Legend:
- Unmodified
- Added
- Removed
-
realbig-media/trunk/README.MD
r3062761 r3090592 3 3 Tags: AD, content filling 4 4 Requires at least: 6.2 5 Tested up to: 6. 4.35 Tested up to: 6.5.3 6 6 Stable tag: 0.1.26.56 7 7 Requires PHP: 5.6 … … 108 108 == Changelog == 109 109 110 = 1.1.0 = 111 112 Изменения версии: 113 114 * добавили возможность выбора отображения рекламы при меньшем количестве тегов; 115 * сделали вывод рекламы на сайтах с бесконечной прокруткой; 116 * другие мелкие улучшения и правки. 117 110 118 = 1.0.7 = 111 119 -
realbig-media/trunk/README.txt
r3062761 r3090592 3 3 Tags: AD, content filling 4 4 Requires at least: 6.2 5 Tested up to: 6. 4.35 Tested up to: 6.5.3 6 6 Stable tag: 0.1.26.56 7 7 Requires PHP: 5.6 … … 108 108 == Changelog == 109 109 110 = 1.1.0 = 111 112 Изменения версии: 113 114 * добавили возможность выбора отображения рекламы при меньшем количестве тегов; 115 * сделали вывод рекламы на сайтах с бесконечной прокруткой; 116 * другие мелкие улучшения и правки. 117 110 118 = 1.0.7 = 111 119 -
realbig-media/trunk/RFWP_AdminPage.php
r3062761 r3090592 12 12 try { 13 13 WP_Filesystem(); 14 $filePath = plugin_dir_path( __FILE__ ).'assets/ realbig_plugin_standart.svg';14 $filePath = plugin_dir_path( __FILE__ ).'assets/images/realbig_plugin_standart.svg'; 15 15 if ( $wp_filesystem->exists( $filePath ) ) { 16 16 $iconUrl = $wp_filesystem->get_contents( $filePath ); … … 166 166 global $wpPrefix; 167 167 168 if (wp_get_raw_referer() && !wp_get_referer() && !empty($_POST)) { 168 if (!empty($_POST) && wp_get_raw_referer() && !wp_get_referer() && 169 preg_replace('~^https?://~', '//', home_url() . wp_unslash( $_SERVER['REQUEST_URI'] )) === 170 preg_replace('~^https?://~', '//', wp_get_raw_referer())) { 169 171 if (!empty($_POST['clearLogs'])) { 170 172 RFWP_Logs::clearAllLogs(); -
realbig-media/trunk/realbigForWP.php
r3062761 r3090592 6 6 Plugin name: Realbig Media 7 7 Description: Плагин для монетизации от RealBig.media 8 Version: 1. 0.78 Version: 1.1.0 9 9 Author: Realbig Team 10 10 Author URI: https://realbig.media … … 183 183 $fromDb = RFWP_gatherBlocksFromDb(); 184 184 $GLOBALS['fromDb'] = $fromDb; 185 $contentBlocks = RFWP_creatingJavascriptParserForContentFunction_test($fromDb['adBlocks'], $fromDb['excIdClass'], $fromDb['blockDuplicate'], $fromDb['obligatoryMargin'], $fromDb['tagsListForTextLength'] );185 $contentBlocks = RFWP_creatingJavascriptParserForContentFunction_test($fromDb['adBlocks'], $fromDb['excIdClass'], $fromDb['blockDuplicate'], $fromDb['obligatoryMargin'], $fromDb['tagsListForTextLength'], $fromDb['showAdsNoElement']); 186 186 $content = $contentBlocks['before'].$content.$contentBlocks['after']; 187 187 if (!is_admin()&&empty(apply_filters('wp_doing_cron',defined('DOING_CRON')&&DOING_CRON))&&empty(apply_filters('wp_doing_ajax',defined('DOING_AJAX')&&DOING_AJAX))) { … … 520 520 wp_enqueue_script( 521 521 'asyncBlockInserting', 522 plugins_url().'/'.basename(__DIR__).'/as yncBlockInserting.js',522 plugins_url().'/'.basename(__DIR__).'/assets/js/asyncBlockInserting.js', 523 523 array('jquery'), 524 524 $GLOBALS['realbigForWP_version'], … … 541 541 wp_enqueue_script( 542 542 'readyAdGather', 543 plugins_url().'/'.basename(__DIR__).'/ readyAdGather.js',543 plugins_url().'/'.basename(__DIR__).'/assets/js/readyAdGather.js', 544 544 array('jquery'), 545 545 $GLOBALS['realbigForWP_version'], … … 576 576 } 577 577 578 include_once(plugin_dir_path(__FILE__) . 'asyncBlockInserting.js'); 578 include_once(plugin_dir_path(__FILE__) . 'assets/js/RFWP_BlockInserting.js'); 579 include_once(plugin_dir_path(__FILE__) . 'assets/js/asyncBlockInserting.js'); 579 580 echo PHP_EOL . "</script>" . PHP_EOL; 580 581 … … 603 604 } 604 605 605 include_once(plugin_dir_path(__FILE__) . ' readyAdGather.js');606 include_once(plugin_dir_path(__FILE__) . 'assets/js/readyAdGather.js'); 606 607 echo PHP_EOL . "</script>" . PHP_EOL; 607 608 -
realbig-media/trunk/synchronising.php
r3062761 r3090592 134 134 $sqlTokenSave = "INSERT INTO %i (text, block_number, setting_type, element, directElement, elementPosition, " . 135 135 "elementPlace, firstPlace, elementCount, elementStep, minSymbols, maxSymbols, minHeaders, maxHeaders, " . 136 "onCategories, offCategories, onTags, offTags, elementCss ) VALUES ";136 "onCategories, offCategories, onTags, offTags, elementCss, showNoElement) VALUES "; 137 137 foreach ($decodedToken['data'] AS $k => $item) { 138 138 $counter ++; 139 139 $sqlTokenSave .= ($counter != 1 ?", ":"") . 140 "(%s, %d, %d, %s, %s, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %s, %s, %s, %s )";140 "(%s, %d, %d, %s, %s, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %s, %s, %s, %s"; 141 141 array_push($params, $item['text'], (int) sanitize_text_field($item['block_number']), 142 142 (int) sanitize_text_field($item['setting_type']), sanitize_text_field($item['element']), … … 149 149 sanitize_text_field($item['onTags']), sanitize_text_field($item['offTags']), 150 150 sanitize_text_field($item['elementCss'])); 151 152 if (sanitize_text_field($item['showNoElement']) != "") { 153 $sqlTokenSave .= ", %d"; 154 array_push($params, (int) sanitize_text_field($item['showNoElement'])); 155 } else { 156 $sqlTokenSave .= ", null"; 157 } 158 $sqlTokenSave .= ")"; 151 159 } 152 160 unset($k, $item); … … 157 165 "minHeaders = values(minHeaders), maxHeaders = values(maxHeaders), onCategories = values(onCategories), " . 158 166 "offCategories = values(offCategories), onTags = values(onTags), offTags = values(offTags), " . 159 "elementCss = values(elementCss) ";167 "elementCss = values(elementCss), showNoElement = values(showNoElement) "; 160 168 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 161 169 $wpdb->query($wpdb->prepare($sqlTokenSave, $params)); … … 195 203 $sanitised = sanitize_text_field($decodedToken['adWithStatic']); 196 204 RFWP_Utils::saveToRbSettings($sanitised, 'adWithStatic'); 205 } 206 if (isset($decodedToken['showAdsNoElement'])) { 207 $sanitised = sanitize_text_field($decodedToken['showAdsNoElement']); 208 RFWP_Utils::saveToRbSettings($sanitised, 'showAdsNoElement'); 197 209 } 198 210 /** Selected taxonomies */ -
realbig-media/trunk/templates/adminPage.php
r3062761 r3090592 13 13 <style> 14 14 <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 15 echo $wp_filesystem->get_contents( plugin_dir_path(__FILE__) . '../assets/ page.css'); ?>15 echo $wp_filesystem->get_contents( plugin_dir_path(__FILE__) . '../assets/css/page.css'); ?> 16 16 </style> 17 17 -
realbig-media/trunk/textEditing.php
r3063330 r3090592 191 191 } 192 192 193 $editedContent = '<span id="content_pointer_id" data-content-length="'.$contentLength.'"'.$finalRejectedBlocks.$finalAcceptedBlocks.'></span>'.$editedContent;193 $editedContent = '<span class="content_pointer_class" data-content-length="'.$contentLength.'"'.$finalRejectedBlocks.$finalAcceptedBlocks.'></span>'.$editedContent; 194 194 195 195 $creatingJavascriptParserForContent = RFWP_creatingJavascriptParserForContentFunction_content(); … … 265 265 if (typeof launchAsyncFunctionLauncher === "undefined") { 266 266 function launchAsyncFunctionLauncher() { 267 if (typeof asyncFunctionLauncher !== "undefined" && typeof asyncFunctionLauncher=== "function") {268 asyncFunctionLauncher();267 if (typeof RFWP_BlockInserting === "function") { 268 RFWP_BlockInserting.launch(blockSettingArray); 269 269 } else { 270 270 setTimeout(function () { … … 291 291 let deniedString = ""; 292 292 let contentSelector = \''.esc_attr(stripslashes($contentSelector)).'\'; 293 let content Check = null;293 let contentsCheck = null; 294 294 if (contentSelector) { 295 content Check = document.querySelector(contentSelector);295 contentsCheck = document.querySelectorAll(contentSelector); 296 296 } 297 297 … … 310 310 } 311 311 312 if (!content Check) {312 if (!contentsCheck || !contentsCheck.length) { 313 313 for (let i = 0; i < possibleClasses.length; i++) { 314 content Check = document.querySelector(possibleClasses[i]+deniedString);315 if (content Check) {314 contentsCheck = document.querySelectorAll(possibleClasses[i]+deniedString); 315 if (contentsCheck.length > 0) { 316 316 break; 317 317 } 318 318 } 319 319 } 320 if (!contentCheck) { 321 contentCheck = document.querySelector(\'[itemprop=articleBody]\'); 322 } 323 if (contentCheck) { 324 console.log(\'content is here\'); 325 let contentPointerCheck = document.querySelector(\'#content_pointer_id\'); 326 let cpSpan 327 if (contentPointerCheck && contentCheck.contains(contentPointerCheck)) { 328 cpSpan = contentPointerCheck; 329 } else { 330 if (contentPointerCheck) { 331 contentPointerCheck.parentNode.removeChild(contentPointerCheck); 320 if (!contentsCheck || !contentsCheck.length) { 321 contentsCheck = document.querySelectorAll(\'[itemprop=articleBody]\'); 322 } 323 if (contentsCheck && contentsCheck.length > 0) { 324 contentsCheck.forEach((contentCheck) => { 325 console.log(\'content is here\'); 326 let contentPointerCheck = contentCheck.querySelector(\'.content_pointer_class\'); 327 let cpSpan 328 if (contentPointerCheck && contentCheck.contains(contentPointerCheck)) { 329 cpSpan = contentPointerCheck; 330 } else { 331 if (contentPointerCheck) { 332 contentPointerCheck.parentNode.removeChild(contentPointerCheck); 333 } 334 cpSpan = document.createElement(\'SPAN\'); 332 335 } 333 cpSpan = document.createElement(\'SPAN\'); 334 } 335 cpSpan.setAttribute(\'id\', \'content_pointer_id\'); 336 cpSpan.classList.add(\'no-content\'); 337 cpSpan.setAttribute(\'data-content-length\', \'0\'); 338 cpSpan.setAttribute(\'data-accepted-blocks\', \''.esc_attr(stripslashes($adBlocksIdsString)).'\'); 339 cpSpan.setAttribute(\'data-rejected-blocks\', \''.esc_attr(stripslashes($rejectedIdsString)).'\'); 340 window.jsInputerLaunch = 10; 341 342 if (!cpSpan.parentNode) contentCheck.prepend(cpSpan); 336 cpSpan.classList.add(\'content_pointer_class\'); 337 cpSpan.classList.add(\'no-content\'); 338 cpSpan.setAttribute(\'data-content-length\', \'0\'); 339 cpSpan.setAttribute(\'data-accepted-blocks\', \'\'); 340 cpSpan.setAttribute(\'data-rejected-blocks\', \'\'); 341 window.jsInputerLaunch = 10; 342 343 if (!cpSpan.parentNode) contentCheck.prepend(cpSpan); 344 }); 343 345 344 346 launchAsyncFunctionLauncher(); … … 352 354 }, 200); 353 355 } else { 354 content Check = document.querySelector("body"+deniedString+" div"+deniedString);355 if (content Check) {356 contentsCheck = document.querySelector("body"+deniedString+" div"+deniedString); 357 if (contentsCheck) { 356 358 console.log(\'content is here hard\'); 357 359 let cpSpan = document.createElement(\'SPAN\'); 358 cpSpan. setAttribute(\'id\', \'content_pointer_id\');360 cpSpan.classList.add(\'content_pointer_class\'); 359 361 cpSpan.classList.add(\'no-content\'); 360 362 cpSpan.classList.add(\'hard-content\'); … … 364 366 window.jsInputerLaunch = 10; 365 367 366 content Check.prepend(cpSpan);368 contentsCheck.prepend(cpSpan); 367 369 launchAsyncFunctionLauncher(); 368 370 } … … 1119 1121 } 1120 1122 } 1121 if (!function_exists('RFWP_creatingJavascriptParserForContentFunction ')) {1122 function RFWP_creatingJavascriptParserForContentFunction ($fromDb, $usedBlocks, $contentLength, $excIdClass, $shortcodes, $rejectedBlocks, $blockDuplicate) {1123 if (!function_exists('RFWP_creatingJavascriptParserForContentFunction_content')) { 1124 function RFWP_creatingJavascriptParserForContentFunction_content() { 1123 1125 try { 1126 if (!is_admin()&&empty(apply_filters('wp_doing_cron',defined('DOING_CRON')&&DOING_CRON))&&empty(apply_filters('wp_doing_ajax',defined('DOING_AJAX')&&DOING_AJAX))) { 1127 RFWP_WorkProgressLog(false,'creatingJavascriptParserForContentFunction_content begin'); 1128 } 1129 $scriptingCode = '<script>'.PHP_EOL; 1130 // $scriptingCode .= 'if (typeof contentLength==="undefined") {var contentLength = '.$contentLength.';} else {contentLength = '.$contentLength.';}'.PHP_EOL; 1131 $scriptingCode .= 'window.jsInputerLaunch = 15;'.PHP_EOL; 1132 $scriptingCode .= 1133 'if (typeof launchAsyncFunctionLauncher === "undefined") { 1134 function launchAsyncFunctionLauncher() { 1135 if (typeof RFWP_BlockInserting === "function") { 1136 RFWP_BlockInserting.launch(blockSettingArray); 1137 } else { 1138 setTimeout(function () { 1139 launchAsyncFunctionLauncher(); 1140 }, 100) 1141 } 1142 } 1143 } 1144 launchAsyncFunctionLauncher();'.PHP_EOL; 1145 1146 $scriptingCode .= '</script>'; 1147 1148 return $scriptingCode; 1149 } catch (Exception $ex) { 1150 $messageFLog = 'Some error in creatingJavascriptParserForContent: '.$ex->getMessage().';'; 1151 RFWP_Logs::saveLogs(RFWP_Logs::ERRORS_LOG, $messageFLog); 1152 return ''; 1153 } catch (Error $er) { 1154 $messageFLog = 'Some error in creatingJavascriptParserForContent: '.$er->getMessage().';'; 1155 RFWP_Logs::saveLogs(RFWP_Logs::ERRORS_LOG, $messageFLog); 1156 return ''; 1157 } 1158 } 1159 } 1160 if (!function_exists('RFWP_creatingJavascriptParserForContentFunction_test')) { 1161 function RFWP_creatingJavascriptParserForContentFunction_test($fromDb, $excIdClass, $blockDuplicate, $obligatoryMargin, $tagsListForTextLength, $showAdsNoElement) { 1162 try { 1163 /*?><script>console.log('Header addings passed');</script><?php*/ 1164 if (!is_admin()&&empty(apply_filters('wp_doing_cron',defined('DOING_CRON')&&DOING_CRON))&&empty(apply_filters('wp_doing_ajax',defined('DOING_AJAX')&&DOING_AJAX))) { 1165 RFWP_WorkProgressLog(false,'creatingJavascriptParserForContentFunction_test begin'); 1166 } 1124 1167 $cou1 = 0; 1125 1168 global $rfwp_shortcodes; … … 1134 1177 overflow: hidden; 1135 1178 } 1136 #content_pointer_id{1179 .content_pointer_class { 1137 1180 display: block !important; 1138 1181 width: 100% !important; 1182 } 1183 .rfwp_removedMarginTop { 1184 margin-top: 0 !important; 1185 } 1186 .rfwp_removedMarginBottom { 1187 margin-bottom: 0 !important; 1139 1188 } 1140 1189 </style>'; … … 1151 1200 } 1152 1201 } 1153 var cou2 = 0;1154 if (typeof usedBlockSettingArray==="undefined") {1155 var usedBlockSettingArray = [];1156 } else {1157 if (Array.isArray(usedBlockSettingArray)) {1158 cou2 = usedBlockSettingArray.length;1159 } else {1160 var usedBlockSettingArray = [];1161 }1162 }1163 1202 if (typeof excIdClass==="undefined") { 1164 1203 var excIdClass = ["'.$excIdClass.'"]; 1165 }1166 if (typeof contentLength==="undefined") {1167 var contentLength = '.$contentLength.';1168 } else {1169 contentLength = '.$contentLength.';1170 1204 } 1171 1205 if (typeof blockDuplicate==="undefined") { 1172 1206 var blockDuplicate = "'.$blockDuplicate.'"; 1173 1207 } 1208 if (typeof obligatoryMargin==="undefined") { 1209 var obligatoryMargin = '.intval($obligatoryMargin).'; 1210 } 1174 1211 '; 1212 if (!empty($tagsListForTextLength)) { 1213 $scriptingCode .= ' 1214 if (typeof tagsListForTextLength==="undefined") { 1215 var tagsListForTextLength = ["'.$tagsListForTextLength.'"]; 1216 } 1217 '; 1218 } 1175 1219 1176 1220 $k1 = 0; … … 1180 1224 $item = get_object_vars($item); 1181 1225 } 1182 if (in_array($item['id'], $usedBlocks)) {1183 $resultHere = 'used';1184 }1185 elseif (in_array($item['id'], $rejectedBlocks)) {1186 $resultHere = 'rejected';1187 }1188 1226 // $resultHere = in_array($item['id'], $usedBlocks); 1189 1227 // if ($resultHere == false) { … … 1212 1250 $scriptingCode .= 'blockSettingArray[cou1]["maxHeaders"] = 0;'.PHP_EOL; 1213 1251 } 1252 if (isset($item['showNoElement'])) { 1253 $scriptingCode .= 'blockSettingArray[cou1]["showNoElement"] = '.$item['showNoElement'].'; '.PHP_EOL; 1254 } else { 1255 $scriptingCode .= 'blockSettingArray[cou1]["showNoElement"] = '.$showAdsNoElement.';'.PHP_EOL; 1256 } 1214 1257 $scriptingCode .= 'blockSettingArray[cou1]["id"] = \''.$item['id'].'\'; '.PHP_EOL; 1215 1258 if (!empty($rfwp_shortcodes[$item['block_number']])) { … … 1225 1268 $scriptingCode .= 'blockSettingArray[cou1]["text"] = \'' . $currentItemContent . '\'; ' . PHP_EOL; 1226 1269 $scriptingCode .= 'blockSettingArray[cou1]["setting_type"] = '.$item['setting_type'].'; ' . PHP_EOL; 1270 $scriptingCode .= 'blockSettingArray[cou1]["rb_under"] = ' . wp_rand(100000, 1000000) . '; ' . PHP_EOL; 1271 // $scriptingCode .= 'blockSettingArray[cou1]["block_number"] = '.$item['block_number'].'; ' . PHP_EOL; 1227 1272 if (!empty($item['elementCss'])) { 1228 1273 $scriptingCode .= 'blockSettingArray[cou1]["elementCss"] = "'.$item['elementCss'].'"; ' . PHP_EOL; … … 1248 1293 } 1249 1294 $scriptingCode .= 'cou1++;'.PHP_EOL; 1250 // $cou1++;1251 }1252 elseif ($resultHere == 'used') {1253 $scriptingCode .= 'usedBlockSettingArray[cou2] = [];'.PHP_EOL;1254 $scriptingCode .= 'usedBlockSettingArray[cou2]["id"] = \''.$item['block_number'].'\'; '.PHP_EOL;1255 $scriptingCode .= 'usedBlockSettingArray[cou2]["elementPosition"] = '.$item['elementPosition'].'; '.PHP_EOL;1256 $scriptingCode .= 'cou2++;'.PHP_EOL;1257 $k1++;1258 }1259 }1260 $scriptingCode .= PHP_EOL;1261 $scriptingCode .= 'window.jsInputerLaunch = 15;'.PHP_EOL;1262 $scriptingCode .=1263 'if (typeof launchAsyncFunctionLauncher === "undefined") {1264 function launchAsyncFunctionLauncher() {1265 if (typeof asyncFunctionLauncher !== "undefined" && typeof asyncFunctionLauncher === "function") {1266 asyncFunctionLauncher();1267 } else {1268 setTimeout(function () {1269 launchAsyncFunctionLauncher();1270 }, 100)1271 }1272 }1273 }1274 launchAsyncFunctionLauncher();'.PHP_EOL;1275 1276 $scriptingCode .= PHP_EOL;1277 $scriptingCode .= '</script>';1278 1279 $scriptingCodeResult['before'] = $contentBeforeScript.$cssCode;1280 $scriptingCodeResult['after'] = $scriptingCode;1281 $scriptingCode = $contentBeforeScript.$cssCode.$scriptingCode;1282 return $scriptingCodeResult;1283 } catch (Exception $ex) {1284 $messageFLog = 'Some error in creatingJavascriptParserForContent: '.$ex->getMessage().';';1285 RFWP_Logs::saveLogs(RFWP_Logs::ERRORS_LOG, $messageFLog);1286 return '';1287 } catch (Error $er) {1288 $messageFLog = 'Some error in creatingJavascriptParserForContent: '.$er->getMessage().';';1289 RFWP_Logs::saveLogs(RFWP_Logs::ERRORS_LOG, $messageFLog);1290 return '';1291 }1292 }1293 }1294 if (!function_exists('RFWP_creatingJavascriptParserForContentFunction_content')) {1295 function RFWP_creatingJavascriptParserForContentFunction_content() {1296 try {1297 if (!is_admin()&&empty(apply_filters('wp_doing_cron',defined('DOING_CRON')&&DOING_CRON))&&empty(apply_filters('wp_doing_ajax',defined('DOING_AJAX')&&DOING_AJAX))) {1298 RFWP_WorkProgressLog(false,'creatingJavascriptParserForContentFunction_content begin');1299 }1300 $scriptingCode = '<script>'.PHP_EOL;1301 // $scriptingCode .= 'if (typeof contentLength==="undefined") {var contentLength = '.$contentLength.';} else {contentLength = '.$contentLength.';}'.PHP_EOL;1302 $scriptingCode .= 'window.jsInputerLaunch = 15;'.PHP_EOL;1303 $scriptingCode .=1304 'if (typeof launchAsyncFunctionLauncher === "undefined") {1305 function launchAsyncFunctionLauncher() {1306 if (typeof asyncFunctionLauncher !== "undefined" && typeof asyncFunctionLauncher === "function") {1307 asyncFunctionLauncher();1308 } else {1309 setTimeout(function () {1310 launchAsyncFunctionLauncher();1311 }, 100)1312 }1313 }1314 }1315 launchAsyncFunctionLauncher();'.PHP_EOL;1316 1317 $scriptingCode .= '</script>';1318 1319 return $scriptingCode;1320 } catch (Exception $ex) {1321 $messageFLog = 'Some error in creatingJavascriptParserForContent: '.$ex->getMessage().';';1322 RFWP_Logs::saveLogs(RFWP_Logs::ERRORS_LOG, $messageFLog);1323 return '';1324 } catch (Error $er) {1325 $messageFLog = 'Some error in creatingJavascriptParserForContent: '.$er->getMessage().';';1326 RFWP_Logs::saveLogs(RFWP_Logs::ERRORS_LOG, $messageFLog);1327 return '';1328 }1329 }1330 }1331 if (!function_exists('RFWP_creatingJavascriptParserForContentFunction_test')) {1332 function RFWP_creatingJavascriptParserForContentFunction_test($fromDb, $excIdClass, $blockDuplicate, $obligatoryMargin, $tagsListForTextLength) {1333 try {1334 /*?><script>console.log('Header addings passed');</script><?php*/1335 if (!is_admin()&&empty(apply_filters('wp_doing_cron',defined('DOING_CRON')&&DOING_CRON))&&empty(apply_filters('wp_doing_ajax',defined('DOING_AJAX')&&DOING_AJAX))) {1336 RFWP_WorkProgressLog(false,'creatingJavascriptParserForContentFunction_test begin');1337 }1338 $cou1 = 0;1339 global $rfwp_shortcodes;1340 $scriptingCodeResult = [];1341 $contentBeforeScript = ''.PHP_EOL;1342 $cssCode = ''.PHP_EOL;1343 $cssCode .='<style>1344 .coveredAd {1345 position: relative;1346 left: -5000px;1347 max-height: 1px;1348 overflow: hidden;1349 }1350 #content_pointer_id {1351 display: block !important;1352 width: 100% !important;1353 }1354 .rfwp_removedMarginTop {1355 margin-top: 0 !important;1356 }1357 .rfwp_removedMarginBottom {1358 margin-bottom: 0 !important;1359 }1360 </style>';1361 $scriptingCode = '1362 <script>1363 var cou1 = 0;1364 if (typeof blockSettingArray==="undefined") {1365 var blockSettingArray = [];1366 } else {1367 if (Array.isArray(blockSettingArray)) {1368 cou1 = blockSettingArray.length;1369 } else {1370 var blockSettingArray = [];1371 }1372 }1373 if (typeof excIdClass==="undefined") {1374 var excIdClass = ["'.$excIdClass.'"];1375 }1376 if (typeof blockDuplicate==="undefined") {1377 var blockDuplicate = "'.$blockDuplicate.'";1378 }1379 if (typeof obligatoryMargin==="undefined") {1380 var obligatoryMargin = '.intval($obligatoryMargin).';1381 }1382 ';1383 if (!empty($tagsListForTextLength)) {1384 $scriptingCode .= '1385 if (typeof tagsListForTextLength==="undefined") {1386 var tagsListForTextLength = ["'.$tagsListForTextLength.'"];1387 }1388 ';1389 }1390 1391 $k1 = 0;1392 foreach ($fromDb AS $k => $item) {1393 $resultHere = 'normal';1394 if (is_object($item)) {1395 $item = get_object_vars($item);1396 }1397 // $resultHere = in_array($item['id'], $usedBlocks);1398 // if ($resultHere == false) {1399 if ($resultHere == 'normal') {1400 // $contentBeforeScript .= $item['text'].PHP_EOL;1401 $scriptingCode .= 'blockSettingArray[cou1] = [];'.PHP_EOL;1402 1403 if (!empty($item['minSymbols'])&&$item['minSymbols'] > 1) {1404 $scriptingCode .= 'blockSettingArray[cou1]["minSymbols"] = '.$item['minSymbols'].'; '.PHP_EOL;1405 } else {1406 $scriptingCode .= 'blockSettingArray[cou1]["minSymbols"] = 0;'.PHP_EOL;1407 }1408 if (!empty($item['maxSymbols'])&&$item['maxSymbols'] > 1) {1409 $scriptingCode .= 'blockSettingArray[cou1]["maxSymbols"] = '.$item['maxSymbols'].'; '.PHP_EOL;1410 } else {1411 $scriptingCode .= 'blockSettingArray[cou1]["maxSymbols"] = 0;'.PHP_EOL;1412 }1413 if (!empty($item['minHeaders'])&&$item['minHeaders'] > 1) {1414 $scriptingCode .= 'blockSettingArray[cou1]["minHeaders"] = '.$item['minHeaders'].'; '.PHP_EOL;1415 } else {1416 $scriptingCode .= 'blockSettingArray[cou1]["minHeaders"] = 0;'.PHP_EOL;1417 }1418 if (!empty($item['maxHeaders'])&&$item['maxHeaders'] > 1) {1419 $scriptingCode .= 'blockSettingArray[cou1]["maxHeaders"] = '.$item['maxHeaders'].'; '.PHP_EOL;1420 } else {1421 $scriptingCode .= 'blockSettingArray[cou1]["maxHeaders"] = 0;'.PHP_EOL;1422 }1423 $scriptingCode .= 'blockSettingArray[cou1]["id"] = \''.$item['id'].'\'; '.PHP_EOL;1424 if (!empty($rfwp_shortcodes[$item['block_number']])) {1425 $scriptingCode .= 'blockSettingArray[cou1]["sc"] = \'1\'; '.PHP_EOL;1426 } else {1427 $scriptingCode .= 'blockSettingArray[cou1]["sc"] = \'0\'; '.PHP_EOL;1428 }1429 $currentItemContent = $item['text'];1430 $currentItemContent = preg_replace('~(\'|\")~','\\\$1',$currentItemContent);1431 $currentItemContent = preg_replace('~(\r\n)~','',$currentItemContent);1432 // $currentItemContent = preg_replace('~(\<\/script\>)~','</scr"+"ipt>',$currentItemContent);1433 // $scriptingCode .= 'blockSettingArray[cou1]["text"] = \'' . $item['text'] . '\'; ' . PHP_EOL;1434 $scriptingCode .= 'blockSettingArray[cou1]["text"] = \'' . $currentItemContent . '\'; ' . PHP_EOL;1435 $scriptingCode .= 'blockSettingArray[cou1]["setting_type"] = '.$item['setting_type'].'; ' . PHP_EOL;1436 // $scriptingCode .= 'blockSettingArray[cou1]["block_number"] = '.$item['block_number'].'; ' . PHP_EOL;1437 if (!empty($item['elementCss'])) {1438 $scriptingCode .= 'blockSettingArray[cou1]["elementCss"] = "'.$item['elementCss'].'"; ' . PHP_EOL;1439 }1440 if ($item['setting_type'] == 1) { //for ordinary block1441 // $scriptingCode .= 'blockSettingArray[cou1]["setting_type"] = 1; ' . PHP_EOL;1442 $scriptingCode .= 'blockSettingArray[cou1]["element"] = "' . $item['element'] . '"; ' . PHP_EOL;1443 $scriptingCode .= 'blockSettingArray[cou1]["elementPosition"] = ' . $item['elementPosition'] . '; ' . PHP_EOL;1444 $scriptingCode .= 'blockSettingArray[cou1]["elementPlace"] = ' . $item['elementPlace'] . '; ' . PHP_EOL;1445 } elseif ($item['setting_type'] == 2) { //for repeatable1446 $scriptingCode .= 'blockSettingArray[cou1]["element"] = "' . $item['element'] . '"; ' . PHP_EOL;1447 $scriptingCode .= 'blockSettingArray[cou1]["elementPosition"] = ' . $item['elementPosition'] . '; ' . PHP_EOL;1448 $scriptingCode .= 'blockSettingArray[cou1]["firstPlace"] = "' . $item['firstPlace'] . '"; ' . PHP_EOL;1449 $scriptingCode .= 'blockSettingArray[cou1]["elementCount"] = "' . $item['elementCount'] . '"; ' . PHP_EOL;1450 $scriptingCode .= 'blockSettingArray[cou1]["elementStep"] = "' . $item['elementStep'] . '"; ' . PHP_EOL;1451 } elseif ($item['setting_type'] == 3) { //for direct block1452 $scriptingCode .= 'blockSettingArray[cou1]["element"] = "' . $item['element'] . '"; ' . PHP_EOL;1453 $scriptingCode .= 'blockSettingArray[cou1]["directElement"] = "' . $item['directElement'] . '"; ' . PHP_EOL;1454 $scriptingCode .= 'blockSettingArray[cou1]["elementPosition"] = ' . $item['elementPosition'] . '; ' . PHP_EOL;1455 $scriptingCode .= 'blockSettingArray[cou1]["elementPlace"] = ' . $item['elementPlace'] . '; ' . PHP_EOL;1456 } elseif (in_array($item['setting_type'],[6,7])) { //for percentage1457 $scriptingCode .= 'blockSettingArray[cou1]["elementPlace"] = ' . $item['elementPlace'] . '; ' . PHP_EOL;1458 }1459 $scriptingCode .= 'cou1++;'.PHP_EOL;1460 1295 } 1461 1296 } … … 1546 1381 $adBlocks = []; 1547 1382 $statusFor404 = 'show'; 1383 $showAdsNoElement = 0; 1548 1384 $obligatoryMargin = 0; 1549 1385 $tagsListForTextLength = null; 1550 1386 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange 1551 1387 $realbig_settings_info = $wpdb->get_results($wpdb->prepare( 1552 'SELECT optionName, optionValue FROM %i WGPS WHERE optionName IN (%s, %s, %s, %s,%s )',1388 'SELECT optionName, optionValue FROM %i WGPS WHERE optionName IN (%s, %s, %s, %s,%s,%s)', 1553 1389 "{$wpPrefix}realbig_settings", "excludedIdAndClasses", "blockDuplicate", "obligatoryMargin", 1554 "statusFor404", " tagsListForTextLength"));1390 "statusFor404", "showAdsNoElement", "tagsListForTextLength")); 1555 1391 if (!empty($realbig_settings_info)) { 1556 1392 foreach ($realbig_settings_info AS $k => $item) { … … 1574 1410 $statusFor404 = $item->optionValue; 1575 1411 break; 1412 case 'showAdsNoElement': 1413 $showAdsNoElement = $item->optionValue; 1414 break; 1576 1415 } 1577 1416 } … … 1623 1462 $result['excIdClass'] = $excIdClass; 1624 1463 $result['blockDuplicate'] = $blockDuplicate; 1625 $result['obligatoryMargin'] = $obligatoryMargin; 1626 $result['tagsListForTextLength'] = $tagsListForTextLength; 1627 return $result; 1628 } 1464 $result['obligatoryMargin'] = $obligatoryMargin; 1465 $result['tagsListForTextLength'] = $tagsListForTextLength; 1466 $result['showAdsNoElement'] = $showAdsNoElement; 1467 return $result; 1468 } 1629 1469 } 1630 1470 if (!function_exists('test_sc_oval_exec')) { … … 1824 1664 $plugin1 = 'webnavoz-likes/webnavoz-likes.php'; 1825 1665 if (is_plugin_active($plugin1)) { 1826 ?><script><?php include_once (plugin_dir_path(__FILE__).' webnawozComp.js'); ?></script><?php1666 ?><script><?php include_once (plugin_dir_path(__FILE__).'assets/js/webnawozComp.js'); ?></script><?php 1827 1667 } 1828 1668 } -
realbig-media/trunk/update.php
r3062761 r3090592 245 245 'offTags', 246 246 'elementCss', 247 'showNoElement', 247 248 ]; 248 249 try {
Note: See TracChangeset
for help on using the changeset viewer.