Note: '//+' means an additional comment added by me
Class TypeLink
{
var $typeDir;
var $dsql;
var $TypeID; //+ category ID
var $baseDir; //+ Site root URL
var $modDir; //+ Template directory
var $indexUrl; //+ Home page link address
var $indexName; //+ Home page link Name
var $TypeInfos; //+ Category information
var $SplitSymbol; //+ Spacing symbol for column position
var $valuePosition; //+ Homepage> Domestic> Two Sessions News> ( With connection)
var $valuePositionName; //+ Homepage> Domestic> Two Sessions News> (Without connection)
var $OptionArrayList; //+ Category drop-down list
Function one, get a certain Category link
Copy code The code is as follows:
//Get the URL of a category link
function GetOneTypeUrl( $typeinfos)
{
return GetTypeUrl();
}
//Get hyperlink information of a certain category
function GetOneTypeLink($typeinfos)
{
$ typepage = $this->GetOneTypeUrl($typeinfos);
$typelink = "
".$typeinfos['typename']."return $typelink;
}
Function 2, get a link list of a certain category, such as: 'Category 1>Category 2>' .
Copy code The code is as follows:
//islink indicates whether the returned list has a connection
//+ SplitSymbol column The position interval symbol dede system defaults to '-'
function GetPositionLink($islink=true)
{ //+ Get the homepage link name
$indexpage = "
".$this->indexName."";
……
……
else
{
if($ islink)
{
$this->valuePosition = $this->GetOneTypeLink($this->TypeInfos);
if($this->TypeInfos['reid']!=0 )
{
//Call recursive logic
$this->LogicGetPosition($this->TypeInfos['reid'],true);
}
$this-> valuePosition = $indexpage.$this->SplitSymbol.$this->valuePosition;
return $this->valuePosition.$this->SplitSymbol;
}
else
{
$this->valuePositionName = $this->TypeInfos['typename'];
if($this->TypeInfos['reid']!=0)
{
// Call recursive logic
$this->LogicGetPosition($this->TypeInfos['reid'],false);
}
return $this->valuePositionName;
}
}
}
//Get a link list of a certain category, recursive logic part
function LogicGetPosition($id,$islink)
{
$this->dsql->SetQuery ("SQL query statement");
$tinfos = $this->dsql->GetOne();
if($islink)
{ //+ list with connection
$this ->valuePosition = $this->GetOneTypeLink($tinfos).$this->SplitSymbol.$this->valuePosition;
}
else
{ //+ List without connection
$this->valuePositionName = $tinfos['typename'].$this->SplitSymbol.$this->valuePositionName;
}
if($tinfos['reid']>0 )
{ //+ Recursive
$this->LogicGetPosition($tinfos['reid'],$islink);
}
}
Function 3 , to obtain the advanced search function of category list, that is, highsearch.php, you need to use this function
Copy the code The code is as follows:
/ /hid refers to the category selected by default, 0 means "please select a category" or "no category limit"
//oper is the category that the user is allowed to manage, 0 means all categories
//channeltype is Refers to the content type of the category, 0 means no channel limit
function GetOptionArray($hid=0,$oper=0,$channeltype=0,$usersg=0)
{
return $this-> ;GetOptionList($hid,$oper,$channeltype,$usersg);
}
function GetOptionList($hid=0,$oper=0,$channeltype=0,$usersg=0)
{
return $this->OptionArrayList;
}
//+ Add '-' recursively for lower-level categories
function LogicGetOptionArray($id, $step, $oper=0)
{
}
Function 4,
//Get the categories related to this class. This function is applied to the template tag {dede:channel}{/dede:channel}
//The value of $typetype is: sun lower-level category self sibling category top top-level category
Copy code The code is as follows:
function GetChannelList($typeid=0,$reid=0,$row=8,$typetype='sun',$innertext='',
$col=1,$tablewidth=100,$myinnertext= '')
{
}
}
http://www.bkjia.com/PHPjc/321595.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321595.htmlTechArticleNote: '//+' represents an additional comment added by me Class TypeLink { var $typeDir; var $ dsql; var $TypeID; //+ Category ID var $baseDir; //+ Site root URL var $modDir; //+ Template directory...