Drupal 是一套開放源碼的內容管理平台,擁有多種實用的功能,可以用來建置從個人網誌到大型網路社群等各種類型的網站,例如華納唱片、紐約觀察報、Fast Company、Popular Science、SonyBMG、富比士、哈佛大學等網站,或是個人部落格(Tim Berners-Lee)、播客網站(TWIT.tv)、線上社群(SpreadFireFox.com)。
Drupal 是一套開放源碼的內容管理平台,擁有多種實用的功能,可以用來建置從個人網誌到大型網路社群等各種類型的網站,例如華納唱片、紐約觀察報、Fast Company、Popular Science、SonyBMG、富比士、哈佛大學等網站,或是個人部落格(Tim Berners-Lee)、播客網站(TWIT.tv)、線上社群(SpreadFireFox.com)。
Re: upload模组
you might try this one....
http://drupal.org/project/itweak_upload
for drupal 5, try this
http://agaric.com/note/theming-file-attachments-drupal-5x
Re: upload模组
想詢問~想將後面的附檔名格式拿掉的話~
找不到移那行才是~~
function theme_upload_attachments($files) {$header = array(t('Attachment'), t('Size'));
$rows = array();
foreach ($files as $file) {
$file = (object)$file;
if ($file->list && empty($file->remove))
{
$href = file_create_url($file->filepath);
$text = $file->description ? $file->description : $file->filename;
#echo "alert('$href, $text');";
##################################################
$piece=explode("/",$href);
$theflename=$piece[count($piece)-1];
$thedirname_extra=filenameRemoveExtensionName($text);
if(okFileType($theflename)==".zip")
{
$thedirname=filenameRemoveExtensionName($theflename);
$href="";
for($i=0; $i<(count($piece)-1); $i++) $href.=$piece[$i]."/";
$href.=$thedirname."/".$thedirname_extra."/index.html";
}
#echo "alert('$href, $text');";
##################################################
$rows[] = array(l($text, $href), format_size($file->filesize));
}
}
if (count($rows)) {
return theme('table', $header, $rows, array('id' => 'attachments'));
}
}
Re: upload模组
你只修改了 $href , 但沒有寫程式碼修改 $text ...
---
notaBlueScreen | 訂閱RSS | Plurk
Re: upload模组
哀~這樣修改好像也不對~
$text = '
';就是不秀檔名只統一秀某一圖示~
Re: upload模组
你應該是中間的東西寫錯了
$text = 檔案名
$href = 連結
$text = '
';
當然所有都是圖示....---
notaBlueScreen | 訂閱RSS | Plurk
Re: upload模组
if ($file->list && empty($file->remove))
{
$href = file_create_url($file->filepath);
$text = $file->description ? $file->description : $file->filename;
$rows[] = array(l($text, $href), format_size($file->filesize));
}
}
那我應是在$text上加上
$file->filename = '
';然後$rows[] = array(l($text,$file->filename, $href), format_size($file->filesize));這裡得改為$text,$file->filename, $href
=_="呃…因為想不秀檔名只秀一張代表圖~
但拿掉array中的$text又變成當點選路徑的話~會選不到路徑~
Re: upload模组
大概改出個大概~命名一個
$icon = t('down');
然後將$rows[] = array(l($text, $href), format_size($file->filesize));中的$text改為$icon
想用css來做處理~將down全部改為一張圖來顯示~
background: url(xxx.gif);
width: xxxpx;
height: xxxpx;
}
span{
display: none;
}
但是~>w<~~看不出想要讓upload檔案列表表格的class或div或id怎下~
也試在
$rows[] = array(l(', $href),裡面加上div~ but不行

會變成下面這樣子 =OO=
Re: upload模组
預設是 plain text 輸出,你要改一改變為 HTML
$rows[] = array(l('', $href, array('html' => TURE))
為安全想一想,在這句前或許要加一加:
$icon = check_plain($icon);---
notaBlueScreen | 訂閱RSS | Plurk
Re: upload模组
>w<謝謝kay.L指點~~(orz磕頭)
我將它再修改為
$rows[] = array(l('', format_size($file->filesize));
目前長相雖怪怪~但try出來我再來調調~(附檔odd2.PNG)哈
然後我的css再貼上糖糖的
.icon_img a{
text-indent: -3000px;
display: block;
width: 14px;
height: 30px;
background: url('../images/film_link.png') #fff;
}
有與趣的人可以看這的相關連結http://www.hsiu28.net/style/article_detail.php?id=32#
Re: upload模组
嗯~就是得加一句檢查它是不是plain格式~
想詢問kay.L為什麼drupal要加什麼之類的結構那些必須的是怎麼研究呢?
Re: upload模组
其實哦,可以這樣寫,直接在連結中加 class
l($icon, $link, array('attributes' => array('class' => 'images')));
"想詢問kay.L為什麼drupal要加什麼之類的結構那些必須的是怎麼研究呢?"
抱歉,看不懂 ...可否再詳細說說
---
notaBlueScreen | 訂閱RSS | Plurk
Re: upload模组
也就是於連結中直接加進attributes(屬性)然後指定它的class為images~嗯~>w<(謝謝)
就是想詢問啊像是遇到想修改一些模組的功能之類的…
為什麼kay.l你是怎麼知道它必須要加的是什麼或者是加了會產生何種問題~等等…
因為啊像可能知道修改了某一個地方~卻不知那個地方可能也得加檢查~嗯~
因為每一個模組它的功能無法從頭了解~所以就很好奇大家是怎麼判別~嗯
Re: upload模组
你可以查看 API
這邊更好,可以查看很多模組
http://drupalcontrib.org/drupal-6-modules
Devel themer 也是好幫手
http://drupal.org/project/devel_themer
一般修改都是顯示方法,你用 Devel themer 點一點就找到該要修改的 function
然後就可以動工了
深入一些的,還是要靠點經驗,有空沒空看一看 API。
---
notaBlueScreen | 訂閱RSS | Plurk