Единый форум поддержки

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

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


Вы здесь » Единый форум поддержки » Архив » Запросы по скриптам[2]


Запросы по скриптам[2]

Сообщений 21 страница 40 из 996

1

Архивная тема с запросами о создании различных скриптов

Это архивная тема с запросами от пользователей на написание скриптов. Некоторые скрипты могут быть индивидуальным исполнением для конкретного форума, что не гарантирует его работоспособность на другом форуме. Перед использованием скрипта, пожалуйста, внимательно изучите все предыдущие сообщения между автором запроса и исполнителем, в них могут содержаться важные детали о функционале и установке найденного скрипта.
Скрипты, опубликованные в этой теме, могут быть устаревшими и нерабочими, поскольку функционал форумов и стандарты языка javascript или библиотеки jquery могли измениться.

Предыдущая тема - Запросы по скриптам
Следующая тема - Запросы по скриптам[3]

Инструменты для поиска и редактирования стиля (скриптов).

Как с помощью браузера можно определить элемент дизайна.

Каталог скриптов/CSS

Полезные скрипты, необходимые темы для новичков, а также ссылки на сайты рассказывающие что такое НТМЛ и CSS.

Типовые Вопросы (ЧаВо)

Ответы на часто задаваемые вопросы.

Как задавать вопросы! Разница между стилем и скриптом. ( Советы)

Плюс к названию темы еще и Памятка.

+1

21

Fover
оберни li.pа-author , к примеру в strong, и всунь иконку в конец strong

0

22

пару дней назад перестал работать скрипт 20 последних сообщений

Код:
<script src="/export.php?type=js&max=20" type="text/javascript"></script>
<script type="text/javascript">
if(location.href=='http://'+location.hostname+'/'){
var html='';
var ts = '';
var mo = '';
var hh = '';
var mm = '';
var i = 0;
for(i=0;i<content.length/2;i++) {
	ts = new Date();
	ts.setTime(1000*content[i][0]);
	mo = ts.getMonth()+1;
	if (mo<10) mo='0'+mo;
	hh = ts.getHours();
	mm = ts.getMinutes()+'';
	if (mm<10) mm='0'+mm;
	ts = ts.getDate()+'.'+mo+' '+hh+':'+mm;
	ts2 = new Date();
	ts2.setTime(1000*content[i+10][0]);
	mo2 = ts2.getMonth()+1;
	if (mo2<10) mo2='0'+mo2;
	hh2 = ts2.getHours();
	mm2 = ts2.getMinutes()+'';
	if (mm2<10) mm2='0'+mm;2
	ts2 = ts2.getDate()+'.'+mo2+' '+hh2+':'+mm2;
html2="</tr></tbody></table></div>"
html1="<h2>ПОСЛЕДНИЕ 20 СООБЩЕНИЙ</h2><div class=\"container\"><table cellspacing=\"0\" width=100%><thead><tr><th scope=\"col\"><b>Автор</b></th><th scope=\"col\"><b>Время</b></th><th scope=\"col\"><b>Последнее Сообщение в Теме</b></th><th scope=\"col\"><b>Автор</b></th><th scope=\"col\"><b>Время</b></th><th scope=\"col\"><b>Последнее Сообщение в Теме</b></th></tr></thead><tbody class=\"hasicon\">"
html+='<tr><td>'+content[i][1]+'</td><td class=\"tc2\">'+ts+'<td class=\"tcr\"><a href=\"'+content[i][2]+'\">'+content[i][3]+'</a><br /></td><td>'+content[i+10][1]+'</td><td class=\"tc2\">'+ts2+'<td class=\"tcr\"><a href=\"'+content[i+10][2]+'\" target=\"_blank\">'+content[i+10][3]+'</a><br /></td></tr>';
}

var arr=document.getElementsByTagName("div")
i=0
str=document.URL
while(arr[i] ){
if((str.substring(str.lastIndexOf('/')+1)=="" || str.substring(str.lastIndexOf('/')+1)=="index.php") && arr[i].className=="statscon"){
name=arr[i].innerHTML
name=name.substring(0)
arr[i].innerHTML=""+html1+""+html+""+html2+"<br><h2>Общая Статистика</h2>"+name+""
}
i++
}}
</script>

0

23

Deff
Не получится, тогда в репке ник пользователя исчезнет.

0

24

SKEE

Код:
<script type="text/javascript">
var a = '<script src="/export.php?type=js&max=20?'+(+new Date())+'" type="text/javascript"><\/script>';
if($('#pun-index').length)document.write(a)
</script>
<script type="text/javascript">
if(location.href=='http://'+location.hostname+'/'){
var html='';
var ts = '';
var mo = '';
var hh = '';
var mm = '';
var i = 0;
for(i=0;i<content.length/2;i++) {
	ts = new Date();
	ts.setTime(1000*content[i][0]);
	mo = ts.getMonth()+1;
	if (mo<10) mo='0'+mo;
	hh = ts.getHours();
	mm = ts.getMinutes()+'';
	if (mm<10) mm='0'+mm;
	ts = ts.getDate()+'.'+mo+' '+hh+':'+mm;
	ts2 = new Date();
	ts2.setTime(1000*content[i+10][0]);
	mo2 = ts2.getMonth()+1;
	if (mo2<10) mo2='0'+mo2;
	hh2 = ts2.getHours();
	mm2 = ts2.getMinutes()+'';
	if (mm2<10) mm2='0'+mm;2
	ts2 = ts2.getDate()+'.'+mo2+' '+hh2+':'+mm2;
html2="</tr></tbody></table></div>"
html1="<h2>ПОСЛЕДНИЕ 20 СООБЩЕНИЙ</h2><div class=\"container\"><table cellspacing=\"0\" width=100%><thead><tr><th scope=\"col\"><b>Автор</b></th><th scope=\"col\"><b>Время</b></th><th scope=\"col\"><b>Последнее Сообщение в Теме</b></th><th scope=\"col\"><b>Автор</b></th><th scope=\"col\"><b>Время</b></th><th scope=\"col\"><b>Последнее Сообщение в Теме</b></th></tr></thead><tbody class=\"hasicon\">"
html+='<tr><td>'+content[i][1]+'</td><td class=\"tc2\">'+ts+'<td class=\"tcr\"><a href=\"'+content[i][2]+'\">'+content[i][3]+'</a><br /></td><td>'+content[i+10][1]+'</td><td class=\"tc2\">'+ts2+'<td class=\"tcr\"><a href=\"'+content[i+10][2]+'\" target=\"_blank\">'+content[i+10][3]+'</a><br /></td></tr>';
}

var arr=document.getElementsByTagName("div")
i=0
str=document.URL
while(arr[i] ){
if((str.substring(str.lastIndexOf('/')+1)=="" || str.substring(str.lastIndexOf('/')+1)=="index.php") && arr[i].className=="statscon"){
name=arr[i].innerHTML
name=name.substring(0)
arr[i].innerHTML=""+html1+""+html+""+html2+"<br><h2>Общая Статистика</h2>"+name+""
}
i++
}}
</script>

Отредактировано Deff (Пт, 29 Ноя 2013 17:06:45)

0

25

Fover
Ну тады так:

<script type="text/javascript">
$(document).ready(function(){
$('#pun-viewtopic div.post').each(function(){
$(this).find('.pa-author').css({'display':'inline-block'});
var purl = $(this).find('.pl-email:first a').attr('href');
var pem = $(this).find('.pl-email:last a').attr('href');
var pls = purl.slice(purl.indexOf('id=')+3);var pweb = $(this).find(".post-links ul li.pl-website a");
var pwu = pweb.attr("href");
$(this).find("div.post-author ul").prepend("<li style='width:auto;display:inline-block;padding:3px;'><span style='cursor:pointer;font-size:2em' class='vprofo open'>" + FORUM.editor.keyboard.keys[44] + "</span><div class='viewp' style='color: rgb(153, 153, 153);display: block;position: absolute;z-index:10;margin-left: 30px!important;width: auto;padding: 8px;background: #fff; border: 1px solid #cecece;'>• <a href='"+purl+"'>Посмотреть профиль</a><br />• <a href='http://admin.webtalk.ru/messages.php?action=new&uid="+pls+"'>Написать ЛС</a><br>• <a href='"+pem+"'>Написать E-mail</a><fweb><br>• <a href='"+pwu+"'>Веб-сайт</a></fweb></div></li>");
if(pweb.length){}else {$(this).find("fweb").replaceWith(" ");}
$(".viewp, .pl-email, .pl-website").hide();
$(this).find("div.post-author").find(".vprofo").click(function () {
$(this).toggleClass("open").toggleClass("close").next().toggle()});
});})
</script>

Или

<script type="text/javascript">
$(document).ready(function(){
$('#pun-viewtopic div.post').each(function(){
$(this).find('.pa-author').css({'display':'inline-block'});
var purl = $(this).find('.pl-email:first a').attr('href');
var pem = $(this).find('.pl-email:last a').attr('href');
var pls = purl.slice(purl.indexOf('id=')+3);var pweb = $(this).find(".post-links ul li.pl-website a");
var pwu = pweb.attr("href");
$(this).find('.pa-author').after("<li style='width:auto;display:inline-block;padding:3px;'><span style='cursor:pointer;font-size:2em' class='vprofo open'>" + FORUM.editor.keyboard.keys[44] + "</span><div class='viewp' style='color: rgb(153, 153, 153);display: block;position: absolute;z-index:10;margin-left: 30px!important;width: auto;padding: 8px;background: #fff; border: 1px solid #cecece;'>• <a href='"+purl+"'>Посмотреть профиль</a><br />• <a href='http://admin.webtalk.ru/messages.php?action=new&uid="+pls+"'>Написать ЛС</a><br>• <a href='"+pem+"'>Написать E-mail</a><fweb><br>• <a href='"+pwu+"'>Веб-сайт</a></fweb></div></li>");
if(pweb.length){}else {$(this).find("fweb").replaceWith(" ");}
$(".viewp, .pl-email, .pl-website").hide();
$(this).find("div.post-author").find(".vprofo").click(function () {
$(this).toggleClass("open").toggleClass("close").next().toggle()});
});})
</script>

Отредактировано Deff (Пт, 29 Ноя 2013 16:50:01)

0

26

Все равно криво.
К тому же я писал для MyBB, а всякие русфф я не перевариваю.

0

27

Deff
не работает (((

0

28

Fover написал(а):

Всплывающее окно в профиле

наезжают звездочки в профиле
http://s6.uploads.ru/t/aU4su.gif

0

29

SKEE написал(а):

Deff
не работает (((

Вот этот ник "Arni" - Забаньте (предварительно сменинив ник), все ники с одинарными и двойными кавычками губят все скрипты! Если нужны кавыки - пусть ставит кодом - &quot;Arni&quot;


Чуть подправил скрипт

Отредактировано Deff (Пт, 29 Ноя 2013 17:11:42)

0

30

Deff
А как здесь убрать подчёркивание ссылок?

<script type="text/javascript">
$(document).ready(function(){
$('#pun-viewtopic div.post').each(function(){
$(this).find('.pa-author').css({'display':'inline-block'});
var purl = $(this).find('.pl-email:first a').attr('href');
var pem = $(this).find('.pl-email:last a').attr('href');
var pls = purl.slice(purl.indexOf('id=')+3);var pweb = $(this).find(".post-links ul li.pl-website a");
var pwu = pweb.attr("href");
$(this).find('.pa-author').after("<li style='width:auto;display:inline-block;padding:3px;'><span style='cursor:pointer;font-size:2em' class='vprofo open'>" + FORUM.editor.keyboard.keys[44] + "</span><div class='viewp' style='color: rgb(153, 153, 153);display: block;position: absolute;z-index:10;margin-left: 30px!important;width: auto;padding: 8px;background: #fff; border: 1px solid #cecece;'>• <a href='"+purl+"'>Посмотреть профиль</a><br />• <a href='http://admin.webtalk.ru/messages.php?action=new&uid="+pls+"'>Написать ЛС</a><br>• <a href='"+pem+"'>Написать E-mail</a><fweb><br>• <a href='"+pwu+"'>Веб-сайт</a></fweb></div></li>");
if(pweb.length){}else {$(this).find("fweb").replaceWith(" ");}
$(".viewp, .pl-email, .pl-website").hide();
$(this).find("div.post-author").find(".vprofo").click(function () {
$(this).toggleClass("open").toggleClass("close").next().toggle()});
});})
</script>

text-decoration: none;

не помогло

0

31

Good написал(а):

Deff
А как здесь убрать подчёркивание ссылок?
text-decoration: none;
не помогло

Добавить класс к <li class=myLink style='width:auto;display:inline-block;p

Далее

.punbb .myLink a {
text-decoration: none;
}

+1

32

SKEE

<div class='viewp' style='z-index: 99999!important;color: rgb(153, 153, 153);display: block;position: absolute;margin-left: 30px!important;width: auto;padding: 8px;background: #fff; border: 1px solid #cecece;'>

Добавляем выделенное красным.

0

33

Fover написал(а):

Все равно криво.

Криво, потому что криво написано ))

Можно гораздо лаконичнее, учитывая, что есть jQuery, если, конечно, его знать )) и rusff сразу начнет перевариваться ))

Код:
<style>
.punbb .post .pa-links {display: none; position: absolute; top: 25px; right: 0; padding: 5px; z-index: 100;}
.punbb .post .pa-links ul {padding: 15px;}
.pa-links li {display: block; list-style: circle outside; float: none; padding-left: 20px; height: 16px; margin-bottom: 5px}
.pa-links li.pl-email {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/balloon__pencil.png) no-repeat; }
.pa-links li.pl-email:first-child {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/user_business.png) no-repeat; }
.pa-links li.pl-email:nth-child(3) {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/mails_pencil.png) no-repeat; }
.pa-links li.pl-website {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/globe-medium-green.png) no-repeat; }
.btn-links {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/user__plus.png) no-repeat; width: 16px; height: 16px; position: absolute; top: 0; right: 10px; cursor: pointer;}
.post-author {position: relative;}

</style>
	
<script>
	$(document).ready(function() {
if(document.URL.indexOf("viewtopic.php")){
	$(".pa-author").after("<div class='btn-links'></div><li class='pa-links'><ul class='container'></ul></li>");	   
	$(".post").each(function(){
$(this).find(".pl-email,.pl-website").prependTo($(this).find(".pa-links ul"));	
	});
	$(".btn-links").click(function() {
$(this).next().toggle('slow');

	});	
}
	})
</script>

Отредактировано sadhaka (Пт, 29 Ноя 2013 19:59:16)

+2

34

sadhaka
Суть неудобства пользования лишний клик, частенько хочется просмотреть профиле Автора последние сообщения, дык нужно найти иконку, кликнуть, ток потом попадаем в профиль и ищем последние сообщения, хорошо бы ввести ссылку сразу в выплывающий блок

Вид ссылки 'http://forum.mybb.ru/search.php?search_id='+UserID

0

35

sadhaka
Уно моменто, мне и так нравится и я не учитываю при написании русфф (для меня это левый сервис).

Для всех: За обсуждения в этой теме буду давать предупреждения, для этого есть специальные темы.

0

36

sadhaka написал(а):

и rusff сразу начнет перевариваться ))

А нафиг совать li целиком ?  Там  в сплывалке "репы"  же нужно ток содержимое  (a).text()
Я не устоял ткнуть колючку!

Отредактировано Deff (Пт, 29 Ноя 2013 20:00:20)

0

37

Deff написал(а):

sadhaka
Суть неудобства пользования лишний клик, частенько хочется просмотреть профиле Автора последние сообщения, дык нужно найти иконку, кликнуть, ток потом попадаем в профиль и ищем последние сообщения, хорошо бы ввести ссылку сразу в выплывающий блок

Вид ссылки 'http://forum.mybb.ru/search.php?search_id='+UserID

К примеру вот так)))

http://s6.uploads.ru/qNwmB.jpg

+1

38

Deff
ссылка немного другая, но как-то так
//добавила условие, чтобы у гостей ничего не показывалось.

Код:
<style>
.punbb .post .pa-links {display: none; position: absolute; top: 25px; right: 0; padding: 5px; z-index: 100;}
.punbb .post .pa-links ul {padding: 15px;}
.pa-links li {display: block; list-style: circle outside; float: none; padding-left: 20px; height: 16px; margin-bottom: 5px}
.pa-links li.pl-email {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/balloon__pencil.png) no-repeat; }
.pa-links li.pl-email:first-child {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/user_business.png) no-repeat; }
.pa-links li.pl-email:nth-child(3) {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/mails_pencil.png) no-repeat; }
.pa-links li.pl-message {background: url(http://www.iconsearch.ru/uploads/icons/blandet/16x16/comments.png) no-repeat; }
.pa-links li.pl-website {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/globe-medium-green.png) no-repeat; }
.btn-links {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/user__plus.png) no-repeat; width: 16px; height: 16px; position: absolute; top: 0; right: 10px; cursor: pointer;}
.post-author {position: relative;}

</style>
	
<script>
	$(document).ready(function() {
if(document.URL.indexOf("viewtopic.php")!=-1 && GroupID != 3){
	$(".pa-author").after("<div class='btn-links'></div><li class='pa-links'><ul class='container'></ul></li>");	   
	$(".post").each(function(){
$(this).find(".pl-email,.pl-website").prependTo($(this).find(".pa-links ul"));
var user = $(this).find(".pl-email:first a").attr("href").match(/\d+/i);
$(this).find(".pa-links ul .pl-email:eq(2)").after("<li class='pl-message'><a rel='nofollow' href='/search.php?action=show_user&user_id="+user[0]+"'>Сообщения</a></li>");
	});
	$(".btn-links").click(function() {
$(this).next().toggle('slow');

	});	

}
	})
</script>
Deff написал(а):

А нафиг совать li целиком ?  Там  в сплывалке "репы"  же нужно ток содержимое  (a).text()
Я не устоял ткнуть колючку!

Полагаю, для того, чтобы сохранились стили. Не очень красиво, когда у тебя все ники красные и наклонные, а тут черный и жирный, тем более, если фон - экзотичных цветов.

Fover написал(а):

Уно моменто, мне и так нравится и я не учитываю при написании русфф (для меня это левый сервис).

Ну когда "мне и так нравится" и пользоваться надо у себя на форуме, а не выкладывать в паблик.

Отредактировано sadhaka (Пт, 29 Ноя 2013 20:43:23)

+1

39

sadhaka написал(а):

Deff
ссылка немного другая, но как-то так
//добавила условие, чтобы у гостей ничего не показывалось.

CПС, чуть подправил, ибо тут в топике, у кого есть вебсайт - все сообщения - не кажет

Код:
<style>
.punbb .post .pa-links {display: none; position: absolute; top: 25px; right: 0; padding: 5px; z-index: 100;}
.punbb .post .pa-links ul {padding: 15px;}
.pa-links li {display: block; list-style: circle outside; float: none; padding-left: 20px; height: 16px; margin-bottom: 5px}
.pa-links li.pl-email {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/balloon__pencil.png) no-repeat; }
.pa-links li.pl-email:first-child {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/user_business.png) no-repeat; }
.pa-links li.pl-email:nth-child(3) {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/mails_pencil.png) no-repeat; }
.pa-links li.pl-message {background: url(http://www.iconsearch.ru/uploads/icons/blandet/16x16/comments.png) no-repeat; }
.pa-links li.pl-website {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/globe-medium-green.png) no-repeat; }
.btn-links {background: url(http://www.iconsearch.ru/uploads/icons/fugue/16x16/user__plus.png) no-repeat; width: 16px; height: 16px; position: absolute; top: 0; right: 10px; cursor: pointer;}
.post-author {position: relative;}

</style>
	
<script>
	$(document).ready(function() {
if($('#pun-viewtopic').length==0|| GroupID == 3)return;
	$(".pa-author").after("<div class='btn-links'></div><li class='pa-links'><ul class='container'></ul></li>");	   
	$(".post").each(function(){
$(this).find(".pl-email,.pl-website").prependTo($(this).find(".pa-links ul"));
var user = $(this).find(".pl-email:first a").attr("href").split('=')[1];
$(this).find(".pa-links ul").append("<li class='pl-message'><a rel='nofollow' href='/search.php?action=show_user&user_id="+user+"' target=_blank>Сообщения</a></li>");
	});
	$(".btn-links").click(function() {
$(this).next().toggle('slow');

	});	
	})
</script>

Отредактировано Deff (Пт, 29 Ноя 2013 21:31:12)

0

40

sadhaka
:cool: Иконки - замечательные - сейчас отметил

0


Вы здесь » Единый форум поддержки » Архив » Запросы по скриптам[2]