Js dynamic retrieval of the article content in the dedeCMS system

Source: Internet
Author: User
Js dynamic retrieval of the article content in the dedeCMS system
 
 
  1. Require_once (dirname (_ FILE _). "/include/common. inc. php ");
  2. Require_once (DEDEINC. "/typelink. class. php ");
  3. Require_once (DEDEINC. "/channelunit. func. php ");
  4. $ T1 = ExecTime ();
  5. $ Pai_multi_site = 'y'; // enable absolute path
  6. /** Post call
  7. * Parameter description
  8. * $ ID of the tid column
  9. * $ Flg article attributes
  10. * $ Num the default number of retrieved items is 6.
  11. * $ Order the sorting of articles is reliable (the default sorting of articles is pubdate and inverted)
  12. * $ Class-controlled style name, used to retrieve multiple styles that control different styles on a page. the default value is jsArticle.
  13. * $ How many articles pass by the skip?
  14. **/
  15. // $ Tid = 10;
  16. // $ Flg = 'a, c ';
  17. // $ Num = 20;
  18. If (! (Isset ($ tid) & is_numeric ($ tid )))
  19. {
  20. $ Tid = 0;
  21. }
  22. If (! (Isset ($ num) & is_numeric ($ num )))
  23. {
  24. $ Num = 6;
  25. }
  26. If (! Isset ($ class ))
  27. {
  28. $ Class = 'jsarticle ';
  29. }
  30. If (! (Isset ($ skip) & is_numeric ($ skip )))
  31. {
  32. $ Skip = 0;
  33. }
  34. $ Query = "Select 'id', 'typeid', 'senddate', 'title', 'ismake', 'arcrank ', 'Money ', 'filename' from '# @__ archives 'Where 1 = 1 ";
  35. If ($ tid)
  36. {
  37. $ Query. = "and 'typeid' = '{$ tid }'";
  38. }
  39. If (isset ($ flg ))
  40. {
  41. // $ Query. = "and (1> 1 ";
  42. $ Flgs = explode (',', $ flg );
  43. Foreach ($ flgs as $ v)
  44. {
  45. $ Query. = "and FIND_IN_SET ('{$ v}', 'flag')> 0 ";
  46. }
  47. // $ Query. = ")";
  48. }
  49. If (isset ($ order ))
  50. {
  51. $ Query. = "order by {$ order} desc ";
  52. }
  53. Else
  54. {
  55. $ Query. = "order by pubdate desc ";
  56. }
  57. $ Query. = "limit {$ skip}, {$ num }";
  58. $ Dsql-> Execute ('me', $ query );
  59. While (false! = ($ Row = $ dsql-> GetArray ('me ')))
  60. {
  61. $ TypeLink = new TypeLink ($ row ["typeid"]);
  62. $ Arclink = GetFileUrl (
  63. $ Row ['id'],
  64. $ Row ["typeid"],
  65. $ Row ["senddate"],
  66. $ Row ["title"],
  67. $ Row ["ismake"],
  68. $ Row ["arcrank"],
  69. $ TypeLink-> TypeInfos ['namerule'],
  70. $ TypeLink-> TypeInfos ['typedir'],
  71. $ Row ["money"],
  72. $ Row ['filename'],
  73. $ TypeLink-> TypeInfos ['moresite '],
  74. $ TypeLink-> TypeInfos ['siteurl'],
  75. $ TypeLink-> TypeInfos ['sitepath']
  76. );
  77. Unset ($ TypeLink );
  78. $ Row ['URL'] = $ arclink;
  79. $ Rows [] = $ row;
  80. }
  81. Echo "document. write ('
      ');";
    • Foreach ($ rows as $ row)
    • {
    • Echo "document. write ('
    • {$ Row ['title']}
    • ');";
    • }
    • Echo "document. write ('
    ');";
  82. $ T2 = ExecTime ();
  83. /* Echo 'execution time ';
  84. Echo $ t2-$ t1 ;*/
  85. ?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.