Changeset 90

Show
Ignore:
Timestamp:
2007-12-08 15:16:54 (1 year ago)
Author:
hannes
Message:

fixing a few problems with non-ASCII characters

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/classes/misc/Post.php

    r57 r90  
    9292        } 
    9393        // add this post 
    94         $table->addRow(Array('<td valign="top" width="' . ($SETTINGS['maxavatarsize'] + 10) . '">' . $_member->getPostside() . '</td>', '<td valign="top">' . $_post . '</td>')); 
     94        $table->addRow(Array('<td valign="top" width="' . ($SETTINGS['maxavatarsize'] + 10) . '">' . $_member->getPostside() . '</td>', '<td valign="top">' . $_post . '</td>'), FALSE, TRUE); 
    9595        // post footer 
    9696        $table->addRow(Array(''), Array('colspan'=>'2', 'class'=>'postfooter')); 
  • trunk/classes/misc/Table.php

    r1 r90  
    7676     *              $attr - Array containing key=>value attributes common 
    7777     *                      to all columns 
     78     *              $decode - decode entities? 
    7879     * Returns:     - 
    7980     **/ 
    80     public function addRow($cols, $attr = FALSE) { 
     81    public function addRow($cols, $attr = FALSE, $decode = FALSE) { 
    8182        $tr = $this->table->addChild('tr'); 
    8283        if ($attr) { 
     
    9091        // add the columns 
    9192        while ($cols[$i] !== NULL) { 
    92             if ($xml = @simplexml_load_string($cols[$i], 'XMLElement')) { 
     93            if ($decode) { 
     94                $xml = @simplexml_load_string(html_entity_decode($cols[$i], ENT_NOQUOTES, 'UTF-8'), 'XMLELement'); 
     95            } else { 
     96                $xml = @simplexml_load_string($cols[$i], 'XMLELement'); 
     97            } 
    9398                // contents for this column given as XML tree 
    9499                $tr->addElement($xml); 
  • trunk/classes/pages/Forum.php

    r24 r90  
    135135                } 
    136136                // add all the previously compiled topic information to table 
    137                 $table->addRow(Array($_mark,'<td><h3>' . $_prefix . '<a href="' . $F->link('topic') . 'id=' . $row2['topicid'] . '">' . $row2['topictitle'] . '</a></h3>' . $_multipages . '</td>', '<td align="center">' . $row2['posts'] . '</td>', '<td align="center">' . $row2['views'] . '</td>', '<td><div>' . $LANG['by'] . ' ' . $_poster1->getProfileLink() . '</div><div>' . $LANG['at'] . ' ' . $F->datetime($row3->posttime, FALSE, TRUE) . '</div><div>' . $LANG['on'] . ' ' . $F->datetime($row3->posttime, TRUE, FALSE) . '</div></td>', '<td><div>' . $LANG['by'] . ' ' . $_poster2->getProfileLink() . '</div><div>' . $LANG['at'] . ' ' . $F->datetime($row4->posttime, FALSE, TRUE) . '</div><div>' . $LANG['on'] . ' ' . $F->datetime($row4->posttime, TRUE, FALSE) . '</div></td>')); 
     137                $table->addRow(Array($_mark,'<td><h3>' . $_prefix . '<a href="' . $F->link('topic') . 'id=' . $row2['topicid'] . '">' . htmlentities($row2['topictitle']) . '</a></h3>' . $_multipages . '</td>', '<td align="center">' . $row2['posts'] . '</td>', '<td align="center">' . $row2['views'] . '</td>', '<td><div>' . $LANG['by'] . ' ' . $_poster1->getProfileLink() . '</div><div>' . $LANG['at'] . ' ' . $F->datetime($row3->posttime, FALSE, TRUE) . '</div><div>' . $LANG['on'] . ' ' . $F->datetime($row3->posttime, TRUE, FALSE) . '</div></td>', '<td><div>' . $LANG['by'] . ' ' . $_poster2->getProfileLink() . '</div><div>' . $LANG['at'] . ' ' . $F->datetime($row4->posttime, FALSE, TRUE) . '</div><div>' . $LANG['on'] . ' ' . $F->datetime($row4->posttime, TRUE, FALSE) . '</div></td>'), FALSE, TRUE); 
    138138            } 
    139139            // add finished table to parent HTML element