Một số ý kiến làm đẹp photoblog on Drupal

Một số ý kiến làm đẹp photoblog on Drupal

The information below is somewhat obsolete and kept just for archiving purposes. It's recommended to check new blog post to get better idea how to make a nice photoblog on Drupal today.

Here are the main reasons why I've chosen Drupal over dedicated photoblogging scripts:

  • User and access management (as I want my friends to be able to access some "friends only" images)

  • Email notifications for new content + various RSS feeds (general / per tag / ...)

  • Text blog

  • Better functionality, flexibility and extendibility

  • RSS aggregator to link to my friends' news

  • Nice and clean urls

  • and... I'm quite familiar with Drupal code and themes (and this was probably the main reason)

After drawing a concept it was not very difficult to assemble photoblog on Drupal. But I made 3 differently setup installations before this final one was released. And I had to make several php code snippets and module code modifications to make the whole thing work the way I want.

Another task was the custom theme. My idea was to create quite dark theme as I like to look at the pictures against the dark background. I think, this way you can feel the vibe better, and it requires less concentration from you. The worst (the less enjoyable at least) part in theme creation process was restyling default drupal.css classes for admin area. I wanted them to match the general darker theme layout instead of quite bright one offered by default drupal.css.

List of modules used

Asterisk(*) denotes modules provided in default Drupal distribution.

  • aggregator*

  • block*

  • blog*

  • captcha

  • codefilter

  • comment*

  • contact*

  • drupal*

  • graphstat

  • help*

  • image

  • menu*

  • node*

  • page*

  • path*

  • pathauto

  • ping*

  • poormanscron

  • search*

  • simple_access

  • statistics*

  • subscriptions

  • system*

  • tagadelic

  • taxonomy*

  • taxonomy_xml

  • upload*

  • user*

  • watchdog*

  • watermark

I was not using image_gallery module as all the "galerizing" functions are performed by the theme and taxonomy (it is at least more flexible).

Custom code:

watermark module

I didn't like the quality of images produced by this module after the watermark is applied to the image. Image quality was too jpegy - 66. It is ok for any news or blog posts but it's not enough for photo dedicated site. So I added the quality argument (which was missing) to it. Around line 235 there is a code:

if (!imagejpeg($im, $image_path)) {

Which I changed to:

  if (!imagejpeg($im, $image_path, 95)) {

The composite jpeg (image with applied watermark) quality produced by the watermark module is 92 now. Which is fine.

Random image on front page (random full node)

Here is the code (php code snippet) which I used in my mission:

<?php
$list_length = 1;
$sql = "SELECT node.type, node.nid FROM node WHERE node.type = 'image' AND node.status = 1 ORDER BY RAND() DESC LIMIT $list_length";
$result = db_query($sql);
while ($anode = db_fetch_object($result)) {
$output .= node_view(node_load(array('nid' => $anode->nid)), $teaser = FALSE, $page = TRUE, $links = TRUE); 
}
print $output;
?>

PHP handling for Drupal 4.7 in mission described here: http://drupal.org/node/57650

Tag cloud block code

The reason why I didn't use the block provided by tagadelic module was that module posts only 12 most used tags (taxonomy terms). But I needed all of them for full navigation.

Here is the code (php code snippet) which I used for tag cloud block:

<?php
$vocs[] = 4; //  id of the vocabulary of which you want to display a tag cloud
$output = theme('tagadelic_weighted',tagadelic_get_weighted_tags($vocs));
print $output;
?>

That's all. It was not very complicated task to make a nice and feature rich photoblog powered by Drupal.

Bạn thấy bài viết này như thế nào?: 
No votes yet

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Custom website bằng WordPress dễ hơn Drupal, Joomla
Custom website bằng WordPress dễ hơn Drupal, Joomla

Hôm nay COME™ Blog xin so sánh 03 CMS này để các bạn có cái nhìn rõ ràng hơn để lựa chọn mã nguồn phù hợp nhất cho website và nhu cầu của mình:

Password Recovery for Drupal 7
Khôi phục mật khẩu trong Drupal 7

Actually recovering your original password in Drupal 7 is not possible, but resetting one is possible and we're going to show you how to do it.

Broadcom công bố VXL lõi tứ tích hợp 3G cho smartphone giá rẻ
Broadcom công bố VXL lõi tứ tích hợp 3G cho smartphone giá rẻ

Hãng sản xuất linh kiện bán dẫn Broadcom của Mỹ vừa chính thức công bố mẫu chip mới nhất có tên BCM23550 được tích hợp modem mạng 3G HSPA+ dành cho các dòng smartphone Android giá rẻ.