[drupal-devel] ann: any node can be blog : remove type "blog".
Hi all. I rewrote blog.module to become a container, something like book outlines. In these files, there no longer is a blog type node. With a checkbox (see screenshot) users with the correct permissions can add any node to their blog. Feel free to try, also feel free to improve these files, just mail me if you commit changes. http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/ber/blog/ Some notes, and maybe todos: I decided to remove the "blog this" funtionality completely. If we do blogs like this any-node-idea, the blog this should be handled by either node_aggregegator, or by a simpler feed_to_node.module. I have been thinking of a nicer way to track the nids that are in a blog. Now I introduce a new table with only one column! That is not very nice IMO, so if anyone knows better options, please let me know. FWIW: if CCK hits core, this problem will be solved, I guess. If a sql Guru would be so friendly to look at my LEFT JOINS and other queries, that would be great. They are as good as i can get them, but I figure someone with more knowledge in this might be able to improve the queries a little. I tried not to introduce any new functionality, nor remove any (unless for the blog this). The module is about as big as it was (~2 more or less), and will perform the same, afaiks. But benchmarks are welcome, I do not know how to do that. Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
Nice. Just yesterday I wanted to post a picture to a blog and figured that the only way to do this is to manually create image node and insert img tag (or use img_assist, or htmlarea), but then I lose ability to view the image at different sizes. With your rewritten module I could do that for single image. I haven't tested, but looked briefly at queries as you asked... You use LEFT JOINs where you should use INNER JOINs. That is, a query snippet FROM {node} n LEFT JOIN {blog} b ON b.nid = n.nid WHERE b.nid gives same results as FROM {node} n INNER JOIN {blog} b ON b.nid = n.nid I'm not sure about performance difference, but that's what inner joins are for - to select rows which are in both tables. On Fri, 18 Mar 2005 14:12:21 +0100, Bèr Kessels <berdrupal@tiscali.be> wrote:
Hi all.
I rewrote blog.module to become a container, something like book outlines. In these files, there no longer is a blog type node. With a checkbox (see screenshot) users with the correct permissions can add any node to their blog. Feel free to try, also feel free to improve these files, just mail me if you commit changes. http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/ber/blog/
Some notes, and maybe todos: I decided to remove the "blog this" funtionality completely. If we do blogs like this any-node-idea, the blog this should be handled by either node_aggregegator, or by a simpler feed_to_node.module.
I have been thinking of a nicer way to track the nids that are in a blog. Now I introduce a new table with only one column! That is not very nice IMO, so if anyone knows better options, please let me know. FWIW: if CCK hits core, this problem will be solved, I guess.
If a sql Guru would be so friendly to look at my LEFT JOINS and other queries, that would be great. They are as good as i can get them, but I figure someone with more knowledge in this might be able to improve the queries a little.
I tried not to introduce any new functionality, nor remove any (unless for the blog this). The module is about as big as it was (~2 more or less), and will perform the same, afaiks. But benchmarks are welcome, I do not know how to do that.
Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
-- menesis ...pasikeite email: gediminas.paulauskas@gmail.com ...pasikeite mobilus: +37063349389
Op vrijdag 18 maart 2005 15:51, schreef menesis:
FROM {node} n LEFT JOIN {blog} b ON b.nid = n.nid WHERE b.nid
gives same results as
FROM {node} n INNER JOIN {blog} b ON b.nid = n.nid
I have changed this, together with some other minor issues. Thanks a lot for the tips. It is so much easier to get a tip like this then to dig trough SQL optimization books and manuals. Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
On Fri, Mar 18, 2005 at 02:12:21PM +0100, B?r Kessels wrote:
I rewrote blog.module to become a container, something like book outlines. In these files, there no longer is a blog type node. With a checkbox (see screenshot) users with the correct permissions can add any node to their blog. Feel free to try, also feel free to improve these files, just mail me if you commit changes.
+1 I haven't read the code, so let me know if you have this already, but I think hook_nodeapi should be implemented, so you can change options per node type: o Posts will always be placed in the user's blog o The user may place posts in thier blog o Posts will never be placed in the user's blog The first option will let this work exactly like the old blog module and the third can be used to reduce clutter on everyone's favorite form. -Neil
Hey Op vrijdag 18 maart 2005 20:24, schreef neil@civicspacelabs.org:
+1 Thanks o Posts will always be placed in the user's blog o The user may place posts in thier blog o Posts will never be placed in the user's blog
I planned to add a default to the workflow. But.... As stated: "no new functionality should be implemented yet". I want to take one step a time. Adding new features is step two. When I finish my todolist.module I will add this to that todolist :) Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
On 18 Mar 2005, at 14:12, Bèr Kessels wrote:
Hi all.
I rewrote blog.module to become a container, something like book outlines. In these files, there no longer is a blog type node. With a checkbox (see screenshot) users with the correct permissions can add any node to their blog. Feel free to try, also feel free to improve these files, just mail me if you commit changes. http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/ber/blog/
I like. :) I proposed this a few months ago but many people voted against it. The reason being "workflow loss". -- Dries Buytaert :: http://www.buytaert.net/
Op zaterdag 19 maart 2005 07:23, schreef Dries Buytaert:
I proposed this a few months ago but many people voted against it. The reason being "workflow loss".
This remains an isseu, but IMO a really minor one. Peopel who have problems with workflow loss should either copy-n-rename story.module, or use flexinode. Hmm, now that I think about it: abe we should have a copy-storymodule: A flexinode lite, that allows quick creation of story-like node types? Should be easy enough to code. Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
Bèr Kessels wrote:
Op zaterdag 19 maart 2005 07:23, schreef Dries Buytaert:
I proposed this a few months ago but many people voted against it. The reason being "workflow loss".
This remains an isseu, but IMO a really minor one. Peopel who have problems with workflow loss should either copy-n-rename story.module, or use flexinode.
Hmm, now that I think about it: abe we should have a copy-storymodule: A flexinode lite, that allows quick creation of story-like node types? Should be easy enough to code.
Regards, Bèr
I haven't looked at your module yet, but I'm all for it by its description. I think you could implement this copy-storymodule node as a "blog" node. This would help users transition from the old scheme to the new one. -Mark
CCK will have a 'duplicate' feature on a node type. On Mar 19, 2005, at 7:34 AM, Bèr Kessels wrote:
Op zaterdag 19 maart 2005 07:23, schreef Dries Buytaert:
I proposed this a few months ago but many people voted against it. The reason being "workflow loss".
This remains an isseu, but IMO a really minor one. Peopel who have problems with workflow loss should either copy-n-rename story.module, or use flexinode.
Hmm, now that I think about it: abe we should have a copy-storymodule: A flexinode lite, that allows quick creation of story-like node types? Should be easy enough to code.
Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
participants (6)
-
Bèr Kessels -
Dries Buytaert -
Mark -
menesis -
Moshe Weitzman -
neil@civicspacelabs.org