teconit
Monday, February 22, 2021
Tuesday, May 19, 2020
Ask people to join your business - Facebook
1. You should have business account to do this. if you don't have business account please follow this link to create business account.
2.If you have business account you can see following Facebook dashboard.
Facebook Pixel tracking with google Tag manager - google analytic first method
There are three methods of install facebook pixel via google tag manager
1. Automatic installation
simple and quickLimitedNot recommended
2. Manual Installation
advancedflexible and powerfullrecommended
3. Custom Template
Quickflexible and powerfullrecommended
In this lesson i am going to discuss first method of applying Facebook pixel
1. facebook ad manager
2. Click the left hand side icon as per the following screen shot (1)
3. Then Events Manager (2)
4. Before go to this point onward you need to setup your account as business account. see this link to create Business Account
5. Then select the Partner Integrations from left hand side menu
7. Then connect google tag manager and Facebook
8. It will automatically connect with google tag manager ( no coding )
9. Then Create Facebook pixel
10. The please fill the popup form
12. you can keep this popup as it is and continue
13. Then connect with your google tag manager account and completed the process
you need to be an administrator of your business to connect Facebook pixel
How to create Facebook business account
- Go and log to facebook
- Click add manager left hand side
- Then click 9 dots icon left hand side
- Then business settings as above scree shot
- Then create account
- Fill the popup form and click NEXT
- It will send you a email with confirm link
- Then go to you email box and confirm facebook business
- Now you will be here and DONE
Sunday, May 17, 2020
Wordpress header meta tag rewrite - WP custom title
How to write simple WP plugin for header meta rewirte?
Activate custom_title_one plugin then see your site title
WP custom title
It is just simple code. First you need to create a folder "custom_title_one" under "plugin" folder then Create new file call custom_title_one.php and save it.
Top of the file you need to be initialize the plugin name description etc...
<?php
/*
Plugin Name: Custom title one
Plugin URI:
Description: Custom title one
Version: 1.0
Author: WAP
*/
?>
Then you need to add WP filters as follows.
add_filter('wpseo_title','custom_title_one');
function custom_title_one(){
return "test title";
}Go to WP admin
Activate custom_title_one plugin then see your site title
Thursday, May 14, 2020
Sri Lanka - Covid 19 - Tourism industry and hotels
Sri Lanka - Covid 19 - Tourism industry and hotels
Sri Lanka, Covid 19, tourism industry and hotels are the main subject in these days in Sri Lanka. Sri lanka is small county. Furthermore It doesn't have strong economy. Covid 19 already badly affected for Sri lankans. Identically tourism industry and hotels. Last year there was an Easter Sunday attack too. Mainly Sri Lanka is a Sinhala Buddhist country. But there are living Tamil and Muslim minority in very peacefully. In here I would like to describe key factors that has been affected to control covid 19. And also feature plan of tourism industry and hotels.
- Leadership
Sri lanka president Mr Gotabaya Rajapaksa is always listening to the right person. In this covid 19 case, He took the opinions from doctors. Collected the intelligent information. Discussed with right person and made decision. All the decision has been took the right time. if something went wrong, He didn't waste time to correct it. - Information flow
The information flows not only in one direction. It is been top-down and bottom-up too. General public has been given information to the covid 19 control unit. All the medias always made awareness programmer about covid 19 and published them. - Sri Lankan tradition
Herbal steam is the well known treatment method in Sri Lanka. In this time, It is popular in here. Foods style of Sri lanka is very special. It's bit of spicy and too hot. Curry Leaves , Turmeric, Clove , Cinnamon , Pepper, Cardamom , Lemongrass and Citronella, Nutmeg and Mace, Vanila , and Ginger are mainly using.
Tourism industry and hotels
Right now Sri Lanka has golden opportunity to accelerate Tourism industry. furthermore Sri Lanka should have start medical tourism. Sri Lankan traditional medical system is more than fit with current situation. Then this will enhance the Tourism industry and hotels. Sri Lanka is waiting for you to warm welcome. This is the time to visit Sri lanka. There is proved medical system to overcome from covid 19. Sri Lanka can protect your life.
Friday, November 1, 2013
simple web service zend framework 2 | zf2
Hi all, Today I am going to code simple web service from ZF2.
As first step, you need to set up zf2 . Follow the instruction given in following link
http://framework.zend.com/manual/2.0/en/user-guide/skeleton-application.html
Mysoap is folder name of my new module. and it's place under root module on ZF2.
Copy all the folder from Application and past into Mysoap. Now we are ready to develop our web service. see the below for folder structure
1.
C:\xampp\htdocs\ZendFramework\module\Mysoap\config\module.config.php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Mysoap;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
class Module
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
}
2.C:\xampp\htdocs\ZendFramework\module\Mysoap\src\Mysoap\Controller\IndexController.php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Mysoap\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Soap\Client;
use Zend\Soap\Server;
use Zend\Soap\AutoDiscover;
require_once 'C:\xampp\htdocs\ZendFramework\module\Mysoap\src\Services\servicesAPI.php';
class IndexController extends AbstractActionController
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
return new ViewModel();
}
public function soapAction()
{
// initialize server and set URI
$server = new Server(null,
array('uri' => 'http://myzend.local/mysoap/wsdl'));
// set SOAP service class
$server->setClass('servicesAPI');
// handle request
$server->handle();
return $this->getResponse();
}
public function wsdlAction()
{
// set up WSDL auto-discovery
$wsdl = new AutoDiscover();
// attach SOAP service class
$wsdl->setClass('servicesAPI');
// set SOAP action URI
$wsdl->setUri('http://myzend.local/mysoap/soap');
// handle request
$wsdl->handle();
return $this->getResponse();
}
public function clientAction()
{
$url = 'http://myzend.local/mysoap/wsdl';
$client = new Client($url);
print_r($client->getProducts());
return $this->getResponse();
}
}
As first step, you need to set up zf2 . Follow the instruction given in following link
http://framework.zend.com/manual/2.0/en/user-guide/skeleton-application.html
Mysoap is folder name of my new module. and it's place under root module on ZF2.
Copy all the folder from Application and past into Mysoap. Now we are ready to develop our web service. see the below for folder structure
1.
C:\xampp\htdocs\ZendFramework\module\Mysoap\config\module.config.php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Mysoap;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
class Module
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
}
2.C:\xampp\htdocs\ZendFramework\module\Mysoap\src\Mysoap\Controller\IndexController.php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Mysoap\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Soap\Client;
use Zend\Soap\Server;
use Zend\Soap\AutoDiscover;
require_once 'C:\xampp\htdocs\ZendFramework\module\Mysoap\src\Services\servicesAPI.php';
class IndexController extends AbstractActionController
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
return new ViewModel();
}
public function soapAction()
{
// initialize server and set URI
$server = new Server(null,
array('uri' => 'http://myzend.local/mysoap/wsdl'));
// set SOAP service class
$server->setClass('servicesAPI');
// handle request
$server->handle();
return $this->getResponse();
}
public function wsdlAction()
{
// set up WSDL auto-discovery
$wsdl = new AutoDiscover();
// attach SOAP service class
$wsdl->setClass('servicesAPI');
// set SOAP action URI
$wsdl->setUri('http://myzend.local/mysoap/soap');
// handle request
$wsdl->handle();
return $this->getResponse();
}
public function clientAction()
{
$url = 'http://myzend.local/mysoap/wsdl';
$client = new Client($url);
print_r($client->getProducts());
return $this->getResponse();
}
}
3. C:\xampp\htdocs\ZendFramework\module\Mysoap\config\module.config.php
return array(
'controllers' => array(
'invokables' => array(
'Mysoap\Controller\Index' => 'Mysoap\Controller\IndexController',
),
),
// The following section is new and should be added to your file
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/mysoap[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Mysoap\Controller\Index',
'action' => 'index',
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'album' => __DIR__ . '/../view',
),
),
);
4. create new folder call Service under SRC. This our web service code
C:\xampp\htdocs\ZendFramework\module\Mysoap\src\Services\servicesAPI.php
class servicesAPI {
/**
* This method returns a string
*
* @param String $value
* @return String
*/
// define filters and validators for input
private $_filters = array(
'title' => array('HtmlEntities', 'StripTags', 'StringTrim'),
'shortdesc' => array('HtmlEntities', 'StripTags', 'StringTrim'),
'price' => array('HtmlEntities', 'StripTags', 'StringTrim'),
'quantity' => array('HtmlEntities', 'StripTags', 'StringTrim')
);
private $_validators = array(
'title' => array(),
'shortdesc' => array(),
'price' => array('Float'),
'quantity' => array('Int')
);
/**
* Returns list of all products in database
*
* @return array
*/
public function getProducts()
{
$p = array(
'title' => 'Spinning Top',
'shortdesc' => 'Hours of fun await with this colorful spinning top.
Includes flashing colored lights.',
'price' => '3.99',
'quantity' => 57
);
return $p;
}
/**
* Returns specified product in database
*
* @param integer $id
* @return array|Example_Exception
*/
public function getProduct($id)
{
$content = "some text here".$id;
$fp = fopen("myText.txt","wb");
fwrite($fp,$content);
fclose($fp);
return $id;
}
/**
* Adds new product to database
*
* @param array $data array of data values with keys -> table fields
* @return integer id of inserted product
*/
public function addProduct($data)
{
}
/**
* Deletes product from database
*
* @param integer $id
* @return integer number of products deleted
*/
public function deleteProduct($id)
{
}
/**
* Updates product in database
*
* @param integer $id
* @param array $data
* @return integer number of products updated
*/
public function updateProduct($id, $data)
{
}
}
Subscribe to:
Comments (Atom)
