<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — 1.3?]]></title>
		<link>https://punbb.informer.com/forums/topic/5739/13/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/5739/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in 1.3?.]]></description>
		<lastBuildDate>Thu, 12 Jan 2006 17:36:54 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/60131/#p60131</link>
			<description><![CDATA[<div class="quotebox"><cite>Paul wrote:</cite><blockquote><p>I can see it now. You guys will be starting a &quot;Request a hook&quot; thread.</p></blockquote></div><p>Great idea!</p>]]></description>
			<author><![CDATA[null@example.com (hcgtv)]]></author>
			<pubDate>Thu, 12 Jan 2006 17:36:54 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60131/#p60131</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/60130/#p60130</link>
			<description><![CDATA[<p>I can see it now. You guys will be starting a &quot;Request a hook&quot; thread.</p>]]></description>
			<author><![CDATA[null@example.com (Paul)]]></author>
			<pubDate>Thu, 12 Jan 2006 17:30:32 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60130/#p60130</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/60126/#p60126</link>
			<description><![CDATA[<div class="quotebox"><cite>Connorhd wrote:</cite><blockquote><p>I plan to completely rewrite the PM system as an extension, with the upgrade script before 1.3 is released fully.</p></blockquote></div><p>same here for the attachment mod ... hopefully there will be enough hooks in there for it to work out for me <img src="https://punbb.informer.com/forums/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[null@example.com (Frank H)]]></author>
			<pubDate>Thu, 12 Jan 2006 16:53:19 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60126/#p60126</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/60124/#p60124</link>
			<description><![CDATA[<p>Great Connorhd, So with this extension system I wouldn&#039;t have to get down and muck with the php files like with mods. Is that correct?</p>]]></description>
			<author><![CDATA[null@example.com (JeffAdams)]]></author>
			<pubDate>Thu, 12 Jan 2006 16:51:21 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60124/#p60124</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/60123/#p60123</link>
			<description><![CDATA[<p>I plan to completely rewrite the PM system as an extension, with the upgrade script before 1.3 is released fully.</p>]]></description>
			<author><![CDATA[null@example.com (Connorhd)]]></author>
			<pubDate>Thu, 12 Jan 2006 16:49:27 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60123/#p60123</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/60117/#p60117</link>
			<description><![CDATA[<p>I agree Paul, the extensions system sounds very cool.</p>]]></description>
			<author><![CDATA[null@example.com (JeffAdams)]]></author>
			<pubDate>Thu, 12 Jan 2006 15:52:45 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60117/#p60117</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/60115/#p60115</link>
			<description><![CDATA[<p>PM is a feature only some people want some of the time which is why its better to have it as a mod. The alternative is to have it as a standard feature which a most users will then have to disable which is the definition of bloat. Anyway, I&#039;m sure a messaging system will be one of the first extensions made for 1.3&#039;s new extension system.</p>]]></description>
			<author><![CDATA[null@example.com (Paul)]]></author>
			<pubDate>Thu, 12 Jan 2006 15:45:18 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60115/#p60115</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/60114/#p60114</link>
			<description><![CDATA[<p>There is a lot of talk about the email system being better than PMs which I generally agree but there are instances where you need PMs. For instance, I run a forum for high school debaters, they want to trade evidence privately (they don&#039;t want everyone getting the same evidence) but don&#039;t want to use the forum&#039;s email thus revealing their email address to the other person.</p>]]></description>
			<author><![CDATA[null@example.com (JeffAdams)]]></author>
			<pubDate>Thu, 12 Jan 2006 15:35:50 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60114/#p60114</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/39720/#p39720</link>
			<description><![CDATA[<p>NegativeZero: I haven&#039;t missed your post. I&#039;ve just been busy. I&#039;ll try to read it through tomorrow and post a reply.</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Thu, 07 Apr 2005 22:33:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/39720/#p39720</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/39338/#p39338</link>
			<description><![CDATA[<div class="quotebox"><cite>Rickard wrote:</cite><blockquote><p>Jacq: I generally agree with you regarding user groups, but, and that&#039;s a big but (hoho), a user group system that allows users to be members of more than one group is a lot more complex. As it is now, basically all permission checks are done in SQL. This is great because it keeps the script code nice and readable. I very much doubt that would be the case if several groups were involved. You&#039;d have to somehow merge permissions from different groups to figure out what permission applies to the user in question. I&#039;m talking about conflicting permissions. Members of group A are not allowed to use the search feature, but member of group B are. Which permission should apply to a user that is a member of both groups? The usual solution to this is to use three different permission settings instead of two (e.g. allow, disallow and deny). I&#039;m just not sure I like that solution.</p></blockquote></div><p>I realise that I&#039;m resurrecting a dead &amp; done topic, but I thought this was worth pointing out. </p><p>First, a preface. I run several forums, all of which were using phpBB, and I was quite sick of it, so I changed all but one to punBB. The one that I didn&#039;t change was due to it having several (three) user groups, each of which had its own private forum. Now, I could have set up seven different user groups corresponding to the permissions and everything, but that seems like a bit of a pain to manage, and is really just a fudge. What punBB has at the moment isn&#039;t really user groups as much as it is flexible user &#039;classes&#039;. </p><p>Anyway, there&#039;s no reason why a simple permissions system couldn&#039;t be done primarily in SQL. It just has to be designed carefully. </p><p>We already have a table for holding users and for forums. What needs to be done is to tie them together via some more flexible relations. The four current user groups could be considered user types or user classes. So, if we consider a new usergroup table:</p><p>table &#039;usergroups&#039;:<br />- INT group_id<br />- VARCHAR group_name</p><p>Relating the groups to the users is then really easy, just using a simple table for relations:</p><p>table &#039;usergroup_users&#039;:<br />- INT group_id<br />- INT user_id</p><p>This adds a great deal of flexibility, in that a user can be part of any group, and they can be in multiple groups at once. Now, we need to represent which forums each group is allowed to access. This is basically relating groups to forums, and then giving a value to what they can do. For the permission itself, we can use just a number from 0 - 3, where 0 = no permission (can&#039;t view), 1 = read permission, 2 = read and post replies, 3 = read, post replies, post topics. I suppose if you wanted you could take it an extra step and add in edit permissions as a separate value in this table too, or even add moderation permissions to allow a usergroup to moderate certain forums, but that&#039;s getting beyond the scope of this example, which is pretty simplified. Here&#039;s the table:</p><p>table &#039;usergroup_perms&#039;:<br />- INT group_id<br />- INT forum_id<br />- TINYINT permission</p><p>So that&#039;s basically it for our table structure. The most pertinent question now is how we go about doing as much work in the database server as possible to tie this all together. Now, I&#039;m running under the assumption that we&#039;re using a logical permissions system, in that a user&#039;s permission for a forum is going to be the highest permission of any group he or she belongs to. Setting this up differently would mean it doesn&#039;t work according to the way that the average user would expect it to. As an example, let&#039;s consider two groups. One group is &#039;house&#039;. These are the people who have access to a house. Let&#039;s say for example that there&#039;s four people in this group. Also consider another group, car. These are the people who are allowed to drive a car. The two groups are not related, but two of the users in &#039;house&#039; are also in &#039;car&#039;, but not every user in car is able to access house, and vice versa. The logical thing to say about the two people who are in both groups is that they can access both house and car. They get the highest level of permission from each group. Having a setup where owning a house meant you weren&#039;t allowed to drive, for example, is not the way permissions systems work in the real world.</p><p>With that out of the way, quite simply we need to somehow get a list of every forum for which there is at least one group that a certain user belongs to that has permission level &gt; 0. </p><div class="codebox"><pre><code>SELECT forums.* , max( usergroup_perms.permission ) AS perm
FROM `usergroup_users`
LEFT JOIN `usergroup_perms` ON usergroup_perms.group_id = usergroup_users.group_id
LEFT JOIN `forums` ON forums.forum_id = usergroup_perms.forum_id
WHERE usergroup_users.user_id = &#039;&lt;user_id&gt;&#039;
AND permission &gt;0
GROUP BY forums.forum_id</code></pre></div><p>That query should achieve the desired result, and it&#039;s not overly complex. This is the most complex query, because this will show or hide the forums based on whether a user can see them. Once they&#039;re inside a forum, checking if the user is allowed to view the threads is basically the same query, but with an added clause in WHERE, since we know which forum_id we&#039;re looking at. When a user asks to read a thread, we check for permission &gt; 0, when they ask to post a reply, we check for permission &gt; 1, and when they ask to post a new thread, we check for permission &gt; 2. Of course, in the case of replies, from my memory of the punBB code we only know which thread we&#039;re replying to, so there would need to be an extra join to go from thread_id to forum_id. Basically though, the only major thing that would change would be the SQL statements themselves, and perhaps the addition of a function to check the user&#039;s permission before performing a task (though I think that code is already there, it would probably just need modification).</p><p>As far as the administration side of things goes, you would need to maintain an exhaustive set of permissions for each group. Administration of this isn&#039;t actually as hard as it looks at first. Whenever a new group is added, you insert a new permissions table row for each forum, probably with each permission set to 3. When you add a new forum, you need to add a new row to the permissions table for each group, again probably with permissions set to 3. You would also need to make sure that there is always a &#039;Members&#039; and a &#039;Guests&#039; usergroup. Whenever a new forum is added, the Members group should get permission 3 and the Guests permission 1. Also, whenever a user registers, they need to be added to the Members usergroup. </p><p>Maintaining the permissions is easy enough to do, in essence it would probably be exactly the same as the current setup. </p><p>I was actually considering coding all this up myself as a mod, but I unfortunately don&#039;t have enough spare time - doing my honours year in Computer Science so I&#039;m pretty busy. Also, while I&#039;ve tested the query I posted here in MySQL and it appears to give the desired results, I&#039;m not exactly an SQL wiz so it&#039;s possible I made a flub in there somewhere. I&#039;ve also got no idea if it will work on databases other than MySQL (though I don&#039;t see any reason why it shouldn&#039;t). This is just dealing with forum access permissions, but there&#039;s no reason why other permissions values couldn&#039;t be added to the table too. For example, you might have a second value which controls whether a group is allowed to search certain forums, or whether they can edit their posts, or if they have moderator privileges as mentioned earlier... the assumption is that permissions are attached to the forums, of course. Either way, this is really all just speculative stuff since I don&#039;t have time to code it, but I thought it was worth posting here since someone else might be interested in exploring it further. </p><p>Or I could have missed the bus totally and someone&#039;s already done all this. <img src="https://punbb.informer.com/forums/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></description>
			<author><![CDATA[null@example.com (NegativeZero)]]></author>
			<pubDate>Mon, 04 Apr 2005 06:03:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/39338/#p39338</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/30252/#p30252</link>
			<description><![CDATA[<p>Too bad in PHP OOP is a performance issue. Compiler caches like php-accelerate help, but not many virtual hosting companies have them on.</p>]]></description>
			<author><![CDATA[null@example.com (Jacq)]]></author>
			<pubDate>Wed, 12 Jan 2005 06:08:46 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/30252/#p30252</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/30238/#p30238</link>
			<description><![CDATA[<p>Rickard: I see your point.&nbsp; Keeping the data separate is not the issue, its how to insert the bits of code into the existing layout to give it a seamless appearance.&nbsp; My experiences with installing mods on other forums and cmss (is that a word? <img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /> ) has been toughest when it comes to an upgrade of the core app.&nbsp; Sometime I actually had to print out the original files that get modified by the mod install, and check line by line against the new version of the same file to find where I needed to insert and/or tweak the code to work with the new version.&nbsp; That?s not a task for any novice to want to go through.&nbsp; Some of the better mods, used mod specific variables and commented sections of code that where updated so they stood out against the core logic.&nbsp; Others made their own DB tables to keep data separate.&nbsp; The biggest thing I wanted from other mods was not to break the rest of the site if something went amiss during the upgrade.&nbsp; When looking through the code of punBB I see its mostly procedural code with some sprinkles of OOP.&nbsp; To be honest, I still am one of those persons who like to look at procedural code.&nbsp; I am an engineer by day, and thats how my brain is trained to think.&nbsp; So I like to look at the punbb code because I can understand it. (Most of it that is).&nbsp; Where I am going with this is that a module system seems like it would be best suited to be applied with an OOP approach. </p><p>Conner: I took a look at that post, and it seems like PunMod is a step in the right direction.&nbsp; Anyway you slice it.&nbsp; its a fine line to tread when you have to code an application and have the foresight to think about how mods should interact with the core app.&nbsp; I guess if I were to code a PM system, I would try to be as unobtrusive as possible to the core files, and take the minimalist approach towards the scope of the application.&nbsp; For instance, when a user logs in put an icon next to his name where it says ?logged in as username? indicating that user has a private message.&nbsp; Click on that link, and have it bring you to the module itself , etc..</p>]]></description>
			<author><![CDATA[null@example.com (buzzkill)]]></author>
			<pubDate>Wed, 12 Jan 2005 01:06:32 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/30238/#p30238</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/30232/#p30232</link>
			<description><![CDATA[<div class="quotebox"><cite>Jérémie wrote:</cite><blockquote><p>Maybe by calling them from the templates ? That&#039;s usually how software like CMS (like Textpattern for example) do it, since it&#039;s the only place where everything come into places.</p></blockquote></div><p>Yes, but PunBB doesn&#039;t use templates to the same degree as those apps. It uses templates only to allow users to setup the overall structure of the site, i.e. not individual &quot;bits&quot; of the forums.</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Tue, 11 Jan 2005 23:10:38 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/30232/#p30232</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/30194/#p30194</link>
			<description><![CDATA[<p>I know, but I don&#039;t see a review process (if there is one). It would be good for users to vote or comment on the mod after using it.</p>]]></description>
			<author><![CDATA[null@example.com (Bwongar.com)]]></author>
			<pubDate>Tue, 11 Jan 2005 19:15:01 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/30194/#p30194</guid>
		</item>
		<item>
			<title><![CDATA[Re: 1.3?]]></title>
			<link>https://punbb.informer.com/forums/post/30193/#p30193</link>
			<description><![CDATA[<p>there is modding community - <a href="http://www.punres.org">www.punres.org</a></p>]]></description>
			<author><![CDATA[null@example.com (Connorhd)]]></author>
			<pubDate>Tue, 11 Jan 2005 19:13:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/30193/#p30193</guid>
		</item>
	</channel>
</rss>
