Jump to content

Iconite Yahoo,google ( Guests


Go to solution Solved by gadeas,

Recommended Posts

Posted

pai mergi in ftp public/style_extra/search_engine/Google.png

Si pentru yahoo /public/style_extra/search_engine/Yahoo.png

+1 :o3

Am incercat si treaba asta si degeaba

  • Moderators
  • Solution
Posted

Momentan am sa las solutia mea, nu stiu daca este tutorial sau daca exista ceva hook, dar na, mai simplu imi fac eu singur.

 

Cum arata:

51nHKZ2.png

 

Cum se face:

In globalTemplate inainte de:

</head>

Adauga urmatoru cod:

<script>
jQuery(document).ready(function($) {
    var element = 'p:not(#mot_body) span.name';
    $(element).each(function () {
        var text = $(this).text();
        var isComma = text.slice(-1);
        var imageGoogle = '<img src="http://www.html5rocks.com/static/images/google_logo_small.png" alt="google" />';
        var imageYahoo  = '<img src="http://www.wsadirectory.com/images/yahoo.png" alt="Yahoo" />';
        var imageBing   = '<img src="http://www.wsadirectory.com/images/bing.png" alt="Bing" />';

        /* Google */
        if (text == 'Google' || text == 'Google,') {
            $(this).html((isComma == ',') ? imageGoogle + ',' : imageGoogle);
        }

        /* Yahoo */
        if (text == 'Yahoo' || text == 'Yahoo,') {
            $(this).html((isComma == ',') ? imageYahoo + ',' : imageYahoo);
        }

        /* Bing */
        if (text == 'Bing' || text == 'Bing,') {
            $(this).html((isComma == ',') ? imageBing + ',' : imageBing);
        }
    });
});
</script>

Schimba imaginile ( doar ce e intre src ) cum crezi ca vrei sa fie la:

var imageGoogle = '<img src="http://www.html5rocks.com/static/images/google_logo_small.png" alt="google" />';
var imageYahoo  = '<img src="http://www.wsadirectory.com/images/yahoo.png" alt="Yahoo" />';
var imageBing   = '<img src="http://www.wsadirectory.com/images/bing.png" alt="Bing" />';

In rest, sint sigur ca se putea face mai scurt prin alta metoda, dar na, macar apar imaginiile si verifica putin daca exista sau nu , dupa.

  • Upvote 1

PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.