Hmm, if a shell reports that /usr/bin/convert exists and PHP is choking on it, then it's possible that your shell server and web server are actually different hosts, OR your web hoster has some restrictions on what can be executed. I'm gonna guess the latter. Can you contact your webhoster and see if they restrict access to /usr/bin/convert?

77

(0 replies, posted in News)

Ochiba version 1.2 - IE7=the new suck

This version includes a few minor bug fixes, the most significant of which is CSS compatibility for IE7.

Please read the release notes at http://ochiba.x-maru.org/notes for details.

78

(2 replies, posted in Support)

I love it when answers appear before I even read the question :).

Hope you enjoy ochiba!

I was afraid of that.

Ochiba was written when IE7 wasn't yet out, but I made the assumption that it would fix all the problems IE6 had, and be standards compliant. This was rather naive of me.

Since it's not possible to have IE6 and IE7 installed at the same time, I'm unable to test things in IE7 and I can't tell you what the problem is. The best I can suggest at this time is to look at the templates/site.tmpl file and change the line that reads:

<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="{ROOT}/css/iesux.css" /><[endif]-->

and change the 7 to an 8. Maybe IE8 will be standards compatible.

Hmm, looks fine in IE6 for me. What version are you having trouble with?

Do you have terminal (ssh) access? If so, try logging in and entering the command which convert. That should tell you the path the convert on your system.

If not, try asking your provider what the path to the binary is.

82

(3 replies, posted in Support)

I'm at a loss on this one. Try shelling in and running convert from the command line to see if it works there- my guess is that something is up with your ImageMagick binaries.

83

(4 replies, posted in Support)

Ahh, pruning.

This is one of those things that is pretty easy in something like kareha, where "boards" are self-contained, but a lot more complicated in ochiba where "boards" are really just label filters. I also had a a bunch of new ideas in mind (prune by date, prune by space on disk, prune by thread count, prune by post count). Plus, this kinda thing is harder to test for obvious reasons.

Anyway, those are my excuses. Here's some stop-gap code to provide pruning until the time I do this properly (probably ochiba v2).

conf.php

--- release/ochiba-1.1/conf.php 2005-09-21 19:46:39.000000000 -0700
+++ conf.php    2007-01-28 14:51:42.000000000 -0800
@@ -67,6 +67,7 @@
 define("FEATURE_RSS",true);                    // Enable RSS feed?
 define("FEATURE_FETCH",false);         // Enable URL fetch instead of upload?
 define("FEATURE_SAGE",20);                 // Number of replies before no longer bumped, or false
+define("FEATURE_PRUNE",35);         // Number of threads to retain; false to retain all
 define("FEATURE_MULTIPLE_CATEGORY",true);   // Allow multiple categories per post?
 
 // Restrict posting? If so, only tripcodes provided in a comma-separated list will

includes/post.php

--- release/ochiba-1.1/includes/post.php   2006-01-07 11:40:39.000000000 -0800
+++ includes/post.php   2007-01-28 14:52:46.000000000 -0800
@@ -313,6 +315,11 @@
         }
     }
 
+    //----- Prune? If FEATURE_PRUNE is set to a number, delete off old stuff
+    if(is_numeric(FEATURE_PRUNE) && FEATURE_PRUNE>0) {
+        prune($_POST['categories']);
+    }
+
     echo $STRINGS["postthanks"];
     echo JS_AUTO_CLOSE;

includes/functions.php - add the following function to the file

function prune($categories) {
    global $db;
    // Have to do this for each category posted...
    foreach($categories as $c) {
        // Get threads to delete, if any
        $q = "select id from images where category like '%/$c/%' order by date desc";
        if(eregi("^mysql",DB)) {
            // Fuck you mysql
            $q .= " limit " . FEATURE_PRUNE . ",10";
        } else {
            $q .= " limit 10 offset " . FEATURE_PRUNE;
        }
        $threads = $db->getCol($q);
        $allchildren = getComments($threads);
        foreach($allchildren as $children) {
            foreach($children as $child) {
                deleteImage($child["id"]);
            }
        }
        foreach($threads as $thread) {
            deleteImage($thread);
        }
    }
}

84

(9 replies, posted in Support)

Hmm, see if this works for you

--- release/ochiba-1.1/includes/post.php      2006-01-07 11:40:39.000000000 -0800
+++ includes/post.php   2007-01-28 13:01:49.000000000 -0800
@@ -110,6 +110,8 @@
                 $page->fail($ERRORS["restricted"]);
             }
         }
+    } else if ($_FILES['file']['name'][0] && !is_uploaded_file($_FILES['file']['tmp_name'][0])) {
+        $page->fail($ERRORS["emptyreject"]);
     }
 
     // Quit now if errors ...

85

(9 replies, posted in Support)

There isn't a warning- there's no way for the pre-submit checks to get at the size of the file, so it will post anyway. Once it hits the server, there should be some sort of error- something I fixed in 1.1 I thought.

86

(3 replies, posted in Support)

Hmm, now that one is something I can't answer without looking into closer- it works fine on my systems. You try manually downloading the thumbnail to see if it opens ok on your desktop?

87

(4 replies, posted in Support)

If you set it to false, it will always bump regardless of the number of replies. It won't die.

88

(9 replies, posted in Discuss)

Oh the letters in parentheses are acceskeys. So on any page, pressing alt-P (Linux) or ctrl-P (Mac) will be the same as clicking the link. (S) is for search, etc.

89

(9 replies, posted in Discuss)

Hmm, having a fixed number of characters greatly increases the machine-readability of captchas, whose sole purpose to defeat machine readability, so the idea seemed ill-advised to me at the time I was working on it.

Still, it's pretty easily done. In includes/functions.php line 790:

    $code = strtoupper(substr($code,0,6));
    $code = ereg_replace("[^A-z]","",$code);

Flip these two lines around and change that "6" to whatever length you want. Also, change line 817 from

    return substr($x,0,10);

to

    return $x;

This won't guarantee 100% of the time it'll be the set length (has to do with the way the "random" strings are generated) but it should work most of the time. For better coverage, you can change the md5() call on line 811 to sha1().

90

(2 replies, posted in Support)

I've never thought of the tripcode as the same as the password- they are used for identification not for authorization (admin/mod tripcodes excepted, of course)- so it's treated fairly laxly. More concerning than the cleartext entry, for example, is the fact that it is stored in a browser cookie.

Still, it's easy to change to the obfuscated form - just change the input type of the tripcode field in post.tmpl from type="text" to type="password.

91

(9 replies, posted in Support)

Oops, thanks.

92

(9 replies, posted in Discuss)

So that was interesting. The following changes adds a feature where you can click on the captcha image to generate a new one. Two files need to be changed, includes/verification.php and js/ochiba.js. Just remove lines preceded by a minus and add lines preceded by a plus, if you're not familiar with diff output.

includes/verification.php

--- release/ochiba-1.1/includes/verification.php     2005-06-17 00:38:26.000000000 -0700
+++ includes/verification.php   2007-01-25 17:55:12.000000000 -0800
@@ -8,7 +8,13 @@
 // | @version $Revision: 1.4 $
 // +----------------------------------------------------------------------+
 
-$s = $_GET["s"] or exit;
+if($_GET['new']) {
+    $s = mt_rand();
+    session_start();
+    $_SESSION['seed'] = $s;
+} else {
+    $s = $_GET["s"] or exit;
+}
 
 $code = verification($s);

js/ochiba.js:

--- release/ochiba-1.1/js/ochiba.js   2005-12-15 20:54:07.000000000 -0800
+++ js/ochiba.js        2007-01-25 18:50:55.000000000 -0800
@@ -143,6 +143,9 @@
        }
        if(me = document.getElementById("verify")) {
                me.value = "";
+        var captcha = me.nextSibling;
+        if(!captcha.src) captcha = captcha.nextSibling; 
+        addEvent(captcha,"click",function(){ this.src='verify?new='+Math.random(); });
        }
 }

Taking a quick look at that SMF code, it seems pretty easy to drop that code in. The function you need is the showCodeImage() - you could paste that into verification.php, then pass it $code. Looks like you have to also grab the fonts from them, too.

93

(9 replies, posted in Discuss)

Well, ,the "O" vs zero thing is moot because numbers are not used. The O vs Q is an issue and I actually did try removing Qs from use but that created really subtle bugs that were maddeningly hard to track down. Also, since XmlHttpRequest is used to "pre-verify" before submitted a form, you get immediate feedback if the captcha doesn't match, before having to wait for a file upload, so the cost of trying a second guess isn't too high.

Having said all that, the existing captcha code was supposed to be a proof-of-concept kind of thing and stop spammers, but isn't the best. If you have other code for generating captcha images, it should be easy to drop-in. Just replace includes/verification.php with the image generating code (but keep the first two lines).

As for requesting a new captcha: I've been meaning to look into this.

If you know of captcha generating code, I can take a look at making the modification.

94

(9 replies, posted in Support)

In includes/post.php, line 406, change this:

        $vars["max_bytes"] = round(MAXIMUM_SIZE/1024/1024);

to this:

        $vars["max_bytes"] = number_format(MAXIMUM_SIZE/1024/1024,1);

This will give you precision to the tenths (ie "0.5"). If you change that last number from 1 to 2, you get hundredths (ie "0.50"), etc.

If you want to change it to KB, then change it to:

        $vars["max_bytes"] = round(MAXIMUM_SIZE/1024);

and then change the display line in templates/post.tmpl where it specifies "MB" to "KB".

Next step might be to use a variable instead of "Anonymous" which by default is empty and throws the name-required-error. Once set in conf.php it uses whatever the Admin specified and throws no error anymore.

Hmm interesting. I've mentioned my feelings on so-called "Anonymous" posting before:
http://ochiba.x-maru.org/supportold/kar … 106307785/

However, your idea seems like it might be easy to add and make it configurable by the site owner.

1. Yeah, no way currently to delete categories. Some discussion of the complications here if you haven't seen it yet:

http://ochiba.x-maru.org/support/viewtopic.php?id=23

If your ochiba install is a fresh one with no or few images, then executing the SQL indicated should be sufficient.

2. The first line you inserted takes care of the server-side check. However, there is a client-side javascript check which actually prevents the form from even being sent to the server.  In js/ochiba.js, at line 166 there is this block:

    // Name is required
    if (!document.getElementById('name').value) {
        alert('A name is required');
        document.getElementById('name').focus();
        return false;
    }

You can comment out or delete that block.

3. In templates/site, near the top are these lines that reference css files

<link rel="stylesheet" type="text/css" href="{ROOT}/css/ochiba.css" title="ochiba" />
<link rel="alternate stylesheet" type="text/css" href="{ROOT}/css/classic.css" title="classic" />
<link rel="alternate stylesheet" type="text/css" href="{ROOT}/css/futallaby.css" title="futallaby" />

Of these, the one *not* marked as "alternate stylesheet" is the default one, so if you'd like a different one as default, change that one's rel to stylesheet and the other to alternate stylesheet.

Thanks for the note and tip. I'm reconsidering my initial intentions with the collapse/expand thing and will probably drop that "functionality" in the next major update.

98

(1 replies, posted in Support)

Even /admin?

It sounds to me like mod_rewrite isn't working. Whether it is just not available on your system at all, or it is not working as ochiba expects is not clear. I would suggest contacting your web hoster and ask if mod_rewrite is available if you are not sure.

If you are sure it is available, then please review this thread, which covered a few different issues with mod_rewrite as it is configured on some hosting plans, such as those with Dreamhost.

http://ochiba.x-maru.org/support/viewtopic.php?id=6

Dan wrote:

"The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

Hmm, sounds like a mod_rewrite issue. Give the following thread a read, and try out some of the changes indicated:

http://ochiba.x-maru.org/support/viewto … pid=19#p19

Let me know if that helps.

#define("DB","mysql://MtnXfreeride:## my p/w ###@mysql153.secureserver.net/MtnXfreeride");

The "#" at the beginning of this line signals a comment - you should remove the "#".