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: 想要讓一個CUSTOM ...
是有現成模組,但以開發來談。。。
新開 CONTENT TYPES 暫時可以略過使過代碼建立,你可以手動在此新增一個:
/#overlay=admin/structure/types/add
(透過代碼建的話比較煩,不是對外發放,最好不要令自己麻煩,其中一個可以參考:
http://api.drupal.org/api/drupal/developer--hooks--node.php/function/ho…)
再來就透過 node_save 儲蓄東西:
http://api.drupal.org/api/drupal/modules--node--node.module/function/no…
(http://www.notabluescreen.com/create-node-migrating-site)
其實,你要是做即時輸出,對保存內容不著重,直接或者 JS 更快更好,否則,在NODE才處理好像有點怪
---
notaBlueScreen
Re: 想要讓一個CUSTOM ...
我是想說如果作成模組可以省掉每次COPY CODE的動作...又可以分享給大家來使用
我的表達方式可能有點差...我把CODE貼出來好了,這是現在在RUN的頁面
http://waaagh.ws/galley/20110416-%E5%8C%97%E5%AE%9C%E8%B2%A1%E8%8C%82%E…
<?php// Get the xml of the feed provided in $url
$url = "http://picasaweb.google.com/data/feed/base/user/cstony0917/albumid/5596072560939078545?alt=rss&kind=photo&authkey=Gv1sRgCJTnv9OX5cfLNA&hl=zh_TW";
$cid = $url;
#echo '
'; #print_r(cache_get($cid)); if(!cache_get($cid)){ $session = curl_init($url); curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($session); curl_close($session); cache_set($cid,$response,'cache'); }else{ $response = cache_get($cid)->data; } $xml = simplexml_load_string($response); $items = $xml->channel; $page_count = 20; $start = 0; $start = $_GET['p'] * $page_count; $photo = array(); $item_count =0; foreach ($items->item as $item){ $title = $item->title; $content = $item->description; #echo $i. ''; // The Dirty Work! // // Pull the images from the *description* section // $quotes = array('"', "'", "\n"); $imgContents = str_replace($quotes, '', $content); # Strip " and ' as well as \n from input string $imgContents = stristr($imgContents, 'src='); # Drop everything before the 'src' $endTagPosition = strpos($imgContents, 'alt='); # Position of the end tag '>' $img = substr($imgContents, 4, $endTagPosition - 5); # Get everything from src to end tag --> 'src="path" something>' // Swap out the s288 from the small image to make the thumbnail and larger images // $img144 = str_replace('/s288', '/s144', $img); $img800 = str_replace('/s288', '/s1024', $img); $download = str_replace('/s288', '/d', $img); $photo[$item_count]['title'] = $title; $photo[$item_count]['thumb'] = $img144; $photo[$item_count]['large'] = $img800; $photo[$item_count]['download'] = $download; $item_count ++; } $end = $start + $page_count; if($end > $item_count) $end = $item_count; ?>
<?php
$uri=explode("?",$_SERVER['REQUEST_URI']);
$curr_url = check_plain("http://" .$_SERVER['HTTP_HOST'] .$uri[0]);
page_spilt($item_count,$page_count,$curr_url);
?> <?php for($i = $start; $i< $end;$i++): ?>-
" title="<?php echo $photo[$i]['title'] ;?>" class="img">
" width="120px" />
style="height:10px;" class="download">下載原圖
<?php endfor;?>
page_spilt是自訂的function,使用的時候也會一起貼在內文裡面,因為太長了我就沒貼近來,這樣真的很麻煩Orz..
其實分頁效果原本跟CACHE一樣想用DRUPAL的API,只不過分頁的API看好久看不懂....Orz
我想要的效果就是在新的node裡面會有一個欄位可以讓我填RSS的URL
http://picasaweb.google.com/data/feed/base/user/cstony0917/albumid/5596072560939078545?alt=rss&kind=photo&authkey=Gv1sRgCJTnv9OX5cfLNA&hl=zh_TW以及node title就可以送出,並且產生跟現在一樣的頁面.....@@
大大給的連結....小弟有看沒有懂...Orz....
Re: 想要讓一個CUSTOM ...
我找到了這個模組可以達到我的需求,看到模組簡介的時候我整個超感動的!!
http://drupal.org/project/custom_formatters
這根本就是我要的啊!!!!Orz