Lazyest Galley是一个用于wordpress的相册管理插件,这个bug是在Sidebar随机显示图片时,点链接时不能显示正确的图像,后来检查了一下plugin内的lazyest-gallery.php这个文件,发现是重复的写了一个”/”, 删除多余的符号即可以正常显示。


如下,删除蓝字的地方。


// =================== Sidebar Functions ===============


 function lg_random_image($title){
 global $gallery_address, $gallery_root;
 if ($dir_content = opendir($gallery_root)) {


  echo ‘

  • ‘ . $title . ‘

    ‘.”\n”;


      $random_folders = array();
      for ( $i = 0; false !== ($dir = readdir($dir_content)) && !(is_file($dir)); $i++ ) {
       $forbidden = explode(‘,’, get_option(‘lg_excluded_folders’));
       for ($j = 0; $j < count($forbidden); $j++) {
        if ($dir !== $forbidden[$j] && $dir != “..” && $dir != “.” && !eregi(‘^.*\.(xml)$’, $dir))
         $random_folders[$i] = $dir;
       }
      }
      $rnd_folder = $random_folders[rand(0,sizeof($random_folders)-1)].”/”(删除此处的”/”)


     // if (substr($rnd_folder, strlen($rnd_folder)-1, strlen($rnd_folder)) != “/”)
      // $rnd_folder .= “/”;


      $imgfiles = lg_build_img_array($rnd_folder, false);
      $img = $imgfiles[rand(0,sizeof($imgfiles)-1)];


      echo ‘


       ‘;


      


  • 1条评论

    1. 你好,我是GOOGLE到你這裡的,我裝了lazyest gallery插件,沒發現頁面在哪裡,看了你的文章,是否在SIDEBAR裡?SIDEBAR幾乎被我刪掉,現在祇剩下有用的連接,那這樣是否無法顯示LG?望賜教

    发表评论

    评论也有版权!

    click to change验证码