Memories are nice, but that's all they are.

WordPress Tip #1 : Custom Scripts, AJAX Calls, Limitless Shoddy Code …

Coding custom AJAX/PHP scripts in your Wordpress theme

  July 2nd, 2014


So you have a WordPress site and you need to save some information from the front-end, count likes, custom analytic, shit I dunno.

There comes a time in every person’s CMS career where you start realising that installing more and more plugins just causes more and more headaches, so you go in search of the coding tricks that will last more then a few core updates.

The first problem one has trying to write their own custom scripts is that you want to access the WordPress database. So you create a custom php file, include some random WordPress files till you get a connection. You know it looks ugly, but how the hell else are ya suppose to do it?

Well for one you could just go here and read up on it: WordPress Codex

But I’m gonna help you out, here it is.

First up, we need to create a function in wordpress. This will be your script. Write in it whatever the hell you want. Update a meta field (Custom Field) or return a set of results in json format. Its up to you.

The PHP: functions.php

The Javascript:

Note: If your javascript is having trouble change ajaxurl to “/wp-admin/admin-ajax.php”

Have fun storming the castle.

By: Jason Rogers   •      No Comments Yet

  javascript php tips wordpress

Ranked on Goodreads is a Great Feeling!

  February 6th, 2014


Awe I feel great after seeing this! Im not so involved in the community, but I read up everyday on goodreads!


 

By: Jason Rogers   •      No Comments Yet

  books inspiration personal stuffs

Flash Fiction Challenge 1: Cerulean God

roll for your title

  January 17th, 2014


This is the first challenge of the year, and well my first time really trying something like this. The challenges are by Chuck Wendig on his terribleminds.com

 Cerulean God

     I embarked on my death while the war had just begun. Done through by the second son of my fathers name. What justice to blindly take the path ahead of my choosing from me. Can passing sentence on such a life, from a choice, perhaps a indoctrination, to a question thought myth to be virtuous?
     Crawling to the banister of my sea deck seeing the mountain of water that had plunged from the storm that plagued us for weeks, I couldn’t help but feel overwhelmed. The God of the Cerulean Throne at its crest so beautiful. A cloud of hate emanating while her legion stormed forth. Fueled by her song which seemed to give them strength, and ours fear. On any other day, listening to something so beautiful might have brought me to tears, but on this day I just want to rip off my ears. Or maybe that was just because I didn’t want to listen to my brother say another word, at least not until my dagger touched his heart.
     The sea has been rising slowly for weeks, half the village was already under water. There was no escape, the storm had been to strong to sail away, if one could with all the masts ripped off. If anyone is to survive for long the rations must be replenished. Maybe that was the plan, to confine us to uncomfortable proportions, then attack at our weakest.
     Aeij’n my brother, spoke softly in my ear, “It perhaps is not over, if but you see what is so clearly in front of you.”
     “And you say this is just? Who are you to decide that this God sits in judgement? This freedom was a lie and I gladly accept death.”
     He laughs, “oh this is not the end brother. For living a life doing whatever the hell you wanted, you’ll be condemned forever.”
     “What are you talking about?” I muttered.
     “Really? How bout running off to find your glory, while I stayed and cared for your wife and children? I raised those boys…”
     “They’ve died long ago, do you really want to take credit for their actions? It was you who led them to death before their time. I was there for them just as our father was there for us.”
     “That old fool. I hope you rot with him. There for us you say? That miserable fool never cared for either one of us. Searching for his own so-called honor, just as you did.”
     “Perhaps, but its to late now, I will not apologize because I didn’t meet your expectations. You sought nothing, your weak brother. Your life was nothing more then a beggars, taking the scraps our family left behind. Do not preach to me.” I muttered distastefully.
     As the Gods minions got closer I could see a circle of our elders performing their old magic in the center of town. They sat in a tight circle visibly mumbling to themselves. In unison their arms came up and a fine threaded blue light came from the center and weaved its way up, sparks flying, until it reached high above. Time slowed as I watched its beauty, then like a web it came around the town. It did not halt the attackers, but it did seem to slow there movement, like some sort of sentience that knew who to latch on to.
     It didn’t matter much for the troops on the front line however as they were being slaughtered. Lances and tridents impaling them. Before moving on to the next the monsters would slice of the head of there foe and place the head on the wall facing the city. Probably some sort of scare tactic, to bad it was working though. The sounds of woman and children screaming was enough to send even the most wretched heart fearful.
     As he leans closer I pull myself up the banister leaning over so most of my weight rested on the ledge. I could see the wide empty grin as I turn to face him. “As you have passed judgement so will I.”
     Sniggering gently, “Yes, maybe. But not by the laws of our fathers you so blindly followed…”
     Stopped by the lance sticking in his belly, horrified he looked in my eyes and screamed his last breath.
     “I guess not, but you will be judged by man.” Grinning as the stench of his words creeps from my senses.
     “Do not presume I did not judge the laws of old in my time. I even rebuilt some to the betterment of our people, I lived without regret. Except maybe you brother, I should never have let your poison influence our people.” I said turning to watch the battle.
     The elders light fell, they could not withstand the assault long, and they knew it. At once I could see the difference it made on the attackers, no longer impeded they scaled the outer walls and launched high above the guards onto the grounds. Making there way towards the weakest of our villagers. The shield had barely done anything. Protection is much more difficult then destruction though, now the elders will be formidable. Taking up the arms they had next to them I can feel the hate and anger coming off of them, perhaps this battle is far from over.
     There was some men who still stood strong near the center walls. Just high enough to keep the bulk of the torrent from flooding the rest of the city. The men looked fearful and trembling, but what human wouldn’t. It is in this act of dissent they are strong, courageous and worthy of my loyalty.
     Perhaps this battle is not over for me yet. I will fight and stand with all of you, my brothers. This ruling will be appealed.
     I slump down down to the floor and closed my eyes to prepare for the next battle.

__

That was fun, I liked the title I had got.

By: Jason Rogers   •      No Comments Yet

  personal stuffs über awesomeness

A Misunderstood Life

High school was a real treat i’ll gladly not repeat

  January 12th, 2014


If you struggle with the intricacies of everyday life, watch this.

 

The One Book

8520610

I read Susan’s book some months ago, and it was/is the only book to ever capture any resemblance to who I am. Which is sad because I know I’m not alone.

In a way, as corny as it sounds, it started me on a path to accepting my true nature. How can that be bad?

My favorite section was actually close to the beginning where she made a reference to studies done from last century to this century about what qualities the books of their time were eliciting:

Pre 1920′s Post 1920′s
1 Citizenship 1 Magnetic
2 Duty 2 Fascination
3 Work 3 Stunning
4 Golden Deeds 4 Attractive
5 Honor 5 Glowing
6 Reputation 6 Dominant
7 Morals 7 Forceful
8 Manners 8 Energetic
9 Integrity -

This is when I became hooked. A slight case of the grass greener, perhaps?

Me

“You are the average of the five people you spend the most time with.” Jim Rohn

I think perhaps in my case I was the product of the intolerance and miscommunication of opinions of said 5 [not the same 5 at all times mind you]. I almost used bigotry, however I do not intend people to think I am writing to slander them. I think people have given this word special meaning that turns it derogatory (or im wrong and it is derogatory…sorry).

big·ot·ry – intolerance toward those who hold different opinions from oneself.

Not void of friendship, but not from understanding either. It was not until recently, maybe the last two years, that I have learned enough to cast aside the will of what society makes of me, and to redefine myself. Trust me its been a sometimes lonely, medicated, constant search of a journey. And that’s ok. It’s much better now.

Oh and for your reference, seeking solitude and being alone are two different things. Next time you see someone alone maybe its not out of loneliness or some pejorative dissent…

The Apology

Just as I have been judged, so too did I cast it. Being misunderstood brought about frustration and anger that would lead to unspeakable insults (in both directions). What kind of friendship is that?

Instead of learning and trying to understand I would hide away from dealing about situations. And so I apologize for my failure of forthcomings.

Watch the TED talk, read the book. Maybe society will seem just a little more cozy.

By: Jason Rogers   •      No Comments Yet

  authors books inspiration opinions personal stuffs

Alan Watts (1915 – 1973)

What if Money Was No Object?

  January 6th, 2014


“The ego is nothing other than the focus of conscious attention.

97182-alan-watts-1024x640

Alan Watts (6 January 1915 – 16 November 1973) Taught Eastern philosophy to the Western Culture. He wrote The Way of Zen in 1957, one of the first bestselling books on Buddhism. As well as over 25 other books.

If you haven’t seen this video, then you should. One of my favorite inspirational speeches.

 
The Script:

“So I always ask the question: What would you like to do if money were no object? How would you really enjoy spending your life? Well it’s so amazing as the result of our kind of educational system, crowds of students say ‘Well, we’d like to be painters, we’d like to be poets, we’d like to be writers’ But as everybody knows you can’t earn any money that way! Another person says ‘Well I’d like to live an out-of-door’s life and ride horses.’ I said ‘You wanna teach in a riding school?’

Let’s go through with it. What do you want to do? When we finally got down to something which the individual says he really wants to do I will say to him ‘You do that! And forget the money!’ Because if you say that getting the money is the most important thing you will spend your life completely wasting your time! You’ll be doing things you don’t like doing in order to go on living – that is to go on doing things you don’t like doing! Which is stupid! Better to have a short life that is full of which you like doing then a long life spent in a miserable way. And after all, if you do really like what you are doing – it doesn’t really matter what it is – you can eventually become a master of it. It’s the only way of becoming the master of something, to be really with it. And then you will be able to get a good fee for whatever it is. So don’t worry too much, somebody is interested in everything. Anything you can be interested in, you’ll find others who are.

But it’s absolutely stupid to spend your time doing things you don’t like in order to go on spending things you don’t like, doing things you don’t like and to teach our children to follow the same track. See, what we are doing is we are bringing up children and educating to live the same sort of lifes we are living. In order they may justify themselves and find satisfaction in life by bringing up their children to bring up their children to do the same thing. So it’s all retch and no vomit – it never gets there! And so therefore it’s so important to consider this question:

What do I desire?”

Alan Watts

…and that beard was just so sexy!

By: Jason Rogers   •      No Comments Yet

  authors birthdays inspiration money