Category: English

English articles

Orlando @ Jamendo

Orlando @ Jamendo

These who know me well enough, they know that I’m a Jamendo fan. For those who do not know, Jamendo is a service, which provides you with free (enough) music, and musicians with a place, where they can popularize and actually make money from their music.

Few weeks ago I got a message from an author there, who recommended me to listen to his album. I followed up his recommendation and I really liked it. The author is Orlando and the album is CO2.

I tried to embed the thing in here, but it did not like either my WordPress theme, or something else went wrong. But anyway… you are always able to listen it online, right?

Troubles with WP Ajax Edit Comments plugin

Troubles with WP Ajax Edit Comments plugin

Today I decided to install WP Ajax Edit Comments plugin in my blog. I saw similar functionality few months ago at Emuto’s blog (in Bulgarian), and I decided it would be nice to have it here too.

Initially I was planning to do this as part of my WordPress 2.3 upgrade, but since I decided to postpone that, I wanted to have it “here and now”.

Unfortunately, after copying and enabling the plugin, I was very frustrated to see that there’s no “edit comment” AJAX functionality at all. Neither for registered users, neither for the Admin, nor for any regular user. I was slightly disappointed, but I decided to investigate the issue.

First, I blamed my theme. Since it’s custom theme, I thought that the nice “comment preview” code screwed up the plugin. I put the plugin in test blog and there it worked like a charm. So I copied the theme from the test blog and applied it on mine. Alas, nothing again. It was not the theme (but at least one thing less to blame).

I left the theme active and I disabled all plugins except WP Ajax Edit Comments. It immediately worked. So it was something worse: __plugin-to-plugin conflict__. I started to switch on the rest of the plugins, each time refreshing a page with comments. I was _very surprised_ to see that the PHP Markdown plugin caused the issue. Once I enabled it, all nice edit comment AJAX functionality vanished again.

I was very disappointed. I desperately need that plugin to work, because most of my articles are written with the flexible and easy Markdown formatting rules. So I decided to try saving the day and achieving both Markdown and WP Ajax Edit Comments to work.

My first action was to update the Markdown plugin to its last version. That, unfortunately, did not help – still both plugins conflicted somehow, causing WP Ajax Edit plugin to fail injecting the functionality. Then I decided to install Markdown Extra plugin, hoping that it would work. Alas, failure again – the same miserable conflict.

Then I dug a bit inside Markdown Readme. Inside the readme I saw that you can actually switch off Markdown only for your comments (yes, by default Markdown works on the comments as well). From Markdown readme:

> ### WordPress-Specific Settings ###
>
> By default, the Markdown plugin applies to both posts and comments on
> your WordPress weblog. To deactivate one or the other, edit the
> _MARKDOWN\_WP\_POSTS_ or _MARKDOWN\_WP\_COMMENTS_ definitions under the
> “WordPress settings” header at the start of the “markdown.php” file.

I did that and disabled _MARKDOWN\_WP\_COMMENTS_. Woot! It immediately worked and I saw the AJAX commands from the Edit Comments plugin.

Well, that was what I actually needed. I will miss Markdown in my comments (only God knows how many times since now I will comment with Markdown in my blog, and then will edit the comment :-)). But comment’s editing is something extremely nice and it will benefit everybody, so I will have to live with that configuration.

The saga is not yet over: I am planning to notify both authors for this incident and I hope the (any) of the plugins will be fixed, so they live together with their full blown functionality. I also posted this issue in WordPress support forums. Stay tuned!

New Hoax: Check Messenger on ScanMessenger

New Hoax: Check Messenger on ScanMessenger

Yesterday I was really surprised to get the following message from one of my contacts:

> Check this out to find out if someone deleted you from their MSN: http://www.list-view.com

It obviously did not sound like him, more like an automated message, delivered from a bot. Of course, I did not click directly on the link (later I found that it would not cost any harm, but better safe than sorry). I preferred to copy/paste the link in one of my protected environments and see what will happen there.

The site, which I saw, had quite good, even professional design. However, they were asking __very strange__ question to me: to enter my MSN login data. As a return they promised to reveal me a big secret: to tell me which of my contacts deleted me from their contact lists.

Of course, I never gave them my Microsoft Passport credentials. And I do not advise any of you to give them. They claim that they do not store any personal information, but you can __never__ be sure of this. By giving them your Passport credentials you let them access any of your passport-related services. If you’re paid subscriber, you simply let them access your financial data as well.

To confirm my words I decided to query for “ScanMessenger” the site in Live Search. Obviously, the second found result was McAfee’s Site Advisor for scanmessenger.com. My suspicion was confirmed – Check Messenger / ScanMessenger is nothing more but fragulent site, designed to steal your Passport credentials.

If you spend some time clicking on its links, you will see that behind the shiny facade there’s nothing more but one “login” page. No matter where you click, you will either get “404 Not Found” error, or this login page. However, in order to ensure maximum coverage, they have this page translated into many languages (20 so far).

Will you get any real “service” from this site? Possibly. If you enter your credentials, this site will (at least) get your contact list from MSN, then it will send from your behalf the above message to all the people in your contact list. If the people in your contact list are stupid enough to do the same, the site will “know” that they have not deleted you yet. However, this “service” will fail if the people are smart enough not to give their Microsoft Passport credentials just to everyone, or if they have really deleted you from their contact list :).

What to do if you already visited the place and gave your credentials? I’d say the first thing should be to change your Passport password. Then, depending on which sensitive services you’re subscribed there, I’d advice you to go through all transaction-related data there and check your virtual (and maybe real too, if you have credit card info stored somewhere) money. And hope that all is OK. And learn to never give your credentials again.

Leaner Akismet for WordPress 2.1.2

Leaner Akismet for WordPress 2.1.2

Some time ago I modified the standard Akismet plugin, so it would not show me the comments’ contents by default. Instead, the comments’ contents are shown only with their title, and the actual comment text is hidden until you click the [+]:

Modified Akismet

After I upgraded to WordPress 2.1.2 (in parallel with moving my site to a better hosting solution), I had to re-apply the modifications again. And I found one difference in comparison with the previous instructions. The difference is in step 7, and the new step 7 should be:

>
> Now find the code
> ` `}`

For your convenience, you can find here the zipped version of the modified Akismet plugin. Please mention that the plugin has modified name as well – in case you install it, do not forget to change the name to “akismet.php”.

Enjoy :)!

Преместване / Site is moving

Преместване / Site is moving

Извинявам се отново на всички приятели и читатели, които имаха и продължават да имат проблеми с четенето и коментирането тук. Изглежда моят доставчик не може или не иска да се справи с проблемът, затова както бях решил, започвам миграция към virtual private server на друг доставчик.

Като пряк резултат този блог и всички *@doncho.net услуги ще са недостъпни за известен период от време, който се надявам да успея да сведа до 2-3 дни. Ако всичко е наред, очаквам първо пощата (всички мои и на Веси адреси) да се “съживи”, а след това и блогът и картинната галерия.

Преместването ще започне до ден-два. Тогава този сайт ще изчезне. Надявах се поне да си кача впечатленията от Тенерифе, но ми писна да получавам малоумните грешки, че MySQL сървъра “току-що” изчезнал. Също така ще почакат и снимките, временно ще говоря с Веси да засилим малко на flickr страницата ми за най-нетърпеливите :).

Пожелайте успех, няма да е лесно… надявам се да е за последно (и новия хостинг да се докаже като качествен такъв).

Следва подобен текст на английски:

Hi all,

I am very sorry for all friends and readers, who had and still have problems reading and commenting in here. It seems my service provider cannot or does not want to fix my issue. As a direct outcome, I decided to migrate to different, virtual private server hosting.

During the migration this blog and all *@doncho.net services will be unavailable. I hope the downtime to be narrowed to 2-3 days. If all is OK, I expect first my mail back operational (mine and Vessi’s), and right after them my blog and my picture gallery.

Regular expression hell in WordSpew

Regular expression hell in WordSpew

I always hated [regular expressions][]. And I still do. I hate them a lot.

About two weeks ago I saw that my [WordSpew][] plug-in seems to have an issue with the Cyrillic text. Some of the messages did not show well if they contain _more than 7 (seven) Cyrillic characters_. Why exactly seven? I have no f*cking idea. Why they do not show? I do not have idea, too!

Short analysis showed to me that the following code in [WordSpew][] is the reason for that misery:

$jal_user_text = preg_replace(“#((http|ftp)s?://\S+)|
([-_a-z0-9]+(\.[-_a-z0-9]+)*@
[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]{2,6})|\S{16}#ieu”,
‘”$0″==”$1″ || “$0″==”$2” ? “$0” : “$0 “‘, $jal_user_text);

In short – there is no short way to explain. Because regular expressions were always a nightmare to me, I did not even bother to analyze this one. Way too complex.

Commenting out that line fixed the problem. I was expecting my http and ftp links to get broken, but it seems that does something else instead, because my links are still showing.

I will be really interested if someone can help me to understand what exactly this reg-exp is doing. Also I’d like to know why it fails, if `jal_user_text` consists of more than 7 Cyrillic characters (wtf?!), for example “дддддддд”. The failure consists of… empty text, returned by the [preg_replace][] function.

Any ideas?

[WordSpew]: http://pierre.sudarovich.free.fr/index.php/2006/02/28/ajax-shoutbox/ “WordSpew – an Ajax Shoutbox”
[regular expressions]: http://en.wikipedia.org/wiki/Regular_expression “Wikipedia about regular expressions”
[preg_replace]: http://dk2.php.net/preg_replace “preg_replace @ PHP Manual”

WP-ShortStat not counting? Fixed!

WP-ShortStat not counting? Fixed!

After yesterday’s upgrade I decided to enable the WP-ShortStat plugin, which seems to come bundled at least with version 2.0.6 (maybe even earlier, but I did not notice). I was quite surprised why, after I enabled it, its tables remained empty and the stats (logically!), were zero too.

Since I know that my blog does not have _that little_ visitors (well, at least I visit it, don’t I?), I decided to look for the reason. After some hacking through the code, I saw that because of some reason, this plugin looks for the function ‘is\_admin\_page’ and if such function is not defined, it defines it. Obviously, something was wrong with that function, because my debugging showed that if I just remove the call to it, everything goes smooth.

I did not want to search more. I have no idea what is going wrong, and honestly – I do not care. I even tend to think that the function is totally useless, since the plugin detects quite well the ‘admin pages’ by looking for ‘wp-admin’ in the page URL. What is important for me after the whole research is that my counters started to go up :).

If you observe the same problem and if you share my thoughts, you may try to fix your wp-shortstat.php file. It’s simple:

* Open the file in an editor
* look for “is\_admin\_page()” in this file. You will find a fragment, which will look like:

if($wpdb->is\_admin
|| strstr($_SERVER['PHP_SELF'], 'wp-admin/')
|| is\_404()
|| is\_admin\_page()
)

* Once you find this fragment, delete the line “|| is_admin_page()”, or if you want to be good boy/gal, just add two back slashes _//_ in front of it like that:

if($wpdb->is_admin
|| strstr($_SERVER['PHP\_SELF'], 'wp-admin/')
|| is\_404()
__//__|| is\_admin\_page()
)

* Save the file. You’re done. The thing should immediately start counting your visits.

Blog upgrade to 2.0.6 and some neat stuff too

Blog upgrade to 2.0.6 and some neat stuff too

Yesterday I devoted some time to the blog. It was running 2.0.4 for a long time, and 2.0.6 was already out. Also I found SNAP Preview Anywhere service, which I liked and decided to integrate in the blog. WordPress.Com guys liked it, so what the hell, it worths a try!

SNAP integration went very smooth using the SNAP Preview Anywhere plugin. In not more than 3 minutes I had finished the job. It’s a bit stupid to show you previews of your internal links, so I switched that off. I wonder why the author does not switch that off by default, but it’s his choice anyway.

After the plugin installation, I went for the more risky task, i.e. upgrading my WordPress to 2.0.6. I say “risky”, but after all it went smooth: backup site, backup DB, switch off plugins (remember the ones, which were ON first), copy 2.0.6 files over, enable plugins, perform the upgrade, done.

After the upgrade was ready, I saw that my site’s Cyrillic was broken again. No wonder, this nasty MySQL bug bites again! I had to search through my postings to find the note to myself, which I left at the times when I upgraded my blog. Interesting, the posting was precisely at the times when I upgraded to 2.0.4. No wonder :). After injecting that code, everything ran fine.

Later on, after I loaded my Akismet, I “discovered” that I’ve overwritten my Akismet customizations from two weeks above. Using my own instructions, I was able to restore them without any problem. But if you’re lazy and do not want to follow all the steps, I will put this two updated files:

* Akismet (as it comes in WordPress 2.0.6) with the DHTML modification only, which allows you to have moderation comments “shrink”, but still displays 50 comments per Akismet page
* Akismet (as it comes in WordPress 2.0.6) with the DHTML modification and the 500 commments per moderation page change. This is the one I use, because when the comments are shrink, the more you see – the better.

Hm, maybe I should follow Yovko’s advice and write to the Akismet guys… some day?

Leaner Akismet Management Page

Leaner Akismet Management Page

My Akismet saga will never end. That’s the conclusion, which I achieved today, looking at the 3650 comments, which Akismet claimed as spam.

Few weeks earlier I had very bad experience with Akismet, because it was keeping to mark non-spam messages as such. And I eventually lost some of them into the huge pile of spam, which I daily receive. After that point I started to consider disabling Akismet, but the spammers brought me back in the reality quite fast… with one 5000 spam comments per hour pick.

After that point it was clear – Akismet will stay for a while. But how do I manager better (and most important – faster!) the daily spam heap? That was the question, which was bothering me again and again.

If you happen to have blog with Akismet protection, you will know that it displays the spam comments in a list of 50 messages/screen. This can be quite frustrating in the cases where you have 3500 messages to handle, because first – it does not have the “next/prev” page links at the bottom of each page too, and second – because 3500 spam comments fit “nicely” into about 70 pages.

I was not able to handle all that today, so I decided to make some changes. First I started with changing the amount of messages per page. That was easy – just found the magic number (yes, it’s a magic number) 50 and replaced it with variable, which had value of 500. So far – so good.

But now I hit another problem. The page become way too long to handle. “cialis”, “viagra” again and again and forever. Now, if you have had issues with that many spam messages, you usually develop the ability to judge the “spamness” of the message only by looking at the author and/or the reference link s/he provides. I mean, I don’t have much people who I care about and who sign also as “big cock mothefuka” in my comments section. Right?

So the next task was to develop a nice addition to Akismet, which will hide all bodies (with the “not spam” little form) and display only the person, it’s link and the IP address. That way I was expecting to see a nice table and to be able to browse through the comments much faster. If I need the body of a specific comment, the only thing I have to do is to click the expand/collapse link.

Surprisingly, it all happen much easier than I was expecting. Now I’m happy owner of Akismet management page, which looks like this:

Leaner Akismet Management page with one comment per line

If you want the same result, you can achieve it in these easy steps:

1. Locate and backup your akismet.php file. It should be located at “…/content/plugins/akismet” directory of your WordPress installation

2. Now when you have done that, find the function “ksd\_caught”. It’s a long function, but inside there you must find the place, where comment list generation occurs. The easiest way is just to look for this text: “<p><strong><?php comment\_author”, but it can be different across the different Akismet verstions.

3. Now after you found the text above, copy this text into the clipboard:
<a href="#" onclick="var content = this.parentNode.parentNode.getElementsByTagName('div')[0];if (content.style.display != '') { content.style.display = ''; this.innerHTML='[-]'; } else { content.style.display = 'none'; this.innerHTML='[+]'; }; return false;">[+]</a>

4. Paste the code __between__ the <p> and the <strong> in (2)

5. Now find the text “<?php comment\_text() ?>”. It should be just few lines after the text (2).

6. Copy and paste the code below __before__ the text in (5)
<div style="display:none;">

7. Now find the code
<?php
}
}

8. Copy and paste the code below __before__ the code in (7):
</div>

After all, the picture should look like this:

The final code, as it looks when compared with the original version

Please note that some browsers might trick you, if you copy/paste directly from here. They might provide you with incorrect symbol for “double quotes”, especially if you have non-US locale, which has different opening and closing double quotes. If that happens, PHP will not understand your “sense of humor” and will award you with interesting, hairy error messages. To avoid all this pain, you must ensure that your the browser correctly copied to the clipboard the double quotes. The best way to check this is by pasting the copied text in Notepad or similar text editor, where usually you can immediately tell if the double quotes are the correct ones. But in general you should care about all this only if you do not succeed with the integration as I described it, or if you’re _sure_ that you have the incorrect double quotes.

At the end, after saving the file and loading your Akismet spam management page, it all should work as described. And I think you will love it!

If you’re interested in the “lazy” way of (not)doing all above, you can use this file, where I placed the following:

* akismet.php – Akismet 1.2.1 with the code changes integrated (it also includes my modifications for 500 comments per page, which is not described above)

* akismet.old.php – Akismet 1.2.1 before I started to apply the changes, described here (but it already contains the 500 comments per page change)

* akismet.new.php – Akismet 1.2.1 after the changes. This is actually identical to akismet.php, which is included only for convenience of the lazy people, who would not like to rename this file :).

Questions? Comments? Concerns?

Blackmore’s Night CD goodness

Blackmore’s Night CD goodness

> > Можете да намерите българския вариант непосредствено след английския.

Last week we had a discussion in Ladyvera’s blog (in BG) regarding Lorena McKennitt, which ended up talking about Blackmore’s Night and their music. Blackmore’s Night is one of my favorite bands, but unfortunately for me so far I was quite a pirate for Blackmore’s Night music. But this discussion finally put in stone my decision to ‘legalize’ my right to listen them. So I decided to get the original albums and to give my contribution for the great work of this band.

Again, as usual when it comes to books or CDs, Amazon.co.uk is the first shop I visit. There I found that my favorite band has much more albums than what I already had illegally, but I did not wish at that time to place an order for all. ?100 seemed a bit too high, even for a Christmas present, so I decided to order only these 4:

* [Fires at Midnight][]
* [Ghost of a Rose][]
* [Under a Violet Moon][]
* [Shadow of the Moon][]. That was the first BN’s album I ever had and as such it’s still my all-time favorite.

I placed the order and started the hardest part, i.e. the waiting :). Fortunately, as expected, the CDs arrived in about a week. The postman decided that he cannot slip the whole fat package through my P.O.Box entry, so he opened the package and slipped each one of the CDs, and then slipped the remaining of the package :). Smart, especially when you have in mind that otherwise I had to go to the post office for the package pick-up. CDs were neither scratched, nor their outside package was damaged, which was quite cool.

I took the CDs and started the standard “Open package” -> “Insert into CD” -> “Rip to Library” process. But in the middle of the process I was badly surprised: [Under a Violet Moon][Under a Violet Moon’s] box had broken insides. One of the most important parts – the CD fixating wheel was damaged, resulting into inability to hold the CD in place.

It’s normal to assume that after this discovery I was quite mad. It’s not (only) the money, it’s also the disappointment after 5 days of waiting. I immediately photographed the problem and filed a complaint to Amazon. So far this company was extremely correct and diligent when dealing with ordering problems.

I was quite sure that there would be a solution to my problem. I so much did not want to deal with sending back this CD (especially when the post price is higher than the contents’ price), I even asked Amazon if it’s possible to send me a box only, but not to ask me to return the CD because of this.

Amazon answered even better. Considering the high ship back price, they are sending a new CD and they’re asking me to keep the old one:

> There will of course be no additional charge for the replacement order. When sending a replacement for a damaged or defective item,
it is our policy to request that you must return the original item to Amazon.co.uk within 30 days.
>
> However, as the cost of returning the package is in this case prohibitively expensive, we ask that you keep the original item with
our compliments. Perhaps you would like to donate it to a charity in your area if you feel it would be appropriate to do so.
>
> We will notify you by e-mail at the time the new order is sent out to confirm the date, contents and method of delivery.

That’s exactly the way how a self-respected company must behave. No wonder Amazon made its way from small web-shop to the biggest web shop ever.

Thanks!


Миналата седмица имахме
интересна дискусия в блога на Вера относно Lorena McKennitt, като най-накрая говорихме и за Blackmore’s Night и тяхната музика. Blackmore’s Night са от любимите ми групи, но за моя жалост до сега основно пиратствах тяхната музика. Но дискусията ме накара най-накрая да взема решението да си “легализирам” албумите им, купувайки си официалните издания. Още повече, че това е и израз на моето уважение ми към работата и усилията им.

Както обикновено, като опрат нещата до поръчка на книги или дискове, Amazon.co.uk е обичайната спирка. Там открих, че моите любимци имат много повече албуми, отколкото аз вече нелегално си кътах, но за момента не ми се искаше да поръчвам дискове за GBP100. Сумата си е висока, дори и за Коледен подарък. Така че реших да поръчам само тези четири:

* [Fires at Midnight][]
* [Ghost of a Rose][]
* [Under a Violet Moon][]
* [Shadow of the Moon][]. Това е първият албум на BN, и като такъв ми е от най-любимите.

Пуснах поръчката и след това дойде време за най-тежката част, а именно чакането :). Както и очаквах, дисковете пристигнаха за около седмица. Пощальонът решил, че пликът е твърде тлъст, за да мине през процепа на вратата ми, затова го отворил и пуснал едно по едно CDтата, а след това пуснал и отворения плик :). Умно, особено като имаме впредвид, че ако беше решил да кара “процедурно”, трябваше да ми пише бележка и аз да се разкарвам до пощата, за да получавам пратката там. CD-тата не бяха по никакъв начин засегнати от тази “интервенция”, а пликът така или иначе щеше да го сполети тази съдба :).

Взех дисковете и започнах стандартната процедура: “отваряне на диска” -> “слагане в CD устройството” -> “Rip to Library” на Media Player. Но по средата на процеса бях неприятно изненадан: държача на диска от кутията на [Under a Violet Moon][Under a Violet Moon’s] беше счупен, явно по време на производството още. Понеже функцията на този държач е да фиксира CD-то в кутията, за да не се наранява то при пренасяне, за мен това си беше сериозен проблем.

Нормално е да приемем, че след като открих това доста се ядосах. Не беше само до парите, допълнително дойде и разочарованието след 5 дни чакане. Веднага снимах проблема и изпратих оплакване до Amazon. До сега те бяха изключително коректни и внимтелни, когато опирахме до проблеми с поръчката.

Не бях много сигурен какво ще е решението на този проблем. Хич не ми се занимаваше с изпращане на CD-то обратно, още повече че разходите по изпращането са повече от цената на самото CD. Така че направо им казах на Амазон да пратят една кутийка ако трябва, но да не ме карат да връщам CD-то по пощата.

Amazon отговориха още по-добре. Вземайки в предвид високата цена на изпращане обратно, те ще изпратят ново CD и ме молят да задържа сегашното:

> There will of course be no additional charge for the replacement order. When sending a replacement for a damaged or defective item,
it is our policy to request that you must return the original item to Amazon.co.uk within 30 days.
>
> However, as the cost of returning the package is in this case prohibitively expensive, we ask that you keep the original item with
our compliments. Perhaps you would like to donate it to a charity in your area if you feel it would be appropriate to do so.
>
> We will notify you by e-mail at the time the new order is sent out to confirm the date, contents and method of delivery.

Това е точно начинът, по който една самоуважаваща се компания трябва да постъпва. Не се учудвам, че Amazon успяха от един малък уеб-магазин да станат най-големия такъв.

Благодаря!

[Fires at Midnight]: http://www.amazon.co.uk/Fires-at-Midnight-Blackmores-Night/dp/B00005KCDG/sr=8-2/qid=1165750847/ref=pd_ka_2/026-9635203-8851633?ie=UTF8&s=music “Fires at Midnight”
[Ghost of a Rose]: http://www.amazon.co.uk/Ghost-Rose-Blackmores-Night/dp/B00009NJ93/sr=8-3/qid=1165750847/ref=pd_ka_3/026-9635203-8851633?ie=UTF8&s=music “Ghost of a Rose”
[Under a Violet Moon]: http://www.amazon.co.uk/Under-Violet-Moon-Blackmores-Night/dp/B00005J9YO/sr=8-4/qid=1165750847/ref=pd_ka_4/026-9635203-8851633?ie=UTF8&s=music “Under a Violet Moon”
[Shadow of the Moon]: http://www.amazon.co.uk/Shadow-Moon-Blackmores-Night/dp/B00005J9YN/sr=8-7/qid=1165750847/ref=pd_ka_7/026-9635203-8851633?ie=UTF8&s=music “Shadow of the Moon”

Theme: Overlay by Kaira Extra Text