Coppermine Photo Galleryは写真を管理するウェブアプリケーションです。
ブログと組み合わせると便利なのですが、写真のリンクソースを表示させる改造をします。
// If this is the users gallery icon then check it
と書いてある行の前に下記のソースを挿入。
$homepage = $CONFIG['site_url']; print <<<EOT <tr> <td class="tableb" style="white-space: nowrap;">リンクのソース</td> <td width="100%" class="tableb" valign="top" colspan="2" > <input type="text" style="width: 100%" name="user4" maxlength="255" value='<a href="$homepage$thumb_link"><img src="$homepage$thumb_url" class="image" border="0" alt="{$CURRENT_PIC['title']}"/></a>' class="textinput" /> </td> </tr> EOT;
これをUTF-8で保存。
function form_options() { global $CURRENT_PIC, $lang_editpics_php; $isgalleryicon_selected = … $isgalleryicon_disabled = …
の後に下記のソースを挿入
$thumb_url = get_pic_url($CURRENT_PIC, 'thumb'); $thumb_link = 'displayimage.php?&pos='.(-$CURRENT_PIC['pid']); $homepage = $CONFIG['site_url']; print <<<EOT <tr> <td class="tableb" style="white-space: nowrap;">リンクのソース</td> <td width="100%" class="tableb" valign="top" colspan="2" > <input type="text" style="width: 100%" name="user4" maxlength="255" value='<a href="$homepage$thumb_link"><img src="$homepage$thumb_url" class="image" border="0" alt="{$CURRENT_PIC['title']}"/></a>' class="textinput" /> </td> </tr> EOT;
globalを追加
global $CONFIG;
include/function.inc.php
function cpg_db_connect() { global $CONFIG; $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']); if (!$result) { return false; } mysql_query("SET NAMES utf8", $result); if (!mysql_select_db($CONFIG['dbname'])) return false; return $result; }
キーワードは、半角スペースで区切ります。 全角で入力してしまった場合、一括で置換しましょう。
UPDATE cpg132_pictures SET keywords=REPLACE(keywords,' ',' ')
Coppermine Photo Galleryは写真を管理するウェブアプリケーションです。 このコメントスパム対策をします。 元の記事は http://coppermine-gallery.net/forum/index.php?topic=33827.0
db_input.phpを開く
$akismet = new Akismet($MyBlogURL ,$WordPressAPIKey); $akismet→setCommentAuthor($name); $akismet→setCommentAuthorEmail($email); $akismet→setCommentAuthorURL($url); $akismet→setCommentContent($comment); $akismet→setPermalink('http://www.example.com/blog/alex/someurl/');
if($akismet→isCommentSpam()) store the comment but mark it as spam (in case of a mis-diagnosis) cpgdie(ERROR, $langerrors['permdenied'], FILE, LINE); else</code>を挿入する。 * このelseの後ろで、<code php>$insert = cpgdb_query(“INSERT INTO {$CONFIG…</code>という行が実行される。