Archive for Before posting please check the "stickies" in the support forums.
Please ask questions in real English and not "txt". You will get a better response.
Please do not ask support questions via PMs.
  Forum Index -> Forum Blogs
myff admin

Wiki forums

Following on from the thread on guides.

It would be rather good to have forums operating as Wikis.

I don't see this as a terribly difficult job.

If we make it so that the Edit permission on a Wiki forum controls who can edit not just their own posts, but the first post in a thread regardless of who posted it, then that deals with Wiki type permissions without too much aggravation.

We let people put a button in the template that would access a wiki editing system.

When an edit it stored we change the first post of the thread to the new version and store a "diff".

There would be little difference in the phpbb2 and phpbb3 code, as all that would differ is saving the posts.
myff admin

On phpbb2 this is now working at the very crude level of where a forum is set as a WIKI, then users with edit permission on posts in that forum can now not just edit their own posts, but also the first post in a topic.

I have no plans to release anything quite that basic, but it is at least a start and demonstrates that at using phpbb2 there is no need to interfere at the core permissions level, just a few tweaks to viewtopic.php to make the edit button available and a few tweaks to posting.php to not block editing of the first post by a user who did not make that post, when the forum is a wiki and when that user has edit authorization on the forum.
myff admin

I have not actually done the saving bit yet, but when you edit the wiki post it can generate a "diff". The diff can be seen capable of going from the new post to regenerating the previous post.
This is a vital part of a wiki system, we do not want to be storing a complete copy of a massive post each time someone makes a minor revision, yet we do need the audit trail of what edits have been made and the ability to back track.
Saving is really pretty trivial, and then that "only" leaves the Wiki control panel template itself where people will be able to review previous versions and MOD it.
myff admin

Saving is at least looking good.

Time to call it a day though.  The main panel is not something to start this late in the day.
myff admin

May as well muse on though, we will have a WIKI portal to go with the wiki forums. This will control a few things, one of which will be a prefix to any Wiki article posted, this will allow users to gain access to the Wiki control panel without there having to be template edits made.

I don't at the moment see much need for permissions in the PORTAL, strikes me that forum MODs would have full Wiki MODDING permissions, why do it any differently?
myff admin

Thought of the minute!

Do I need to write a totally new control panel for the wiki? Isn't the development of the guide really just like viewing a topic? With operations similar to that of a topic?

E.g. we see the first post the one with the current guide split into each edit, and rather than simply displaying the guide as it develops we add a few flashy features like toggles between the finished view and the changes involved.

In this way the Wiki keeps looking integrated into the forums own look and feel.
myff admin

I have now got a viewwikitopic.php that should in principle be showing much of the relevant info. It actually doesn't as there are no doubt some pretty basic typos in the code, but I'm still seeing this as being ahead of the game
myff admin

I'm pretty please with this. The flaws are clear:

1) pmtest2 made the final edit, and so should be the one listed at the top.
2) A lot of the viewtopic semantics like "QUOTE" are irrelevant. We have to get rid of a lot of that sort of stuff or it will be really confusing.
3) We need to add some clever tweaks like not showing just the current state of the Wiki but the differences formated in various ways. Actually the clever bits that will make it look good are in this case the easy bits.

The main point is that we are successfully back tracking from the top post which is the only one stored, two the bottom post which is the original posting via small "deltas" that are stored in the portal database.
myff admin

Looking good, the Edit button only appears on the first post and does a standard Edit.

The Delete buttons will go to an as yet unwritten wiki.php file that will do the clever bits of deleting the deltas whilst keeping it all consistent.

e.g. a common action would be to reject someones edits by deleting the first post.

I think I will leave that bit for another day and have a little fun with how the changes are shown. This is the bit that is needed to make it really Wiki like.
myff admin

Do we really need more than this?

Green shows additions, and red (yes I know I didn't include any) shows deletions.

Note that we see the unformatted text in the edit view. e.g. the bbcodes show. It would get insanely complicated to do otherwise.
myff admin

The more I look at this the more I see that we do need a means of seeing previous revisions in their full glory.

This is not a major technical feat, but I do need the inspiration on the best way of doing it and that is eluding me a bit.
myff admin

I have thought of one thing that I'm not going to do here, and that is compile all the fully fledged posts into the wiki view. There is a good reason why both phpbb2 and phpbb3 store posted in a "pre-chewed" format and that is performance. So we are not about to process a load of raw posts, most of which will not be interesting to the view anyway. The full look of any revision will therefore be generated on demand in some way.
myff admin

just spotted the dates were all duff in the screenshot  

Fixed that, but still lacking inspiration on how best to show formated revisions

I'm not going to let that hold things up though. I can get on and do the delete functionality tomorrow and at that point we have a decently functional wiki system.
myff admin

I think I am going to go for a bit of clever javascript and a bit of web 2.0.

Each post will have links to set view to "Differences", "Unformatted","Formatted" and the view will change inline. Each of these modes is useful and I think it is a lot less messy to see things inline. Should be fun to code
myff admin

All that is missing there is the "Formatted" link and code. The other display modes work

The web2.0 frame work is actually there though.

It may be best to do the formated view by creating the unformatted code to be used on the client PC and then asking the forum to format it and return it. e.g. possibly better for server performance as it just involves the server being passed something of post size but not having to make a load of database queries and check privileges etc.
myff admin

Aside from the odd extra line break sneaking in, this is working quite well.

Just the Delete code to do now.
myff admin

Ah, spoke a bit too soon. When more than a single page of edits have happened things go screwy. I was half expecting that though.
myff admin

Finally pagination seems to work, amazing the permutations you can get in that sort of code  

Deletion will be pretty interesting to   But touch would I will get that done tomorrow and actually release this Saturday. I reckon it will be a great addition, and what is more the first live use of web2.0 on the forums.

phpbb3 does not use it at all that I know of, we use it a lot in the admin panel additions and I always planned to use it on the forums in general.  But phpbb2 is not really designed that way and I simply had not see the opportunity for it until now.
myff admin

This is a little annoying, if you look at the screenshot carefully, you see what is shown whilst technically correct is really rather stupidly wrong in this instance

However this is a case of "tough"   Rather like we don't much around trying to fix phpbb3 bugs in areas where they are actively developing the code, this part of the Wiki code uses the well established PEAR Text_Diff library and this is under active development. In fact it is a coin toss whether this bug would be in the version on the live servers at all.
myff admin

ah, doing the diff at the character level does improve results

I am also dithering on delete. The wiki edits are an audit trail. If you delete an edit midway it is possible to make it consistent but it then in effect lies about what happened. It only really makes sense to allow the final edit to be deleted, e.g. rolling back sequentially.
myff admin

Okay we now have the following display modes:


Will show the raw post text with differences to the previous post highlighted, additions in green, subtractions in red, and the somewhat odd simply seen to be changed as yellow.


Only show the green, red and yellow bits. e.g. collapse to just the changes made.


show green and yellow


Show red and yellow


Show the post without any of the changes.


Show the formated post, e.g. process the bbcodes and smilies.
myff admin

As an aside to the above I am always showing html in unformatted form. I don't think most Wikis want to cope with html as the mark up language either.

html will work with the wikis, but the difference views will struggle.
myff admin

The Wiki delete function now seems to be working okay, though I have yet to check out whether permissions are doing their job.

Took me a while to decide whether to modify posting.php to deal with wikis or to copy it to a new file and strip it to just what is needed to deal with wikis. Doing the latter was clearly the right way to go.

I must also tweak modcp.php though, so that a topic delete clears wiki edits.
myff admin

That all seems to be working okay.

But I have seen more anomalies on the formatted view.

That is the web2.0 thing that attempts to show the formatted post by deriving it from the unformatted information available.

I think this is probably too tall an order So much gets translated backwards and forwards that something is always going to screw up somewhere.

I think we go back and do it the right way.
myff admin

Yes, it may have been another 150 lines of code, but it has got to be better

In principle the Wiki code is now complete
myff admin

I have fixed a few little wibbles in the formatted text returned via web 2.0. I guess just about any odd character is prone to getting translated at various points down the line. I think by and large we can deal with these issues as they arise. Afterall the Wiki audit trail view mode which is what we are talking about here is purely cosmetic. If there is a bit of an issue viewing how an topic looked in a past edit, then all it is, is a bit annoying.
myff admin

Things are still testing out okay.

I was wondering though about the possibility of comments/annotations? To some degree though this needs to be managed within the forum itself. e.g. people can discuss editing the topic in the replies to the WIKI topic. If there is a need to have parallel discussions e.g. one by authors and one by punters commenting on the article, then there really should be two forums one where articles are authored and one to which periodically an edited article is copied across.

As for the idea of comments/annotations in general I think I'd want to see how the need develops. Technically it is a bit of an issue in that if I wanted to store such things in the same record as the wiki edits I'd need to restructure things, storing elsewhere will mean a small performance hit. On balance though I think the hit is worth taking. The wiki edit record are an audit trail. The more you cram into the record then the more likely it is a bug with disrupt that audit trail.
myff admin

I am still finding the odd thing to tweak here, things that are not unimportant.

I may have to think long and hard about whether to release this tomorrow. It is one hell of an addition to the feature set and there really is no pressing need to go from idea to release in 5 days.
myff admin

I think that settles it, in fixing one of the little issues I blew the wiki edit trail, and that fact took a little while to show up. A simple bug, but a sound warning that this needs just a bit more patience.

As it is fixing the bug has probably broken the fix.
myff admin

Found another little bug, but back in theory to all being fixed.

One of the issues is around marking who has edited the post last. The phpbb2 code seems kind of broken to me In practice it will work because of the way things are set to only list how many times a user has edited their own post, and not who else has edited it. Move outside of those boundaries, and that is clearly intended as being possible and it is flawed.
I have left it as is for non wiki forums, as I want minimum disruption here.

At least now I have another week to look at more features.
myff admin

I do have some ideas that may be useful in general on non wiki forums.

Watch this space.
myff admin

I am please I have delayed this. The notes system is looking really good in my view.

Perhaps annoyingly I think that work may be finished asides from more testing, but all the same we need to wait till Saturday for the install. But that's life.

There may still be scope for more features in the week ahead.
myff admin

The comments feature is an interesting technical challenge.

We have to avoid the gratuitous increasing of database load that would result from most ways of implementing this well.

As it stands we don't show if comments exist for a particular post, which is obviously quite lame.

There are three ways of dealing with this.

1) Always check the comment tables.
2) Add flags to the post table for each comment type.
3) tag the post text if comments have been made.

We will do the option 3, since it is the lightest on resources. In effect we will have a pseudo bbcode at the bottom of a post that will say "Show Comments"  when comments exist. This will use web2.0 to pull in the comments.
myff admin

I think this is the point where sanity prevails. We have the means of adding comments to a post now, and of making inline wiki notes visible to people making edits. The last thing to do would be to allow separate comments on specific wiki versions. It might have some limited use, but would do little a wikinote would not do and we would end up having 4 places a debate might be happening.

1) In replies to the post.
2) In comments on the post.
3) In wikinotes in the post.
4) in comments on individual edits.

It is too much in my view. Much better to refine the first three, and make options on the comment portal as to what type of topic it appears in.
myff admin

Actually option 2 can I think be refined to allow for option 4 without the code getting nasty.
myff admin

All seems to be done.

We see here what might be over the top. We are viewing a wiki where people in the wiki edit mode can not only use the new bbcode type notes facility to make edits into the post, but can also read and add comments made against either the individual edit or on the wiki article in general.

This was done in the admin panel by copying the POSTCOMMENTS portal.

There is one main concession to the server! You see the comment count in brackets here. That feature is only available in a wiki view, otherwise we would see people using it on all their forums just for the sake of it, and there is a load factor involved. In a standard forum a post that has comments made on it, will have a link at the bottom if post tagging was selected.

Here we see the POSTCOMMENT settings.

I have made it so that when using the feature in a standard forum you have to specify the ID explicitly. Frankly this is again to push the idea that this feature is not there for the sake of it on all forums. It is pointless outside of particular circumstances and should be treated with respect.
myff admin

I have incorporated the WIKI portal setup into the default configuration people will see when they create a wiki forum. It seems daft to make them go through the hoops of copying portals and editing templates.
myff admin

A few more fixes in today, but aside from some final tests on deleting posts, I think all that remains is to construct some "help" on the new features.

It will be quite a major install Saturday, no database changes, but a lot of files involved.
myff admin

Given we have had two server issues over the last couple of days I have not made myself happy enough with the testing of the Wiki stuff, and really don't fancy the aggravation of a major install tomorrow Forum Index -> Forum Blogs
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum