<?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);

    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);

         $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  $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>';
                   }
           }  
    }
    else{
        echo '出错，相册不存在。- '.$pidname;
    }
?>
