»Forumlar »SE ? Core Labs »Seditio Kod Renklendirme
  https://seditio.com.tr/eski1/forums.php?m=posts&q=47
          Geri Dön      -      Sayfayı Yazdırmak için tıklayın
Author: MUST!, Posted: 2009-11-21 20:05 GMT. This post was edited by MUST! (2009-11-21 20:08 GMT, 6148 Gün ago)
?ncelikle Geshi yi download ediyoruz ve /datas/geshi klas?r?ne upload ediyoruz.
http://www.cybershare.us/eklentiler/geshi.rar

2. system/functions.php'yi a??yoruz
bul:
:
hp]if ($p2>$p1 && $p1>0)

                {

                $key = '**'.$ii.$unique_seed.'**';

                $code[$key]= substr ($text, $p1+6, ($p2-$p1)-6);

                $code_len = strlen($code[$key])+13;

                $code[$key] = str_replace('\t','   ', $code[$key]);

                $code[$key] = str_replace('  ', '  ', $code[$key]);

                $code[$key] = str_replace('  ', '  ', $code[$key]);

                $code[$key] = str_replace(

                array('{', '<', '>' , '\'', '"', "<!--", '$' ),

                array('{', '<', '>', ''', '"', '"<!--"', '$' ),$code[$key]);

                $code[$key] = "<div class=\"codetitle\">".$L['bbcodes_code'].":</div><div class=\"code\">".trim($code[$key])."</div>";

                $text = substr_replace($text, $key, $p1, $code_len);

                }

            }



Alt?na Ekle G?l?m

:
hp]////Geshi Highlighter MUST! STLYES////

$hcode = array();

$unique_key = $sys['unique'];

$jj = 10000;

$p1 = 1;

$p2 = 1;

while ($p1>0 && $p2>0 && $jj<10031)

{

$jj++;



$p1 = strpos($text, '

');

$P2 = STRPOS($TEXT, '

');

PREG_MATCH("#\[HIGHLIGHT=(.*?)\ Kod:





(.*?)\[\/highlight\]#se", $text, $matches);



$language = $matches[1];



$lang_lenght = strlen($language);



$language = ($language=='html') ? 'html4strict' : $language;







if ($p2>$p1 && $p1>0)



{



$id = '**'.$jj.$unique_key.'**';



$hcode[$id]= substr ($text, $p1+12+$lang_lenght, ($p2-$p1)-12-$lang_lenght);



$hcode_len = strlen($hcode[$id])+24+$lang_lenght;



$hcode[$id] = sed_highlight_bbcode($hcode[$id], $language);



$hcode[$id] = "<div class=\"codetitle\">".strtoupper($language)." ".$L['bbcodes_code'].":</div>



<div class=\"code\">".trim($hcode[$id])."</div>";



$text = substr_replace($text, $hcode[$id], $p1, $hcode_len);



}



}





 


bul:

:
hp]function sed_parse($text, $parse_bbcodes=TRUE, $parse_smilies=TRUE, $parse_newlines=TRUE)

?st?ne ekle
[highlight=php]function sed_highlight_bbcode($code, $language){
$find1 = array('&amp;', '{', '<', '>', '$', ''', '"', '\', '&amp;', '&nbsp;');
$replace1 = array('&', '{', '<', '>' , '$', '\'', '"', '\', '&amp;', '&nbsp;');
$code = str_replace($find1, $replace1, $code);

include_once('datas/geshi/geshi.php');
$geshi = new GeSHi($code, $language);
$geshi->set_header_type(GESHI_HEADER_NONE);
//$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 1); // Comment this line to remove the line numbers

$tabs = 4;
$geshi->set_tab_width($tabs);
$code = $geshi->parse_code();
$code = preg_replace('/&amp;#([0-9]+);/', '&#$1;', $code);
$code = str_replace(array('[', ']', "\n"), array('[', ']', ''), $code);

return $code;
}
[/ highlight]





Language => Keyword
ActionScript => actionscript
Ada => ada
Apache Log File => apache
AppleScript => applescript
ASM (NASM based) => asm
ASP => asp
AutoIT => autoit
Bash => bash
BlitzBasic => blitzbasic
C => c
CAD DCL => caddcl
CAD Lisp => cadlisp
C++ => cpp
C# => csharp
CSS => css
D => d
Delphi => delphi
Diff => diff
DOS => dos
FreeBasic => freebasic
HTML (4.0.1) => html4strict
Inno => inno
Java => java
Java 5 => java5
Javascript => javascript
Lisp => lisp
Lua => lua
Matlab => matlab
MPASM => mpasm
MySQL => mysql
NullSoft Installer => nsis
OCaml => ocaml
Openoffice.org BASIC => oobas
Oracle 8 => oracle8
Pascal => pascal
Perl => perl
PHP => php
PHP (Brief version) => php-brief
Python => python
QBasic/QuickBASIC => qbasic
robots.txt => robots
Ruby => ruby
Scheme => scheme
SDLBasic => sdlbasic
SQL => sql
T-SQL => tsql
VisualBasic => vb
VHDL => vhdl
VisualFoxPro => visualfoxpro
XML => xml

son mesaj 1 dakika

kullan?m kolayl??? i?in texboxter2 eklentisini kendinize g?re modifiye edebilirsiniz... edemeyenler olursa burda belirtsin yard?mc? olurum.
Author: Azhack, Posted: 2009-12-09 12:07 GMT. This post was edited by Azhack (2009-12-09 20:37 GMT, 6130 Gün ago)
Language => Keyword
ActionScript => actionscript
Ada => ada
Apache Log File => apache
AppleScript => applescript
ASM (NASM based) => asm
ASP => asp
AutoIT => autoit
Bash => bash
BlitzBasic => blitzbasic
C => c
CAD DCL => caddcl
CAD Lisp => cadlisp
C++ => cpp
C# => csharp
CSS => css
D => d
Delphi => delphi
Diff => diff
DOS => dos
FreeBasic => freebasic
HTML (4.0.1) => html4strict
Inno => inno
Java => java
Java 5 => java5
Javascript => javascript
Lisp => lisp
Lua => lua
Matlab => matlab
MPASM => mpasm
MySQL => mysql
NullSoft Installer => nsis
OCaml => ocaml
Openoffice.org BASIC => oobas
Oracle 8 => oracle8
Pascal => pascal
Perl => perl
PHP => php
PHP (Brief version) => php-brief
Python => python
QBasic/QuickBASIC => qbasic
robots.txt => robots
Ruby => ruby
Scheme => scheme
SDLBasic => sdlbasic
SQL => sql
T-SQL => tsql
VisualBasic => vb
VHDL => vhdl
VisualFoxPro => visualfoxpro
XML => xml


bu kisim dami eklenecek??..bunlari degisdikden sonra textbooterde o highlighter komutu otomatik gozukecekmi?

son mesaj 8 saat 30 dakika ?nce

function sed_highlight_bbcode($code, $language){
$find1 = array('&amp;', '{', '<', '>', '$', ''', '"', '\', '&amp;', '&nbsp;');
$replace1 = array('&', '{', '<', '>' , '$', '\'', '"', '\', '&amp;', '&nbsp;');
$code = str_replace($find1, $replace1, $code);

include_once('datas/geshi/geshi.php');
$geshi = new GeSHi($code, $language);
$geshi->set_header_type(GESHI_HEADER_NONE);
//$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 1); // Comment this line to remove the line numbers

$tabs = 4;
$geshi->set_tab_width($tabs);
$code = $geshi->parse_code();
$code = preg_replace('/&amp;#([0-9]+);/', '&#$1;', $code);
$code = str_replace(array('[', ']', "\n"), array('[', ']', ''), $code);

return $code;
}
bu kisim ekleyince hata veriyo siteyi acmiyor
hmm napim?
Author: TR-Akdam, Posted: 2009-12-09 22:11 GMT.
verdi?in kodlarda sorun ??kt? musti ?al??mad?
buradakini uygulay?n
Author: Kaan, Posted: 2009-12-09 22:38 GMT. This post was edited by Kaan (2009-12-09 22:43 GMT, 6130 Gün ago)
Musti Yanl?? Eklemi? O y?zden ?al??m?yor..

son mesaj 3 dakika ?nce

Alttaki K?s?mda [highlight=?] / [highlight] Aras?na Yazabilece?iniz Metinleri vermi?tir onlar? her hangi bir dosyaya eklemiyorsunuz..

?rnek: [highlight=apache] Buraya Apache kodlar? gelicek [highlight]

Kod:
Language => Keyword
ActionScript => actionscript
Ada => ada
Apache Log File => apache
AppleScript => applescript
ASM (NASM based) => asm
ASP => asp
AutoIT => autoit
Bash => bash
BlitzBasic => blitzbasic
C => c
CAD DCL => caddcl
CAD Lisp => cadlisp
C++ => cpp
C# => csharp
CSS => css
D => d
Delphi => delphi
Diff => diff
DOS => dos
FreeBasic => freebasic
HTML (4.0.1) => html4strict
Inno => inno
Java => java
Java 5 => java5
Javascript => javascript
Lisp => lisp
Lua => lua
Matlab => matlab
MPASM => mpasm
MySQL => mysql
NullSoft Installer => nsis
OCaml => ocaml
Openoffice.org BASIC => oobas
Oracle 8 => oracle8
Pascal => pascal
Perl => perl
PHP => php
PHP (Brief version) => php-brief
Python => python
QBasic/QuickBASIC => qbasic
robots.txt => robots
Ruby => ruby
Scheme => scheme
SDLBasic => sdlbasic
SQL => sql
T-SQL => tsql
VisualBasic => vb
VHDL => vhdl
VisualFoxPro => visualfoxpro
XML => xml
Author: RusTik, Posted: 2009-12-12 21:17 GMT.
musti 1ci kisimi yaptim..dataasada atdim...

ama 2ci kisim varya true falan olan yer..ee onu yapinca calismiyor..o kismida solermisin ne yapayim?
Author: Max-Payne, Posted: 2009-12-12 23:15 GMT.
T?kler MUST! Saol Kanka
Author: Kaan, Posted: 2009-12-13 09:57 GMT. This post was edited by Kaan (2010-10-14 02:55 GMT, 5822 Gün ago)
?ncelikle Geshi Burdan,yi download ediyoruz ve /datas/geshi klas?r?ne upload ediyoruz.


2. system/functions.php'yi a??yoruz.
Kod:
if ($p2>$p1 && $p1>0)
                {
                $key = '**'.$ii.$unique_seed.'**';
                $code[$key]= substr ($text, $p1+6, ($p2-$p1)-6);
                $code_len = strlen($code[$key])+13;
                $code[$key] = str_replace('\t','&nbsp; &nbsp;', $code[$key]);
                $code[$key] = str_replace('  ', '&nbsp; ', $code[$key]);
                $code[$key] = str_replace('  ', ' &nbsp;', $code[$key]);
                $code[$key] = str_replace(
                array('{', '<', '>' , '\'', '"', "<!--", '$' ),
                array('{', '<', '>', ''', '"', '"<!--"', '$' ),$code[$key]);
                $code[$key] = "<div class=\"codetitle\">".$L['bbcodes_code'].":</div><div class=\"code\">".trim($code[$key])."</div>";
                $text = substr_replace($text, $key, $p1, $code_len);
                }
            }

sat?rlar?n? bulup alt?na
Kod:
////Geshi Highlighter////
$hcode = array();
$unique_key = $sys['unique'];
$jj = 10000;
$p1 = 1;
$p2 = 1;
while ($p1>0 && $p2>0 && $jj<10031)
{
$jj++;
$p1 = strpos($text, '
');
$P2 = STRPOS($TEXT, '
');
PREG_MATCH("#\[HIGHLIGHT=(.*?)\ Kod: (.*?)\[\/highlight\]#se", $text, $matches);
$language = $matches[1];
$lang_lenght = strlen($language);
$language = ($language=='html') ? 'html4strict' : $language;
if ($p2>$p1 && $p1>0)
{
$id = '**'.$jj.$unique_key.'**';
$hcode[$id]= substr ($text, $p1+12+$lang_lenght, ($p2-$p1)-12-$lang_lenght);
$hcode_len = strlen($hcode[$id])+24+$lang_lenght;
$hcode[$id] = sed_highlight_bbcode($hcode[$id], $language);
$hcode[$id] = "<div class=\"codetitle\">".strtoupper($language)." ".$L['bbcodes_code'].":</div>
<div class=\"code\">".trim($hcode[$id])."</div>";
$text = substr_replace($text, $hcode[$id], $p1, $hcode_len);
}
}

kodlar?n? ekliyoruz.

Son olarak

Kod:
function sed_parse($text, $parse_bbcodes=TRUE, $parse_smilies=TRUE, $parse_newlines=TRUE)

sat?r?n? bulup ?st?ne
Kod:
function sed_highlight_bbcode($code, $language){
    $find1 = array('&amp;', '{', '<', '>', '$', ''', '"', '\', '&amp;', '&nbsp;');
    $replace1 = array('&', '{', '<', '>' , '$', '\'', '"', '\', '&amp;', '&nbsp;');   
    $code = str_replace($find1, $replace1, $code);
   
    include_once('datas/geshi/geshi.php');
    $geshi = new GeSHi($code, $language);
    $geshi->set_header_type(GESHI_HEADER_NONE);
    //$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 1); // Comment this line to remove the line numbers

    $tabs = 4;
    $geshi->set_tab_width($tabs);
    $code = $geshi->parse_code();
    $code = preg_replace('/&amp;#([0-9]+);/', '&#$1;', $code);
    $code = str_replace(array('[', ']', "\n"), array('[', ']', ''), $code);

return $code;
}

kodlar? ekliyoruz.

Textboxer'da kullanabilmek i?in haz?rlad???m?z yamay? plugins/textboxer2 klas?r?ne upload edin.
Kullan?m:

Kod:
[highlight=kod_dili]kodunuz buraya[/highlight]

?rne?in:
Kod:
[highlight=php]kod buraya[/highlight]

:
hp]$t-> assign(array(

    "VIEW_TITLE" => $v,

    "VIEW_BODY" => $vd  

    ));



$t->parse("MAIN");

$t->out("MAIN");



require("system/footer.php");

Kullana bilece?iniz Kod Dilleri
Kod:
Language => Keyword
ActionScript => actionscript
Ada => ada
Apache Log File => apache
AppleScript => applescript
ASM (NASM based) => asm
ASP => asp
AutoIT => autoit
Bash => bash
BlitzBasic => blitzbasic
C => c
CAD DCL => caddcl
CAD Lisp => cadlisp
C++ => cpp
C# => csharp
CSS => css
D => d
Delphi => delphi
Diff => diff
DOS => dos
FreeBasic => freebasic
HTML (4.0.1) => html4strict
Inno => inno
Java => java
Java 5 => java5
Javascript => javascript
Lisp => lisp
Lua => lua
Matlab => matlab
MPASM => mpasm
MySQL => mysql
NullSoft Installer => nsis
OCaml => ocaml
Openoffice.org BASIC => oobas
Oracle 8 => oracle8
Pascal => pascal
Perl => perl
PHP => php
PHP (Brief version) => php-brief
Python => python
QBasic/QuickBASIC => qbasic
robots.txt => robots
Ruby => ruby
Scheme => scheme
SDLBasic => sdlbasic
SQL => sql
T-SQL => tsql
VisualBasic => vb
VHDL => vhdl
VisualFoxPro => visualfoxpro
XML => xml


Textboxer i?in highlight Yamas?
https://seditio.com.tr/eski1/data.....i_kod.rar
Author: Max-Payne, Posted: 2009-12-13 12:03 GMT.
T?kler Kaan
Author: RusTik, Posted: 2009-12-13 22:02 GMT.
true nin ustune ekleme kismi varya olmuyor onu ekleyince site hata veriyor

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/kriptogr/public_html/system/functions.php on line 2240
Author: MUST!, Posted: 2009-12-15 16:00 GMT.
functions.php 2240 sat?r?n? yazarm?s?n?
Author: Aragorn-pc, Posted: 2009-12-15 16:13 GMT.
:
hp]function sed_highlight_bbcode($code, $language){


Bende de ayn?
Author: Kaan, Posted: 2009-12-15 16:22 GMT.
Sorun mu yas?yorsunuz Kod renklendirmede.?
Author: Aragorn-pc, Posted: 2009-12-15 16:26 GMT.
Rustik'in hatas? i?in 2240 sat?r'? yazd?m.

yani a?a??daki kodlarda t?rnak hatas? oldu?unu s?yl?yor.
Kod:
function sed_highlight_bbcode($code, $language){
    $find1 = array('&amp;', '{', '<', '>', '$', ''', '"', '\', '&amp;', '&nbsp;');
    $replace1 = array('&', '{', '<', '>' , '$', '\'', '"', '\', '&amp;', '&nbsp;');   
    $code = str_replace($find1, $replace1, $code);
   
    include_once('datas/geshi/geshi.php');
    $geshi = new GeSHi($code, $language);
    $geshi->set_header_type(GESHI_HEADER_NONE);
    //$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 1); // Comment this line to remove the line numbers

    $tabs = 4;
    $geshi->set_tab_width($tabs);
    $code = $geshi->parse_code();
    $code = preg_replace('/&amp;#([0-9]+);/', '&#$1;', $code);
    $code = str_replace(array('[', ']', "\n"), array('[', ']', ''), $code);

return $code;
}
Author: Kaan, Posted: 2009-12-15 16:27 GMT.
Sizlerde test ettinixmi sorun olup olmad?g? konusunda..
Author: Aragorn-pc, Posted: 2009-12-15 16:29 GMT.
Evet biraz ?nce test ettim, t?rnak hatas? oldu?unu s?yl?yor.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in
Author: Kaan, Posted: 2009-12-15 16:31 GMT.
?u an ben kendim Kullan?yorum bir sorunla kar??la?mad?m Kodlar? inceler tekrar yay?nlar?m..

?rnek:
:
hp]function sed_highlight_bbcode($code, $language){

    $find1 = array('&amp;amp;', '{', '<', '>', '$', ''', '"', '\', '&amp;amp;', '&amp;nbsp;');

    $replace1 = array('&', '{', '<', '>' , '$', '\'', '"', '\', '&amp;amp;', '&amp;nbsp;');  

    $code = str_replace($find1, $replace1, $code);

   

    include_once('datas/geshi/geshi.php');

    $geshi = new GeSHi($code, $language);

    $geshi->set_header_type(GESHI_HEADER_NONE);

    //$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 1); // Comment this line to remove the line numbers



    $tabs = 4;

    $geshi->set_tab_width($tabs);

    $code = $geshi->parse_code();

    $code = preg_replace('/&amp;amp;#([0-9]+);/', '&#$1;', $code);

    $code = str_replace(array('[', ']', "\n"), array('[', ']', ''), $code);



return $code;

}

Bir Sorun Oldugunu Sanm?yorum eklerken ufak bi?ey g?zden ka??yordur..
Author: Aragorn-pc, Posted: 2009-12-15 16:37 GMT. This post was edited by Aragorn-pc (2009-12-15 16:47 GMT, 6124 Gün ago)
o kod'lar da olmad? ama t3 '?n sitesinden aldi?im kodlar ile hata ??kmad?..

:
hp]function sed_highlight_bbcode($code, $language){

    $find1 = array('&amp;amp;', '{', '<', '>', '$', ''', '"', '\', '&amp;amp;amp;', '&amp;amp;nbsp;');

    $replace1 = array('&', '{', '<', '>' , '$', '\'', '"', '\\', '&amp;amp;', '&amp;nbsp;');   

    $code = str_replace($find1, $replace1, $code);

 

    include_once('datas/geshi/geshi.php');

    $geshi = new GeSHi($code, $language);

    $geshi->set_header_type(GESHI_HEADER_NONE);

    //$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 1); // Comment this line to remove the line numbers

 

    $tabs = 4;

    $geshi->set_tab_width($tabs);

    $code = $geshi->parse_code();

    $code = preg_replace('/&amp;amp;#([0-9]+);/', '&#$1;', $code);

    $code = str_replace(array('[', ']', "\n"), array('[', ']', ''), $code);

 

return $code;

}


son mesaj 9 dakika ?nce

peki geshi.php nerede ? class.geshi.php ve functions.geshi.php var onlar? yap?ncada olmuyor

Powered by SeditioPrint version