This is a good decision. Good luck to this great project.
2 2006-08-30 09:14
Re: What editor do you use for php? (114 replies, posted in Programming)
I simply like GVim (or Vim).
It's powerful, free and light
3 2006-06-19 08:38
Re: Multilang forum and categories. (7 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Actually it's not clean enough to be distributed.
If you're interested, I'll package it, and you'll be able to see if you like it or not... but before this, I will have to finish some little things on it
ps: I didn't work much on it since nobody seemed to be interested.
4 2006-06-05 13:05
Re: Multilang forum and categories. (7 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Ok, I used the lang file's array system instead of the DB.
The translation replaces the original title, if availlable.
Thanks for your help.
5 2006-05-27 22:10
Re: Multilang forum and categories. (7 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Hi Paul, and thanks for your answer.
As I told before, it would be a part of an internationalization mod. It's only one of the functions.
I already did other parts:
- Automatic language detection for guests
- Storing user's language, and adding a tag with the used language before the topic title
- In the topics, a link proposing a babelfish traduction from the original language to your's
- The ability to filter only one language in the topic lists.
The goal is to reduce the language barrier... I think it's a better approach than creating one section for each supported language.
It may be interesting for the board's which have a massively multilang vocation (support forums?)
6 2006-05-27 09:00
Re: Multilang forum and categories. (7 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Nobody's interested by a multi-lang mod?
7 2006-05-26 12:15
Topic: Multilang forum and categories. (7 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Hi,
I plan to develop an internationalization mod for PunBB.
I already did a dirty hack for phpBB for one of my boards, but I'd like to make something cleaner for punbb.
One of the functions of the mod would be to get forums, descriptions and categories in the user's language.
So I add 2 tables, one for the alternate forum languages, and another one for the description.
In each table, I put an ID in each table (as primary key), the original categorie and forum ID, the translation and the language.
But I'm very noob at using complex queries.
I think it will be possible to get the alternative language using the original (big) query, but all my tries failled.
I could make simpler queries, but I think that the number of queries would not be acceptable.
The original query in index.php:
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
Do you think this is a good approach? Would there be a simpler system to do this cleanly?
How would you do this?
I used the $lang[] system for my phpBB hack, but this is dirty ... even if it is the simplest way to do it.
Thanks.
8 2006-05-23 14:24
Re: PunBB 1.2.12 (69 replies, posted in News)
Just help Rickard & Paul if you think that the development is not fast enough.
I think that they're already spending a lot of time on it.
Rickard> Thank you for your reactivity to fix vulnerabilities, and a big thank for this nice piece of code.
9 2006-05-23 10:49
Re: disabling the search function (18 replies, posted in Feature requests)
In search.php I replaced this
// Are we searching for multibyte charset text?
if ($multibyte)
{
$cur_word = $db->escape('%'.str_replace('*', '', $cur_word).'%');
$cur_word_like = ($db_type == 'pgsql') ? 'ILIKE \''.$cur_word.'\'' : 'LIKE \''.$cur_word.'\'';
if ($search_in > 0)
$sql = 'SELECT id FROM '.$db->prefix.'posts WHERE message '.$cur_word_like;
else if ($search_in < 0)
$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
else
$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.message '.$cur_word_like.' OR t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
}
else
{
$cur_word = str_replace('*', '%', $cur_word);
$sql = 'SELECT m.post_id FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON m.word_id = w.id WHERE w.word LIKE \''.$cur_word.'\''.$search_in_cond;
}
By:
// Are we searching for multibyte charset text?
$cur_word = $db->escape('%'.str_replace('*', '', $cur_word).'%');
$cur_word_like = ($db_type == 'pgsql') ? 'ILIKE \''.$cur_word.'\'' : 'LIKE \''.$cur_word.'\'';
if ($search_in > 0)
$sql = 'SELECT id FROM '.$db->prefix.'posts WHERE message '.$cur_word_like;
else if ($search_in < 0)
$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
else
$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.message '.$cur_word_like.' OR t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
(In fact I juste replaced "if ($multibyte)" by "if ($multibyte || 1)" to reduce code modifications, and be able to reverse this change easily.)
And I don't use anymore the indexation tables.
This is not a clean solution, and I know that it must be less efficient, or loads the server, but it works.
I also added a 'return;' at the beginning of the 'update_search_index' function, in the 'include/search_idx.php file, so the indexation tables are not fed anymore.
10 2006-04-27 12:26
Re: disabling the search function (18 replies, posted in Feature requests)
With a 10MB limitation you should probably move somewhere else
Only very silly hosts limit databases that much (a lot simply count it against your disk quota or don't count it at all, which is better)
I can't change this.
Plus, I doubt your forum can get very large even without the search tables. 10MB is small
With 2100 registred users (and guests allowed to post) this is not a *very* little forum. The problem is that I have to prune it and rebuild search index regulary.
11 2006-04-27 07:05
Re: disabling the search function (18 replies, posted in Feature requests)
Yes, but with a 10MB database limitation, and no way to change of hoster, you have choices to make
12 2006-04-26 17:19
Re: disabling the search function (18 replies, posted in Feature requests)
Would it be possible to make a basic search without the indexation tables, as you can do with other forums like phpBB?
I also have some database limitations, and having such big tables make me impossible to use PunBB.
Blacklisting words only reduced the tables of 1/3.
Any idea?