织梦dedecms自定义标签liketags调用tag/keyword相同的相关文章(2)

             $keyword = ( !empty($refObj->Fields['keywords']) ? $refObj->Fields['keywords'] : '' );

         }

          

         $typeid = ( !empty($mytypeid) ? $mytypeid : 0 );

         if(empty($typeid))

         {

             if(!empty($refObj->Typelink->TypeInfos['reid'])) {

                  $typeid = $refObj->Typelink->TypeInfos['reid'];

             }

             else {

                  if(!empty($refObj->Fields['typeid'])) $typeid = $refObj->Fields['typeid'];

             }

         }

          

         if( !empty($typeid) && !preg_match('#,#', $typeid) ) {

             $typeid = GetSonIds($typeid);

         }

          

         if(!empty($refObj->Fields['tags']) && $eregtype != 'keyword' ) 

         {

             $tags = explode(',', addslashes($refObj->Fields['tags']));

             $getsql = " tag like '".join("' OR tag like '", $tags)."' ";

             $dsql->Execute('me', "Select * From `dede_tagindex` where $getsql ");

             while($arow = $dsql->GetArray('me'))

             {

                 $tids[] = $arow['id'];

             }

             $tid = join(',', $tids);

             if($tid!='')

             {

                 $dsql->Execute("me", "Select aid From `dede_taglist` where tid in($tid) And arcrank > -1 group by aid order by aid desc");

                 while($arow = $dsql->GetArray("me"))

                 {

                     $ids[] = $arow['aid'];

                     $arcid =  $refObj->Fields['aid'];

                 }

             } 

         }

         if($eregtype == 'tag' && count($ids) == 0 )

         {

             return;

         }

         else

         {

             if(count($ids) > 0)

             {

                 if(!empty($typeid))

                 {

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6c6fba2fe861ebb8814605b843aea190.html