1 (edited by habana 2007-10-26 23:12)

Topic: SQL hack help needed (was How to clone an PunBB forum ?)

Hi all,

i made few weeks ago a dedicate forum about Sansa mp3 player with mixed languages (French + English) at the same URL (for curious, "Tout Sansa" in my signature).
Later i tried to duplicate http://.../toutforum with copy/paste and renamed the second directoryhttp://.../allforum, then restarted installation from install.exe , gave identical setup informations. That works perfectly and i have defaut language setup for EN and FR. 
Thats great, i love PunBB (since a few years smile )

Now, i would like to limit call categorie queries to database at categorie 1 (for french version) and at categorie 2 (for english version).

I suppose i just need to change SQL query to change the SELECT argument for both index, forum.php and search (maybe not for searches finaly ?) but don't find where to hack that.
Could a nice knight help me with his light ?

Thanks,
habana

Re: SQL hack help needed (was How to clone an PunBB forum ?)

I'm afraid I don't understand your setup or what exactly you want wink

3 (edited by habana 2007-10-27 00:01)

Re: SQL hack help needed (was How to clone an PunBB forum ?)

Sorry, i'll try to explain better. I first created two categories at the same url.
I want to keep only one database but have two (virtually) separated forums with separated languages on separated url's.

One on http://dormrf.free.fr/toutsansa/ (i want only filled from french categorie), one on http://dormrf.free.fr/allsansa/  (i want only filled from english categorie)
Categories as defined in admin_categories.php

Edit:
I suppose i found the place to modify query in original index.php

// Print the categories and forums
$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());

Re: SQL hack help needed (was How to clone an PunBB forum ?)

Aha smile
I think that would get complicated rather fast tongue
The way I would think about doing it is with two completely separate forum installations, with one installation storing all of the user data.

5 (edited by habana 2007-10-27 00:16)

Re: SQL hack help needed (was How to clone an PunBB forum ?)

Smartys wrote:

The way I would think about doing it is with two completely separate forum installations, with one installation storing all of the user data.

But there are english messages existing in th DB hmm

i prefer to try to "hardcode" category in SQL query
Kind of

AND (c.cat_name = Forum Sansa EN)

Thanks anyway smile

Re: SQL hack help needed (was How to clone an PunBB forum ?)

The problem is that you essentially want to separate posts, topics, and forums into different folders based on categories. Doing that would require edits of quite a few files. Editing the code my way would only require two copies of PunBB and one or two tiny edits to the dblayer.
But if you're going to do it your way, I would suggest using c.id, not c.name, since c.id is the primary key and is thus better indexed.

7 (edited by habana 2007-10-27 01:31)

Re: SQL hack help needed (was How to clone an PunBB forum ?)

Thanks, i start having results but not yet perfect.

Edit: That works nicely smile
Bye