|
إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...
انضم الينا
#1
| ||
| ||
Hi All, I've been looking at the code to add new types of notifications and it looks like the current method of generating them is pretty inflexible in so far as it's impossible to write them without modifications to the source code. I'll use a [related] bug that I filed to have join requests added as an example: In looking at includes/class_bootstrap.php, you'll see the function build_notifications and a quick read of this functions shows you that you can only ever create customizations that are built from columns that exist in the user table. What this means is that any new notification type that you want to add requires , minimally, a modification of:
This would have been MUCH easier for joinrequests if all of the existing code used called a global functions_usergrouprequest.php that provided for the adding of leaders, adding requests, accepting requests, etc. (or use a DM instead of a library). Anyways, the net-net is that the current method of creating new types of notifications is pretty rigid and I'm wondering if any of you other programmers out there would like to see a more pluggable interface to create these things without having to make code changes. I recognize that most programmers are uber and follow good OO or Modular programming methodologies, but the fact that adding these things requires mods to the class_dm_user.php file means that we can never create these things for our own mods without turning our products into hacks. Note: there are hooks in the build_notifications function in includes/class_bootstrap.php file, but they are really just read-only hooks because the current system requires that the count of the notification types be a referenced in $vbulletin->userinfo[ ]; Your thoughts? Cheers, Dave. __DEFINE_LIKE_SHARE__ |
مواقع النشر (المفضلة) |
| |