I have not made such a mod.

27

(34 replies, posted in PunBB 1.2 bug reports)

(removed)

Connorhd wrote:

...

wrong wrong wrong tongue

you can use <center> you don't need to do <br /> (infact i think its wrong to use it in html), and you don't need a doctype

have a look at the source on http://www.google.com/ tongue

just because punbb is 1337 doesn't mean everyone else MUST be

I'm just saying. And running it through the validator without a DOCTYPE will make it default to something (and it may not be the intended DOCTYPE). After all, I did say "just a suggestion."

And isn't <center> deprecated?

EDIT: I never knew Google was so bad at HTML.
1. You need to say what language in <script>.
2. The DOCTYPE is mandatory.
3. This is what the validator said: http://validator.w3.org/check?uri=http% … ;verbose=1

It also said:

A DOCTYPE Declaration is mandatory for most current markup languages and without one it is impossible to reliably validate this document. I am falling back to "HTML 4.01 Transitional" and will attempt to validate the document anyway, but this is very likely to produce spurious error messages for most non-trivial documents.

So, yes, DOCTYPE is mandatory. See this.

29

(2 replies, posted in PunBB 1.2 troubleshooting)

Try upgrading to PunBB 1.2.5. (You have to uprade to 1.2 first.)

30

(7 replies, posted in PunBB 1.2 troubleshooting)

If it's the Microsoft® FTP thingy, right-click > Properties and under Permissions, check all the boxes.

Also, some hosts will not let certain directories be "world writable", so you may want to make that 755 (in the Microsoft® FTP thingy, check all read/execute boxes, and check write just for owner) if that's the case.

One thing, you should use <div style="text-align: center"> instead of <center>, and close empty tags (<br></br> or <br /> instead of <br>). Just a suggestion.

Oh. And you MUST, I mean MUST, put in the DOCTYPE.
Example: For XHTML 1.0 Strict, use <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML 1.0 Transitional: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 Frameset: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

I'm not good at MySQL queries.

What errors did you get?

33

(9 replies, posted in PunBB 1.2 troubleshooting)

Is that Supermod? I made a better installer/upgrader for it (only works with MySQL, though). It's in the release post, or try http://www.scottywz.com/phpxplorer.scot … e_EASY.zip.

34

(3 replies, posted in PunBB 1.2 troubleshooting)

Upgrade to MySQL 3.23.17 or later

And my Web host won't let me do cron jobs.

36

(35 replies, posted in General discussion)

1. My mod will only allow certain elements/attributes.
2. How many users will make a 10000 x 10000 red box with the word "Whoops" on it?

No, it would, unless the headers were set up to tell the browser not to cache it.

shinko_metsuo wrote:

Err I got a list of errors

Did you follow the instructions?

Here's how I have it:

NOTE. My host charges an extra $20 USD/year for unlimited subdomains. (I just have to make a directory called subdomain.scottywz.com or sig.scottywz.com or whatever.)
1. I made a directory called sig.scottywz.com (see above); however, you can call it whatever. Or, you can just skip this step.
2. Make a file called quotes.php like you did. It is easiest to call it that, but if you HAVE to call it something else, edit

include "quotes.php";

(see below code) to whatever.
3. Make a file called index.php with:

<?php 
    /* ScrobblerSig 2.1 by Timothy Humphrey (Humpty), http://timothyhumphrey.name/scrobblersig 
     * 
     * Contributors 
     * 
     * electrichamster - The original creator of ScrobblerSig 
     * russ 
     */ 
     
    /* ---------- Main User Config ---------- */ 
     
    /* 
     * The options that are listed below may be specified in the url if the allowParameters option is 
     * true.  To do so first append a question mark ? to the end of the url.  Next, specify the option 
     * name followed by an equal sign = and then the value; for example, option=value.  Multiple options 
     * are specified by separating them with an ampersand &; for example, option1=value1&option2=value2. 
     * Enter %26 to specify an ampersand & character in the url, %3D for an equal = sign. 
     * 
     * The username option is an exception and is always allowed to be specified in the url, but whether 
     * or not it is actually used depends on other options. 
     * 
     * All parameters may be specified by their regular name or by a short form; the short form that can 
     * be used is specified in parenthesis at the beginning of the parameter's description.  The general 
     * naming convention for the short name is to use the first letter of each word comprising the name. 
     * Be aware of conflicts though, such as backgroundColor (bc) and borderColor (bdc).  Whether the 
     * full or short name is used specify the parameter name in lowercase. 
     * 
     * Examples 
     * 
     * scrobblersig.php 
     * scrobblersig.php?fontsize=24 
     * scrobblersig.php?labelcolor=aa0000&trackcolor=a9b200 
     * scrobblersig.php?fs=24 
     * scrobblersig.php?lc=aa0000&tc=a9b200 
     */ 
    //(u) Audioscrobbler username, see the allowAnyUser and allowWhitelistedUser options for info about 
    //using this option in the url. 
    $username = "ScottyWZ"; 

    /* 
     * All of the "-label" options below can display the time the track is played by specifying time 
     * variables: 
     *    - <date> Outputs the date according to the dateFormat option 
     *    - <time> Outputs the time according to the timeFormat option 
     *    - <zone> Outputs the timezone according to the timeZoneOffset and timeZoneLabel options.  The 
     *      timeZoneLabel is output instead of the timeZoneOffset if it is present. 
     * 
     * Example 
     * 
     * "This song was played at <time> <zone> on <date>" 
     */ 

    //This must be defined 
    $nlnt = "\n\n"; 

    //Sig text 
    include "quotes.php"; 
     
    //(cpl) Text to display if track is currently playing 
    $currentlyPlayingLabel = $st.".   (Updated every 15 seconds) Currently listening to this song / Last song listened to was:"; 
     
    //(lpl) Text to display if track isn't currently playing 
    $lastPlayedLabel = $st.":   (Updated every 15 seconds) Currently listening to this song / Last song listened to was:"; 

    //(el1 and el2) Text to display if the song parse failed 
    $errorLabel1 = $st.".:  (Updated every 15 seconds) Currently listening to this song / Last song listened to was:"; 
    $errorLabel2 = "Song parse failed"; 

    /* 
     * Time formats, see http://www.php.net/date for details about the dateFormat and timeFormat 
     */ 
    //(df) Format used to replace the <date> pattern 
    $dateFormat = "D, M j, Y"; 
     
    //(tf) Format used to replace the <time> pattern 
    $timeFormat = "g:i A"; 
     
    //(tzo) Time between your time zone and GMT in [-]hour[:minute] format; that is the beginning minus 
    //sign is optional and so are the minutes, if minutes are included separate from hours with a colon. 
    //This is also used to replace the <zone> pattern if the timeZoneLabel option isn't specified. 
    $timeZoneOffset = "-5"; 
     
    //(tzl) Replaces the <zone> pattern 
    $timeZoneLabel = "EST"; 
     
    /* 
     * Formatting options.  The various "-color" options specify colors using the RRGGBB format, where 
     * RR represents the hexadecimal numerical amount of red, GG the amount of green, and BB the amount 
     * of blue; for example FF0000 is red, A9B200 is a dull golden color. 
     */ 
    //(f) The filename of the truetype font to use.  Native PHP font searching rules are used: 
    // - If the .ttf extension is not specified it is appended. 
    // - Most systems will search in the same directory as the script for the font and if it can't be 
    //   found search system font directories, this allows you to use any font on the system as well as 
    //   custom fonts. 
    $font = "Tahoma.ttf"; 

    //(fs) The size of the font in points 
    $fontSize = 8; 
     
    //(fc) The foreground color; the labelColor and trackColor parameters override this if set. 
    $foregroundColor = "000000"; 

    //The foreground color for Pastures of Plenty; the labelColor and trackColor parameters override this if set. 
    $foreground_color_Pastures = "FF0000"; 
     
    //(lc) The color of the track label, the first line of text 
    $labelColor = null; 
     
    //(tc) The color of the track text, the second line of text 
    $trackColor = null; 
     
    //(a) Whether antialiasing should be applied to the text; specify 1 for true and 0 for false in the 
    //url.  If set to true you should set the backgroundColor to match the background of the page the 
    //image will appear on for best results. 
    $antialias = true; 
     
    //(ha) Horizontal alignment of the text, can be "left" or "right" 
    $horizontalAlign = "left"; 
     
    //(b) Whether or not a border is drawn around the image; specify 1 for true and 0 for false in the 
    //url. 
    $border = false; 
     
    //(bdc) The color of the image border, see the border option 
    $borderColor = "FFFFFF"; 
     
    //(p) The padding to appear on the sides of the image; the horizontalPadding and verticalPadding 
    //parameters override this if set. 
    $padding = 3; 
     
    //(hp) The padding to appear on the left and right side of the image 
    $horizontalPadding = null; 
     
    //(vp) The padding to appear on the top and bottom of the image 
    $verticalPadding = null; 
     
    //(bc) The background color 
    $backgroundColor = "FFFFFF"; 
     
    //(bi) Background image to use; may be GIF, PNG, or JPEG format 
    $backgroundImage = null; 
     
    //(bt) Whether the backgroundColor appears; specify 1 for true and 0 for false in the url. 
    $backgroundTransparent = false; 
     
    //(it) The image format, may be "png" or "jpg" 
    $imageType = "jpg"; 
     
    //(mw) The maximum width of the image, 0 means unrestricted; ignored if a backgroundImage is used. 
    $maxWidth = 479; 
     
    //(mh) The maximum height of the image, 0 means unrestricted; ignored if a backgroundImage is used. 
    $maxHeight = 127; 
     
     
    /* 
     * The following options may NOT be specified in the url 
     */ 
    //Whether or not parameters specified in the url are used; setting this to false will result in 
    //fewer variations of images being cached on the server. 
    $allowParameters = true; 
     
    //Whether or not any username can be specified for the username option in the url; this takes 
    //precedence over the allowWhitelistedUser option. 
    $allowAnyUser = false; 
     
    //Whether or not whitelisted users can be specified for the username option in the url, see the 
    //whitelistedUserFilename option. 
    $allowWhitelistedUser = true; 
     
    //The filename of a list of usernames, one on each line, that are allowed to be specified for the 
    //username option; also see the allowWhitelistedUser option. 
    $whitelistedUserFilename = "scrobblersig-whitelist.txt"; 
     
    //Whether or not the browser's cache should be used to help minimize bandwidth usage 
    $useBrowserCache = true; 
     
    //Number of seconds information is cached from Audioscrobbler 
    $cacheDuration = 15; 
     
    //Number of seconds to wait for a response from the Audioscrobbler server 
    $timeout = 10; 



    /* ---------- Main code, do not edit past this point (Yeah, right) ---------- */ 
     
    //error_reporting(E_ERROR | E_WARNING); 
     
    function GetParameter($name, $altName, &$value, $bypassExtensionCheck = false) { 
        //Get parameter while checking for disguising file extension 
        if(isset($_GET[$name]) || isset($_GET[$altName])) { 
            $name = isset($_GET[$name]) ? $name : $altName; 
            $value = !$bypassExtensionCheck 
                ? preg_replace("/(.*?)(\.png|\.jpg|\.gif)*/i", "\\1", $_GET[$name]) 
                : $_GET[$name]; 
        } 
    } 
     
    /* Get values from parameters */ 
    if($allowAnyUser) 
        GetParameter("username", "u", $username); 
    elseif($allowWhitelistedUser) { 
        GetParameter("username", "u", $paramUsername); 
        if($paramUsername) { 
            $whitelistedUsers = @file_get_contents("./$whitelistedUserFilename"); 
            $username = preg_match("/\b$paramUsername\b/", $whitelistedUsers) ? $paramUsername : $username; 
        } 
    } 
     
    if($allowParameters) { 
        GetParameter("antialias", "a", $antialias); 
        GetParameter("backgroundcolor", "bc", $backgroundColor); 
        GetParameter("backgroundimage", "bi", $backgroundImage, true); 
        GetParameter("backgroundtransparent", "bt", $backgroundTransparent); 
        GetParameter("border", "b", $border); 
        GetParameter("bordercolor", "bdc", $borderColor); 
        GetParameter("currentlyplayinglabel", "cpl", $currentlyPlayingLabel); 
        GetParameter("dateformat", "df", $dateFormat); 
        GetParameter("errorlabel1", "el1", $errorLabel1); 
        GetParameter("errorlabel2", "el2", $errorLabel2); 
        GetParameter("font", "f", $font); 
        GetParameter("fontsize", "fs", $fontSize); 
        GetParameter("foregroundcolor", "fc", $foregroundColor); 
        GetParameter("horizontalalign", "ha", $horizontalAlign); 
        GetParameter("horizontalpadding", "hp", $horizontalPadding); 
        GetParameter("image_type", "it", $imageType); //supported for compatibility 
        GetParameter("imagetype", "it", $imageType); 
        GetParameter("labelcolor", "lc", $labelColor); 
        GetParameter("lastplayedlabel", "lpl", $lastPlayedLabel); 
        GetParameter("maxheight", "mh", $maxHeight); 
        GetParameter("maxwidth", "mw", $maxWidth); 
        GetParameter("padding", "p", $padding); 
        GetParameter("trackcolor", "tc", $trackColor); 
        GetParameter("timeformat", "tf", $timeFormat); 
        GetParameter("timezonelabel", "tzl", $timeZoneLabel); 
        GetParameter("timezoneoffset", "tzo", $timeZoneOffset); 
        GetParameter("verticalpadding", "vp", $verticalPadding); 
    } 
     
    /* Fix certain parameters to ensure proper values */ 
    if(!isset($labelColor)) $labelColor = $foregroundColor; 
    if(!isset($trackColor)) $trackColor = $foregroundColor; 
    if(!isset($horizontalPadding)) $horizontalPadding = $padding; 
    if(!isset($verticalPadding)) $verticalPadding = $padding; 
     
    $antialias = (bool) $antialias; 
    $backgroundTransparent = (bool) $backgroundTransparent; 
    $border = (bool) $border; 
    $fontSize = (int) $fontSize; 
    $horizontalAlign = $horizontalAlign == "right" ? "right" : "left"; 
    $horizontalPadding = (int) $horizontalPadding; 
    $maxHeight = (int) $maxHeight; 
    $maxWidth = (int) $maxWidth; 
    $verticalPadding = (int) $verticalPadding; 
     
    $temp = explode(":", $timeZoneOffset); 
    $timeZoneOffset = (int) $temp[0]; 
    if(count($temp) > 1) 
        $timeZoneOffset += (int) $temp[1] / 60 * (substr($temp[0], 0, 1) == "-" ? -1 : 1); 
     
    /* Check to see if the song info needs updating */ 
    $safeUsername = escapeshellcmd($username); 
    $dataFilename = "./sig-$safeUsername.txt"; 
    if(!file_exists($dataFilename) || (filemtime($dataFilename) + $cacheDuration < time())) { 
        //Delete cached images 
        $tempFiles = array_merge(glob("./sig-$safeUsername*.png"), glob("./sig-$safeUsername*.jpg")); 
        if($tempFiles != null) { 
            foreach($tempFiles as $filename) 
                @unlink($filename); 
        } 
         
        //Get user track data from Audioscrobbler 
        $data = ""; 
        $fp = @fopen("http://ws.audioscrobbler.com/txt/recent/$username", "r"); 
        if($fp != null) { 
            stream_set_timeout($fp, $timeout); 
            $data = fread($fp, 100000); 
            fclose($fp); 
        } 
         
        if(trim($data) != "") { 
            $dataFile = @fopen($dataFilename, "wt"); 
            if($dataFile != null) { 
                @fwrite($dataFile, $data); 
                @fclose($dataFile); 
            } 
        } 
        elseif(file_exists($dataFilename)) { 
            //Remove currently playing track info and preserve cached Audioscrobbler data 
            if($data = @file($dataFilename)) { 
                $data[0] = "\n"; 
                if($dataFile = @fopen($dataFilename, "wt")) { 
                    @fwrite($dataFile, implode("", $data)); 
                    @fclose($dataFile); 
                } 
            } 
        } 
    } 
     
    /* Determine if client cache should be used */ 
    if($useBrowserCache 
        && isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && file_exists($dataFilename) 
        && strtotime($_SERVER["HTTP_IF_MODIFIED_SINCE"]) == filemtime($dataFilename) 
        ) { 
        header("Status: 304 Not Modified", true, 304); //HTTP status set this way to work on IIS 
        exit; 
    } 
     
    /* Create image if no cached version of it exists */ 
    $imageFilename = "./sig-$safeUsername" . ($allowParameters && $_SERVER["QUERY_STRING"] ? "-" . md5($_SERVER["QUERY_STRING"]) : "") . ".$imageType"; 
    $image = null; 
    if(!file_exists($imageFilename)) { 
        $trackData = @file($dataFilename); 
        if($trackData != null) { 
            $trackData[0] = trim($trackData[0]); 

            //Check if a track is currently playing 
            if($trackData[0] != "") { 
                $track = "$trackData[0]"; 
                $label = $currentlyPlayingLabel; 
                $date = time(); 
            } 
            else { 
                $track = "$trackData[1]"; 
                $label = $lastPlayedLabel; 
                $date = strtotime($trackData[2]); 
            } 
             
            $track = html_entity_decode($track); 
             
            if($timeZoneOffset != "") 
                $date = strtotime((int) ($timeZoneOffset * 60) . " minute", $date); 
        } 
        else { 
            $label = $errorLabel1; 
            $track = "$errorLabel2"; 
            $date = time(); 
        } 
         
        //Replace time format variables with actual values 
        $label = str_replace("<date>", gmdate($dateFormat, $date), $label); 
        $label = str_replace("<time>", gmdate($timeFormat, $date), $label); 
        $label = str_replace("<zone>", $timeZoneLabel ? $timeZoneLabel : ($timeZoneOffset < 0 ? "-" : "+") . sprintf("%'02d", abs($timeZoneOffset)) . sprintf("%'02d", round(abs(($timeZoneOffset - (int) $timeZoneOffset) * 60))), $label); 
         
        $label = trim($label); 
        $track = trim($track); 

        /* Generate the image */ 
        //Get the text sizes 
        $labelBounds = imagettfbbox($fontSize, 0, $font, $label); 
        $labelWidth = $labelBounds[2] - $labelBounds[0] + 1; 
        $labelHeight = -$labelBounds[7] + $labelBounds[1] + 1; 
         
        $trackBounds = imagettfbbox($fontSize, 0, $font, $track); 
        $trackWidth = $trackBounds[2] - $trackBounds[0] + 1; 
        $trackHeight = -$trackBounds[7] + $trackBounds[1] + 1; 
         
        //Get image dimensions 
        $dimension = max($labelWidth, $trackWidth) + ($horizontalPadding * 2) + ($border ? 2 : 0); 
        $maxWidth = ($maxWidth > 0 && $dimension > $maxWidth) ? $maxWidth : $dimension; 
        $dimension = $labelHeight + $trackHeight + ($verticalPadding * 2) + ($border ? 2 : 0); 
        $maxHeight = ($maxHeight > 0 && $dimension > $maxHeight) ? $maxHeight : $dimension; 

        //Generate image canvas 
        if($backgroundImage != "") { 
            preg_match("/[^\.]+$/", $backgroundImage, $extension); 
            switch($extension[0]) { 
                case "gif": 
                    $image = @imagecreatefromgif($backgroundImage); 
                    break; 
                case "png": 
                    $image = @imagecreatefrompng($backgroundImage); 
                    break; 
                case "jpg": 
                    $image = @imagecreatefromjpeg($backgroundImage); 
                    break; 
            } 
        } 
        if($image == null) 
            $image = imagecreate($maxWidth, $maxHeight); 

        //Set the colors 
        preg_match_all("/[\dabcdef]{2}/i", $backgroundColor, $backColorParts); 
        preg_match_all("/[\dabcdef]{2}/i", $borderColor, $borderColorParts); 
        preg_match_all("/[\dabcdef]{2}/i", $labelColor, $labelColorParts); 
        preg_match_all("/[\dabcdef]{2}/i", $trackColor, $trackColorParts); 
        $blackColorPart = array(0, 0, 0); 
        if(count($backColorParts[0]) != 3) $backColorParts[0] = $blackColorPart; 
        if(count($borderColorParts[0]) != 3) $borderColorParts[0] = $blackColorPart; 
        if(count($labelColorParts[0]) != 3) $labelColorParts[0] = $blackColorPart; 
        if(count($trackColorParts[0]) != 3) $trackColorParts[0] = $blackColorPart; 
         
        $backColorIndex = imagecolorallocate($image, hexdec($backColorParts[0][0]), hexdec($backColorParts[0][1]), hexdec($backColorParts[0][2])); 
        $borderColorIndex = imagecolorallocate($image, hexdec($borderColorParts[0][0]), hexdec($borderColorParts[0][1]), hexdec($borderColorParts[0][2])); 
        $labelColorIndex = imagecolorallocate($image, hexdec($labelColorParts[0][0]), hexdec($labelColorParts[0][1]), hexdec($labelColorParts[0][2])); 
        $trackColorIndex = imagecolorallocate($image, hexdec($trackColorParts[0][0]), hexdec($trackColorParts[0][1]), hexdec($trackColorParts[0][2])); 
        if($backgroundTransparent) 
            imagecolortransparent($image, $backColorIndex); 

        //Check to see if antialiasing is used 
        if(!$antialias) { 
            $labelColorIndex = -$labelColorIndex; 
            $trackColorIndex = -$trackColorIndex; 
        } 

        //Draw border 
        if($border) 
            imagerectangle($image, 0, 0, $maxWidth - 1, $maxHeight - 1, $borderColorIndex); 
         
        //Draw label 
        $x = ($horizontalAlign == "right" ? max($labelWidth, $trackWidth) - $labelWidth : 0) + $horizontalPadding + ($border ? 1 : 0); 
        $y = $labelHeight - abs($labelBounds[1]) + $verticalPadding + ($border ? 1 : 0); 
        imagettftext($image, $fontSize, 0, $x, $y, $labelColorIndex, $font, $label); 
         
        //Draw track 
        $x = ($horizontalAlign == "right" ? max($labelWidth, $trackWidth) - $trackWidth : 0) + $horizontalPadding + ($border ? 1 : 0); 
        $y = $trackHeight - abs($trackBounds[1]) + $verticalPadding + $labelHeight + ($border ? 1 : 0); 
        imagettftext($image, $fontSize, 0, $x, $y, $trackColorIndex, $font, $track); 
         
        //Save image 
        if($imageType == "jpg") 
            @imagejpeg($image, $imageFilename); 
        else 
            @imagepng($image, $imageFilename); 
         
        if(file_exists($imageFilename)) { 
            imagedestroy($image); 
            $image = null; 
        } 
    } 

    /* Output the image */ 
    //Output image headers 
    if($imageType == "jpg") 
        header("Content-type: image/jpeg"); 
    else 
        header("Content-type: image/png"); 
     
    if(file_exists($dataFilename)) { 
        header("Last-Modified: " . gmdate("D, d M Y H:i:s", filemtime($dataFilename)) . " GMT"); 
        header("Expires: " . gmdate("D, d M Y H:i:s", filemtime($dataFilename) + $cacheDuration) . " GMT"); 
    } 
     
    //Output image 
    if(!$image) 
        readfile($imageFilename); 
    else { 
        if($imageType == "jpg") 
            imagejpeg($image); 
        else 
            imagepng($image); 
        imagedestroy($image); 
    } 
?>

Fiddle around with this if you don't have/want a song to be displayed.
4. Fiddle with quotes.php so that it contains the quotes you want.
5. In your sig, add [img ]*&&**&&*&&^^*&%%*&%[/img ] (where *&&**&&*&&^^*&%%*&% is the path to the index.php (or whatever) file).

I wrote:

In the query string, you can put in ?action=all_quotes and it will dump all the quotes. One problem: It does the same thing as ?action=random_quote which I have that way because, with variables $q[1], $q[2], etc., I want to display all those variables (they contain ^the quotes), but I don't know how. How do I get it to do that?

How?

39

(12 replies, posted in Programming)

This is what I don't like about Perl:

1. I want to install a Webmail app (mainly PHP) on my Web site.
2. I want to run the conf.pl file to configure it.
3. When I try to do so, it tells me it can't be world writable.
4. I fix that.
5. Now, I get a "Permission denied" message.
6. I chmod the file to 755.
7. Now, it says it must be run from the command line! mad ALL THAT WORK FOR NOTHING! <edit> Oh, and I don't think I can do that with my Web host. </edit>

40

(1 replies, posted in PunBB 1.2 discussion)

Try reuploading the search.php page from the original zip file. (Eg. if you use 1.2.2, get the zip for 1.2.2 and upload upload/search.php)

If you installed any mods, see if they affect the search.php page, and they were originally intended for your PunBB installation.

Connorhd wrote:

scottywz you should look at making your signature cache itself, its REALLY slow for me, rather annoying since it loads about 3 min after the rest of the page and makes everything move

What would we do without browser caches?

Funny. Do you ever get something like

Red: "... This week, we got some good news, got some bad news."
Harold: "What's the bad news?"
Red: "Meet my nephew, Harold. And, now, the good news...."
- Dialog from "The Group Photo Project", The Red Green Show

:  (Updated every 15 seconds) Currently listening to this song / Last song listened to was:
Solas - Pastures of Plenty

I want extern.php to show the actual post instead of Last post, author, etc. I'm not using this particular extern.php on any real forums, just for my site news and my blog.

Who's Willis?

To get a random quote without looking at my signature, go:
Random Quote
Random Quote (no title)
All Quotes (see below)
or All Quotes (no title) (see below)

In the query string, you can put in ?action=all_quotes and it will dump all the quotes. One problem: It does the same thing as ?action=random_quote which I have that way because, with variables $q[1], $q[2], etc., I want to display all those variables (they contain ^the quotes), but I don't know how. How do I get it to do that?

The code I have now is:

<?php 

/* A Huge Comment */ 

/* Start App */ 

$nlt = "\n";

/*                      Define quotes                      */
/***********************************************************/
/* (Use ".$nlt at the end of each string except the last.) */

    /* Quote 1 */
    $q1t1 = "\"You know I was thinking hype could really help you, Harold. You're hyper now, so just".$nlt;
    $q1t2 = "back off one letter, and you're there.\" - Red, The Red Green Show";
    $q[1] = $q1t1.$q1t2;

    /* Quote 2 */
    $q2t1 = "\"It's the Possom Lodge Word Game. You know everybody dreams about a two-week vacation".$nlt;
    $q2t2 = "in Hawaii. Well, now you can do more than just dream about it! Ha-ha! Now, you can sit".$nlt;
    $q2t3 = "down and plan it out on your brand new pad of paper!\" - Harold, The Red Green Show";
    $q[2] = $q2t1.$q2t2.$q2t3;

    /* Quote 3 */
    $q3t1 = "\"Can you hear me? Am I talking?\" - Red, The Red Green Show".$nlt;
    $q3t2 = "(After shooting holes inside his Possum van with the doors shut.)";
    $q[3] = $q3t1.$q3t2;

    /* Quote 4 */
    $q4t1 = "\"BOBBY, EAT YOUR CHICKEN!\" - Peggy, King of the Hill".$nlt;
    $q4t2 = "(After being angry at someone else.)";
    $q[4] = $q4t1.$q4t2;

    /* Quote 5 */
    $q5t1 = "Red: \"... This week, we got some good news, got some bad news.\"".$nlt;
    $q5t2 = "Harold: \"What's the bad news?\"".$nlt;
    $q5t3 = "Red: \"Meet my nephew, Harold. And, now, the good news....\"".$nlt;
    $q5t4 = "- Dialog from \"The Group Photo Project\", The Red Green Show";
    $q[5] = $q5t1.$q5t2.$q5t3.$q5t4;

/* End Define Quotes */

$st = $q[rand(1,5)].$nlnt; // The number after the comma should be replaced the number of quotes defined above

/* Don't mod past here unless you know the risks. */

$action = isset($_GET['action']); 

if (!$action) { 

$action = ""; 

} 

else { 

$action = $_GET['action']; 

} 

$title = isset($_GET['html_title']); 

if (!$title) { 

$title = ""; 

} 

else { 

$title = $_GET['html_title']; 

} 

/* If $title == 'yes' or undefined */

if ($action == 'random_quote' && !$title) {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT");              //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate");  // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false);     //
header("Pragma: no-cache");                                    //
echo '<title>Random Quote</title>'."\n\n".'<pre>'.$st.'</pre>'; // Where's the quote?
}

else if ($action == 'all_quotes' && !$title) {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT");              //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate");  // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false);     //
header("Pragma: no-cache");                                    //
echo '<title>All Quotes</title>'."\n\n".'<pre>'.$st.'</pre>'; // Where's the quote? // The All Quotes feature is not available yet.
} 

else if ($action == 'random_quote' && $title == 'yes') {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT");              //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate");  // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false);     //
header("Pragma: no-cache");                                    //
echo '<title>Random Quote</title>'."\n\n".'<pre>'.$st.'</pre>'; // Where's the quote?
}

else if ($action == 'all_quotes' && $title == 'yes') {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT");              //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate");  // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false);     //
header("Pragma: no-cache");                                    //
echo '<title>All Quotes</title>'."\n\n".'<pre>'.$st.'</pre>'; // Where's the quote? // The All Quotes feature is not available yet.
}

/* If $title == 'no' */ 

else if ($action == 'random_quote' && $title == 'no') {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT");              //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate");  // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false);     //
header("Pragma: no-cache");                                    //
echo '<pre>'.$st.'</pre>'; // Where's the quote?
}

else if ($action == 'all_quotes' && $title == 'no') {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT");              //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate");  // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false);     //
header("Pragma: no-cache");                                    //
echo '<pre>'.$st.'</pre>'; // Where's the quote? // The All Quotes feature is not available yet.
} 

/* End App */ 

?>

where /* A Huge Comment */ is, well, a huge comment.

Also html_title can be in the query string, but is optional. If it's not there or set to yes it will add an HTML <title> </title> to the output. If it's set to no it won't.

That worked, except that "phpBB" comes after "Wintergreen". Can I get "phpBB" under "Oxygen" instead?

Edit: Oh, and I modded so that a user can change the style for all 3 PunBB-powered aspects of my site (main site, forums, and another thing) all at once.

See the subject. This is just for my Web site's news and possibly my blog.

If you are going to do some BBCode work, scratch out BBCode and make it HTML.

Will be done in ~1 minute.

Edit: Done. Also added another quote.

Now, I have:

<?php 

...

/* Start App */ 

$action = isset($_GET['setstyle']); 

if (!$action) { 

$action = ""; 

} 

else { 

$action = $_GET['setstyle']; 

} 

if (!$action) { 
?> 
<form action="<?php print ($PHP_SELF); ?>?setstyle=setstyle" method="post"> 
<div align="center"><ul><li><select name="styledrop" style="width: 90%"> 
<?php 
$result = $db->query('SELECT * FROM '.$db->prefix.'styles') or error('ERROR..', __FILE__, __LINE__, $db->error()); 

echo '<option value="'.$styletest.'">Current ('.$styletest.')</option>'; 
echo '<optgroup label="Select a Style" />'; 
  echo '<option value="'.pun_htmlspecialchars($pun_config['o_default_style']).'">Default ('.pun_htmlspecialchars($pun_config['o_default_style']).')</option>'; 
/* while ($styles = $db->fetch_assoc($result)) 
{ 
    echo '<option value="'.$styles['name'].'">'.$styles['name'].'</option>'; 
} 
*/ 

        $styles = array(); 
        $d = dir(PUN_ROOT.'style'); 
        while (($entry = $d->read()) !== false) 
        { 
            if (substr($entry, strlen($entry)-4) == '.css') 
                $styles[] = substr($entry, 0, strlen($entry)-4); 
        } 
        $d->close(); 

            while (list(, $temp) = @each($styles)) 
            { 

                echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n"; 
            } 

?> 
                            </select> 

  </select></li></ul> 
<ul><li><input type="submit" value="Submit"><!-- <input type="submit" value="Preview"> --></li></ul></div> 
</form> 

<?php 
} 

if ($action) { 
$style = $_POST['styledrop']; 
} 

if ($action == 'setstyle') { 
$now = time(); 
setcookie($style_cookie_name, $_POST['styledrop'], time()+60*60*24*31536000, $cookie_path, $cookie_domain, $cookie_secure); // When does it expire? 
// header("Location: http://www.scottywz.com/scottywz.com/index.php") // redirect 
header("Location: ".$_SERVER['HTTP_REFERER']); // redirect 
} 

if ($action && $action != 'setstyle') { 
echo 'Invalid Action!'; 
} 

/* End App */ 

?>

(The ... part wasn't anything but a giant comment.) Now, I want to know how I can sort the styles alphabetically. I changed it from taking the styles from the database to taking them from the filenames.

50

(35 replies, posted in General discussion)

It makes a big red page 10000 px wide and 10000 px high with the word "Whoops" on it. At least that's how it is in Firefox.