Advertisement
Oliverfr

The Quest For A Content-Warning Javascript Code

Aug 10th, 2011
1,556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. ***This page is meant for discussion about a coding need I have***
  2.  
  3. I would indeed need help coding a content warning system for my wordpress blog, Hentairules.net
  4. I blow at javascript, and I have very little confidence in free scripts found on obscure sites, to be frank :)
  5.  
  6. The main problem is that it has to rely on javascript alone.
  7.  
  8. The reason is that my wordpress blog uses a blog caching system that caches every php output created once by a visitor, and serves it again to somebody else requesting it again.
  9. This is extremely confusing to most wordpress plugins, including my content-warning plugin, that plugin's entirety is cached including the part detecting if a visitor has been warned already, or not.
  10. That's why there's a new content warning message on every page.
  11.  
  12. So, what I need is : an equivalent of the content warning message displayed to my visitors, based on javascript, that I could place in the head/body/footer parts (whatever is required) of my blog code.
  13.  
  14. More precisely, that means :
  15. - I'd love something alonge imagebam.com's code ? For instance - WARNING ADULT PIC - http://www.imagebam.com/image/982692141880413
  16. - for visitors without the content-warning cookie, creating a cookie with a long duration, skipping that creation step for visitors already having the cookie
  17. - for visitors without the cookie, showing the actual warning message with everything around it grayed (for heaven's sake, not blacked out)
  18. - nature of the warning message : the actual page the visitor tries to see remains, but above it, making the rest of the page grayer, there is a message with the explanation and the yes/no option to click.
  19. - option YES : removing the warning message
  20. - option NO : redirecting to another website
  21.  
  22. If it's javascript powered, it will be generated by the browser of the visitors when THEY load it, it won't be served by my blog cache who would have prepared its output in advance.
  23.  
  24. Background info :
  25. - I'd love something alonge imagebam.com's code ? For instance - WARNING ADULT PIC - http://www.imagebam.com/image/982692141880413
  26. - my blog has a stylesheet obviously, stylesheet styling is OK.
  27. - my blog allows editing of everything inside the template, code can be added anywhere. It can be in the body, in the header (above and below <head>), in the footer (heck, you could even add stuff after </html> if you wanted)
  28.  
  29. Thanks a LOT if you can provide me a code for this ! :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement