phpbb-extensions / boardrules Goto Github PK
View Code? Open in Web Editor NEWBoard Rules extension for phpBB
Home Page: https://www.phpbb.com/customise/db/extension/boardrules/
License: GNU General Public License v2.0
Board Rules extension for phpBB
Home Page: https://www.phpbb.com/customise/db/extension/boardrules/
License: GNU General Public License v2.0
Would it be a good idea to use mod_rewrite (apache specific) to hide the front controller app.php from urls like phpBB does with an .htaccess file? Will make urls a bit prettier.
A Beta 2 should be released now that phpBB-RC2 is out, as Beta 1 is incompatible with RC2.
Changes since Beta 1: 1.0.0-b1...master
Header link should be optional as per our earlier feature outline
entity import function can throw two types of exceptions.
Shouldn't the docblock contain both @throws types?
https://www.phpbb.com/community/viewtopic.php?p=13662351#p13662351
Should be updated to say throws base
This PR is splitting the ACP BBcode buttons into a separate template: phpbb/phpbb#2290
After its merged, we can include the template instead of hard-coding the bbcode buttons too.
Do we not use breadcrumbs? I thought we did (was it just in the ACP)?
https://www.phpbb.com/community/viewtopic.php?p=13629791#p13629791
We probably do want to have breadcrumbs as well on the frontend.
I have not been able to find an elegant/efficient way to implement this.
My idea was simple enough. Append the following text to the bottom of the "Terms of Use" paragraph shown to users when attempting to register:
You agree to abide by the additional rules of this forum set forth in the following “Rules” section. View Board Rules.
So we'd need a template event in ucp_agreement.html
But we need to do a little work in the event listener, such as:
public function require_at_registration($event)
{
$this->template->assign_vars(array(
'S_BOARDRULES_AT_REGISTRATION' => ($this->config['boardrules_enable'] && $this->config['boardrules_require_at_registration']) ? true : false
'BOARDRULES_REGISTRATION' => $this->user->lang('BOARDRULES_REGISTRATION', $this->controller_helper->url('rules')),
));
}
My question is regarding the event listener. We could just add the function to the page_header() core event, but I think we really only want this event listener to load when it is needed, which is only when a guest is on the register page.
So is it worth asking for a core event somewhere in ucp_register.php just for this purpose, or does anybody have any brighter ideas?
get_rules should not include rule id = parent id
Kind of like phpBB does, would it help to install some sample data, say 1 category with 1 rule inside, just to help users see how it works? It may be more helpful than sending it out with nothing as we currently do.
Just something basic like:
Example Rule Category
Example Rule
This is an example rule in your Board Rules installation. Everything
seems to be working. You may delete this rule and category and
continue to set up your own board rules. Have fun :)
We should be able to use the config_text field to make the Board Rules explanation user configurable from the Settings page.
Currently it is hard coded language
These rules are disclosed to clarify the various responsibilities of all community members here on yourdomain.com. They shall be adhered to by everyone to ensure that our board runs smoothly and provides a fun and productive experience for all of our community members and visitors.
While it's a good bit of text, is there any value in making it customizable for the admin?
It's not needed. Also make the Preview button not bold.
PHP Notice: in file [ROOT]/ext/phpbb/boardrules/entity/rule.php on line 545: Undefined index: rule_message_bbcode_options
// If we're setting the option and the option is not already set
if (!$negate && !($this->data['rule_message_bbcode_options'] & $option_value))
{
// Add the option to the options
$this->data['rule_message_bbcode_options'] += $option_value;
}
First time through we are trying to add a value to something that does not exist.
I noticed that all the rules that I have created yesterday are gone. When I try to re-create the rules with the same anchor I am getting an error message that the anchor is not unique (however I cannot access the rule by it's unique URL). The table notifications in the DB is also empty ...
In which table the rules are kept?
Any other ideas?
IMO prosilver template and theme files should be also placed in all
folder.
https://area51.phpbb.com/phpBB/viewtopic.php?f=84&t=41499&p=265161#p265161 and previous posts
When installing the sample rule data, we should use text from a language file instead of hard-coded language.
If you download the tag:
https://github.com/phpbb-extensions/boardrules/releases
There are no notes explaining what users should do. We should have something telling users where to copy files to or where they can go to learn how to install the extension if a tutorial exists somewhere.
Now that a build script has been added, as per our discussion on irc with MichaelC my question is if we should require phing as a dependency for -dev.
So do we want to set up a unique permission for the ACP module (a_boardrules)?
Where module 'auth' => 'ext_phpbb/boardrules && acl_a_boardrules'
Or we could just use an existing ACP permission like acl_a_board (which I believe gives access to Full/Standard Admins only).
Where module 'auth' => 'ext_phpbb/boardrules && acl_a_board'
I guess my question is, who do we want to restrict access to editing/creating board rules to?
What do you think to create board rules github page?
Currently every anchor must be unique.
We should allow non-unique anchors between different languages. So, for example, the anchor rule-1
will link to "Rule 1" no matter which language the user is viewing the rules in.
An example scenario is where a user is using English, and he copies the link to a rule and gives the link to another user. But the other user is on another language, so the link currently won't work for them since in their language, the rule's anchor does not exist.
So we should only enforce unique anchors within the current language a rule is being created in.
Based on this report:
https://www.phpbb.com/customise/db/extension/boardrules/support/topic/153026
IMO, migration files should be unified before first final release.
m3_add_schema can be merged with m1_initial_schema
The beta 2 tag release neglected to update the version in composer.json
Next logical step is to move this to RC which ideally we'd do in ~1 week. Hopefully we can get it to stable and release that at the same time as 3.1.
Anything else we must address before creating a Beta 1 release?
How will we implement this feature?
Using the notifications system was mentioned in the discussions. But what if a board has over 10,000 members? Can the notification system handle creating 10,000 notifications???
Should we have a gitattributes file?
Mainly just to prevent the following files which are unrelated to the actual extensions usage from being exported when anybody clicks download:
/tests/
.travis.yml
README.md
Disabled the extension (don't know exactly which version I had), updated to master repo, tried to enable the extension again. Result ;)
SQL ERROR [ mysqli ]
Duplicate entry 'phpbb.boardrules.notification.type.boardrules' for key 'type' [1062]
SQL
UPDATE phpbb_notification_types SET notification_type_name = 'phpbb.boardrules.notification.type.boardrules', notification_type_enabled = 1 WHERE notification_type_name = 'boardrules'
BACKTRACE
FILE: [ROOT]/ext/phpbb/boardrules/migrations/v10x/m11_notification_type_update.php
LINE: 41
CALL: phpbb\db\driver\factory->sql_query()
FILE: (not given by php)
LINE: (not given by php)
CALL: phpbb\boardrules\migrations\v10x\m11_notification_type_update->update_notifications_name()
I could easily just delete the data, but I'm guessing others might encounter this error too.
I made a wiki entry here:
https://github.com/phpbb-extensions/boardrules/wiki/Board-Rules-Directory-Structure-and-Content-Guide
Since this extension is meant to be a learning model, I took the liberty of creating a guide explaining the purpose and usage of all the directories and files in this extension (since not everything can be explained just in code comments).
Some extra eyes on it would help in making sure it is accurate. Feel free to make edits to it as needed.
Need a migration for this version.
When I delete the last remaining rule within a category and I click the closing-icon on the AJAX confirm message, an empty table of a few pixels is shown. (When I click the "Return to previous page" link, it's working fine).
We should add functional ACP test coverage for:
-Create rule
-Edit rule
-Delete rule
The HHVM test failures are due to rule_entity_message_test.php
The tests die without reporting errors, so it's hard to tell what it is exactly, but it most likely has to do with get_message_for_storage/edit/display() functions. HHVM tests also fail on functional test btw.
zend_mm_heap corrupted
May be a lead...
Move ACP template events from:
/styles/prosilver/template/event/
to:
/adm/style/event/
Requires: phpbb/phpbb#2455
For multilanguage board that feature could be useful.
Just copy them and translate each rule.
Because deleting a category will also delete all rules within it, we should mention that to the user. So the delete rule confirmation text should read something like:
Are you sure you want to remove this rule?
Note: Removing a rule category will also remove all rules contained within it.
Move rule should have some csrf protection. This can be done by using the create link hash for the move rule links and checking that hash in the controller.
The difference between rules and categories is not clear when editing one of those. For categories the "Rules message" textarea serves no purpose and should actually be hidden.
Switch to simpler test framework based almost entirely on phpBB's framework files:
Requires:
Since this extension is a learning example, I think our composer.json should be up to par.
having said that, the "username"
fields in the author block are not part of the composer.json schema, so should be removed.
In my extensions I have typically added my username to my name field, e.g.:
"name": "Matt Friedman (VSE)",
Also, what is the story at the bottom with
"branch-alias": {
"dev-master": "1.0-dev"
What does 1.0-dev refer to? And what branch alias? because the github branch is called master. So i'm confused by this line.
We do this for most important pages, like so: https://github.com/phpbb/phpbb/blob/develop/phpBB/viewtopic.php#L717
and https://github.com/phpbb/phpbb/blob/develop/phpBB/ucp.php#L39
I suggest we do the same here:
https://github.com/phpbb-extensions/boardrules/blob/master/controller/main_controller.php#L152
Something like: S_IN_RULES
This will come in handy for style authors who use it to highlight icons/status/whatever.
Because they are used as ID attributes in html tags.
Is there a reason the rule_parent_id field
is not included in the entity->import()
function? If not, it probably should be added.
Do we really need them - delete and move methods, in admin controller?
These methods can be called via rule operator directly from a future ACP module.
If you send out a first notification, it works.
If you try to send a new notification, it does not work. Whether or not the first notification was read, the first notification is the only notification you see, the second (or third or fourth) never show up.
Same issue reported in this ext author's experience: https://www.phpbb.com/community/viewtopic.php?f=461&t=2249811
@EXreaction notifications are your baby, any ideas?
At least the following lines do not use sql_freeresult:
It would be nice to have a categories pull-down field on the edit a rule page, so you can easily move a rule being edited into a new category. This should be something exactly like editing forums offers.
Deletion must be done with the operator (since it has to resync the tree).
We may need to update the notifications system for the next phpBB release:
phpbb/phpbb#2885
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.