View previous topic :: View next topic |
Author |
Message |
dolan
Joined: 15 May 2003 Posts: 2 Location: SF
|
Posted: Thu May 15, 2003 4:46 pm Post subject: Multiple categories per post |
|
|
I *really* think it would be wise to change the relationship of post -> category from 1:1 to 1:many. Often times when I post I'm covering a subject that spans categories, such as "photos" and "travel".
I realize this would mean changing the datamodel on the backend, but it really would only involve adding an extra table, assuming synthetic keys are created for each post (which it looks like there are) and for each category (again, they seem to be there). The table would simply list the category-post relationships and the SQL would have to be mildly changed to accomodate the extra table. The "post" object would have to change the datatype of the category from whatever it currently is to an array/hash of that, and the selects (for selecting a category) would have to change to multiple-selects or checkboxes.
That said, I've written similar code in a number of Java apps I've developed. I have no real knowledge of PHP, but assuming b2 was designed to scale in the first place (which I assume it was), this shouldn't be a huge change. One could rather easily even develop a migration script for current data.
If you have any questions or want to discuss this further please email me at dhalbrook(at)hotmail(dot)com.
Thanks,
Dolan |
|
Back to top |
|
 |
fplanque
Joined: 22 Dec 2002 Posts: 53 Location: Montpellier, South of France
|
Posted: Sun May 18, 2003 12:38 am Post subject: b2 evolution supporting multiple categories per post |
|
|
Hi Dolan,
I soooooo agree with you... that I have actually implemented it a few weeks ago into my b2 evolution!
(Even better, I have multiple blogs too! )
I am looking for beta testers before releasing the whole thing into open source.
Quick feature list available here:
http://fplanque.net/Blog/devblog?m=200305#180
-François. |
|
Back to top |
|
 |
dolan
Joined: 15 May 2003 Posts: 2 Location: SF
|
Posted: Mon May 19, 2003 4:39 pm Post subject: Cool .. just a follow-up question. |
|
|
Francois,
Your dev blog looks great .. nice to know we're not re-inventing the wheel too often. En tout cas, j'ai besoin d'utiliser mon francais de temps en temps, et lire qqch ecrit en ce langue m'aide beaucoup.
I was wondering about data migration -- do you have some sort of diagram of the table changes you've made? I'd love to beta test your version, but I just want to be sure I don't end up losing anything current.
The assumption is that you have a similar table to the one I discussed in my first post, with foreign keys from category and post, as well as maybe something which says which is the main category?
BTW, I might pick up a book on PHP one of these days, so I'll offer now to help as much as I'm able.
Thanks,
Dolan |
|
Back to top |
|
 |
fplanque
Joined: 22 Dec 2002 Posts: 53 Location: Montpellier, South of France
|
Posted: Mon May 19, 2003 9:53 pm Post subject: multicats & migration |
|
|
Dolan,
Merci pour les compliments
Sure I am planning a migration path from b2 databases to b2evolution. The idea will be to apply a script that will create the new tables and colums and also populate them according to existing data. For instance, all existing posts will be placed in one single category: their existing one
Regarding the datamodel, it's just as you can imagine it:
-table postcats linking posts and cats together by their respective keys
-the old post-category still used as being the main category
I get in touch with you via e-mail for beta testing.
-François. |
|
Back to top |
|
 |
Candle
Joined: 23 Dec 2002 Posts: 545
|
Posted: Wed May 21, 2003 9:41 pm Post subject: ...... |
|
|
I really like this B2Evolution , can't wait till it is out of beta ..
Lot's of good stuff going into it . _________________ Play Aliens Awaken mY new Game . |
|
Back to top |
|
 |
|