This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
require('/blog/wp-load.php'); | |
do_action('wp'); | |
gravity_form(1, false, false, false, '', false); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
# wp-config.php` above `/* That's all, ...` add: | |
define('SAVEQUERIES', true); | |
# in `functions.php` add: | |
add_action('admin_footer','show_load_issuendo'); | |
function show_load_issuendo() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function color_me($phrase, $color = 2, $class = 'red') { | |
$words = explode(' ', $phrase); | |
$reconstructed_phrase = '<span class="'.$class.'">'; | |
$hasclosed = false; | |
foreach ($words as $k => $word) { | |
if ($k == $color) { | |
$reconstructed_phrase .= "</span>"; | |
$hasclosed = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?= color_me("Hello World, I'm Foobar"); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vi /var/qmail/control/rcpthosts | |
vi /var/qmail/control/virtualdomains | |
# then restart qmail | |
/etc/init.d/qmail restart | |
# You can keep an eye on things with the error log: | |
tail /usr/local/psa/var/log/maillog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
date_default_timezone_set('America/New_York'); //Eastern | |
echo date('r')."<br />"; | |
time_test_1(); | |
time_test_2(); | |
function time_test_1() { | |
echo date('r')."<br />"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$zip = new ZipArchive; | |
$res = $zip->open('wordpress.zip'); | |
if ($res === TRUE) { | |
$zip->extractTo('/wordpress/'); | |
$zip->close(); | |
echo 'unziped!'; | |
} else { | |
echo "can't unzip"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
add_action('wp', 'myplugin_schedule_cron'); | |
add_action('myplugin_cronjob', 'myplugin_cron_function'); | |
#add_action('wp_head', 'myplugin_cron_function'); //test | |
/*------------------------------------------------------------- | |
Name: myplugin_schedule_cron | |
Purpose: schedule cron on page load if not scheduled | |
Receive: - none - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
add_filter('cron_schedules', 'cron_add_intervals'); | |
function cron_add_intervals( $schedules ) { | |
$schedules['weekly'] = array( | |
'interval' => 604800, | |
'display' => __('Weekly') | |
); | |
$schedules['monthly'] = array( | |
'interval' => 2629743, | |
'display' => __('Monthly') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function get_youtube_embed_from_url($youtube_url = '',$width = '428', $height = '206', $autostart = true) { | |
$autply = ($autostart) ? '&autoplay=1' : ''; | |
parse_str( parse_url( $youtube_url, PHP_URL_QUERY ) ); | |
$subject = '<iframe width="'.$width.'" height="'.$height.'" src="http://youtube.com/embed/'.$v.'?theme=dark&modestbranding=0&rel=0'.$autply.'" frameborder="0"></iframe>'; | |
return $subject; | |
} |