On certain servers that do not run PHP 5.2 or higher, the Auto Update feature of the P2 WordPress theme—which was recently implemented by FrakMedia! Productions for internal communications between all its workers—does not work. A quick run-down: the P2 theme is for micro-blogging. It is basically micro-blogging meets Twitter meets web forums, on Red Bull.
Now, “auto update” means that whenever you post something it will show up automatically (using AJAX and JSON), so you do not have to refresh the browser page.
In internally testing this, FrakMedia!’s PR coordinator Jon recently pointed this out to me, and I set out to find the problem. And it has a solution, which is highlighted in this thread on WordPress’s support site. It fixes the auto update problem when it comes to posting new threads, but it doesn’t deal with updating when replies to threads are posted.
So, you only need to fix one file. That file is p2/inc/ajax.php and need to be modified thusly:
This solves the issue with auto updating any newly started threads only, not any replies to said threads. That’s the next step.
3. At line 318, remove this line:
echo json_encode( $json_data );
And add this block of code:
$json = new Services_JSON();
nocache_headers();
echo $json->encode( $json_data );
Once you’ve saved the file and uploaded it to your server, or edited through your WordPress dashboard’s editor (Appearance -> Editor), then this problem will be fixed. Simply refresh your browser, and start making things happen.
Important Note: As with any other theme, whenever you install an update from the publisher for said theme you will be overwriting any changes you made to the code. So make sure that you modify the code again after the update to reproduce the modifications noted in this article! Do keep in mind that should the files from said update be totally recoded, the above code may or may not work as intended. (The lines may not be there or may have moved to an entirely new file, for instance, and other fun stuff like that.)
For the new website I’m developing (you can see a clearly unfinished, work-in-progress preview of it here), I am using the Organize Series plugins designed for WordPress. That plugin is designed to organize a bunch of blog posts into a series, like a series on hot women in the Marvel universe. For my purposes, I needed to organize the lots under one specific auction, with navigation links in the sub-menu. (See this.) I ran into a problem when needing to create separate links for articles within the series. Basically, I had no way to dynamically call the unique id number associated to the series, and found I’d have to hardcode it.
So I decided that I would have to hack the code by creating two new functions: one to create a “previous” link and the other a “next” link. These new functions would tie into the function (called wp_series_nav) that was already present to generate the links—although it did not possess the means to actually grab the dynamic series ID without a bunch of effort.
So I went to the source file (series-template-tags.php) and modified it to create these two functions:
wp_series_nav_prev()
wp_series_nav_next()
It’s a real quick hack, and you’ll need to add these functions before the wp_series_nav() function that’s located around line 609.
… and that’s it! Now you’ll be able to add the new functions to your blog’s page template. Cool, eh?
Important Note: As with any other plugin, whenever you install an update from the publisher for said plugin you will be overwriting any changes you made to the code. So make sure that you modify the code again after the update to reproduce the modifications noted in this article! Do keep in mind that should the files from said update be totally recoded, the above code may or may not work as intended. (The lines may not be there or may have moved to an entirely new file, for instance.)
In any event, I wanted to modify the plugin so that when an administrator or editor is logged in, they’ll be able to access their site’s WordPress Dashboard from the Login with Ajax widget.
Simple enough fix there that took all but three or so minutes to implement and test, once I figured out how the plugin worked.
In the widget_in.php file, you add:
global $user_level;
As you see below:
<div id="LoginWithAjax">
<?php
global $current_user;
global $user_level;
global $wpmu_version;
get_currentuserinfo();
?>
Now, that calls the variable we need to identify the user’s level (see: WordPress Codex). To put it to good use, and to print out that dashboard link, you need to make the following highlighted change to line 42.
And that should do it! Now you’ll have a link leading back to your dashboard, so you can blog at will!
Important Note: As with any other plugin, whenever you install an update from the publisher for said plugin you will be overwriting any changes you made to the code. So make sure that you modify the code again after the update to reproduce the modifications noted in this article! Do keep in mind that should the files from said update are totally recoded, the above code may or may not work as intended. (The lines may not be there or may have moved to an entirely new file, for instance.)
As with most everything that is released for MediaWiki or WordPress, I invariably have to modify it to suit the needs of the projects I work on. I find that nothing works quite right “out of the box.” In the interests of people who run into this same issues, I’ve decided on a new track for my website (in addition to just being a general place to vent, sorry!) where I tell you how I frakking fix things. Hopefully, this will help some hapless bloke who faces similar problems with extensions and programs that I run into as well—and who knows, I may just need your help someday. Scared yet? More to Read…
This is repeated here more for my own future reference than anything else. On the other hand I’ll share it with the Internet anyway. Enjoy.
“Creating a life that reflects your values and satisfies your soul is a rare achievement. In a culture that relentlessly promotes avarice and excess as the good life, a person happy doing his own work is usually considered an eccentric, if not a subversive. Ambition is only understood if it’s to rise to the top of some imaginary ladder of success. Someone who takes an undemanding job because it affords him the time to pursue other interests and activities is considered a flake. A person who abandons a career in order to stay home and raise children is considered not to be living up to his potential—as if a job title and salary are the sole measure of human worth. You’ll be told in a hundred ways, some subtle and some not, to keep climbing, and never be satisfied with where you are, who you are, and what you’re doing. There are a million ways to sell yourself out, and I guarantee you’ll hear about them.” — Bill Watterson
I’m pleased that one of my reasons for my continued sanity—whatever remains of it in its disfigured form—has returned with new content. In this instance, I’m referring to Real Time with Bill Maher.
Several wonderful things transpired during Friday’s episode that were notable. Amongst them is Seth MacFarlane’s near-perfect Shatner-esque delivery of a speech regarding war, nearly ripped word-for-word from the original Star Trek episode, “A Taste of Armageddon.”
(Thanks to TrekMovie.com for posting an article with the YouTube embed!)
A second item was Seth MacFarlane’s response to Sarah Palin’s fake outrage where she pretends to be a defender for those affected by Down Syndrome. The YouTube embed is disabled, but I shall offer this link. Clicky, clicky. (MacFarlane’s comments are segued by Real Time‘s skit on what various celebrities have written on the palm of their hand, Palin-style.)
Now, I did see the Family Guy episode in question, and I found nothing in it that made fun of anyone with Down Syndrome—including Pailn’s son, Trig. Now, I’m not a heartless bastard, although at times I may come off as one, as I feel sorry for Trig. I feel sorry that Trig received the short straw and ended up not only with Down Syndrome, but with an idiot like Sarah Palin as a mother.
Trig’s just fucked—and it has nothing to do with MacFarlane or his cartoon.
If anything, this whole thing reminds me how fortunate I am to be surrounded by people who actually like me for who I am—in that regard, I am far better off than I was more than a year ago—and that I have my health.
Regardless, this fake outrage is just another attempt by the Alaskan Drama Queen to gain attention to herself and her laughable political ambitions. Sad, really. What’s even sad is that people still talk about Sarah Palin, as if she’s the new face of the Republican party.
So, to my fellow Americans who believe themselves Republicans, I state the following: When the late Republican president Abraham Lincoln spoke of being able to “fool some of the people all of the time, and all of the people some of the time,” Lincoln did not refer to parading around the imbecile who effectively euthanized McCain’s campaign. (Not that this is the first time that Republicans tried to kill a McCain presidential ticket… during their previous attempt, they trotted out a metal deficient who masqueraded as a Texan and Governor Bush assumed the White House.) However, being the RINOs that the present Republican Party now are, I’ll give them credit for borrowing from former Republicans. It would be embarrassing if they borrowed inspiration from Stalin and the SOP from Gulags.
Then there’s also this, which gave me a laugh, because it will never come to pass.
Obama is a weak-willed, inexperienced pissant who, I believe, will be remembered as the Jimmy Carter of the new millennium. I want to feel sorry for Obama, since he did walk into a pile of shit not of his own making, but he’s simply either impotent or incompetent. He took the job knowing the risks, and ergo I can’t feel any empathy for him, for empathy isn’t going to fix a fucking thing. Decisive action is, even if it is unpopular.
A majority of Obama’s initiatives—like a public option for health care—are now pretty much dead (leading me to question if they ever really had life at all) and, sadly, the economy is only getting weaker… so Obama’s battles have already been lost before they were waged. This being the case, Obama should throw out any of his attempts to be bi-partisan and become a dick. Since Cheney is all but bragging about torturing human beings—lest we forget that, for better or for worse, these people are human—Obama should really piss off the Repugnantcans and string Cheney by his pubes for war crimes. Hey, they did call their actions integral parts of the “war on terror,” after all. Ergo, it is a war crime!
What is the worst that can happen? Impeachment proceedings? And even impeachment, in and of itself, isn’t going to get Obama jettisoned from the presidency. So… he’s already lost everything, and he should just go down fighting, like any honorable bloke would do.
It’ll never happen of course, but one can always dream. Aside from hope, dreams are the only thing that a majority of Americans really have left at this point.
And on a slightly lighter ancillary subject, the only downfall from Friday’s Real Time program was this: the discussion of the Kevin Smith’s issue with Southwest Airlines by discussing the erroneous story as if it were fact. I’ve never liked Southwest Airlines anyway, as their customer service blows chunks… and Kevin Smith’s issue wasn’t with his weight, but with how he was treated and how Southwest continues to cover up their employees’s errors with piles of steamin’ lies.
So, if Bill wants to apologize for not going with all the facts, he’ll probably do it live next week.
Ah, yes, Valentine’s Day. That day. It’s a day that men dread due to the absurd amounts of social programming that tells us that the gifting of chocolates and jewelry apparently equate to the retention of romantic courtship. I’m not into that romantic pomp and circumstance social dance, and thankfully I don’t have to worry about it at the present.
Emancipation is a wonderful feeling, even if you’re the only one tossing and toiling in bed, all alone in the night.
Onto more important matters: sometime this month marks the fifth birthday of a site that helped change my life. It’s called Battlestar Wiki, and I spent the better part of an hour and a half sifting through my experiences running the site and, much to my surprise, writing what amounts to a love letter to the frakking fandom that has placed so much time, effort, and trust in a website. It is as raw as bloody steak, having come from a stream of consciousness, and can be found here:
I think Obama and the Democrats need to get an idea of how the world works… Seeing as they’re getting pwned by Republicans as of late and have no concept of actual reality, or so it seems. On that note, I’m glad that Ted Kennedy was able to keep the seat warm for the past 46 years for a Republican boy model to simply waltz in and take it. I’m sure Kennedy is rolling in his grave right now.
Democrats, keep up the good work, you worthless suits. It’s times like these where I really want there to be a viable third party in this country, because both parties are abominations of the political system that need to be put down like rabid dogs.
Anyway, Democrats and Obama need to watch this. Please. Get the fucking message and get moving. This country is in such deep shit right now that I really do see America following the footsteps of the Roman Empire.
What’s that saying? “Those that fail to learn from history are doomed to repeat it”?
Sort of broke my consistency with the blogging thing. Not all right by me, but here’s a summary of what has passed:
1. Pasta Dinner Benefit
Ticket to the benefit.
I attended a spaghetti dinner last Friday for Noah McClain, a two year old boy who was diagnosed with Guillian Barre Syndrome and Cerebral Palsy. The dinner was held by the American Legion post that my grandmother belongs to, and so I went to the dinner with my parents and grandmother. What makes Noah’s predicament even more harrowing is the fact that his father lost his job (and with it insurance benefits) just a few days after finding out about his son’s condition, and so the McClain family needs help paying for Noah’s medical expenses.
As a member of the Legion—for McClain’s father served in our military—the fine folks at the Legion organized this event. I’m not sure how much they managed to raise, but given the high turnout, I wouldn’t be surprised if they raised a good deal of money to help!
At the dinner, I was also pleased to interface with some members of the community. One of them was a one of my father’s present clients who praised me on the work I did on the virtual tour of their home, so that certainly made my night.
2. Spending Time with Friends
In the vein of spending time with friends, I’ve been participating in weekly trivia events at the local Hurricane’s Bar and Grill. That is until the owner there canceled it for affecting “season business.” Now, I’m not sure what kind of “seasonal business” two hours on a Monday night is affecting, because Monday is typically the lowest turn-out for sports bars. So… I’m not sure what we’re doing on Monday nights, other than hanging with my friends watching Chuck.
I also attended my friend Andrea’s birthday, from which I was called away from just as we were going to eat cake because my brother needed help prior to his trip up to Tallahassee. None-the-less, good times were had.
3. Staying Positive
I’ve been pretty positive and centered so far this month, which is great. I’m honestly getting to spend more time with myself again, which will be a good thing as once I start up school again in the next few months, I doubt I will.
Between that and a few reality checks, I believe that I’m on the right path.
Which reminds me… I have a poem attached to a wall in my room, right next to the door. Somehow, despite the fact that I walk past it on a daily basis, I haven’t gone back and read it until just recently. It’s just… been there.
I was given this poem by one of the adult aides at a community center where I volunteered my time at during my middle school years, and I had it laminated. It’s been with me for the past decade, and I want to share it with all of you, since I take it quite to whatever heart I have remaining.
The following Family Guy clip resonates with me. This scares me when I think about it.
Since this is Sunday and, like the Head Cheese upstairs, I should rest on the seventh day; I figure that this should be fun and less thought-provoking than my previous posts. Ergo, this clip in question.
(For those of you readin’ through Facebook, click here for the clip.)
And, no, I do not care who won at the Globes. I do not care for 24. And I do not care for green eggs—but I do care for ham.