1 (edited by daris 2009-08-24 08:44)

Topic: [Release] GeSHi highlight

GeSHi highlight v1.0.4
Highlights code tags in posts using GeSHi highlighter.
Download

http://img516.imageshack.us/img516/4845/geshigx3.th.jpg

Re: [Release] GeSHi highlight

they should add this ext on this sie. nice!

Re: [Release] GeSHi highlight

I installed the extension but it isn't working for me for some reason. I tried some html within the code tag but it didn't color highlight it.

4 (edited by daris 2009-02-09 12:59)

Re: [Release] GeSHi highlight

Programming-Designs wrote:

I installed the extension but it isn't working for me for some reason. I tried some html within the code tag but it didn't color highlight it.

You should specify which language should be used, for example

[ code=html]<b>dfsf</b>[/ code]

(without spaces)

edit: fixed small mistake and released version 1.0.1 (same link)

5 (edited by Programming-Designs 2009-02-09 20:15)

Re: [Release] GeSHi highlight

Oh ok thanks for clearing that up. Will update to the new version and give it a try.

Edit: Tested it. Great mod I love it. Great for my programming forums smile

Re: [Release] GeSHi highlight

I get the following error when I try this ext.

Fatal error: Call to undefined function: htmlspecialchars_decode() in c:\punbb\include\parser.php(19) : eval()'d code on line 17

7

Re: [Release] GeSHi highlight

Thanks for reporting, fixed (added workaround for php4)

New release: 1.0.2 | Download

Re: [Release] GeSHi highlight

File does not exist

Daris could you repair this link? wink

9

Re: [Release] GeSHi highlight

Fixed

Re: [Release] GeSHi highlight

I get this error with your latest version. The error below is repeated thousands of times.

Notice: Uninitialized string offset: 1 in c:\punbb\extensions\geshi_highlight\geshi.php on line 1838

11

Re: [Release] GeSHi highlight

Can you show code, which you want to highlight? I'm not sure, but rather it's bug in geshi script than in my extension.

Re: [Release] GeSHi highlight

Below is the code I was trying to use:

if (isset($_GET['get_host']))
{
    if (!$forum_user['is_admmod'])
        message($lang_common['No permission']);

    ($hook = get_hook('mr_view_ip_selected')) ? eval($hook) : null;

    // Is get_host an IP address or a post ID?
    if (preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $_GET['get_host']) || preg_match('/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/', $_GET['get_host']))
        $ip = $_GET['get_host'];
    else
    {
        $get_host = intval($_GET['get_host']);
        if ($get_host < 1)
            message($lang_common['Bad request']);

        $query = array(
            'SELECT'    => 'p.poster_ip',
            'FROM'        => 'posts AS p',
            'WHERE'        => 'p.id='.$get_host
        );

Re: [Release] GeSHi highlight

I've got problem.

Geshi replace ' with &#039 entities.

14

Re: [Release] GeSHi highlight

bingiman wrote:

I get this error with your latest version. The error below is repeated thousands of times.

Notice: Uninitialized string offset: 1 in c:\punbb\extensions\geshi_highlight\geshi.php on line 1838

It's only notice, but I don't know how to fix (hide tongue ) it.

Reactor wrote:

Geshi replace ' with &#039 entities.

Fixed

New release 1.0.3
Download

Re: [Release] GeSHi highlight

I just found out that in the first post there's a 1.0.4 (I thought 1.0.3 was latest, like said in previous post). But the download link (and the whole site around it, as well as the user from here) is gone. Does anybody still have the 1.0.4?

16

Re: [Release] GeSHi highlight

http://my-trac.assembla.com/punbb-exten … r/branches

17

Re: [Release] GeSHi highlight

http://punbb.informer.com/wiki/_media/p … v1.0.5.zip
just added max tested 1.3.4 and named version 1.0.5
@ daris;  can you modify that on your trac? really appreciated work
will even install it here, as it's good stuff

example
==================

[code=php]

<?php
/**
* Adds a new post to the specified topic or a new topic to the specified forum.
*
* @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org
* @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
* @package PunBB
*/

define('FORUM_SKIP_CSRF_CONFIRM', 1);

if (!defined('FORUM_ROOT'))
    define('FORUM_ROOT', './');
require FORUM_ROOT.'include/common.php';

($hook = get_hook('po_start')) ? eval($hook) : null;

if ($forum_user['g_read_board'] == '0')
    message($lang_common['No view']);

// Load the post.php language file
require FORUM_ROOT.'lang/'.$forum_user['language'].'/post.php';
[/code]