TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 412
  • Total: 412

IE8 messes up my Block codes

Started by lurkalot, July 17, 2010, 11:25:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lurkalot

Over the last few weeks I've been having trouble getting my block codes to work when adding new blocks.  It turns out that IE8 is messing up code when copying and pasting them into blocks.

Grab a snippet code with IE8 and paste it into a php block, and I can watch the code change before my eyes.  Use Firefox and all is well. 

Anyone else had this problem?  I have a feeling this was due to one of those windows updates but can't be sure.  It was fine a few weeks ago

This code copied and pasted using IE8.  And won't work in my TP blocks.


/////////////////////// Set up the topic where the poll is.$pollTopic = 11;// Images per row.$imagesPerRow = 4;/////////////////////$pollResults = ssi_showPoll($pollTopic,'array');// Just a counter..$imageCount = 0;global $scripturl;$patternImg = "/src=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i";echo ' <table style="width: 100%"> <tr>';foreach ($pollResults['options'] as $pollItem){ preg_match($patternImg, $pollItem['option'], $image); $imageCount++; if ($imageCount > $imagesPerRow) { echo ' </tr> <tr>'; $imageCount = 1; } echo ' <td style="width: 25%; text-align: center; padding: 1px 1px 10px 1px;"> <a href="' , $scripturl , '?topic=' , $pollTopic , '"> <img ' , $image[0] , ' alt="Go Vote !" title="Go Vote !" border="0" width="100" /> </a> <br /> Member : ' , strip_tags($pollItem['option']); if (!$pollResults['allow_vote']) { echo ' <br /> Votes : ' , $pollItem['votes'] , ' (' , $pollItem['percent'] , '%) <br /> ' , $pollItem['bar']; } echo ' </td>'; }while ($imageCount < $imagesPerRow){ echo ' <td style="width: 25%"> </td>'; $imageCount++;}echo ' </tr> </table>';


Then below code copied and pasted with Firefox.  You can see it's just as it was posted in the support thread. And works perfectly.


/////////////////////
// Set up the topic where the poll is.
$pollTopic = 11;

// Images per row.
$imagesPerRow = 4;
/////////////////////

$pollResults = ssi_showPoll($pollTopic,'array');

// Just a counter..
$imageCount = 0;

global $scripturl;

$patternImg = "/src=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i";

echo '
      <table style="width: 100%">
         <tr>';

foreach ($pollResults['options'] as $pollItem)
{
   preg_match($patternImg, $pollItem['option'], $image);   
   
   $imageCount++;
   
   if ($imageCount > $imagesPerRow)
   {
      echo '
         </tr>
         <tr>';
   
      $imageCount = 1;
   }
   
   echo '
            <td style="width: 25%; text-align: center; padding: 1px 1px 10px 1px;">
               <a href="' , $scripturl , '?topic=' , $pollTopic , '">
                  <img ' , $image[0] , ' alt="Go Vote !" title="Go Vote !" border="0" width="100" />
               </a>
               <br />
               Member : ' , strip_tags($pollItem['option']);
               
   if (!$pollResults['allow_vote'])
   {
      echo '
               <br />
               Votes : ' , $pollItem['votes'] , ' (' , $pollItem['percent'] , '%)
               <br />
               ' , $pollItem['bar'];
   }

      echo '
            </td>';
     
}

while ($imageCount < $imagesPerRow)
{
   echo '
            <td style="width: 25%">
            </td>';
   
   $imageCount++;
}

echo '
         </tr>
      </table>';

lurkalot

Just forgot to say.  Once code is pasted in to the blocks using Firefox, you can then edit the code with IE8 and save it without any problems.

Bloomin strange if you ask me.  ???

IchBin

Does it act differently if you put IE8 into compatibility mode?

lurkalot

IchBin, unfortunately no it doesn't, that was one of the first things I tried.

It's strange because it was fine about a month ago, and suddenly started playing up.  This also is happening on both my PC's, one running XP home, and the other windows 7.

Bet Microsoft messed it up with some of their lovely windows updates.  :knuppel2:

Can't believe I'm the only one having this issue though.   ???

IchBin

Well, I'm sure you'd find more people would have the issue if more people used IE8. But I like to think people are smarter than that. :P

This website is proudly hosted on Crocweb Cloud Website Hosting.