Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 03-22-2008, 09:45 PM
workplaybiz workplaybiz is offline
 
Join Date: Jan 2006
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default What hook/file is used just before the vbulletin page is displayed?

I am working on a modification and I have a quick question -
What hook/file is used just before the vbulletin page is displayed?

I am looking to add a line of php code to the end of every outputted template before it is displayed to the user.

I have looked through the code and I have come up with:
eval('print_output("' . fetch_template('TEMPLATENAME') . '");');
as the line that outputs the template.

It would be ideal if I could create a plugin to do this.

Thanks,
John

--------------- Added [DATE]1206227479[/DATE] at [TIME]1206227479[/TIME] ---------------

I am trying to use IonCube's HTML encoder (http://www.ioncube.com/html_encoder.php) to encode outputted files.
Reply With Quote
  #2  
Old 03-23-2008, 03:00 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It depends on the page. There is no "universal" hook, unless it's been added very recently.
Reply With Quote
  #3  
Old 03-23-2008, 03:05 AM
workplaybiz workplaybiz is offline
 
Join Date: Jan 2006
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would you suggest protecting the source code for a page created with Gary King's Template Article (https://vborg.vbsupport.ru/showthread.php?t=62164) using IonCube's HTML encoder?
Reply With Quote
  #4  
Old 03-23-2008, 03:19 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML cannot be "protected". Browsers need raw HTML to display anything, so in the end, you'll get it anyway. IonCube's encoder only obfuscates HTML, which only slows down viewing the source code. To be honest with you, I got the source code of the "encoded" demo page in 5 seconds.
Reply With Quote
  #5  
Old 03-23-2008, 03:20 AM
Darkwaltz4's Avatar
Darkwaltz4 Darkwaltz4 is offline
 
Join Date: Oct 2002
Location: Chicago
Posts: 1,538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the hook you are looking for is: global_complete
Reply With Quote
  #6  
Old 03-23-2008, 03:35 AM
workplaybiz workplaybiz is offline
 
Join Date: Jan 2006
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My main goal is to protect some JavaScript and PHP source code... It is very important that this code is protected. I filed a provisional patent on the source code and it will be central to the uniqueness of my website. I am not as worried about protecting the PHP source code.

Would you suggest putting the source code in a directory above public_html so it would not be accessible by URL, linking to the code and obfuscating the <script src="../../myfile.js"> statement and the PHP include statements and the JavaScript code itself? Is there anything else you would suggest doing?

I realize I can't fully protect JavaScript code, but I want to make it difficult for someone to view.

Thanks,
John
Reply With Quote
  #7  
Old 03-23-2008, 04:14 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If the browser can view it, it's easy to view. I can assure you, anything you do the the source to try to hide it won't really do anything. I can promise you I can get such raw source code in a matter of seconds.
Reply With Quote
  #8  
Old 03-23-2008, 04:37 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Javascript is even easier as you can just download the js file it uses.
Reply With Quote
Reply

Thread Tools
Display Modes

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 09:25 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.04082 seconds
  • Memory Usage 2,216KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete