×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Figlet Extension: Difference between revisions

    Content added Content deleted
    imported>DrOwl
    imported>DrOwl
    Line 51:
    # $input = mysql_escape_string($input);
    $figlet = passthru('echo $input | /home/drowl/figlet/figlet -d /home/drowl/figlet/fonts');
    $output="<nowiki><pre></nowiki>";
    $output.="$figlet";
    $output.="<nowiki></pre></nowiki>";
     
    return $output;

    Revision as of 01:10, 21 May 2005

    Integrate figlet text into wiki pages using figletlink in a custom Mediawiki extension:

    this is a first untestedversion with justmonkey knolage of how to make it work

    Syntax

    <figlet>text</figlet>

    Example

    <figlet>moo</figlet>

    example Result

    | '_ ` _ \ / _ \ / _ \ 
    | | | | | | (_) | (_) |
    |_| |_| |_|\___/ \___/ 
    

    (not installed on anything this is only beta i dont have figlet installed on this server)

    Source

    <?php
    # Figlet Mediawiki extension
    # using shell figlet 
    # by DrOwl 21.06.2005
    #modded from
    # by mutante 25.03.2005
    
    #install extension hook
    $wgExtensionFunctions[] = "wfFigletExtension";
    
    
    #extension hook callback function
    function wfFigletExtension() { 
      global $wgParser;
     
      #install parser hook for <figlet> tags
      $wgParser->setHook( "figlet", "renderFiglet" );
    }
    
    function renderFiglet( $input ) {
    global $wgOutputEncoding;
     
        # $input = mysql_escape_string($input);
        
    if (!$input) $input = "mu"; #ifno input then mu
    
    $input =~ /[Aa-Zz]|[1-0];
    # $input = mysql_escape_string($input);
    $figlet = passthru('echo $input | /home/drowl/figlet/figlet -d /home/drowl/figlet/fonts');
    $output="<pre>";
    $output.="$figlet";
    $output.="<nowiki>

    </nowiki>";

    return $output;

    }

    ?>

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.

    Recent changes

  • BruderSpektrum • 12 hours ago
  • BruderSpektrum • 16 hours ago
  • BruderSpektrum • 16 hours ago
  • BruderSpektrum • 16 hours ago
  • Cookies help us deliver our services. By using our services, you agree to our use of cookies.