:::

8-6 /blocks/tad_ebook_list.php

<?php
//顯示函數
function tad_ebook_list($options){
  global $xoopsDB ;

  //單一檔案真實路徑:
  include_once XOOPS_ROOT_PATH."/modules/tadtools/TadUpFiles.php" ;
  $TadUpFiles=new TadUpFiles("tad_ebook");

  $myts =& MyTextSanitizer::getInstance();

  $today=date("Y-m-d");
  $tbl=$xoopsDB->prefix('tad_ebook');
  $sql="select * from `{$tbl}` where `ebook_publish_date` <= '{$today}' order by `ebook_publish_date` desc";


  $result=$xoopsDB->query($sql) or die(mysql_error());

  $i=0;
  $all_data="";
  while($all=$xoopsDB->fetchArray($result)){

    $all['ebook_title']=$myts->htmlSpecialChars($all['ebook_title']);

    $TadUpFiles->set_col('ebook_sn',$all['ebook_sn']);
    $all['ebook_pic']=$TadUpFiles->get_pic_file('thumb');

    $all_data[$i]=$all;
    $i++;
  }

  $block['show_pic']=$options[0];
  $block['height']=$options[1];
  $block['all_data']=$all_data;

  return $block;
}



//設定函數
function tad_ebook_list_edit($options){

  $checked1=$options[0]=='1'?"checked":"";
  $checked0=$options[0]=='0'?"checked":"";

  $form="
  是否顯示縮圖?
  <input type='radio' name='options[0]' value='1' $checked1>是
  <input type='radio' name='options[0]' value='0' $checked0>否
  <br>
  區塊高度?
  <input type='text' name='options[1]' value='{$options[1]}'>
  ";
  return $form;
}
?>

 


:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.cp27.secserverpros.com%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1178%26tbsn%3D37

書籍目錄

展開 | 闔起

線上使用者

354人線上 (152人在瀏覽線上書籍)

會員: 0

訪客: 354

更多…