Supreme7 / Hardverapro 2025 by Supreme7

// ==UserScript==
// @name         Hardverapro 2025 by Supreme7
// @namespace    https://hardverapro.hu/tag/supreme7.html
// @version      1.0
// @description  Hardverapro finomhangolás
// @author       SUPREME7
// @include      *hardverapro.hu*
// @grant        GM_xmlhttpRequest
// @grant        GM_setValue
// @grant        GM_getValue
// @require  https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    var $ = window.jQuery;//OR

    // BEÁLLÍTÁSOK

    // Hirdetés szövegének előnézete funkció hozzáadás
    var uadPreview = GM_getValue("s7_uad_preview", null);

     // Profi Üzleti hirdetések elrejtése
    var hideBusinessUsers = GM_getValue("s7_hide_business_users", null);

    // Hirdetők letiltása
    var hideUsers = GM_getValue("s7_hide_users", null);

    // Letiltott hirdetők felhasználónevei
    ////////////////////////////////
    /// ADD MEG A BLOKKOLT HIRDETŐK NEVEIT
    ////////////////////////////////
    var hidden_users = ["Hirdető1", "Hirdető2"];

    ////////////////////////////////


    if($(".uad-list").length && hideUsers == 1){

        $(".uad-list ul li").each(function() {


            var nick = $(this).find(".uad-user-text").find("a").first().text();
            var title = $(this).find(".uad-col-title").find("a").first().text();
            var isBusinessUser = $(this).hasClass('uad-business-user');

            if (jQuery.inArray(nick, hidden_users) != -1) {

                console.log(nick + " hirdetése elrejtve. ("+title+") ")
                $(this).hide();

            }


            if (hideBusinessUsers && isBusinessUser) {

                console.log(nick + " Profi üzleti hirdető elrejtve. ("+title+") ")
                $(this).hide();

            }
        });

    }


    // Felhasználó menü hozzáadása jobb oldali boxhoz

    var userName = $(".dropdown-menu").find("h6").find("a").html();
    var userFace = $(".dropdown-user").find(".user-face").find("img").attr('src');
    var private_msg = $(".dropdown-user").find("a[href='/privatok/listaz.php']").html();

    $( "#right" ).prepend( "<div class='user-menu-list user-thread-list'><div class='card card-forum'><div class='card-header'>Saját menü</div>"
                          +"<li class='list-group-item'><img src='"+userFace+"'> "+userName+"</li> "
                          +"<li class='list-group-item'> <a href='/privatok/listaz.php'>"+ private_msg +"</a></li>"
                          + "<li class='list-group-item'><span class='fas fa-tags fa-fw'></span> <a href='/hirdetesfeladas/listaz.php'>Hirdetéseim kezelése</a></li>"
                          + "<li class='list-group-item'><span class='fas fa-exclamation-circle fa-fw'></span> <a href='/jelentesek/index.html'>Jelentéseim</a></li>"
                          + "</div>"
                          + "<div class='user-menu-list user-thread-list'><div class='card card-forum'><div class='card-header'>S7#HA beállítások</div>"
                          + "<li class='list-group-item'><div class='form-check'><label><input type='checkbox' id='s7_uad_preview' "+ (uadPreview == 1 ? 'checked' : '' ) +"><span class='check-indicator'></span> Lenyíló hírdetés előnézet?</label></div></li>"
                          + "<li class='list-group-item'><div class='form-check'><label><input type='checkbox' id='s7_hide_users' "+ (hideUsers == 1 ? 'checked' : '' ) +"><span class='check-indicator'></span> Meghatározott hirdetők hirdetéseinek elrejtése?</label></div></li>"
                          + "<li class='list-group-item'><div class='form-check'><label><input type='checkbox' id='s7_hide_business_users' "+ (hideBusinessUsers == 1 ? 'checked' : '' ) +"><span class='check-indicator'></span> Profi üzleti hirdetők elrejtése</label></div></li>"
                          + (hideUsers == 1 ? "<li class='list-group-item' style='padding: 10px 0px 10px 10px'> <span class='fas fa-user fa-fw'></span> <b>Elrejtett hirdetők</b>: "+ hidden_users.join(", ") +"</li>" : "")
                          + "</div>"
                         );


    // S7 beállítások


    // Előnézet
    $('#s7_uad_preview').change(function() {

        var returnVal;

        if(this.checked) {

            $(this).prop("checked", true);
            GM_setValue("s7_uad_preview", true);

        }else{


            $(this).prop("checked", false);
            GM_setValue("s7_uad_preview", false);

        }

        location.reload();
    });


    // Hirdetők elrejtése

    $('#s7_hide_users').change(function() {

        var returnVal;

        if(this.checked) {

            $(this).prop("checked", true);
            GM_setValue("s7_hide_users", true);

        }else{


            $(this).prop("checked", false);
            GM_setValue("s7_hide_users", false);

        }

        location.reload();
    });

     // Profi üzleti hirdetők elrejtése
    $('#s7_hide_business_users').change(function() {

        var returnVal;

        if(this.checked) {

            $(this).prop("checked", true);
            GM_setValue("s7_hide_business_users", true);

        }else{


            $(this).prop("checked", false);
            GM_setValue("s7_hide_business_users", false);

        }

        location.reload();
    });




    if(uadPreview == 1){

        $( ".uad-list" ).find("ul").find("li").each(function( index ) {

            var uadId = $(this).attr("data-uadid");
            var uadURL = $(this).find(".uad-col-title").find("a").attr("href");
            if(typeof uadId === 'undefined'){

                return;
            }
            $(this).append("<div class='uad-col uad-col-icons' style='display: flex !important; border-left: solid 1px #ddd;'><span class=' fa fa-chevron-down text-muted uad-content-load' style=' float: left; margin-left: 10px; cursor: pointer;' uad-id='"+ uadId +"' uad-url='"+ uadURL +"'></span></div>");

        });
    }

    // Lenyíló leírás
    $(".uad-content-load").click(function(e){
        e.preventDefault();
        var uadId = $(this).attr("uad-id");
        var uadURL = $(this).attr("uad-url");

        if($(".uad-id-"+ uadId +"").length){

            $(".uad-id-"+ uadId +"").slideToggle('500','linear');

        }else{

            $(this).parents(':eq(1)').after("<div class=' card-body uad-content uad-id-"+ uadId +"' style='background-color: #ffeee4; border-left: 4px solid #827a6b; -webkit-box-shadow: inset 1px 3px 8px -6px #000000; box-shadow: inset 1px 3px 8px -6px #000000;'><img style='max-width: 20px;' src='https://cdn.rios.hu/dl/upc/2025-09/05/117454_ogw83fzb4c70mxjq_ajax-loader_2.gif'></div>");

            GM_xmlhttpRequest({
                method: "POST",
                url: uadURL,
                headers: {
                    "Content-Type": "application/x-www-form-urlencoded"
                },

                onload: function(response) {


                    var responseText = response.responseText;
                    var uadText = $(responseText).find('.uad-content').html();


                    var images;

                    $(".uad-id-"+ uadId +"").html("<div style='display: block; margin-top: 20px;'>"+uadText+"</div>");
                    $(".uad-id-"+ uadId +"").prepend('<div class="images"></div>');

                    $(responseText).find('.carousel-item').each(function() {

                        var imageUrl = $(this).find('img').attr('src');
                        $(".uad-id-"+ uadId +"").find('.images').prepend('<a href="'+imageUrl+'" target="_blank"><img style=" max-height: 135px; max-width: 25%; margin: 2px ; border: 1px dotted #555; padding: 2px;" src="'+imageUrl+'" style=""></a>');

                    });

                    $(".uad-id-"+ uadId +"").find('.fakebook').hide();



                }
            });
        }

    });


})();