script post
Forum gratuit: forum de suport al utilizatorilor :: Forum de suport :: Probleme legate de un script (cod) :: Arhiva scripturi/coduri
Pagina 1 din 2 • Distribuiţi
Pagina 1 din 2 • 1, 2
script post
cand postez un topic ma duce pe (http://evict.forumgratuit.ro/post) si imi zice ceva gen ca mesajul meu a fost postat si mi apar 2 optiuni (intoarcere la forum si viziualizare mesaj) . cum le elimin?gen sa redirectioneze direct la mesaj.mersi
Re: script post
- Cod:
function query(e){
return document.querySelector(e);
}
function _query(e){
return document.querySelectorAll(e);
}
document.addEventListener('DOMContentLoaded', function(){
if(!/post\?f/.test(location)) return false;
var form=query('form[action="/post"]'), inputs=_query('form[action="/post"] input, form[action="/post"] textarea'), len=inputs.length, i=0;
form.addEventListener('submit', function(e){
e.preventDefault();
var data='';
for(;i<len;i++){
data+=inputs[i].getAttribute('name')+'='+inputs[i].value+'&';
}
data=data.substring(0, data.length-1);
var parser=new DOMParser();
function domify(string){
return parser.parseFromString(string, "text/html");
};
var http=new XMLHttpRequest();
http.open('POST', 'post', true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange=function(){
if(http.readyState==4 && http.status==200){
var dom=domify(http.responseText), d;
d=dom.querySelector('#main-content .inner p');
if(d===null){
alert('A aparut o eroare in postarea topicului');
} else {
if(/Mesajul a fost inregistrat cu succes/.test(dom.querySelector('#main-content .inner p').innerHTML)){
location=dom.querySelector('#main-content .inner p a').getAttribute('href');
} else {
alert('A aparut o eroare in trimiterea mesajului');
}
}
};
};
http.send(data);
})
})
Re: script post
Ai o eroare intr-unul dintre codurile javascript.
Cauta:
Dupa ce faci asta, adauga codul dat de mine si daca nu functioneaza, nu il dezactiva.
Edit:Am modificat putin codul initial pentru a se potrivi forumului tau(doar dupa ce rezolvi problema cu codul celalalt):
Cauta:
- Cod:
document.addEventListener("DOMContentLoaded", function() {
$("img[src='http://2img.net/i/fa/subsilver/category.gif']").replaceWith('<span class="nonew">No new</span>');
$("img[src='http://2img.net/i/fa/subsilver/category_new.gif']").replaceWith('<span class="new">1 new</span>');
$("img[src='http://2img.net/i/fa/subsilver/category_locked.gif']").replaceWith('<span class="lock">Lock</span>');
- Cod:
})
Dupa ce faci asta, adauga codul dat de mine si daca nu functioneaza, nu il dezactiva.
Edit:Am modificat putin codul initial pentru a se potrivi forumului tau(doar dupa ce rezolvi problema cu codul celalalt):
- Cod:
function query(e){
return document.querySelector(e);
}
function _query(e){
return document.querySelectorAll(e);
}
document.addEventListener('DOMContentLoaded', function(){
if(!/post\?f/.test(location)) return false;
var form=query('form[action="/post"]'), inputs=_query('form[action="/post"] input, form[action="/post"] textarea'), len=inputs.length, i=0;
form.addEventListener('submit', function(e){
e.preventDefault();
var data='';
for(;i<len;i++){
data+=inputs[i].getAttribute('name')+'='+inputs[i].value+'&';
}
data=data.substring(0, data.length-1);
var parser=new DOMParser();
function domify(string){
return parser.parseFromString(string, "text/html");
};
var http=new XMLHttpRequest();
http.open('POST', 'post', true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange=function(){
if(http.readyState==4 && http.status==200){
var dom=domify(http.responseText), d;
d=dom.querySelector('#main-content .message');
if(d===null){
alert('A aparut o eroare in postarea topicului');
} else {
if(/Mesajul a fost inregistrat cu succes/.test(d.innerHTML)){
location=dom.querySelector('#main-content .message a').getAttribute('href');
} else {
alert('A aparut o eroare in trimiterea mesajului');
}
}
};
};
http.send(data);
})
})
Re: script post
- Cod:
$(document).ready(function(){
$('.btn-moderator').tipsy({gravity: 'sw'});
$('.btn-asistent').tipsy({gravity: 'sw'});
$('.btn-designer').tipsy({gravity: 'sw'});
$('.inf-cookies').tipsy({gravity: 'ne'});
$('CLASA/ID').tipsy({gravity: 'nw'});
$('CLASA/ID').tipsy({gravity: 'ne'});
$('CLASA/ID').tipsy({gravity: 'sw'});
$('CLASA/ID').tipsy({gravity: 'se'});
});
$(function(){var isPunbb='';if($('.pun').length)var isPunbb='class="pun"';$('a.topictitle').after(' <img id="topicPreview" src="https://i.servimg.com/u/f56/18/45/41/65/new_wi10.gif" title="Preview topic" alt="Preview" style="cursor:pointer;"/>');$('img#topicPreview').click(function(){$('body').append('<div id="preview-filter" style="position:fixed;left:0;right:0;top:0;bottom:0;background:url(https://i.servimg.com/u/f39/18/21/41/30/overla10.png);cursor:pointer;z-index:10;"></div><div id="topicPreview-container" '+isPunbb+' style="width:auto;top:20%;left:15%;right:15%;padding:4px;position:fixed;z-index:50;background:#EEE;border:1px solid #CCC;border-radius:5px;"><div id="topicPreviewing" style="max-height:400px;overflow-y:auto;"><center><span class="topicPreview-loading" style="font-weight:bold;font-size:18px;">Asteptati...</span></center></div></div>');$('#topicPreviewing').load($(this).siblings('a.topictitle').attr('href')+' .post:eq(0)');$('#preview-filter').click(function(){$('#preview-filter, #topicPreview-container').remove()})})});
- Cod:
jQuery(function($)
{
$("img[src='https://i.servimg.com/u/f39/17/59/19/05/citeaz10.png']").replaceWith('<span class="butoanetopic butoanetopic-quote"><i class="fa fa-quote-right"></i> CITEAZA</span>');
});
jQuery(function($)
{
$("img[src='https://i.servimg.com/u/f39/17/59/19/05/edit10.png']").replaceWith('<span class="butoanetopic butoanetopic-editeaza"><i class="fa fa-pencil-square-o"></i> EDITEAZA</span>');
});
jQuery(function($)
{
$("img[src='https://i.servimg.com/u/f39/17/59/19/05/sterge10.png']").replaceWith('<span class="butoanetopic butoanetopic-sterge"><i class="fa fa-scissors"></i> STERGE</span>');
});
jQuery(function($)
{
$("img[src='https://i.servimg.com/u/f39/17/59/19/05/ip10.png']").replaceWith('<span class="butoanetopic butoanetopic-ipp"><i class="fa fa-search"></i> IP</span>');
});
function bestskins_ls() {
for(var x = $('.vote'), i = 0, vote; (vote = x[i++]); ) {
var count = 0,
qtd = 0,
barra = $('.vote-bar', vote)[0],
botao = $('.vote-button', vote)[0];
if (barra) {
var numbarra = barra.title.match(/\d+/g);
qtd = Math.round(parseInt( numbarra[1] ) * parseInt( numbarra[0] )) / 100;
}
//Imagem de reputação
var reputation_UP = 'https://i.imgur.com/PTraX1a.png';
botao = botao ? '<li><span onclick="bestskinsVoto(\'' + botao.firstChild.href + '\',this);" class="BS_like"><img src="' + reputation_UP + '" alt="+" class="rep_up"></span></li>' : '<li style="display: none;"><img src="' + reputation_UP + '" alt="+" class="rep_up"></li>';
var numrep = '<li>' + (qtd == 0 ? '<span class="reput_vote zero">' + qtd + '</span>' : '<span class="reput_vote positive">' + qtd + '</span>') + '</li>';
var htmlFinal =
'<div class="rep_bar clearfix" id="rep_post">' +
' <ul class="bs_inline">' + botao + numrep + '</ul>' +
'</div>';
$('.postfoot', vote.parentNode.parentNode.parentNode.parentNode).before( htmlFinal );
}
x.remove();
};
function bestskinsVoto(b,a) {
a.onclick = '#';
$.get(b, function() {
a.parentNode.style.display = 'none';
var verify = a.parentNode.nextSibling.firstChild.innerHTML;
if(verify == 0) {
a.parentNode.nextSibling.firstChild.classList.remove('zero'),
a.parentNode.nextSibling.firstChild.classList.add('positive');
}
var c = a.parentNode.nextSibling.firstChild, b = parseInt(/\d+/.exec(c.innerHTML)[0])+1;
c.innerHTML = c.innerHTML.replace(/\d+/,b);
});
};
if (document.readyState === 'complete') {
bestskins_ls();
} else {
document.addEventListener('DOMContentLoaded', function() {
bestskins_ls();
});
}
- Cod:
$(function() {
var $items = $('#vtab>ul>li');
$items.mouseover(function() {
$items.removeClass('selected');
$(this).addClass('selected');
var index = $items.index($(this));
$('#vtab>div').hide().eq(index).show();
}).eq(0).mouseover();
});
jQuery(function($)
{
$("img[src='https://i.servimg.com/u/f59/18/06/95/12/fbloca10.png']").replaceWith('<span class="butoaneblnw butoaneblnw-blocat">Forum blocat <i class="fa fa-lock"></i></span>');
});
jQuery(function($)
{
$("img[src='https://i.servimg.com/u/f59/18/06/95/12/ms11.png']").replaceWith('<span class="butoaneblnw butoaneblnw-new">Mesaje noi <i class="fa fa-pencil"></i></span>');
});
jQuery(function($)
{
$("img[src='https://2img.net/i/fa/prosilver_grey/icon_participate.gif']").replaceWith('<i class="fa fa-check-square-o"></i>');
});
- Cod:
(function(j){
/*
- @Top Five Mod [phpBB]
- @Automod TopFive Forumotion
*/
window.top_five_Mod = {
init: function() {
jQuery('.module.recent-topic').appendTo('table#top_five tbody tr.bg2.row2 td:eq(0)');
jQuery('.module.recent-topic br:last').remove();
jQuery('.module.recent-topic').replaceWith(jQuery('.module.recent-topic').html());
jQuery('.module.active-posters').appendTo('table#top_five tbody tr.bg2.row2 td:eq(1)');
jQuery('.module.active-posters').replaceWith(jQuery('.module.active-posters').html());
top_five_Mod.edit(); top_five_Mod.newestMem(); top_five_Mod.nEdit();
},
edit: function(a,cd) {
cd = jQuery('table#top_five tbody tr.bg2.row2 td:eq(1) .row_count');
cd.each(function() {
var number = $('table', this).attr('title').match(/\d+/g)[0];
$('table', this).replaceWith(' '+ number +' mesaje<i class="fa fa-comments"></i><br />');
});
},
newestMem: function() {
jQuery.get('/memberlist?mode=joined&order=DESC&submit=Ok&username', function(data, error) {
if(!data) console.log(error);
xSucces = jQuery('.pun .frm .frm-form table tbody tr:lt(9)', data);
jQuery('table#top_five tbody tr.bg2.row2 td:eq(2)').html(xSucces);
localStorage.setItem('save_query', jQuery('table#top_five tbody tr.bg2.row2 td:eq(2)').html());
window.top_five_Mod.nEdit();
});
if(localStorage.getItem('save_query'))
{
xSucces = localStorage.getItem('save_query');
jQuery('table#top_five tbody tr.bg2.row2 td:eq(2)').html(xSucces);
window.top_five_Mod.nEdit();
}
},
nEdit: function() {
jQuery('table#top_five tbody tr.bg2.row2 td:eq(2) tr').each(function(data) {
var user = jQuery('td.avatar-mini a', this).text();
var uurl = jQuery('td.avatar-mini a', this).attr('href');
var regd = jQuery('td.avatar-mini', this).next().next().text();
jQuery(this).replaceWith('<div class="mem_rows"><b style="font-size: 11px;"><a href="http://'+ window.location.host +''+ uurl +'">'+ user +'</a></b> s-a inregistrat in data de: '+ regd +'<i class="fa fa-check-square"></i></div>');
});
}
/* cache: function() {
sessionStorage.setItem('link_mod','N/A');
}*/
};
jQuery(function() {
setTimeout(function() {
if(sessionStorage.getItem('link_mod'))
{
window.top_five_Mod.init()
} else {
window.top_five_Mod.init()
}
}, 50);
jQuery('script[src^="/1.7.2/jquery.min.js"]').attr('src','http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js');
});
}());
Re: script post
Eroarea cea veche a disparut. Cea noua se afla in acest script:http://evict.forumgratuit.ro/99732.js
Cand dai de el il poti pur si simplu sterge/dezactiva. Sau daca gasesti pe cineva cu mai multa rabdare decat mine, poate reusesti sa il corectezi.
Cand dai de el il poti pur si simplu sterge/dezactiva. Sau daca gasesti pe cineva cu mai multa rabdare decat mine, poate reusesti sa il corectezi.
Re: script post
Codul exista garantat. Poate l-ai adaugat intr-un template? overall_header?
Pagina 1 din 2 • 1, 2
Subiecte similare
» Problema script anulare bara widget in post
» Script post moderator
» script pentru vot in post
» Cerere script post
» Cerere script $.post DataBase
» Script post moderator
» script pentru vot in post
» Cerere script post
» Cerere script $.post DataBase
Forum gratuit: forum de suport al utilizatorilor :: Forum de suport :: Probleme legate de un script (cod) :: Arhiva scripturi/coduri
Pagina 1 din 2
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum