Viewing 1 replies (of 1 total)
  • Okay….ummmm… I must have done something wrong. This is the php file as I edited it:
    <?php
    /*
    Plugin Name: Witty Text
    Plugin URI: https://www.w-a-s-a-b-i.com/
    Description: Outputs a random text sniplet, predefined in a text file.
    Version: 1.0
    Author: Alexander Malov
    Author URI: https://www.w-a-s-a-b-i.com/
    */
    function witty ($before = ”, $after = ”) {
    $witty_file =”/var/www/html/witty.txt”; // /htdocs/blog/wp-content/plugins/witty.txt
    $sniplets = file(“$witty_file”);
    $sniplet = rand(0, sizeof($sniplets)-1);
    echo $before, $sniplets[$sniplet], $after;
    }
    ?>
    And this is the warning I got when it didn’t work:
    Warning: file(/var/www/html/witty.txt): failed to open stream: No such file or directory in /www/c/chanz/htdocs/blog/wp-content/plugins/witty.php on
    What did I do wrong?
    ugh….someday I will figure this stuff out…..
    Kate

Viewing 1 replies (of 1 total)
  • The topic ‘YAUP’ is closed to new replies.