| Subcribe via RSS

Can’t Access Facebook Developers Apps Page, Ad Manager Redirects

May 29th, 2013 | No Comments | Posted in Facebook

I’m always trying to figure out ways to simplify my life so I wanted to find a WordPress plugin that would post my content directly to Facebook. Should be simple enough right?

Well I was trying out Simple Facebook Connect and it of course needs a Facebook application ID & secret to post the data to my Facebook page. So I go to the main developers page, and it comes up without issue. The second I try to click on Apps in the nav bar, I get redirected to Facebook Ads Manager. Huh?

I try coming at this from every different angle, and the results were always the same. I even deactivated my advertising account to see if that would help. Nope. So after digging through the support forum, and digging some more, I finally found a post that turned on the light bulb in my head. The Facebook page in question is a page for a website that is connected to an email address that isn’t associated with a Facebook account.

When I try to login to my personal Facebook account, I can get to the Facebook Apps page and create the application ID with no problem. Would it really have been so hard for FB to throw up an error message or something to let us know what is going on instead of kicking in this perplexing redirect?

Changing the Name of a Business in Paypal

November 15th, 2012 | No Comments | Posted in General

Ok I admit that this post is a bit random. I needed to update the name of my LLC this evening in Paypal and their instructions for doing so within Help were ever so useless. I finally threw in the towel and went to email support and once I drilled down to define my issue I finally come across this link:


You have to be logged in to get access to this page, but its painfully simple to make this change once you are here. Too bad they bury it in their site.

Counting Characters in a String via C#

October 22nd, 2012 | No Comments | Posted in C#
So real basic one today. How do we count the number of characters in a string via c sharp? Pretty easily. We create a foreach loop and feed our string into it one character at a time. Within the loop, we increment our counter. Once we exit, iCount has our character count.

Embedding mySQL Insert Statement Inside Select While Loop in PHP

October 20th, 2012 | No Comments | Posted in PHP

Today we are doing a little getting our feet wet with basic PHP interactivity with mySQL. Usually I let WordPress handle the nitty gritty, but I have a need to add custom fields to posts in bulk so whipping up a quick PHP script seemed best. Let’s take a quick look at the code then I’ll break it down.

So line 2 is where we establish our mySQL database connection. Feel free to swap out your authentication values here. Line 6 looks at which mySQL database table we are going to be interacting with.

Line 10-16 sets our SQL Select statement. This Select connects up the WordPress tables to bring us back all posts that have a category ID equal to 1. The while statement at line 20 cycles through these post results. Line 22 prints out our results which I would suggest checking before you allow the insert block to do its thing.

At line 25 I’ve added a check to compare the current ID with the previous ID. The previous ID gets set within the if statement and this ensures that we aren’t making multiple inserts for revisions on the same post.

Line 29 accomplishes the actual insert of the custom field. Update these values to correspond to the data you are planning to insert. Lines 38-39 just kick back any errors that come up. So pretty straight forward. You could add an array to chuck custom fields in for multiple categories.

Using Custom Sidebars for Posts and Pages in WordPress

October 18th, 2012 | No Comments | Posted in PHP, WordPress

WordPress is great. It is a platform that gets you up and running extremely quickly. Yet for all its gains through ease of use, it will often fail in the ability to customize for your needs out of the box.

A good example of this is the sidebar element. Sometimes we want to throw up a custom view based on a particular post. Maybe we are advertising a seminar, and we want all of our education pages to relay this ad to our visitors. This message may not be appropriate to the other users of our site.

So this can be accomplished relatively easily with the aid of a small code tweak and the use of WordPress’ custom fields. Here is the code block that we will replace the standard get_sidebar() call in the single.php.

First things first. We need to get that custom field value, but we are in the post template file (single.php) so unfortunately we are outside of that main body content loop where we pull back all of the values for the post. Well by accessing the $wp_query to determine the post ID then we can fetch the custom field sidebar value we set within the post (code lines 2-5).

Now that we have our custom field value, we need to feed it into the get_sidebar() method. Basically you need to save out a second copy of the sidebar.php, make your appropriate changes then load it back to the server as sidebar-[custom field value].php. That way when we pass this value into get_sidebar() in line 8 it knows what file to look for.

Easy enough. Customize that sucker like crazy. You can do similar customization to your WordPress header and footer as well.

Helpful Query Terms & Operators for Google Search

May 2nd, 2012 | No Comments | Posted in General

Just like querying a SQL database, using Google is so much more helpful if you know the syntax to dig down and pinpoint exactly what you are searching for. Here are a few of the more helpful tools you can use to unearth the information Google keeps from you in your regular searches.

site:URL say you want to search for a term on a certain website and they don’t have a search function or frankly their search capabilities leave a little something to be desired. This should get you what you need.

intitle: Say you are looking for all webpages that mention certain keywords in the page title. Also helpful is the allintitle: which makes sure all the terms you are searching for are there.

allinurl: similar to the above but we are looking at terms in the URL instead of the title.

cache: say your favorite website has done a massive redesign overnight or you found this great article that was taken offline for whatever reason. If you happen to know the URL, you may be able to resurrect it via Google’s cache. Just be aware it may be gone the next time Google runs its indexing.

link: if you are a budding SEO and what to see who is linking to your competition this will get you started.

location: this is a helpful Google news operator. Say I want to find out who the Atlanta Falcons picked up in their undrafted free agent haul, but I only want sourced from Atlanta. This weeds out the national media hacks.

These are the ones I use most often. You can find a few more helpful operators via SEOptimise

Error when Opening VS.NET Project Moved to New Folder

September 8th, 2010 | No Comments | Posted in visual studio

So from time to time, you need to move a Visual Studio project to a new folder to do some new fun things with it — upgrading code, replicating a project or just because. Well when you do this VS.NET doesn’t like you too much because all its references were pointing back to that original folder. In my case, I got hit with errors two fold. The first:

The local IIS URL http://[XXX] specified for Web Project [XXX] has not been configured. In order to open, the directory needs to be configured. Would you like to create a virtual directory now?

Sure Visual Studio. Knock yourself out. You Ok through only to get hit with:

Creation of the virtual directory [XXX] failed with the error: Could not find the server [XXX]. Creating a virtual directory is only supported on the local IIS server.

Couldn’t you have just saved me the extra error message and spit that out to begin with? So our culprit is the .csproj file. Open that up in text pad and scroll to the bottom. Within the WebProjectProperties XML block, there is a UseIIS node. Flip that from true to false. Save it out and you should be good to go.

Err Msg: ‘Could Not Load Type _Default’ & ‘Server Application Unavailable’

February 5th, 2010 | No Comments | Posted in ASP.NET
I thought I’d lump these two together since they seem to be interrelated. So I’m doing development on a dev box I haven’t worked with in a while. I have a Visual Studio project that works like a champ on my box, but as soon as I load it up to the dev I get the error message ‘Could Not Load Type _Default.’ I was thinking it was a web.config issue so I tried to massage that for a while with no luck. I’d set up the application correctly in IIS so it shouldn’t have any issues accessing the dll in the local bin folder. What I hadn’t counted on was the two versions of the .NET Framework running on this box. This was a 2.0 app I’d developed and my current application was defaulting over to 1.1. Updated this under the application in IIS, and up it came. It didn’t stay up for long though as I surfed through my application and quickly hit a ‘Server Application Unavailable’ error. I threw this project into the 2.0 application pool and everything settled down.

Find All Cookie Values in a Given Application via ASP.Net and c#

January 14th, 2010 | No Comments | Posted in ASP.NET, C#

Cookies can be especially maddening at times if you don’t know what values are being stored within them. The following simple script is written in csharp and ASP.Net and allows you to see all of the cookies currently hanging around under a given application. Pretty handy when trying to fish yourself out of a problem.

Error Message: Could not find file ‘c:\windows\system32\inetsrv\System.Xml.XmlDocument’.

January 13th, 2010 | No Comments | Posted in XML

Someday I’ll free myself from the XML hell I seem to be mired in, but that day is not today. So I’ve got a fun new issue. The previous coder stored all the user entry values in session values without thinking about the fact that this won’t run correctly once it goes live in the web farm. So now I have to switch all those values over to be stored in the cookie and a few in the database that need to be secured. So in my haste to switch everything over, I ran across the error message “Could not find file ‘c:\windows\system32\inetsrv\System.Xml.XmlDocument’.” Huh? All I’ve done is try to store the Xml string into a XmlDocument object like so:

After pondering and tinkering with this for the better part of 30 minutes, it finally occured to me. The Load method of XmlDocument is used to access an Xml file on the server whereas the LoadXml method is used to load a previously defined Xml string. Popped that in, and it worked like a charm. Now what is my next error?