list_new.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. //
  3. require_once "../path.php";
  4. require_once "../public/_pdo.php";
  5. require_once '../public/load_lang.php';
  6. require_once '../ucenter/function.php';
  7. global $PDO;
  8. PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
  9. $query = "select * from article where 1 order by create_time DESC limit 0,4";
  10. $Fetch = PDO_FetchAll($query);
  11. foreach($Fetch as $row){
  12. echo '<div class="content_block">';
  13. echo '<div class="card">';
  14. echo '<div class="pd-10">';
  15. echo '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../article/?id='.$row["id"].'&display=para">'.$row["title"].'</a></div>';
  16. echo '<div class="summary" style="padding-bottom:5px;color: #ad4b00;">'.$row["subtitle"].'</div>';
  17. echo '<div class="author" style="padding-bottom:5px;margin-bottom:0.4em;">';
  18. echo '<a href="../uhome/course.php?userid='.$row['owner'].'">';
  19. echo ucenter_getA($row["owner"]);
  20. echo '</a>';
  21. echo '</div>';
  22. echo '<div class="summary" style="padding-bottom:5px;height: 4.5em;line-height: 1.5em;overflow-y: hidden;">'.$row["summary"].'</div>';
  23. echo '</div>';
  24. echo '<div class="pd-10" style="display:flex;justify-content: space-between;">';
  25. echo '</div>';
  26. echo '</div>';
  27. echo '</div>';
  28. }
  29. ?>