How to prevent the request limit in this javascript via the localstorage?
4 posters
Page 1 of 1
How to prevent the request limit in this javascript via the localstorage?
Hi all,
I have a javascript in my overall_header to display the avatar in the navigation bar
How can I adapt it to prevent the Request Limit Exceeded?
Best Regards,
Dark-Avenger
I have a javascript in my overall_header to display the avatar in the navigation bar
- Code:
<li><div id="avatar"><script>
jQuery(document).ready(function(){
jQuery.get('/profile?mode=editprofile&page_profil=avatars', function(data) {
link = jQuery('.frm dl dd img', data).attr('src');
if(link){
jQuery('#avatar').html('<center><img src="'+link+'" width="25px" height="25px" /></center>');
}else{
jQuery('#avatar').html('');
}
});
});
</script></div></li>
How can I adapt it to prevent the Request Limit Exceeded?
Best Regards,
Dark-Avenger
Last edited by Dark-Avenger on June 9th 2014, 2:56 pm; edited 2 times in total
Re: How to prevent the request limit in this javascript via the localstorage?
Hi Paulos,
Do you know how can I fix it?
Do you know how can I fix it?
Re: How to prevent the request limit in this javascript via the localstorage?
Hello,
In this case, you don't need to use Ajax, Forumotion has a var to do this for you!!
Your code can be resumed on this
Best regards, Wagner
In this case, you don't need to use Ajax, Forumotion has a var to do this for you!!
Your code can be resumed on this
- Code:
<li>
<div id="avatar"></div>
</li>
<script>
jQuery(function(){
var avatar = _userdata["avatar"];
jQuery('#avatar').append(avatar);
});
</script>
Best regards, Wagner
Re: How to prevent the request limit in this javascript via the localstorage?
How can I change avatar's size with this script?
Re: How to prevent the request limit in this javascript via the localstorage?
You just need to put a CSS rule.. Something like this
Just put the rules you want...
- Code:
#avatar img{width:WIDTHVALUE;height:HEIGHTVALUE}
Just put the rules you want...
Re: How to prevent the request limit in this javascript via the localstorage?
It still reaches the requests limit. I dont know but I have removed the javascript from template and request limit hits on each move which I can make in my ACP and I have removed 2-3 javascripts to make my forum more light.
Re: How to prevent the request limit in this javascript via the localstorage?
Can you send your forum link? I will check if i know what is doing this...
Re: How to prevent the request limit in this javascript via the localstorage?
Yes sure here it is:Wagner' wrote:Can you send your forum link? I will check if i know what is doing this...
- Spoiler:
- Code:
http://linux-team.forumgreek.com/
Re: How to prevent the request limit in this javascript via the localstorage?
Hmm, I'm brazilian, Greek it's too hard to me xD
But, i don't see any script who is doing this.. And few minutes navigating in your forum i dont have reached any RL... Dont you think its your internet?
But, i don't see any script who is doing this.. And few minutes navigating in your forum i dont have reached any RL... Dont you think its your internet?
Re: How to prevent the request limit in this javascript via the localstorage?
Do you know if these codes for IPB Profile makes to many requests to server?
Profile JS:
IPB JS:
Profile JS:
- Code:
if(/\/?u(\d+)wall$/.test(location.pathname)) {
jQuery(document).ready(function(){if(jQuery('#profile-advanced-layout #tabs li a').length){
var nevoskin=jQuery('#profile-advanced-layout #tabs li:eq(1) a').attr('href');
window.location.href=nevoskin;
}})};
if(/\/?u(\d+)stats$/.test(location.pathname)) {
jQuery(document).ready(function(){if(jQuery('#profile-advanced-layout #tabs li a').length){
var nevoskin=jQuery('#profile-advanced-layout #tabs li:eq(1) a').attr('href');
window.location.href=nevoskin;
}})};
if(/\/?u(\d+)friends$/.test(location.pathname)) {
jQuery(document).ready(function(){if(jQuery('#profile-advanced-layout #tabs li a').length){
var nevoskin=jQuery('#profile-advanced-layout #tabs li:eq(1) a').attr('href');
window.location.href=nevoskin;
}})};
if(/\/?u(\d+)contact$/.test(location.pathname)) {
jQuery(document).ready(function(){if(jQuery('#profile-advanced-layout #tabs li a').length){
var nevoskin=jQuery('#profile-advanced-layout #tabs li:eq(1) a').attr('href');
window.location.href=nevoskin;
}})};
$("meta[http-equiv='refresh'][content]:first").each(function(){window.location.href=$(this).attr("content").replace(/^.*;url=/,"")});
IPB JS:
- Code:
if(/\/?u(\d+)$/.test(location.pathname)) {
jQuery(document).ready(function(){if(jQuery('#profile-advanced-right').length){
var avataripb=jQuery('#profile-advanced-right .main-content.clearfix.center img:first-child').attr('src');
var tabsipb=jQuery('#profile-advanced-layout #profile-advanced-left #tabs').html();var infoipbge=jQuery('#profile-advanced-left #profile-advanced-details .middleline').html();
var listfriends=jQuery('.main-content.clearfix[style^="padding:0.3em;text-align:center;"]').html();
var prfiletoadd=jQuery('#profile-advanced-right #profile-advanced-add').html();
var usernameipb=jQuery('#profile-advanced-right .module.main:eq(0) .main-head .h3').text().split(' (conectado)').join('');var miregistro=jQuery('.middleline #field_id-4 dd div:eq(0)').html();
var monedas=jQuery('.middleline #field_id-13 dd div:eq(0)').html();
var reputipb=jQuery('.middleline #field_id-14 dd div:eq(0)').html();
var mid=jQuery('#profile-advanced-layout #tabs li:eq(3) a').attr('href').match(/[0-9]+/);
var onlineipb=jQuery('#profile-advanced-right .main-head:eq(0) .h3 em').text().replace(/[(]/gi,' ').replace(/[)]/gi,' ');
jQuery('#profile-advanced-right').after('<div class="ipb-profile">
<div class="nav-ipb-top"><span>Επισκόπηση Προφίλ Μέλους: <span id="useridhahs"> '+usernameipb+'</span></span></div>
<div class="mod-left">
<div class="profile-ava"><img id="ipd-avatar" src="'+avataripb +'" /> </div>
<div class="ipb-tab-us">'+tabsipb+'</div></div>
<div class="mod-center">
<div class="sub-panel-top"><div class="usernam-ipb">'+usernameipb+'</div>
<div class="register-date">Εγγράφηκε στις: '+miregistro+'</div>
<div class="ofline-ipb">Copyright©& nbsp; PunBB.biz & nbsp;& & nbsp; 15-Tronos</div>
<div class="lass-activiti"></div>
<div class="rating-profile">
<img src="http://i.imgur.com/jFLWgyz.png"/>
<img src="http://i.imgur.com/jFLWgyz.png"/>
<img src="http://i.imgur.com/jFLWgyz.png"/>
<img src="http://i.imgur.com/jFLWgyz.png"/>
<img src="http://i.imgur.com/jFLWgyz.png"/>
</div><div class="profi-add-ipb">'+prfiletoadd+'
<a id="men"href="/privmsg?mode=post&u='+mid+'">Αποστολή Προσωπικού Μηνύματος</a>
<a id="search-i"href="/spa/'+usernameipb+'">Βρείτε το περιεχόμενο μου</a>
</div>
</div>
<div class="main-info-ipb">
<div class="co-ipb" id="profile">
<div class="ipb-m-title">
<h2 id="wallcomment">Σχόλια Προφίλ</h2>
<h2 id="estadis">Λεπτομέρειες Προφίλ</h2>
<h2 id="estadisgene"><span>Στατιστικά</span></h2>
<h2 id="friends">Φίλοι</h2>
<h2 id="contacto">Επικοινωνία</h2></div>
<div class="mensajeprofile"></div>
<div class="m-info-ipb"><div class="in-ipb">'+infoipbge+'
<div class="contac-me-ipb"></div>
</div>
<div class="band-right">
<div class="repu-ipb"><span id="cs">'+monedas+'</span><div id="sub">Βαθμοί</div></div>
<div class="coin-ipb"><span>'+reputipb+'</span><div iid="re-p"> Φήμη</div></div>
<div class="module-ipb-right">
<h2>Φίλοι</h2>
<div class="main-ipb-f">'+listfriends+'</div>
</div>
</div>
</div>
<div class="estadis-ipb"></div>
<div class="friends-ips"></div>
<div class="contact-ips"></div></div>
</div></div>
</div>');
}});
$(document).ready(function(){if(jQuery('#profile-advanced-right').length){
$('.estoyenline-i:contains("conectado") .ofline-ipb').attr('style','display:none;');
$('.estoyenline-i:contains("conectado")').attr('style','padding:0px 5px;');
var linkwall=jQuery('#tabs ul li a:eq(0)').attr('href');
jQuery(".mensajeprofile").load(linkwall+' #profile-advanced-details .main-content');
var linkestaipb=jQuery('#tabs ul li a:eq(2)').attr('href');
jQuery(".estadis-ipb").load(linkestaipb+' #profile-advanced-details .main-content');
jQuery(".lass-activiti").load(linkestaipb+' #profile-advanced-details .main-content.clearfix .stats-field.genmed ul li:contains("Última visita :")');
var linkfriendipb=jQuery('#tabs ul li a:eq(3)').attr('href');
jQuery(".friends-ips").load(linkfriendipb+' #profile-advanced-details .main-content');
var linkcontaipb=jQuery('#tabs ul li a:eq(4)').attr('href');
jQuery(".contact-ips").load(linkcontaipb+' #profile-advanced-details .main-content');
}});
$(document).ready(function(){if(jQuery('#profile-advanced-right').length){ // Script del Slider
$(".mensajeprofile, .estadis-ipb, .friends-ips, .contact-ips") . hide();
$('.m-info-ipb').addClass('activetab');
$(".ipb-tab-us ul li:eq(0)").click(function(e){
$('.ipb-tab-us li ,.co-ipb div').removeClass('activetab');
$(this).addClass('activetab');
$('.mensajeprofile').addClass('activetab').fadeToggle();
$('.estadis-ipb, .m-info-ipb, .friends-ips, .contact-ips') . hide('');
return false;
e.preventDefault();
});
$(".ipb-tab-us ul li:eq(1)").click(function(e){
$('.ipb-tab-us li ,.co-ipb div').removeClass('activetab');
$(this).addClass('activetab');
$('.m-info-ipb').addClass('activetab').fadeToggle();
$('.mensajeprofile, .estadis-ipb, .friends-ips, .contact-ips') . hide('');
return false;
e.preventDefault();
});
$(".ipb-tab-us ul li:eq(2)").click(function(e){
$('.ipb-tab-us li ,.co-ipb div').removeClass('activetab');
$(this).addClass('activetab');
$('.estadis-ipb').addClass('activetab').fadeToggle();
$('.mensajeprofile, .m-info-ipb, .friends-ips, .contact-ips') . hide('');
return false;
e.preventDefault();
});
$(".ipb-tab-us ul li:eq(3)").click(function(e){
$('.ipb-tab-us li ,.co-ipb div').removeClass('activetab');
$(this).addClass('activetab');
$('.friends-ips').addClass('activetab').fadeToggle();
$('.mensajeprofile, .m-info-ipb, .estadis-ipb, .contact-ips') . hide('');
return false;
e.preventDefault();
});
$(".ipb-tab-us ul li:eq(4)").click(function(e){
$('.ipb-tab-us li ,.co-ipb div').removeClass('activetab');
$(this).addClass('activetab');
$('.contact-ips').addClass('activetab').fadeToggle();
$('.mensajeprofile, .m-info-ipb, .estadis-ipb, .friends-ips') . hide('');
return false;
e.preventDefault();
});
}});
$(document).ready(function(){if(jQuery('#profile-advanced-right').length){
$(".ipb-tab-us ul li:first-child > a").click(function(e){$('.co-ipb').attr('id', 'profilewall');});
$(".ipb-tab-us ul li:first-child + li > a").click(function(e){$('.co-ipb').attr('id', 'profile');});
$(".ipb-tab-us ul li:first-child + li +li > a").click(function(e){$('.co-ipb').attr('id', 'estadisticas');});
$(".ipb-tab-us ul li:first-child + li +li +li > a").click(function(e){$('.co-ipb').attr('id', 'friends');});
$(".ipb-tab-us ul li:first-child + li +li + li +li > a").click(function(e){$('.co-ipb').attr('id', 'contacto');
});
}});
$(document).ready(function(){if(jQuery('#profile-advanced-right').length){jQuery('#profile-advanced-right').remove()};});
$(document).ready(function(){if(jQuery('#profile-advanced-layout').length){jQuery('#profile-advanced-layout').remove()};});
}
Re: How to prevent the request limit in this javascript via the localstorage?
Hmm, the second script (IPB JS) make too much requests..
See:
1.
2.
3.
4.
5.
Just 4, or 5 I don't remember now, it's sufficient to make a RL...
See:
1.
- Code:
jQuery(".contact-ips").load(linkcontaipb + ' #profile-advanced-details .main-content');
2.
- Code:
jQuery(".friends-ips").load(linkfriendipb + ' #profile-advanced-details .main-content');
3.
- Code:
jQuery(".lass-activiti").load(linkestaipb + ' #profile-advanced-details .main-content.clearfix .stats-field.genmed ul li:contains("Última visita :")');
4.
- Code:
jQuery(".estadis-ipb").load(linkestaipb + ' #profile-advanced-details .main-content');
5.
- Code:
jQuery(".mensajeprofile").load(linkwall + ' #profile-advanced-details .main-content');
Just 4, or 5 I don't remember now, it's sufficient to make a RL...
Re: How to prevent the request limit in this javascript via the localstorage?
Is it better to remove them? Because the tutorial says to check In all the pages.
Re: How to prevent the request limit in this javascript via the localstorage?
Hmm, where did you get that? There are some words in portuguese, so did you get in a portuguese forum, right?
Can you send the link to the tutorial? So i can check if is there any better way to do this...
Can you send the link to the tutorial? So i can check if is there any better way to do this...
Re: How to prevent the request limit in this javascript via the localstorage?
I found them in punbb.biz before two-three months. I think this is an updated link http://www.punbb.biz/t316-javascript-ipb-profile-v220022014-jq191 I just found my reply to get the codes.
Re: How to prevent the request limit in this javascript via the localstorage?
Hmm, so.. I think they have stolen this tutorial from some brazilian forum or something like that, i dont know... But, i think is this script is doing that to your forum... Its better to remove it.. (I think x.x)
@Edit: Reading the tutorial... Wait a sec..
@Edit: Reading the tutorial... Wait a sec..
Re: How to prevent the request limit in this javascript via the localstorage?
Ok I am waiting if there is a solution or if not to delete them.
Re: How to prevent the request limit in this javascript via the localstorage?
I think is better to do a another code, by yourself..
About your question of storage, its simple:
Setting items
Getting items
Example
Run in your console
To get you name
You can close the browser, but when you comes back the name is in there (:
Best regards, Wagner
About your question of storage, its simple:
Setting items
- Code:
localStorage.setItem('key','value');
Getting items
- Code:
localStorage.getItem('key');
Example
Run in your console
- Code:
var name = prompt('What\'s your name?');
localStorage.setItem('name',name);
To get you name
- Code:
alert( localStorage.getItem('name') );
You can close the browser, but when you comes back the name is in there (:
Best regards, Wagner
Re: How to prevent the request limit in this javascript via the localstorage?
Ok I have removed some javascripts and now the problem with Requests Limits have been solved.
One more question: Do you know how many load functions must I have in my javascripts to skip the requests limits and how can I know how may .load functions firing the port?
With Best Regards,
Dark-Avenger
One more question: Do you know how many load functions must I have in my javascripts to skip the requests limits and how can I know how may .load functions firing the port?
With Best Regards,
Dark-Avenger
Re: How to prevent the request limit in this javascript via the localstorage?
What is your browser?
In Google Chrome you can check the requests at Network tab in Developer Tools..
I think 5 requests in 10 seconds can make a request limit.. Just need to check if this is right..
In Google Chrome you can check the requests at Network tab in Developer Tools..
I think 5 requests in 10 seconds can make a request limit.. Just need to check if this is right..
Re: How to prevent the request limit in this javascript via the localstorage?
Ok thanks Wagner.
Best Regards,
Dark-Avenger
Best Regards,
Dark-Avenger
Re: How to prevent the request limit in this javascript via the localstorage?
Since this topic is marked solved I'll move it to the archive.
Derri- Helper
- Posts : 8711
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom
Similar topics
» Request Limit?
» Request Limit Exceed Message
» Forumotion Request Limit
» Request limit excedded?
» javascript active class code request
» Request Limit Exceed Message
» Forumotion Request Limit
» Request limit excedded?
» javascript active class code request
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum