Using Wordpress (with some modifications) as a CMS

January 17th, 2008

For a long time one of the things I’ve liked about Wordpress is it’s flexibility. I recently did a project for Savvydog Design for one of their clients: the National WASP WWII Museum - that involved doing some customizations to Wordpress. They wanted most of the pages on the site to be editable (I used Wordpress’ pages functionality here), they also wanted to be able to enter in news items (these would be standard blog posts with a category of “news”), as well as be able to enter in events (these would also be standard blog posts with a category of “events”). They wanted the home page of the site to show some (editable) content at the top, and then list the last 3 news or event items. On the side bar, they wanted to be able to list the next 3 upcoming events. Here is how I put it all together:

*Please note - some of the customizations take a few things as assumptions - (for example how you have your permalinks set up, etc.) So if you use any of this, do so at your own risk (most especially the part about editing a core Wordpress file - I’m sure I’ll get heat for that from SOMEONE.) Your mileage may vary, and I don’t guarantee this will work with your setup, yadda yadda yadda…
Read the rest of this entry »

Some CubeCart 4 minor mods (including select box image changer)

January 5th, 2008

I’ve now used CubeCart 4 for a number of clients recently, and I have to say I’m pretty impressed. As with any cart - the features still have to match your needs, but for the most part, the clients I’ve implemented this for were able to get the features they had wanted. Then add in a few mods, and we’re in even better shape. I also want to mention that CubeCart 4’s support has been fantastic! Great customer service, helpful responses, with reasonable response time. They’re in a different time zone than me, but normal requests would be answered within a day - when I had a critical issue it was responded to within a few hours that same day. And as before, customizing their template has been pretty painless. I’ve been really happy with them and they’ve moved up to the top of my recommended list for cart software.

So to get things working just so with a few of my recent implementations, here are a some tricks I did: (Some of these little hacks were actually given to me by CubeCart’s support, although they do specifically say they don’t support changes to core application files.)
Read the rest of this entry »

Google labels Scriptygodess as pariah

December 8th, 2007

A note to anyone brave enough to come here from Google: Scriptygoddess never has (and never will) distribute malware. I honestly have no idea where they got that idea from, unless this is their retribution for me pissing about their business practices previously.

All paid links have been removed from this site for some time now. The only ad on this site besides Google’s own adsense (which I make crap from by the way and will now probably just remove entirely) (Google’s ads have now been removed. If I’m not making money on this site, then neither will they) is an ad for the hosting company I personally use and have been recommending to people because I think they’re a good hosting company. (HostICan (now called “HostISuck” in my house) ad has been removed. I’ll probably make a post on them too soon) I have NEVER distributed malware. Never. Not once. So where they got that idea from is completely fabricated and a total lie.

You should know that I make NO money off this site now. It is purely a public service and information personal storage house.

I have asked for a reconsideration from Google, and they say that may take some time. (as in several weeks) Heh. I would greatly appreciate anyone’s/everyone’s help in this matter. Please make a post on your site that Scriptygoddess is alive and well and DOES NOT DISTRIBUTE MALWARE, despite the lie that Google tells.

update: So after further investigation, it seems my site had been hacked and in such a way that made it hard for me to even notice. A hacker was able to add a line of code to one of my template files and from the way it was written it seemed it wouldn’t even have shown up in the html unless you were specifically coming from Google. Google is supposedly in a war against spammers and hackers, and in their fight I guess they don’t mind punishing some victims as well. (How noble of them.) =puke=

The strange thing is that I am running the latest version of Wordpress, I am (obviously) not even using a customized template, I am using VERY FEW plugins… so now I’m left wondering what the deal is with Wordpress - or the few plugins I have running, that would allow the hack to go through. I’ve been searching around online to try and find more information, but I’m not getting anything back specific. (What I HAVE seen on the forums seems like a lot of defensiveness to me. People saying they have some kind of XSS hack on their site, and then other people trying to put the blame elsewhere) I’ve sent a few emails to a few Wordpress people - but haven’t heard back. This is distressing to say the least. I love Wordpress, but if it means having my site get hacked without my even knowing it and then getting banned and labeled by Google as a malware distributor… I don’t know…

Update: 12/18/07 - FINALLY! Google has lifted the “malware” curse on Scriptygoddess. Guess that was my belated Hanukkah present. Good thing too - because I’ve been very busy the last few weeks - have a post due probably after the holidays about a cool site I did using Wordpress - all kinds of custom templates for posts and pages, and basically stretching Wordpress’s CMS ability. As well - I did a very cool site using CubeCart and I have a few things I learned from that experience to post about. Stay tuned…

(oh, also, - seems I got a PR push as well - from a 3 to a 5. Of course, I used to sit comfortably at a PR6 - but I’ll take what I can get. LOL!)

Next Previous Posts in Same Category

December 4th, 2007

I’ve gotten a few emails about my (old) Next/Previous Post in Same Category plugin and about the fact that’s its broken - however, this functionality is now built into wordpress. (and I have it working on the site right now as a matter of fact). I’m a bit behind on what has been included with each new version of Wordpress, so I’m not sure when this made it’s way in there, but.. YAY! Now I don’t have to update the plugin! LOL! So, in any case, if you want to include links to the next/previous post in the same category as the one being viewed, you just need to do this (on the “single.php” template page INSIDE the “Loop“)

<?php previous_post_link('&laquo; %link', 'Previous post in category: %title', TRUE); ?>
<?php next_post_link('%link &raquo;', 'Next post in category: %title', TRUE); ?>

Where the first argument (where I have “&laquo; %link”) is the format of what is displayed… ie. if you want text before or a tag around the actual link (represented by “%link”) this is where you say how you want it to show.

And the second argument (where I have “Previous post in category: %title” is the text of the actual link. You don’t have to have the “%title” in there - but I think it’s useful) :)

Code to make a button in Flash link to another URL

December 2nd, 2007

This is only just a small snippet of code and probably won’t be totally helpful unless you have a fairly good idea what you’re doing. I would make a full tutorial, except *I* don’t have a complete understanding of what I’m doing. LOL! I know just enough in Flash to be “dangerous”.

In any case, from what I can tell, in the latest version of Flash, there is a new way to make a button link to a URL. Instead of creating an action on the same layer as the button, you need to assign an instance name to your button. Then in another layer you have all the code for your buttons - similar to the following:

function gotoYahoo(event:MouseEvent):void
{
var mylink:URLRequest = new URLRequest("http://www.yahoo.com");
navigateToURL(mylink, "_self");
}
buttonInstanceName.addEventListener(MouseEvent.CLICK, gotoYahoo);

(If YOU know more about Flash, and have any corrections - they would be very welcome in the comments. I know how to do simple animations (like slideshows) and simple buttons - but beyond that I’m still in the very early learning stages)

Change class name assignment with javascript

December 1st, 2007

Example:
<div id="mydiv" class="current">Content</div>

To change class assignment:
document.getElementById('mydiv').className = 'notcurrent';

To remove the class assignment:
document.getElementById('mydiv').className = '';

Clean up…

November 5th, 2007

Trying to do some clean up here - there are files on this site still from my movable type days. So going to do a fresh start and removing a lot. The design will probably end up being the boring default for awhile once I’m done… hopefully will get the chance to get a real design up, but at the moment, as work has gotten busier and busier for me, this site is increasingly becoming the example of the saying: “the cobbler’s children have no shoes”.

Updated 11/8/07: Adding a few plugins, etc. here and there. I really am having trouble deciding on where I want the design to go on this site. No matter what I come up with, I’m not happy. LOL! In any case, in the meantime, I’ve added the ability for users to register on the site, so if you tend to leave a lot of comments (*cough*Ajnabiz*cough*) now you don’t have to complain to me about entering your user info each time. ;-)

That feature has been removed. If you comment here a lot let me know and I’ll create an account for you. Otherwise, until Wordpress has an ability to approve users before allowing them to register on the site, I’m not adding this back in. I know that users who register can’t do anything but edit their own profile, but for some reason, the register/login form is becoming of interest to spammers.

Pagerank

October 28th, 2007

So I’ve seen a few blogs talking about how Google is now punishing sites that sell link advertising, by downranking their sites. I’ve now seen this firsthand on scriptygoddess. It used to have a page-rank of 6 - and now it is a pagerank 43. I’ve seen other sites (good sites with good content) get downranked.

I know I’m probably stating the obvious - but I think its outrageous that Google wants to hurt sites that have good, valueable content, just because they’d like to make some cash for their work. What exactly is “wrong”/”bad” by my making some money for my effort? For a long time I had scriptygoddess remain up, and posted information I had learned - out of the goodness of my heart. But when I started working for myself to help make ends meet - it made sense to put up advertising on the site to help that end as well. I tried to be clear about which links are sponsored links. While it would have been lucrative to use those “inline” advertising links (where they link text right in your own post to advertisements) I didn’t go that route because I felt it gave a bad user experience. Some links were intentional - and others were advertising and how could you tell the difference without mousing over or clicking on it? Annoying.

The biggest joke of all this, is of course, Google isn’t punishing sites that ONLY contain GOOGLE advertising (which, by the way, pay the least/worst of any advertising I’ve contracted with)

On the whole, and up until now, I thought Google’s been a pretty cool company but this move is just plain bad. Back before the dot-com bust - many sites were designed to draw revenue strictly from advertising. The business models didn’t work out quite right - but I think I’ve been seeing a revitalization to that idea - the right advertising can support a website. And what is Google trying to do? Completely smush it and stop progression.

And I think it will eventually come back to bite them. I’ve found recently that when doing searches strictly through Google, I’ve found myself going back through their pages a lot more than I used to - and in some cases never finding what I had needed to. So by downranking sites with valuable information, they’ve pushed them further back in the list of pages, and maybe in some cases, pushing some sites so far back that you’d never find them *making their own search engine not as useful as before*.

I hope they re-think this idea.

Edited to add: The more I think about this, and the more I read, the more I have to laugh. Google is playing “link-police” from what I understand because their complaint is that selling links puts less-relevant sites up on top when you do searches - and that you’re not allowed to “buy” that position. Right. That’s why when I do searches on Google, top of the page, and all along the side are links for sites that BOUGHT that position. So really what they’re saying is it’s only ok when you’re paying GOOGLE. *no one else should be making money* except for them. I think it’s definitely time to change my default search engine!

document.getElementById … has no properties

September 3rd, 2007

This isn’t a big deal, but it was something I was fighting with for a bit. If you’re trying to set the properties of a DIV via javascript, and you’re getting the “document.getElementById(”mydiv”) has no properties” javascript warning, there’s probably two big things that will cause it.

1) you didn’t set the id.
Go back and make sure your div has id=”mydiv” (or whatever you named it) in there.

2) the javascript is running BEFORE the div has been defined in the code.
This is what got me. I had the javascript code just above where the div was… and at load time, that div doesn’t exist yet… the browser hasn’t gotten that far down the page yet, so as far as it’s concerned, that div with that id, doesn’t exist. Once I moved the javascript BELOW the div… all was well.

And actually here - they suggest calling it on onload.

Kudos to W3Schools

August 18th, 2007

Whenever someone asks me for tutorials on one thing or another, I think the first link I send them is w3schools. Recently, one of my clients was asking if I could do XSLT to format their XML document. I’ve heard about XSLT, I even get the basics of XML, and or course I understand HTML and CSS… but I didn’t know how they all fit together. I did a quick little tutorial on their site, and now everything clicks into place. Sure, I’m no expert yet, but I think I have a solid enough understanding to do what they want. I know there’s other good tutorials out there for web technologies (feel free to post some of your favorites in the comments) - but for having only a few minutes this morning, they gave a really good explanation that put everything into place for me.