Check if a Javascript Function Exists Before Calling it

Sometimes for a reason or another, you may need to make sure a Javascript function exists or is accessible from your code, before calling it. That can be done through the following code:

[code]if (typeof yourFunctionName == ‘function’) { yourFunctionName(); }[/code]

We keep proving support to all our apps buyers !

This is a quick post to remind to all our buyers, or future buyers, that we DO provide a free support on all our products available on the codecanyon marketplace. We do it for a simple reason: we want all our buyers to be happy and fully satisfied with their purchase.

All our apps have a demo page, as a proof they are working just fine in normal conditions and we’ll be happy to help you out getting the app ou plugin running on your website if needed. To get support you would need to send us your request through the form situated on our profile page (in order to verify your purchase(s)).

Please also remember that support doesn’t include free customization. The free support we provide is to get the original app or plugin running. For anything else requesting some time, like customization (small or bigger) we’ll be happy to provide you with a fair price estimate on getting the job done corresponding to your own needs !

But remember to always ask us for support if you think anything is not working as expected. Don’t assume it’s broken, or that it will not work on your website. Here is an example of a buyer who posted a comment today saying that our YouTube for WordPress plugin wasn’t working with a popular WordPress Theme called “Avada“.

support-youtube-plugin-for-wordpress

 

After some quick checks on the buyer website, we were able to figure out the issue he was having, and fix it for him right away. We mostly request a link and admin access in the case of a WordPress plugin, and a temporary FTP access for an app, and in 98% of the cases, we are able to fix our buyers issues, since is important to offer a good service online, as other companies online do, that offer services from online purchases to insurance sell as One Sure Insurance.

So please feel free to contact us from our profile page, we’ll be happy to hear about you ! Also, make sure to check all the trainers to watch for cheltenham festival according to comparethebets, you will love their app.

How to create and configure a Facebook app

In order to create a new Facebook app, you need to navigate to this URL: https://developers.facebook.com/apps

Creating a new app
At the top right section of the page, locate the link “Create New App“. Once clicked you should get a dialog to complete some basic app information.

create-new-facebook-app

You need to specify your app name.

The App Namespace

The “App Namespace” is optional but we suggest you to specify one if you want to get your app accessible on Facebook through a URL of this type: https://apps.facebook.com/YOUR_NAMESPACE/

So let’s say that your app name is “Mind Reader Game”, and that you want your game to be accessible through this URL: https://apps.facebook.com/mind_reader_game/. You would need to define “mind_reader_game” as your App Namespace.

You can hit Continue to create your app. Facebook may require you to type-in a captcha code as a security check and to make sure you are human !

Your app general settings

Once your app created, you should get redirected to a page similar to this screenshot.

facebook-app-settings

First of all, you need to set the sandbox mode to disabled. Otherwise other users than you will not be able to connect or use your app.

Second, you need to define your “App Domain”. That should be the domain where you are running your app. Example: “yougapi.com”. Note that the App Domain cannot contain any “http://” in it.

If you are using a URL starting with www, then you need to define your domain name starting with a www. Example: “www.yougapi.com”. You can also define a list of several domains. Example: “yougapi.com” and “www.yougapi.com”.

We advise you to choose only one way to access your pages (using a www, or not using any www) and have only one App Domain defined.

Website with Facebook login

If you are running an app (PHP application for ex), that implements the Facebook connect feature like does, you would need to click on the “Website with Facebook login” section and define your “Site URL”.

Make sure to pay attention to the way your app will be accessed (using a www or without a www). Both ways are fine, but you need to be consistant. So if you access your PHP app without any www in the URL, then the “Site URL” defined shouldn’t contain any www in it.

The Site URL should start with an “http://” and be the full URL of your app. Here is an app example we are running: “http://yougapi.com/products/mind_reader/”, so the “Site URL” that we would need to define would be the exact previous URL. Easy isn’t it?

App on Facebook

This section is only needed if you want your app to be accessible on “https://apps.facebook.com/YOUR_NAMESPACE/”. If you have already previously defined your app namespace, you should see the URL of your canvas page where you app can be accessed on Facebook.

facebook-canvas-page

But if you navigate to that canvas page, you will notice that there is no content. The page is empty, and that’s normal since you didn’t define any canvas URL yet.

What is a Canvas URL

That’s simply the URL where you have the application or page, hosted on your server. In our case it’s hosted on “http://yougapi.com/products/mind_reader/”.

Two Canvas URLs need to be defined, one starting with “http://” and the other starting with “https://” for a secure access to that page. That’s one one the new Facebook requirement to enable all the Facebook users to be able to access your app on Facebook.com

We recommend to keep the height setting as Fluid, but for the width it’s up to you! We like using the fluid width to maximize the space and having less vertical scrollbars.

Once you have defined both Canvas Urls, you can access the canevas page, and be able to view you app there.

Here is how our final Facebook app settings looks like:

facebook-app-settings-final

You can access our Mind Reader Game in 2 different ways:
1. Directly on its URL: http://yougapi.com/products/mind_reader/
2. On Facebook.com: https://apps.facebook.com/mind_reader_game/

If you have any questions feel free to ask in the comments section !

Theme Pack and Theme Generator for jQuery Mobile

Was looking for some already built jQuery Mobile themes, and came across this great project called “Graphite” available at http://driftyco.github.io/graphite/. They’ve already built several minimalist and very good looking themes.

A demo is available on their website showing you the different theme colors you can use and allows you to get a feel of the theme through a functional showcase. Check it out since that could be useful if you want to save some time. For the purists who want to create their own jQuery Mobile themes from scratch you can use this great tool called jQuery Mobile ThemeRoller

 

graphite-jquery-mobile-themes

 

Why Facebook removed the ability to post on friends walls via Graph API

Facebook has disabled at the beginning of February 2013 the ability to post on friends wall through the Graph API. Here is the official announcement:

We will remove the ability to post to a user’s friends’ walls via the Graph API. Specifically, posts against [user_id]/feed where [user_id] is different from the session user, or stream.publish calls where the target_iduser is different from the session user, will fail. If you want to allow people to post to their friends’ timelines, invoke the feed dialog.

That method was enabling apps to present a visitor a list of his Facebook friends after he had connected with his Facebook account, select the friends the user wanted to invite, and hit a send button, and it would post the same message (that could be customized by the app admin for example) to all the selected friends.

Additionally, once a single user has given the correct permissions to a specific app, that app could post on behalf of that user, on all his friends wall, and that could be done in an automatic way. All these was generating too many abuses or pushing the invited friends to report the messages as spammy. We think that’s the major reason why Facebook has taken down that ability. And actually these new changes make sense.

So what’s now?

Now the only way to invite a friend is by using the Facebook Feed dialog. It’s not possible anymore to have an automatic system. The user need to manually invite each friend one by one. The user also has to define himself the message that he wants to post of his friends wall. The apps or plugins just have the ability to define the link and picture that can be posted with the message.

We just released our new WordPress plugin Facebook Friends Inviter that’s based on the latest Facebook updates. You can check a demo on this page and try it out for yourself. And our standalone version of the Friends Inviter should be available soon.

Facebook Friends Inviter for WordPress

 

So it’s still possible to have plugins and apps enabling visitors to invite their Facebook friends, it just need to be done in a whole different way. We have totally rewritten our Friends Inviter WP plugin to reflect the new changes, and have giving it the additional feature to make it work as a content locker.

We hope you’ll like it !

A basic app to check Facebook Apps statuses and get some stats

We just finalized the creation of a simple and straight forward app for a customer. You can check it out here: http://yougapi.com/products/fb_app_status/

Fb_app_status_checker

 

Features
– Ability to define the apps ids and names from the config file
– Caching is supported to avoid calling the Facebook API too many times
– The caching can be disabled from the config file, and the caching duration can be customized
– Get the daily and monthly app users

Here is how the results returned from the Facebook API with an app information looks like, you can check it at this URL: https://graph.facebook.com/167907536582421

NHP Options Framework for WordPress

Before starting talking about the NHP Options Framework, let’s talk a bit about some history.

As you may know we have created several WordPress plugins over the last months. Most WP plugins need a settings page, where the admin can set his settings data (it could be the Facebook app id and secret for a Facebook plugin for ex, some customization data, it can be anything a plugin needs to run properly…). We started by creating our own setting page, and trying to standardize it the best we could, to enable us to reuse some codes and save time when creating other plugins.

Then we started working on our own WordPress plugin framework, mostly focused on the settings page (that has even a color picker), that was using AJAX to save the settings data, and also had some other useful functions and hooks, saving us some time. It was like a blackbox, loosing some flexibility overall though… and since we are not focused on design, the look and feel didn’t really satisfy us.

Recently we did some research about frameworks, or better ways to have a plugin settings page. We finally decided to use the “NHP Options Framework for WordPress“, that has the looks and feel we want, and enough flexibility to manage all the settings we need in our plugins. We still need to figure out some stuff, but overall and after updating 2 plugins using this framework, we are very satisfied with the results.

Now we don’t really see a big issue in having some hooks repeated, if there are very clear, and easy to reuse. There is really no need to have a blackbox for everything, if we loose too much flexibility. There is a balance to find.
senihome.com