...EGO ALPHA ET OMEGA, PRIMUS ET NOVISSIMUS, PRINCIPIUM ET FINIS...
...EGO PRAETERITUS, ET NUNC, ET POSTERUS: ET IN SEMPER...
...EGO TOTUS, UNUS IN SAECULA SAECULORUM...
Ronde des Lutins, La

 

 

 

 

內文摘要獨立顯示 網路技術 - TT


Tatter Tools原本對於內文的摘要是使用JavaScript展開/縮略內文
此項修改可以將摘要和內文分開,適用於0.9X

  • 在一般瀏覽頁面上顯示摘要,點擊進入可閱讀全文
  • 由於摘要和內文分開儲存在不同欄位,使用者可以另外撰寫摘要,不需非從內文擷取不可



    修改方法

    1.將下列語法加入mysql database

    ALTER TABLE `t3_(你的前綴)` ADD `summary` TEXT NOT NULL;

    2.打開index.php

    尋找以下語法:

    $sql = "select count(*) from t3_".$dbid." where $is_public $add_query";
    list ($t_cnt) = mysql_fetch_array(mysql_query($sql));

    $sql = "
      select
         no, category1, category2, title, body
        , user_id, image_file_path1, image_file_path2, regdate
        , rp_cnt, tb_cnt, view_cnt, is_sync, is_public
        , perm_rp, perm_tb

    加入粗體部份:

    $sql = "select count(*) from t3_".$dbid." where $is_public $add_query";
    list ($t_cnt) = mysql_fetch_array(mysql_query($sql));

    $sql = "
      select
        no, category1, category2, title, body
        , user_id, image_file_path1, image_file_path2, regdate
        , rp_cnt, tb_cnt, view_cnt, is_sync, is_public
        , perm_rp, perm_tb, summary

    尋找以下語法:

    $result = @mysql_query($sql);
    while(list(
      $no, $category1, $category2, $title, $body
      , $user_id, $image_file_path1, $image_file_path2, $regdate
      , $rp_cnt, $tb_cnt, $view_cnt, $is_sync, $is_public_set
      , $perm_rp, $perm_tb
      ) = @mysql_fetch_array($result)) {

    加入粗體部份:

    $result = @mysql_query($sql);
    while(list(
      $no, $category1, $category2, $title, $body
      , $user_id, $image_file_path1, $image_file_path2, $regdate
      , $rp_cnt, $tb_cnt, $view_cnt, $is_sync, $is_public_set
      , $perm_rp, $perm_tb, $summary
      ) = @mysql_fetch_array($result)) {

    尋找以下語法:

    $d2_rp = $skin->s_article_rep;

    $d2_rp = str_replace("", "", $d2_rp);
    $d2_rp = str_replace("", "", $d2_rp);

    加入粗體部份:

    $d2_rp = $skin->s_article_rep;

    if ($md != "pl") $body = $summary."<br>(繼續閱讀)<br> "; // 這裡可修改閱讀全文的字樣

    $d2_rp = str_replace("", "", $d2_rp);
    $d2_rp = str_replace("", "", $d2_rp);

    3.打開admin/article_edit.php

    尋找以下語法:

    $d2_rp = $skin->put_query("
      insert into t3_".$dbid." (
         title, body, user_id, image_file_path1, image_file_path2, regdate
        ) values (
        '輸入網誌文章主題', '輸入網誌文章內容', '$p_user_id', '$image_file_path1', '$image_file_path2', '".time()."'
        )
      ");

    加入粗體部份:

    put_query("
      insert into t3_".$dbid." (
        title, body, user_id, image_file_path1, image_file_path2, regdate, summary
        ) values (
        '輸入網誌文章主題', '輸入網誌文章內容', '$p_user_id', '$image_file_path1', '$image_file_path2', '".time()."','輸入網誌文章摘要'
        )
      ");

    尋找以下語法:

    put_query("
      update t3_".$dbid." set
        category1 = '$category1'
        , category2 = '".$$category2."'
        , user_id = '$user_id'
        , title = '$title'
        , regdate = '$regdate'
        , body = '".trim($body)."'
        , subscription = '$subscription'
        , perm_rp = '$perm_rp'
        , perm_tb = '$perm_tb'
      where
        no = '$num'
      ");

    加入粗體部份:

    put_query("
      update t3_".$dbid." set
        category1 = '$category1'
        , category2 = '".$$category2."'
        , user_id = '$user_id'
        , title = '$title'
        , regdate = '$regdate'
        , body = '".trim($body)."'
        , subscription = '$subscription'
        , perm_rp = '$perm_rp'
        , perm_tb = '$perm_tb'
        , summary = '".trim($summary)."'
      where
        no = '$num'
      ");

    尋找以下語法:

    $sql = "
      select
        category1, category2, title, body, user_id,
        image_file_path1, image_file_path2, regdate, is_public
        , subscription, perm_rp, perm_tb
      from
        t3_".$dbid."
      where
        no = $num
      ";
    list (
      $category1, $category2, $title, $body, $user_id,
      $image_file_path1, $image_file_path2, $regdate, $is_public
      , $subscription, $perm_rp, $perm_tb
      ) = mysql_fetch_array(mysql_query($sql));

    加入粗體部份:

    $sql = "
      select
        category1, category2, title, body, user_id,
        image_file_path1, image_file_path2, regdate, is_public
        , subscription, perm_rp, perm_tb, summary
      from
        t3_".$dbid."
      where
        no = $num
      ";
    list (
      $category1, $category2, $title, $body, $user_id,
      $image_file_path1, $image_file_path2, $regdate, $is_public
      , $subscription, $perm_rp, $perm_tb, $summary
      ) = mysql_fetch_array(mysql_query($sql));

    尋找以下語法:

    <table style="margin:10 0 0 0">
      <tr>
        <td width="75" align="right">文章標題 :: </td>
        <td><input type="text" class="text" maxlength="80" name="title" value="<?=$title?>" style="width:328"><br></td>
      </tr>
    </table>

    加入粗體部份:

    <table style="margin:10 0 0 0">
      <tr>
        <td width="75" align="right">文章標題 :: </td>
        <td><input type="text" class="text" maxlength="80" name="title" value="<?=$title?>" style="width:328"><br></td>
      </tr>
    </table>

    <table style="margin:10 0 0 0">
      <tr>
        <td width="75" align="right" valign="top">文章摘要 :: </td>
        <td><textarea name="summary" rows="5" onselect="save_pos(this)" onclick="save_pos(this)" onkeyup="save_pos(this)" style="width:328;"><?=str_replace("&", "&", trim(set_body($summary)))?></textarea></td>
      </tr>
    </table>

    尋找以下語法:

    $sql = "
      select
        no, category1, category2, title, body, user_id, image_file_path1, image_file_path2, regdate, is_public, is_sync
      from
        t3_".$dbid."
      where
        no = $num
      ";
    list ($no, $category1, $category2, $title, $body, $user_id, $image_file_path1, $image_file_path2, $regdate, $is_public, $is_sync) = mysql_fetch_array(mysql_query($sql));

    加入粗體部份:

    $sql = "
      select
        no, category1, category2, title, body, user_id, image_file_path1, image_file_path2, regdate, is_public, is_sync, summary
      from
        t3_".$dbid."
      where
        no = $num
      ";
    list ($no, $category1, $category2, $title, $body, $user_id, $image_file_path1, $image_file_path2, $regdate, $is_public, $is_sync, $summary) = mysql_fetch_array(mysql_query($sql));



    修改完後只有一個問題:必須全部重新另行輸入各文章的摘要|||||
  • 05/11/15 06:29
    VIEWED (13743) TRACKBACK (1) REPLIES (3)

    kana 06/04/02 16:20
    請問這個在1.0.1版上可以嘛...??

    彤影 06/04/03 15:35
    應該不行,因為1.0版整個系統完全不一樣了

    06/05/07 06:50
    此回覆僅限站長瀏覽

    NAME
    URL
    CODE
    PASS
    SECRET

    PAGE: 1 ...  83 84 85 86  87  ...  111
    TODAY: 7 | YESTERDAY: 246 | TOTAL: 1319900