Hellas
Hellas

Embed Comment Images in WordPress

WordPress allow use of html img tag  in the comments, so the images are shown directly if wrapped with it, but most of the people who visits our blogs do not know how to use html tags. After unsuccessful searching for instant solution, I decided to build a plugin which exactly do that.

This plugin is simple. It uses preg_replace to detect direct image links in comments and wraps those with the img html tag. On top of it, you can specify width of your comment so it creates container and then fits image into it. It does not resize image it just puts image of any size into specified container. This is good because nothing is stored on your server, but bad because people can link images of virtually any size which will slow loading of your page for your visitors.

screenshot-1

I am planning in next version to detect size of the image on given link and if it is over X megabytes and x*y pixels it skips wrapping image in IMG tag.

Currently this plugin embeds only images with .jpg, .png and .gif extension, but I am planing making interface so you can specify which image types should be embedable.

You can download plugin from WordPress.org or here:

DOWNLOAD

Embed Comment Images DEMO

You can use this post as a testing demo. Just copy/paste the image link directly into the comment field.

p.s.

If you want to embed video content URLs in the comments, you can do so by using oEmbed plugin.

Nemate podršku za ajax…

Nemate podrsku za ajax…

“Nemate podršku za ajax” je Javascript greška koja se pojavila na PIK.ba web sajtu 21.04.2012. Trenutno nema rješenja kako da je popravite dok PIK.ba administracija ne rijesi problem ali postoji zaobilazni put da pročitate vaše poruke.

 

Greška se pojavljuje na svim browserima od Opere, Chrome-a, Firefoxa, Internet Explorera. Greška vas onemogućuje da pročitate privatne poruke.

 

Edit:
Zaobilazno rješenje za čitanje poruka (preporuka je da ne odgovarate jer vam sagovornik vjerovatno ne zna kako odgovoriti jer ima isti problem)

Ulogujte se na  www.pik.rs (koji dijelu istu bazu artikala i korisnika kao i pik.ba) sa svojim korisničkim imenom i lozinkom. Idite na Poruke i klik na poruku će da otvori istu. Vidjećete i mnogo notifikacija ali ne odgovarajte na njih jer će biti duplikati na pik.ba.

Disable Password Reset in WordPress

I just compiled small plugin from code available online, which will disable password reset function “Lost your password” in WordPress. This will enhance security of your WordPress site especially in case if you have lot of WordPress sites and you want to be able to change passwords only from MySQL.

On top of that it will disable error message which tells potential attacker, what he mistaked username or password while typing the name.

This plugin is in no way absolute security and it would be nice addition to a combo of Limit Login Attempts and Bulletproof security.

Do note that if you forget password you will not be able to reset it through “Lost your password?” but only on one of the more advanced ways listed on Resetting Your Password WordPress Codex page.

You can download plugin here: Disable Password Reset WP Plugin

My Favorite Atheist Quotes

My favorite atheist quotes

1. I believe in God, only I spell it Nature. – Frank Lloyd Wright

2. We must question the story logic of having an all-knowing all-powerful God, who creates faulty Humans, and then blames them for his own mistakes. – Gene Roddenberry

3. Religion is regarded by the common people as true, by the wise as false, and by the rulers as useful. – Seneca the Younger

4. If I were not an atheist, I would believe in a God who would choose to save people on the basis of the totality of their lives and not the pattern of their words. I think he would prefer an honest and righteous atheist to a TV preacher whose every word is God, God, God, and whose every deed is foul, foul, foul. – Isaac Asimov

5. Since the Bible and the church are obviously mistaken in telling us where we came from, how can we trust them to tell us where we are going? – Anonymous

6. The God of the Old Testament is arguably the most unpleasant character in all fiction: jealous and proud of it; a petty, unjust, unforgiving control-freak; a vindictive, bloodthirsty ethnic cleanser; a misogynistic, homophobic, racist, infanticidal, genocidal, filicidal, pestilential, megalomaniacal, sadomasochistic, capriciously malevolent bully. – Richard Dawkins

7. People ask me what I think about that woman priest thing. What, a woman priest? Women priests. Great, great. Now there’s priests of both sexes I don’t listen to. – Bill Hicks

8. All the biblical miracles will at last disappear with the progress of science. – Matthew Arnold

9. I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours. – Stephen Roberts

10. Give a man a fish and he will eat for a day; teach a man to fish and he will eat for a lifetime; give a man religion and he will die praying for a fish. – Anonymous

11. Calling Atheism a religion is like calling bald a hair color. – Don Hirschberg

12. God should be executed for crimes against humanity. – Bryan Emmanuel Gutierrez

13. I do not fear death. I had been dead for billions and billions of years before I was born, and had not suffered the slightest inconvenience from it. – Mark Twain

14. Is God willing to prevent evil, but not able? Then he is not omnipotent. Is he able, but not willing? Then he is malevolent. Is he both able and willing? Then whence cometh evil? Is he neither able nor willing? Then why call him God? – Epicurus

15. A lie is a lie even if everyone believes it. The truth is the truth even if nobody believes it. – David Stevens

16. I refuse to prove that I exist,” says God, “for proof denies faith, and without faith I am nothing. – Douglas Adams

17. It ain’t the parts of the Bible that I can’t understand that bother me, it is the parts that I do understand. – Mark Twain

18. We are all atheists about most of the gods that societies have ever believed in. Some of us just go one god further. – Richard Dawkins

19. Believing there is no God gives me more room for belief in family, people, love, truth, beauty, sex, Jell-o, and all the other things I can prove and that make this life the best life I will ever have. – Penn Jillette

20. Gods are fragile things; they may be killed by a whiff of science or a dose of common sense. – Chapman Cohen

21. When one person suffers from a delusion, it is called insanity. When many people suffer from a delusion it is called religion. – Robert Pirsig

22. I have no need for religion, I have a conscience. – Anonymous

23. I am against religion because it teaches us to be satisfied with not understanding the world. – Richard Dawkins

24. Animals do not have gods, they are smarter than that. – Ronnie Snow

25. Today’s religion will be the future’s mythology. Both believed at one time by many; but proved wrong by the clever. – Steven Crocker

26. Religion is what keeps the poor from murdering the rich. – Napoleon

27. Religion is the masterpiece of the art of animal training, for it trains people as to how they shall think. – Arthur Schopenhauer

28. Why should I allow that same God to tell me how to raise my kids, who had to drown His own? – Robert G. Ingersoll

29. To you I’m an atheist; to God, I’m the Loyal Opposition. – Woody Allen

30. You talk to God, you’re religious. God talks to you, You’re psychotic. – TV Show Dr House

31. In the beginning, God created the universe. This has made a lot of people very unhappy and is widely regarded as a bad move. – Douglass Adams

32. Life in Lubbock, Texas taught me two things:
One is that God loves you and you’re going to burn in hell.
The other is that sex is the most awful, filthy thing on Earth, and you should save it for someone you love. – Butch Hancock

33. You’re basically killing each other to see who’s got the better imaginary friend. -Richard Jeni

The Most Unfair Thing About Life

The most unfair thing about life is the way it ends. I mean, life is tough. It takes up a lot of your time. What do you get at the end of it? A death. What’s that, a bonus?!?! I think the life cycle is all backwards. You should die first, get it out of the way. Then you go live in an old age home. You get kicked out for being too healthy, go collect your pension, then, when you start work, you get a gold watch on your first day. You work forty years until you’re young enough to enjoy your retirement. You drink alcohol, you party, and you get ready for high school. You go to primary school, you become a kid, you play, you have no responsibilities. You become a little baby, you go back, spend your last 9 months floating with luxuries like central heating, spa, room service on tap, then you finish off as an orgasm! Amen.”

George Costanza

14 Good Reasons Why Star Trek is Better Than Star Wars

Eh kad se pisalo po njuzima. hr.rec.sf.startrek

From: Cmdr.Radac (cmdr.ra…@hi.hinet.hr)
Subject: A zašto ja volim Star Trek
Newsgroups: hr.rec.sf.startrek
Date: 2002-12-15 14:15:03 PST

14 Good Reasons why Star Trek is better than Star Wars

1. Just how many Star Trek films have been made?
2. None of Star Trek’s leading characters have an interminable breathing
obstruction
3. Star Trek doesn’t have to resort to using petty telekinetic forces to
make some action
4. Star Wars creators obviously can’t count as they made 4, 5, and 6
first!?
5. Strangely enough, all the leading ships in Star Wars are totally
invincible to enemy fire
6. Star Wars storyline is either so difficult to understand, or so badly
written, that they need to tell us it by scrolling it on the screen before
the film starts
7. Isn’t there some slight similarity between the ‘photon’ and ‘proton’
torpedoes?
8. And which was created first?
9. Which sound better: a ‘hyperdrive motivator’ or a ‘warp core’?
Exactly.
10. Star Trek doesn’t have some stupid hairy monster out of Bigfoot and
the Hendersons
11. One word: Q.
12. DS9’s Dabo girls vs. no women at Tatooine’s spaceport bar.
13. Data would kick C3P0’s metal ass.
14. The new special effects on the trilogy don’t even come close to the
effects on the DS9 episode, Sacrifice of Angels