We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Request Links #2
Topic Started: Jun 30 2011, 04:41 PM (618 Views)
wilders
Member
[ *  * ]
Board Address:Private
Board Software:Zetaboard
Description: I requested a code before that some images arent allowed on our forums is there a way to not allow sites that i didnt allow for avatars aswell ? the code was for the images and is working good :
<script type='text/javascript'>
var allowedimg = "imageshack"
var images = new RegExp("\\[img\\]((?:.+?)(?:"+allowedimg+")(?:.+?))\\[\\/img\\]","gi");
$('.c_post,.c_sig,.portal_content').each(function(){
$(this).html($(this).html().replace(images, "<img src='$1' />"));
});
</script>
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
[edit] sorry, it was an epic fail >.< I'll do it for you tomorrow.
Edited by Quozzo, Jun 30 2011, 06:50 PM.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Quozzo
Jun 30 2011, 05:27 PM
[edit] sorry, it was an epic fail >.< I'll do it for you tomorrow.
Haha ok :P didnt see the fail anyways :P
Offline Profile Goto Top
 
Reid
Member Avatar
È una trappola!

Try this in Admin CP -> Board Template -> Below the Board:
Code:
 
<script type='text/javascript'>
(function () {
var allowed_image_hosts = ["imageshack"];
$('img.avatar').each(function () {
var n = allowed_image_hosts.length, allowed = false,
beginning = this.src.indexOf('://') + 3,
src = this.src.substring(beginning);

if (src.indexOf('www') === 0) {
src = src.substr(3);
}

while (n--) {
if (src.indexOf(allowed_image_hosts[n]) !== -1) {
allowed = true;
break;
}
}
if (!allowed) $(this).remove();
});
}());
</script>
I should note that this will disable people who have uploaded their avatar to the forum, unless you add in your server's IP address.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Reid
Jul 1 2011, 05:40 PM
Try this in Admin CP -> Board Template -> Below the Board:
Code:
 
<script type='text/javascript'>
(function () {
var allowed_image_hosts = ["imageshack"];
$('img.avatar').each(function () {
var n = allowed_image_hosts.length, allowed = false,
beginning = this.src.indexOf('://') + 3,
src = this.src.substring(beginning);

if (src.indexOf('www') === 0) {
src = src.substr(3);
}

while (n--) {
if (src.indexOf(allowed_image_hosts[n]) !== -1) {
allowed = true;
break;
}
}
if (!allowed) $(this).remove();
});
}());
</script>
I should note that this will disable people who have uploaded their avatar to the forum, unless you add in your server's IP address.
It doesnt show any avatars lol even if i got them on the list ;/ also i tried adding the IP of our boards that doesnt work also :/
Edited by wilders, Jul 1 2011, 07:34 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Please post the code you tried to use, using Reid's script, it blocked images uploaded on my board and allowed ImageShack ones. If you did not edit the script, please post your Board Template.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Cory
Jul 1 2011, 08:07 PM
Please post the code you tried to use, using Reid's script, it blocked images uploaded on my board and allowed ImageShack ones. If you did not edit the script, please post your Board Template.
I added my boards IP and it still blocked the image i did imageshack|87//.51//.25//.54 also tried without the /
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type='text/javascript'>
(function () {
var allowed_image_hosts = ["87.51.25.54", "imageshack"];
$('img.avatar').each(function () {
var n = allowed_image_hosts.length, allowed = false,
beginning = this.src.indexOf('://') + 3,
src = this.src.substring(beginning);

if (src.indexOf('www') === 0) {
src = src.substr(3);
}

while (n--) {
if (src.indexOf(allowed_image_hosts[n]) !== -1) {
allowed = true;
break;
}
}
if (!allowed) $(this).remove();
});
}());
</script>
Try that instead.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Working great! thanks again guys! also if they disable javascript will the images be visible or not
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
All avatars will display when JavaScript is disabled.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Kk Thanks !


Edit : If the site doesnt load fast you see the avatars :/
Edited by wilders, Jul 2 2011, 08:12 AM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Make sure you are putting it above all other scripts so it will load the quickest.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Kk thanks can be closed thanks alot <3
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic