drupal

Install uploadprogress on linux for Drupal 7

I’ve been testing drupal seven on virtual box with Ubuntu and noticed this message in Status report.

Since I'm working on tube-like site I've thought that upload progress bar would be great addition. Actually I like upload progress bar from jquery(it use flash) much more, but why not try it as it's already build in. First googled link on PECL uploadprogress suggest to download uploadprogress sources, manually compile it with phpize and copy to php extensions directory. That's not my way.

Better do this instead.

We need php5-dev package or system will notice we don't have phpize later, so:

  1. $ sudo apt-get install php5-dev

Next, we need pear(if it's not yet installed already).

  1. $ sudo apt-get install php-pear

Now for uploadprogress:

  1. $ sudo pecl install uploadprogress

If you have not Ubuntu but Centos instead, than you should use native package manager instead. As for Centos its's yum, instead of apt-get.

We still must add "extension=uploadprogress.so" into php.ini manually. Usually it's located somewhere at /etc/php5/. You can type "locate php.ini" to find it. With Ubuntu or Debian you can create uploadprogress.ini at /etc/php5/apache2/conf.d and write there "extension=uploadprogress.so". Php will use it then .

Do not forget to restart apache of course.

  1. $ apachectl restart

The most voxing thing is that progress bar doesn't work anyway! Now file field options have new radio button Bar with progress meter in addition to standart Throbber at Progress indicator sub-menu, but as you create new material standart throbber is still shown.

Several ratings for the node with fivestar module.

Fivestar is a popular drupal module for node ratings setup. Unfortunately, it’s unable to rate node by several parameters, multiple axis. It can be still used to create reviews, and you can setup several ratings in a review. But you will need whole pack of modules: fivestar, cck, node comments, node limit or something like that. Last dev-version 6.x-1.x-dev from 28 january fix this disappointing imperfection. But it’s in completely mess! It’s simply ignore settings you set.

So, I’ve found this topic and caught this snippet:

  1. <?php
  2. $nid = arg(1);
  3. $output = '';
  4. $tags = array(
  5. 'quality' => t('Quality'),
  6. 'color' => t('Color'),
  7. 'vote' => t('Overall'),
  8. );
  9.  
  10. foreach ($tags as $tag => $title) {
  11. $votes = fivestar_get_votes('node', $nid, $tag);
  12.  
  13. $values = array(
  14. 'user' => isset($votes['user']['value']) ? $votes['user']['value'] : NULL,
  15. 'average' => isset($votes['average']['value']) ? $votes['average']['value'] : NULL,
  16. 'count' => isset($votes['count']['value']) ? $votes['count']['value'] : NULL,
  17. );
  18.  
  19. $settings = array(
  20. 'stars' => 5,
  21. 'allow_clear' => TRUE,
  22. 'style' => 'average',
  23. 'text' => 'dual',
  24. 'content_type' => 'node',
  25. 'content_id' => $nid,
  26. 'tag' => $tag,
  27. 'autosubmit' => TRUE,
  28. 'title' => $title,
  29. 'feedback_enable' => TRUE,
  30. 'labels_enable' => TRUE,
  31. 'labels' => array(t('Poor'), t('Okay'), t('Good'), t('Great'), t('Awesome')),
  32. );
  33.  
  34. $output .= drupal_get_form('fivestar_custom_widget', $values, $settings);
  35. }
  36.  
  37. print $output;
  38. ?>

Also fivestar module is supposed to be patched to use the snippet. But it’s look like last stable module version 6.x-1.19 already have all necessary modifications, so everything working as is.

Khe-khe. There is still a problem. Now I have multiple ratings, but I can not setup different widgets(one rating with red stars and another one with blue, for example)!
 

I have strong allergy to IMCE.

It makes me laugh. 200 000 modules and there is NO normal file manager!

Installed some modules

Get rid of imput format menu and imput format tips with better formats module.

There are two modules for code highlighting. They are
GeSHi and Syntaxhighlighter. Keep GeSHi. I like it more. Details later.

%&#@^! drupal

Web-developers-fans of drupal have a proverb. “All CMS suck, but drupal sucks less.” I have never been fun of drupal. And what is more, virtually the only one reason why I had made this blog with drupal is my desire to make my own flash games portal, for which quite flexible CMS is needed (yes, I do know about Arcade CMS, no, thanks.). Drupal seems to be quite good in comparison with others. As blog CMS I like it even more then popular Wordpress. Basic abilities are scanty, but with additional modules (there are thousands of them) almost any functional is possible. Sometimes even without any programming at all. Nevertheless just next day I had installed drupal a worm of doubt started nibbling me. It happened when drupal refused to let me in administer pages. Little investigation showed that my hoster had needed to set bigger execution time of php-scripts. It helps. Just for a half of an hour. Just after another couple modules installation drupal refused to let me in administer pages again. This time no error messages at all, just empty window. It had been cured with some magic update module deleting.

Syndicate content