Enthusiast 3.1.5 fixes

Posted by Masao on 2016.04.12 with 4 comments // filed under: This Week in Code

First of all, I want to say, oops sorry for disappearing. Let’s just say I got distracted playing Dragon Age Inquisition.

This post is mostly focused on Enthusiast, the most popular fanlisting management script used. A few days ago, I woke up to about 10 inactivity emails from TAFL/TFL about my fanlistings being more than two month out of date, which was a surprise, because I had just checked my Enth dashboard the day before. After tweeting about it, a friend told me that it’s been happening to others, and they had to mess around with the script to change the inactivity warning time.

I looked into the code, and tried that, but it wasn’t getting all my fanlistings that were clearly out of date, so I ended up rewriting the portion of the code that checks for inactivity. The old way was done by using PHP’s date() function to figure out which sequential week of the year a particular fanlisting’s last update date was, and checking if it had more than 8 difference to the current sequential week of the year. For whatever reason, it wasn’t consistent, so I rewrote it instead comparing the difference between the two dates in the number of days between them.

It’s not a full tutorial because it’s basically just some search and replace or move lines around.

If you’re using Enthusiast 3.1.5, I highly recommend applying this fix, so you don’t have to worry about your dashboard not warning you.

View the instructions on pastebin / github gist.

I’ve been working on a syntax update for Enthusiast, but until that’s done, it’ll just be a few fixes here and there. There’s a bug in the disabling country field for fanlistings that I fixed, but still need to be fully tested. I’ll link it here later when it’s been tested by more people.

PHP: Dynamic Navigation/Page Title

Posted by Masao on 2015.11.03 with 1 comment // filed under: This Week in Code

Oops, so I wrote this bit of code months ago, but got lazy about writing the actual tutorial. Basically, if you don’t want to install a CMS and just want to have dynamic/variable page title or navigation highlight, where your current page is displayed differently in the navigation, so that your visitor knows which menu item they are on.

First, you want to grab the page name, be it page.php or index.php?page

	$url = $_SERVER['REQUEST_URI'];

Then we need to parse it, depending on if it’s just page.php, or it has a query string (aka the stuff after the ? in page.php?query or page.php?q=query).

	if (strlen($_SERVER['QUERY_STRING']) > 0) 
		$page = (strpos($url, "=") > 0) ? (substr($url, strpos($url, "=") + 1)) : (substr($url, strpos($url, "?") + 1));

In the if statement, we are testing if the length of the query is greater than 0, so if there is a query, presumably it will be greater than 0, after which we need to determine if it’s page.php?query or page.php?var=query (var being anything).

Continue Reading

DIY Wooden Monitor stand

Posted by Masao on 2015.10.31 with 8 comments // filed under: A Day in the Life

I’ve been kind of obsessed with these ever seeing some really sleek looking ones on sale on Etsy, but the price was more than I could justify spending. So when I found some DIY guides on how to make some, I jumped on the chance.

I got the supplies from IKEA and Home Depot.

And of course, you’ll need a drill, as electric drills will make this easier. The stuff I got from IKEA cost about $20, including the cheap pack of brushes, and the stain supply plus rags and paint thinner cost about $30. Not as cheap as I was hoping, but the experience was well worth it. Staining the wood was the best part. And now that I have the supplies, if I happen to find better wood in the future, I can just replace the cheap $3.99 Ekby Tryggve I got, stain the new piece, and screw the legs on again. Natural wood would be extra fancy, but even an untreated wood with gloss would look nice.

All in all, I am very happy with the results. I don’t have an excuse to slouch anymore, because I’d need to sit up straight if I want to see my monitor at the right angle.

When the holidays roll around, I want to get a new monitor, my old 20″ monitor is smaller than I’d like, and I’ve had it for years. I really want a 23″-24″ one.

Continue Reading


Posted by Masao on 2015.09.19 with 4 comments // filed under: A Day in the Life, Sitely Matters

Oops, I let life kind of kick this blog on the back burner again.

The short life update is, I did finally get a job, and most of my time has been consumed by that. The whole early morning and doing the 8-5 thing is still something I need to get used to, ’cause when I get home I unfortunately don’t want to do much.

As for tutorials, believe it or not, I wrote up a script for a tutorial almost a month ago, but I’ve been dragging my feet on writing the actual post.

What prompted me to finally log in and make this post is the official shutdown of Kippt, which was a serviced I loved using to keep track of all my resources and interesting tutorials and such. Since that’s no longer a thing, I think it’s time I make a schedule for myself and get working on the Delicious clone I’ve been planning for some time, since I can’t find a better alternative besides pinboard.

Anyway, I’ll get working on finishing that tutorial soon.

Residue of Student Woes

Posted by Masao on 2015.08.13 with 8 comments // filed under: A Day in the Life

Ah the dreaded student loans. Yes, unfortunately I have some. I graduated in June, but I’m still job hunting, and waiting to hear back from the few places I did well interviewing. In June, I got hit with a loan payment, due a few days after my graduation commencement date. I paid from the last 2-3 months of paychecks from my school job, sans whatever I had to fork over for tuition.

I was pretty annoyed they hit me with a payment the month I was graduating, not even giving me a bit of time to find a job first. But strangely enough the next month, in July, they did not bill me. I thought maybe they were getting the deferment back on schedule.

But to be safe, I regularly checked my account, and still it said I owed $0.00 for my next payment. The last time I checked was earlier this week. Still the nice $0.00 due.

A few minutes ago I got an email from MyFedLoan telling me I have a bill. I was disappointed but hoped they were billing me for September, but nope, around past 11 PM, on August 13, 2015, they wanted me to know I had a due payment on August 15, 2015, a Saturday.

If I hadn’t hooked my email up on my phone, maybe I might have missed the email until late Friday night, or even Saturday, thereby missing a payment.

I just can’t believe they have a system in which they would alert you 2 days before your payment was due that you in fact had a payment.

Who ever came up with their system sure has a great big heart.

I hope I’m not making a big deal out of this, but I do think it’s extremely unfair they notified me out of the blue, on such a short notice when the previous month I was still in deferment. I don’t even want to think about the consequences of me failing to pay because I didn’t realize I had a payment due.

I’ll pay my loan off ASAP as soon as I land a job, but until then, it would be nice if I could be treated with an ounce of respect from them, but that’s probably too much to ask.

Creative block

Posted by Masao on 2015.07.07 with no comments // filed under: Projects

Well, I totally see why CSS frameworks are so popular, because if you’re spending so much time figuring our how your application should look, it’s stopping you from coding the functions side.

And that’s where I’m stuck on. I’m not too sure how I want the webring to be set up and for it to look like, so I’ve been messing around with that.

Otherwise though, sad to say not a whole lot is going on. Just lazy bug :(


Posted by Masao on 2015.06.18 with 2 comments // filed under: A Day in the Life, Projects

Sorry for the lack of updates; basically the last stretch before graduation took over my life and I was spending most of my time on campus working on assignments. I’m all done now though, and I should be getting my diploma in the mail. I may or may not have a job already, but it’s not 100% for certain yet.

Anyway, this does mean I don’t have any more real distractions, so I’m going to be trying to get a schedule up for things I want to complete and also post about. I still need to work out some stuff before I make my senior project github repository public, but in the mean time I did start one public repo (a php webring script).

I’ll be working on that project and also do some related posts here, as a way to document my process. I still have a lot of nostalgia for those types of scripts, and a lot of the old ones are now no longer around. I doubt many people will use them, but it’ll be a good practice to write them anyway.

What OS are you running?

Posted by Masao on 2015.05.16 with 7 comments // filed under: This Week in Code

Are you using Windows, Mac OS X, or Linux? And the second question I’d ask is, are you interested in learning basic programming?

If you’re using Linux, chances are, you already know some basic programming. If you’re using Mac OS X, which is Linux-based, you can easily code and compile your programs, too. If you’re using Windows though, you’ll have to jump through some hoops to accomplish the same thing, but it’s definitely doable.

I have a Windows desktop and a Macbook Pro. I code mostly on my Macbook Pro. And the biggest reason is the Terminal. Before I started studying Computer Science, command line stuff scared me, and I preferred doing everything through a graphical interface. Now that I’ve used a lot of command line stuff, for a lot of things I prefer running things command line instead of through a graphical user interface.

If you’re using Linux or OS X, you can easily code in C and C++, but if you’re running Windows, you might have to install some extra programs just to get that running.

I would prefer to do tutorials in C++, but most people probably would prefer PHP. It’s just C++ is easily transferable because so many other languages are based on C, so once you know the foundation, it’s easy to apply it. Another reason is C/C++ is more powerful than PHP and has strong data typing, which makes for better foundation than weak data typing in PHP.

So I guess what I’m getting at is if enough people have OS X, I’ll do tutorials in both PHP and C++, otherwise I’ll stick to PHP.

Balancing Act

Posted by Masao on 2015.04.29 with 4 comments // filed under: A Day in the Life

Oops, I let school and life take over a little too much. The short version is I’m on my last quarter of classes and I’ve got 3 weekly labs, homework, and 2 quizzes a week, and a senior project I’m kind of procrastinating on.

The computer science department usually gets its share of weird people, and most of them are fine, but being a tutor and having to deal with all of them can sometimes be a pain. Unfortunately the number of guys who smell funny is getting to me. And what’s more annoying are the people who put zero effort in learning how to code, but will go to the walk-in lab expecting tutors to write their homework for them…

It’s dealing with all that which can make you appreciate people who do take it seriously and learn and do well.

But in general, this all makes me think, “do these people think this will work out in the real world?” No one’s going to hold your hand if you’re not willing to put the effort in yourself. Worst yet are the people who straight up just copy and leech off people. Those losers who will sit close to you and literally copy every line of code you write, until you catch them and move to a different seat. If you need help, ask. Don’t just crane your neck over and spy off people’s computers.

What’s on my phone

Posted by Masao on 2015.03.29 with 12 comments // filed under: A Day in the Life, Geek Culture

Last December, I finally got my wish and upgraded to owning a smart phone. I’m still kind of in that “let me show you my baby” phase, so bear with me. Anyway, I’m always interested in seeing what people decorate their phones with. I get kind of crazy with custom icons, even on my PC.

I own a Samsung Galaxy S5 in white, with this pink case by Caseology. I’m using CM Locker for my custom lockscreen, Zooper Widget for the home screen clock, and LINE DECO for the icons. And my Kaworu charm is from here.

I’m a huge EXO fan, and my bias is D.O., so my lockscreen and home screen are both promo images of him from their new album EXODUS. Speaking of which, all the teaser trailers look really well-done. I really can’t wait for the full MV release. I already cracked and pre-ordered the album.

Apps I use a lot are: LINE Messenger, Any.do’s Cal, Instagram, Twitter, VSCO Cam, SwiftKey, and Textra as my SMS replacement.

Processed with VSCOcam with hb1 preset

Continue Reading