DEDE 5.7 홈페이지를 가중치별로 정렬하는 방법

藏色散人
풀어 주다: 2019-11-15 11:14:49
원래의
1824명이 탐색했습니다.

DEDE 5.7 홈페이지를 가중치별로 정렬하는 방법

DEDE 5.7 홈페이지를 무게순으로 정렬하는 방법은 무엇인가요?

#🎜 🎜#DEDE 5.7 홈페이지 [arclist] 무게별 정렬 추가

1 Dreamweaver 시스템의 includetaglib 디렉토리에서 arclist.lib.php 파일을 찾아 엽니다 #🎜 🎜## 🎜🎜# 74행과 75행 주위에서 발견됨:

권장 학습:

dedecmstutorial

  // arclist是否需要weight排序,默认为"N",如果需要排序则设置为"Y"
$isweight = $ctag->GetAtt('isweight');
로그인 후 복사
이 행을 다음으로 변경: #🎜🎜 #
 $weight = $ctag->GetAtt('weight');
로그인 후 복사
327행에서 발견됨

  //文档排序的方式
    $ordersql = '';
    if($orderby=='hot' || $orderby=='click') $ordersql = " ORDER BY arc.click $orderWay";
    else if($orderby == 'sortrank' || $orderby=='pubdate') $ordersql = " 
ORDER BY arc.sortrank $orderWay";
    else if($orderby == 'id') $ordersql = "  ORDER BY arc.id $orderWay";
    else if($orderby == 'near') $ordersql = " ORDER BY ABS(arc.id - ".$arcid.")";
    else if($orderby == 'lastpost') $ordersql = "  ORDER BY arc.lastpost $orderWay";
    else if($orderby == 'scores') $ordersql = "  ORDER BY arc.scores $orderWay";
    else if($orderby == 'rand') $ordersql = "  ORDER BY rand()";
    else $ordersql = " ORDER BY arc.sortrank $orderWay";
로그인 후 복사

수정됨:

    //文档排序的方式
    $ordersql = '';
    if($orderby=='hot' || $orderby=='click') $ordersql = " ORDER BY arc.click $orderWay";
    else if($orderby == 'sortrank' || $orderby=='pubdate') $ordersql = " 
ORDER BY arc.sortrank $orderWay";
    else if($orderby == 'id') $ordersql = "  ORDER BY arc.id $orderWay";
    else if($orderby == 'near') $ordersql = " ORDER BY ABS(arc.id - ".$arcid.")";
    else if($orderby == 'lastpost') $ordersql = "  ORDER BY arc.lastpost $orderWay";
    else if($orderby == 'scores') $ordersql = "  ORDER BY arc.scores $orderWay";
    else if($orderby == 'rand') $ordersql = "  ORDER BY rand()";
    else if($orderby == 'weight') $ordersql = "  order by arc.weight $orderWay";//如果没有特定设置排序则按照权重先排序
    else $ordersql = " ORDER BY arc.sortrank $orderWay";
로그인 후 복사

OK 이제 이 문서를 저장하면 홈페이지에서 orderby='weight'를 사용할 수 있습니다.

위 내용은 DEDE 5.7 홈페이지를 가중치별로 정렬하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!