Latest Updates

View More Articles

Saturday, October 18, 2014

How to integrate DoubleClick for Publishers(DFP) ads in HTML5 Application

1. jQuery implementation for Google DoubleClick for Publishers (DFP)

First Download jQuery DFP Plugin Here

Ad unit tester
You can use this page to test your DFP ads using the jquery.dfp.js script. There is some debug code included to help debug the ad delivery.

You can also use the Google Console to debug your ad units. This is done by by adding a "google_console=1" or "google_debug=1" to the url, and toggling the console by pressing CTRL + F10.

Placement Setup
You can add ad units to your page in any location that you would like to display an ad.

By default this script will look for ad units with a class of adunit but you can of course use jQuery selectors as well.

The minimum information required for an ad unit to function is having the ad unit specified. To do this you can use the id parameter of the element, for example:
You can add ad units to your page in any location that you would like to display an ad.
By default this script will look for ad units with a class of adunit but you can of course use jQuery selectors as well.
The minimum information required for an ad unit to function is having the ad unit specified. To do this you can use the id parameter of the element, for example:
<div class="adunit" id="Ad_unit_id"></div>
In the example above the ID of the div element will be used to look up a corresponding ad unit in DFP and the dimensions of the adunit will be set to the same dimensions of the div which could be defined in your CSS.
You can optionally specify the adunit name and dimensions in the following way:
<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176"></div>
This method can be useful for including multiple copies of an ad unit with the same name which when part of a DFP placement will then pull in as many different creatives as possible.
You can also specify multiple dimensions sets:
<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176,450x500"></div>
Also you can optionally specify custom targeting on a per ad unit basis in the following way:
<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176" data-targeting='{"city_id":"1"}'></div>
Also you can optionally specify custom exclusion category on a per ad unit basis in the following way:
<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176" data-exclusions="firstcategory,secondcategory"></div>
To create an out of page ad unit set the data-outofpage property on the ad unit. Dimensions are not required for out of page ad units.
<div class="adunit" data-adunit="Ad_unit_id" data-outofpage="true"></div>
In order to identify an add unit on the page that is a video companion ad, set the data-companion attribute on that unit.
<div class="adunit" data-adunit="Ad_unit_id" data-dimensions="393x176" data-companion="true"></div>
For More details See here
Using DoubleClick for Publishers (DFP) to Deliver Ads on apps
Delivering Mobile Rich Media Ads to Mobile Apps
 How to integrate ads into a hybrid application

Friday, October 17, 2014

SEO advice : How to build canonical url ?

 I want to talk a little bit about canonicalization, www vs. non-www, redirects, duplicate urls, 302 “hijacking,” etc.

What is a canonical url? Do you have to use such a weird word, anyway?
Sorry that it’s a strange word; that’s what we call it around Google. Canonicalization is the process of picking the best url when there are several choices, and it usually refers to home pages. For example, most people would consider these the same urls:
But technically all of these urls are different. A web server could return completely different content for all the urls above. When Google “canonicalizes” a url, we try to pick the url that seems like the best representative from that set.

How to Setup

Simple Open your .htacces file vai any ftp client application and add the flowing code :

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# END 
Note : This will add "www." even if there is already a sub domain.

Thursday, September 18, 2014

Getting Started with GitHub Setting Git Repository in Windows

Today in this article will walk you through three different approaches: Shared File System Hosting, Git Protocol Hosting, and SSH Hosting.
Setting Up Your Repository
Before choosing which hosting strategy you’d like to use, you’ll first need a git repository to share.  The following steps will walk you through setting up an empty git repository.

Download the latest version directly from

For reference, here are the dialogs presented by the wizard:

Step 2 – Create a Bare Repository
With this step, we’ll be creating an empty repository for a sample project named ‘sample’.  Since we’ll only be using this repository remotely, we’ll be initializing a folder as a ‘bare’ repository, which means that git will place all the files git needs to manage the repository directly within the initialized folder rather than in a ‘.git’ sub-folder.  To create the repository, follow these steps:

Using Windows Explorer, create a folder somewhere on the server where you plan to store all of your repositories (e.g. C:\git\).
Within the chosen repositories parent folder, create a sub-folder named ‘example.git’.
From the folder pane of Windows Explorer, right click on the ‘example’ folder and select ‘Git Bash Here’.  This will open up a bash shell.
At the command prompt, issue the following command:

 git init --bare

Shared File System Hosting
Hosting a git repository via a shared file system is by far the easiest way to get started sharing a git repository.  Simply share the main git folder where you created the ‘example.git’ repository and grant full control of the contents.  Once you’ve set up the desired level of access, users can clone the shared repository using the following command:
git clone \\[repository server name]\[share name]\example.git

Git Protocol Hosting 
 Git supplies its own ‘git’ protocol for simple hosting purposes. To host an existing repository using the git protocol, you can simply issue the following command from the hosting server:
git daemon --base-path=C:/git --export-all 
This will host all repositories located in the folder C:/git as read-only. To allow push access, add –enable=receive-pack:
git daemon --base-path=C:/git --export-all --enable=receive-pack 

Git Protocol Hosting

Git supplies its own ‘git’ protocol for simple hosting purposes.  To host an existing repository using the git protocol, you can simply issue the following command from the hosting server:
$> git daemon --base-path=C:/git --export-all
This will host all repositories located in the folder C:/git as read-only.  To allow push access, add –enable=receive-pack:
$> git daemon --base-path=C:/git --export-all --enable=receive-pack
This is fine for situations where you want to temporarily share a repository with a co-worker (e.g. when working on a feature branch together), but if you want to permanently share remote repositories then you’ll need to start the git daemon as a Windows service.
Unfortunately, it doesn’t seem Microsoft makes installing an arbitrary command as a service very easy.  Windows does provide the Service Control utility (e.g. sc.exe), but this only allows you to work with Windows service applications.  To resolve this problem, a simple .Net Windows Service application can be created which performs a Process.Start() on a supplied service argument. 
 Once you have the service compiled, create a batch file named ‘gitd.bat’ with the following contents:
"C:\Program Files (x86)\Git\bin\git.exe" daemon --reuseaddr --base-path=C:\git --export-all --verbose --enable=receive-pack
You can then register the gitd.bat file as a service using the Service Control utility by issuing the following command (from an elevated prompt):
sc.exe create "Git Daemon" binpath= "C:\Utils\ServiceRunner.exe C:\Utils\git-daemon.bat" start= auto
To start the service, issue the following command:
sc.exe start "Git Daemon"
After successfully starting the Git Daemon service, you should be able to issue the following command:
git clone git://localhost/example.git

Registering Git Daemon With Cygwin

As an alternative to using the Service Control utility, you can also install any application as a service using Cygwin’s cygrunsrv command.  If you already have Cygwin installed or you’re planning on using Cygwin to host git via SSH then this is the option I’d recommend.  After installing Cygwin with the cygrunsrv package, follow these steps to register the git daemon command as a service:
Step 1: Open a bash shell
Step 2: In a directory where you want to store your daemon scripts (e.g. /cygdrive/c/Cygwin/usr/bin/), create a file named “gitd” with the following content:

c:/Program \Files/Git/git daemon --reuseaddr                 \
                                 --base-path=/cygdrive/c/git \
                                 --export-all                \
                                 --verbose                   \
Step 3: Run the following cygrunsrv command to install the script as a service (Note: assumes Cygwin is installed at C:\Cygwin):
cygrunsrv   --install gitd                          \
            --path c:/cygwin/bin/bash.exe           \
            --args c:/cygwin/usr/bin/gitd           \
            --desc "Git Daemon"                     \
            --neverexits                            \
Step 4: Run the following command to start the service:
cygrunsrv --start gitd

SSH Hosting

Our final approach to be discussed is the hosting of git repositories via SSH.  SSH (which stands for Secure Shell) is a protocol commonly used by Unix-like systems for transporting information securely between networked systems.  To host git repositories via SSH, you’ll need to run an SSH server process on the machine hosting your git repositories.  To start, install Cygwin with the openssh package selected. 
Once you have Cygwin installed, follow these steps:
Step 1 – Open a bash shell
Step 2 – Run the following command to configure ssh:
ssh-host-config -y
For later versions of Windows, this script may require that a privileged user be created in order to run with elevated privileges.  By default, this user will be named cyg_server.  When prompted, enter a password for the cyg_server user which meets the password policies for your server.
Step 3 – Run the following command to start the sshd service:
net start sshd
You should see the following output:
The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.
The sshd service should now be up and running on your server.  The next step is to choose a strategy for allowing users to connect via SSH.

User Management Strategy

There are two primary strategies for managing how users connect to the SSH server.  The first is to configure each user individually.  The second is to use a single user for your entire team.  Let’s look at each.

Individual User Management

SSH allows users configured in the /etc/passwd file to connect via SSH.  Cygwin automatically creates this file when it first installs.  To add additional users (e.g. the user ‘bob’), you can append new records to the passwd file by issuing the following command from a bash shell:
mkpasswd -l | grep ‘^bob’ >> /etc/passwd
This command adds an entry for a user ‘bob’ by doing the following:
  • run the mkpasswd command for all local users
  • select only entries starting with the string ‘bob’
  • append the entry to the /etc/passwd file
To see the new entry, you can ‘cat’ the contents of the file to the screen by issuing the following command:
cat /etc/passwd
This should show entries that look like the following:
LocalService:*:19:544:U-NT AUTHORITY\LocalService,S-1-5-19::
NetworkService:*:20:544:U-NT AUTHORITY\NetworkService,S-1-5-20::
By adding the new entry to the /etc/password file, the user ‘bob’ will now have access to access git repositories via SSH.  To clone a repository, Bob would simply need to issue the following command:
git clone ssh://DevMachine/git/example.git
At this point, Bob would have to enter his password as it is set on the server.  I’ll show you how to avoid typing the password a little later.
One downside of this setup, however, is that the user ‘bob’ will also have access to shell into the machine by entering the following command:
ssh DevMachine
If the user bob already has an account on the machine, this probably isn’t an issue.  However, not all users in the /etc/password file are necessarily accounts on the local server.  You can also add network users by issuing the following command:
mkpasswd -d [domain name] -u [user name] >> /etc/passwd
In this case, you may want to restrict what the user ‘bob’ can do to just issuing git commands.  You can do this by changing bob’s default shell entry in the /etc/passwd file from /bin/bash to /usr/bin/git-shell.  The git-shell is a special shell which restricts access to just a few git commands.  Trying to ssh into a server where the shell is set to git-shell will print an error message.

Single User

Another strategy that is a bit easier to manage is to use a single user for all team members.  At first, this might seem like you’re just throwing up your hands and opening up access to everyone, but this isn’t actually the case as we’ll see shortly.
To use this strategy, follow these steps:
Step 1 – Global User Creation
First create a new user to be used for git access.  I’ll call the user ‘git’ for our example. 
Step 2 – Configure SSH Access
Now, configure the ‘git’ user to have access to shell into the server:
mkpasswd -l | grep ‘^git’ >> /etc/passwd
Step 3 – Change Shell
Optional, but it’s a good idea to set the git user’s shell to the git-shell.
You should now be able to use the git user to access any git repositories on the server.  If you test that out at this point, you’ll be prompted for the ‘git’ user’s password.
What we want to do at this point is configure users to have access to ssh as the ‘git’ account without having to use the password.  To do this, we’ll need to set up an ssh public/private key pair for each user.  Let’s use bob as our example.  I’ll be using Cygwin’s openssh as our example, but the concepts are the same if using Putty as your SSH client.
To setup bob’s ssh keys, he’ll need to run the following command:
This will prompt the user bob for the location to store the ssh keys.  Hitting enter will accept the defaults. The command will further prompt him for a passphrase.  A passphrase is recommended because it keeps anyone who has access to bob’s machine from getting his private key and impersonating him, but for now let’s just have him hit enter when prompted.  Entering an empty passphrase will cause ssh to bypass asking for anything.  I’ll talk about ways of using a passphrase without having to enter it every time in a bit.
Here’s the kind of output you’ll see:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/bob/.ssh/id_rsa):
Created directory '/home/bob/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/bob/.ssh/id_rsa.
Your public key has been saved in /home/bob/.ssh/
The key fingerprint is:
53:6c:19:ec:c7:96:c5:ee:1d:b0:93:84:b6:8c:a5:2d bob@bobsMachine
The key's randomart image is:
+--[ RSA 2048]----+
|         .. ..   |
|         ..* oo  |
|         .%.o++  |
|         E.+=+.. |
|        S .o ....|
|         .    . .|
|                 |
|                 |
|                 |
From here, Bob will have a newly created .ssh directory in his home directory:
.ssh $> ls

What we as the admin of the git server need from Bob is the contents of his file.  That should look something like the following:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRVsZqNvQNc9YBcLCrm2pZotUiFsyZsQtdhWdtVF3u3PHR1ZNcGvWqSSI+hrb7HP/mTFBzyciO1nWRfbERXjexLd5uBf+ou5ZHDs51JIGQs61Lb+Kq/Q8P2/77bqGIIF5cZPfewZM/wQYHiR/JhIWHCRRmVOwPgPkfI7cqKOpbFRqyRYuV0pglsQEYrjm4FCM2MJ4iWnLKdgqj6vCJbNT6ydx4LqqNH9fCcbOphueoETgiBeUQ9U64OsEhlek9trKAQ0pBSNkJzbslbqzLgcJIitX4OYTxau3l74W/kamWeLe5+6M2CUUO826R9j4XuGQ2qqo5A5GrdVSZffuqRtX1 bob@bobMachine
Next, we want to add this key to a special file named authorized_users in the remote ‘git’ user’s .ssh folder.
[DevMachine]: .ssh > $ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC36qnox4nlTInc1fyOlaUC3hJhEdVM4/qKeEKPBJ520sOzJG+cRvRGNSdbtLNKD9xZs0dpiql9Vtgy9Yc2XI+lWjBGUmPbqWUuP8IZdFGx3QwPSIx9YzakuUBqYE5+9JKcBuHIhIlilqCCzDtXop6Bi1lN0ffV5r6PyqyFIv0L7MJb8jDsHX7GRl4IGu8ScxfY4G0PS3ZrMGfQBr2fm8KFzg7XWVaP/HTT4XKcf5Jp6oHvLz8FvEfdZdajyFUXRzrE0Kt9KAbeIBJV8+usiTAVpsmMY1yfrsuBUdOlhpvL/pU2o5B6K8VlJeXSF4IYEgS+v6JBAlyaWQkXupQr+lIL bob@BobMachine
That’s it.  The user ‘bob’ will now be able to ssh without providing a password.

SSH Without Passphrases

Remember, it’s recommended that everyone use a passphrase.  This prevents someone who’s gained access to your machine from tricking out the remote server to letting them have access as you.  To use a passphrase, repeat the above steps with a a passphrase set.  To keep us from having to always type in the passphrase, we can use ssh-agent (or the Pageant process for Putty users).  The basic premise is that you type your passphrase once per session and the ssh-agent will keep track of the passphrase for you. 
To use the ssh-agent to track your passphrase, add the following to your ~/.bash_profile:
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
 trap "kill $SSH_AGENT_PID" 0
Close your bash shell and reopen it.  You should see an agent pid output when you open your shell again.
Agent pid 1480
[DevMachine]: >
Now, issue the following command:
ssh-add ~/.ssh/id_rsa
Type your passphrase when prompted.  Thereafter, you will be able to ssh without providing a passphrase.
That concludes the guide.  Enjoy!

Sunday, September 14, 2014

Getting started Writing Your First Firefox OS Apps

Firefox OS  A brand new OS for smart phones.This OS User-interface & Apps are written with HTML, CSS & JS .Today in this Article If you are interested in building apps which runs in devices having Firefox OS .  Firefox OS apps are basically Web Apps!these apps run not only in Firefox OS devices, but on any device that have a browser!!! Like Android Too !! Let's Start Here......
Create a directory named firefox anywhere in your computer.
This will be the base directory - we put all files of our app here.
Create a file index.html (it doesn't need to be index.html, it could be any name with .html extension) in the hello directory.

Open the index.html file with your Firefox Browser. You can double-click or right-click then open with Firefox.

But...doesn't look like a mobile app!
Because, we've not taken care of screen size & others.
To test mobile screens with various sizes, press Control + Shift + M in your Firefox!
All Firefox OS apps need a manifest file. The manifest file tells the app's name, description, permissions it requires and some other basic settings.
Manifest file can have any name,I used heremanifest.webapp but it should have .webapp extension.
"name": "Hello FireFox OS",
"description": "This An FireFox Hello World Apps",
"launch_path": "/index.html",
"version": "0.0.1",
        "16": "/img/icon-16.png",
        "32": "/img/icon-32.png",
        "48": "/img/icon-48.png",
        "60": "/img/icon-60.png",
        "128": "/img/icon-128.png"
"developer": {
"name":"The DevLine",
1. Open App Manager by typing about:app-manager in the address bar of browser
2. click Start Simulator > Firefox OS x.x from the bottom bar
3. Click Add Packaged App & select the folder which contains manifest.webapp file you just created.
4. Click update
Go to the simulator & fine our app installed.
We will add a text input box and a button in our simple app.
When user clicks button, an alert box with the text in the input field will be shown.
CHANGE THE index.html FILE
INSIDE YOUR PROJECT JS DIRECTORY( Create A JS Directory for put JS file only )
And Add the flowing code insert  your apps.js file .
//to UI elements
var button = document.getElementById('myButton');
var txtInput = document.getElementById('myTextInput');
// Bind click event of the button with an event listener
button.addEventListener('click', function(){
    var text = txtInput.value;
    // Show alert box with this text
Open  Simulator and click Update And See the Result
Done! You have created your first  Firefox OS app!
Once you've completed your app, you need to upload it in a server, and share the link.You can submit your app in the Firefox Marketplace for more publicity!
MDNWill be your one-stop center for docs. You may also check out: HTML5,JavaScript,CSS

Saturday, September 13, 2014

Firefox OS Apps Developing Environment Setup For Beginners

In this article for who want to develop Firefox OS apps . Here is Firefox OS Apps Developing Environment Setup Guide .  and about to know whats is Firefox OS And Diagram To start Developing You must Know this....
What is Firefox OS
Firefox OS is a Linux kernel-based open-source operating system for smartphones and tablet and is set to be used on smart TVs.
Firefox OS is designed to provide a complete community-based alternative system for mobile devices, using open standards and approaches such as HTML5 applications, JavaScript, a robust privilege model, open web APIs to communicate directly with cellphone hardware,and application marketplace. As such, it competes with commercially developed operating systems such as Apple's iOS, Google's Android, Microsoft's Windows Phone as well as other community-based open source systems such as Ubuntu Touch.
Firefox OS architecture diagram
System requirements
To develop and debug apps using the WebIDE, all you need is Firefox version 33 or later. To test on a real Firefox OS device, you need a device running Firefox OS 1.2 or later, and a USB cable.
App Manager
The App Manager is a tool for Firefox Desktop which provides a number of useful tools to help developers test, deploy and debug HTML5 web apps on Firefox OS phones & Simulator, directly from Firefox browser.

To Open App Manager on Firefox simply 
Open the App Manager (in the URL bar, type about:app-manager) Or 
Click Open Menu > Developer > App Managers
An Apps panel, which manages local apps (app source code located on your computer) and apps hosted externally, allowing you to package and install them on your device or simulator, and debug them using Toolboxes.
Setup your Firefox OS device
Make sure you have Firefox Desktop 26+ installed
Install the Firefox OS Simulator
Install Here :
After Install this Addons In App Manager's bottom toolbar, click on Start Simulator, then click on the name of the installed simulator, which should appear there.
Install ADB helper
The process uses the Android Debug Bridge (ADB) to handle the device-computer connection and communication.
Let Firefox handle ADB (recommended). Install the ADB Helper add-on, which makes the process easier. With this installed, there's no need to install the ADB, and no need to type the adb forward command: everything is handled by the add-on.
Connecting your device to the App Manager
With all your configuration done, it's now time to plug your device into your computer and start the App Manager:
At the bottom of the App Manager tab, you will see a connection status bar (see screenshot below). You should be able to connect your device by clicking the "Connect to localhost:6000" button.
Now that everything is working, let's review the functionality available inside the App Manager, starting with the Apps panel

Tuesday, September 9, 2014

The project is using an unsupported version of the Android Gradle plug-in: Upgrading

To face this type of problem upgrading your project . try to flowing instruction to solve
Error:The project is using an unsupported version of the Android Gradle plug-in (0.7.3).
Starting with version 0.9.0 incompatible changes were introduced in the build language.
Please read the migration guide to learn how to update your project.
Open migration guide, fix plug-in version and sync project
Warning:'android' is deprecated; use '' instead
To fix it, open file called build.gradle change apply plugins to
apply plugin: ''
Warning:(4, 22) Old buildToolsVersion 19.0.1; recommended version is 19.1.0 or later
Because your gradle plugin version and building tools are not match or old that's why show this error . to fix it try to change your buildToolsVersion updated
 compileSdkVersion 20
    buildToolsVersion '20.0.0' 
Warning: Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds
To fix it, open file called build.gradle change one line not using + blow are sample
    dependencies {
        classpath ''
Error:You must use a newer version of the Android Gradle plugin. The minimum supported version is 0.12.0 and the recommended version is 0.12.2
Error:The SDK Build Tools revision (19.0.1) is too low for project ':app'. Minimum required is 19.1.0
dependencies {
        classpath ''
To fix it, open file called build.gradle
in the project root, and change gradle version there to 0.12.2.

Best HTML5 Mobile UI Frameworks For Developers

Day by day Increase in demand of HTML5 Mobile User Interface Frameworks results into more number of HTML5 Application.Are you expert in JavaScript and CSS than this is for you .In this post,
 I have collected few outstanding HTML5 Mobile UI Frameworks that help you for front-end Application development. 
jQuery Mobile
jQuery Mobile framework takes the "write less, do more" mantra to the next level: Instead of writing unique applications for each mobile device or OS, the jQuery mobile framework allows you to design a single highly-branded responsive web site or application that will work on all popular smartphone, tablet, and desktop platforms.
Kendo UI Mobile
Build websites,mobile apps and rich HTML5 data visualizations by using Javascript and HTML5. Kendo UI Complete, comprehensive HTML5 & jQuery framework.
Sencha Touch
Sencha Touch is a user interface (UI) JavaScript library, or framework, specifically built for the Mobile Web.Sencha Touch in Action is the definitive guide to developing applications with Sencha Touch
Chocolate Chip UI
ChocolateChip-UI is a mobile first framework. It has a bit of a twist: it includes HTML, CSS and JavaScript. The nice thing is, it gives you a native look for your Web applications… They’ve really designed this well. The documentation is very thorough. And it’s pretty easy to get started. And it’s also ChocolateChip-UI, so its the most delicious framework out there.

Friday, September 5, 2014

How to Show Country Status Into OpenX UI

Today in this article I will cover how to show country stats report on your UI . that's means you will now see user by country. this is not default option in OpenX or Revive-adserver. basically it's need Plugins & Patch than it's work .Here i will show how to do this . so let's start
First Download this File
Now Open The Flowing File Openx/lib/max/Admin_DA.php OpenX Directory See#41 Number Line Add code here 'getCountries' => 'stats', After add this the file are looking blow
      'getAdvertisersStats'    => 'stats',
      'getConversions'         => 'stats',
      'getConnectionVariables' => 'stats',
      'getCountries'           => 'stats',
      'getPlacementsStats'     => 'stats',
      'getPublishersStats'     => 'stats',
      'getZonesStats'          => 'stats',
Now we need to add more patch in this same file Now find #638 Number Line See return $aStats}; After } Copy the code and past here Admin_DA.php
     * Returns an array of countries.
     * @param array $aParams
     * @return array
    function getCountries($aParams)
        $conf = $GLOBALS['_MAX']['CONF'];
        $oDbh = &OA_DB::singleton();

        $where = '';
        if (!empty($aParams['day'])) {
            $aParams['day_begin'] = $aParams['day_end'] = $aParams['day'];
        if (!empty($aParams['day_begin'])) {
            $oStart = new Date($aParams['day_begin']);
            $where .= ' AND cs.date_time >= '. $oDbh->quote($oStart->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
        if (!empty($aParams['day_end'])) {
            $oEnd = new Date($aParams['day_end']);
            $where .= ' AND cs.date_time <= '. $oDbh->quote($oEnd->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
        if (!empty($aParams['month'])) {
            $oStart = new Date("{$aParams['month']}-01");
            $oEnd = new Date(Date_Calc::beginOfNextMonth($oStart->getDay(), $oStart->getMonth, $oStart->getYear(), '%Y-%m-%d'));
            $where .= ' AND cs.date_time >= '. $oDbh->quote($oStart->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
            $where .= ' AND cs.date_time <= '. $oDbh->quote($oEnd->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
        if (!empty($aParams['day_hour'])) {
            $oStart = new Date("{$aParams['day_hour']}:00:00");
            $oEnd = new Date($oStart);
            $where .= ' AND cs.date_time >= '. $oDbh->quote($oStart->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
            $where .= ' AND cs.date_time <= '. $oDbh->quote($oEnd->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
        if (!empty($aParams['agency_id'])) {
            $where .= ' AND c.agencyid='. $oDbh->quote($aParams['agency_id'], 'integer');
        if (!empty($aParams['clientid'])) {
            $where .= ' AND c.clientid='. $oDbh->quote($aParams['clientid'], 'integer');
        if (isset($aParams['zonesIds'])) {
            $where .= ' AND cs.zone_id IN ('. $oDbh->escape(implode(',', $aParams['zonesIds'])) .")";
        if (!empty($aParams['campaignid'])) {
            $where .= ' AND m.campaignid='. $oDbh->quote($aParams['campaignid'], 'integer');
        if (!empty($aParams['bannerid'])) {
            $where .= ' AND d.bannerid='. $oDbh->quote($aParams['bannerid'], 'integer');

 $order = '';
        if (!empty($aParams['listorder'])) {
     switch ($aParams['listorder']){
      case 'country':
              $order = '';
      case 'name':
              $order = '';
      case 'impressions':
              $order = ' SUM(cs.impressions)';
      case 'clicks':
              $order = ' SUM(cs.clicks)';
          $order = '';
 $orderdirection = 'ASC';
        if (!empty($aParams['orderdirection'])) {
  if ($aParams['orderdirection'] == 'down'){
   $orderdirection = 'DESC';

        $query =
   as country,
            SUM(cs.impressions) as impressions,
            SUM(cs.clicks) as clicks
            {$conf['table']['prefix']}{$conf['table']['clients']} AS c,
            {$conf['table']['prefix']}stats_country AS cs,
            {$conf['table']['prefix']}{$conf['table']['banners']} AS d,
            {$conf['table']['prefix']}{$conf['table']['campaigns']} AS m
            AND m.campaignid=d.campaignid
            AND d.bannerid=cs.creative_id
            ". $where ."
        GROUP BY
     ". $order . " " . $orderdirection

        return $oDbh->queryAll($query, null, MDB2_FETCHMODE_DEFAULT, true);
Now we have need to declare Parameter country status . to go to country report page
Open lib/OA/Admin/Statistics/Fields/Delivery/Default.php here see #74 number line $this->_aFields['sum_views'] = Add the flowing Line Call 'link'
 'link'    => 'stats.php?entity=country&',
Now it's look like blow code
                'name'   => $GLOBALS['strImpressions'],
                'short'  => $GLOBALS['strImpressions_short'],
                'pref'   => 'ui_column_impressions',
                'link'    => 'stats.php?entity=country&',
                'rank'   => 1,
                'active' => true,
                'format' => 'default'
Now we need to place the file stats-country.php in this location /www/admin/. after uploding stats-country.php .Open stats.php file Flowing this location www/admin/stats.php
See #159 number line here .here past the flowing Blow code
// If displaying conversion statistics, hand over control to a different file
if ($entity == 'country') {
    include_once MAX_PATH . '/www/admin/stats-country.php';
After the patch code the flowing #159 to #170 number line code looking like this
// If displaying conversion statistics, hand over control to a different file
if ($entity == 'conversions') {
    include_once MAX_PATH . '/www/admin/stats-conversions.php';

// If displaying conversion statistics, hand over control to a different file
if ($entity == 'country') {
    include_once MAX_PATH . '/www/admin/stats-country.php';
Now time to install the openx plugin “openXDeliveryLogCountry” first.if you already have install it than skip this steep.
 After Install “openXDeliveryLogCountry”  have a look at openx /var folder, within there is a section [deliveryHooks], for impression-logging there should be a row “logImpression” containing “deliveryLog:oxLogCountry:logImpressionCountry”, like:
If done all of Previews Steep than wait few hour after few hour you need to take a look into the database, table “ox_data_bkt_country_m” (Impressions) or “ox_data_bkt_country_c” (Clicks). Are there any rows logged after a banner has been displayed or clicked? If row are logged than country stats are show in your UI . See blow image
Done ! Now go status page and click the impression row see the country report.
Note : if you show blank page on stats.php?entity=country& in this page than please check [deliveryHooks] & Plugins
If you face any problem please drop a comment here i will try my best to assist you.

Thursday, September 4, 2014

Best Phonegap Plugins For PhoneGap Mobile Application Development

Below are few plugins you would use for developing your phonegap mobile app
FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a click event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.
To instantiate FastClick on the body, which is the recommended method of use:
window.addEventListener('load', function() {
    new FastClick(document.body);
}, false); 
iscroll.js, it is the general purpose script. It includes the most commonly used features and grants very high performance in a small footprint
Google Analytics
Google Analytics plugin for iOS and Android. This allows you to post usage information to your Google Analytics account.
Facebook Login
The Facebook plugin for Apache Cordova allows you to use the same JavaScript code in your Cordova application as you use in your web application. However, unlike in the browser, the Cordova application will use the native Facebook app to perform Single Sign On for the user. If this is not possible then the sign on will degrade gracefully using the standard dialog based authentication.
Native notifications
This plugin is for use with Cordova, and allows your application to receive push notifications on Amazon Fire OS, Android, iOS and WP8 devices.
Save app
Store and fetch application preferences using platform facilities
Share you app on social networks
This plugin allows you to use the native sharing window of your mobile device
Showing  Alert
This plugin allows you to show a native Toast (a little text popup) on iOS, Android and WP8. It's great for showing a non intrusive native notification which is guaranteed always in the viewport of the browser.
Feedback Pages
Reads the version of your app from the target build settings.

Monday, September 1, 2014

OpenX: Blank Statistics Page. Fixed Solution

This Error Come from 2 way first :
  1. If Maintenance script runs, but it doesn't do the transfer of data.
  2. After a PHP Upgrade to version 5.4.x the openx statistics page won’t display anymore. You only get a white page. No errors are displayed anywhere.
Open the Openx2.8.10 Flowing Root Directory And Edit the 2 file
In the CommonEntity.php file see the 287 Line to 296 Line Apply the php comment in your file like this ad_id
            $this->childrendata = array();
            if (array_search('ad_id', $aggregates) !== false) {
                $this->childrendata['ad_id'] = Admin_DA::fromCache('getAds', $aParams);
                // Plugins can set their own ads in the array
                foreach ($this->aPlugins as $oPlugin) {
                 /* stop error hide this line 

Also on line 316 Line to 326 LIne zone_id :
 if (array_search('zone_id', $aggregates) !== false) {
                $this->childrendata['zone_id'] = Admin_DA::fromCache('getZones', $aParams);
                // Plugins can set their own zones in the array
                foreach ($this->aPlugins as $oPlugin) {
                /*  stop error hide this line 

If done to do this file Now open CommonHistory.php File Also Add php comment in this flowing line 161
    function prepare(&$aParams, $link = '')
    /* stop error hide this line 
Finally… Reload the page see stats page are working and see stats report in your Openx UI . Hope Solve you problem save lot of time . but forget to write comment

Copyright @ 2014 Bijoy Technology .
The content is copyrighted to Abdullah Al Mahamud and may not be reproduced on other websites.