I am trying to place this code into my classified ad website to block
certain URL's
import re
# List of URLs to block
blocked_urls = [
"example.com",
"blockeddomain.com",
# Add more URLs here as needed
]
# Function to check if a URL is blocked
def is_url_blocked(url):
for blocked_url in blocked_urls:
if re.search(blocked_url, url):
return True
return False
# Example usage
def post_advertisement(ad_text, ad_url):
if is_url_blocked(ad_url):
print("Sorry, the URL you are trying to post is not allowed.")
else:
# Post the advertisement
print("Advertisement posted successfully!")
# Test
post_advertisement("Check out this website: example.com", "example.com")
post_advertisement("Great deals here: myclassifieds.com", "myclassifieds.com")
Does anyone know which file I need to olace it in?
I have 2 different sites and using fino and bitfinder with
osclass 8.2.1 version back office.
Robert