I need coding help, to fix the content warning system, thanks to whoever can help :)

1 Star2 Stars3 Stars4 Stars5 Stars (11 votes, average: 3.91 out of 5)
Loading...
By Oliver (AKA the Admin) on 18 comments
in Categories: Just Talking

Hi everyone, things are getting a bit less chaotic at home, most of the furniture has found its new location, I think I’ll be able to resume my normal  life soon (including hentai sharing, half of the time, here, I’m taking advantage of the chaos at home to take it easy) ^^

However, in the short term, there’s also the problem of the new content warning shown on Hentairules. No choice, my web host requires it, and the law tells them they’re right (why did everyone assume I was hosted in the USA, I wonder ?).

The biggest issue is the incompatibility between two blog plugins, one of them handling the blog cache (without it, I’d need a dedicated server and it would cost me an arm and a leg), and the other showing you an adult content warning.
The result is the mess everyone is seeing (well, almost everyone, good job geeks !), with this bloody warning splashed out on every single new page we visit.

There’s a solution, true, however I found out I’m not competent enough to make it work, as I found today. And I don’t want to impose it on you all for too long.

So, I’m officially asking for help !

Please, if you have coding skills in php and javascript, can you take a look at the page where I give full details ? Ideally, I’d shamelessly need a coding ninja to provide me a fully working code.
Thank you very much :)

Subscribe
Notify of
guest

18 Comments
oldest
newest most voted
Inline Feedbacks
View all comments
BigBear
BigBear
13 years ago

Hey Oliver,

My primary occupation is backend and frontend website coding, so I think I can solve you little conundrum (for free, of course). Drop me a line on my email, because I have a few questions, not answered in the link you posted:
1) which plugins do you currently use for your blog
2) are you ok with visitors that have disabled js not seeing the warning et all.
3) is waiting a day for me to clear up my current work ok :}

Oliver AKA The Admin
Admin
13 years ago
Reply to  BigBear

I'd rather keep it public, so that everyone has the info :)

– I use the "content warning" wordpress plugin : http://wordpress.org/extend/plugins/content-warni

– very few persons don't have javascript enabled, even my host won't be so anal about it, I hope, so it's OK

– I can wait, do I have other choice anyway ;)

Allen7
Allen7
13 years ago

Oliver, as I said in a previous comment, you can use Ad-Block Plus and Element Hider to hide the warning system. On every page and every time. I don't even see the warning anymore.

Oliver AKA The Admin
Admin
13 years ago
Reply to  Allen7

It's a solution for YOU, not for the website, and my web host will plug me off if all I'm doing is asking my visitors to install a customized script blocker.

Allen7
Allen7
13 years ago

You can still keep the warning system but the end users can choose block it themselves, thus there should be no problem. You had no control over it, the end user chose to do it themselves.

On another note, I doubt they're spying on every post you make. So if you choose to recommend this method, I don't think you'll have problems… I dunno, maybe you can recommend it to people until you get a real fix?

Or have a gateway page when arriving to HR that then redirects to the actual blog. Like what most adult websites do.

I get a feeling I might've ticked you off a bit… just trying to help here >.>

Allen7
Allen7
13 years ago
Reply to  Allen7

Sure, it's not a solution for the website itself, but this little trick will make a lot of end users happy. Which is the entire point of trying to fix this warning system isn't it?

Oliver AKA The Admin
Admin
13 years ago
Reply to  Allen7

Don't worry, you're not bothering me, I'm open to discussion, and even (but it wasn't the case here) to conflictual discussion (as long as nobody gets emo, conflict also allows to move forward).

But I stand to my words, rather than recommending complicated stuff, I'd rather wait and find a valid solution on my own end.

halo
halo
13 years ago

Why did we assume you were hosting in the US? That would be because of the loli content you occasionally put up on the site would land you jail time in the UK.

@Allen, I think Oliver is wanting a way to hide it on on the site's side. Adblock is for the client side (the client's browser).

Anonymous2
Anonymous2
13 years ago

it's really boring beacuse we have often to click "enter".
can you make this as cookie ? I mean, once we accepted, we should not see this boring message again.
thanks

Marx
Marx
13 years ago

@anonymous2: That would be the reason why Oliver asked for someone to help him.

@Oliver: Hope you can get this issue resolved quickly with some help, I unfortunately know next to nothing about coding (as it is, I can read, follow instructions, and exercise a due amount of caution when it comes to screwing around with config files).
Been a fan of your website for a few months now, and I'd really hate to see your website being screwed up just because your host thinks he has to protect the minors of this world from seeing hentai women drawn naked and anatomically correct.

Schuyler Thorpe
13 years ago

That would explain why I saw this funny message when it popped up.

PERVS OF THE WORLD–UNITE!

SAVE OLIVER AND PEOPLE LIKE US FROM ENDLESS CENSORSHIP…

(Sorry: I don't know shit from a hole in the ground in regards to web coding and HTML formatting.)

I think I'm also a bit blinded from that "flashy" message too. My eyes won't focus! xD

Andreas
Andreas
13 years ago

Hey,
I thought I could contribute something here. I made two functions which can either show the warning or hide it. If the cookie named "hentairulesWarning" exists it won't show.
My time run out so I couldn't do something fancy with the background but maybe someone else can ;)

First the functions:
<script type="text/javascript">
function showWarning()
{
a = document.cookie;
c= a.search(/hentairulesWarning.+/); //looking for the cookie
if(c==-1)
{
document.getElementById("Warning").style.display="block";
}
}
function hideWarning()
{
document.getElementById("Warning").style.display="none";
document.cookie= 'hentairulesWarning=ok'; //setting the cookie
}
</script>
Then you would need a <div> or something similar with css-options like this:
<div id='Warning' style='display:none;position:fixed; height:200px; width:300px; overflow:auto; left:40%; top:40%;'>

somewhere after this div you should place the javascript code which shows the warning if necessary:
<script type="text/javascript"> showWarning();</script>

this worked well on my small test-page but a blog of this size is a different matter. hope it helps anyway.

cheers

Andreas
Andreas
13 years ago
Reply to  Andreas

ah and the Enter button needs a "onclick='hideWarning()'" – 'tag'

Lot
Lot
13 years ago

sometimes ago I've made a small jquery script that check if a cookie is set and if not it display a normal system confirm window with a message, if accepted it set the cookie if not it redirect to another site.
message, cookie days, name of the cookie and its value and redirect link are customizable but I never use it (so I think you should try it in case) and don't know how to insert it in wordpress.

Voo
Voo
13 years ago

And noscript saves the day once again ;-)

Anyway my day job is a “bit” more focused on hardware (speak VLSI stuff) though I do my fair share of programming, so lets see:

I don’t see why caching would be a problem here – I mean this should obviously be implemented solely with JS and the cache will just serve the whole code. So is the problem just coming up with a small JS file that you include in some header or is there something I miss?

@Ganonmaster
13 years ago

I've put together a dummy page that might do what you want. I'm not fluent in javascript, didn't test it across different browsers, and it probably could be a lot better. Maybe someone else could improve on it.

Here's the code: http://pastebin.com/HygSKdQR

johann
johann
13 years ago

I shoddily put together some stuff I found on google to make this:
http://coolyo.freevar.com/dialog_box.html

for some reason I can't get the cookies part to work, though… I hope this helps, in any way.

princeheir
princeheir
13 years ago

sadly im not good at these things :(