vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Advanced Syntax Highlighting - BBCode [highlight] (https://vborg.vbsupport.ru/showthread.php?t=93071)

Andreas 07-27-2005 10:00 PM

Advanced Syntax Highlighting - BBCode [highlight]
 
Advanced Syntax Highlighting
This Hack provides a [highlight] BBCode to highlight a wide range of Languages such as XML, HTML, Java, Javascript, SQL and so on.
It uses GeSHi, which is included in this ZIP.

Details
1 Product XML with 2 Plugins and 2 Templates

Please only click Install if you actually have installed/are using this Hack, and click Uninstall whan you don't use it any longer!

Chris M 07-28-2005 04:15 PM

Quote:

Warning: Unknown(/home/xxx/public_html/xxx/includes/geshi.php): failed to open stream: No such file or directory in /includes/class_bbcode.php(148) : eval()'d code on line 70

Fatal error: (null)(): Failed opening required '/home/xxx/public_html/xxx/includes/geshi.php' (include_path='.:/usr/local/lib/php') in /home/xxx/public_html/xxx/includes/class_bbcode.php(148) : eval()'d code on line 70
:ermm:

Edit: I re-uploaded geshi.php and it worked - Odd :speechless:

Satan

prawn 07-28-2005 05:40 PM

great idea. thanks kirby :)

but html highlightning does not show up colored. what am i doing wrong?

greets

Andreas 07-28-2005 05:51 PM

You must use the Names of the Files in Directory geshi, eg. for HTML you must use html4strict:

[hightlight=html4strict]
<!-- some HTML here -->
[/highlight]

prawn 07-28-2005 05:58 PM

ah thank you. that's pretty easy. didn't really look into the geshi dir.

Boofo 07-29-2005 12:11 AM

Is there a way we can make a bbcode replacement for like sql and xml tags? And is there any way to take the numbers out of the code on each line at the beginning?

Boofo 07-29-2005 06:49 AM

It looks like xml hightlighting gets broken.

Andreas 07-29-2005 07:41 AM

Line Numbers -> Edit the Plugin (Hook bbcode_create) and comment out $geshi->enable_line_numbers

Furure Versions might include a setting for this.

As for the Screenshot: Can you post the Text which generated this output?

If you want to have [sql] and [xml] Tags, I guess you would have to create similar handlers that would then call handle_bbcode_highlight

Boofo 07-29-2005 08:00 AM

Sure thing. ;)

Here you go.

Quote:

<?xml version="1.0" encoding="ISO-8859-1"?>
<navgroups product="vbulletin">
<navgroup phrase="styles_and_templates" permissions="canadminstyles" displayorder="20">
<navoption displayorder="12">
<phrase>edit_templates</phrase>
<link>template.php?do=modify&amp;expandset=1</link>
</navoption>
<navoption displayorder="14">
<phrase>view_all_templates</phrase>
<link>template.php?do=modify&amp;expandset=1&amp;g roup=all</link>
</navoption>
<navoption displayorder="16">
<phrase>add_new_template</phrase>
<link>template.php?group=&amp;do=add&amp;dostyleid =all</link>
</navoption>
</navgroup>
<navgroup phrase="languages_and_phrases" permissions="canadminlanguages" displayorder="30">
<navoption displayorder="25">
<phrase>add_new_phrase</phrase>
<link>phrase.php?do=add</link>
</navoption>
</navgroup>
</navgroups>
This is something I did for my admin cpnav.

Andreas 07-29-2005 08:13 AM

This is the Output I get on my Board ...


All times are GMT. The time now is 01:50 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.01210 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete