Skip to content

Instantly share code, notes, and snippets.

View alaasalama's full-sized avatar

Alaa AlDin Salama alaasalama

View GitHub Profile
@alaasalama
alaasalama / exclude_user_agent_load_script
Created March 8, 2016 12:12
Excluding user agents list from loading specific script on your website.
<?php
$UA_list = array("GT-I9300","SM-N900T"); //list all user agents you want to block here "using any keyword"
$current_UA = $_SERVER['HTTP_USER_AGENT']; //getting the current user agent
$matchFound = preg_match_all("/\b(" . implode($UA_list,"|") . ")\b/i",$current_UA,$matches); //check if the current user agent is in the block list
if($matchFound){
//do nothing!
}else{ //print the script
?>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
<script>
jQuery( document ).ready(function() {
jQuery('input[name=log]').val('');
jQuery('input[name=pwd]').val('');
jQuery('#log')
.on('blur', function(){
var jQuerythis = jQuery(this);
if(jQuerythis.val() == 'Username'){
jQuerythis.val('');
}
UPDATE`wp_postmeta`SET`meta_key`= 'views_temp' WHERE`meta_key`= 'views'
UPDATE`wp_postmeta`SET`meta_key`= 'tie_views_temp' WHERE`meta_key`= 'tie_views'
UPDATE`wp_postmeta`SET`meta_key`= 'tie_views' WHERE`meta_key`= 'views_temp'
UPDATE`wp_postmeta`SET`meta_key`= 'views' WHERE`meta_key`= 'tie_views_temp'