1. Dashboard
  2. Artikel
  3. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  1. HTML - Webmaster Forum
  2. Interner Bereich
  3. Forum-Hilfe.de intern

&& --> &anp;&

  • ST-O Keule
  • 10. Mai 2005 um 11:48
  • 1
  • 2
  • Empon
    Meister(in)
    Beiträge
    370
    • 17. Mai 2005 um 17:22
    • #21
    Zitat von ST-O Keule

    Ups ... sorry habe das wichtigste vergessen


    Code
    $text = str_replace("&","&",$text);


    tut mir leid

    ich wollt' schon sagen :lol:

    Mess with the best, die like the rest

  • admin
    Administrator
    Reaktionen
    6
    Artikel
    1
    Beiträge
    12.794
    • 17. Mai 2005 um 21:28
    • Offizieller Beitrag
    • #22

    Ist jetzt zwar besser, aber immer noch nicht perfekt :roll:


    [php:1:106ced1d5c]<?php
    &;&; < > "
    ?>[/php:1:106ced1d5c]

    [php:1:106ced1d5c]
    &;&; < > "
    [/php:1:106ced1d5c]

    • Vorheriger offizieller Beitrag
    • Nächster offizieller Beitrag
  • ST-O Keule
    Großmeister(in)
    Beiträge
    498
    • 20. Mai 2005 um 08:17
    • #23

    Versuch Nr.2 ;)

    $text = str_replace("&amp;;","&",$text);

    [Blockierte Grafik: http://sturmtrupp-ost.de/images/ban_sto480.jpg]
    Homepage -->Sturmtrupp-Ost
    Projekt -->Recording System

  • admin
    Administrator
    Reaktionen
    6
    Artikel
    1
    Beiträge
    12.794
    • 20. Mai 2005 um 17:45
    • Offizieller Beitrag
    • #24

    Jetzt wird es schlimmer :wink:


    Wenn ich das versuche, kommt dann das im Testforum so heraus

    Zitat

    <?php
    &amp;amp;;&amp;amp;; < > "
    ?>

    • Vorheriger offizieller Beitrag
    • Nächster offizieller Beitrag
  • ST-O Keule
    Großmeister(in)
    Beiträge
    498
    • 21. Mai 2005 um 00:20
    • #25

    lol

    also ja da weis ich auch nicht weiter außer du gibst mir mal den gesammten Quelltext der Funktion!

    [Blockierte Grafik: http://sturmtrupp-ost.de/images/ban_sto480.jpg]
    Homepage -->Sturmtrupp-Ost
    Projekt -->Recording System

  • admin
    Administrator
    Reaktionen
    6
    Artikel
    1
    Beiträge
    12.794
    • 21. Mai 2005 um 08:51
    • Offizieller Beitrag
    • #26

    Hier das Script

    PHP
    ######################################################## 
    ## Mod Title:   PHP Syntax Highlighter BBCode 
    ## Mod Version:   Beta 2.0.0 
    ## Author:   JW Frazier / Fubonis < [email]php@fubonis.com[/email] > 
    ## 
    ## This mod is only for phpBB2 
    ## Tested on RC-3 
    ## ONLY for PHP4+ 
    ## 
    ## Description:  This mod creates a new BBCode, "[php]your_code[/php]" 
    ## It simply takes the code and uses the syntax highlighting of PHP 
    ## and makes a pretty presentation of your code! 
    ## To use this, your code MUST have at least the opening PHP tag 
    ## Example: [php]<?php phpinfo(); ?>[/php] is valid 
    ## [php]phpinfo();[/php] is not. 
    ## 
    ## 
    ## Installation Level:   Easy 
    ## Installation Time:   10 Minutes 
    ## Files To Edit:   5 
    ## /includes/bbcode.php 
    ## /templates/YOUR_TEMPLATE_NAME/bbcode.tpl 
    ## /templates/YOUR_TEMPLATE_NAME/posting_body.tpl 
    ## /language/lang_YOUR_LANGUAGE/lang_main.php 
    ## /posting.php 
    
    
    ######################################################## 
    ## 
    ## Installation Notes: 
    ## 
    ## ALWAYS back up your files. 
    ## Rock the open-source movement! 
    ######################################################## 
    # 
    #-----[ ACTION: OPEN /includes/bbcode.php]------------------------------------------ 
    # 
    # 
    #-----[ ACTION: FIND]------------------------------------------ 
       $bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['Code'], $bbcode_tpl['code_open']); 
    
    
    # 
    #-----[ ACTION: ADD BELOW]------------------------------------------ 
       $bbcode_tpl['php_open'] = str_replace('{L_PHP}', $lang['PHPCode'], $bbcode_tpl['php_open']); // PHP MOD 
    # 
    #-----[ ACTION: FIND]------------------------------------------ 
    # 
       // [code] and
    Alles anzeigen

    for posting code (HTML, PHP, C etc etc) in your posts.
    $text = bbencode_second_pass_code($text, $uid, $bbcode_tpl);
    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #
    // PHP MOD
    // [PHP] and [/PHP] for posting PHP code in your posts.
    $text = bbencode_second_pass_php($text, $uid, $bbcode_tpl);
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    //

    Code
    and

    for posting code (HTML, PHP, C etc etc) in your posts.
    $text = bbencode_first_pass_pda($text, $uid, '

    Code
    ', '

    ', '', true, '');
    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #
    // PHP MOD
    // [PHP] and [/PHP] for posting PHP code in your posts.
    $text = bbencode_first_pass_pda($text, $uid, '[php]', '[/php]', '', true, '');
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    } // bbencode_second_pass_code()
    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #
    /**
    * PHP MOD
    * Does second-pass bbencoding of the [php] tags. This includes
    * running htmlspecialchars() over the text contained between
    * any pair of [php] tags that are at the first level of
    * nesting. Tags at the first level of nesting are indicated
    * by this format: [php:1:$uid] ... [/php:1:$uid]
    * Other tags are in this format: [php:$uid] ... [/php:$uid]
    *
    * Original code/function by phpBB Group
    * Modified by JW Frazier / Fubonis < php@fubonis.com >
    */
    function bbencode_second_pass_php($text, $uid, $bbcode_tpl)
    {
    global $lang;

    $html_entities_match = array("#<#", "#>#");
    $html_entities_replace = array("&lt;", "&gt;");

    $code_start_html = $bbcode_tpl['php_open'];
    $code_end_html = $bbcode_tpl['php_close'];

    // First, do all the 1st-level matches. These need an htmlspecialchars() run,
    // so they have to be handled differently.
    $match_count = preg_match_all("#\[php:1:$uid\](.*?)\[/php:1:$uid\]#si", $text, $matches);

    for ($i = 0; $i < $match_count; $i++)
    {
    $before_replace = $matches[1][$i];
    $after_replace = $matches[1][$i];

    $after_replace = preg_replace($html_entities_match, $html_entities_replace, $after_replace);

    // Replace 2 spaces with " " so non-tabbed code indents without making huge long lines.
    $after_replace = str_replace(" ", " ", $after_replace);
    // now Replace 2 spaces with " " to catch odd #s of spaces.
    $after_replace = str_replace(" ", " ", $after_replace);

    // Replace tabs with " " so tabbed code indents sorta right without making huge long lines.
    $after_replace = str_replace("\t", " ", $after_replace);

    $str_to_match = "[php:1:$uid]" . $before_replace . "[/php:1:$uid]";

    $replacement = $code_start_html;
    $after_replace = str_replace('&lt;', '<', $after_replace);
    $after_replace = str_replace('&gt;', '>', $after_replace);
    ob_start();
    highlight_string($after_replace);
    $after_replace = ob_get_contents();
    ob_end_clean();
    $replacement .= $after_replace;
    $replacement .= $code_end_html;

    $text = str_replace($str_to_match, $replacement, $text);
    }

    // Now, do all the non-first-level matches. These are simple.
    $text = str_replace("[php:$uid]", $code_start_html, $text);
    $text = str_replace("[/php:$uid]", $code_end_html, $text);
    $text = str_replace('&amp;nbsp;', '', $text);
    $text = str_replace('&amp;</font><font color="#0000CC">nbsp</font><font color="#006600">;', '', $text);
    $text = str_replace('&amp;</font><font color="#0000BB">nbsp</font><font color="#007700">;', '', $text);

    return $text;

    } // bbencode_second_pass_php()
    #
    #-----[ ACTION: CLOSE /includes/bbcode.php]------------------------------------------
    #
    #
    #-----[ ACTION: OPEN /templates/YOUR_TEMPLATE_NAME/bbcode.tpl]------------------------------------------
    #
    #
    #-----[ ACTION: FIND]------------------------------------------
    #

    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #

    </span>
    <table border="0" align="center" width="90%" cellpadding="3" cellspacing="1">
    <tr>
    <td><span class="genmed">{L_PHP}:</span></td>
    </tr>
    <tr>
    <td class="code">


    </td>
    </tr>
    </table>
    <span class="postbody">

    #
    #-----[ ACTION: CLOSE /templates/YOUR_TEMPLATE_NAME/bbcode.tpl]------------------------------------------
    #
    #
    #-----[ ACTION: OPEN /templates/YOUR_TEMPLATE_NAME/posting_body.tpl]------------------------------------------
    #
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    f_help = "{L_BBCODE_F_HELP}";
    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #
    h_help = "{L_BBCODE_H_HELP}";
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    bbtags = new Array('','','','','','','

    Zitat

    ','

    ','

    Code
    ','

    ','

      ','

    ','

      ','

    ','','http://,');
    #
    #-----[ ACTION: REPLACE WITH]------------------------------------------
    #
    bbtags = new Array('','','','','','','

    Zitat

    ','

    ','

    Code
    ','

    ','

      ','

    ','

      ','

    ','','http://,','[php]<?php\n','\n?>[/php]');
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    <td><span class="genmed">
    <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
    </span></td>
    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #
    <td><span class="genmed">
    <input type="button" class="button" accesskey="h" name="addbbcode18" value="PHP" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('h')" />
    </span></td>
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">
    #
    #-----[ ACTION: REPLACE WITH]------------------------------------------
    #
    <select name="addbbcode20" onChange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    <select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
    #
    #-----[ ACTION: REPLACE WITH]------------------------------------------
    #
    <select name="addbbcode22" onChange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
    #
    #-----[ ACTION: CLOSE /templates/YOUR_TEMPLATE/posting_body.tpl]------------------------------------------
    #
    #
    #-----[ ACTION: OPEN /language/lang_YOUR_LANGUAGE/lang_main.php]------------------------------------------
    #
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    $lang['Code'] = "Code"; // comes before bbcode code output.
    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #
    $lang['PHPCode'] = "PHP"; // PHP MOD
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    $lang['bbcode_f_help'] = "Font size: [size=x-small]small text[/size]";
    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #
    $lang['bbcode_h_help'] = "PHP syntax highlighter. [php]<?php code ?>[/php] (alt+h)"; // PHP MOD
    #
    #-----[ ACTION: CLOSE language/lang_YOUR_LANGUAGE/lang_main.php]------------------------------------------
    #
    #
    #-----[ ACTION: OPEN /posting.php]------------------------------------------
    #
    #
    #-----[ ACTION: FIND]------------------------------------------
    #
    "L_BBCODE_F_HELP" => $lang['bbcode_f_help'],
    #
    #-----[ ACTION: ADD BELOW]------------------------------------------
    #
    "L_BBCODE_H_HELP" => $lang['bbcode_h_help'], // PHP MOD
    #
    #-----[ ACTION: CLOSE /posting.php]------------------------------------------
    #
    #
    #-----[ ACTION: UPLOAD YOUR FILES]------------------------------------------
    #[/code]

    • Vorheriger offizieller Beitrag
    • Nächster offizieller Beitrag
  • Rocco
    Kaiser(in)
    Beiträge
    2.557
    • 21. Mai 2005 um 09:21
    • #27

    hab ihr schon mal dran gedacht, dass es vllt ein anderes script ist, das beim ansenden "drüberläuft", das das & ersetzt!?

    mfg

    [Blockierte Grafik: http://rocco.forum-hilfe.de/image/userbar.png]

  • admin
    Administrator
    Reaktionen
    6
    Artikel
    1
    Beiträge
    12.794
    • 21. Mai 2005 um 13:56
    • Offizieller Beitrag
    • #28

    Ich denke mir dabei garnichts, den PHP ist ein Buch mit 7 Siegeln für mich :roll:
    Aber natürlich kann das Forenscript selbst dafür sorgen, das das" & " falsch dargestellt wird ?

    • Vorheriger offizieller Beitrag
  • ST-O Keule
    Großmeister(in)
    Beiträge
    498
    • 25. Mai 2005 um 07:52
    • #29

    das muss wohl auch so sein ! ich sehe zumindest nichts wo das geändert wird (& --> &amp;) :(

    [Blockierte Grafik: http://sturmtrupp-ost.de/images/ban_sto480.jpg]
    Homepage -->Sturmtrupp-Ost
    Projekt -->Recording System

  • CHIEFmaster
    Kaiser(in)
    Beiträge
    2.454
    • 25. Mai 2005 um 11:39
    • #30

    irgendwo hab ich gelesen, wie man das beheben kann!!!
    ich schau mal nach und poste es dann hier!!!
    (vorausgesetzt, ich finde es... *g*)

    [EDIT:]
    SORRY, habs gefunden!
    War aber nicht deswegen, sondern wegen der fehlerhaften Darstellung von Umlauten....


    [SIGPIC][/SIGPIC]
    http://www.fotocommunity.de/pc/pc/mypics/787761


    http://www.fotocommunity.de/pc/pc/mypics/787761

  • baloo
    Großmeister(in)
    Beiträge
    514
    • 14. Juni 2005 um 10:34
    • #31

    vielleicht liegt es irgendwo im script an einem htmlspecialchars, htmlentities oder ähnlich.
    diese funktionen setzen sonderzeichen wie & automatisch in die dazugehörigen codes wie &amp; um.
    ist dann aber komisch, dass andere sonderzeichen wie < und > nicht umgesetzt werden...

    aber auf jeden fall drin lassen, man kann ja auch AND statt && schreiben und so viele & brauchts in php auch nicht :wink:

    thats-me.ch Communtiy

    • 1
    • 2

Tags

  • forum
  • html
  • ie
  • tex
  • mod
  • color
  • text
  • star
  • funktion
  • input
  • version
  • wochenende
  • code
  • php
  • upload
  • meinung
  • font
  • script
  • scripte
  • fehlermeldungen
  • phpbb2
  • variable
  • select
  • preg_replace
  • syntax
  • bbcode
  1. Datenschutzerklärung
  2. Impressum
Community-Software: WoltLab Suite™
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
Zitat speichern