Exemplo n.º 1
0
/**
 * Make a timestamp into a relative string
 *
 * @todo Tidy up and move out of this file.
 * Based on Garrett Murray's code from http://graveyard.maniacalrage.net/etc/relative/
 */
function relative_time($posted_date)
{
    $in_seconds = $posted_date;
    $diff = time() - $in_seconds;
    $months = floor($diff / 2592000);
    $diff -= $months * 2419200;
    $weeks = floor($diff / 604800);
    $diff -= $weeks * 604800;
    $days = floor($diff / 86400);
    $diff -= $days * 86400;
    $hours = floor($diff / 3600);
    $diff -= $hours * 3600;
    $minutes = floor($diff / 60);
    $diff -= $minutes * 60;
    $seconds = $diff;
    if ($months > 0) {
        return sprintf(_c('on %s', 'on <date>'), date('N, jS \\o\\f F, Y'));
    }
    switch (true) {
        case $weeks > 0:
            // weeks and days
            $week = sprintf(Locale::ngettext('%d week', '%d weeks', $weeks), $weeks);
            if ($days > 0) {
                $day = sprintf(Locale::ngettext('%d day', '%d days', $days), $days);
                $relative_date = sprintf(_c('%s, %s ago', 'relative time, "x weeks, x days ago"'), $week, $day);
            } else {
                $relative_date = sprintf(_c('%s ago', 'relative time, "x weeks ago"'), $week);
            }
            break;
        case $days > 0:
            // days and hours
            $day = sprintf(Locale::ngettext('%d day', '%d days', $days), $days);
            if ($hours > 0) {
                $hour = sprintf(Locale::ngettext('%d hour', '%d hours', $hours), $hours);
                $relative_date = sprintf(_c('%s, %s ago', 'relative time, "x days, x hours ago"'), $day, $hour);
            } else {
                $relative_date = sprintf(_c('%s ago', 'relative time, "x days ago"'), $day);
            }
            break;
        case $hours > 0:
            // hours and minutes
            $hour = sprintf(Locale::ngettext('%d hour', '%d hours', $hours), $hours);
            if ($minutes > 0) {
                $minute = sprintf(Locale::ngettext('%d minute', '%d minutes', $minutes), $minutes);
                $relative_date = sprintf(_c('%s, %s ago', 'relative time, "x hours, x minutes ago"'), $hour, $minute);
            } else {
                $relative_date = sprintf(_c('%s ago', 'relative time, "x hours ago"'), $hour);
            }
            break;
        case $minutes > 0:
            // minutes only
            return sprintf(Locale::ngettext('%d minute ago', '%d minutes ago', $minutes), $minutes);
            break;
        case $seconds > 0:
            // seconds only
            return sprintf(Locale::ngettext('%d second ago', '%d seconds ago', $seconds), $seconds);
            break;
    }
    return $relative_date;
}
Exemplo n.º 2
0
function load_course_roles()
{
    global $wp_roles;
    if (!$wp_roles->is_role('course_manager')) {
        _c('Course Manager|User role');
        $author = get_role('author');
        add_role('course_manager', 'Course Manager|User role', $author->capabilities);
        $role = get_role('course_manager');
        $role->add_cap('manage_courses');
        $role = get_role('administrator');
        $role->add_cap('manage_courses');
    }
}
Exemplo n.º 3
0
 /**
  * Helper renvoyant l'url correspondante aux paramètres d'entrés
  * @return String $url
  * @param $params Array
  */
 public static function _($params, $domain = null)
 {
     if (is_string($params)) {
         // si c'est simplement une url...
         if (preg_match('#^http://#i', $params)) {
             return $params;
         } else {
             $params = self::selector($params);
         }
     }
     $urlEngineClassName = '\\Mynd\\Core\\Url\\' . ucwords(_c('url_handler')) . 'Url';
     $urlEngine = new $urlEngineClassName();
     if (!is_null($domain)) {
         $path = $urlEngine->params2path($params);
         return $urlEngine->path2url($path, $domain);
     }
     return $urlEngine->params2url($params);
 }
Exemplo n.º 4
0
 public function params2path($params)
 {
     if (empty($params['controller'])) {
         $params['controller'] = _c('default_controller');
     }
     if (empty($params['action'])) {
         $params['action'] = _c('default_action');
     }
     if (empty($params['module'])) {
         $params['module'] = null;
     }
     $url_vars = array();
     foreach ($params as $key => $value) {
         $url_vars[] = $key . '=' . urlencode($value);
     }
     $url_vars = implode('&', $url_vars);
     return $url_vars;
 }
Exemplo n.º 5
0
 function wp_install_defaults($user_id)
 {
     global $wpdb;
     // Default category
     $cat_name = $wpdb->escape(__('Uncategorized'));
     $cat_slug = sanitize_title(_c('Uncategorized|Default category slug'));
     $wpdb->query("INSERT INTO {$wpdb->terms} (name, slug, term_group) VALUES ('{$cat_name}', '{$cat_slug}', '0')");
     $wpdb->query("INSERT INTO {$wpdb->term_taxonomy} (term_id, taxonomy, description, parent, count) VALUES ('1', 'category', '', '0', '1')");
     // Default link category
     $cat_name = $wpdb->escape(__('Blogroll'));
     $cat_slug = sanitize_title(_c('Blogroll|Default link category slug'));
     $wpdb->query("INSERT INTO {$wpdb->terms} (name, slug, term_group) VALUES ('{$cat_name}', '{$cat_slug}', '0')");
     $wpdb->query("INSERT INTO {$wpdb->term_taxonomy} (term_id, taxonomy, description, parent, count) VALUES ('2', 'link_category', '', '0', '7')");
     // Now drop in some default links
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://codex.wordpress.org/', 'Documentation', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (1, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/development/', 'Development Blog', 0, 'http://wordpress.org/development/feed/', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (2, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/ideas/', 'Suggest Ideas', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (3, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/support/', 'Support Forum', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (4, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/plugins/', 'Plugins', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (5, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/themes/', 'Themes', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (6, 2)");
     $wpdb->query("INSERT INTO {$wpdb->links} (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://planet.wordpress.org/', 'WordPress Planet', 0, '', '');");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (7, 2)");
     // First post
     $now = date('Y-m-d H:i:s');
     $now_gmt = gmdate('Y-m-d H:i:s');
     $first_post_guid = get_option('home') . '/?p=1';
     $wpdb->query("INSERT INTO {$wpdb->posts} (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, comment_count, to_ping, pinged, post_content_filtered) VALUES ({$user_id}, '{$now}', '{$now_gmt}', '" . $wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!')) . "', '', '" . $wpdb->escape(__('Hello world!')) . "', '0', '" . $wpdb->escape(_c('hello-world|Default post slug')) . "', '{$now}', '{$now_gmt}', '{$first_post_guid}', '1', '', '', '')");
     $wpdb->query("INSERT INTO {$wpdb->term_relationships} (`object_id`, `term_taxonomy_id`) VALUES (1, 1)");
     // Default comment
     $wpdb->query("INSERT INTO {$wpdb->comments} (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES ('1', '" . $wpdb->escape(__('Mr WordPress')) . "', '', 'http://wordpress.org/', '{$now}', '{$now_gmt}', '" . $wpdb->escape(__('Hi, this is a comment.<br />To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.')) . "')");
     // First Page
     $first_post_guid = get_option('home') . '/?page_id=2';
     $wpdb->query("INSERT INTO {$wpdb->posts} (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ({$user_id}, '{$now}', '{$now_gmt}', '" . $wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.')) . "', '', '" . $wpdb->escape(__('About')) . "', '0', '" . $wpdb->escape(_c('about|Default page slug')) . "', '{$now}', '{$now_gmt}','{$first_post_guid}', 'publish', 'page', '', '', '')");
 }
Exemplo n.º 6
0
<?php 
            if ($comments) {
                ?>
<ol id="commentlist">
<?php 
                foreach ($comments as $comment) {
                    ?>
	<li id="comment-<?php 
                    comment_ID();
                    ?>
">
	<?php 
                    comment_text();
                    ?>
	<p><cite><?php 
                    comment_type(_c('Comment|noun'), __('Trackback'), __('Pingback'));
                    ?>
 <?php 
                    _e("by");
                    ?>
 <?php 
                    comment_author_link();
                    ?>
 &#8212; <?php 
                    comment_date();
                    ?>
 @ <a href="#comment-<?php 
                    comment_ID();
                    ?>
"><?php 
                    comment_time();
Exemplo n.º 7
0
        }
        unset($users_of_blog);
        $current_role = false;
        $class = empty($role) ? ' class="current"' : '';
        $role_links[] = "<li><a href='users.php'{$class}>" . sprintf(__ngettext('All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users), number_format_i18n($total_users)) . '</a>';
        foreach ($wp_roles->get_names() as $this_role => $name) {
            if (!isset($avail_roles[$this_role])) {
                continue;
            }
            $class = '';
            if ($this_role == $role) {
                $current_role = $role;
                $class = ' class="current"';
            }
            $name = translate_with_context($name);
            $name = sprintf(_c('%1$s <span class="count">(%2$s)</span>|user role with count'), $name, $avail_roles[$this_role]);
            $role_links[] = "<li><a href='users.php?role={$this_role}'{$class}>{$name}</a>";
        }
        echo implode(" |</li>\n", $role_links) . '</li>';
        unset($role_links);
        ?>
</ul>
</form>
</div>

<form class="search-form" action="" method="get">
<p class="search-box">
	<label class="hidden" for="user-search-input"><?php 
        _e('Search Users');
        ?>
:</label>
Exemplo n.º 8
0
   </label>
</p>
<p>
	<label>
<input name="selection" type="radio" value="<?php 
echo $structures[2];
?>
" class="tog" <?php 
checked($structures[2], $permalink_structure);
?>
 />
<?php 
_e('Numeric');
?>
<br /> <span> <?php 
echo _c('&raquo;|Used as a list bullet');
?>
 <code><?php 
echo get_option('home') . $prefix;
?>
/archives/123</code></span>
   </label>
</p>
<p>
<label>
<input name="selection" id="custom_selection" type="radio" value="custom" class="tog"
<?php 
if (!in_array($permalink_structure, $structures)) {
    ?>
checked="checked"
<?php 
Exemplo n.º 9
0
 /**
  * @Request({"status": "int", "ids": "int[]"}, csrf=true)
  * @Response("json")
  */
 public function statusAction($status, $ids = [])
 {
     foreach ($ids as $id) {
         if ($page = $this->pages->find($id) and $page->getStatus() != $status) {
             $page->setStatus($status);
             $this->pages->save($page);
         }
     }
     if ($status == Page::STATUS_PUBLISHED) {
         $message = _c('{0} No page published.|{1} Page published.|]1,Inf[ Pages published.', count($ids));
     } else {
         $message = _c('{0} No page unpublished.|{1} Page unpublished.|]1,Inf[ Pages unpublished.', count($ids));
     }
     return compact('message');
 }
Exemplo n.º 10
0
<div id="current-theme">
<?php 
if ($ct->screenshot) {
    ?>
<img src="<?php 
    echo WP_CONTENT_URL . $ct->stylesheet_dir . '/' . $ct->screenshot;
    ?>
" alt="<?php 
    _e('Current theme preview');
    ?>
" />
<?php 
}
?>
<h3><?php 
printf(_c('%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author'), $ct->title, $ct->version, $ct->author);
?>
</h3>
<p class="description"><?php 
echo $ct->description;
?>
</p>
<?php 
if ($ct->tags) {
    ?>
<p><?php 
    _e('Tags:');
    ?>
 <?php 
    echo join(', ', $ct->tags);
    ?>
Exemplo n.º 11
0
/**
 * Meta widget used to display the control form for a widget.
 *
 * Called from dynamic_sidebar().
 *
 * @since unknown
 *
 * @param array $sidebar_args
 * @return array
 */
function wp_widget_control($sidebar_args)
{
    global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget;
    $widget_id = $sidebar_args['widget_id'];
    $sidebar_id = isset($sidebar_args['id']) ? $sidebar_args['id'] : false;
    $control = isset($wp_registered_widget_controls[$widget_id]) ? $wp_registered_widget_controls[$widget_id] : 0;
    $widget = $wp_registered_widgets[$widget_id];
    $key = $sidebar_id ? array_search($widget_id, $sidebars_widgets[$sidebar_id]) : 'no-key';
    // position of widget in sidebar
    $edit = -1 < $edit_widget && is_numeric($key) && $edit_widget === $key;
    // (bool) are we currently editing this widget
    $id_format = $widget['id'];
    if (!isset($sidebar_args['_show'])) {
        $sidebar_args['_show'] = '';
    }
    if (!isset($sidebar_args['_display'])) {
        $sidebar_args['_display'] = '';
    }
    // We aren't showing a widget control, we're outputing a template for a mult-widget control
    if ('all' == $sidebar_args['_show'] && 'template' == $sidebar_args['_display'] && isset($control['params'][0]['number'])) {
        // number == -1 implies a template where id numbers are replaced by a generic '%i%'
        $control['params'][0]['number'] = -1;
        // if given, id_base means widget id's should be constructed like {$id_base}-{$id_number}
        if (isset($control['id_base'])) {
            $id_format = $control['id_base'] . '-%i%';
        }
    }
    $widget_title = '';
    // We grab the normal widget output to find the widget's title
    if (('all' != $sidebar_args['_show'] || 'template' != $sidebar_args['_display']) && is_callable($widget['_callback'])) {
        ob_start();
        $args = func_get_args();
        call_user_func_array($widget['_callback'], $args);
        $widget_title = ob_get_clean();
        $widget_title = wp_widget_control_ob_filter($widget_title);
    }
    $wp_registered_widgets[$widget_id]['callback'] = $wp_registered_widgets[$widget_id]['_callback'];
    unset($wp_registered_widgets[$widget_id]['_callback']);
    if ($widget_title && $widget_title != $sidebar_args['widget_name']) {
        $widget_title = sprintf(_c('%1$s: %2$s|1: widget name, 2: widget title'), $sidebar_args['widget_name'], $widget_title);
    } else {
        $widget_title = wp_specialchars(strip_tags($sidebar_args['widget_name']));
    }
    $sidebar_args['_widget_title'] = $widget_title;
    if (empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display']) {
        echo $sidebar_args['before_widget'];
    }
    ?>
		<div class="widget-top">
		<h4 class="widget-title"><span><?php 
    echo $widget_title;
    ?>
</span>

			<?php 
    if ($edit) {
        ?>

			<a class="widget-action widget-control-edit" href="<?php 
        echo clean_url(remove_query_arg(array('edit', 'key')));
        ?>
"><?php 
        _e('Cancel');
        ?>
</a>

			<?php 
    } else {
        ?>

			<a class="widget-action widget-control-edit" href="<?php 
        echo clean_url(add_query_arg(array('edit' => $id_format, 'key' => $key)));
        ?>
"><?php 
        _e('Edit');
        ?>
</a>

			<?php 
    }
    ?>

			<br class="clear" />

		</h4></div>

		<div class="widget-control"<?php 
    if ($edit) {
        echo ' style="display: block;"';
    }
    ?>
>

			<?php 
    if ($control) {
        call_user_func_array($control['callback'], $control['params']);
    } else {
        echo '<p>' . __('There are no options for this widget.') . '</p>';
    }
    ?>

			<input type="hidden" name="widget-id[]" value="<?php 
    echo $id_format;
    ?>
" />
			<input type="hidden" class="widget-width" value="<?php 
    echo $control['width'];
    ?>
" />

			<div class="widget-control-actions">

				<?php 
    if ($control) {
        ?>

				<a class="button widget-action widget-control-save hide-if-no-js edit alignleft" href="#save:<?php 
        echo $id_format;
        ?>
"><?php 
        _e('Done');
        ?>
</a>

				<?php 
    }
    ?>

				<a class="button widget-action widget-control-remove alignright" href="<?php 
    echo clean_url(wp_nonce_url(add_query_arg(array('remove' => $id_format, 'key' => $key)), "remove-widget_{$widget['id']}"));
    ?>
"><?php 
    _e('Remove');
    ?>
</a>
				<br class="clear" />
			</div>
		</div>
<?php 
    if (empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display']) {
        echo $sidebar_args['after_widget'];
    }
    return $sidebar_args;
}
Exemplo n.º 12
0
function WP_members_list_list()
{
    global $wp_roles, $getWP, $tern_wp_msg, $tern_wp_members_defaults, $current_user, $notice;
    get_currentuserinfo();
    $o = $getWP->getOption('tern_wp_members', $tern_wp_members_defaults);
    $wps = new WP_User_Search($_GET['query'], $_GET['userspage'], $_GET['role']);
    $paging_text = paginate_links(array('total' => ceil($wps->total_users_for_query / $wps->users_per_page), 'current' => $wps->page, 'base' => 'admin.php?page=members-list-edit-members-list&%_%', 'format' => 'userspage=%#%', 'add_args' => $args));
    if ($paging_text) {
        $paging_text = sprintf('<span class="displaying-num">' . __('Displaying %s&#8211;%s of %s') . '</span>%s', number_format_i18n(($wps->page - 1) * $wps->users_per_page + 1), number_format_i18n(min($wps->page * $wps->users_per_page, $wps->total_users_for_query)), number_format_i18n($wps->total_users_for_query), $paging_text);
    }
    ?>
	<div class="wrap">
		<div id="icon-users" class="icon32"><br /></div>
		<h2>Members List</h2>
		<?php 
    if (!empty($notice)) {
        ?>
<div id="notice" class="error"><p><?php 
        echo $notice;
        ?>
</p></div><?php 
    }
    ?>
		<p>Here you are able to select which of your members you'd like to show or hide in your members list. By default all members are showm.</p>
		<?php 
    if (!empty($tern_wp_msg)) {
        echo '<div id="message" class="updated fade"><p>' . $tern_wp_msg . '</p></div>';
    }
    ?>
		<div class="filter">
			<form id="list-filter" action="" method="get">
				<ul class="subsubsub">
					<?php 
    $l = array();
    $a = array();
    $u = get_users_of_blog();
    $t = count($u);
    foreach ((array) $u as $c) {
        $d = unserialize($c->meta_value);
        foreach ((array) $d as $e => $v) {
            if (!isset($a[$e])) {
                $a[$e] = 0;
            }
            $a[$e]++;
        }
    }
    unset($u);
    $current_role = false;
    $class = empty($role) ? ' class="current"' : '';
    $l[] = "<li><a href='admin.php?page=members-list-edit-members-list'{$class}>" . sprintf(__ngettext('All<span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $t), number_format_i18n($t)) . '</a>';
    foreach ($wp_roles->get_names() as $s => $name) {
        if (!isset($a[$s])) {
            continue;
        }
        $class = '';
        if ($s == $role) {
            $current_role = $role;
            $class = ' class="current"';
        }
        $name = translate_with_context($name);
        $name = sprintf(_c('%1$s <span class="count">(%2$s)</span>|user role with count'), $name, $a[$s]);
        $l[] = "<li><a href='admin.php?page=members-list-edit-members-list&role={$s}'{$class}>{$name}</a>";
    }
    echo implode(" |</li>\n", $l) . '</li>';
    unset($l);
    ?>
				</ul>
			</form>
		</div>
		<form class="search-form" action="" method="get">
			<p class="search-box">
				<label class="hidden" for="user-search-input">Search Users:</label>
				<input type="text" class="search-input" id="user-search-input" name="query" value="" />
				<input type="hidden" id="page" name="page" value="<?php 
    echo $_REQUEST['page'];
    ?>
" />
				<input type="submit" value="Search Users" class="button" />
			</p>
		</form>
		<form id="posts-filter" action="" method="get">
			<div class="tablenav">
				<?php 
    if ($wps->results_are_paged()) {
        ?>
					<div class="tablenav-pages"><?php 
        echo $paging_text;
        ?>
</div>
				<?php 
    }
    ?>
				<div class="alignleft actions">
					<select name="action">
						<option value="" selected="selected">Bulk Actions</option>
						<option value="show">Show</option>
						<option value="hide">Hide</option>
					</select>
					<input type="submit" value="Apply" name="doaction" id="doaction" class="button-secondary action" />
				</div>
				<br class="clear" />
			</div>
			<table class="widefat fixed" cellspacing="0">
				<thead>
				<tr class="thead">
					<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
					<th scope="col" id="username" class="manage-column column-username" style="">Username</th>
					<th scope="col" id="name" class="manage-column column-name" style="">Name</th>
					<th scope="col" id="email" class="manage-column column-email" style="">E-mail</th>
					<th scope="col" id="role" class="manage-column column-role" style="">Role</th>
					<th scope="col" id="displayed" class="manage-column column-displayed" style="">Displayed</th>
				</tr>
				</thead>
				<tfoot>
				<tr class="thead">
					<th scope="col"  class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
					<th scope="col"  class="manage-column column-username" style="">Username</th>
					<th scope="col"  class="manage-column column-name" style="">Name</th>
					<th scope="col"  class="manage-column column-email" style="">E-mail</th>
					<th scope="col"  class="manage-column column-role" style="">Role</th>
					<th scope="col" id="displayed" class="manage-column column-displayed" style="">Displayed</th>
				</tr>
				</tfoot>
				<tbody id="users" class="list:user user-list">
<?php 
    //
    $c = 0;
    //foreach($m as $u) {
    foreach ($wps->get_results() as $u) {
        $u = new WP_User($u);
        $r = $u->roles;
        $r = array_shift($r);
        if (!empty($_REQUEST['role']) and $_REQUEST['role'] != $r) {
            continue;
        }
        $d = is_float($c / 2) ? '' : ' class="alternate"';
        $nu = $current_user;
        $e = $u->ID == $nu->ID ? 'profile.php' : 'user-edit.php?user_id=' . $u->ID . '&#038;wp_http_referer=' . wp_get_referer();
        ?>
		<tr id='user-<?php 
        echo $u->ID;
        ?>
'<?php 
        echo $d;
        ?>
>
			<th scope='row' class='check-column'><input type='checkbox' name='users[]' id='user_<?php 
        echo $u->ID;
        ?>
' class='administrator' value='<?php 
        echo $u->ID;
        ?>
' /></th>
			<td class="username column-username">
				<?php 
        echo get_avatar($u->ID, 32);
        ?>
				<strong>
					<a href="<?php 
        echo $e;
        ?>
"><?php 
        echo $u->user_nicename;
        ?>
</a>
				</strong><br />
				<div class="row-actions">
					<span class='edit'><a href="admin.php?page=members-list-edit-members-list&users%5B%5D=<?php 
        echo $u->ID;
        ?>
&action=show&_wpnonce=<?php 
        echo wp_create_nonce('tern_wp_members_nonce');
        ?>
">Show</a> | </span>
					<span class='edit'><a href="admin.php?page=members-list-edit-members-list&users%5B%5D=<?php 
        echo $u->ID;
        ?>
&action=hide&_wpnonce=<?php 
        echo wp_create_nonce('tern_wp_members_nonce');
        ?>
">Hide</a></span>
				</div>
			</td>
			<td class="name column-name"><?php 
        echo $u->first_name . ' ' . $u->last_name;
        ?>
</td>
			<td class="email column-email"><a href='mailto:<?php 
        echo $u->user_email;
        ?>
' title='e-mail: <?php 
        echo $u->user_email;
        ?>
'><?php 
        echo $u->user_email;
        ?>
</a></td>
			<td class="role column-role"><?php 
        echo $r;
        ?>
</td>
			<td class="role column-displayed"><?php 
        if (!empty($o['hidden']) and in_array($u->ID, $o['hidden'])) {
            echo 'no';
        } else {
            echo 'yes';
        }
        ?>
</td>
		</tr>
<?php 
        $c++;
    }
    ?>
				</tbody>
			</table>
			<div class="tablenav">
				<div class="alignleft actions">
					<select name="action2">
						<option value="" selected="selected">Bulk Actions</option>
						<option value="show">Show</option>
						<option value="hide">Hide</option>
					</select>
					<input type="hidden" id="page" name="page" value="members-list-edit-members-list" />
					<input type="hidden" id="_wpnonce" name="_wpnonce" value="<?php 
    echo wp_create_nonce('tern_wp_members_nonce');
    ?>
" />
					<input type="submit" value="Apply" name="doaction2" id="doaction2" class="button-secondary action" />
				</div>
				<br class="clear" />
			</div>
		</form>
	</div>
<?php 
}
Exemplo n.º 13
0
    ?>
</div>
                  <?php 
    /* If this is a monthly archive */
} elseif (is_month()) {
    ?>
                    <div class="pagetitle"><?php 
    printf(_c('Archive for %s|Monthly archive page'), get_the_time(__('F, Y')));
    ?>
</div>
                  <?php 
    /* If this is a yearly archive */
} elseif (is_year()) {
    ?>
                    <div class="pagetitle"><?php 
    printf(_c('Archive for %s|Yearly archive page'), get_the_time(__('Y')));
    ?>
</div>
                  <?php 
    /* If this is an author archive */
} elseif (is_author()) {
    ?>
                    <div class="pagetitle"><?php 
    _e('Author Archive');
    ?>
</div>
                  <?php 
    /* If this is a paged archive */
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
    ?>
                    <div class="pagetitle"><?php 
Exemplo n.º 14
0
<?php

/**
 * Footer Template
 *
 * This file is loaded by footer.php and used for content inside the #footer div
 *
 * @package K2
 * @subpackage Templates
 */
?>

<?php 
printf(_c('Powered by %1$s Theme by %2$s templates from %3$s|1:WordPress, 2:K2', 'k2_domain'), '<a href="http://wordpress.org/">' . __('WordPress', 'k2_domain') . '</a>', '<a href="http://github.com/harryxu/ktwitt" title="A twitter like wordpress theme base on k2" target="_blank">KTwitt</a>', '<a href="http://getk2.com/" title="' . __('Loves you like a kitten.', 'k2_domain') . '">K2</a>');
?>
 | 
<?php 
printf(_c('%1$s and %2$s|1:Entries Feed, 2:Comments Feed', 'k2_domain'), '<a href="' . get_bloginfo('rss2_url') . '">' . __('Entries Feed', 'k2_domain') . '</a>', '<a href="' . get_bloginfo('comments_rss2_url') . '">' . __('Comments Feed', 'k2_domain') . '</a>');
Exemplo n.º 15
0
/**
 * {@internal Missing Short Description}}
 *
 * @since unknown
 *
 * @param unknown_type $edit
 * @param unknown_type $for_post
 * @param unknown_type $tab_index
 * @param unknown_type $multi
 */
function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
	global $wp_locale, $post, $comment;

	if ( $for_post )
		$edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;

	$tab_index_attribute = '';
	if ( (int) $tab_index > 0 )
		$tab_index_attribute = " tabindex=\"$tab_index\"";

	// echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';

	$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
	$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
	$jj = ($edit) ? mysql2date( 'd', $post_date ) : gmdate( 'd', $time_adj );
	$mm = ($edit) ? mysql2date( 'm', $post_date ) : gmdate( 'm', $time_adj );
	$aa = ($edit) ? mysql2date( 'Y', $post_date ) : gmdate( 'Y', $time_adj );
	$hh = ($edit) ? mysql2date( 'H', $post_date ) : gmdate( 'H', $time_adj );
	$mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj );
	$ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj );

	$cur_jj = gmdate( 'd', $time_adj );
	$cur_mm = gmdate( 'm', $time_adj );
	$cur_aa = gmdate( 'Y', $time_adj );
	$cur_hh = gmdate( 'H', $time_adj );
	$cur_mn = gmdate( 'i', $time_adj );

	$month = "<select " . ( $multi ? '' : 'id="mm" ' ) . "name=\"mm\"$tab_index_attribute>\n";
	for ( $i = 1; $i < 13; $i = $i +1 ) {
		$month .= "\t\t\t" . '<option value="' . zeroise($i, 2) . '"';
		if ( $i == $mm )
			$month .= ' selected="selected"';
		$month .= '>' . $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) . "</option>\n";
	}
	$month .= '</select>';

	$day = '<input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
	$year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="5"' . $tab_index_attribute . ' autocomplete="off" />';
	$hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
	$minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
	printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute);

	echo '<input type="hidden" id="ss" name="ss" value="' . $ss . '" />';

	if ( $multi ) return;

	echo "\n\n";
	foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) {
		echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $$timeunit . '" />' . "\n";
		$cur_timeunit = 'cur_' . $timeunit;
		echo '<input type="hidden" id="'. $cur_timeunit . '" name="'. $cur_timeunit . '" value="' . $$cur_timeunit . '" />' . "\n";
	}
?>

<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" />

<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e('OK'); ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js"><?php _e('Cancel'); ?></a>
</p>
<?php
}
function get_calendar($initial = true) {
	global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;

	$key = md5( $m . $monthnum . $year );
	if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
		if ( isset( $cache[ $key ] ) ) {
			echo $cache[ $key ];
			return;
		}
	}

	ob_start();
	// Quick check. If we have no posts at all, abort!
	if ( !$posts ) {
		$gotsome = $wpdb->get_var("SELECT ID from $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1");
		if ( !$gotsome )
			return;
	}

	if ( isset($_GET['w']) )
		$w = ''.intval($_GET['w']);

	// week_begins = 0 stands for Sunday
	$week_begins = intval(get_option('start_of_week'));

	// Let's figure out when we are
	if ( !empty($monthnum) && !empty($year) ) {
		$thismonth = ''.zeroise(intval($monthnum), 2);
		$thisyear = ''.intval($year);
	} elseif ( !empty($w) ) {
		// We need to get the month from MySQL
		$thisyear = ''.intval(substr($m, 0, 4));
		$d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
		$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
	} elseif ( !empty($m) ) {
		$thisyear = ''.intval(substr($m, 0, 4));
		if ( strlen($m) < 6 )
				$thismonth = '01';
		else
				$thismonth = ''.zeroise(intval(substr($m, 4, 2)), 2);
	} else {
		$thisyear = gmdate('Y', current_time('timestamp'));
		$thismonth = gmdate('m', current_time('timestamp'));
	}

	$unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear);

	// Get the next and previous month and year with at least one post
	$previous = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
		FROM $wpdb->posts
		WHERE post_date < '$thisyear-$thismonth-01'
		AND post_type = 'post' AND post_status = 'publish'
			ORDER BY post_date DESC
			LIMIT 1");
	$next = $wpdb->get_row("SELECT	DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
		FROM $wpdb->posts
		WHERE post_date >	'$thisyear-$thismonth-01'
		AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' )
		AND post_type = 'post' AND post_status = 'publish'
			ORDER	BY post_date ASC
			LIMIT 1");

	echo '<table id="wp-calendar" summary="' . __('Calendar') . '">
	<caption>' . sprintf(_c('%1$s %2$s|Used as a calendar caption'), $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '</caption>
	<thead>
	<tr>';

	$myweek = array();

	for ( $wdcount=0; $wdcount<=6; $wdcount++ ) {
		$myweek[] = $wp_locale->get_weekday(($wdcount+$week_begins)%7);
	}

	foreach ( $myweek as $wd ) {
		$day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd);
		echo "\n\t\t<th abbr=\"$wd\" scope=\"col\" title=\"$wd\">$day_name</th>";
	}

	echo '
	</tr>
	</thead>

	<tfoot>
	<tr>';

	if ( $previous ) {
		echo "\n\t\t".'<td abbr="' . $wp_locale->get_month($previous->month) . '" colspan="3" id="prev"><a href="' .
		get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month),
			date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">&laquo; ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
	} else {
		echo "\n\t\t".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
	}

	echo "\n\t\t".'<td class="pad">&nbsp;</td>';

	if ( $next ) {
		echo "\n\t\t".'<td abbr="' . $wp_locale->get_month($next->month) . '" colspan="3" id="next"><a href="' .
		get_month_link($next->year, $next->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($next->month),
			date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' &raquo;</a></td>';
	} else {
		echo "\n\t\t".'<td colspan="3" id="next" class="pad">&nbsp;</td>';
	}

	echo '
	</tr>
	</tfoot>

	<tbody>
	<tr>';

	// Get days with posts
	$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
		FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
		AND YEAR(post_date) = '$thisyear'
		AND post_type = 'post' AND post_status = 'publish'
		AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);
	if ( $dayswithposts ) {
		foreach ( $dayswithposts as $daywith ) {
			$daywithpost[] = $daywith[0];
		}
	} else {
		$daywithpost = array();
	}

	if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false)
		$ak_title_separator = "\n";
	else
		$ak_title_separator = ', ';

	$ak_titles_for_day = array();
	$ak_post_titles = $wpdb->get_results("SELECT post_title, DAYOFMONTH(post_date) as dom "
		."FROM $wpdb->posts "
		."WHERE YEAR(post_date) = '$thisyear' "
		."AND MONTH(post_date) = '$thismonth' "
		."AND post_date < '".current_time('mysql')."' "
		."AND post_type = 'post' AND post_status = 'publish'"
	);
	if ( $ak_post_titles ) {
		foreach ( $ak_post_titles as $ak_post_title ) {

				$post_title = apply_filters( "the_title", $ak_post_title->post_title );
				$post_title = str_replace('"', '&quot;', wptexturize( $post_title ));

				if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) )
					$ak_titles_for_day['day_'.$ak_post_title->dom] = '';
				if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one
					$ak_titles_for_day["$ak_post_title->dom"] = $post_title;
				else
					$ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . $post_title;
		}
	}


	// See how much we should pad in the beginning
	$pad = calendar_week_mod(date('w', $unixmonth)-$week_begins);
	if ( 0 != $pad )
		echo "\n\t\t".'<td colspan="'.$pad.'" class="pad">&nbsp;</td>';

	$daysinmonth = intval(date('t', $unixmonth));
	for ( $day = 1; $day <= $daysinmonth; ++$day ) {
		if ( isset($newrow) && $newrow )
			echo "\n\t</tr>\n\t<tr>\n\t\t";
		$newrow = false;

		if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $thismonth == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $thisyear == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) )
			echo '<td id="today">';
		else
			echo '<td>';

		if ( in_array($day, $daywithpost) ) // any posts today?
				echo '<a href="' . get_day_link($thisyear, $thismonth, $day) . "\" title=\"$ak_titles_for_day[$day]\">$day</a>";
		else
			echo $day;
		echo '</td>';

		if ( 6 == calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins) )
			$newrow = true;
	}

	$pad = 7 - calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins);
	if ( $pad != 0 && $pad != 7 )
		echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';

	echo "\n\t</tr>\n\t</tbody>\n\t</table>";

	$output = ob_get_contents();
	ob_end_clean();
	echo $output;
	$cache[ $key ] = $output;
	wp_cache_set( 'get_calendar', $cache, 'calendar' );
}
Exemplo n.º 17
0
    if ($action == 'update-users') {
        bb_apply_nxt_role_map_to_orphans();
    }
    $goback = add_query_arg('updated', $action, nxt_get_referer());
    bb_safe_redirect($goback);
    exit;
}
switch (@$_GET['updated']) {
    case 'update-users':
        bb_admin_notice(__('<strong>User role mapping saved.</strong>'));
        break;
    case 'update-options':
        bb_admin_notice(__('<strong>User integration settings saved.</strong>'));
        break;
}
$bb_role_names[''] = _c('none|no bbPress role');
$bb_role_names = array_merge($bb_role_names, array_map(create_function('$a', 'return sprintf( _c( "bbPress %s|bbPress role" ), $a );'), $nxt_roles->get_names()));
$nxtRoles = array('administrator' => __('NXTClass Administrator'), 'editor' => __('NXTClass Editor'), 'author' => __('NXTClass Author'), 'contributor' => __('NXTClass Contributor'), 'subscriber' => __('NXTClass Subscriber'));
$nxtRoles = apply_filters('role_map_nxt_roles', $nxtRoles);
$cookie_options = array('nxt_siteurl' => array('title' => __('NXTClass address (URL)'), 'class' => 'long', 'note' => __('This value should exactly match the <strong>NXTClass address (URL)</strong> setting in your NXTClass general settings.')), 'nxt_home' => array('title' => __('Blog address (URL)'), 'class' => 'long', 'note' => __('This value should exactly match the <strong>Blog address (URL)</strong> setting in your NXTClass general settings.')), 'bb_auth_salt' => array('title' => __('NXTClass "auth" cookie salt'), 'note' => __('This must match the value of the NXTClass setting named "auth_salt" in your NXTClass site. Look for the option labeled "auth_salt" in <a href="#" id="getAuthSaltOption" onclick="window.open(this.href); return false;">this NXTClass admin page</a>.')), 'bb_secure_auth_salt' => array('title' => __('NXTClass "secure auth" cookie salt'), 'note' => __('This must match the value of the NXTClass setting named "secure_auth_salt" in your NXTClass site. Look for the option labeled "secure_auth_salt" in <a href="#" id="getSecureAuthSaltOption" onclick="window.open(this.href); return false;">this NXTClass admin page</a>. Sometimes this value is not set in NXTClass, in that case you can leave this setting blank as well.')), 'bb_logged_in_salt' => array('title' => __('NXTClass "logged in" cookie salt'), 'note' => __('This must match the value of the NXTClass setting named "logged_in_salt" in your NXTClass site. Look for the option labeled "logged_in_salt" in <a href="#" id="getLoggedInSaltOption" onclick="window.open(this.href); return false;">this NXTClass admin page</a>.')));
foreach (array('bb_auth_salt', 'bb_secure_auth_salt', 'bb_logged_in_salt') as $salt_constant) {
    if (defined(strtoupper($salt_constant))) {
        $cookie_options[$salt_constant]['note'] = array(sprintf(__('You have defined the "%s" constant which locks this setting.'), strtoupper($salt_constant)), $cookie_options[$salt_constant]['note']);
        $cookie_options[$salt_constant]['value'] = constant(strtoupper($salt_constant));
        $bb_hardcoded[$salt_constant] = true;
    }
}
$user_db_options = array('nxt_table_prefix' => array('title' => __('User database table prefix'), 'note' => __('If your bbPress and NXTClass sites share the same database, then this is the same value as <code>$table_prefix</code> in your NXTClass <code>nxt-config.php</code> file. It is usually <strong>nxt_</strong>.')), 'nxtclass_mu_primary_blog_id' => array('title' => __('NXTClass MU primary blog ID'), 'note' => __('If you are integrating with a NXTClass MU site you need to specify the primary blog ID for that site. It is usually <strong>1</strong>. You should probably leave this blank if you are integrating with a standard NXTClass site')), 'user_bbdb_advanced' => array('title' => __('Show advanced database settings'), 'type' => 'checkbox', 'options' => array(1 => array('label' => __('If your bbPress and NXTClass site do not share the same database, then you will need to add advanced settings.'), 'attributes' => array('onclick' => 'toggleAdvanced(this);')))));
$advanced_user_db_options = array('user_bbdb_name' => array('title' => __('User database name'), 'note' => __('The name of the database in which your user tables reside.')), 'user_bbdb_user' => array('title' => __('User database user'), 'note' => __('The database user that has access to that database.')), 'user_bbdb_password' => array('title' => __('User database password'), 'note' => __('That database user\'s password.')), 'user_bbdb_host' => array('title' => __('User database host'), 'note' => __('The domain name or IP address of the server where the database is located. If the database is on the same server as the web site, then this probably should be <strong>localhost</strong>.')), 'user_bbdb_charset' => array('title' => __('User database character set'), 'note' => __('The best choice is <strong>utf8</strong>, but you will need to match the character set which you created the database with.')), 'user_bbdb_collate' => array('title' => __('User database character collation'), 'note' => __('The character collation value set when the user database was created.')));
$custom_table_options = array('custom_user_table' => array('title' => __('User database "user" table'), 'note' => __('The complete table name, including any prefix.')), 'custom_user_meta_table' => array('title' => __('User database "user meta" table'), 'note' => __('The complete table name, including any prefix.')));
$advanced_display = bb_get_option('user_bbdb_advanced') ? 'block' : 'none';
Exemplo n.º 18
0
$submenu['edit-pages.php'][10] = array(_c('Add New|page'), 'edit_pages', 'page-new.php');
$menu[25] = array(sprintf(__('Comments %s'), "<span id='awaiting-mod' class='count-{$awaiting_mod}'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>"), 'edit_posts', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div');
$_wp_last_object_menu = 25;
// The index of the last top-level menu in the object menu group
$menu[39] = array('', 'read', '', '', 'wp-menu-separator');
$menu[40] = array(__('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top', 'menu-appearance', 'div');
$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
$submenu['themes.php'][10] = array(__('Editor'), 'edit_themes', 'theme-editor.php');
$update_plugins = get_option('update_plugins');
$update_count = 0;
if (!empty($update_plugins->response)) {
    $update_count = count($update_plugins->response);
}
$menu[45] = array(sprintf(__('Plugins %s'), "<span class='update-plugins count-{$update_count}'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>"), 'activate_plugins', 'plugins.php', '', 'menu-top', 'menu-plugins', 'div');
$submenu['plugins.php'][5] = array(__('Installed'), 'activate_plugins', 'plugins.php');
$submenu['plugins.php'][10] = array(_c('Add New|plugin'), 'install_plugins', 'plugin-install.php');
$submenu['plugins.php'][15] = array(__('Editor'), 'edit_plugins', 'plugin-editor.php');
if (current_user_can('edit_users')) {
    $menu[50] = array(__('Users'), 'edit_users', 'users.php', '', 'menu-top', 'menu-users', 'div');
} else {
    $menu[50] = array(__('Profile'), 'read', 'profile.php', '', 'menu-top', 'menu-users', 'div');
}
if (current_user_can('edit_users')) {
    $_wp_real_parent_file['profile.php'] = 'users.php';
    // Back-compat for plugins adding submenus to profile.php.
    $submenu['users.php'][5] = array(__('Authors &amp; Users'), 'edit_users', 'users.php');
    $submenu['users.php'][10] = array(__('Add New'), 'create_users', 'user-new.php');
    $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
} else {
    $_wp_real_parent_file['users.php'] = 'profile.php';
    $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
Exemplo n.º 19
0
 /**
  * Sets up the translated strings and object properties.
  *
  * The method creates the translatable strings for various
  * calendar elements. Which allows for specifying locale
  * specific calendar names and text direction.
  *
  * @since 2.1.0
  * @access private
  */
 function init()
 {
     // The Weekdays
     $this->weekday[0] = __('Sunday');
     $this->weekday[1] = __('Monday');
     $this->weekday[2] = __('Tuesday');
     $this->weekday[3] = __('Wednesday');
     $this->weekday[4] = __('Thursday');
     $this->weekday[5] = __('Friday');
     $this->weekday[6] = __('Saturday');
     // The first letter of each day.  The _%day%_initial suffix is a hack to make
     // sure the day initials are unique.
     $this->weekday_initial[__('Sunday')] = __('S_Sunday_initial');
     $this->weekday_initial[__('Monday')] = __('M_Monday_initial');
     $this->weekday_initial[__('Tuesday')] = __('T_Tuesday_initial');
     $this->weekday_initial[__('Wednesday')] = __('W_Wednesday_initial');
     $this->weekday_initial[__('Thursday')] = __('T_Thursday_initial');
     $this->weekday_initial[__('Friday')] = __('F_Friday_initial');
     $this->weekday_initial[__('Saturday')] = __('S_Saturday_initial');
     foreach ($this->weekday_initial as $weekday_ => $weekday_initial_) {
         $this->weekday_initial[$weekday_] = preg_replace('/_.+_initial$/', '', $weekday_initial_);
     }
     // Abbreviations for each day.
     $this->weekday_abbrev[__('Sunday')] = __('Sun');
     $this->weekday_abbrev[__('Monday')] = __('Mon');
     $this->weekday_abbrev[__('Tuesday')] = __('Tue');
     $this->weekday_abbrev[__('Wednesday')] = __('Wed');
     $this->weekday_abbrev[__('Thursday')] = __('Thu');
     $this->weekday_abbrev[__('Friday')] = __('Fri');
     $this->weekday_abbrev[__('Saturday')] = __('Sat');
     // The Months
     $this->month['01'] = __('January');
     $this->month['02'] = __('February');
     $this->month['03'] = __('March');
     $this->month['04'] = __('April');
     $this->month['05'] = __('May');
     $this->month['06'] = __('June');
     $this->month['07'] = __('July');
     $this->month['08'] = __('August');
     $this->month['09'] = __('September');
     $this->month['10'] = __('October');
     $this->month['11'] = __('November');
     $this->month['12'] = __('December');
     // Abbreviations for each month. Uses the same hack as above to get around the
     // 'May' duplication.
     $this->month_abbrev[__('January')] = __('Jan_January_abbreviation');
     $this->month_abbrev[__('February')] = __('Feb_February_abbreviation');
     $this->month_abbrev[__('March')] = __('Mar_March_abbreviation');
     $this->month_abbrev[__('April')] = __('Apr_April_abbreviation');
     $this->month_abbrev[__('May')] = __('May_May_abbreviation');
     $this->month_abbrev[__('June')] = __('Jun_June_abbreviation');
     $this->month_abbrev[__('July')] = __('Jul_July_abbreviation');
     $this->month_abbrev[__('August')] = __('Aug_August_abbreviation');
     $this->month_abbrev[__('September')] = __('Sep_September_abbreviation');
     $this->month_abbrev[__('October')] = __('Oct_October_abbreviation');
     $this->month_abbrev[__('November')] = __('Nov_November_abbreviation');
     $this->month_abbrev[__('December')] = __('Dec_December_abbreviation');
     foreach ($this->month_abbrev as $month_ => $month_abbrev_) {
         $this->month_abbrev[$month_] = preg_replace('/_.+_abbreviation$/', '', $month_abbrev_);
     }
     // The Meridiems
     $this->meridiem['am'] = __('am');
     $this->meridiem['pm'] = __('pm');
     $this->meridiem['AM'] = __('AM');
     $this->meridiem['PM'] = __('PM');
     // Numbers formatting
     // See http://php.net/number_format
     $trans = _c('number_format_decimals|$decimals argument for http://php.net/number_format, default is 0');
     $this->number_format['decimals'] = 'number_format_decimals' == $trans ? 0 : $trans;
     $trans = _c('number_format_decimal_point|$dec_point argument for http://php.net/number_format, default is .');
     $this->number_format['decimal_point'] = 'number_format_decimal_point' == $trans ? '.' : $trans;
     $trans = _c('number_format_thousands_sep|$thousands_sep argument for http://php.net/number_format, default is ,');
     $this->number_format['thousands_sep'] = 'number_format_thousands_sep' == $trans ? ',' : $trans;
     // Import global locale vars set during inclusion of $locale.php.
     foreach ((array) $this->locale_vars as $var) {
         if (isset($GLOBALS[$var])) {
             $this->{$var} = $GLOBALS[$var];
         }
     }
 }
Exemplo n.º 20
0
function touch_time($edit = 1, $for_post = 1, $tab_index = 0)
{
    global $wp_locale, $post, $comment;
    if ($for_post) {
        $edit = in_array($post->post_status, array('draft', 'pending')) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date) ? false : true;
    }
    $tab_index_attribute = '';
    if ((int) $tab_index > 0) {
        $tab_index_attribute = " tabindex=\"{$tab_index}\"";
    }
    echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"' . $tab_index_attribute . ' /> <label for="timestamp">' . __('Edit timestamp') . '</label></legend>';
    $time_adj = time() + get_option('gmt_offset') * 3600;
    $post_date = $for_post ? $post->post_date : $comment->comment_date;
    $jj = $edit ? mysql2date('d', $post_date) : gmdate('d', $time_adj);
    $mm = $edit ? mysql2date('m', $post_date) : gmdate('m', $time_adj);
    $aa = $edit ? mysql2date('Y', $post_date) : gmdate('Y', $time_adj);
    $hh = $edit ? mysql2date('H', $post_date) : gmdate('H', $time_adj);
    $mn = $edit ? mysql2date('i', $post_date) : gmdate('i', $time_adj);
    $ss = $edit ? mysql2date('s', $post_date) : gmdate('s', $time_adj);
    echo "<select name=\"mm\" onchange=\"edit_date.checked=true\"{$tab_index_attribute}>\n";
    for ($i = 1; $i < 13; $i = $i + 1) {
        echo "\t\t\t<option value=\"{$i}\"";
        if ($i == $mm) {
            echo ' selected="selected"';
        }
        echo '>' . $wp_locale->get_month($i) . "</option>\n";
    }
    ?>
</select>
<input type="text" id="jj" name="jj" value="<?php 
    echo $jj;
    ?>
" size="2" maxlength="2" onchange="edit_date.checked=true"<?php 
    echo $tab_index_attribute;
    ?>
 />
<input type="text" id="aa" name="aa" value="<?php 
    echo $aa;
    ?>
" size="4" maxlength="5" onchange="edit_date.checked=true"<?php 
    echo $tab_index_attribute;
    ?>
 /> @
<input type="text" id="hh" name="hh" value="<?php 
    echo $hh;
    ?>
" size="2" maxlength="2" onchange="edit_date.checked=true"<?php 
    echo $tab_index_attribute;
    ?>
 /> :
<input type="text" id="mn" name="mn" value="<?php 
    echo $mn;
    ?>
" size="2" maxlength="2" onchange="edit_date.checked=true"<?php 
    echo $tab_index_attribute;
    ?>
 />
<input type="hidden" id="ss" name="ss" value="<?php 
    echo $ss;
    ?>
" size="2" maxlength="2" onchange="edit_date.checked=true" />
<?php 
    if ($edit) {
        printf(_c('Existing timestamp: %1$s %2$s, %3$s @ %4$s:%5$s|1: month, 2: month string, 3: full year, 4: hours, 5: minutes'), $wp_locale->get_month($mm), $jj, $aa, $hh, $mn);
    }
    ?>
</fieldset>
	<?php 
}
if (1 == count($posts) && is_singular()) {
    $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->comments} WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id));
    if ($comments) {
        // Make sure comments, post, and post_author are cached
        update_comment_cache($comments);
        $post = get_post($id);
        $authordata = get_userdata($post->post_author);
        ?>

<br class="clear" />

<table class="widefat" cellspacing="0">
<thead>
  <tr>
    <th scope="col" class="column-comment"><?php 
        echo _c('Comment|noun');
        ?>
</th>
    <th scope="col" class="column-author"><?php 
        _e('Author');
        ?>
</th>
    <th scope="col" class="column-date"><?php 
        _e('Submitted');
        ?>
</th>
  </tr>
</thead>
<tbody id="the-comment-list" class="list:comment">
<?php 
        foreach ($comments as $comment) {
Exemplo n.º 22
0
/**
 * Localize list items before the rest of the content.
 *
 * The '%l' must be at the first characters can then contain the rest of the
 * content. The list items will have ', ', ', and', and ' and ' added depending
 * on the amount of list items in the $args parameter.
 *
 * @since 2.5.0
 *
 * @param string $pattern Content containing '%l' at the beginning.
 * @param array $args List items to prepend to the content and replace '%l'.
 * @return string Localized list items and rest of the content.
 */
function wp_sprintf_l($pattern, $args)
{
    // Not a match
    if (substr($pattern, 0, 2) != '%l') {
        return $pattern;
    }
    // Nothing to work with
    if (empty($args)) {
        return '';
    }
    // Translate and filter the delimiter set (avoid ampersands and entities here)
    $l = apply_filters('wp_sprintf_l', array('between' => _c(', |between list items'), 'between_last_two' => _c(', and |between last two list items'), 'between_only_two' => _c(' and |between only two list items')));
    $args = (array) $args;
    $result = array_shift($args);
    if (count($args) == 1) {
        $result .= $l['between_only_two'] . array_shift($args);
    }
    // Loop when more than two args
    $i = count($args);
    while ($i) {
        $arg = array_shift($args);
        $i--;
        if ($i == 1) {
            $result .= $l['between_last_two'] . $arg;
        } else {
            $result .= $l['between'] . $arg;
        }
    }
    return $result . substr($pattern, 2);
}
			echo '<br />';
		}

		echo '</p></div>';
	}
}
?>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<h2><?php _e('Manage Comments'); ?></h2>

<ul class="subsubsub">
<?php
$status_links = array();
$num_comments = wp_count_comments();
$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 'approved' => _c('Approved|plural'));
$class = ( '' === $comment_status ) ? ' class="current"' : '';
$status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>";
foreach ( $stati as $status => $label ) {
	$class = '';

	if ( $status == $comment_status )
		$class = ' class="current"';

	$status_links[] = "<li><a href=\"edit-comments.php?comment_status=$status\"$class>" . $label . '</a>';
}

$status_links = apply_filters( 'comment_status_links', $status_links );

echo implode(' | </li>', $status_links) . '</li>';
unset($status_links);
Exemplo n.º 24
0
/**
 * Display incoming links dashboard widget content.
 *
 * @since unknown
 */
function wp_dashboard_incoming_links_output() {
	$widgets = get_option( 'dashboard_widget_options' );
	@extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP );
	$rss = @fetch_rss( $url );
	if ( isset($rss->items) && 0 < count($rss->items) )  {

		echo "<ul>\n";

		$rss->items = array_slice($rss->items, 0, $items);
		foreach ( $rss->items as $item ) {
			$publisher = '';
			$site_link = '';
			$link = '';
			$content = '';
			$date = '';
			$link = clean_url( strip_tags( $item['link'] ) );

			if ( isset( $item['author_uri'] ) )
				$site_link = clean_url( strip_tags( $item['author_uri'] ) );

			if ( !$publisher = wp_specialchars( strip_tags( isset($item['dc']['publisher']) ? $item['dc']['publisher'] : $item['author_name'] ) ) )
				$publisher = __( 'Somebody' );
			if ( $site_link )
				$publisher = "<a href='$site_link'>$publisher</a>";
			else
				$publisher = "<strong>$publisher</strong>";

			if ( isset($item['description']) )
				$content = $item['description'];
			elseif ( isset($item['summary']) )
				$content = $item['summary'];
			elseif ( isset($item['atom_content']) )
				$content = $item['atom_content'];
			else
				$content = __( 'something' );
			$content = wp_html_excerpt($content, 50) . ' ...';
			if ( $link )
				$text = _c( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"|feed_display' );
			else
				$text = _c( '%1$s linked here saying, "%3$s"|feed_display' );

			if ( $show_date ) {
				if ( $show_author || $show_summary )
					$text .= _c( ' on %4$s|feed_display' );
				$date = wp_specialchars( strip_tags( isset($item['pubdate']) ? $item['pubdate'] : $item['published'] ) );
				$date = strtotime( $date );
				$date = gmdate( get_option( 'date_format' ), $date );
			}

			echo "\t<li>" . sprintf( _c( "$text|feed_display" ), $publisher, $link, $content, $date ) . "</li>\n";
		}

		echo "</ul>\n";

	} else {
		echo '<p>' . __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links&hellip; yet. It&#8217;s okay &#8212; there is no rush.') . "</p>\n";
	}
}
Exemplo n.º 25
0
        /**
         * Display the day events for the date $d.
         * @param string $d 			date for which to shw events
         */
        function display($d)
        {
            ?>
    <link type="text/css" rel="stylesheet" href="<?php 
            bloginfo('siteurl');
            ?>
/wp-includes/js/thickbox/thickbox.css" />
    <link type="text/css" rel="stylesheet" href="<?php 
            echo EVENTSCALENDARCSSURL;
            ?>
/events-calendar.css" />
<?php 
            $options = get_option('optionsEventsCalendar');
            $events = $this->db->getDaysEvents($d);
            list($ec_year, $ec_month, $ec_day) = explode("-", $d);
            ?>
      <div id="EC_daysEvents">
<?php 
            foreach ($events as $event) {
                if ($event->accessLevel == 'public' || current_user_can($event->accessLevel)) {
                    $title = stripslashes($event->eventTitle);
                    $description = preg_replace('#\\r?\\n#', '<br />', $event->eventDescription);
                    $description = stripslashes($description);
                    $location = stripslashes($event->eventLocation);
                    $PostID = isset($event->postID) ? $event->postID : '';
                    $linkout = isset($event->eventLinkout) ? $event->eventLinkout : '';
                    list($ec_startyear, $ec_startmonth, $ec_startday) = explode("-", $event->eventStartDate);
                    if (!is_null($event->eventStartTime) && !empty($event->eventStartTime)) {
                        list($ec_starthour, $ec_startminute, $ec_startsecond) = explode(":", $event->eventStartTime);
                        $startTime = date($options['timeFormatWidget'], mktime($ec_starthour, $ec_startminute, $ec_startsecond, $ec_startmonth, $ec_startday, $ec_startyear));
                    } else {
                        $startTime = null;
                    }
                    $startDate = date($options['dateFormatWidget'], mktime($ec_starthour, $ec_startminute, $ec_startsecond, $ec_startmonth, $ec_startday, $ec_startyear));
                    list($ec_endyear, $ec_endmonth, $ec_endday) = explode("-", $event->eventEndDate);
                    if ($event->eventEndTime != null && !empty($event->eventEndTime)) {
                        list($ec_endhour, $ec_endminute, $ec_endsecond) = explode(":", $event->eventEndTime);
                        $endTime = date($options['timeFormatWidget'], mktime($ec_endhour, $ec_endminute, $ec_endsecond, $ec_endmonth, $ec_endday, $ec_endyear));
                    } else {
                        $endTime = null;
                    }
                    $endDate = date($options['dateFormatWidget'], mktime($ec_endhour, $ec_endminute, $ec_endsecond, $ec_endmonth, $ec_endday, $ec_endyear));
                    // Title
                    $output = '<p>' . "\n" . '<div for="EC_title" class="EC_title"><strong>&nbsp;' . $title . '</strong></div>' . "\n";
                    // If Location
                    if (!empty($location) && !is_null($location)) {
                        $output .= '<div for="EC_location" class="EC_location"><strong>&nbsp;' . _c('Location', 'events-calendar') . ':</strong> ' . $location . '</div>' . "\n";
                    }
                    // start time
                    if (!empty($startTime) && !is_null($startTime)) {
                        $output .= '<div for="EC_time" class="EC_time"><strong>&nbsp;' . $startTime . '</strong>&nbsp;';
                    }
                    // end Time
                    if (!empty($endTime) && !empty($startTime) || !is_null($endTime) && !is_null($startTime)) {
                        $output .= _c('to', 'events-calendar') . '<strong>&nbsp;' . $endTime . '</strong>';
                    }
                    // Description
                    $output .= '</div><div for="EC_description" class="EC_description">&nbsp;' . $description . '</div>' . "\n";
                    // If Star Date <> End Date
                    if ($event->eventStartDate != $event->eventEndDate) {
                        $output .= '<div for="EC_date" class="EC_date"><strong>' . _c('Date range', 'events-calendar') . '</strong></div>' . _c('Since', 'events-calendar') . '&nbsp;' . $startDate . '&nbsp;' . _c('until', 'events-calendar') . '&nbsp;' . $endDate . "\n";
                    }
                    // Link outside the site if the link exist
                    if ($linkout != '') {
                        $output .= '<div for="EC_linkout" class="EC_linkout_and_postid"><strong>' . _c('Link out', 'events-calendar') . '</strong></div><a href="' . $linkout . '" target="_parent">' . substr($linkout, 0, 37) . '</a>';
                    }
                    // Link to a post when exist
                    if ($PostID != '') {
                        $IDtmp = get_post($PostID);
                        $ptitle = $IDtmp->post_title;
                        $output .= '<div for="EC_postid" class="EC_linkout_and_postid"><strong>' . _c('Post', 'events-calendar') . ' (' . $PostID . ')</strong></div><a href="' . get_permalink($PostID) . '" target="_parent"/>' . stripslashes($ptitle) . '</a><br />';
                    }
                    echo $output;
                }
                // if
            }
            // for each
        }
Exemplo n.º 26
0
 /**
  * @Request({"ids": "array"}, csrf=true)
  */
 public function deleteAction($ids = [])
 {
     $widgets = $this->getWidgets();
     foreach ($ids as $id) {
         unset($widgets[$id]);
     }
     $this->save($widgets);
     $this['message']->success(_c('{0} No widgets deleted.|{1} Widget deleted.|]1,Inf[ Widgets deleted.', count($ids)));
     return $this->redirect('@system/dashboard/settings');
 }
Exemplo n.º 27
0
<!-- Start Search -->
<div class="search">
  <form method="get" action="<?php 
bloginfo('url');
?>
/">
   <fieldset>
     <legend><span><?php 
_e('Search');
?>
</span></legend>
   <input type="text" value="<?php 
the_search_query();
?>
" name="s" /><button type="submit"><?php 
echo _c('Search|verb', 'compositio');
?>
</button>
   </fieldset>
  </form>
<div class="syn">
 <ul>
  <li><?php 
printf(__('<a href="%s">Entries</a> (RSS)', 'compositio'), get_bloginfo('rss2_url', 'display'));
?>
</li>
  <li><?php 
printf(__('<a href="%s">Comments</a> (RSS)', 'compositio'), get_bloginfo('comments_rss2_url', 'display'));
?>
</li>
 </ul>
Exemplo n.º 28
0
	<?php 
        /* If this is a monthly archive */
    } elseif (is_month()) {
        ?>
	 <h2 class="archive"><?php 
        printf(_c('Archive for %s|Monthly archive page', 'journalist'), get_the_time(__('F, Y', 'journalist')));
        ?>
</h2>

	<?php 
        /* If this is a yearly archive */
    } elseif (is_year()) {
        ?>
	 <h2 class="archive"><?php 
        printf(_c('Archive for %s|Yearly archive page', 'journalist'), get_the_time(__('Y', 'journalist')));
        ?>
</h2>

	<?php 
        /* If this is an author archive */
    } elseif (is_author()) {
        ?>
	 <h2 class="archive"><?php 
        _e('Author Archive', 'journalist');
        ?>
</h2>

	<?php 
        /* If this is a paged archive */
    } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
Exemplo n.º 29
0
function akismet_rightnow()
{
    global $submenu, $wp_db_version;
    if (8645 < $wp_db_version) {
        // 2.7
        $link = 'edit-comments.php?comment_status=spam';
    } elseif (isset($submenu['edit-comments.php'])) {
        $link = 'edit-comments.php?page=akismet-admin';
    } else {
        $link = 'edit.php?page=akismet-admin';
    }
    if ($count = get_option('akismet_spam_count')) {
        $intro = sprintf(__ngettext('<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already,', '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already,', $count), 'http://akismet.com/', number_format_i18n($count));
    } else {
        $intro = sprintf(__('<a href="%1$s">Akismet</a> blocks spam from getting to your blog,'), 'http://akismet.com/');
    }
    if ($queue_count = akismet_spam_count()) {
        $queue_text = sprintf(__ngettext('and there\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.', 'and there are <a href="%2$s">%1$s comments</a> in your spam queue right now.', $queue_count), number_format_i18n($queue_count), clean_url($link));
    } else {
        $queue_text = sprintf(__("but there's nothing in your <a href='%1\$s'>spam queue</a> at the moment."), clean_url($link));
    }
    $text = sprintf(_c('%1$s %2$s|akismet_rightnow'), $intro, $queue_text);
    echo "<p class='akismet-right-now'>{$text}</p>\n";
}
		<li><a href="theme-editor.php?file=<?php 
                echo "{$template_file}";
                ?>
&amp;theme=<?php 
                echo urlencode($theme);
                ?>
"><?php 
                echo $filedesc;
                ?>
</a></li>
<?php 
            }
            ?>
	</ul>
	<h4><?php 
            echo _c('Styles|Theme stylesheets in theme editor');
            ?>
</h4>
	<ul>
<?php 
            foreach ($themes[$theme]['Stylesheet Files'] as $style_file) {
                $description = get_file_description($style_file);
                $style_show = basename($style_file);
                $filedesc = $description != $style_file ? "{$description} <span class='nonessential'>({$style_show})</span>" : "{$description}";
                $filedesc = $style_file == $file ? "<span class='highlight'>{$description} <span class='nonessential'>({$style_show})</span></span>" : $filedesc;
                ?>
		<li><a href="theme-editor.php?file=<?php 
                echo "{$style_file}";
                ?>
&amp;theme=<?php 
                echo urlencode($theme);