今日もガクリ('A`)
きっと明日もまたガクリ?('A`)
2008 / 02
« «  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  » »
archive for 2008年02月22日(金)
Customizable Post Listings の修正

当ブログで使用している WordPress のプラグイン Customizable Post Listings 1 の修正点

  1. サーバーとローカル環境での MySQL のバージョンの違いによる不具合の修正

    $sql .= "GROUP BY $tableposts.ID ORDER BY $orderby $order";

    ローカルで構築した MySQL のバージョンだと、GROUP BY 句を指定していると正常に SELECT されないので、以下の様に修正

    $sql .= "ORDER BY $orderby $order";

  2. バグを見つけたので修正

    if ($orderby != 'rand()') $orderby = "$tableposts.post_$orderby";

      ・
      ・
      ・

    if ('modified' == $orderby) $sql .= "AND $tableposts.post_modified_gmt <= '$now' ";

    上記の最初の if 文で $orderby 変数を置き換えてしまっているので、2番目の if 文では真とはなりません。なので、関数の最初で別変数に保持するように修正

    $o = $orderby;

      ・
      ・
      ・

    if ('modified' == $o) $sql .= "AND $tableposts.post_modified_gmt <= '$now' ";

  3. 新規の投稿も更新にリストアップされるのが気に入らないので、recent posts = recent updates にならないように修正(2番の修正が必要)

    if ('modified' == $o) $sql .= "AND $tableposts.post_modified_gmt <= '$now' AND $tableposts.post_date_gmt <> $tableposts.post_modified_gmt ";

    単に投稿日時と更新日時が同じでないレコードを抽出するように条件を加えただけ

  1. recent posts, recent updates の部分で使用しています。配布元サイトのバージョンは 1.1 となっていますが、何故か私が持っているのは 1.5 です…なんでだろう?どこで落としたのか所在がわからなくなりました…('A`)
blog, WordPresscomment (1)no trackbacks(5,616)
contents
most viewed (1183634)
categories
archives
recent posts
recent updates
recent comments
recent trackbacks
912T ASUSTeK ASUSTeK Crosshair IV Extreme blog CSS DARK SOULS DARK SOULS 3 Darksouls3 DarksoulsIII DARK SOULS III DISM Euro Truck Simulator 2 Everquest II firefox foobar2000 game Install internet KB2990941 KB3087873 mod panels ui PCゲーム PHP PX-Q3PE Raid skin SoftBank software SpeedFan Spinel Steam TPS trailer truck TvRock TVTest Windows Windows 7 Win Toolkit WordPress インストール ダークソウルズ 初音ミク 窓辺ななみ
mobile
qrcode:home
profile
曇り札幌市中央区 ‘ 曇り
気温: 10℃ ‘ 湿度: 66%
recommends
Valid XHTML 1.0 Transitional Valid CSS X.X
RSS 2.0 RSS 0.92
RDF/RSS ATOM
get Firefox 2 get Opera
ie