dust ultimate two

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » dust ultimate two » Организация » коды


коды

Сообщений 1 страница 2 из 2

1

..

Код:
<!-- своя картинка в каждую категорию -->
<script type="text/javascript">
$(document).ready(function () {

  myarray = new Array(
    "Administration", "https://upforme.ru/uploads/001b/bd/26/2/128243.png",
    "First Of All", "https://upforme.ru/uploads/001b/bd/26/2/128243.png",
    "Sacramento", "https://upforme.ru/uploads/001b/bd/26/2/128243.png",
    "Chat", "https://upforme.ru/uploads/001b/bd/26/2/128243.png",
    "Reclame", "https://upforme.ru/uploads/001b/bd/26/2/128243.png",
    "Archives", "https://upforme.ru/uploads/001b/bd/26/2/128243.png",
  );

  $("#pun-index div.category h2").each(function () {
    for (q = 0; q < myarray.length; q += 2) {
      if ($(this).children("span").text() == myarray[q]) {
        $(this).css({
          "background": "url(" + myarray[q + 1] + ") no-repeat top center",
          "width": "975px",
          "height": "27px",
          "margin-left": "0px",
          "margin-bottom": "-10px",
          "border-radius": "20px 20px 0 0"
        });
      }
    }
  });

  $("#pun-index #pun-stats h2").each(function () {
    for (q = 0; q < myarray.length; q += 2) {
      if ($(this).children("span").text() == myarray[q]) {
        $(this).css({
          "background": "url(" + myarray[q + 1] + ") no-repeat top center",
          "width": "890px",
          "height": "50px",
          "margin-left": "52px",
          "margin-bottom": "-11px",
          "border-radius": "20px 20px 0 0"
        });
      }
    }
  });

});
</script>

Отредактировано Jerry Dust (2026-04-28 20:04:38)

Подпись автора

https://i.imgur.com/5o0dxGP.png
♥️
поле чудес х rich bitch x капсула х  капсула'23
«good morning, reasons why I drink.»

0

2

Код:
<!--------- добавление блока в статистику 
<script type="text/javascript">
(function() {
    let attempts = 30; // Увеличим количество попыток
    
    function findAndWrapItems() {
        // Ищем pun-stats разными способами
        const punStats = document.querySelector('#pun-stats, .pun-stats, [class*="pun-stats"]');
        
        if (!punStats) {
            console.log('❌ pun-stats не найден');
            return false;
        }
        
        console.log('✅ pun-stats найден:', punStats);
        
        // Внутри punStats ищем statscon или любой другой контейнер
        const statscon = punStats.querySelector('.statscon, [class*="statscon"]');
        
        if (!statscon) {
            console.log('❌ statscon не найден внутри pun-stats');
            
            // Если statscon нет, ищем сразу ul.container внутри punStats
            const container = punStats.querySelector('ul.container, .container');
            
            if (!container) {
                console.log('❌ container не найден внутри pun-stats');
                
                // Показываем все что есть внутри punStats для диагностики
                console.log('Содержимое pun-stats:', punStats.innerHTML);
                return false;
            }
            
            console.log('✅ container найден внутри pun-stats');
            return wrapItems(container);
        }
        
        console.log('✅ statscon найден');
        
        // Ищем container внутри statscon
        const container = statscon.querySelector('ul.container, .container');
        
        if (!container) {
            console.log('❌ container не найден внутри statscon');
            return false;
        }
        
        console.log('✅ container найден внутри statscon');
        return wrapItems(container);
    }
    
    function wrapItems(container) {
        // Проверяем, не обернуты ли уже элементы
        if (container.querySelector('div.statscommonblock')) {
            console.log('✅ Элементы уже обернуты');
            return true;
        }
        
        // Ищем элементы item1, item2, item3, item4
        const itemsToWrap = [];
        
        // Проверяем все li внутри container
        const allItems = container.querySelectorAll('li');
        console.log(`Найдено li элементов: ${allItems.length}`);
        
        // Показываем все классы для диагностики
        allItems.forEach(li => {
            console.log('Найден li с классами:', li.className);
            
            // Проверяем разные варианты классов
            const classStr = li.className;
            if (classStr.includes('item1') || classStr.includes('item-1') || classStr.includes('item_1')) {
                itemsToWrap.push(li);
            } else if (classStr.includes('item2') || classStr.includes('item-2') || classStr.includes('item_2')) {
                itemsToWrap.push(li);
            } else if (classStr.includes('item3') || classStr.includes('item-3') || classStr.includes('item_3')) {
                itemsToWrap.push(li);
            } else if (classStr.includes('item4') || classStr.includes('item-4') || classStr.includes('item_4')) {
                itemsToWrap.push(li);
            }
        });
        
        console.log(`Найдено элементов для обертки: ${itemsToWrap.length}`);
        
        if (itemsToWrap.length >= 4) {
            // Берем первые 4 элемента
            const firstFour = itemsToWrap.slice(0, 4);
            
            const statsBlock = document.createElement('div');
            statsBlock.className = 'statscommonblock';
            
            // Вставляем блок перед первым элементом
            container.insertBefore(statsBlock, firstFour[0]);
            
            // Перемещаем элементы
            firstFour.forEach(item => {
                statsBlock.appendChild(item);
            });
            
            console.log('✅ Обертка выполнена успешно!');
            console.log('Новая структура создана');
            return true;
        }
        
        return false;
    }
    
    // Функция для поиска в комментариях (если элементы скрыты в noindex)
    function searchInComments() {
        // Проходим по всем комментариям на странице
        const walker = document.createTreeWalker(
            document.body,
            NodeFilter.SHOW_COMMENT,
            null,
            false
        );
        
        let node;
        while (node = walker.nextNode()) {
            const comment = node.nodeValue;
            if (comment.includes('pun-stats') || comment.includes('statscon')) {
                console.log('Найден комментарий с нужным содержимым:', comment);
                return true;
            }
        }
        return false;
    }
    
    // Пытаемся выполнить сразу
    if (!findAndWrapItems()) {
        console.log(`🔄 Будем пробовать ${attempts} раз с интервалом 500ms`);
        searchInComments();
        
        let attemptCount = 0;
        const interval = setInterval(function() {
            attemptCount++;
            console.log(`\n--- Попытка #${attemptCount} ---`);
            
            if (findAndWrapItems() || attemptCount >= attempts) {
                clearInterval(interval);
                if (attemptCount >= attempts) {
                    console.log('❌ Превышено количество попыток. Элементы не найдены.');
                }
            }
        }, 500);
    }
})();
</script>----->
Подпись автора

https://i.imgur.com/5o0dxGP.png
♥️
поле чудес х rich bitch x капсула х  капсула'23
«good morning, reasons why I drink.»

0


Вы здесь » dust ultimate two » Организация » коды


Рейтинг форумов | Создать форум бесплатно