Welcome, Guest. Please Login or Register.
April 29, 2025, 12:52:43 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  German User Help  |  Hilfe bzw. Diskussionen zu Mods  |  PHP Syntax hervorhebung « previous next »
Pages: 1 [2] Reply Ignore Print
Author Topic: PHP Syntax hervorhebung  (Read 4699 times)
mediman
Support Team
YaBB God
*****
Posts: 2858


WWW
Re:PHP Syntax hervorhebung
« Reply #15 on: January 11, 2003, 09:50:06 PM »
Reply with quote

wird neu geschrieben!

mediman
Logged

mainComm Dev Team
TREO
Noobie
*
Posts: 24


2 evil 4 u

WWW
Re:PHP Syntax hervorhebung
« Reply #16 on: January 12, 2003, 06:24:17 PM »
Reply with quote

und wie lange kann das dauern bis das fertig ist ???
Logged

chris
Guest
Re:PHP Syntax hervorhebung
« Reply #17 on: January 12, 2003, 08:53:11 PM »
Reply with quote

Quote from: TREO on January 12, 2003, 06:24:17 PMund wie lange kann das dauern bis das fertig ist ???

In Anbetracht dieser Frage und dem Thema Deines Boards frag ich mich wieso Du es nicht selber schreibst!?
Logged
TREO
Noobie
*
Posts: 24


2 evil 4 u

WWW
Re:PHP Syntax hervorhebung
« Reply #18 on: January 13, 2003, 02:18:43 PM »
Reply with quote

naja ...
... ich hab ja wie gesagt mal die Eingebaute funktion dazu gebracht zu funktionieren aber das ist ja ein bisschen was anderes ...
... und ich dachte mir das die Modder ein bisschen mehr ahnung davon haben [ich meine vom modden des boards] ...
... naja ...
... dann muss ich wohl mal wieder ein bisschen am code rumspielen :)
Logged

chris
Guest
Re:PHP Syntax hervorhebung
« Reply #19 on: January 13, 2003, 02:34:14 PM »
Reply with quote

mit folgender routine macht das mercuryboard...

   /**
    * Colors PHP code in a string
    *
    * @param string $input Code to be PHP-highlighted
    * @param int $start Starting line to count from
    * @author Jason Warner <[email protected]>
    * @since Beta 2.1
    * @return string PHP-highlighted string
    **/
   function colorphp($input, $start=1)
   {
      $input = str_replace(array('<br>', '<br />'), '', $input);

      $transl = array_flip(get_html_translation_table(HTML_ENTITIES));
      $input  = strtr($input, $transl);

      if(strpos($input, '<'.'?') === false){
         $input  = '<'."?php $input ?".'>';
         $tagged = true;
      }

      ob_start();

      highlight_string($input);
      $input = ob_get_contents();

      ob_end_clean();

      $s = array('[',  ']',   ':',   '(',  ')',  "\t", '<code>', '</code>');
      $r = array('&#91;', '&#93;', '&#58;', '&#40;', '&#41;', '    ', '', '');
      $input = str_replace($s, $r, $input);

      if(isset($tagged)){
         $input = str_replace(array('&lt;?php', '?&gt;'), '', $input);
      }

      $lines = explode('<br />', $input);
      $count = count($lines);

      if(isset($tagged)){
         $count--;
      }

      for($i=0; $i<$count; $i++)
      {
         if(isset($tagged) && !$i){
            continue;
         }

         $lines[$i] = "<font color='#000000'><b>$start</b></font>&nbsp;" . ((isset($tagged) || (!isset($tagged) && $i)) ? '&nbsp;' : null) . rtrim($lines[$i]) . "\n";
         $start++;
      }

      $input = implode('<br>', $lines);

      return "<table align='center' border='0' width='90%' cellpadding='3' cellspacing='0'><tr><td><b>PHP:</b></td></tr><tr><td class='code'>\n\n$input\n\n</td></tr></table>";
   }

keine ahnung ob die brauchbar ist... aber vllt. hilft es ja...
Logged
TREO
Noobie
*
Posts: 24


2 evil 4 u

WWW
Re:PHP Syntax hervorhebung
« Reply #20 on: January 13, 2003, 03:05:43 PM »
Reply with quote

mal schaun ob ich was damit anfangen kann ...
Logged

mediman
Support Team
YaBB God
*****
Posts: 2858


WWW
Re:Php Syntax hervorhebung
« Reply #21 on: March 07, 2003, 12:46:06 AM »
Reply with quote

highlight_string is all you need!

mediman
Logged

mainComm Dev Team
TREO
Noobie
*
Posts: 24


2 evil 4 u

WWW
Re:Php Syntax hervorhebung
« Reply #22 on: May 06, 2003, 05:27:19 PM »
Reply with quote

ich habe mir den code jetzt...
... zum erstenmal ...
... mal richtig angeschaut ...
... und da fehlen noch ein paar funktionen ...
... im sinne von function();

also könntest du bitte auch noch den code von folgenden funktionen posten ?
ob_start();
ob_get_contents();
ob_end_clean();

ich weiß das sie mit der Highlighting funktion an sich nichts zu tun haben ...
... aber ich will wissen was mit dem text in diesen funktionen passiert ...
Logged

TREO
Noobie
*
Posts: 24


2 evil 4 u

WWW
Re:Php Syntax hervorhebung
« Reply #23 on: May 24, 2003, 11:51:00 AM »
Reply with quote

hallo ?
will nicht mal einer antworten ?
Logged

chris
Guest
Re:Php Syntax hervorhebung
« Reply #24 on: May 24, 2003, 11:59:50 AM »
Reply with quote

Quote from: TREO on May 24, 2003, 11:51:00 AM
hallo ?
will nicht mal einer antworten ?

worauf? was die funktionen ob_start, etc sind?

http://de2.php.net/manual/de/function.ob-start.php
http://de2.php.net/manual/de/function.ob-get-contents.php
http://de2.php.net/manual/de/function.ob-end-clean.php
Logged
TREO
Noobie
*
Posts: 24


2 evil 4 u

WWW
Re:Php Syntax hervorhebung
« Reply #25 on: May 24, 2003, 12:15:17 PM »
Reply with quote

ups ...
... das ist mir jetzt aber peinlich  :-[ ...
... da ich noch nie mit den Funktionen zu tun hatte ...
... dache ich das es mercury board interne Funktionen sind ...
... nagut ...
... dann mache ich mir mal an die arbeit und versuche mit eine PHP funktion für das board zu bauen ...
Logged

Mingmaster
Noobie
*
Posts: 10


Re:Php Syntax hervorhebung
« Reply #26 on: May 27, 2003, 06:17:04 AM »
Reply with quote

Ich habe mir vor ein paar Wochen eine Mod gebastelt jedoch noch nicht auf Herz und Nieren gestestet!! Daher auf eigene Gefahr  ;)
Modify Syntax Highlight Mod Es ist ein ziemliches Problem wegen den UBBC Tags im Board! Aber vielleicht reicht es dir ja.



mfg Ming
Logged
Pages: 1 [2] Reply Ignore Print 
YaBB SE Community  |  German User Help  |  Hilfe bzw. Diskussionen zu Mods  |  PHP Syntax hervorhebung « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.030 seconds with 18 queries.