public static function plugin_row_meta($meta, $file)
 {
     global $CRAYON_DONATE;
     if ($file == CrayonWP::basename()) {
         $meta[] = '<a href="options-general.php?page=crayon_settings">' . crayon__('Settings') . '</a>';
         $meta[] = '<a href="options-general.php?page=crayon_settings&theme-editor=1">' . crayon__('Theme Editor') . '</a>';
         $meta[] = '<a href="' . $CRAYON_DONATE . '" target="_blank">' . crayon__('Donate') . '</a>';
     }
     return $meta;
 }
 public static function post_get_excerpt($e)
 {
     CrayonLog::debug('post_get_excerpt');
     self::$is_excerpt = FALSE;
     return $e;
 }
Exemplo n.º 3
0
function wplms_unit_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    ?>
  <li <?php 
    comment_class(empty($args['has_children']) ? '' : 'parent');
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
" data-id="<?php 
    comment_ID();
    ?>
">
      <div id="div-comment-<?php 
    comment_ID();
    ?>
" class="unit-comment-body">
          <div class="unit-comment-author vcard">
              <?php 
    if ($args['avatar_size'] != 0) {
        if (function_exists('bp_core_fetch_avatar')) {
            echo bp_core_fetch_avatar(array('item_id' => $comment->user_id, 'type' => 'thumb'));
        }
    }
    ?>
          </div>
          <div class="unit-comment-text">
          <?php 
    echo '<cite class="fn">' . bp_core_get_user_displayname($comment->user_id) . '</cite>';
    ?>
           <div class="unit-comment-meta commentmetadata">
                <?php 
    if (current_user_can('edit_posts')) {
        ?>
  <a href="<?php 
        echo htmlspecialchars(get_comment_link($comment->comment_ID));
        ?>
"><?php 
    }
    $time_passed = human_time_diff(get_comment_time('U'), current_time('timestamp'));
    printf(__('%s ago', 'vibe'), $time_passed);
    if (current_user_can('edit_posts')) {
        ?>
</a><?php 
    }
    ?>
          </div>
          <?php 
    if ($comment->comment_approved == '0') {
        ?>
          <em class="comment-awaiting-moderation"><?php 
        _e('Your comment is awaiting moderation.');
        ?>
</em>
          <?php 
    }
    ?>
              <?php 
    $mycomment = get_comment_text();
    //$crayon = '<pre class="lang:html toolbar:always mark:1">' . $mycomment . '</pre>';
    // Add Crayon to content
    echo CrayonWP::highlight($mycomment);
    ?>
              <div class="reply" data-parent="<?php 
    comment_ID();
    ?>
">
                 <a ><?php 
    _e('REPLY', 'vibe');
    ?>
</a>
              </div>
          </div>
      </div>
  </li>
<?php 
}
<div id="crayon-te-content">

<?php 
$crayon_root_te = dirname(dirname(dirname(__FILE__)));
require_once $crayon_root_te . '/crayon_wp.class.php';
require_once CrayonWP::wp_load_path();
require_once CRAYON_TE_PHP;
require_once CRAYON_PARSER_PHP;
CrayonSettingsWP::load_settings();
$langs = CrayonParser::parse_all();
$curr_lang = CrayonGlobalSettings::val(CrayonSettings::FALLBACK_LANG);
$themes = CrayonResources::themes()->get();
$curr_theme = CrayonGlobalSettings::val(CrayonSettings::THEME);
$fonts = CrayonResources::fonts()->get();
$curr_font = CrayonGlobalSettings::val(CrayonSettings::FONT);
CrayonTagEditorWP::init_settings();
class CrayonTEContent
{
    public static function select_resource($id, $resources, $current, $set_class = TRUE)
    {
        $id = CrayonSettings::PREFIX . $id;
        if (count($resources) > 0) {
            $class = $set_class ? 'class="' . CrayonSettings::SETTING . ' ' . CrayonSettings::SETTING_SPECIAL . '"' : '';
            echo '<select id="' . $id . '" name="' . $id . '" ' . $class . ' ' . CrayonSettings::SETTING_ORIG_VALUE . '="' . $current . '">';
            foreach ($resources as $resource) {
                $asterisk = $current == $resource->id() ? ' *' : '';
                echo '<option value="' . $resource->id() . '" ' . selected($current, $resource->id()) . ' >' . $resource->name() . $asterisk . '</option>';
            }
            echo '</select>';
        } else {
            // None found, default to text box
<?php

require_once dirname(dirname(__FILE__)) . '/crayon_wp.class.php';
require_once CrayonWP::wp_load_path();
echo '<link rel="stylesheet" href="', plugins_url(CRAYON_STYLE, dirname(__FILE__)), '?ver=', $CRAYON_VERSION, '" type="text/css" media="all" />';
echo '<div id="content">';
CrayonSettingsWP::load_settings();
// Run first to ensure global settings loaded
$crayon = CrayonWP::instance();
// Settings to prevent from validating
$preview_settings = array();
// Load settings from GET and validate
foreach ($_GET as $key => $value) {
    //	echo $key, ' ', $value , '<br/>';
    if (!in_array($key, $preview_settings)) {
        $_GET[$key] = CrayonSettings::validate($key, $value);
    }
}
$crayon->settings($_GET);
if (!isset($crayon_preview_dont_override_get) || !$crayon_preview_dont_override_get) {
    $settings = array(CrayonSettings::TOP_SET => TRUE, CrayonSettings::TOP_MARGIN => 10, CrayonSettings::BOTTOM_SET => FALSE, CrayonSettings::BOTTOM_MARGIN => 0);
    $crayon->settings($settings);
}
// Print the theme CSS
$theme_id = $crayon->setting_val(CrayonSettings::THEME);
if ($theme_id != NULL) {
    echo CrayonResources::themes()->get_css($theme_id);
}
$font_id = $crayon->setting_val(CrayonSettings::FONT);
if ($font_id != NULL) {
    echo CrayonResources::fonts()->get_css($font_id);