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:
<?php $nid = arg(1); $output = ''; 'quality' => t('Quality'), 'color' => t('Color'), 'vote' => t('Overall'), ); foreach ($tags as $tag => $title) { $votes = fivestar_get_votes('node', $nid, $tag); ); 'stars' => 5, 'allow_clear' => TRUE, 'style' => 'average', 'text' => 'dual', 'content_type' => 'node', 'content_id' => $nid, 'tag' => $tag, 'autosubmit' => TRUE, 'title' => $title, 'feedback_enable' => TRUE, 'labels_enable' => TRUE, ); $output .= drupal_get_form('fivestar_custom_widget', $values, $settings); } print $output; ?>
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)!
It makes me laugh. 200 000 modules and there is NO normal file manager!
There isn’t any cable Internet providers in a place I’m living. So I borrowed mobile Internet modem from a friend to try. There are no unlimited tariffs, exorbitant prices for traffic, well I have no choice. I pull in a belt, say bye-bye to torrents and entertaining portals and concentrate on working. Alas this has been last not for long. Modem broke in two months. LED was blinking merrily, but: “Windows can not determine device or device malfunction”. Nothing has helped. I had to spend about two weeks without Internet, because the certificate of guarantee had been left with my friend in another city and I hadn’t planned any trip there sooner. I’ve stand just 3 days.
Internet withdrawal agony and disturbed by my absence clients made me doing something on fourth day. I decided to ignore guarantee and get the modem to the service immediately. A friend googled service center address for me and I set out for journey. In an hour I was standing in front of a building. The addresses are match. But the building was some block of flats (with wealthy roomers I would say) without any offices or just signboards. Harsh security guard had frowned and pointed me to unnoticeable door leading to basement. Yet that was not the office. In a half repaired rooms frames of servers were staying. There was nobody except for two guys of the geekiest appearance behind a glass door in a room littered with circuit plates. The workshop was here, but the office has had another address, so I was sent there. This time I had to take metro to the almost edge of the city and then walk a lot or look for a bus in a distinct I’m unfamiliar to. I decided to walk. In a half of an hour I found that I was walking in a wrong direction and I returned to the metro station. It drizzled through the sun and cold wind blown. I was just about to give up and return to home. I’ve stopped in a computer equipment shop to get warm and noticed miniUSB-USB cable by glance. My modem connects to computer with the similar one. A hazy idea has flitted in my mind. In two minutes the modem was connected to my netbook by new cable (don’t even ask me why I’ve taken the netbook). In tree minutes my computer gaily blinked with established connection. And just in 10 minutes frozen, tired but terribly happy (cause I had not got to the service) I was going home.
This one was a surprise for me. It’s easy to remove all traces from code in Flash IDE. I used to believe that the flex release export (Project=>Export release build) remove both debug and traces. But it does not. Now it’s also obvious that FlashDevelop release configuration also do not remove traces from sources. Of course common user doesn’t even have any applications displaying traces, but this is still affect performance. And of course this is bad-looking.
I googled a little for a solution. No, to all appearances there is no “omit trace actions” like option in flex sdk compiler, so there are no many ways out.
The easiest way is to do search and replace for all project. Replace “trace” with “//trace”, that’s all.
Also flex has pretty strong logging framework mx.logging. Here is a little example:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init();"> <mx:Script> <![CDATA[ import mx.logging.Log; import mx.logging.ILogger; import mx.logging.LogEventLevel; import mx.logging.targets.TraceTarget; private var _log:ILogger; private var _traceTarget:TraceTarget; private function init():void { _traceTarget = new TraceTarget(); _traceTarget.filters=["*"]; _traceTarget.level = LogEventLevel.ALL; _traceTarget.includeDate = false; _traceTarget.includeTime = false; _traceTarget.includeCategory = true; _traceTarget.includeLevel = true; Log.addTarget(_traceTarget); _log = Log.getLogger("ExampleLogger"); _log.info("Your tracing like a pro!"); } ]]> </mx:Script> </mx:Application>
CONFIG::debugging { trace(counter); }
Sometimes I hate flex. Sometimes I love it. For example you need no time to translate DateField component to Russian. What I need is Russian date format, week starts at Monday and labels translated to Russian. Here you are:
<mx:DateField formatString="DD.MM.YYYY" dayNames="['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб']" firstDayOfWeek="1" monthNames="['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь','Декабрь']"/>
As far as translation is needed in every place in project it's better to make subclass:
package fbrg { import mx.controls.DateField; public class DateFieldRus extends DateField { public function DateFieldRus() { super(); this.formatString = "DD.MM.YYYY"; this.dayNames = ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб']; this.firstDayOfWeek=1; this.monthNames=['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь','Декабрь']; } } }
I’m going to continue introduce people to the best Russian flashers and their blogs. This time I’ll talk about _etc. One of the respected flasher.ru moderators, the man who closed more than 9000 topics for “meaningless title”, he seemingly knows bytecode better than parents know their children. How to explain these excellent peaces he’s made otherwise?
One by one(links guide to examples where sources also can be downloaded, or to a page with download link).
FontLoader. This one let us upload swf-files with embedded-fonts to main swf and use them in main one. So short, so usefull!
MouseWheel. In AS2 if flash has had focus then mouse scroll will not scroll html-page. This is not true for AS3 unfortunately. This class cure the problem (as a matter of a fact it adds as2-flash to stage and connects with LocalConnection to it, but does this in a very smart way).
getDefinitionNames. It returns names of all classes in loaded swf or defined domain. A nice tool and weapon of a flash-hacker.
You can feel inspired by other games, sever uselessness, saturate with new details and reshape. Let’s take new Civilizations wars for example. The mechanics is as old as computer games. I played similar games 5 times at least (including fascinating Dyson, which now is renamed and extended to Eufloria). But this game is totally different with all this droll little people, magic, towers-altars and rpg-multipier.
P.S. Here are Dyson and Civilizations war screenshoots.