tapatalk statistics piwik

copy file PiwikTracker.php from piwik directory
libs/PiwikTracker/PiwikTracker.php
to yours tapatalk plugin
add on mobiquo/mobiquo.php
following lines before line with “exit”:

$idSite = 1;//set up your site id from piwik
$piwikUrl = ‘http://www.yourUrls.tld/piwikPath/’; //remember to update
$piwikToken = ‘123456’; //copy it from piwik site settings

$useragent = @$_SERVER[‘HTTP_USER_AGENT’];
$useragent = str_replace(“Mozilla/5.0 Firefox/3.5.6 Tapatalk/”, “Mozilla/5.0 Tapatalk/”, $useragent);
$remoteip = getenv(‘REMOTE_ADDR’);
$method = $context[‘mob_request’][‘method’];

require_once(‘./PiwikTracker.php’);
PiwikTracker::$URL = $piwikUrl;
$t = new PiwikTracker( $idSite, $piwikUrl);
$t->setCustomVariable( 1, frontend, tapatalk, visit );
$t->setCustomVariable( 3, Tapatalk, Tapatalk, visit );
$t->setUserAgent( $useragent );
$t->setBrowserHasCookies(true);
$t->setPlugins($flash = false, $java = false, $director = false);
if (!empty($remoteip)) { $t->setIp( $remoteip ); }
$t->setTokenAuth( $piwikToken );
$t->doTrackPageView( “On Tapatalk ” . $method );

backup all mysql databases

#! /bin/bash
TIMESTAMP=$(date +”%F”)
BACKUP_DIR=”/home/mysql_backup/$TIMESTAMP”
MYSQL=/usr/bin/mysql
MYSQLDUMP=/usr/bin/mysqldump
MYSQL_USER=”root”
MYSQL_PASSWORD=”************”

mkdir -p $BACKUP_DIR

databases=`$MYSQL -u$MYSQL_USER -p$MYSQL_PASSWORD -e “SHOW DATABASES;” | grep -Ev “(Database|information_schema)”`

for db in $databases; do
echo $db
$MYSQLDUMP –force –opt –user=$MYSQL_USER -p$MYSQL_PASSWORD –databases $db | gzip > “$BACKUP_DIR/$db.gz”
done

wordpress plugin

add custom menu to backend / admin dashboard

add_action( 'admin_menu', 'register_my_custom_menu_page' );

function register_my_custom_menu_page(){
add_menu_page(
'page title',
'menu Title',
'manage_options',
'my_custom_menu',
'my_custom_menu_page',
'',
101
);
add_submenu_page(
'my_custom_menu',
'page subtitle',
'sub menu',
'manage_options',
'my_custom_submenu',
'my_custom_submenu_page'
);
add_submenu_page(
'my_custom_menu',
'page subtitle2',
'sub menu2',
'manage_options',
'my_custom_submenu2',
'my_custom_submenu_page2'
);
}
function my_custom_menu_page()
{
echo "Admin Page Test";
}
function my_custom_submenu_page()
{
echo "Admin SUB Page Test";
}

function my_custom_submenu_page2()
{
echo "Admin SUB Page 2";
}

typo3 4.5 lts send html email

t3lib htmlmail deprecated so use t3lib_mail_Message

$mail = t3lib_div::makeInstance(‘t3lib_mail_Message’);
$mail->setReturnPath(‘returnEmail@domain.tld’);
$mail->setFrom(‘fromEmail@domain.tld’);
$mail->setTo(recipentEmail@domain.tld);
$mail->setSubject($emailSubject);
$mail->setBody($plainMailContent);
$mail->addPart($htmlMailContent, ‘text/html’); //html content
$mail->send();
$success = $mail->isSent();