[問題] Coppermine Photo Gallery

CPG Running Discuss
關於 CPG 架設使用操作討論,非本程式相關問題一律砍文!

版主: 版主管理群

回覆文章
help
星球公民
星球公民
文章: 189
註冊時間: 2002-08-09 02:01
來自: 香港
聯繫:

[問題] Coppermine Photo Gallery

文章 help »

問題外掛:Coppermine Photo Gallery 1.2.1
參考連結:here
使用版本:phpBB 2.0.4
網站位置:
狀況描述:

可否把 "隨機圖片" 放在討論版討頁內 ? phpBB2/index.php
我要如何修改
help
星球公民
星球公民
文章: 189
註冊時間: 2002-08-09 02:01
來自: 香港
聯繫:

文章 help »

沒有人可以幫忙 ?
寒冰軒
竹貓忠實會員
竹貓忠實會員
文章: 417
註冊時間: 2003-11-06 23:24
來自: 阿婆A灶腳
聯繫:

文章 寒冰軒 »

help 寫:沒有人可以幫忙 ?
Coppermine Photo Gallery 這個功能竹貓好像支援的不多
有空也可以到其它友站發問看看或許就能問出個答案來也說不定
Coppermine Photo Gallery 這個功能我也是在竹貓看到的教學文
但是是去友站發問才慢慢架成功的

說了那麼多~你的問題我也不會 ^"^║║(汗)
~§ 架站系統:WindowsXP §~
~§ 架站程式:Appserv2.4.4a §~
~§ 使用網路:giga ADSL §~
~§ 安裝程式:Apache + php + MySql §~
~§ 論壇版本: 2.0.18 §~
申明檔
1.新手發問並不是可恥的事.可恥的是沒有按照發文規則及格式還裝做沒解決你的問題是我們的錯。
2.很樂意大家pm給我.或把我加入即時通.msn,但加入並不是代表小弟已成為您的私人看護
3.還是想不通嗎? 那可以到地下十八樓找你的答案。
[http://microduo.home99.tw/?fromuid=6331]微剋多資訊[/url]
help
星球公民
星球公民
文章: 189
註冊時間: 2002-08-09 02:01
來自: 香港
聯繫:

文章 help »

爬了好多文章,都找不到
help
星球公民
星球公民
文章: 189
註冊時間: 2002-08-09 02:01
來自: 香港
聯繫:

文章 help »

找到一個文章 .... 不過好似唔係咁明白內容

http://coppermine.sourceforge.net/board ... pic=1196.0

Ok here we go:

In your case create a file e.g 'gallery_side_random_block.php' in you coppermine dir, put the code below in it and change the path to your '/gallery' and correct the connection to your mySql database, further you could change the number of dispayed thumbs with 'LIMIT 0,4' on row 30 to the amount you like. Now there are random 4 thumbs vertically displayed.

[php]<?php
<?php

//***Enter Path information here***
//***absolute path to main coppermine directory***

$copperminepath = '/gallery'; //***YOU MUST CHANGE THIS***

//This connects to the mysql DB
//***change username and password below***

$MZrandompic = @mysql_connect('localhost', 'root', ''); //***YOU MUST CHANGE THIS***

if (!$MZrandompic) {
echo( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
exit();
}

//select photo DB
//***YOU MUST CHANGE THIS***

if (! @mysql_select_db('coppermine') ) {
die( '<p>Unable to locate the picture ' .
'database at this time.</p>' );
}

//This gets a random picture record from the database and
//the picture's location and displays it

$MZresult = @mysql_query("SELECT * FROM cpg11d_pictures ORDER BY RAND() LIMIT 0,4");
if (!$MZresult) {
die('<p>Error performing query: ' . mysql_error() .
'</p>');
}

while ( $MZrow = mysql_fetch_array($MZresult) ) {

// $albumid = $MZrow['aid']; //This gets the picture's associated album name
$pos = $MZrow['pid']; //This finds the picture's coppermine location

echo('<P ALIGN=center>');

echo('<a target = "_new" href="' . $copperminepath . '/displayimage.php?album=' . $albumid .
'&pos=-' . $pos . '">'); //make thumbnail clickable

echo('<IMG SRC="' . $copperminepath . '/albums/'); //append base dir structure
echo($MZrow['filepath'].thumb_.$MZrow['filename'] .
'" alt=' . $MZrow['filename'] . ' '. 'border=0 width=80 height=50>' . '</a>'); //outputs path from /userspics
}

//This displays the picture's album name and
//links it to the coppermine album

$MZalbumresult = @mysql_query("SELECT * FROM cpg11d_albums WHERE aid = '$albumid'");
if (!$MZalbumresult) {
die('<p>Error performing query: ' . mysql_error() .
'</p>');
}

while ( $MZalbumname = mysql_fetch_array($MZalbumresult) ) {
echo('<FONT SIZE=1>');
echo('<P ALIGN=center>');

echo('<a href="' . $copperminepath .
'/thumbnails.php?album=' . $albumid . '">' .
$MZalbumname['title'] . '</a>' . '</p>');
}

if (! @mysql_select_db('coppermine') ) {
die( '<p>Unable to reload the main website ' .
'database at this time.</p>' );
}

?>

?>[/php]

Go to your sidenav.tpl and add the code below to your table/block 'my gallery' section (change to he right path).

[php]<?php
<?php include("/inetpub/coppermine/gallery_side_random_block.php");>
?>[/php]

有沒有人可翻譯一下內容 ?
hihihihi
星球公民
星球公民
文章: 46
註冊時間: 2003-12-27 12:13

文章 hihihihi »

嘗試幫你翻譯一下:
你的情況請新增一個檔案例如'gallery_side_random_block.php' 在你的coppermine目錄,把以下語句貼入剛才那個檔案然後更改裡面的'/gallery'路徑和mysql資料庫內容,另外你可以在第30行更改'LIMIT 0,4'的數值來決定它的顯示數量.現在的設定就是把4個隨機圖片垂直顯示\r

如翻譯有錯請指正... :mrgreen:
help
星球公民
星球公民
文章: 189
註冊時間: 2002-08-09 02:01
來自: 香港
聯繫:

文章 help »

我跟上述 edit 加上
可以在 index.php 見到個位置,不過沒有出現圖片,不知要注意那幾個位要 edit
有沒有人成功 ? 我想橫向
anson_wongy
星球普通子民
星球普通子民
文章: 26
註冊時間: 2004-04-25 09:46
來自: 我阿媽個肚!

文章 anson_wongy »

我也問過相同的問題,可是沒人回答... :-( :cry:
help
星球公民
星球公民
文章: 189
註冊時間: 2002-08-09 02:01
來自: 香港
聯繫:

文章 help »

我成功加到在首頁,我想打橫
czdance
星球普通子民
星球普通子民
文章: 12
註冊時間: 2004-09-27 11:59

文章 czdance »

搞不懂..有人能幫幫我嗎??
coppermine..我是裝在www/phpbb2/gallery
我想他的意思應該是預設coppermine資料夾...所以我應該要把coppermine的地方改成gallery

cpg11d_albums<--這個應該是指資料庫..我去資料庫查過了我要改cpg132_albums
至於帳號密碼地方我弄上了...

有人能跟我講一下該怎麼改嗎??

但是不懂的是..我的照片設在www/phpbb2/gallery/albums/userpics
那麼我該怎麼改??..後面有些部分就看不懂要怎麼改了!!
回覆文章

回到「Coppermine Photo Gallery」