2005
CA-Weekday
Sponsored Links
[php]< ?php
/*
Plugin Name: CA-Weekday
Plugin URI: http://www.funponsel.com/blog/archives/2005/04/21/ca-weekday/
Description: Display custom weekday name
Version: 0.1
Author: Cosa Aranda
Author URI: http://www.funponsel.com/blog/
*/
$dayhint = array(
'Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday',
);
if (is_plugin_page()) :
ca_weekday_option();
else :
// Admin interface
function ca_weekday_add_option() {
add_options_page('Custom Weekday Options', 'Custom Weekday', 8, __FILE__);
$options = array(
'Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday',
);
add_option('ca_weekday', $options, 'Options for Custom Weekday by Cosa Aranda');
} //end ca_weekday_add_option
function ca_weekday($before='',$after='',$tipe=0,$print=true,$current=null) {
if (is_null($current)) {
//$current = get_the_time('U');
ob_start();
switch ($tipe) {
case 0: //current date
$day = date('j');
$month = date('n');
$year = date('Y');
break;
case 1: //post
$day = get_the_time('j');
$month = get_the_time('n');
$year = get_the_time('Y');
break;
case 2: //comment date
$day = comment_date('j');
$month = comment_date('n');
$year = comment_date('Y');
break;
}
$current = mktime(0,0,0,$month,$day,$year)+1;
ob_end_clean();
} else {
$current++;
}
$options = get_option('ca_weekday');
$h = date("w",$current);
$hh = $options[$h];
$hh = $before . $hh . $after;
if ($print) echo $hh;
else return($hh);
} //end ca_weekday
function ca_weekday_option() {
global $dayhint;
if ( isset($_POST['submitted']) ) {
$options = array();
$options[] = $_POST['weekday0'];
$options[] = $_POST['weekday1'];
$options[] = $_POST['weekday2'];
$options[] = $_POST['weekday3'];
$options[] = $_POST['weekday4'];
$options[] = $_POST['weekday5'];
$options[] = $_POST['weekday6'];
update_option('ca_weekday', $options);
echo '
Plugin settings saved.
‘;
}
$options = get_option(’ca_weekday’); n Custom Weekday is a plugin that allows you to define custom weekday name. Use the form below to modify the weekday name to fit your personal preferance. This plugin can be used anywhere on the page, like this: An example above will display custom weekday for today inside ‘(’ and ‘)’ character. More information about the syntax can be found here. END; add_action(’admin_menu’, ‘ca_weekday_add_option’); endif; // end if is_plugin_page() ?>[/php] Pages: 1 2
$action_url = $_SERVER[PHP_SELF] . ‘?page=’ . basename(__FILE__);
echo < <Custom Weekday Options
ca_weekday('(',')',0,TRUE);
} //end ca_weekday_option()
CA-Weekday is written by cosa and posted under Programming, WordPress , plugin, WordPress. If you like it, you might consider subscribing to our feed, follows us on Twitter, or receive our latest posts via email. Or else, you could also or store it to your favourite social bookmark sites. Further information about this article can be found.
And while you're here, why don't you check out our other articles:
Pssst! Most people are coming to this page searching for: weekday,download lagu dealova,weekday in php,php weekday,php weekday name,Lirik Dealova,php show weekday,lirik lagu fruit basket,lirik lagu dealova,php display weekday,once, lirik, dealova,weekday installation,lirik lagu for fruit basket,dealova-once-lirik lagu,current weekday date php,lagu dealova-once,"lirik+DEALOVA",weekday php,php show weekday from a date,php display a weekday date, 2 Comments
»
Leave a comment



[...] Visit [...]
[...] other people’s plugins, I did create my own plugins as well. For example: CA-Weton, CA-Weekday, CA-Credits, and [...]