AnonSec Team
AnonSec Team
Server IP : 149.13.87.7  /  Your IP : 185.174.145.2
Web Server : nginx
System : Linux h2 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User : root ( 0)
PHP Version : 8.0.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /mnt/platforms/workspaces/shortable.org/../allaboutarea.com/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /mnt/platforms/workspaces/shortable.org/../allaboutarea.com/ContentEdit.php
<?php
    $config_file = './config.json';
    $config = json_decode(file_get_contents($config_file), true);

    $section_order_values = array(1, 2, 3, 4, 5);
    shuffle($section_order_values);


    // End Randomize style

    // Brand Name
    $brandName = $config['brand_name'];
    $brand_email = $config['brand_email'];
    $brand_address = $config['brand_address'];
    $brand_phone = $config['brand_phone'];
    $brand_domain = $config['brand_domain'];
    $brandCls = str_replace(' ', '-', $brandName);

    $section_1_format = $config["section_1_format"];
    $section_2_format = $config["section_2_format"];
    $section_3_format = $config["section_3_format"];

    $vertical = $config["niche"];

    session_start();

    if (!isset($_SESSION['brandname_index'])) {
        $_SESSION['brandname_index'] = rand(0, strlen($brandName) - 1);
    }
    //$brandNameWithSpan = substr_replace('shortable.org', '<span class="brandLogoChar">', $_SESSION['brandname_index'], 0) . '</span>';
$brandNameWithSpan = substr_replace('shortable.org', '', $_SESSION['brandname_index'], 0) . '';


    // Hero Section

    $titleIndex = $config['titleIndex'];
    $descIndex = $config['descIndex'];
    $buttonIndex = $config['heroBtnIndex'];
    $heroImageIndex = $config['heroImageIndex'];
    $heroPatternIndex = $config['heroPatternIndex'];
    
    $titleData = json_decode(file_get_contents('./assets/db/Hero/'.$vertical.'/Hero-titles.json'), true);
    $descData = json_decode(file_get_contents('./assets/db/Hero/'.$vertical.'/Hero-description.json'), true);
    $buttonData = json_decode(file_get_contents('./assets/db/Hero/'.$vertical.'/Hero-button.json'), true);
    $randomTitle = str_replace('[BrandName]', $brandName, $titleData['heroTitle'][$titleIndex]);
    $randomDesc = str_replace('[BrandName]', $brandName, $descData['heroDescription'][$descIndex]);
    $randomButton = $buttonData['heroButton'][$buttonIndex];
    
    // End Hero Section

    //Section 1
    
    $section1_CTA_index = $config['section_1_CTA_index'];
    $section1_CTA_Data = json_decode(file_get_contents('./assets/db/Section-1/'.$vertical.'/cta.json'), true);
    $randomSection1_CTA = $section1_CTA_Data['cta'][$section1_CTA_index];

    $section_1_Paragraph_index = $config['section_1_Paragraph_index'];
    $section1_Paragraph_Data = json_decode(file_get_contents('./assets/db/Section-1/'.$vertical.'/paragraph.json'), true);
    $randomSection1_Paragraph = $section1_Paragraph_Data['section1_Paragraph'][$section_1_Paragraph_index];
    
    $section_1_Title_index = $config['section_1_Title_index'];
    $section1_Title_Data = json_decode(file_get_contents('./assets/db/Section-1/'.$vertical.'/title.json'), true);
    $randomSection1_Title = $section1_Title_Data['section1_Title'][$section_1_Title_index];
    
    $section_1_Subheading_index = $config['section_1_Subheading_index'];
    $section_1_Subheading_Data = json_decode(file_get_contents('./assets/db/Section-1/'.$vertical.'/sub-heading.json'), true);
    $randomSection1_Subheading = $section_1_Subheading_Data['sub-heading'][$section_1_Subheading_index];

    $section_1_img_index = $config['section_1_img_index'];

    //End Section 1

    // Section 2

    $section2_CTA_index = $config['section_2_CTA_index'];
    $section2_CTA_Data = json_decode(file_get_contents('./assets/db/Section-2/'.$vertical.'/cta.json'), true);
    $randomSection2_CTA = $section2_CTA_Data['cta'][$section2_CTA_index];

    $section_2_Paragraph_index = $config['section_2_Paragraph_index'];
    $section2_Paragraph_Data = json_decode(file_get_contents('./assets/db/Section-2/'.$vertical.'/paragraph.json'), true);
    $randomSection2_Paragraph = $section2_Paragraph_Data['section2_Paragraph'][$section_2_Paragraph_index];
    
    $section_2_Title_index = $config['section_2_Title_index'];
    $section2_Title_Data = json_decode(file_get_contents('./assets/db/Section-2/'.$vertical.'/title.json'), true);
    $randomSection2_Title = $section2_Title_Data['section2_Title'][$section_2_Title_index];
    
    $section_2_Subheading_index = $config['section_2_Subheading_index'];
    $section_2_Subheading_Data = json_decode(file_get_contents('./assets/db/Section-2/'.$vertical.'/sub-heading.json'), true);
    $randomSection2_Subheading = $section_2_Subheading_Data['sub-heading'][$section_2_Subheading_index];

    $section_2_img_index = $config['section_2_img_index'];

    // End Section 2
    
    // Section 3

    $section3_CTA_index = $config['section_3_CTA_index'];
    $section3_CTA_Data = json_decode(file_get_contents('./assets/db/Section-3/'.$vertical.'/cta.json'), true);
    $randomSection3_CTA = $section3_CTA_Data['cta'][$section3_CTA_index];

    $section_3_Paragraph_index = $config['section_3_Paragraph_index'];
    $section3_Paragraph_Data = json_decode(file_get_contents('./assets/db/Section-3/'.$vertical.'/paragraph.json'), true);
    $randomSection3_Paragraph = $section3_Paragraph_Data['section3_Paragraph'][$section_3_Paragraph_index];
    
    $section_3_Title_index = $config['section_3_Title_index'];
    $section3_Title_Data = json_decode(file_get_contents('./assets/db/Section-3/'.$vertical.'/title.json'), true);
    $randomSection3_Title = $section3_Title_Data['section3_Title'][$section_3_Title_index];
    
    $section_3_Subheading_index = $config['section_3_Subheading_index'];
    $section_3_Subheading_Data = json_decode(file_get_contents('./assets/db/Section-3/'.$vertical.'/sub-heading.json'), true);
    $randomSection3_Subheading = $section_3_Subheading_Data['sub-heading'][$section_3_Subheading_index];

    $section_3_img_index = $config['section_3_img_index'];

    // End Section 3
    
    // Switch columns

    $contact_title_index = $config['contact_title_index'];
    $contact_title = $config['contact_title_index'];
    $contact_title_Data = json_decode(file_get_contents('./assets/db/Contact/title.json'), true);
    $randomContactTitle = $contact_title_Data['contact_title'][$contact_title_index];

    if (isset($config['section_1_switch_columns']) && $config['section_1_switch_columns'] === 'y')
        $section1_row_class = 'row align-items-center flex-row-reverse';
    else 
        $section1_row_class = 'row align-items-center';
    
    
    if (isset($config['section_2_switch_columns']) && $config['section_2_switch_columns'] === 'y')
        $section2_row_class = 'row align-items-center flex-row-reverse';
    else 
        $section2_row_class = 'row align-items-center';


    if (isset($config['section_3_switch_columns']) && $config['section_3_switch_columns'] === 'y')
        $section3_row_class = 'row align-items-center flex-row-reverse';
    else 
        $section3_row_class = 'row align-items-center';
    
    
    $hero_row_class = "";
    if (isset($config['hero_switch_columns']) && $config['hero_switch_columns'] === 'y')
        $hero_row_class = 'flex-row-reverse text-end';


    // Sections ordering
    
    $config = json_decode(file_get_contents('config.json'), true);
    
    $section1_order = $config['section1_order'];
    $section2_order = $config['section2_order'];
    $section3_order = $config['section3_order'];
    $section4_order = $config['section4_order'];
    $section5_order = $config['section5_order'];
    
    $sections = [
        $section1_order => 'about-us',
        $section2_order => 'our-services',
        $section3_order => 'section-3',
        $section4_order => 'contact-us',
        $section5_order => 'newsletter-form'
    ];
  
    ksort($sections);

    // Button Radius

    $btn_roundness_index = $config['btn_roundness'];
    $btn_roundness_Data = json_decode(file_get_contents('./assets/db/Styles/CTA/btnRoundness.json'), true);
    $randomBtnRoundness = $btn_roundness_Data['btn_roundness'][$btn_roundness_index];

    // CTA Text transform

    $cta_text_transform_index = $config['cta_text_transform'];
    $cta_text_transform_Data = json_decode(file_get_contents('./assets/db/Styles/CTA/btnTextTransform.json'), true);
    $randomBtnTextTransform = $cta_text_transform_Data['cta_text_transform'][$cta_text_transform_index];
    
    // Newsletter format

    $newsletter_format_index = $config['newsletter_format'];
    $newsletter_format_Data = json_decode(file_get_contents('./assets/db/Components/Newsletter/Newsletter.json'), true);
    $randomNewsletterFormat = $newsletter_format_Data['newsletter_format'][$newsletter_format_index];

    // Navbar format

    $navbar_format_index = $config['navbar_format'];
    $navbar_format_Data = json_decode(file_get_contents('./assets/db/Components/Navbar/format.json'), true);
    $RandomNavbarFormat = $navbar_format_Data['navbar_format'][$navbar_format_index];
   
    // Footer format

    $footer_format_index = $config['footer_format'];
    $footer_format_Data = json_decode(file_get_contents('./assets/db/Components/Footer/format.json'), true);
    $RandomFooterFormat = $footer_format_Data['footer_format'][$footer_format_index];
    
    // Hero format

    $hero_format_index = $config['hero_format'];
    
    // Contact format

    $contact_format_index = $config['contact_format'];
    $contact_format_Data = json_decode(file_get_contents('./assets/db/Contact/format.json'), true);
    $randomContactFormat = $contact_format_Data['contact_format'][$contact_format_index];
    
    // Text Aligns

    $text_align_index = $config['text_align'];
    $text_align_Data = json_decode(file_get_contents('./assets/db/Components/Hero/text-aligns.json'), true);
    $randomTextAlign = $text_align_Data['text_align'][$text_align_index];
    $align = $randomTextAlign['align'];
    $align_pd = $randomTextAlign['pd'];
    
    // Body Font Style

    $randomBodyFontIndex = $config["body_fonts"];
    $body_fonts_Data = json_decode(file_get_contents('./assets/db/Styles/Fonts/BodyFonts.json'), true);

    $body_fonts_filtered = array_filter($body_fonts_Data['body_fonts'], function($font) use ($vertical) {
        $font_verticals = explode(',', $font['font_vertical']);
        return in_array(strtolower($vertical), array_map('trim', $font_verticals));
    });
    
    $selectedBodyFonts = array_values($body_fonts_filtered);
    $randomBodyFont = $selectedBodyFonts[$randomBodyFontIndex];
    
    $font_link = $randomBodyFont['font_link'];
    $font_family = $randomBodyFont['font_family'];    
    
    // Theme color
    
    $theme_color_index = $config['theme_color'];
    $theme_color_Data = json_decode(file_get_contents('./assets/db/Styles/ThemeColor.json'), true);
    
    $theme_colors_filtered = array_filter($theme_color_Data['theme_color'], function($color) use ($vertical) {
        $color_verticals = explode(',', $color['color_vertical']);
        return in_array(strtolower($vertical), array_map('trim', $color_verticals));
    });
    
    $selectedThemeColor = array_values($theme_colors_filtered);
    $randomThemeColor = $selectedThemeColor[$theme_color_index];

    $primary_color = $randomThemeColor['primary_color'];
    $secondary_color = $randomThemeColor['secondary_color'];
    $hover_color = $randomThemeColor['hover_color'];
    
    // Hero Background color

    $hero_bg_color_index = $config['hero_bg_color'];
    $hero_bg_color_Data = json_decode(file_get_contents('./assets/db/Components/Hero/background-color.json'), true);
    $randomHeroBgColor = $hero_bg_color_Data['hero_bg_color'][$hero_bg_color_index];
    $hero_bg_color = $randomHeroBgColor['background'];
    $hero_color = $randomHeroBgColor['color'];
    $hero_bg_type = $randomHeroBgColor['bg_type'];

    if (!isset($_SESSION['hero_height'])) {
        $hero_height = rand(580, 720);
        $_SESSION['hero_height'] = $hero_height;
    } else {
        $hero_height = $_SESSION['hero_height'];
    }

    $lightColors = [
        "#DCE5DE", "#E1E8F1", "#CFDEE3", "#E8E6F0", "#F8E2D2", "#EDEEE9", "#CBF0EB", "#D2E2EF", "#E9E9E9", "#E5F0E0", "#F4F1E8", "#D0E1EA", "#E3E9F0", "#EEEECB", "#CEE9F2", "#E0F0E6", "#D6E1E7", "#5B83A0", "#FCF5DC", "#C3E7F3", "#EAF4D1", "#C9EAF0", "#BDEAF6", "#E1E3EB", "#DBE8F0", "#ACC2C7", "#F1D9D7", "#C5DEED", "#E2C6B1", "#AFDFDB", "#DFCFF2", "#A4B3D7", "#F2ECD9"
    ];

    if (!isset($_SESSION['randomLightColor'])) {
        $randomLightColorIndex = array_rand($lightColors);
        $randomLightColor = $lightColors[$randomLightColorIndex];
        $_SESSION['randomLightColor'] = $randomLightColor;
    } else {
        $randomLightColor = $_SESSION['randomLightColor'];
    }

    $randomHeroSmallImgIndex = $config["randomHeroSmallImgIndex"];

    function getRandomServiceIndices($count) {
        if (!isset($_SESSION['indices'])) {
            $config_file = './config.json';
            $config = json_decode(file_get_contents($config_file), true);
            $services_content_Data = json_decode(file_get_contents('./assets/db/Services-icons/'.$config["niche"].'/content.json'), true);
            $services_count = count($services_content_Data['services_content']) - 1;
            $indices = range(0, $services_count);
            shuffle($indices);
            $_SESSION['indices'] = $indices;
        } else {
            $indices = $_SESSION['indices'];
        }
        return array_slice($indices, 0, $count);
    }
    
    function getRandomService($index) {
        $config_file = './config.json';
        $config = json_decode(file_get_contents($config_file), true);        
        $services_content_Data = json_decode(file_get_contents('./assets/db/Services-icons/'.$config["niche"].'/content.json'), true);
        return $services_content_Data['services_content'][$_SESSION['indices'][$index]];
    }
    
    $services_main_title_index = $config['services_main_title'];
    $services_main_title_Data = json_decode(file_get_contents('./assets/db/Services-icons/'.$config["niche"].'/main-titles.json'), true);
    $randomServiceMaintitle = $services_main_title_Data['services_main_title'][$services_main_title_index];   

?>

AnonSec - 2021