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
Topic Started: Jun 16 2011, 06:36 AM (638 Views)
wilders
Member
[ *  * ]
Board Address:Private
Board Software:Zetaboards
Description: I want a code that doesnt allow links that you dont want being posted or they can't do [img]linkofthesiteyoudontwant[/img] i only want links that i approved...Because there is a way to get IP'S with it.

Thanks already.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Do you want to block specific links or the use of all links unless they're accepted? The former would be easier.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Like i want to allow www.imageshack.us or any other site that i think its safe , but not the others that arent on the list like if they want to post the link i dont want something like this needs to come [#10213] You are not allowed to use that image extension on this board.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
function keepLink(link) {
$(".c_post a:not([href*='" + link + "']), #topic_review td a:not([href*='" + link + "'])").replaceWith("<em>You are not allowed to use that link on this board.</em>");
}

function keepImage(image) {
$(".c_post img:not([src*='" + image + "']), #topic_review td img:not([src*='" + image + "'])").replaceWith("<em>You are not allowed to use that image on this board.</em>");
}

keepLink("google");

keepImage("imageshack");
</script>
That, for example, will remove all links and images except links from Google and images from ImageShack. The two lines on bottom is what you want to edit and you repeat each line for each link or image you want to allow; the first line is to keep links, the second line is to keep images. Just change the text to the text that is contained within the link or image URL that you wish to allow.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Yes thats good but imageshack uploads like http://img824.imageshack.us the number keeps changing same goes for other images sites i got imageshack on the list but blocks it all because it got numbers in it :/

Edited by wilders, Jun 17 2011, 06:41 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Did you change the code? What I used above didn't block ImageShack links and I used a URL with numbers in it.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
oh its working nvm but it makes it load for like 1 second then it changes to text so they are still able to get the IP because when it loads they get the IP. Can't u make it like before they post they get a box saying you are not allowed to use this site?

Edit : it wasnt working because the image had this [img]http://img508.imageshac now when i add swiftkit it still doesnt work :/

Can you delete the link thingy but only keep it for images because people posted random sites and they all get blocked and its hard to add them all because people will just post different ones again



I'm sorry that im asking so much :/
Edited by wilders, Jun 17 2011, 06:57 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
function keepImage(image) {
$(".c_post img:not([src*='" + image + "']), #topic_review td img:not([src*='" + image + "'])").replaceWith("<em>You are not allowed to use that image on this board.</em>");
}

keepImage("imageshack");
</script>
That will keep the images you specify only.

The way I'm doing it requires JavaScript on the page to load to remove all others and only keep the ones you specify. If you want an error to appear when they're posting that will require a much more complex code that I do not have the knowledge to create, so you would have to wait for one of the experts to fill that in. Though, a user can ultimately bypass this option if they wanted by disabling JavaScript. Your board's word filters could be used to do this, but you would have to do the opposite of what you're doing now, block each individual link instead of allow them.

I'm not sure why it wouldn't work, if the image URL contains the name you specified it should be allowed.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Oh :( Do you know anyone in the code team can make something like that ? If not you can close this thread will be using your code for now :)!

Thanks alot man :)


Edit : Its blocking some of the imageshack links and some not :S
Edited by wilders, Jun 17 2011, 07:16 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Probably anyone on the code team can do it if it's possible. Many members can do it too, we have a lot of coders here. It's just a matter of waiting.

Can I see a link to a post that is and is not blocking the ImageShack image?
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
I added it on a different forum ; http://s7.zetaboards.com/Terrorize/forum/53674/ imageshack is working there maybe i did something wrong also when i add tinypic or imgur they still get blocked out ;/
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
You need to disable the img tag in the Admin CP then put this below the board
Code:
 
<script type='text/javascript'>
var allowedimg = "mediashack|photobucket|209\\.85\\.122\\.87"
var images = new RegExp("\\[img\\]((?:.+?)(?:"+allowedimg+")(?:.+?))\\[\\/img\\]","gi");
$('.c_post').each(function(){
$(this).html($(this).html().replace(images, "<img src='$1' />"));
});
</script>

change the IP address above to the IP address of your board so attached images can be used.

separate the domains for the images you allow with a bar |
if you need to put in a slash, a colon or a dot then you need to escape it with two backslashes like so
Code:
 
http://209.85.122.87

becomes

http\\:\\/\\/209\\.85\\.122\\.87
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Thanks! working great love you <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