151

(18 replies, posted in Discuss)

just trying to include some navigation which i have across my site, and maybe a news.php for the home section.

Aah.

A couple of ways to go about it, depending on how complex things are, fiddle with site.tmpl and includes/page.php and try to incorporate those into ochiba.

For example, put "{NEWS}" into site.tmpl somewhere. Then in page.php, in the display() function, add something like:

ob_start();
include("news.php");
$news = ob_get_contents();
ob_get_clean();
$tmpl->setVariable("NEWS",$news);

Not very efficient, but it should do the trick.

152

(18 replies, posted in Discuss)

siik wrote:

no, not an options section for the admin to change, but for any user visiting to change.

Oh, I see. Yeah, I had started on something like this originally because I really wanted users to be able to specify their time zone.

However, any user-customized output makes the caching system invalid, so I abandoned the idea. I dunno, I guess these can be features you can enable if you want to give up the caching.

As for css selection, you can add your own to the menu (templates/site.tmpl) and use something like the following for each stylesheet offered:

<a href="javascript:void null" onclick="setActiveStyleSheet('ochiba'); return false;">ochiba</a>

It'll cookie and save the selection.

also just ran into some php problems with your templates, as in it won't parse. i leave an <? include "this" ?> and it stays that way in the output. should i be editing something else, like index itself? i don't want to 'break' anything.

Aah, the template files are not PHP files, so code won't work. If you could give me more details about what you're trying to do, I can make a suggestion (which template, which page, what you are including, etc).

153

(18 replies, posted in Discuss)

siik wrote:

also chiming in about category-centric feature-restrict. maybe even category-centric bbs mode and image reply mode (no image posts in one cat)

It should be doable by installing ochiba twice, one in open-posting mode, one in restricted mode. Give them the same look, share a menu, and it should be mostly transparent as far as visitors go.

an options section where someone/anyone can define their own posts per page, truncated posts per thread, css

You mean a web-based interface to conf.php? Something to consider, I suppose, but conf.php is meant to be edit once, and not think about it anymore, so I haven't felt it was a good place to spend time on an interface you'll use very infrequently.

a popular keywords section ala flickr

Interesting idea... I'll have to play around with this.

default category, instead of /home

mod_rewrite is your friend!

maybe pinging of blog servers for photolog/moblog purposes? maybe even some rss enclosure stuff so it can podcast too?

Interesting, interesting... I haven't really delved into the RSS side of things other than just getting it up, but it is an area I would like to expand.

later on i will volunteer to make a languages.txt so you can just include it and have all the text and stuff from that

That would be great. I've gotten a little sloppy with things, but the strings.php is an easy place to start, I hope.

lemme know how you do on the iframe/divs instead of popups

I actually got it to render OK in IE. See http://ochiba.x-maru.org/test/ for a sample of a new idea for the posting and searching interfaces. It's not a full ochiba install, just a few sample pages to illustrate where I'm going. Rather than a opening a whole new window, the post and search boxes will appear via dynamically generated content, via DOM stuff (kind of like the "Another File" option for posting).

Another idea I had is to use XmlHttpRequest to "pre-validate" verification codes, so that the POST doesn't officially begin until the verification code has checked out. This will save an a lot of headache, I think (be quicker, too).

154

(7 replies, posted in Support)

Aah, I had a hunch that occurred to me after I last posted.

I think the problem is that ochiba isn't finding HTML_Template_IT. Do you have it installed? If not, check the requirements page for help getting it installed.

The line I think it chokes on is in includes/page.php:

require_once("HTML/Template/IT.php");

BTW, is this a system you have admin access on?

155

(18 replies, posted in Discuss)

7hs wrote:

Another bug (although it might be in imagemagick or PHP): ochiba seems not to understand very large animated gifs such as http://muchan.org/stuff/msca-001-afk-gogo.gif . It says "unrecognized file type."

That file comes up as about 4.4MB, which is greater than then the 2,000,000 bytes defined as the maximum file size accepted by ochiba (see MAXIMUM_SIZE in conf.php). The thing is, even if you adjust this value greater, PHP itself will reject uploads up to a certain size, as defined in php.ini, and unless you have administrative control, there's not much you can do, other than ask your hoster to increase it. The relevant paramters in php.ini are post_max_size and upload_max_filesize. Apache itself also has possible limits, but generally, those don't come into play.

I'm pretty sure that's what you are running into.

156

(7 replies, posted in Support)

That looks correct, which makes me scratch my head as to why index.php isn't working.

Unfortunately, I'm out of general ideas. The thing I would try if I could would be to put break points into index.php to see how far it gets. For example, put a line such as:

echo "GOT TO THIS BREAKPOINT";exit

into index.php, reload the page, and if it got to the breakpoint, move the line down to the next block of code.

If you can do this, it'll help isolate where it's failing.

157

(18 replies, posted in Discuss)

7hs wrote:

Make categories searchable (or automatically include them as keywords)

This should be doable, though kinda ugly. You mean something like "search for keyword xyz in category abc only" right?

7hs wrote:

Allow FEATURES_RESTRICT_POSTING to be specified by category, so some image categories can be admins/mods only and others public

This is a lot harder. It was a design decision I made early on, to minimize what is in the database. At one point, I started to work on category-specific settings, but decided against it.

It's something I'll keep in mind.

Also, a tiny bug: setting a category abbreviation as "img" causes weird stuff to happen. You should probably just disallow it.

Ooh, yeah. Any category abbreviation that maps to a real file/directory is bad (ie categories named "thumbs", "img", "index","includes", etc). In the case of "img", you could rename the img/ directory and adjust conf.php if you really wanted.

Thanks for the feedback!

158

(7 replies, posted in Support)

That is strange that install.php worked but index.php comes up blank.

Just to make sure I understand the scenario: this is Apache, right? And what version of PHP?

What happens if you upload the following in a file named "test.php" and then you try to access it?

<pre>
<?php var_dump($_SERVER["PATH_INFO"]); ?>
</pre>

159

(1 replies, posted in Support)

Nope :(

I'll put that on the to-do list.

160

(7 replies, posted in Support)

Wow, I haven't given much thought to trying to make ochiba work under Windows. I don't have access to a Windows server nor know much about it, so these are just going to be stabs in the dark.

When you say you tried pointing CONVERT to the convert.exe, did you put the full Windows path, such as:

define("CONVERT","C:\Progra~1\ImageM~1\convert.exe -quality 90 -geometry %s %s[0] %s");

(or wherever it is)?

Also, what happens if you copy the convert.exe into the ochiba directory and just:

define("CONVERT","convert.exe -quality 90 -geometry %s %s[0] %s");

?

161

(33 replies, posted in Support)

Oops, I thought I had fixed that. Here's a new update for index.php, to get rid of the trailing slash.

29,30c29,30
< 
< $path_parts = explode("/",$_SERVER["PATH_INFO"]);
---
> $path_parts = explode("/","/" . $_SERVER["argv"][0]);
> array_pop($path_parts);

/search is working now.

162

(33 replies, posted in Support)

WOW, what madness.

Thanks for the access. I think I kind of got it working. The Dreamhost build of PHP is whacked- apparently, it chokes on trying to find "index.php/blah" as per the RewriteRule- it never finds it and ochiba never "runs". I don't know if the "cgi.fix_pathinfo" param would fix this, but you don't have access to php.ini to try it out.

Anyway, two seemingly minor modifications makes it work:

.htaccess
This sends PHP the "path_info" as part of the GET string, instead of a real PATH_INFO. Thank god for the Apache folks.

11c11
< RewriteRule ^(.*)$ index.php/$1 [L,QSA]
---
> RewriteRule ^(.*)$ /index.php?$1/ [L,QSA]

index.php
This converts the path_info kludge from the .htaccess into what ochiba expects.

29,30c29
< 
< $path_parts = explode("/",$_SERVER["PATH_INFO"]);
---
> $path_parts = explode("/","/" . $_SERVER["argv"][0]);

Another thing I noticed is that the caching doesn't work for some strange reason. You have to turn it off, or else you'll get stale cache reads.

Also, there are issues with the setuid behavior when it creates directories; I had to manually chmod 755 on thumbs and thumbs/00/. images/ and images/00/ don't need it in the default because of the way it works. This can be addressed by adding a umask call prior to the mkdir()s in post.php and process_image.php. Otherwise, you'll have errors when it gets to thumbs/01/.

Finally, /stats doesn't work because it appears Dreamhost has set that up as a special URL so ochiba never even gets that request. Madness, I tell you!

I left it set up at the site you provided- let me know if you notice any oddities I missed.

163

(33 replies, posted in Support)

7hs wrote:

I can set up a subdomain & shell for you to play around with on my server if you want.

Hmm, that would certainly expedite things. I've been wondering if I could even re-create Dreamhost's setup to the point where it becomes meaningful.

If the offer still stands, drop me an email (ochiba at x-maru.org) and let me know how you'd like to handle things.

164

(33 replies, posted in Support)

Drat.

OK, one last idea: in .htaccess, change the rewrite rule lines near the end from:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

to

RewriteCond %{SCRIPT_NAME} !-f
RewriteCond %{SCRIPT_NAME} !-d

or

RewriteCond %{DOCUMENT_ROOT}%{SCRIPT_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{SCRIPT_FILENAME} !-d

I'll try to set up a php-as-cgi system to tinker with this more directly if that doesnt' work out.

165

(33 replies, posted in Support)

7hs wrote:

I don't have access to the systemwide php.ini. Is there somewhere I can create one locally to set that option?

Hmm, I was under the impression from the Dreamhost kbase article that you had a separate php.ini somewhere. Perhaps I misunderstood- see mdpaciga's post on that page.

As for the directory variables, you might want to try hardcoding stuff for you installation since I think this may be the area where the problem lies. For example, if you have files in /home/7hs/webroot/ochiba/ that map to http://gallery.mydomain.com/, then:

define("ROOT","");
define("ABSOLUTE_ROOT","http://gallery.mydomain.com/");

In the case of ochiba being installed at the top level of a vhost, ROOT being blank is correct. I think this was already occurring in the self-discovery/default, but you might give it a try. Also, try adding ini_set("include_path", ".:/path/to/ochiba/directory:/path/to/pear" ) at the top of conf.php to see if that's a trip up.

BTW, does __FILE__ work? If it doesn't then this is a bigger problem :|

Finally, what happens if you remove the .htaccess file and access /index.php?

7hs wrote:

If I turn running PHP as CGI off, I get this error:
"Warning: dl() has been disabled for security reasons in /home/.taily/mydomain/gallery.mydomain.org/conf.php on line 12"

Ah, so that is how you got the sqlite module to work on Dreamhost.

166

(33 replies, posted in Support)

Hmm, some things to try (these are just off the top of my head, or from notes mentioned in the discussions linked above)

* cgi.fix_pathinfo=1 in your php.ini

* fiddle with the path-discovery variables at the end of conf.php. In particular, it seems like PHP run in cgi mode will not set certain $_SERVER variables relating to path to the correct path to the php file - instead, it is set to the php.cig binary, apparently. See the note by dasil003 at the end of the dreamhost knowledge base page. Try putting "echo"s in there with various variables and load /conf.php to see that they are being set correctly ($fileroot, $docroot, ROOT, __FILE__, etc).

* Try running PHP as a module rather than CGI, if only to see if this clears things up.

Personally, I think Dreamhost's "warnings" are a little overstated. You don't run any additional risk to yourself by running PHP as a module, and if anything it can make your stuff a little more secure if done properly. However, you do increase the risk to others on a shared hosting server, which is Dreamhost's perspective.

167

(33 replies, posted in Support)

Hmm, that's a strange one. This query indicates it's an odd problem that seems to occur with a variety of different PHP software depending on the hosting setup, but I can't find a common solution.

Can you tell if mod_rewrite is enabled for your directory (you might want to ask your hoster if not)? It's required, the way ochiba is currently written.

If so, can you put a echo $_SERVER["PATH_INFO"] somewhere near the top of index.php and tell me what it reports when you try to access /admin?

Is this on a Windows based server or Unix one? If on Unix, is it running PHP as a CGI?

Does this discussion seem like something that might be applicable? Or this one?

Actually, ImageMagick isn't a part of the php build, but rather a separate set of programs that ochiba will run using exec(). So, if you have shell login (ie ssh) access to your server, you could type something like

which convert

to see if the ImageMagick program convert is available.

169

(0 replies, posted in News)

Things about the old support forum, running kareha, were starting to bug me, so I've switched to this one. It supports sqlite, which seems appropriate for ochiba.

Anyhow, the old support board is still available read-only here: http://ochiba.x-maru.org/supportold/.

170

(0 replies, posted in News)

This release includes a new multiple file upload interface, options to truncate the display of image threads, and administrative thread deletion. Numerous bugfixes include a fix to faulty cache directory handling, closing a loophole in post restriction, and more robust filename handling when zip files are uploaded.

Everyone is encouraged to update - there are a number of security holes that were closed.

171

(0 replies, posted in News)

ochiba is released.