Plugin Directory

Changeset 3090592


Ignore:
Timestamp:
05/22/2024 06:45:38 AM (23 months ago)
Author:
nikmelnik
Message:

Релиз версии 1.1.0 плагина Realbig

Изменения версии:

  • добавили возможность выбора отображения рекламы при меньшем количестве тегов;
  • сделали вывод рекламы на сайтах с бесконечной прокруткой;
  • другие мелкие улучшения и правки.
Location:
realbig-media/trunk
Files:
12 added
8 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • realbig-media/trunk/README.MD

    r3062761 r3090592  
    33Tags: AD, content filling
    44Requires at least: 6.2
    5 Tested up to: 6.4.3
     5Tested up to: 6.5.3
    66Stable tag: 0.1.26.56
    77Requires PHP: 5.6
     
    108108== Changelog ==
    109109
     110= 1.1.0 =
     111
     112Изменения версии:
     113
     114* добавили возможность выбора отображения рекламы при меньшем количестве тегов;
     115* сделали вывод рекламы на сайтах с бесконечной прокруткой;
     116* другие мелкие улучшения и правки.
     117
    110118= 1.0.7 =
    111119
  • realbig-media/trunk/README.txt

    r3062761 r3090592  
    33Tags: AD, content filling
    44Requires at least: 6.2
    5 Tested up to: 6.4.3
     5Tested up to: 6.5.3
    66Stable tag: 0.1.26.56
    77Requires PHP: 5.6
     
    108108== Changelog ==
    109109
     110= 1.1.0 =
     111
     112Изменения версии:
     113
     114* добавили возможность выбора отображения рекламы при меньшем количестве тегов;
     115* сделали вывод рекламы на сайтах с бесконечной прокруткой;
     116* другие мелкие улучшения и правки.
     117
    110118= 1.0.7 =
    111119
  • realbig-media/trunk/RFWP_AdminPage.php

    r3062761 r3090592  
    1212            try {
    1313                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';
    1515                if ( $wp_filesystem->exists( $filePath ) ) {
    1616                    $iconUrl = $wp_filesystem->get_contents( $filePath );
     
    166166            global $wpPrefix;
    167167
    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())) {
    169171                if (!empty($_POST['clearLogs'])) {
    170172                    RFWP_Logs::clearAllLogs();
  • realbig-media/trunk/realbigForWP.php

    r3062761 r3090592  
    66Plugin name:  Realbig Media
    77Description:  Плагин для монетизации от RealBig.media
    8 Version:      1.0.7
     8Version:      1.1.0
    99Author:       Realbig Team
    1010Author URI:   https://realbig.media
     
    183183                    $fromDb = RFWP_gatherBlocksFromDb();
    184184                    $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']);
    186186                    $content = $contentBlocks['before'].$content.$contentBlocks['after'];
    187187                    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))) {
     
    520520                wp_enqueue_script(
    521521                    'asyncBlockInserting',
    522                     plugins_url().'/'.basename(__DIR__).'/asyncBlockInserting.js',
     522                    plugins_url().'/'.basename(__DIR__).'/assets/js/asyncBlockInserting.js',
    523523                    array('jquery'),
    524524                    $GLOBALS['realbigForWP_version'],
     
    541541                wp_enqueue_script(
    542542                    'readyAdGather',
    543                     plugins_url().'/'.basename(__DIR__).'/readyAdGather.js',
     543                    plugins_url().'/'.basename(__DIR__).'/assets/js/readyAdGather.js',
    544544                    array('jquery'),
    545545                    $GLOBALS['realbigForWP_version'],
     
    576576                    }
    577577
    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');
    579580                    echo  PHP_EOL . "</script>" . PHP_EOL;
    580581
     
    603604                    }
    604605
    605                     include_once(plugin_dir_path(__FILE__) . 'readyAdGather.js');
     606                    include_once(plugin_dir_path(__FILE__) . 'assets/js/readyAdGather.js');
    606607                    echo  PHP_EOL . "</script>" . PHP_EOL;
    607608
  • realbig-media/trunk/synchronising.php

    r3062761 r3090592  
    134134                                    $sqlTokenSave = "INSERT INTO %i (text, block_number, setting_type, element, directElement, elementPosition, " .
    135135                                        "elementPlace, firstPlace, elementCount, elementStep, minSymbols, maxSymbols, minHeaders, maxHeaders, " .
    136                                         "onCategories, offCategories, onTags, offTags, elementCss) VALUES ";
     136                                        "onCategories, offCategories, onTags, offTags, elementCss, showNoElement) VALUES ";
    137137                                    foreach ($decodedToken['data'] AS $k => $item) {
    138138                                        $counter ++;
    139139                                        $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";
    141141                                        array_push($params, $item['text'], (int) sanitize_text_field($item['block_number']),
    142142                                            (int) sanitize_text_field($item['setting_type']), sanitize_text_field($item['element']),
     
    149149                                            sanitize_text_field($item['onTags']), sanitize_text_field($item['offTags']),
    150150                                            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 .= ")";
    151159                                    }
    152160                                    unset($k, $item);
     
    157165                                        "minHeaders = values(minHeaders), maxHeaders = values(maxHeaders), onCategories = values(onCategories), " .
    158166                                        "offCategories = values(offCategories), onTags = values(onTags), offTags = values(offTags), " .
    159                                         "elementCss = values(elementCss) ";
     167                                        "elementCss = values(elementCss), showNoElement = values(showNoElement) ";
    160168                                    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange
    161169                                    $wpdb->query($wpdb->prepare($sqlTokenSave, $params));
     
    195203                                    $sanitised = sanitize_text_field($decodedToken['adWithStatic']);
    196204                                    RFWP_Utils::saveToRbSettings($sanitised, 'adWithStatic');
     205                                }
     206                                if (isset($decodedToken['showAdsNoElement'])) {
     207                                    $sanitised = sanitize_text_field($decodedToken['showAdsNoElement']);
     208                                    RFWP_Utils::saveToRbSettings($sanitised, 'showAdsNoElement');
    197209                                }
    198210                                /** Selected taxonomies */
  • realbig-media/trunk/templates/adminPage.php

    r3062761 r3090592  
    1313<style>
    1414    <?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'); ?>
    1616</style>
    1717
  • realbig-media/trunk/textEditing.php

    r3063330 r3090592  
    191191                        }
    192192
    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;
    194194
    195195                        $creatingJavascriptParserForContent = RFWP_creatingJavascriptParserForContentFunction_content();
     
    265265    if (typeof launchAsyncFunctionLauncher === "undefined") {
    266266        function launchAsyncFunctionLauncher() {
    267             if (typeof asyncFunctionLauncher !== "undefined" && typeof asyncFunctionLauncher === "function") {
    268                 asyncFunctionLauncher();
     267            if (typeof RFWP_BlockInserting === "function") {
     268                RFWP_BlockInserting.launch(blockSettingArray);
    269269            } else {
    270270                setTimeout(function () {
     
    291291            let deniedString = "";
    292292            let contentSelector = \''.esc_attr(stripslashes($contentSelector)).'\';
    293             let contentCheck = null;
     293            let contentsCheck = null;
    294294            if (contentSelector) {
    295                 contentCheck = document.querySelector(contentSelector);
     295                contentsCheck = document.querySelectorAll(contentSelector);
    296296            }
    297297
     
    310310            }
    311311           
    312             if (!contentCheck) {
     312            if (!contentsCheck || !contentsCheck.length) {
    313313                for (let i = 0; i < possibleClasses.length; i++) {
    314                     contentCheck = document.querySelector(possibleClasses[i]+deniedString);
    315                     if (contentCheck) {
     314                    contentsCheck = document.querySelectorAll(possibleClasses[i]+deniedString);
     315                    if (contentsCheck.length > 0) {
    316316                        break;
    317317                    }
    318318                }
    319319            }
    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\');                   
    332335                    }
    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                });
    343345               
    344346                launchAsyncFunctionLauncher();
     
    352354                    }, 200);
    353355                } else {
    354                     contentCheck = document.querySelector("body"+deniedString+" div"+deniedString);
    355                     if (contentCheck) {
     356                    contentsCheck = document.querySelector("body"+deniedString+" div"+deniedString);
     357                    if (contentsCheck) {
    356358                        console.log(\'content is here hard\');
    357359                        let cpSpan = document.createElement(\'SPAN\');
    358                         cpSpan.setAttribute(\'id\', \'content_pointer_id\');
     360                        cpSpan.classList.add(\'content_pointer_class\');
    359361                        cpSpan.classList.add(\'no-content\');
    360362                        cpSpan.classList.add(\'hard-content\');
     
    364366                        window.jsInputerLaunch = 10;
    365367                       
    366                         contentCheck.prepend(cpSpan);
     368                        contentsCheck.prepend(cpSpan);
    367369                        launchAsyncFunctionLauncher();
    368370                    }   
     
    11191121        }
    11201122    }
    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() {
    11231125            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}
     1144launchAsyncFunctionLauncher();'.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                }
    11241167                $cou1 = 0;
    11251168                global $rfwp_shortcodes;
     
    11341177        overflow: hidden;
    11351178    }
    1136     #content_pointer_id {
     1179    .content_pointer_class {
    11371180        display: block !important;
    11381181        width: 100% !important;
     1182    }
     1183    .rfwp_removedMarginTop {
     1184        margin-top: 0 !important;
     1185    }
     1186    .rfwp_removedMarginBottom {
     1187        margin-bottom: 0 !important;
    11391188    }
    11401189</style>';
     
    11511200                }
    11521201            }
    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             }
    11631202            if (typeof excIdClass==="undefined") {
    11641203                var excIdClass = ["'.$excIdClass.'"];
    1165             }
    1166             if (typeof contentLength==="undefined") {
    1167                 var contentLength = '.$contentLength.';
    1168             } else {
    1169                 contentLength = '.$contentLength.';
    11701204            }
    11711205            if (typeof blockDuplicate==="undefined") {
    11721206                var blockDuplicate = "'.$blockDuplicate.'";
    11731207            }                       
     1208            if (typeof obligatoryMargin==="undefined") {
     1209                var obligatoryMargin = '.intval($obligatoryMargin).';
     1210            }
    11741211            ';
     1212                if (!empty($tagsListForTextLength)) {
     1213                    $scriptingCode .= '
     1214            if (typeof tagsListForTextLength==="undefined") {
     1215                var tagsListForTextLength = ["'.$tagsListForTextLength.'"];
     1216            }                       
     1217            ';
     1218                }
    11751219
    11761220                $k1 = 0;
     
    11801224                        $item = get_object_vars($item);
    11811225                    }
    1182                     if (in_array($item['id'], $usedBlocks)) {
    1183                         $resultHere = 'used';
    1184                     }
    1185                     elseif (in_array($item['id'], $rejectedBlocks)) {
    1186                         $resultHere = 'rejected';
    1187                     }
    11881226//                  $resultHere = in_array($item['id'], $usedBlocks);
    11891227//                  if ($resultHere == false) {
     
    12121250                            $scriptingCode .= 'blockSettingArray[cou1]["maxHeaders"] = 0;'.PHP_EOL;
    12131251                        }
     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                        }
    12141257                        $scriptingCode     .= 'blockSettingArray[cou1]["id"] = \''.$item['id'].'\'; '.PHP_EOL;
    12151258                        if (!empty($rfwp_shortcodes[$item['block_number']])) {
     
    12251268                        $scriptingCode     .= 'blockSettingArray[cou1]["text"] = \'' . $currentItemContent . '\'; ' . PHP_EOL;
    12261269                        $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;
    12271272                        if (!empty($item['elementCss'])) {
    12281273                            $scriptingCode     .= 'blockSettingArray[cou1]["elementCss"] = "'.$item['elementCss'].'"; ' . PHP_EOL;
     
    12481293                        }
    12491294                        $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 block
    1441 //                      $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 repeatable
    1446                             $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 block
    1452                             $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 percentage
    1457                             $scriptingCode .= 'blockSettingArray[cou1]["elementPlace"] = ' . $item['elementPlace'] . '; ' . PHP_EOL;
    1458                         }
    1459                         $scriptingCode .= 'cou1++;'.PHP_EOL;
    14601295                    }
    14611296                }
     
    15461381            $adBlocks = [];
    15471382            $statusFor404 = 'show';
     1383            $showAdsNoElement = 0;
    15481384            $obligatoryMargin = 0;
    15491385            $tagsListForTextLength = null;
    15501386            // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.SchemaChange
    15511387            $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)',
    15531389                    "{$wpPrefix}realbig_settings", "excludedIdAndClasses", "blockDuplicate", "obligatoryMargin",
    1554                 "statusFor404", "tagsListForTextLength"));
     1390                "statusFor404", "showAdsNoElement", "tagsListForTextLength"));
    15551391            if (!empty($realbig_settings_info)) {
    15561392                foreach ($realbig_settings_info AS $k => $item) {
     
    15741410                                $statusFor404 = $item->optionValue;
    15751411                                break;
     1412                            case 'showAdsNoElement':
     1413                                $showAdsNoElement = $item->optionValue;
     1414                                break;
    15761415                        }
    15771416                    }
     
    16231462            $result['excIdClass'] = $excIdClass;
    16241463            $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        }
    16291469    }
    16301470    if (!function_exists('test_sc_oval_exec')) {
     
    18241664            $plugin1 = 'webnavoz-likes/webnavoz-likes.php';
    18251665            if (is_plugin_active($plugin1)) {
    1826                 ?><script><?php include_once (plugin_dir_path(__FILE__).'webnawozComp.js'); ?></script><?php
     1666                ?><script><?php include_once (plugin_dir_path(__FILE__).'assets/js/webnawozComp.js'); ?></script><?php
    18271667            }
    18281668        }
  • realbig-media/trunk/update.php

    r3062761 r3090592  
    245245                'offTags',
    246246                'elementCss',
     247                'showNoElement',
    247248            ];
    248249            try {
Note: See TracChangeset for help on using the changeset viewer.