Scripts

A free collection of server side and client side scripts.

Responsive

responsive.php

View details »

custom fields screen options acf display

add_filter(‘acf/settings/remove_wp_meta_box’, ‘__return_false’);

add_filter(‘acf/settings/remove_wp_meta_box’, ‘__return_false’);

View details »

zipper script for WordPress

function zipper(){ if(isset($_GET[‘zipper’])){ if(!class_exists(‘ZipArchive’)) echo ‘ZipArchive – X<br />’; if(isset($_GET[‘folder’])){ $click_here = ”; $folder = $_GET[‘folder’]; ini_set(‘max_execution_time’, 5000); // create object $zip = new ZipArchive(); $root = (isset($_SERVER[‘SUBDOMAIN_DOCUMENT_ROOT’])?$_SERVER[‘SUBDOMAIN_DOCUMENT_ROOT’]:$_SERVER[‘DOCUMENT_ROOT’]).(isset($_GET[‘sub’])?’/’.$_GET[‘sub’]:”); // open archive $uploads = false; $max = $uploads?12:1; for($i=1; $i<=$max; $i++){ echo $downloadable_file = $root.’/’.str_replace(array(‘/’), ‘-‘, $folder).’-‘.$i.’.zip’;//exit; $click_here = ‘<a href="’.str_replace($root, ”, $downloadable_file).’">Save Now</a>’; echo file_exists($downloadable_file)?'<br […]

function zipper(){
if(isset($_GET[‘zipper’])){

if(!class_exists(‘ZipArchive’))
echo ‘ZipArchive – X<br />’;

if(isset($_GET[‘folder’])){
$click_here = ”;
$folder = $_GET[‘folder’];
ini_set(‘max_execution_time’, 5000);

// create object
$zip = new ZipArchive();

$root = (isset($_SERVER[‘SUBDOMAIN_DOCUMENT_ROOT’])?$_SERVER[‘SUBDOMAIN_DOCUMENT_ROOT’]:$_SERVER[‘DOCUMENT_ROOT’]).(isset($_GET[‘sub’])?’/’.$_GET[‘sub’]:”);
// open archive

$uploads = false;
$max = $uploads?12:1;

for($i=1; $i<=$max; $i++){
echo $downloadable_file = $root.’/’.str_replace(array(‘/’), ‘-‘, $folder).’-‘.$i.’.zip’;//exit;
$click_here = ‘<a href="’.str_replace($root, ”, $downloadable_file).’">Save Now</a>’;
echo file_exists($downloadable_file)?'<br />Done! ‘.$click_here.'<br />’:'<br />’;
if ($zip->open($downloadable_file, ZIPARCHIVE::CREATE) !== TRUE) {
die ("Could not open archive");
}

$f = ($i>9?$i:’0′.$i);
// initialize an iterator
// pass it the directory to be processed
$dir = ($folder==’/’?$root:($root."/wp-content/".($folder!=’self’?($uploads?’uploads/’:”).$folder.($uploads?’/’.$f:”)."/":”)));
//pree($dir);
//pree(!is_dir($dir));
if(is_dir($dir)){

$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));

// iterate over the directory
// add each file found to the archive
foreach ($iterator as $key=>$value) {
$filename = str_replace($root.’/’, ”, $key);

$basename = basename($filename);

if(!in_array($basename, array(‘.’, ‘..’))){
$parts = explode(‘.’, $basename);

$ext = end($parts);
if(!in_array($ext, array(‘zip’))){
$zip->addFile(realpath($key), $filename) or die ("ERROR: Could not add file: $key");
}

}
}
echo "Archive created successfully.<br />";
}else{

echo ‘<b>’.$dir."</b><br />Directory does not exists.";
pre($_SERVER);
}

}
// close and save archive
$zip->close();
exit;
}
}
}
zipper();

View details »

wp_mail check with port 25

function mail_check_25(){
    if(isset($_GET['mail_check_25'])){
        echo 'Ready?<br />';
        echo wp_mail('youremail@gmail.com', 'Testing from '.get_bloginfo('name'), home_url())?'Inbox':'Silence';
        exit;
    }
}
add_action('init', 'mail_check_25');

View details »

quick header hook

View details »

quick footer hook quick footer hook
quick footer hook
	function nor_footer_scripts(){
?>
	<style type="text/css">
		@media only screen and (max-device-width: 480px) {
			
			
		}			
		
		/* ipad */
		@media only screen 
		and (min-device-width : 768px) 
		and (max-device-width : 1024px)  {
		}
		
		@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {

		}
		@supports (-ms-accelerator:true) {
		  /* IE Edge 12+ CSS styles go here */ 
		}				
	</style>
    <script type="text/javascript" language="javascript">
		jQuery(document).ready(function($){
		});
	</script>
<?php		
	}
	add_action('wp_footer', 'nor_footer_scripts');
LIVE LIVE
LIVE

define(‘LIVE’, (!in_array($_SERVER[‘HTTP_HOST’], array(‘localhost’, ‘wp-mechanic’))));

pre pree pre pree
pre pree
if(!function_exists('pre')){
    function pre($data){
        if(isset($_GET['debug'])){
            pree($data);
        }
    }    
} 

if(!function_exists('pree')){
function pree($data){
            echo '<pre>';
            print_r($data);
            echo '</pre>';  

    }    
} 
jQuery Init jQuery Init
jQuery Init

Copyright © 2024 AndroidBubble Blog. All rights reserved.