Статусы пользователей в Комментариях
Данный скрипт выводит статус пользователя в комментариях. Данный хак был уже выложен на этом сайте, Но многие пользователи хотели, чтобы кроме online показывало и offline. Вот я и решил улучшить его. Вот описание с той версии скрипта: Очень давно все мы говорили, что за подобное uCoz дает бан, Но нашелся же выход и тут мы обошлись только лишь одним $.get-запросом. Установка: 1) Зайти в ПУ » Комментарии » Вид комментариев, там где хотите видеть статус вставьте: | Код <div class="statusOnline">ONLINE</div> <div id="idad-<?substr($PROFILE_URL$,strpos($PROFILE_URL$,'index')+8,strpos(substr($PROFILE_URL$,strpos($PROFILE_URL$,'index')+8),'" ta'))?>" class="statusOffline">OFFLINE</div> <div style="display:none; text-align:center; color:green;" class="stati">0)?><?substr($PROFILE_URL$,0,-16)?>$PROFILE_URL$</div> 2) На страницу материала и комментариев к нему, в самый конец: Код <script type="text/javascript"> $.get('/index/62', function(d){ // uSite.su var dll = $('cmd[p="content"]',d).text(); $('a',dll).each(function(){ var tik = $(this).attr('href'); var idik = tik.replace("http://АДРЕС_САЙТА/index/8", "idad"); $('.stati').each(function(){ if($(this).text() == tik){ $(this).html('<style>#'+idik+' {display:none;}</style><div class="statusOnline">ONLINE</div>').show(); } }); }); }); </script>[/cpde]<br>|<br></span><span style="color: rgb(136, 117, 106); font-family: 'Times New Roman'; font-size: 16px; background-color: rgb(255, 255, 255);">И в этом коде вы должны вместо АДРЕС_САЙТА вставить адрес вашего сайта </span><br style="color: rgb(136, 117, 106); font-family: 'Times New Roman'; font-size: 16px; background-color: rgb(255, 255, 255);"><br style="color: rgb(136, 117, 106); font-family: 'Times New Roman'; font-size: 16px; background-color: rgb(255, 255, 255);"><span style="color: rgb(136, 117, 106); font-family: 'Times New Roman'; font-size: 16px; background-color: rgb(255, 255, 255);">3) Этот пункт необязателен - тут мы украсим надписи online и offline </span><br style="color: rgb(136, 117, 106); font-family: 'Times New Roman'; font-size: 16px; background-color: rgb(255, 255, 255);"><span style="color: rgb(136, 117, 106); font-family: 'Times New Roman'; font-size: 16px; background-color: rgb(255, 255, 255);">В Таблицу стилей(CSS) вставить код: <br> Код .statusOnline { <br> width:80px; <br> background:#7BA60D; <br> border-radius:3px; <br> font-size:10px; <br> text-transform:uppercase; <br> color:#FFF; <br> border-top:1px solid #97CD6B; <br> border-bottom:1px solid #488019; <br> background-image:url(/img/highlight.png); <br> text-shadow:rgba(0,0,0,0.2) 0 -1px 0; <br> margin:3px 3px 0; <br> padding:0 5px; <br> } <br><br> .statusOffline { <br> border:1px solid #B1B0B0; <br> background-image:url(/img/highlight.png)!important; <br> text-transform:uppercase; <br> width:80px; <br> text-shadow:rgba(0,0,0,0.2) 0 -1px 0; <br> background:#B4B4B4; <br> border-radius:3px; <br> font-size:10px; <br> color:#FFF; <br> margin:3px 3px 0; <br> padding:0 5px; <br> }<!--/uzc--></div><hr><br>[code].statusOnline { Таблица СSS: width:80px; background:#7BA60D; border-radius:3px; font-size:10px; text-transform:uppercase; color:#FFF; border-top:1px solid #97CD6B; border-bottom:1px solid #488019; background-image:url(/img/highlight.png); text-shadow:rgba(0,0,0,0.2) 0 -1px 0; margin:3px 3px 0; padding:0 5px; } .statusOffline { border:1px solid #B1B0B0; background-image:url(/img/highlight.png)!important; text-transform:uppercase; width:80px; text-shadow:rgba(0,0,0,0.2) 0 -1px 0; background:#B4B4B4; border-radius:3px; font-size:10px; color:#FFF; margin:3px 3px 0; padding:0 5px; }
| |
Всего комментариев: 0 | |