Thursday, September 29, 2011

Wordpress Comment Extra Fields Plugin

I made the first version of a plugin I will continue to develop for the next weeks. How to use it/features list:
  • install the plugin (copy it to wp-content/plugins);
  • activate it
  • go to Settings. The plugin adds a new option under that menu: Comment Extra Fields
  • in Comment Extra Fields page you can see the extra fields already defined (and edit / delete each of them) or define new extra fields to be added to your comment form
  • all fields are mandatory (even not all tested for that)
  • the types of fields one can define on admin are:
    • text field
    • textarea
    • checkboxes: field to define the values to display on front comment form
    • radio buttons: field for values
    • drop down: field for values
    • file: the upload on front is made using swfupload for jquery
    • (database) db select: fill in the name of a table (with or without the wordpress prefix) and 2 column names for id and values and on front the drop down will be populated with the database values
  • mouse over the labels and, if there are any, tooltips with hints will be shown
  • on front the plugin comes with a .css using twentyeleven form style
More features to come:
  • allow extra fields to be required
  • add date extra field type
  • allow extra fields to be shown on logged in user or not logged in user
  • add option to remove the default comment fields: author, url and email
  • on admin side allow user to define the HTML code for more flexible DOM display
The first version can be found at this link.

Edit
WordPress.org accepted my plugin, just added it to their SVN (heh:D). I will post link here asap it is available (where's the wittle happy monkey? where's the wittle happy monkey? a-gu-gu-gu to me!).

Edit
Best link

Saturday, September 17, 2011

Wordpress WPML Edits

In one of my recent projects I had to use WPML, a very well done plugin for Wordpress for Multi Languages sites. It is based on the idea of keeping translations of different posts in another posts linked to the first one. This way the problem of translated URLs is solved in a very elegant manner. Also all fields appear only one time per translation (which is really nice. If you have 10 fields and you need to translate it in almost 30 languages you won't end up with almost 300 fields on a post edit page).

My problem appeared when I had to define some custom languages and then I wanted to change their names. On a site there can be different content for users whith IP from Europe and have their browser set to English and users with IP from US and their browser language set to English...so I need the default en plus some user defined language, let's say en-euro. If instead of en-euro I wanted to use en-emea the only possible solution would have been to define the new language and use the new one. So, I ended up looking in all _icl tables and try to figure out where the language codes are used. Same thing for a language name. After updating information in those tables the changes were not visible unless I deleted the plugin's cache (kept in wp_options, option_name='_icl_cache').

There are some risks in using my new plugin:
  • I didn't test it for all types of WPML translations;
  • I don't know what happens if one had already made mane translations and then deletes the plugin's cache from wordpress' database (of course, I can figure out from WPML code, but I had been too busy for that. If I get any emails with problems related to this issue described I will try to go deeper into this issue);
  • There might be still hidden issues with this approach (maybe the creators of the WPML plugin had their reasons not to include this option. On edit languages form the fields for language name and code are disabled...)
I recommend using my plugin before starting to translate, if possible. The plugin can be downloaded from here.

After you copy the .zip's content into wp-content/plugins directory and you activate it, a new option will appear under Settings menu called WPML Edits. When you click on it a form will appear where you can set the Old code, New code, Old name and/or New name and when you click Apply changes the database updates run. You need to use an already existing code/language name for Old code and Old name values and a not already existing code/language name for New fields values.

Tuesday, August 30, 2011

tocanița de gânduri

știți ce aș fi vrut să aud pe transalpina? după ce am urcat cu Bella până la 2100m prin serpentine fără bare de protecție care mi-au declanșat frica de înălțime și litania "frica este irațională. frica este irațională. frica distruge mintea. frica este irațională. nu trebuie să-mi fie frică"? de preferat ar fi fost să nu aud nimic. aerul rarefiat de pe platou creând un vid de liniște în minte nu cerea decât, la rându-i, liniște. de foarte mult timp sunt în căutarea liniștei la nivelul cel mai pur senzorial. decibeli zero. după aceea mi-am dat seama că ar fi mers la fel de bine partea a doua din Concertul Italian de Bach. ghici ce se auzea? desigur...manele! știu că "zicala" cu România este minunată, păcat că este populată este deja răsuflată, de-a dreptul kitsch-oasă, dar o resimt la nivel visceral, atomic. dacă aș ști că am dispărea cu toții, inclusiv eu, nu mi-ar părea rău. din contră, chiar aș începe (așa, în ultimele clipe) să am un dram de speranță. vrabia mălai visează:))))))))

durerea. azi am avut o experiență apropiată de extazul mistic, epifanie pură când am reușit să mă ridic din pat fără să urlu. încă nu pot merge dreaptă, mai icnesc când pășesc, durerea persistă, dar față de ce a fost e doar ca un fel de warning sign, ca să nu uit de durerea agonizantă care poate a fi. am stat cu gura căscată gândind. gândindu. gândindu mă. mă gândeam de ce nu am aceeași frenezie când trec printr-o "ridicare" similară la nivel psihic. fiindcă există paralele. și fiindcă am trecut prin dureri acute și "vindecări" și la nivelul mentalului și a psihicului. singura explicație care mi s-a părut acceptabilă pentru mine în momentul de față (recunosc...am luat multe pastile în ultimele zile. nu știu cât de ale mele sunt gândurile mele acum) este că la nivelul mentalului lucrurile îmi sunt mult mai previzibile. și la nivelul mentalului și a psihismului meritul este în cea mai mare măsură al meu, la un nivel strict în mare parte conștient. la nivelul fizicului mecanismele îmi rămân obscure, vegetative și intangibile. și în clipe de astea mi-aș dori să devin o Cucernică Maică.

Monday, August 29, 2011

pain...the final frontier

cu capul blocat între pat și canapea. trunchiul blocat în durerea țipătoare. disperarea și furia amestecate în fiecare celulă într-o otravă atomică. senzația de dizlocare organică. mâinile scrâșnind tăcut pe lemnul mânerului. liniște. zbucium. liniște. urlet crunt. liniște. lacrimi țâșnind impudic pe obraz. o dâră de salivă scurgându-se calm pe fața întoarsă câș, schimonosindu-se ca la un circ halucinant.
un cuțit și tai în venă. nu mai suport!!!! dar la dracul...nu pot să mă mișc nici măcar până la el...la cuțit.
"reacționezi foarte prost la durere" "no shit!!!"
de fiecare dată când trebuie să mă ridic în picioare (???) - mai degrabă pe picioare, mai corect ar fi între mersul în patru labe și mersul cocoșat - îmi vine în minte genericul de la 2001: A Space Odyssey (Richard Strauss - Also Sprach Zarathustra). încă două-trei scrâșnete, cinci-șase gâfâituri și sunt aproape în picioare.
și Muntele Vrăjit, al lui Thomas Mann...nu mai sunt Hans Castorp? nu mai sunt copilul vieții? habar n-am și acum chiar nu ma interesează. încep să mă gândesc la diferite forme de "răzbunare", cum am să "i-o trag" durerii...după ce-mi trece. dacă nu-mi trece oricum reacționez prost, deci ce se mai poate întâmpla?


Sunday, August 28, 2011

August - 2011 trip

You can see some pictures here, click on My Pictures and then on :: August - 2011 ::. It has a big loading time, so if you really have nothing better to do...
I will try to put them here too, but right now I fight against a crazy backache...

EDIT:
Managed to add Cooliris Live on a page in blogspot. Uploaded the photos on Picasa. Published the album, then tried to figure out the feed URL. Took me a while and used in the end the direct link (extracted with Firebug). So, instead of using api://picasaweb.google.com/?user=jajonet&album=BLIJDORP (as they tell us on their developers site), I used http://photos.googleapis.com/data/feed/api/user/SimonaIlie/album/August282011?max-results=60 which is the final url to get the feed content.

Cooliris can be found here.

Saturday, July 30, 2011

saga (from bleah to lol and back)

A week ago I finished my compressed saga with PayPal. I learned many things from that experience (that I think to share) and also now I have many dilemmas (I will survive them, soon I will forget everything).
The story starts in a lovely hot afternoon at work when a friend of mine asked me if I could receive some money in my PayPal account for her mother. Considering that a few months ago I called the bank to activate my e-payment card so I can use it with my PayPal account I thought it would be such a great opportunity to see how their services work. I lost any sense of curiosity about PayPal meanwhile.
I get the money in the account, all nice and happy. I set my credit card to the PayPal account. No funcky messages, no warnings, no blinking exclamation marks. Why? Because "The Horror" is always kept hidden. You don't see it first.
After a few days I am told I should try to withdraw those money. Ooooh! you have to withdraw them???! (trust me, I made tones of google searches, I read most of their FAQs, I had to be told by someone and then figure out from the support how the whole system works. or doesn't.) So, the idea is this. You have the PayPal account and your bank account. Even you have a credit card in your PayPal account that they verify with your bank, after you get money in your PP account they don't send it to your bank account, they just keep them there. And one of the most hilarious things after all this is that PP actually has a withdraw limit. So...yeah...fool people around to send you money in your PP account and you will be able to actually benefit of those money when we tell you to (even you think you are free to get them from you superb PP account when you want to) Bleah!.
As I said before, I go into the adventure of withdrawing the money from my PP account. Now, some info. I click happy on Withdraw option, choose Withdraw funds to your card and I can see the eyes of the Horror: warning telling me I can withdraw only to a card with Visa or MasterCard logo. I have a MasterCard card. I smile happily. I...poor naive. The only options I have is to insert info for a Visa card. On that page I can see I have 1 active card. When I try to select "Choose another card", the Horror shows me his tail. I can't choose any card. Damn...now starts the amazing information exchange with the PP support. I talked with Angelina, Thomas, Paulina and Michelle. You don't have to tell me these are not their real names (duuuuh!). They are the unknown soldiers, I know very well. First, Angelina tells me a stupid thing, such as "I verified your account and you have a Visa card.". I am like...whoaaat??!! But still, I continue. Thomas tells me something really interesting...he told me he understood my frustration...and it was just my 2nd of 3rd email!!!He was a cute! He tells me he verified my account too (wow! how many people are able to verify my account??!!) and indeed I have a MasterCard card and...sorry, but they only accept Visa cards. Ok, I start to talk around, to ask people what is going on, what I can do?, Google and the conclusion was that actually no, you can use MasterCard on PP, you can't use Visa Electron, for example. Meanwhile I receive some stupid emails from my bank. One imbecile lady confounded me and after she spams me she tells me to go to the bank to solve the issue so I don't receive emails that do not concern me!!! retard. I called the bank to tell them about this issue and also to ask them if there are any problems with my e-payment card and PP. They tell me there is no problem, only that it seems it was not verified, because the 4 digits code does not appear. Ooooh....oh...other retards on the plane. My e-payment card expired 4 months ago. So when they gave me a new one of course the idiots forgot to copy all data! why do I wonder? I live in the country where people cut each others with swords! I share this new info with the boys and girls from PP support. As my card appeared to be verified in PP I ask them if they can reset my code and repeat the verification. I forgive Paulina because she completely ignored my suggestion, but she told me something new: that I could try to send the money back or to someone else with a PP account (I have tried that before, but there were issues too....the Horror...the Horror!). My heart trembles in excitement! I start to google again, I found out alot of new info about PP that they don't tell you or make it visible. I even found a book about How to use your PP account! only 7 dollars!!!!! For example Profile, in PP account is an option itself (it has sub-options). There you can see if your card is usable on PP, add currencies to your PP account, change amounts in your PP account from a currency to another and alot of kinky stuff. I tried to send the money back. Guess what? That's how I met Michelle...the hero that made my day. My last email to PP which had the chance or the misfortune to be read by Michelle contained phrases like these:
"[...]I google it and I find out how to. You won't have to explain me the steps, I know them: History, Issue Refund....right? Well...why on this page(issue refund) I get this message:

Your money can't be transferred from your bank account to cover this refund at this time. Please add money to your PayPal account, or add another payment method.

I think I deserve some explanations, more than "we are sorry but you can't do this". Please contact your technical support and ask them if there are inconsistencies in your databases, because the messages are contradictory. And by the way, if the money can't be transferred from my bank account, how to add money to my paypal account??!! If I can't do this but those money are in PayPal system, please ask someone in charge to do the transfer because this is taking far too long time (not me, don't tell me to go in my account and click on some links because it seems that I can't do anything in my account and those money are stuck in the void). If my PayPal account is a black hole for money, let me know that too!

thank you very much[...]"
Do you think I snapped???!Michelle sensed she should be sorry for my frustrations too. And gave me the solution.

Now, for the completion of the transfer PP took 4% of the amount. To change the currency forth and back took another 5% and to send them back took another 4% from the remaining sum. In the end, during all this mabmo-jumbo there were lost 12.5% of the initial amount. If there were my own money, I would have closed my PP account after the 2nd email.
My only conclusion was this: This is the horror parody of the comedy called "life" (gosh, nothing can destroy my pathos:D)

Tuesday, July 12, 2011

În lumina soarelui - elegie

pierdut minţi
 în zona podului-de-fier sau a podului-de-piatră.
le declar nule
sau vide.
ba nu. invalide.
oricum se vor dezintegra
în lumina soarelui.





doctorul mi-a zis
"între trei şi şase luni".
am fugit speriat la picioarele Mamei
ca şi cum dacă mi-a dat viaţă o dată
poate merge şi a doua oară.
m-a îndepărtat uşor cu picioru'i sidefiu
şi a păşit liniştit
în lumina soarelui.





nu sunt decât un prol
cu Victoria în colţul buzelor
rânjind candid
în lumina soarelui.