Jump to content

Function not working on IE


balkan7

Recommended Posts

this function i use for YouTube videos only works in FF and IE shows me the errors and not to open the popup, how can I fix this error.

 

<?php
function displayVideos($Videos, $maxVideos=NULL,$columns=4,$rows=NULL){
  	global $locale;
  	// Popup
      echo "<script type='text/javascript'>
	  function open(url, title,w,h) {
       var left = (screen.width/2)-(w/2);
       var top = (screen.height/2)-(h/2);
       var targetWin = window.open (url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
      } </script>";
       // End
    if($maxVideos==Null){
      $maxVideos=count($Videos);
    }
    if(!is_int($maxVideos)){
      trigger_error("Maximum number of videos to show must be an integer, not ".$maxVideos,E_USER_WARNING);
      return 1;
    }
    if($rows==NULL){
      $rows=ceil($maxVideos/$columns);
    }

    echo '<table align="center" width="100%" border="0" cellspacing="5" cellpadding="5" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;">';
    $i = 0;
    //print_r($Videos[0]);
    $video=$Videos[$i];

    for($r=0; $r < $rows; $r++) {
      $video=$Videos[$i];
      echo '<tr>';
      for($c=0; $c < $columns; $c++) {
echo '<td valign="top" width="130">';
if($i < $maxVideos && $Videos[$i]){
  $video=$Videos[$i];
  if (isset($_GET['s']) == "mr") {
  	
    echo "<a href=\"javascript: void(0);\" onClick=\"open('pogledni.php?video=".$video->url."', '".$video->title."', '620', '480');\"><img src='http://i.ytimg.com/vi/".$video->url."/default.jpg' border='0' width='130' height='97' /><br />".$video->title."</a><br />".$locale['yt-012']." ".$video->postdate."<br />".$locale['yt-013']." ".$video->views."";
  }
  else {
    echo "<a href=\"javascript: void(0);\" onClick=\"open('pogledni.php?video=".$video->url."', '".$video->title."', '620', '480');\"><img src='http://i.ytimg.com/vi/".$video->url."/default.jpg' border='0' width='130' height='97' /><br />".$video->title."</a><br />".$locale['yt-012']." ".$video->postdate."<br />".$locale['yt-013']." ".$video->views."<br />";
    if ($video->star1!=""){
      echo $locale['yt-014'].'<img src="'.$video->star1.'" /><img src="'.$video->star2.'" /><img src="'.$video->star3.'" /><img src="'.$video->star4.'" /><img src="'.$video->star5.'" />';
    }
    else{
      echo '<br/>';
    }
    echo '<br /> ';
  }
}
echo '</td>';
$i++;

      }
    }
    echo '</table><div align="right" style="padding-right: 25px">';
  }
?>

Link to comment
https://forums.phpfreaks.com/topic/147222-function-not-working-on-ie/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.