Пример #1
0
function make_content($row)
{
    global $tp;
    $contents = utf8_decode(stripslashes($tp->toHTML($row['page_content'], true, 'body')));
    include_once "Textile.php";
    $textile = new Textile();
    $contents = $textile->process($contents);
    return $contents . "<p><small>" . LAN_W_8 . " <a href='" . e_HTTP . "user.php?id." . $row['page_author'] . "'>" . get_username($row['page_author']) . "</a></small></p>";
}
Пример #2
0
function search_wiki($row)
{
    require_once e_PLUGIN . 'wiki/preferences.php';
    // Populate as many of the $res array keys as is sensible for the plugin
    $res['link'] = e_PLUGIN . "wiki/?page=" . urlencode($row['page_title']);
    $res['pre_title'] = "";
    $res['title'] = $row["page_title"] . "";
    $res['pre_summary'] = "";
    include_once e_PLUGIN . "wiki/Textile.php";
    $textile = new Textile();
    $res['summary'] = stripslashes($textile->process(stripslashes($row['page_content'])));
    $res['detail'] = "";
    return $res;
}
Пример #3
0
 /**
  * @param string $text Textile formatted text.
  * @return string HTML
  */
 public static function format($text)
 {
     static $textile;
     if (!isset($textile)) {
         $textile = new Textile();
     }
     foreach (PicoraEvent::getObserverList('PicoraTextile.beforeFormat') as $callback) {
         call_user_func($callback, $text);
     }
     $output = $textile->process($text);
     foreach (PicoraEvent::getObserverList('PicoraTextile.afterFormat') as $callback) {
         call_user_func($callback, $output);
     }
     return $output;
 }
Пример #4
0
function tc_post_process($text, $do_text = '', $do_char = '')
{
    if ($do_text == 'textile2') {
        require_once 'text-control/textile2.php';
        $t = new Textile();
        $text = $t->process($text);
    } else {
        if ($do_text == 'textile1') {
            require_once 'text-control/textile1.php';
            $text = textile($text);
        } else {
            if ($do_text == 'markdown') {
                require_once 'text-control/markdown.php';
                $text = Markdown($text);
            } else {
                if ($do_text == 'wpautop') {
                    $text = wpautop($text);
                } else {
                    if ($do_text == 'nl2br') {
                        $text = nl2br($text);
                    } else {
                        if ($do_text == 'none') {
                            $text = $text;
                        } else {
                            $text = wpautop($text);
                        }
                    }
                }
            }
        }
    }
    if ($do_char == 'smartypants') {
        require_once 'text-control/smartypants.php';
        $text = SmartyPants($text);
    } else {
        if ($do_char == 'wptexturize') {
            $text = wptexturize($text);
        } else {
            if ($do_char == 'none') {
                $text = $text;
            } else {
                $text = wptexturize($text);
            }
        }
    }
    return $text;
}
Пример #5
0
 function sort($sort = '')
 {
     /*  Load Textile  */
     $this->load->plugin('textile');
     /*  Load Javascripts  */
     $head[] = js_tags('prototype');
     $head[] = js_tags('scriptaculous.js?load=effects');
     $head[] = js_tags('lightbox');
     $head[] = css_link('lightbox');
     /*  Add the sort options to the content area.  */
     $content[] = $this->load->view('partials/portfolio/sort_options', array('sort_nav' => $sort), TRUE);
     /*  Get all portfolio entries.  */
     switch ($sort) {
         case 'sites':
             $entries = $this->portfolio_model->get_type('1');
             break;
         case 'apps':
             $entries = $this->portfolio_model->get_type('2');
             break;
         case 'logos':
             $entries = $this->portfolio_model->get_type('3');
             break;
         case 'all':
             $entries = $this->portfolio_model->get_alpha();
             break;
         default:
             $entries = $this->portfolio_model->get_recent();
     }
     if ($entries->num_rows() > 0) {
         /*  Loop through them. Get some additional data, build the content view.  */
         foreach ($entries->result() as $item) {
             $temp_types = array();
             $image_list = array();
             $item->snippet = '';
             /*  Get portfolio images.  */
             $images = $this->portfolio_model->get_images($item->id);
             /*  We need at least one item in the list & one snippet.  */
             if ($images->num_rows() >= 2) {
                 /*  Start the list.  */
                 $image_list[] = '<ul>';
                 $num = 0;
                 $snippet_link = '';
                 $snippet_title = '';
                 /*  Loop through the images.  */
                 foreach ($images->result() as $image) {
                     /*  If it's a snippet we set the snippet property.  */
                     if ($image->type != 'snippet') {
                         /*  Add item to the list array.  */
                         $image_list[] = '<li><a href="' . $image->src . '" rel="lightbox[' . $item->id . ']" title="' . (!empty($image->title) ? $image->title : 'Additional Screenshot') . '">' . (!empty($image->title) ? $image->title : 'Additional Screenshot') . '</a></li>';
                         if ($num == 0) {
                             $snippet_link = $image->src;
                             $snippet_title = $image->title;
                         }
                         $num++;
                     }
                 }
                 foreach ($images->result() as $image) {
                     if ($image->type == 'snippet' && $snippet_link != '') {
                         /*  Set snippet.  */
                         $item->snippet = '<a href="' . $snippet_link . '" rel="lightbox[' . $item->id . ']" title="' . (!empty($snippet_title) ? $snippet_title : 'Additional Screenshot') . '"><img src="' . $image->src . '" /></a>';
                     }
                 }
                 /*  Close the list.  */
                 $image_list[] = '</ul>';
             }
             /*  Build final image list.  */
             $item->image_list = implode("\n", $image_list);
             /*  Get item types.  */
             $types = $this->portfolio_model->get_types($item->id);
             /*  Loop through the types and get only the names.  */
             foreach ($types->result() as $type) {
                 $temp_types[] = $type->name;
             }
             /*  Create Pipe Separated List of Types  */
             $item->types = implode(' | ', $temp_types);
             /*  Link to the site if applicable.  */
             $item->anchor = !empty($item->uri) ? '<p><a href="' . $item->uri . '" target="new">Visit Site</a></p>' : '';
             /*  TEXTILE  */
             $textile = new Textile();
             $item->blurb = $textile->process($item->blurb);
             /*  View Content  */
             $entry = array('item' => $item);
             /*  Load view.  */
             $content[] = $this->load->view('partials/portfolio/item', $entry, TRUE);
         }
     }
     /*  Frame Data  */
     $frame = array('site_title' => $this->config->item('title'), 'head' => implode('', $head), 'area_title' => 'Portfolio', 'body_id' => 'portfolio', 'content' => implode("\n", $content));
     /*  Load the Frame View  */
     $this->load->view('frames/public', $frame);
 }
Пример #6
0
function Textile($text)
{
    $textile = new Textile();
    return $textile->process($text);
}
Пример #7
0
function tc_post_process($text, $do_text = '', $do_char = '')
{
    if ('textile2' == $do_text) {
        require_once 'text-control/textile2.php';
        $t = new Textile();
        $text = $t->process($text);
    } else {
        if ('textile1' == $do_text) {
            require_once 'text-control/textile1.php';
            $text = textile($text);
        } else {
            if ('markdown' == $do_text) {
                require_once 'text-control/markdown.php';
                //$text = Markdown_Parser($text);
                $o = new Markdown_Parser();
                return $o->transform($text);
            } else {
                if ('txt2tags' == $do_text) {
                    require_once 'text-control/txt2tags.class.php';
                    $x = new T2T($text);
                    $x->go();
                    return $text = $x->bodyhtml;
                } else {
                    if ('wpautop' == $do_text) {
                        $text = wpautop($text);
                    } else {
                        if ('nl2br' == $do_text) {
                            $text = nl2br($text);
                        } else {
                            if ('none' == $do_text) {
                                $text = $text;
                            } else {
                                $text = wpautop($text);
                            }
                        }
                    }
                }
            }
        }
    }
    if ('smartypants' == $do_char) {
        require_once 'text-control/smartypants.php';
        $text = SmartyPants($text);
    } else {
        if ('wptexturize' == $do_char) {
            $text = wptexturize($text);
        } else {
            if ('none' == $do_char) {
                $text = $text;
            } else {
                $text = wptexturize($text);
            }
        }
    }
    return $text;
}