<?php

$langwhere =  $andlangbh;
//if(ENABLEMULTISITE=='y')  $langwhere = ''; //这里用不上。

    $sqlabm = "SELECT * from ".TABLE_ALBUM."  where  pidname='$pidname'   $langwhere  order by  id desc";
       //echo '==============='.$sqlabm;
$dhtrigger = 'album'.rand(1000,9999);
 $albumpidname = $pidname;

    if(getnum($sqlabm)>0){
         $row = getrow($sqlabm);
         $effect = $row['effect'];
      
         $langalbum = $row['lang']; //for multi lang

         $pid = $row['pid'];
         $cssname = $row['cssname'];$cssstyle = $row['cssstyle'];
         $cus_columns = $row['cus_columns'];
         $cus_columnsv = ' '.cus_columnsfun($cus_columns);
         $cus_columnsv_bt = ' '.cus_columnsfun_bt($cus_columns);

         $stylev = $cssstyle<>''?' style="'.$cssstyle.'" ':'';

         if($effect<>'hide.php') {

               $sql = "SELECT * from ".TABLE_ALBUM."  where  pid='$pidname' and sta_visible='y'   $langwhere  order by pos desc,id desc";
                   if(getnum($sql)>0){

                  // if(substr($effect,0,5)=='self_')   $file  =  TPLCURROOT.'selfblock/album/'.$effect;
                   //  else if(substr($effect,0,5)=='dmre_')   $file =  REGIONROOT.'dmregion_block/dmreblock/album/'.$effect;
                   //  else  $file =  BLOCKROOT.'album/'.$effect;
                    // $file  =  BLOCKROOT.'jteffect/'.$effect.'.php';
                        if(substr($effect,0,5)=='self_') $file =  TPLCURROOT.'selfblock/album/'.$effect;
                        else if(substr($effect,0,13)=='jthome_effect') $file =  JTHOMEROOT.$effect;
                        else  $file = SYSBLOCKROOT.'album/'.$effect;						
						 

                       if(checkfile($file)) {
                          echo '<div class="albumwrap tc  '.$cssname.'" '.$stylev.'>';
                            $row_abm = getall($sql);
                            require $file;
                           echo '</div>';
                      }

                   }
                   else{
                     echo  '<div class="tc p30"><img src = "'.STAPATH.'img/noimg.png" alt="此相册里没有图片" /><p>此相册里没有图片，请上传。</p></div>';
                   }
           }  
//--------------

       if(dmlogin()){  

             $urlhere = BASEURL.ADMINDIR;
             //mod_album/mod_album.php?lang=en&pid=album20180605_1746046650
             $editlink = $urlhere.'/mod_album/mod_album.php?lang='.$langalbum.'&pid='.$albumpidname;
             echo '<div style="padding:10px;text-align:center"><a target="_blank" href="'.$editlink.'">编辑相册</a></div>';
         }
  //   ---------------------

    }
    else{
        echo '出错，相册不存在。- '.$pidname;
    }
?>
