global.func.php 755 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. *
  4. * 格式化url
  5. */
  6. function format_url($path) {
  7. if (!$path) return IMG_PATH.'nopic.jpg';
  8. if (strpos($path, 'http://')===FALSE && strpos($path, 'https://')===FALSE) {
  9. return 'http://'.$path;
  10. } else {
  11. return $path;
  12. }
  13. }
  14. /**
  15. * Function ISHTML
  16. * 判断内容是否需要生成静态
  17. * @param int $catid 栏目id
  18. */
  19. function ishtml($catid = 0) {
  20. static $ishtml, $catid_siteid;
  21. if (!isset($ishtml[$catid])) {
  22. if (!$catid_siteid) {
  23. $catid_siteid = getcache('category_content', 'commons');
  24. } else {
  25. $siteid = $catid_siteid[$catid];
  26. }
  27. $siteid = $catid_siteid[$catid];
  28. $categorys = getcache('category_content_'.$siteid, 'commons');
  29. $ishtml[$catid] = $categorys[$catid]['content_ishtml'];
  30. }
  31. return $ishtml[$catid];
  32. }