WP Seasonal Logo Rotator (Auto-Scan Hack)

WP Seasonal Logo Rotator (Auto-Scan Hack) 1.0.0

Sem autorização para baixar
Compatibilidade com XF
  1. 2.3.x
Descrição curta
A lightweight template hack to automatically rotate forum logos for seasons, events, or subtle brand
WP Seasonal Logo Rotator (Auto-Scan Hack)

A lightweight template hack to automatically rotate forum logos for seasons, events, or subtle brand refreshes simply by dropping images into a folder.

No add-ons.
No filename editing.
No maintenance.

What This Does
Scans a logo folder automatically
Selects one image at random on each page load
Updates instantly when images are added or removed
Ideal for seasonal or event-based branding

Installation

1. Create a logo folder

Create this folder on your server:
/styles/season_logos/
2. Add list.php

Create list.php inside the same folder.
PHP:
<?php
header('Content-Type: application/json');
$allowed = ['webp', 'png', 'jpg', 'jpeg', 'gif', 'svg'];
$files = [];
foreach (scandir(__DIR__) as $file) {
    if ($file === '.' || $file === '..' || $file === 'list.php') continue;
    if (in_array(strtolower(pathinfo($file, PATHINFO_EXTENSION)), $allowed, true)) {
        $files[] = $file;
    }
}
echo json_encode($files);
Optional check:
3. Add CSS

Admin Panel → Appearance → Styles → Templates → extra.less
CSS:
.p-header-logo {
    position: relative;
    width: 350px;
    height: 300px;
}
.p-header-logo img {
    visibility: hidden;
}
.p-header-logo::before {
    content: "";
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
Adjust width/height to match your logo.



4. Add JavaScript

Admin Panel → Appearance → Templates → PAGE_CONTAINER
Paste after {$ldJsonHtml|raw}
CÓDIGO:
<script>
(async function () {
    const folderPath = '/styles/season_logos/';
    try {
        const res = await fetch(folderPath + 'list.php');
        if (!res.ok) return;
        const logos = await res.json();
        if (!logos.length) return;
        const logo = logos[Math.floor(Math.random() * logos.length)];
        const style = document.createElement('style');
        style.textContent = `
            .p-header-logo::before {
                background-image: url("${folderPath}${logo}");
            }
        `;
        document.head.appendChild(style);
    } catch (e) {}
})();
</script>
Notes
  • Logo changes on each page load
  • Clear browser cache after setup
  • Mobile sizing may need adjustment in extra.less
  • list.php exposes image filenames only



Disclaimer
This is a simple template hack, not an add-on.
Use only if you are comfortable exposing logo filenames via list.php.
  • Curtir
Reações: l1admin689
Autor
axtona
Visualizações
140
Tipo de extensão
rar
Tamanho do arquivo
489 bytes
Primeiro lançamento
Última atualização
Avaliações 0,00 estrelas 0 avaliações
Link was Broken? Please Enviar mensagem para a equipe NP que vamos ajudá-lo rapidamente!
Apoie o desenvolvedor Se você está satisfeito com o teste ou seu projeto gerou lucro, clique no botão “Mais informações” para apoiar o desenvolvedor comprando.

Mais recursos de axtona

Brazilian Language [PT-BR] A
Like the other available Brazilian Portuguese translation
Visualizações
21
Atualizado
SEO Audit A
SEO Audit 1.1.0
A comprehensive SEO auditing dashboard for XenForo administrators.
Visualizações
34
Atualizado
Galeria de mídia XenForo / XFMG A
Galeria XenForo é um addon oficial do XenForo que permite adicionar uma galeria ao seu XF2

Recursos similares

[021] ChatGPT Autoresponder Türkçe Çeviri Translation A
This is the Turkish translation of the description.
Visualizações
517
Atualizado
German translation for [021] ChatGPT Autoresponder W
the german translation Deutsch (Du) for the [021] ChatGPT Autoresponder add-on
Visualizações
317
Atualizado
Top