Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: AzaToth on September 25, 2005, 06:50:16 PM

Title: GeSHiSmf
Post by: AzaToth on September 25, 2005, 06:50:16 PM
Link to Mod (http://mods.simplemachines.org/index.php?mod=200)

A implementation of GeSHI (Generic Syntax Highlighter) for SMF

This is a modification that replace the ordinary code tags, to enable them to syntax highlight code other than php. This is done by parsing the code throught GeSHi and print the result in the post. Support is for  languages like perl, html, c, qbasic etc...

Quote from: GeSHi homepage (http://qbnz.com/highlighter/)GeSHi started as an idea to create a generic syntax highlighter for the phpBB forum system, but has been generalised to this project. GeSHi aims to be a simple but powerful highlighting class, with the following goals:

    * Support for a wide range of popular languages
    * Easy to add a new language for highlighting
    * Highly customisable output formats

GeSHi aims to do this all as quickly as possible. Many customisable features of GeSHi facilitate speed increases, and you can easily find a balance between the amount of highlighting done and the speed in which it is done.

Supported languages:


Example:



Usage:

[code=perl]my $var = undef;[/code]


One pulldown menu in default and classic is also implemented:


Only tested on vanilla 1.1 RC1
Title: Re: GeSHiSmf
Post by: ExistenZ on September 25, 2005, 07:17:06 PM
WOW! I have been waiting for this ll my life! THANK YOU!
Title: Re: GeSHiSmf
Post by: ANARCH¥ on September 25, 2005, 07:26:35 PM
arghhh i want this ... for SMF 1.0 RC2.
lol

hmmm sry
Title: Re: GeSHiSmf
Post by: AzaToth on September 25, 2005, 07:47:19 PM
Quote from: ANARCH¥ on September 25, 2005, 07:26:35 PM
arghhh i want this ... for SMF 1.0 RC2.
lol

hmmm sry
a reason to upgrade :)
Title: Re: GeSHiSmf
Post by: Jazhawk on September 25, 2005, 10:58:00 PM
What does this do exactly?

-Jazhawk
Title: Re: GeSHiSmf
Post by: JayBachatero on September 25, 2005, 11:30:11 PM
Quote from: Jazhawk on September 25, 2005, 10:58:00 PM
What does this do exactly?

-Jazhawk

You can use it to highlight syntax code for other programming languages other than php.
Title: Re: GeSHiSmf
Post by: Enc0der on September 26, 2005, 04:33:08 AM
awesome!
Title: Re: GeSHiSmf
Post by: AzaToth on September 26, 2005, 09:37:19 AM
If anyone have problem with uninstalling this mod please tell me, if you do not have problem with uninstalling then there is a bug in SMF and you should contact [unknown].
Title: Re: GeSHiSmf
Post by: Phoenix Man on September 26, 2005, 12:23:48 PM
Nice.
Just a small add-on, but would you like to add support for the DM language as well?

It's the standard BYOND language. http://developer.byond.com/
Title: Re: GeSHiSmf
Post by: AzaToth on September 26, 2005, 01:20:49 PM
Quote from: Phoenix Man on September 26, 2005, 12:23:48 PM
Nice.
Just a small add-on, but would you like to add support for the DM language as well?

It's the standard BYOND language. http://developer.byond.com/
That I'm sorry you have to speak to the GeSHi developer (http://qbnz.com/highlighter), I have just make the interface for smf.
Title: Re: GeSHiSmf
Post by: ArkServer on September 26, 2005, 01:28:37 PM
Could be me.. there is no install option for 1.1 beta 3
Title: Re: GeSHiSmf
Post by: AzaToth on September 26, 2005, 01:38:09 PM
Quote from: ArkServer on September 26, 2005, 01:28:37 PM
Could be me.. there is no install option for 1.1 beta 3
Thats because I have no beta3 installation, I don't know exactly whats the difference for RC1 and beta3 is for this kind of mod, You can try to substitute RC 1 to beta 3 Public and see if it works...
Title: Re: GeSHiSmf
Post by: ArkServer on September 26, 2005, 03:49:27 PM
Quote from: AzaToth on September 26, 2005, 01:38:09 PM
Quote from: ArkServer on September 26, 2005, 01:28:37 PM
Could be me.. there is no install option for 1.1 beta 3
Thats because I have no beta3 installation, I don't know exactly whats the difference for RC1 and beta3 is for this kind of mod, You can try to substitute RC 1 to beta 3 Public and see if it works...

oh ok, it says it 's compatible with 1.1 beta 3 but  nevermind :P ill keep an eye open for this topic in case you make it 1.1 beta 3 compatible


Title: Re: GeSHiSmf
Post by: AzaToth on September 26, 2005, 03:53:33 PM
Quote from: ArkServer on September 26, 2005, 03:49:27 PM
Quote from: AzaToth on September 26, 2005, 01:38:09 PM
Quote from: ArkServer on September 26, 2005, 01:28:37 PM
Could be me.. there is no install option for 1.1 beta 3
Thats because I have no beta3 installation, I don't know exactly whats the difference for RC1 and beta3 is for this kind of mod, You can try to substitute RC 1 to beta 3 Public and see if it works...

oh ok, it says it 's compatible with 1.1 beta 3 but  nevermind :P ill keep an eye open for this topic in case you make it 1.1 beta 3 compatible

I had to choose one, and 1.1 RC1 option isn't there, sorry...

Title: Re: GeSHiSmf
Post by: Bosswaiter on September 28, 2005, 04:39:04 AM
VERY nice and very helpful !

Only changed the css (smaller font + no maximum lines) for improved reading.

.geshi {
   color: #000000;
   background-color: #cccccc;
   font-family: monospace;
   font-size: small;
   border: 1px solid #000000;
   margin: 1px auto 1px auto;
   padding: 1px;
   width: 99%;
   overflow: auto;
   white-space: pre;
}
Title: Re: GeSHiSmf
Post by: ArkServer on September 30, 2005, 07:20:04 AM
Any update?
Title: Re: GeSHiSmf
Post by: dtm.exe on September 30, 2005, 08:12:54 AM
Nice mod :).
Title: Re: GeSHiSmf
Post by: v3x on October 02, 2005, 02:04:06 AM
Can this be updated for the newest SMF version?
Title: Re: GeSHiSmf
Post by: AzaToth on October 02, 2005, 10:03:40 AM
Quote from: v3x on October 02, 2005, 02:04:06 AM
Can this be updated for the newest SMF version?
It's for SFM 1.1 RC1, it's says "Compatible for 1.1 beta3" because  the mod-section isn't updated yet.
Title: Re: GeSHiSmf
Post by: v3x on October 02, 2005, 10:10:57 AM
Will it interfere with any of my currently installed mods? Like for example, the arcade button and such.

Edit: I'm talking about the upgrade, not this mod.
Title: Re: GeSHiSmf
Post by: Uzbekistan on October 04, 2005, 03:55:30 AM
Yes, it will delete them (upgrade from beta 3 to rc1).
Title: Re: GeSHiSmf
Post by: cadetill on October 18, 2005, 07:14:34 AM
Hi

SQL language doesn't format multiple comments.

I have changed


'COMMENTS' => array(
1 => 'color: #808080; font-style: italic;',
2 => 'color: #808080; font-style: italic;'
),


to


'COMMENTS' => array(
1 => 'color: #808080; font-style: italic;',
2 => 'color: #808080; font-style: italic;',
'MULTI' => 'color: #808080; font-style: italic;'
),


in the sql.php file, but it doesn't work.

Any idea?

Thanks
Title: Re: GeSHiSmf
Post by: AzaToth on October 18, 2005, 07:51:55 AM
Quote from: cadetill on October 18, 2005, 07:14:34 AM
Hi

SQL language doesn't format multiple comments.

I have changed


'COMMENTS' => array(
1 => 'color: #808080; font-style: italic;',
2 => 'color: #808080; font-style: italic;'
),


to


'COMMENTS' => array(
1 => 'color: #808080; font-style: italic;',
2 => 'color: #808080; font-style: italic;',
'MULTI' => 'color: #808080; font-style: italic;'
),


in the sql.php file, but it doesn't work.

Any idea?

Thanks


Hmm, perhaps you should ask the creator of GeSHi, I have only make the interface for smf.
http://qbnz.com/highlighter/
Title: Re: GeSHiSmf
Post by: Epimetheus on November 03, 2005, 08:29:35 PM
Any idea when we might see a release for 1.0.5 ? -- I tried hacking the install file, but there were incompatability issues with the install.xml thing and Subs.php, as well as a few other things.
Title: Re: GeSHiSmf
Post by: Oldiesmann on November 03, 2005, 10:44:25 PM
You probably won't at this point. It's best to upgrade to RC1 if you want to use this
Title: Re: GeSHiSmf
Post by: Epimetheus on November 05, 2005, 09:37:56 AM
I assume that most mods that work for 1.0.5 work for RC1?
Title: Re: GeSHiSmf
Post by: AzaToth on November 05, 2005, 09:42:33 AM
Quote from: Epimetheus on November 05, 2005, 09:37:56 AM
I assume that most mods that work for 1.0.5 work for RC1?
It's only a few mods for 1.0.5 that works unmodified for 1.1
Title: Re: GeSHiSmf
Post by: goetzi on November 23, 2005, 12:11:37 PM
This mod doesn't seem to work with german umlauts (ö, ä, ü). They are displayed like &#228 ;  ... Can you fix this?
Title: Re: GeSHiSmf
Post by: Matt McFarland on January 02, 2006, 01:00:03 PM
Is there anything like iths out there for SMF 1.0.5?
Title: Re: GeSHiSmf
Post by: Matt McFarland on January 02, 2006, 01:52:17 PM
Doh I upgraded to RC2 :(
Title: Re: GeSHiSmf
Post by: Matt McFarland on January 03, 2006, 07:14:35 AM
Does anybody know how to get this to work forSMF 1.1 RC2?
Title: Re: GeSHiSmf
Post by: Matt McFarland on January 03, 2006, 03:22:05 PM
Is there any way I can force this to install on RC2?  or is that a bad idea???
Title: Re: GeSHiSmf
Post by: sourpuss on January 06, 2006, 11:28:35 AM
GeSHiSMF for SMF 1.1RC2  8)

GeSHi updated to latest version - 1.0.7.5.

Download NOW! (http://joom.ru/component/option,com_remository/Itemid,0/func,fileinfo/id,40/)
Title: Re: GeSHiSmf
Post by: Matt McFarland on January 06, 2006, 11:42:51 AM

SWEEEEEEEEET!!!
Is there anything special I have to do to get it to work on my theme?
http://www.shmup-dev.com
Title: Re: GeSHiSmf
Post by: TuXie on February 02, 2006, 10:37:48 AM
We want a version of it for SMF 1.0.5. Please.
Title: Re: GeSHiSmf
Post by: RyanJones on February 23, 2006, 09:20:09 AM
Are we allowed to modify these mods?

I'm thinking of implimenting some of its more advanced features suck as line numbers.

Cheers,

Ryan Jones
Title: Re: GeSHiSmf
Post by: rush4hire on April 13, 2006, 05:30:06 AM
Code (perl) Select
my $var = undef;

Whoa!!
I didn't think of that.
I've been trying to make a tag in subs.php . In fact I had been looking in the wrong file, Subs-Post.php

Then I decided to just settle for one language, and hack the dang thing and run the text in [ code][ /code] tags through GeSHi class .. somehow.

Ima have to do that anyway though. I've spent so much time on it already  :'(
Title: Re: GeSHiSmf
Post by: rush4hire on April 15, 2006, 11:45:42 PM
Quote from: sourpuss on January 06, 2006, 11:28:35 AM
GeSHiSMF for SMF 1.1RC2  8)

GeSHi updated to latest version - 1.0.7.5.

Download NOW! (http://joom.ru/component/option,com_remository/Itemid,0/func,fileinfo/id,40/)

That's not english.

I can't get it to work on SMF 1.1 RC2

dang!
Title: Re: GeSHiSmf
Post by: ArkServer on April 16, 2006, 06:31:26 AM
Quote from: rush4hire on April 15, 2006, 11:45:42 PM
Quote from: sourpuss on January 06, 2006, 11:28:35 AM
GeSHiSMF for SMF 1.1RC2  8)

GeSHi updated to latest version - 1.0.7.5.

Download NOW! (http://joom.ru/component/option,com_remository/Itemid,0/func,fileinfo/id,40/)

That's not english.

I can't get it to work on SMF 1.1 RC2

dang!
Works fine here, if you want an example i can give u a link.
Title: Re: GeSHiSmf
Post by: Harzem on April 16, 2006, 09:11:55 AM
This mod is great, especially for forums that are about programming, like mine :)

Thanks for everyone who brought that mod from beginning of geshi up to RC2 compatibility :)
Title: Re: GeSHiSmf
Post by: ArkServer on April 16, 2006, 02:56:00 PM
Quote from: HarzeM on April 16, 2006, 09:11:55 AM
This mod is great, especially for forums that are about programming, like mine :)

Thanks for everyone who brought that mod from beginning of geshi up to RC2 compatibility :)

That's why im also using this mod :) its great for coders!
Title: Re: GeSHiSmf
Post by: reynierpm on May 18, 2006, 01:42:54 PM
Well I have another theme that usually are not default and classic. Who I can add the Geshi to my Editor? Maybe in a select menu.
Regards,
Title: Re: GeSHiSmf
Post by: theshown on May 24, 2006, 02:30:03 PM
I can't get it work with SMF 1.1 RC2 and i installed the posted mod for this version of SMF.

Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Sources/Subs.php    Test failed
2.    Execute Modification    ./Themes/default/style.css    Test successful
3.    Execute Modification    ./Themes/classic/style.css    Test successful
4.    Execute Modification    ./Themes/default/Post.template.php    Test successful
5.    Execute Modification    ./Themes/classic/Post.template.php    Test successful
6.    Extract Tree    ./Sources/geshi

And if i continue installing (was not recommended) i get the following error when i try to post a message which contains something like
Quote[syntax=language]some code bla bla bla[/language]
:
i can post but i get something like this:
QuoteCode:
as if i would include no code inside [syntax=language][/syntax]

anyone who can help me??  :'(

P.S. i tried to put up version 1.1 RC1 with the related Geshi mod version. And when i try to post, i get the following message:

Fatal error: Cannot instantiate non-existent class: geshi in /web/htdocs/www.domainname.com/home/forum/Sources/Subs.php(1110) : runtime-created function on line 14
Title: Re: GeSHiSmf
Post by: ArkServer on May 24, 2006, 07:30:29 PM
Can;t you edit the subs file manually?
Title: Re: GeSHiSmf
Post by: theshown on May 25, 2006, 02:50:59 AM
Quote from: ArkServer on May 24, 2006, 07:30:29 PM
Can't you edit the subs file manually?
and how should i edit it?

i took it as it came with the whole forum.

ps: the installation of mod with SMF 1.1 RC1 is successful even if in the point 1, so it should work fine. But when i try posting or previewing a message, it gives me that error.
I do not want to find another board in which this highlighter works.
Thank you in advance
Title: Re: GeSHiSmf
Post by: Harzem on May 25, 2006, 03:06:49 AM
What other mods do you have?
Title: Re: GeSHiSmf
Post by: theshown on May 25, 2006, 08:41:30 AM
absolutely no others.

-----------
1. I tried reuploading Subs.php file to /Sources dir, with no result.
2. I am not totally stranger to programming, so i gave a look to line 1110 in Subs.php and i noticed:
'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
global $context;

and i modified it by removing the space
'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', 'global $context;

3. By doing this the problem is solved, but the result i get is that if i use
Code ($language) Select
bla bla bla bla i get the same of bla bla bla bla  with absolutely no highlighting >:(

i'm sorry, i got a very good impression by this bulletin board, but for this problem i think to look forward to vBulletin because i need this problem solved as soon as possible :(
Title: Re: GeSHiSmf
Post by: Harzem on May 25, 2006, 03:58:46 PM
It's strange to see you can't install this mod. I have this mod and it installs and works nice.

Can you try installing another mod? We should identify the problem, whether it is about this specific package or for all packages.
Title: Re: GeSHiSmf
Post by: theshown on May 25, 2006, 05:24:08 PM
i tried installing other mods and all works fine. :|
Title: Re: GeSHiSmf
Post by: theshown on June 14, 2006, 06:36:45 PM
i am definitely back to SMF because I begin to love it and i finally succeed in installing GeSHiSmf, and it's so great mod  :-*
Title: Re: GeSHiSmf
Post by: theshown on June 15, 2006, 02:54:34 AM
if one would like to add new languages or update the geshi.php engine, is it enough uploading the updated geshi.php file and new (or updated) language files and modifying the list box from which select the language to highlight???
If affermative, is correct adding options to listbox like this:
<option value="languagex"> Language X </option>
where in /geshi/ there is a file called languagex.php
???
Title: Re: GeSHiSmf
Post by: phil2win on August 08, 2006, 07:16:26 PM
theshown: mind sharing how you finally fixed it? I've been trying to get GeSHiSmf 0.0.8 to work on my forum for a while now, running 1.1 RC2. I'm getting the same error message you were:

Fatal error: Cannot instantiate non-existent class: geshi in blahblah/testforum/Sources/Subs.php(1158) : runtime-created function on line 14

I haven't had any problems installing other mods, and as you can see, I even made a test forum running a clean 1.1 RC2, no other mods, with it's own database.
Title: Re: GeSHiSmf
Post by: theshown on August 09, 2006, 07:24:32 PM
I remember that i got errors in installing this mod because at that time I didn't know at all the Auto Installer utility inside SMF Forum Administation. Then I simply downloaded the 0.0.8 version of the mod and uploaded the package through the form in "Dowloaded Packages" page in "Packages" section. And all  worked fine. Then i upgraded the languages come with the package with the ones of Geshi project and added the new languages to the posting form list box ;) And all worked fine again.
Title: Re: GeSHiSmf
Post by: phil2win on August 10, 2006, 05:50:12 PM
Wow, it actually worked. Uploading the file (whether the unpacked directory or the gzipped file) through FireFTP didn't work, but using SMF's upload script did work. Strange how that works, but it works, so it's all good.

Thanks a lot, theshown.
Title: Re: GeSHiSmf
Post by: deadpoeticstar on August 14, 2006, 12:07:34 PM
any word on an update for RC3?
Title: Re: GeSHiSmf
Post by: HecKel on August 24, 2006, 10:49:37 PM
I want to upgrade to RC3..., but I want that some mods can be compatible..., and this is one of them...

Any idea when this is ok?

HecKel
Title: RC3 update
Post by: Kakao on August 25, 2006, 11:32:54 AM
I have updated it for RC3:

http://codepoint.net/Packages/GeSHiSmf.tar.gz

Changes from GeSHiSmf 0.0.8:

-changed the SMF indicated version from RC2 to RC3
-changed font-size from 1.3em to 1em
-removed GeSHi header and footer from highlighted code
-upgraded GeSHi version to 1.0.7.13
-added the new languages in the new GeSHi version to GeSHiSmf
Title: Re: GeSHiSmf
Post by: No0oB on September 02, 2006, 01:33:47 PM
Thank you so much!
PS: I found a bug.
When you want to have a "viewable" code, it wil interprete the spaces as   (That is only in preview tho :) )
PPS: Is it possible, to make it show the line number?
Title: Re: GeSHiSmf
Post by: AzaToth on September 07, 2006, 10:34:47 AM
Quote from: HecKel on August 24, 2006, 10:49:37 PM
I want to upgrade to RC3..., but I want that some mods can be compatible..., and this is one of them...

Any idea when this is ok?

HecKel
I jump on is ASAP.
Title: Re: GeSHiSmf
Post by: AzaToth on September 07, 2006, 12:54:48 PM
Released now 0.0.9.

Changes form 0.0.8:

Title: Re: GeSHiSmf
Post by: Bigguy on September 24, 2006, 01:36:20 PM
I'm getting loads of this in my error log. Any fix at all:

8: Undefined index: geshi_enable_footer
File: /home/****/public_html/smfhelper/Sources/Subs.php(1192) : runtime-created function
Line: 28
Title: Re: GeSHiSmf
Post by: Leo.J90 on September 26, 2006, 10:52:41 PM
Why it doesn't work with v1.0.8?
Title: Re: GeSHiSmf
Post by: Bigguy on October 16, 2006, 07:23:52 PM
Anyone know about this. ???

Quote from: Bigguy on September 24, 2006, 01:36:20 PM
I'm getting loads of this in my error log. Any fix at all:

8: Undefined index: geshi_enable_footer
File: /home/****/public_html/smfhelper/Sources/Subs.php(1192) : runtime-created function
Line: 28

Title: Re: GeSHiSmf
Post by: Mark0 on October 16, 2006, 08:01:08 PM
I too get errors every time a page with Geshi code is loaded, slightly different:

8: Undefined offset: 0
File: C:\ .. \forum\Sources\geshi\geshi.php
Line: 2090


Aside from these entries in the errors log, the layout seems to have no problems.
On SMF 1.1 RC3, with default theme and no other mod installed aside from this.

Thanks,
Bye!
Title: Re: GeSHiSmf
Post by: Bigguy on November 03, 2006, 01:50:43 PM
Bump !!!

Quote from: Bigguy on October 16, 2006, 07:23:52 PM
Anyone know about this. ???

Quote from: Bigguy on September 24, 2006, 01:36:20 PM
I'm getting loads of this in my error log. Any fix at all:

8: Undefined index: geshi_enable_footer
File: /home/****/public_html/smfhelper/Sources/Subs.php(1192) : runtime-created function
Line: 28

Title: Re: GeSHiSmf
Post by: AzaToth on November 05, 2006, 12:37:31 PM
Quote from: Bigguy on November 03, 2006, 01:50:43 PM
Bump !!!

Quote from: Bigguy on October 16, 2006, 07:23:52 PM
Anyone know about this. ???

Quote from: Bigguy on September 24, 2006, 01:36:20 PM
I'm getting loads of this in my error log. Any fix at all:

8: Undefined index: geshi_enable_footer
File: /home/****/public_html/smfhelper/Sources/Subs.php(1192) : runtime-created function
Line: 28


That might be able to happen, if you are using a theme that have redefined boarddir/Themes/default/Settings.template.php

Title: Re: GeSHiSmf
Post by: Bigguy on November 05, 2006, 12:54:27 PM
Is there a fix for it or do I just let it go.
Title: Re: GeSHiSmf
Post by: AzaToth on November 06, 2006, 10:50:59 AM
Quote from: Bigguy on November 05, 2006, 12:54:27 PM
Is there a fix for it or do I just let it go.
There always a fix (tm), but I don't know what exactly your current theme has done.
Title: Re: GeSHiSmf
Post by: Bigguy on November 06, 2006, 01:51:26 PM
I am using the "Default_modern" Theme. It has 1 template file and a css file. The rest is called from the default theme.
Title: Re: GeSHiSmf
Post by: DerEineDa on November 12, 2006, 08:47:59 PM
I don't know if it was mentioned before, but there is a little typo in
/Sources/geshi/geshi/java.php , line 1374

This is what it looks like:
3 => 'http://www.google.com/search?hl=en&amp;q=allinurl%3A{FNAME}+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky',


Looks like it is supposed to do a "I'm Feeling Lucky" search on Google, but there is a typo, so it doesn't work. Just change "bntI" to "btnI":
3 => 'http://www.google.com/search?hl=en&amp;q=allinurl%3A{FNAME}+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky',


It's working then.
Title: Re: GeSHiSmf
Post by: RXL on December 05, 2006, 04:17:58 PM
Quote from: AzaToth on November 05, 2006, 12:37:31 PM
Quote from: Bigguy on November 03, 2006, 01:50:43 PM
Bump !!!

Quote from: Bigguy on October 16, 2006, 07:23:52 PM
Anyone know about this. ???

Quote from: Bigguy on September 24, 2006, 01:36:20 PM
I'm getting loads of this in my error log. Any fix at all:

8: Undefined index: geshi_enable_footer
File: /home/****/public_html/smfhelper/Sources/Subs.php(1192) : runtime-created function
Line: 28


That might be able to happen, if you are using a theme that have redefined boarddir/Themes/default/Settings.template.php

I have this problem too.

This found in error log:
Quote
2: opendir(/var/www/virt/forum.host1.local/www/Packages/tempGeSHiSmf//GeSHiSmf/geshi): failed to open dir: No such file or directory
File: /var/www/virt/forum.host1.local/www/Sources/Subs-Package.php
Line: 1253

My fix: manual copying 'geshi' directory from ZIP to 'Source'.

smf_1-1_install
GeSHiSmf-0.1.0
Title: Re: GeSHiSmf
Post by: Valodim on December 06, 2006, 05:55:25 PM
awesome mod, thank you :)

about the error mentioned 5 times above: just replace this line

                    $enable_header = $settings[\'geshi_enable_header\'] ? true : false;

with

                    $enable_header = !empty($settings[\'geshi_enable_header\']);

and

                    $enable_footer = $settings[\'geshi_enable_footer\'] ? true : false;

with

                    $enable_footer = !empty($settings[\'geshi_enable_footer\']);

in subs.php


\\ more edit

here's some code to add line highlighting (like here (http://qbnz.com/highlighter/geshi-doc.html#highlighting-special-lines-extra)), simply replace the line

                    $geshi = new GeSHi($data[0],$data[1],$sourcedir.\'/geshi/geshi\');

with

                    $data[1] = explode(\',\', $data[1]);

                    $geshi = new GeSHi($data[0],$data[1][0],$sourcedir.\'/geshi/geshi\');

                    if(count($data[1]) > 1) {
                        array_filter($data[1], \'is_numeric\');
                        $geshi->highlight_lines_extra($data[1]);
                    }

in subs.php to extend the code tag syntax to highlight specific lines like
[kode=language,1,2,3,4,5]
to highlight 1,2,3,4 and 5th line. you need to replace kode with code, of course :P
Title: Re: GeSHiSmf
Post by: Laibeus Lord on December 08, 2006, 07:17:57 AM
Quote from: DerEineDa on November 12, 2006, 08:47:59 PM
I don't know if it was mentioned before, but there is a little typo in
/Sources/geshi/geshi/java.php , line 1374

This is what it looks like:
3 => 'http://www.google.com/search?hl=en&amp;q=allinurl%3A{FNAME}+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky',


Looks like it is supposed to do a "I'm Feeling Lucky" search on Google, but there is a typo, so it doesn't work. Just change "bntI" to "btnI":
3 => 'http://www.google.com/search?hl=en&amp;q=allinurl%3A{FNAME}+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky',


It's working then.

Quote from: Valodim on December 06, 2006, 05:55:25 PM
awesome mod, thank you :)

about the error mentioned 5 times above: just replace this line

                    $enable_header = $settings[\'geshi_enable_header\'] ? true : false;

with

                    $enable_header = !empty($settings[\'geshi_enable_header\']);

and

                    $enable_footer = $settings[\'geshi_enable_footer\'] ? true : false;

with

                    $enable_footer = !empty($settings[\'geshi_enable_footer\']);

in subs.php


\\ more edit

here's some code to add line highlighting (like here (http://qbnz.com/highlighter/geshi-doc.html#highlighting-special-lines-extra)), simply replace the line

                    $geshi = new GeSHi($data[0],$data[1],$sourcedir.\'/geshi/geshi\');

with

                    $data[1] = explode(\',\', $data[1]);

                    $geshi = new GeSHi($data[0],$data[1][0],$sourcedir.\'/geshi/geshi\');

                    $geshi->set_overall_class(\'geshi\');
                    if(count($data[1]) > 1) {
                        array_filter($data[1], \'is_numeric\');
                        $geshi->highlight_lines_extra($data[1]);
                    }

in subs.php to extend the code tag syntax to highlight specific lines like
[kode=language,1,2,3,4,5]
to highlight 1,2,3,4 and 5th line. you need to replace kode with code, of course :P

Thanks to the updates and enhancements!!


The mod file in the mods.s...m...f...org needs an update ;)

Title: Re: GeSHiSmf
Post by: Laibeus Lord on December 13, 2006, 04:52:25 AM
Yep...
I'm getting same errors now:


8: Undefined offset: 0
File: /home/*****/public_html/boards/Sources/geshi/geshi.php
Line: 2090


tons of it...  all the same... all line 2090 of geshi.php

SMF1.1 Final
Default Theme
Title: Re: GeSHiSmf
Post by: liquidlight on December 22, 2006, 06:14:54 PM
Hello, thought this was the right place to post this:
I use SMF 1.1.1 and GeSHiSmf-0.1.0.tar.gz and when i try to "Apply Mod" it I get the following error:
"The package you are trying to download or install is either corrupt or not compatible with this version of SMF."

Is it really compatible with SMF 1.1 but not with 1.1.1 ?

Does anybody have an idea of what could it be?
Title: Re: GeSHiSmf
Post by: Bigguy on December 22, 2006, 08:59:08 PM
It is not updated to work with 1.1.1 Thats what it looks like.
Title: Re: GeSHiSmf
Post by: Valodim on December 23, 2006, 07:28:07 PM
I suppose there's no update needed, just try calling your package manager like this
index.php?action=packages;version_emulate=1.1.1
and try if it outputs any errors if you try to apply the mod. this should work for most 1.1 mods :)
Title: Re: GeSHiSmf
Post by: theshown on January 05, 2007, 05:28:18 PM
it seems to work fine with version 1.1.1 of the board
i've just edited file package-info.xml by replacing the 2 occurrences of "1.1" with "1.1.1" and uploading the archive through smf package installer.
Title: Re: GeSHiSmf
Post by: linuxrush on January 07, 2007, 06:32:41 PM
Quote from: theshown on January 05, 2007, 05:28:18 PM
it seems to work fine with version 1.1.1 of the board
i've just edited file package-info.xml by replacing the 2 occurrences of "1.1" with "1.1.1" and uploading the archive through smf package installer.

Hi, I did the exact same thing. but when I try to post a new topic, the drop down list does not appear.

Also, when I do this:

Code ("php") Select

<?php
echo 'test';
?>



and then click on the "Post" button, the forum errors out. Therefore, I guess this is not functional for 1.1.1, which is a very sad thing :(

-LR
Title: Re: GeSHiSmf
Post by: linuxrush on January 07, 2007, 06:35:43 PM
this is the error the forum generates:
Fatal error: Cannot instantiate non-existent class: geshi in /html/wp/forums/Sources/Subs.php(1181) : runtime-created function on line 15
Title: Re: GeSHiSmf
Post by: theshown on January 08, 2007, 02:00:41 AM
first time I installed GeSHi I got the same (and for same i mean the exact) error because I was uploading the unpacked folder of the mod by FTP when I should install the mod through the internal SMF Package Installer. Are you sure you're doing the same thing as me?
I don't know any other possible reasons you could get this error :(
Maybe you're using a particular Theme which is not included in the mod (different from Default and Classic which are supported by the mod).
If you another theme, look at the file "install.xml" inside the mod archive you've downloaded from SMF Mod Site to know what files must be modified.

what I do each time on each SMF forum upgrade from previous to last version is:
- installing GeSHi mod
- downloading the up-to-date version of GeSHi from its SF.net site
- uploading all the files in the folder /Sources/geshi (and overwriting all files) (but only the files in this directories, no others)
- modify file Themes/default/Post.template.php by searching the line:
// Print a drop down list for all the GeSHi-languages we "allow"!
and eventually adding any new language inserted in the last version of GeSHi.

I know that it could be easier and faster to have a mod which is released each time new GeSHi version is released, with the last languages etc etc
I hope this would be useful to anyone.
Title: Re: GeSHiSmf
Post by: Daniel15 on January 10, 2007, 03:58:50 AM
Quotethis is the error the forum generates:
Fatal error: Cannot instantiate non-existent class: geshi in /html/wp/forums/Sources/Subs.php(1181) : runtime-created function on line 15
I got the same error. To fix this, ensure that the 'geshi' directory was created inside the Sources directory. You should have a Sources/geshi/geshi.php file, and a Sources/geshi/geshi directory. If they don't exist, upload them from the original ZIP file.
Title: Re: GeSHiSmf
Post by: AzaToth on January 12, 2007, 10:22:08 AM
Quote from: Daniel15 on January 10, 2007, 03:58:50 AM
Quotethis is the error the forum generates:
Fatal error: Cannot instantiate non-existent class: geshi in /html/wp/forums/Sources/Subs.php(1181) : runtime-created function on line 15
I got the same error. To fix this, ensure that the 'geshi' directory was created inside the Sources directory. You should have a Sources/geshi/geshi.php file, and a Sources/geshi/geshi directory. If they don't exist, upload them from the original ZIP file.
It's a bug in 1.1.1 that I can't fix. I don't think it will be fixed neither soon.
Title: Re: GeSHiSmf
Post by: theshown on January 12, 2007, 10:36:07 AM
the important thing however is that GeSHiSmf works (I hope so)...
Title: Re: GeSHiSmf
Post by: Daniel15 on January 12, 2007, 08:48:20 PM
Quote from: AzaToth on January 12, 2007, 10:22:08 AM
Quote from: Daniel15 on January 10, 2007, 03:58:50 AM
Quotethis is the error the forum generates:
Fatal error: Cannot instantiate non-existent class: geshi in /html/wp/forums/Sources/Subs.php(1181) : runtime-created function on line 15
I got the same error. To fix this, ensure that the 'geshi' directory was created inside the Sources directory. You should have a Sources/geshi/geshi.php file, and a Sources/geshi/geshi directory. If they don't exist, upload them from the original ZIP file.
It's a bug in 1.1.1 that I can't fix. I don't think it will be fixed neither soon.
Your whole archive (including the package-info.xml file) is in a geshi folder (so the Sources/geshi is actually at geshi/geshi in the archive). Try putting all files in the 'root' of the archive instead
Title: Re: GeSHiSmf
Post by: Laibeus Lord on January 15, 2007, 10:13:40 AM
I'm getting this error:

8: Undefined offset: 0
File: /home/gamesho2/public_html/boards/Sources/geshi/geshi.php
Line: 2090


SMF1.1.1
GeSHiSmf-0.1.0.tar.gz

Any ideas or a fix?  Or is it fine to ignore it??

Thanks!!

Title: Re: GeSHiSmf
Post by: linuxrush on January 20, 2007, 09:23:30 PM
please!!! someone smart enough solve this so I can use this wonderful feature. IF only I knew the inner workings of SMF!!!

-LR
Title: Re: GeSHiSmf
Post by: Valodim on January 21, 2007, 12:08:02 AM
just download geshi from the geshi homepage (-> google) and extract it into your Sources/geshi dir :)
Title: Re: GeSHiSmf
Post by: Coldfx on January 21, 2007, 12:46:17 AM
Also, sometimes, trying to upload into the sources/geshi folder can cause failed attempts.  Delete the empty geshi folder (As about 99.5% users are getting), then copy over the entire geshi folder (Found in the tar.gz package).
Title: Re: GeSHiSmf
Post by: red_ag on February 28, 2007, 12:46:14 PM
Hi.

Where i find GeSHiSmf (http://custom.simplemachines.org/mods/index.php?mod=200) for 1.1.2?
Title: Re: GeSHiSmf
Post by: theshown on February 28, 2007, 12:52:43 PM
Just install it. I'm using it from 1.1 without anykind of problems ;) If it tells that it's not compatible with your forum version change the proper info in the file package-info.xml inside the .zip file of the mod and then upload it.
Title: Re: GeSHiSmf
Post by: AzaToth on March 18, 2007, 12:36:21 PM
When I was going to make a package for 1.1.1 before, I got the problem with the geshi folder, that it didn't been copied. I don't know if it's fixed for 1.1.2, I'll look into it

/Carl
Title: Re: GeSHiSmf
Post by: AzaToth on March 18, 2007, 12:53:01 PM
have made a package for 1.1.2 now, and it seems to work. also included the latest geshi release.
Title: Re: GeSHiSmf
Post by: theshown on March 18, 2007, 01:02:08 PM
great work, i wait package for next release of smf :P then i'll install it
Title: Re: GeSHiSmf
Post by: edwardsiow on April 01, 2007, 03:47:40 PM
another undefined indexed...

8: Undefined index: geshi_numbering
File: /home/mortgago/domains/mortgago.com/public_html/Sources/Subs.php(1242) : runtime-created function
Line: 32

anybody please help me....thanks...

your kindness much appreciated...
Title: Re: GeSHiSmf
Post by: edwardsiow on April 01, 2007, 04:06:57 PM
ok....after i have turned on the geshi numbering, that errors disappeared...

thanks god...

Title: Re: GeSHiSmf
Post by: Kirill Krasnov on May 24, 2007, 08:49:17 AM
How I can post national character in geshi code?
I see something like that
   z11=z1;z12=Найти(z1,"-");
Title: Re: GeSHiSmf
Post by: BlueSteel on July 16, 2007, 05:12:01 AM
Grrrrr tried changing the package-info.xml to include ,1.1.3 and reziped it .. but niow its saying that the zip is corrupt or not a valid smf mod ..

Can somerone please tell me what i did wrong or what i need to do to get it to install on SMF 1.1.3

plz ..
(PS: an attachment of fixed archive to install would be prefered and greatly appreciated)
Title: Re: GeSHiSmf
Post by: BlueSteel on July 18, 2007, 07:47:40 AM
still waiting for a reply :( i can't believe that no one has edited this to work with SMF 1.1.3
Title: Re: GeSHiSmf
Post by: TrueSatan on July 18, 2007, 08:39:43 AM
 Unfortunately Motoko-chan moderated to remove the attachment the last time I provided such an update and gave me a slapped wrist for doing it...SMF make the rules and we must abide by them (biting lip very hard to avoid saying more.)

I changed this mod in the normal way to add SMF 1.1.3 compatibility and installed it on a test forum...no problems.

If you'd like to try it again you could always use version emulate to install the package. Put ;emulate_version=1.1.2 at the end of the Package Manager URL
Title: Re: GeSHiSmf
Post by: BlueSteel on July 18, 2007, 12:55:45 PM
didn't work.. still came up with the error

Quote
Install Actions
Installations actions for "GeSHiSmf":
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Title: Re: GeSHiSmf
Post by: AzaToth on July 18, 2007, 01:16:53 PM
Updated for 1.1.3, also including geshi 0.7.20
Title: Re: GeSHiSmf
Post by: BlueSteel on July 18, 2007, 02:20:51 PM
Why am i getting heaps of these errors

I have geshi headers , footers and linenumbers turned on..


http://www.codingmonkeys.com/index.php?topic=704.msg3971
8: Undefined offset: 2
File: /home/monkey1/public_html/Sources/geshi/geshi.php
Line: 2133

and

http://www.codingmonkeys.com/index.php?topic=616.msg3457
8: Undefined offset: 0
File: /home/monkey1/public_html/Sources/geshi/geshi.php
Line: 2172
Title: Re: GeSHiSmf
Post by: Valodim on August 07, 2007, 10:33:56 AM
Two things:
1) I suggest you add an additional trim() for $data[0] to strip leading and trailing whitespace, because code like this

function blah(int lol) {
}

would have an additional empty line at the end, kinda annoying when you have line numbering enabled.

2) you use the global variable $settings without declaring it (not sure if this is still valid for latest version)
Title: Re: GeSHiSmf
Post by: ArkServer on August 26, 2007, 07:18:29 AM
Is it possible to remove the scrollbar and let the user see the entire code, or add an option to do so?
because when i post some larger code the scrollbar becomes annoying.

example:

http://www.engineeringserver.com/t3hc0d3z/using+threads+to+display+the+time-t105.0.html
http://www.engineeringserver.com/t3hc0d3z/create+directory+file+and+write+data-t184.0.html
http://www.engineeringserver.com/t3hc0d3z/program+menu-t86.0.html
etc

thanks, i love the mod :)
Title: Re: GeSHiSmf
Post by: K0H_K1u on August 26, 2007, 11:01:04 PM
Cobol
AutoIT
? Where are they!

:D
Title: Re: GeSHiSmf
Post by: Valodim on August 27, 2007, 11:40:01 AM
AutoIT is in there, Cobol isn't. Might have to get latest version of geshi
http://sourceforge.net/project/showfiles.php?group_id=114997

arkserver: check the css
Title: Re: GeSHiSmf
Post by: ArkServer on August 27, 2007, 01:38:42 PM
What should i cahnge in this:

.geshi {
   color: #000000;
   background-color: #ccceec;
   font-family: monospace;
   font-size: 1.2em;
   border: 1px solid #000000;
   margin: 1px auto 1px auto;
   padding: 1px;
   width: 99%;
   overflow: auto;
   white-space: pre;
   max-height: 24em;
}

nvm ,its done :D

example: http://www.engineeringserver.com/t3hc0d3z/an+example+of+updating+a+textfile+trough+the+net-t249.0.html;msg378;topicseen#new

Thanks a lot for the hint!
Title: Re: GeSHiSmf
Post by: b2k on September 15, 2007, 01:56:24 AM
Hi everybdoy...

See, how can i do for take out the scrollbar

(http://www.simplemachines.org/community/index.php?action=dlattach;topic=50945.0;attach=39905;image)

Thanks
Title: Re: GeSHiSmf
Post by: Valodim on September 15, 2007, 06:00:51 AM
dude, that question was pretty much answered the very post above yours. c'mon. --;

hint: overflow
Title: Re: GeSHiSmf
Post by: b2k on September 15, 2007, 01:12:53 PM
Quote from: Valodim on September 15, 2007, 06:00:51 AM
dude, that question was pretty much answered the very post above yours. c'mon. --;

hint: overflow

Hi, i already have like other...see my style.css

.geshi {
color: #000000;
background-color: #eaeced;
font-family: monospace;
font-size: small;
border: 1px solid #303038;
margin: 1px auto 1px auto;
padding: 1px;
width: 99%;
overflow: auto;
white-space: pre;
max-height: 24em;
}

.geshi {
color: #000000;
background-color: #EBE9E6;
font-family: monospace;
font-size: small;
border: 1px solid #303038;
margin: 1px auto 1px auto;
padding: 1px;
width: 99%;
overflow: auto;
white-space: pre;
max-height: 24em;
}
Title: Re: GeSHiSmf
Post by: Valodim on September 15, 2007, 01:23:34 PM
remove overflow: auto and max-height properties...
Title: Re: GeSHiSmf
Post by: b2k on September 15, 2007, 01:29:32 PM
Thanks...Work Awesome
Title: Re: GeSHiSmf
Post by: yo2lux on October 16, 2007, 04:57:40 AM
This mod work on SMF 1.1.4? Any patch (diff) or package exist to solve the problem with SMF 1.1.4 ?
Thanks
Title: Re: GeSHiSmf
Post by: drgsldr69 on October 30, 2007, 05:31:38 PM
i cant install this on my 1.1.4 smf forum????? it says either corrupt or not compatable
Title: Re: GeSHiSmf
Post by: Bigguy on November 06, 2007, 02:51:29 PM
The author of the mod has probably not updated it yet to work with 1.1.4
Title: Re: GeSHiSmf
Post by: b2k on November 21, 2007, 10:21:09 PM
Hey....Im getting this error in my error`s log

File: /home/*****/public_html/******/Sources/Subs.php(1191) : runtime-created function
Line: 32
Title: Re: GeSHiSmf
Post by: Marook on November 22, 2007, 12:05:46 AM
You must install the mod by hand... its works fine with 1.1.4 !

I've got just one strange problem, didnt sure whats wrong. I can post and view code without any problems. But copy+paste a code wont work, because the linefeeds are gone :/ Pasteing the code into a texteditor, it will fill the whole code into one line... any ideas ?

//Edit : ArkServer, have tried to copy and paste a sample source code from your site, it doesn't work because it was pasted in just one line, your linefeeds are also gone with the wind ;)
Title: Re: GeSHiSmf
Post by: shinji257 on January 24, 2008, 04:40:19 AM
Looks like the most recent version package file is corrupted.  Can't seem to download a good copy anywhere.
Title: Re: GeSHiSmf
Post by: Marook on January 24, 2008, 09:31:38 AM
Without working linefeeds it doesn't make sense to use this mod...
Title: Re: GeSHiSmf
Post by: Marook on January 24, 2008, 09:32:59 AM
Btw i found a copy on my hdd.... here you are
Title: Re: GeSHiSmf
Post by: shinji257 on January 24, 2008, 04:05:54 PM
Thanks!  I'll add this to the other mods I did on my forum.  It is in test stages right now so it isn't even linked to the main page.

EDIT: Oh and this mod is compatible with 1.1.4.  If you get an error that says that it isn't then you can use a certain switch to make the package manager emulate 1.1.3 or I have actually modified package-info.xml and added 1.1.4 to the list of compatible versions.  All tests pass and it installs successfully.
Title: Re: GeSHiSmf
Post by: t0nedef on February 23, 2008, 11:45:07 PM
the latest version appears to be corrupted.... is there a mirror i can download from or could you re-up the archive for me please?
Title: Re: GeSHiSmf
Post by: eric_cartman on February 27, 2008, 09:18:17 AM
Please, upload the latest version again, archive is corrupted
Title: Re: GeSHiSmf
Post by: Marook on February 27, 2008, 11:52:02 AM
there is nothing corrupted, use winrar or 7zip to unpack the archive...
Title: Re: GeSHiSmf
Post by: t0nedef on February 27, 2008, 09:22:22 PM
Um, i used tar -xzvf, but heh, i missed your post with the re-up. Sorry.
Title: Re: GeSHiSmf
Post by: eric_cartman on February 28, 2008, 09:43:17 AM
I used WinRAR and 7zip, but I cannot unpack the archive.

Message: Data error in 'GeSHI\geshi\geshi\blitzbasic.php'. File is broken.

Please, send me .rar archive.
Title: Re: GeSHiSmf
Post by: Marook on February 28, 2008, 11:53:54 AM
Here you are...
Title: Re: GeSHiSmf
Post by: eric_cartman on February 29, 2008, 04:06:31 AM
Thank you very much!!