October 27th, 2008
This is just an archive of the old troidus. Please head over to troidus.com to view the new blog.
Thank you.
This is just an archive of the old troidus. Please head over to troidus.com to view the new blog.
Thank you.
I have a feature in this blog that I’ve never used. It’s a special “Review” category. It is styled a little differently than this default post style, and in this article/tutorial, I’m gonna take you through creating this.
First of all, let’s think about reviews. Reviews require certain extra elements, not needed in normal posts. These elements, like ratings, and a cover picture are stuff that you don’t need in normal posts. So, my recommendation would be to first code your loop without any of these extra stuff. However, you should have a clue as to where these extra elements will go in, so that later, when we add the stuff, it’ll be easy to find the area and just add the snippets of code.
First off, you’ll need a plugin to get this to work. Go and download the plugin “Get custom Field values” from Scott Reilly’s coffeecode site, a really great resource for great WP plugins.
After installing the plugin, it’s time to implement it.
Before that, you should know where the picture uploader uploads its pictures in WordPress, cause we’re going to use it to upload the album covers or what-nots.
Make sure that you upload a single file type only. Otherwise, it won’t pick them up. I’m using gifs.
After uploading the album cover of any size, it’s time to play with custom fields. Write a new custom field with the key ‘postimage’ and the value as the name of the image file, without the extension. For example, if you uploaded james_blunt.gif, the value would be just ‘james_blunt’, albeit without the quotes.
Now, insert this piece of code where you want the album cover to be displayed.
And you'll see the album cover image displayed. Easy as butter!
Now, for ratings. Here, I had already uploaded the madatory _star graphics_ required for ratings. I made 10 graphics, although there is no restriction to how many you can use. Hell, use a 100 star system!! Ok, so, I named the files 1.gif, 1.5.gif, 2.gif, and so on and so forth. Easy to remember, easy to use.
To add the stars, create another custom value with the key 'rate' and value as the file name. Again, the value will be 1, 1.5, 2, and so on and so forth. Finally, at the right spot, add the following code:
And there you go. Your own review system, with no hassles!!
Now, as you most certainly won't want other non-review posts to display the empty img tags, here’s how you remove them.
Say you have a Review category with id 9, where all your reviews are stored. Cleaning up the tags when not using them is easy enough. Just use the following code, and you’re all set:
This uses a simple if statement to check whether a particular post is in the given category (in our case, 9) or not. Then, it serves up the corresponding code.
That's it for this simple tutorial. I hope this is useful to you.
And before I go, I have taken this screenshot of how a review looks at Troidus.
The following post is a sponsored post, paid for by the people at ReviewMe.
As an existing member of Text-link-ads, I was invited to join ReviewMe as soon as it launched, having my site pre-approved. Your site is approved based on factors such as Google PR, Technorati rankings, etc. In other words, if you got through TLA, you’re getting in fine here.
ReviewMe is similar in function to PayperPost, which hooks up advertisers looking for buzz for their products with bloggers who earn money by writing a review of the same.
This is a concept that begun quite recently, and looks set to be another good way of making money off your blog.
However, one criticism with PayperPost is that you are not required to indicate which reviews are paid. ReviewMe improves, in my opinion, in this regard, by making it compulsory to indicate that a review is sponsored. This, I believe, is a good move, as readers aren’t midlead into thinking that reviews are unbiased.
However, as with all products like this, there will be criticism. There are people who feel that sponsored reviews take away from the value of a blog. I, however, feel that if the review is well written, and is authentic, it should, in fact, give bloggers some much needed help in keeping up with hosting costs. Of course, how authentic this remains still has to be seen. For the moment, though, I’m impressed with it.
Also, this may help bloggers get more content across to readers. I’m excited to see where this heads.
I’m trying to write a story. Don’t know how it’s headed, and am too embarassed to show it to anyone in the family. So, guys and gals, is this an ok start or a pathetic excuse for one?
As the bus stopped, I hurried inside, trying to keep myself as dry as I could from the rain that had engulfed the city. The battery must’ve been running low, cause all the lghts in the bus was out, and it was completely dark. The outlines of the fellow passengers made themselves felt as I made my way towards the rear.
And for a writing software, I don’t use Word or anything like that. My choice consists of 2 apps, both great for writing. The first app, where I write, is WriteRoom. It’s free, it’s cool, and best of all, it covers the entire screen, so that you can mute the volume and write away without any distractions. After that, I copy paste the stuff to VoodooPad, simply for the fact that I adore this software! And also that I need to save the file to a place from where I can write it to my backup discs.
So, yeah. I thought it was a prank at first, but it’s not! Microsoft will actually pay $1 to Universal for every Zune they sell. But unlike some who think that they’re doing it just to screw with Apple, I think what Mr. Gruber wrote here is the actual reason.
Microsoft is used to being the company which twists others arms, and is known to have made more than one cunning moves to gain market share for its products. This trend is so deep set, that when it’s actually Microsoft’s arm that’s being twisted, we don’t see it. Here, Universal is acting the bully. They see that Microsoft is in no position to bargain with them, and they impose a $1 per Zune as a payment to “offset the revenue lost due to music piracy”.
WHAT?? John Paczkowski raises a great question in his article here.
This is nothing more than sheer asshattery from the Universal, and other music label execs.
As Warner Music chief Edgar Bronfman Jr. said :
We are selling our songs through iPod, but we don’t have a share of iPod’s revenue. We want to share in those revenue streams. We have to get out of the mindset that our content has promotional value only. We have to keep thinking how we are going to monetize our product for our shareholders.
The music execs are really out for getting a chunk off of music players’ sales, and this deal of Universal and Microsoft just goes to show that these labels are out to get as much revenue off as idiotic reasons as possible!
This post from Khaled made me think about the way I write my CSS, have always written my CSS code. I follow the regular one element, one line approach for attributes with more than 2 elements, and a single line for 2 or lesser. I’ve found that the spacing helps me easily sort through files, and find some rogue piece of code.
However, structuring doesn’t end there. There is also positioning elements, comments, and such.
I usually start the file with a little comment, and don’t usually comment, unless some bugs are encountered, and obviously for the Holly Hack. ![]()
As for positioning, I’ve noticed people mostly alphabetize their CSS attributes, but I never found it comfortable finding a letter and placing codes…
I go from top to bottom. I mean, I follow the XHTML coding. I go from the first id or class encountered, to the last. I don’t even differentiate between ids or classes. I find having relative CSS codes next to each other a big help when it comes to debugging.
So, am I doing something anti-productive? What do you follow? I wanna know…
It’s been a couple of weeks since I’ve had my MacBook, and I’ve almost already forgotten my working style in Windows. Almost.
Anyways, a few observations I’ve made below:
Well, I’m back to some more Mac fun! I’ll think about something consructive to write later!
While I am Loving my new MacBook, I have a little gripe about the stereo speakers in them. I find them suitable only when you shove your ears into them….
After searching the net for a while (apparently, Google isn’t very happy about people “googling”), I found that I wasn’t alone with the problem. Shawn and Anatoli both said that their speakers were very weak. However, some people are supplied with decent ones, like Rob.
Anyways, after reading a few discussions, it seemed that the sound-card drivers provided by Apple are at fault for the lower than low sound. Some people said that the sound on Windows XP when using Boot Camp is much better, and some recommended Rogue Amoeba’s Audio Hijack Pro to get a better kick out of the generic speakers.
So, I gave it a go, and really, what a difference it made! With the right amount of tweaking, I had close to a 100% gain in volume, without losing any quality.
So, if you find yourself pining for a little breathing space around the ears, go try Audio Hijack Pro!
Ok, so, I stole a title from Kitta. Shut up.. It’s my day, and I’ll do what I like. Or not.
So, I’m officially 20. No longer a teen, an immature adult now.
Here’s to new blunders, new adventures, and new.. er.. things!
![]()
