Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Safe Tags Obfuscation Details »»
Safe Tags Obfuscation
Version: 1.00, by thalamus thalamus is offline
Developer Last Online: Jan 2013 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 3.6.8 Rating:
Released: 10-16-2007 Last Update: Never Installs: 18
Uses Plugins Auto-Templates
Re-useable Code Additional Files Translations  
No support by the author.

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 [safe] tags, it will not be parsed (although it will be encrypted) and no link will be automatically added to it.

Example:
Quote:
A simple line of text that contains [safe]a name in here[/safe] 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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-14-2008, 05:21 PM
Gwyrgyn Gwyrgyn is offline
 
Join Date: Jan 2007
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Figured it out. It has to do with the usage of document.write() inside of the script tags. For example, inside of handle_bbcode_safe, this works:
Code:
return "beefy";
And so does this:
Code:
return "<script language=\"javascript\" type=\"text/javascript\"> donothing(); </script>;
But this does not:
Code:
return "<script language=\"javascript\" type=\"text/javascript\"> document.write( decode64( '$fixed' ) ); </script>";
For some reason, using the write function here buggers it up when using AJAX. The solution is to modify some existing html instead. To do this, make a div to modify, and assign it a random id, then edit the innerHTML of it. It should look like this in the end:
Code:
$safeId = vbrand(1, 1000000);
return "<div id=\"safe_container_$safeId\"></div><script type=\"text/javascript\"> document.getElementById('safe_container_$safeId').innerHTML = decode64('$fixed'); </script>";
That should work!
Reply With Quote
  #23  
Old 01-15-2008, 04:12 AM
thalamus's Avatar
thalamus thalamus is offline
 
Join Date: Sep 2005
Location: UK
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for that, Gwyrgyn! :up:

I did a quick checkup, and found the applicable notes here:

http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite

since AJAX is a "standards-based presentation using XHTML and CSS" this would obviously affect it.

I'll go through the code tomorrow and do a check; then if it all works and I'm happy with it I'll update the product.

Many thanks again... I hope the above will explain it for others who may come across the same situation
Reply With Quote
  #24  
Old 01-15-2008, 04:39 AM
thalamus's Avatar
thalamus thalamus is offline
 
Join Date: Sep 2005
Location: UK
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, seems to work great with the quick reply, but quick edit is obviously handled differently as when a quick edit is saved, the text within the safe tags does not show on the page. However, it is there and shows again once the page is refreshed... I'll check further into it. I'll leave the first post bug report as is for now.
Reply With Quote
  #25  
Old 05-18-2008, 08:54 AM
thalamus's Avatar
thalamus thalamus is offline
 
Join Date: Sep 2005
Location: UK
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unfortunately, I've not been able to spend much time on looking at fixing this mod for the quick reply functions, and I'm not sure how they'll work within the new 3.7 version so with regret, I have to remove my support for this modification.

Thanks to those of you who downloaded and provided me with feedback; perhaps at some future date I may be able to get back to it (time and inclination permitting).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03846 seconds
  • Memory Usage 2,256KB
  • Queries Executed 19 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete