ぐーぐるるるるぅ・・・きゅう(〜〜)  
WordPress
info @ 2007/2/25 Sunday 1:41:42

現状では、LINK画像を表示すると、LINK先の名前の表示が行われなくなってしまいます。
そこで、aタグとimgタグに設定されているtitleには、概要ではなくLINK先の名前を設定するように変更します。
また、LINK先の名前も概要の上に表示するようにしておきます。

2.1.1〜(2007.3.19 追加)

2.1.1よりwp_get_links(get_links)がwp_include/links.phpからwp/include/bookmark-template.phpに移動しました。
併せてwp_linksテーブルのlink_categoryが、wp_categoriesテーブルのcat_IDに統合されたようです。wp_get_links(get_links)で、link_categoryにより表示わけを行っていた場合は、cat_IDに変更しないと、リンクが表示されなくなります。

/wp-includes/bookmark-template.php

106行目
$title = $desc;
↓
$title = $name;

128行目
$imgaruyo=’<a href=”’ . $the_link . ’”’ . $rel . $target. ’>’
.”<b>”.$name.”</b></a><br />”;

129行目
$output .= $name;
↓
$output .= “<b>”.$name.”</b>”;

138行目
$output .= $between .$desc;
↓
$output .= $between . $imgaruyo .$desc;

2.0.5〜2.1.0
/wp-includes/links.php

224行目
$title = $desc;
↓
$title = $name;

250行目
$imgaruyo=’<a href=”’ . $the_link . ’”’ . $rel . $target. ’>’
.”<b>”.$name.”</b></a><br />”;

251行目
$output .= $name;
↓
$output .= “<b>”.$name.”</b>”;

261行目
$output .= $between .$desc;
↓
$output .= $between . $imgaruyo .$desc;

・・・で出来たのがここのリンク集って感じです(〜〜)

procmail
info @ 2007/2/24 Saturday 0:49:14

Postfix + Amavisd-new + SpamAssassin が動作している環境で、
procmailの一番簡単な導入を試みます。

Postfixの設定。

/etc/postfix/main.conf を変更

#mailbox_command = /some/where/procmail
↓
mailbox_command = /some/where/procmail

procmailの設定。

/etc/procmailrc を作成

PATH=/bin:/usr/bin
MAILDIR=$HOME/Maildir
DEFAULT=$MAILDIR/

:0
*^X-Spam-Status: YES
$MAILDIR/.spam/

 ※procmailrcはパーミッションを644で設定しないと、
  メンバーから読み取れない為に、「Couldn’t create ”var/mail/***”」
  というメッセージを出力してメールを送信者に返却します。
 ※環境により設定ファイルの場所や、記入内容が異なる場合があります。
 ※改行コードや文字コードが違うと正しく動作しない場合があります。

Amavisd-newの設定

/etc/amavisd.conf

$final_spam_destiny  = D_BAUNCE;
↓
$final_spam_destiny  = D_PASS;

Postfix をリロード、Amavisd-newをリスタートしておしまい。

IMAPを利用する場合、スパムメールが配送される際に自動的にspamフォルダが作成され、
スパムメールがその中に保存されます。

osCommerce+Mobile
info @ 2007/2/19 Monday 8:47:18

前回2つの保留事項がありましたが、とりあえず2つとも解決することが出来ました。

 1.カタログで商品一覧を表示する際に
 「1054 - Unknown column “p.products_id” in “on clause”」エラーが表示されます。

 これは、SQLの評価順位がMySQL5.0から変更になった(さらに厳しくなった)ことが原因であるようです。対策としては、from ・・・ left join ・・・ left join と言う形を使用しているSQLに()を付けて評価する優先順位を明示的に示す必要があります。

/catalog/default.php

(190行目)
$listing_sql = “select ” . $select_column_list . ” p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ” . TABLE_PRODUCTS_DESCRIPTION . ” pd, ” . TABLE_PRODUCTS . ” p left join ” . TABLE_MANUFACTURERS . ” m on p.manufacturers_id = m.manufacturers_id, ” . TABLE_PRODUCTS_TO_CATEGORIES . ” p2c left join ” . TABLE_SPECIALS . ” s on p.products_id = s.products_id where p.products_status = ’1’ and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = ’” . $languages_id . “’ and p2c.categories_id = ’” . $current_category_id . “’”;

$listing_sql = “select ” . $select_column_list . ” p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ((” . TABLE_PRODUCTS_DESCRIPTION . ” pd, ” . TABLE_PRODUCTS . ” p) left join ” . TABLE_MANUFACTURERS . ” m on p.manufacturers_id = m.manufacturers_id, ” . TABLE_PRODUCTS_TO_CATEGORIES . ” p2c) left join ” . TABLE_SPECIALS . ” s on p.products_id = s.products_id where p.products_status = ’1’ and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = ’” . $languages_id . “’ and p2c.categories_id = ’” . $current_category_id . “’”;

同様の対応は、各所に入れていかなければいけないと思われます。発見しだいコメントにて追加していきます。

※毎度の事ながら、シングルクォーテーションは全角に変換して表示しています。

2.adminにて、認証後に機能一覧で機能を選択すると、LOGIN画面に戻されてしまいます。

 これはどうやら、.htaccessが正常に作動していなかっただけのようです。
 次の設定を追加しています。

php_flag output_buffering Off
php_flag register_long_arrays On
php_flag register_globals On
php_value default_charset EUC-JP
php_value mbstring.language Japanese
php_flag encoding_translation On
php_value mbstring.http_input auto
php_value mbstring.http_output EUC-JP
php_value mbstring.internal_encoding EUC-JP
php_value mbstring.substitute_charavter none
php_value session.referer_check (このスクリプトの配置先ドメインを設定)

WordPress
info @ 2007/2/18 Sunday 21:30:39

EasyAllテンプレートでは、初期状態ではカレンダーが左寄せ状態で表示されます。
これをほぼ中央に表示するように調整します。

/wp-content/themes/EasyAll/style.cssで 「calendar」を検索。以下を変更します。

#wp-calendar {
	width: 155px;
	}

↓

#wp-calendar {
	margin-left:12px; (・・・適宜に調整)
	width: 155px;
	}
WordPress
info @ 21:12:25

ページを追加する際は、次の手順で行われます。
1.テンプレートの作成
 /wp-content/themes/(対象のテンプレートディレクトリ)/ にテンプレートファイル newpage.php を作成。

< ?php
/*
Template Name: New Page
  (ページ作成時にテンプレートを選択するときの名前を指定します)
*/
?>
〜〜〜以降 適宜に作成〜〜〜 

2.ページの登録
 管理画面のメニューで、投稿>ページを選択。
 ページタイトルを入力。
 ページテンプレートで、先ほど作成した「New Page」を選択。
 ほかは適宜に入力。

 ※ページのリンクボタンはページ名の昇順に左から表示されていきます。
  並び順を指定することは出来ないようです。
 

WordPress
info @ 20:59:33

何もないところからテーマを作成するのは面倒くさいので、とりあえず、/wp-content/themes/EasyAllをコピーします。

次に管理画面の「表示」で使用される部分を編集します。

■style.cssの先頭部分を編集。
 Thema Name:(テーマの名前)
 Thema URI:(テーマを提供しているアドレス)
 Description:(テーマの説明など)
 Version:(テーマのバージョン)
 Auther:(作成者)
 Auther URI:(作成者のHPアドレス)

■screenshot.pngを作成。
 プリントスクリーン等を使って、300×225ピクセルのテーマ画面画像を作成。
 ※作成はテーマの編集後。

これをアップロードしてとりあえず切り替えてみます。
問題なければ、少しずつスタイルシートやテンプレートの編集をして行きましょう。

OpenPNE
info @ 2007/2/16 Friday 8:50:47

現在安定版の最新は2.6です。これをインストールしてみました。

1.ソースのインストール。(マルチユーザー向け)

・config.php.defautよりconfig.phpを作成。
・解凍したデータを/home/xxx/ にアップロードします。

2.DBの初期化。

・任意の名前を付けてデータベースを作成します。
・install_2_x_create_tables.sqlをインポートします。
 (4.0と4.1が存在するので、自分のMYSQLバージョンがより近いほうを使用します。)
・install_2_x_insert_data.sqlをインポートします。

3.OpenPNEセットアップ

・http://ドメイン/~xxx/ にアクセスしてセットアップを行います。

4.携帯文字化け対応

・webadd/modules/ketai/init.inc(ktai_convert_encoding) で、
 mb_convert_encoding($arr, ’UTF-8’, ’SJIS-win’)
 ↓
 mb_convert_encoding($arr, ’UTF-8’, ’auto’)にする。

osCommerce
info @ 2007/2/14 Wednesday 21:55:51

(63行目)
アカウントの表示

$account_query = tep_db_query(”select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_zone_id, a.entry_state, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter from ” . TABLE_CUSTOMERS . ” c, ” . TABLE_ADDRESS_BOOK . ” a where c.customers_id = ’” . $customer_id . “’ and a.customers_id = c.customers_id and a.address_book_id = ’” . $customer_default_address_id . “’”);

↓(・・・カスタマーズテーブルよりデータを検索する際にニックネームの取得を追加)

$account_query = tep_db_query(”select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_hn, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_zone_id, a.entry_state, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter from ” . TABLE_CUSTOMERS . ” c, ” . TABLE_ADDRESS_BOOK . ” a where c.customers_id = ’” . $customer_id . “’ and a.customers_id = c.customers_id and a.address_book_id = ’” . $customer_default_address_id . “’”);

account_edit.php(92行目)
アカウント更新ページ

$account_query = tep_db_query(”select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_zone_id, a.entry_state, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter from ” . TABLE_CUSTOMERS . ” c, ” . TABLE_ADDRESS_BOOK . ” a where c.customers_id = ’” . $customer_id . “’ and a.customers_id = c.customers_id and a.address_book_id = ’” . $customer_default_address_id . “’”);

↓(更新ページでカスタマーズテーブルのデータを検索する際にニックネームの取得を追加)

$account_query = tep_db_query(”select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_hn, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_zone_id, a.entry_state, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter from ” . TABLE_CUSTOMERS . ” c, ” . TABLE_ADDRESS_BOOK . ” a where c.customers_id = ’” . $customer_id . “’ and a.customers_id = c.customers_id and a.address_book_id = ’” . $customer_default_address_id . “’”);

account_edit_process.php
ユーザー更新

(222行目)

$update_query_customers = $update_query_customers . “customers_firstname = ’” . $_POST[’firstname’] . “’ “;

↓(・・・カスタマーズテーブル登録の際にニックネームを追加する。)

$update_query_customers = $update_query_customers . “customers_firstname = ’” . $_POST[’firstname’] . “’, customers_hn = ’” . $_POST[’hn’] . “’ “;

(239行目)

$update_query_address = $update_query_address . “entry_firstname = ’” . $_POST[’firstname’] . “’, entry_lastname = ’” . $_POST[’lastname’] . “’ “;

↓(・・・アドレスブック更新の際にニックネームを追加する。)

$update_query_address = $update_query_address . “entry_firstname = ’” . $_POST[’firstname’] . “’, entry_lastname = ’” . $_POST[’lastname’] . “’, entry_hn = ’” . $_POST[’hn’] . “’ “;

(48行目〜追加)
if (strlen(trim($_POST[’hn’])) < 4) {
$error = true;
$entry_hn_error = true;
} else {
$entry_hn_error = false;
}

osCommerce
info @ 0:30:22

/includes/modules/account_details.php(47行目〜 追加)
アカウント登録の表示

<!– ●ニックネーム tab 2007/02/03 –>
<tr>
<td class=”main”> <?php echo ENTRY_HN; ?></td>
<td class=”main”> 
<?php
if ($is_read_only) {
echo htmlspecialchars($account[’customers_hn’]);
} elseif ($error) {
if ($entry_lastname_error) {
echo tep_draw_input_field(’hn’) . ’ ’ . ENTRY_HN_ERROR;
} else {
echo htmlspecialchars($_POST[’hn’]) . tep_draw_hidden_field(’hn’);
}
} else {
echo tep_draw_input_field(’hn’, $account[’customers_hn’]) . ’ ’ . ENTRY_LAST_NAME_TEXT;
}
?></td>
</tr>

/includes/languages/japanese.php(214行目〜 追加)
アカウント登録日本語表記

// ’Nickname:’
define(’ENTRY_HN’, ’ニックネーム:’);
// ’ <small><font color=”#FF0000″>min ’ . ENTRY_FIRST_NAME_MIN_LENGTH . ’ chars</font></small>’
define(’ENTRY_HN_ERROR’, ’ <small><font color=”#FF0000″>少なくても ’ . ENTRY_FIRST_NAME_MIN_LENGTH . ’ 文字</font></small>’);
// ’ <small><font color=”#AABBDD”>required</font></small>’
define(’ENTRY_HN_TEXT’, ’ <small><font color=”#AABBDD”>必須</font></small>’);

create_acount_process.php
ユーザー登録DB登録

(219行目)
tep_db_query(”insert into ” . TABLE_CUSTOMERS . ” (customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_default_address_id, customers_telephone, customers_fax, customers_password, customers_newsletter) values (’” . $_POST[’gender’] . “’, ’” . $_POST[’firstname’] . “’, ’” . $_POST[’lastname’] . “’,’” . tep_date_raw($_POST[’dob’]) . “’, ’” . $_POST[’email_address’] . “’, ’1’, ’” . $_POST[’telephone’] . “’, ’” . $_POST[’fax’] . “’, ’” . $crypted_password . “’, ’” . $_POST[’newsletter’] . “’)”);

↓(・・・カスタマーズテーブル登録の際にニックネームを追加する。)

tep_db_query(”insert into ” . TABLE_CUSTOMERS . ” (customers_gender, customers_firstname, customers_lastname, customers_hn, customers_dob, customers_email_address, customers_default_address_id, customers_telephone, customers_fax, customers_password, customers_newsletter) values (’” . $_POST[’gender’] . “’, ’” . $_POST[’firstname’] . “’, ’” . $_POST[’lastname’] . “’, ’” . $_POST[’hn’] . “’, ’” . tep_date_raw($_POST[’dob’]) . “’, ’” . $_POST[’email_address’] . “’, ’1’, ’” . $_POST[’telephone’] . “’, ’” . $_POST[’fax’] . “’, ’” . $crypted_password . “’, ’” . $_POST[’newsletter’] . “’)”);

(221行目)
tep_db_query(”insert into ” . TABLE_ADDRESS_BOOK . ” (customers_id, address_book_id, entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id) values (’” . $insert_id . “’, ’1’, ’” . $_POST[’gender’] . “’, ’” . $_POST[’company’] . “’, ’” . $_POST[’firstname’] . “’, ’” . $_POST[’lastname’] . “’, ’” . $_POST[’street_address’] . “’, ’” . $_POST[’suburb’] . “’, ’” . $_POST[’postcode’] . “’, ’” . $_POST[’city’] . “’, ’” . $state . “’, ’” . $_POST[’country’] . “’, ’” . $_POST[’zone_id’] . “’)”);

↓(・・・アドレスブック登録の際にニックネームを追加する。)

tep_db_query(”insert into ” . TABLE_ADDRESS_BOOK . ” (customers_id, address_book_id, entry_gender, entry_company, entry_firstname, entry_lastname, entry_hn, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id) values (’” . $insert_id . “’, ’1’, ’” . $_POST[’gender’] . “’, ’” . $_POST[’company’] . “’, ’” . $_POST[’firstname’] . “’, ’” . $_POST[’lastname’] . “’, ’”. $_POST[’hn’] . “’, ’” . $_POST[’street_address’] . “’, ’” . $_POST[’suburb’] . “’, ’” . $_POST[’postcode’] . “’, ’” . $_POST[’city’] . “’, ’” . $state . “’, ’” . $_POST[’country’] . “’, ’” . $_POST[’zone_id’] . “’)”);

(238行目に追加)
$hn = $_POST[’hn’];

(48行目〜追加)
if (strlen(trim($_POST[’hn’])) < 4) {
$error = true;
$entry_hn_error = true;
} else {
$entry_hn_error = false;
}

osCommerce
info @ 2007/2/13 Tuesday 23:45:02

products_reviews_write.php
レビュー入力

(21行目)
$customer = tep_db_query(”select customers_firstname, customers_lastname from ” . TABLE_CUSTOMERS . ” where customers_id = ’” . $customer_id . “’”);

↓ (・・・検索の際、取得する項目にニックネームを追加。)

$customer = tep_db_query(”select customers_firstname, customers_lastname, customers_hn from ” . TABLE_CUSTOMERS . ” where customers_id = ’” . $customer_id . “’”);

(24行目)
tep_db_query(”insert into ” . TABLE_REVIEWS . ” (products_id, customers_id, customers_name, customers_hn, reviews_rating, date_added) values (’” . $_GET[’products_id’] . “’, ’” . $customer_id . “’, ’” . addslashes($customer_values[’customers_lastname’]) . ’ ’ . addslashes($customer_values[’customers_firstname’]) . “’, ’” . $_POST[’rating’] . “’, now())”);

↓ (・・・登録の際、ニックネームの設定を追加。)

tep_db_query(”insert into ” . TABLE_REVIEWS . ” (products_id, customers_id, customers_name, customers_hn, reviews_rating, date_added) values (’” . $_GET[’products_id’] . “’, ’” . $customer_id . “’, ’” . addslashes($customer_values[’customers_lastname’]) . ’ ’ . addslashes($customer_values[’customers_firstname’]) . “’, ’”.addslashes($customer_values[’customers_hn’]). “’, ’” . $_POST[’rating’] . “’, now())”);

(47行目)
$customer = tep_db_query(”select customers_firstname, customers_lastname from ” . TABLE_CUSTOMERS . ” where customers_id = ’” . $customer_id . “’”);

↓ (・・・検索の際、取得する項目にニックネームを追加。)

$customer = tep_db_query(”select customers_firstname, customers_lastname, customers_hn from ” . TABLE_CUSTOMERS . ” where customers_id = ’” . $customer_id . “’”);

(117行目)
<td class=”main”><b><?php echo SUB_TITLE_FROM; ?></b> <?php echo $customer_values[’customers_lastname’] . ’ ’ . $customer_values[’customers_firstname’]; ?></td>

↓ (・・・レビュー記入者情報で、ニックネームを優先的にひょうじする。)

<td class=”main”><b><?php echo SUB_TITLE_FROM; ?></b> <?php echo $customer_values[’customers_hn’]?$customer_values[’customers_hn’].”(”.$customer_values[’customers_lastname’] . ’ ’ . $customer_values[’customers_firstname’].”)”:$customer_values[’customers_lastname’] . ’ ’ . $customer_values[’customers_firstname’]; ?></td>

products_reviews_write.php(26行目)
レビュー入力注意書き

define(’TEXT_NO_HTML’, ’<small><font color=”#ff0000″><b>注:</b></font></small> HTML は使用できません’);

↓ (・・・レビュー記入者情報で、ニックネームを優先的にひょうじする。)

define(’TEXT_NO_HTML’, ’<small><font color=”#ff0000″><b>注:</b></font></small> HTML は使用できません!<br><br>※ニックネームが登録されている場合は、本名は表示されません。’);

※注意 シングルクォーテーションは、全角にしています。

Next Page »


Copyright (c) 2007 njcFactory All rights reserved.
HTML convert time: 0.288 sec
Images is enhanced with WordPress Lightbox JS by Zeo
Powered by WordPress ME.