Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Highlight and link function names inside code Details »»
Highlight and link function names inside code
Version: 1.00, by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-26-2002 Last Update: Never Installs: 11
 
No support by the author.

Here's a nice idea I got from another site, which highlights all function names in PHP code and links to their documentary. In this hack the functions are linked to PHP.NET's docs.
Needless to add this is perfect for sites that deal with PHP coding.

Demo:
Code:
  if(!$dohtml)  { // kill any rogue html code
    // $bbcode=str_replace("&","&",$bbcode);
    $bbcode=str_replace("<","<",$bbcode);
    $bbcode=str_replace(">",">",$bbcode);
    $bbcode=str_replace("<","&lt;",$bbcode);
    $bbcode=str_replace(">","&gt;",$bbcode);
  }
  $bbcode=nl2br($bbcode);
(also works inside [php] tags)

To install this hack download the attached file (linkfuncs.hack.php), upload to your /admin folder and use vbHacker.

Have fun!

Show Your Support

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

Comments
  #2  
Old 02-27-2002, 02:56 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats great, i saw it on evilwalrusdotcom. Great addition, thanks :up:
Reply With Quote
  #3  
Old 02-27-2002, 03:39 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup, that's where I saw it too! Although they are using their own docs for the functions.
Reply With Quote
  #4  
Old 02-28-2002, 06:29 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I see you're using it here. I have a complaint about this hack being used here.

Sometimes people post code here that is part of a hack. I like to keep local text files of hack instructions so that I can have a record of everything I've done, and can quickly re-apply each hack after a vB upgrade without having to search all over the forums for every hack I want. So when someone posts code directly in a message, I have to copy that and put it in a text file myself.

The problem is that some editors, if you copy a hyperlink into it, will spell out the full URL of the link. For example, WordPad. I normally use Notepad on my Win2k computer, but for reasons which don't matter here, lately I've been having to access the Internet from my parents' computer, which only has WinMe on it, and the Notepad on WinMe sucks (it doesn't recognize any of the standard keyboard shortcuts and the search feature is limited, too). So I'm kind of forced to use WordPad here as my text editor, and even if you start a new document in text mode, if you paste anything with formatting into the window it still keeps the formatting, it just takes the formatting away when you save it as a text file.

The problem is that if I try to copy, for example, this:
PHP Code:
$post[joindate]=vbdate($registereddateformat,$post[joindate]); 
...WordPad turns it into this:
PHP Code:
$post[joindate]=vbdate <http://www.php.net/date>($registereddateformat,$post[joindate]); 
If it's just one line, I might catch it, but if it's a big block of code, I might not. I shouldn't have to worry about it.

Aside from all that, your hack didn't even work right for the example I just posted. I guess it just saw date( and assumed it was a PHP function? But it's not. It's vbdate(, a custom vB-only function.

Perhaps there should be a way for a user (like me) to turn this feature off. I don't need it and won't use it, and it's just going to get in my way. I don't really see it being used very much in general, anyway; at least for me, when I'm getting code out of these forums is not the time I want to know what a specific function does. It's when I'm editing code later on that I might want to know what something does.

Just my 2?.
Reply With Quote
  #5  
Old 03-01-2002, 01:15 AM
Xelation's Avatar
Xelation Xelation is offline
 
Join Date: Jan 2002
Location: Buffalo, New York
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just installed it with no problems, great hack firefly!
Reply With Quote
  #6  
Old 03-01-2002, 02:07 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JJR512
The problem is that some editors, if you copy a hyperlink into it, will spell out the full URL of the link.
convince your parents to let you install EditPlus2 or...... UltraEdit90 (my preferate.. )
Reply With Quote
  #7  
Old 03-01-2002, 11:26 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

a) The bug where vbdate() is parsed as date() and unlink() is parsed as link() should be fixed now.
Code:
unlink($bob);
$foo = vbdate($bar);
b) I will try to add a user option to enable/disable this hack soon.
Reply With Quote
  #8  
Old 03-01-2002, 11:48 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Done. Feel free to turn this off in your options.
Reply With Quote
  #9  
Old 03-26-2002, 07:32 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uploaded a vbHacker version.
Reply With Quote
  #10  
Old 03-29-2002, 05:35 AM
Visionray's Avatar
Visionray Visionray is offline
 
Join Date: Feb 2002
Location: DC - USA
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice hack!
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 04:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04327 seconds
  • Memory Usage 2,298KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (2)bbcode_php
  • (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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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