发布时间:2023-07-30 15:46:03
来源:互联网
.
翟塘峡口曲江头,万里风烟接素秋。那遍地的绿草,那微风中轻轻摇曳的芦苇,那栖满了夜鹭的灌木丛,就像一幅立体的田园画,静静地展现在我的眼前。
大家可以看到大多数的下载站在软件下载地址处使用的是全局调用函数来实现的,可以这样说很多的朋友不是太明白,我们还是先来看一张效果图(如下),大家应该明白我的意思了吧。下面是我从网上搜集来的相关调用实例,供大家学习研究。
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
- function getsoftlinks($channelid,$type,$aid){
- global $dsql;
- $goto = $dsql->GetOne("Select * From `dede_softconfig` ");
- $channeltable = $dsql->GetOne("select * from `dede_channeltype` where id = $channelid");
- $addtable = $channeltable['addtable'];
- $row = $dsql->GetOne("select * from `".$addtable."` where aid = $aid");
- if ($type == 1){
- if($row['softlinks'] != ''){
- $dtp = new DedeTagParse();
- $dtp->LoadSource($row['softlinks']);
- foreach($dtp->CTags as $ctag){
- if($ctag->GetName()=='link'){
- $link = trim($ctag->GetInnerText());
- $serverName = trim($ctag->GetAtt('text'));
- $islocal = trim($ctag->GetAtt('islocal'));
- if ($islocal == 1){
- if($goto['gotojump'] == 1){
- $uhash = substr(md5($link), 0, 24);
- $links = "/plus/download.php?open=2&id=$aid&uhash=$uhash";
- }
- return $links;
- }
- }
- }
- }
- }
- else if($type == 0){
- if($row['softlinks'] != ''){
- $dtp = new DedeTagParse();
- $dtp->LoadSource($row['softlinks']);
- if(is_array($dtp->CTags)){
- foreach($dtp->CTags as $ctag){
- if($ctag->GetName()=='link'){
- $link = trim($ctag->GetInnerText());
- $serverName = trim($ctag->GetAtt('text'));
- $islocal = trim($ctag->GetAtt('islocal'));
- $rapidity = rand(0,70);
- if ($rapidity == 0){
- $line = 'stop';
- }
- elseif($rapidity <= 20){
- $line = 'busy';
- }
- elseif($rapidity <= 40){
- $line = 'nofree';
- }
- else{
- $line = 'free';
- }
- if ($islocal != 1){
- if($goto['gotojump'] == 1){
- $uhash = substr(md5($link), 0, 24);
- $link = "/plus/download.php?open=2&id=$aid&uhash=$uhash";
- }
- $links = "<tr><td class='line-name'><a rel="nofollow noopener noreferrer" href='".$link."' target='_blank'>".$serverName."</a></td><td>链接速度:</td><td class='line-speed'><p class='".$line." speed-bad'>".$rapidity."</p></td></tr>";
- $downlinks .= $links;
- }
- }
- }
- }
- $dtp->Clear();
- return $downlinks;
- }
- }
- else{
- return "调用参数错误";
- }
- }
- ?>
以上就是织梦CMS下载地址如何全局调用函数。是一趟旅途,每个人都在途中,路过的都是景,擦肩的都是客,遇到的都是缘,回忆的都是念,时光如淡烟,我们抓不住,美好一瞬间,不能长久拥有,学会从过去中转身,幸福才会招待你。更多关于织梦CMS下载地址如何全局调用函数请关注haodaima.com其它相关文章!
|