thalamus
10-16-2007, 10:00 PM
Safe Tags v1.0
by Thalamus - October 2007
Nearly two years ago, I was looking at trying to write some code for a forum that would obfuscate certain text within posts. This (somewhat specialized) forum needed a function where, within posts, users could insert text (such as a name, nickname or other reference) that would be humanly readable on the forum pages, but that could not be picked up by search engines or trawler bots.
What I came up with at the time, was using vBcode tags that were 'built-in' by making core file changes to the bbcode class files. These then used javascript to call the base64 functions to meet the requirements. It all worked very well, but unfortunately played havoc with upgrades to vBulletin - each one meant having to re-input the code into the core php files.
With the introduction of the latest versions, and the addition and availability of more hooks, I've developed the function into a product that uses the available hooks, and making things much simpler for updates. There is a file upload, but this is simply a javascript file containing the base64 encode and decode functions.
Tested on vBulletin 3.6.8
What this product does, is to set up a vBcode (BB Code) tag called "safe" which, when used, enables you to place text into your forum posts that, although seen by human viewers of your site pages, obfuscates that text on the raw HTML page for any passing bot or search engine spider.
It does that by using a simple javascript call, to utilize the base64 encode method of encryption. What it does mean, is that if you have instances where you may want something posted on your forum but you don't want it picked up by spiders (names, places), you can now do it quite freely and easily using the Safe Tags method!
If you place an email address or a URL within the tags, it will not be parsed (although it will be encrypted) and no link will be automatically added to it.
Example:
A simple line of text that contains [safe]a name in here means that the text between the safe tags will be encrypted on the raw HTML but viewable on the thread page.
Installation
In the zip file you should have three files:
safe_encode.js
product-safetags.xml
safetags-readme.txt
To install, extract the files within the zip file to your own hard drive, then upload the safe_encode.js file into your forum's clientscript folder.
Go to your AdminCP -> Plugins & Products -> Manage Products, then click Add/Import Product.
In the Import Product section, browse for the file product-safetags.xml wherever you extracted it on your hard drive, set Allow Overwrite to Yes, then click Import.
--------------------------
The product installation will create a new custom BBcode which you can check in your AdminCP -> Custom BB Codes -> BB Code Manager.
--------------------------
This is my first published plugin, and I really don't know how much I can offer in terms of support, so please don't expect too much. It's a very easy and simple mod if you look through the xml file.
My grateful thanks to those who have helped me on here, and also to the authors of the code snippets I've used in this (I'm sorry I can't remember who you are - I'm old, and tnat's my excuse...)
Thanks for reading :)
by Thalamus - October 2007
Nearly two years ago, I was looking at trying to write some code for a forum that would obfuscate certain text within posts. This (somewhat specialized) forum needed a function where, within posts, users could insert text (such as a name, nickname or other reference) that would be humanly readable on the forum pages, but that could not be picked up by search engines or trawler bots.
What I came up with at the time, was using vBcode tags that were 'built-in' by making core file changes to the bbcode class files. These then used javascript to call the base64 functions to meet the requirements. It all worked very well, but unfortunately played havoc with upgrades to vBulletin - each one meant having to re-input the code into the core php files.
With the introduction of the latest versions, and the addition and availability of more hooks, I've developed the function into a product that uses the available hooks, and making things much simpler for updates. There is a file upload, but this is simply a javascript file containing the base64 encode and decode functions.
Tested on vBulletin 3.6.8
What this product does, is to set up a vBcode (BB Code) tag called "safe" which, when used, enables you to place text into your forum posts that, although seen by human viewers of your site pages, obfuscates that text on the raw HTML page for any passing bot or search engine spider.
It does that by using a simple javascript call, to utilize the base64 encode method of encryption. What it does mean, is that if you have instances where you may want something posted on your forum but you don't want it picked up by spiders (names, places), you can now do it quite freely and easily using the Safe Tags method!
If you place an email address or a URL within the tags, it will not be parsed (although it will be encrypted) and no link will be automatically added to it.
Example:
A simple line of text that contains [safe]a name in here means that the text between the safe tags will be encrypted on the raw HTML but viewable on the thread page.
Installation
In the zip file you should have three files:
safe_encode.js
product-safetags.xml
safetags-readme.txt
To install, extract the files within the zip file to your own hard drive, then upload the safe_encode.js file into your forum's clientscript folder.
Go to your AdminCP -> Plugins & Products -> Manage Products, then click Add/Import Product.
In the Import Product section, browse for the file product-safetags.xml wherever you extracted it on your hard drive, set Allow Overwrite to Yes, then click Import.
--------------------------
The product installation will create a new custom BBcode which you can check in your AdminCP -> Custom BB Codes -> BB Code Manager.
--------------------------
This is my first published plugin, and I really don't know how much I can offer in terms of support, so please don't expect too much. It's a very easy and simple mod if you look through the xml file.
My grateful thanks to those who have helped me on here, and also to the authors of the code snippets I've used in this (I'm sorry I can't remember who you are - I'm old, and tnat's my excuse...)
Thanks for reading :)