403Webshell
Server IP : 188.114.96.3  /  Your IP : 216.73.216.143
Web Server : Apache
System : Linux sv058.home.net.pl 6.8.2 husak_dirty_pages_fix #1 SMP PREEMPT_DYNAMIC Tue Apr 2 22:06:51 CEST 2024 x86_64
User :  ( 3194769)
PHP Version : 8.5.12
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /polana/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /polana/includes/social.php
<?php
declare(strict_types=1);

function social_networks(): array
{
    return [
        'instagram_url' => ['label' => 'Instagram', 'icon' => 'instagram'],
        'facebook_url' => ['label' => 'Facebook', 'icon' => 'facebook'],
        'tiktok_url' => ['label' => 'TikTok', 'icon' => 'tiktok'],
        'youtube_url' => ['label' => 'YouTube', 'icon' => 'youtube'],
        'x_url' => ['label' => 'X', 'icon' => 'x'],
        'pinterest_url' => ['label' => 'Pinterest', 'icon' => 'pinterest'],
        'linkedin_url' => ['label' => 'LinkedIn', 'icon' => 'linkedin'],
        'tripadvisor_url' => ['label' => 'Tripadvisor', 'icon' => 'tripadvisor'],
        'google_maps_url' => ['label' => 'Google Maps', 'icon' => 'maps'],
    ];
}

function social_icon_svg(string $icon): string
{
    return match ($icon) {
        'instagram' => '<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3.2" y="3.2" width="17.6" height="17.6" rx="5" fill="none" stroke="currentColor" stroke-width="2"/><circle cx="12" cy="12" r="4" fill="none" stroke="currentColor" stroke-width="2"/><circle cx="17.4" cy="6.6" r="1.15" fill="currentColor"/></svg>',
        'facebook' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M14.4 8.1h3.2V4.2c-.55-.08-2.43-.22-4.66-.22-4.65 0-7.84 2.84-7.84 8.06v4.5H1.83V21h3.27v11h5.4V21h4.23l.67-4.44h-4.9v-4.06c0-1.28.35-2.16 2.18-2.16h2.72V8.1z" transform="scale(.65) translate(5.2 1.2)"/></svg>',
        'tiktok' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M14.4 3v10.1a4.4 4.4 0 1 1-3.2-4.24v2.68a1.85 1.85 0 1 0 .7 1.46V3h2.5c.42 2.18 1.75 3.7 4.1 4.28v2.52a7.14 7.14 0 0 1-4.1-1.62V3z"/></svg>',
        'youtube' => '<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="2.5" y="5.5" width="19" height="13" rx="4" fill="none" stroke="currentColor" stroke-width="2"/><path fill="currentColor" d="M10 9.1v5.8l5-2.9z"/></svg>',
        'x' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M5.2 4h3.9l3.65 4.87L16.95 4H19l-5.3 6.15L19.6 20h-3.9l-4.1-5.47L6.9 20H4.85l5.8-6.73L5.2 4zm2.55 1.55 8.73 12.9h1.37L9.13 5.55H7.75z"/></svg>',
        'pinterest' => '<svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0a8 8 0 0 0-2.91 15.45c-.07-.63-.13-1.6.03-2.3l.75-3.18s-.19-.38-.19-.95c0-.89.52-1.56 1.16-1.56.55 0 .81.41.81.9 0 .55-.35 1.37-.53 2.13-.15.64.32 1.15.95 1.15 1.14 0 2.01-1.2 2.01-2.93 0-1.53-1.1-2.6-2.67-2.6-1.82 0-2.89 1.37-2.89 2.78 0 .55.21 1.14.48 1.46.05.06.06.12.04.18-.05.2-.16.64-.18.73-.03.12-.09.14-.21.09-.79-.37-1.29-1.52-1.29-2.45 0-1.99 1.45-3.82 4.17-3.82 2.19 0 3.89 1.56 3.89 3.64 0 2.18-1.37 3.93-3.27 3.93-.64 0-1.24-.33-1.45-.72l-.39 1.5c-.14.55-.53 1.24-.78 1.65A8 8 0 1 0 8 0z"/></svg>',
        'linkedin' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M5.4 8.2H2V21h3.4V8.2zM3.7 3A2 2 0 1 0 3.7 7a2 2 0 0 0 0-4zM21 13.65c0-3.85-2.05-5.64-4.8-5.64-2.2 0-3.2 1.21-3.76 2.06V8.2H9.05V21h3.39v-6.34c0-1.67.32-3.29 2.39-3.29 2.04 0 2.07 1.91 2.07 3.4V21H21v-7.35z"/></svg>',
        'tripadvisor' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" d="M3.5 10.2 1.8 8.5h4.1M20.5 10.2l1.7-1.7h-4.1M8.3 8.4 12 6.3l3.7 2.1"/><circle cx="7.2" cy="13.1" r="4.1" fill="none" stroke="currentColor" stroke-width="1.9"/><circle cx="16.8" cy="13.1" r="4.1" fill="none" stroke="currentColor" stroke-width="1.9"/><circle cx="7.2" cy="13.1" r="1.15" fill="currentColor"/><circle cx="16.8" cy="13.1" r="1.15" fill="currentColor"/><path fill="currentColor" d="m12 15.2 1.5 2.2h-3z"/></svg>',
        'maps' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M12 21s6-5.7 6-11a6 6 0 1 0-12 0c0 5.3 6 11 6 11z"/><circle cx="12" cy="10" r="2.2" fill="currentColor"/></svg>',
        default => '<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8" fill="none" stroke="currentColor" stroke-width="2"/></svg>',
    };
}

function social_links(): array
{
    $links = [];

    foreach (social_networks() as $key => $meta) {
        $url = trim(setting($key, ''));

        if ($url !== '') {
            $links[] = [
                'key' => $key,
                'url' => $url,
                'label' => $meta['label'],
                'icon' => $meta['icon'],
            ];
        }
    }

    return $links;
}

function has_social_links(): bool
{
    return social_links() !== [];
}

function render_social_links(string $class = ''): void
{
    $links = social_links();

    if (!$links) {
        return;
    }
    ?>
    <div class="social-links <?= e($class) ?>" aria-label="Social media">
        <?php foreach ($links as $link): ?>
            <a
                class="social-link social-<?= e(str_replace('_url', '', $link['key'])) ?>"
                href="<?= e($link['url']) ?>"
                target="_blank"
                rel="noopener noreferrer"
                aria-label="<?= e($link['label']) ?>"
                title="<?= e($link['label']) ?>"
            >
                <?= social_icon_svg($link['icon']) ?>
            </a>
        <?php endforeach; ?>
    </div>
    <?php
}

Youez - 2016 - github.com/yon3zu
LinuXploit