Im going to have to do some f*kery on this. Let the hacks begin
jzbg
Posts
-
Whats the easiest way to limit the group posts to only show the posts for that specific group? -
Scrolling to bottom of category produces the ERROR: You do not have enough privileges for this action@PitaJ Yes exactly!... I had to write a small tweak inside: nodebb/public/src/modules/alerts.js
(ajaxify.data.template.categories) && ($('[component="topic/purge"]').length === 0) ? null : createNew(params);
This does not fix the reason why users who are not admin or moderator are getting this error each time they hit the bottom of the topics on the categories page.
This resolves my issue but still dont know why it would keep popping this error. When the user is admin it will not appear. But regardless, it should not keep firing this if the user is just a regular user and scrolling to the bottom of the group they are a member.
-
Whats the easiest way to limit the group posts to only show the posts for that specific group?@PitaJ When I filter out the posts that do not belong to the group .... I am left with a smaller amount of posts... I need to get more posts to fill the page.
When the page renders the posts in the group... I am filtering out all of the member posts that do not belong to that group.... NodeBB appears to provide the last 10 posts from the members that are part of that group.
If the top 10 that are coming back have for example 8 of them that posts from a different group ... I am filtering them out.. I dont want to see them since they are not from the group the user is currently viewing.
When I do this, I only have 2 remaining that are associated to the group that the user is viewing. I need to now figure out how I can get another 8 of them that do belong to the group that they are viewing.
Hope this makes things a bit clearer.
NodeBB for whatever reason is showing both the posts made inside the group being viewed by the member but also the posts the member made in other groups.
I dont want to show any of the posts made by the members from other groups. I only want to show the posts made inside the actual group being viewed. My filter is removing those posts made in outside groups by these members. When I filter I am left with a small remaining amount to show on the template.
-
Whats the easiest way to limit the group posts to only show the posts for that specific group?I was able to hook into the
filter:groups/details.build
And do something simple to filter like this:
plugin.groupDetail = function(data,callback){ let f = data.templateData.posts.filter(p=>data.templateData.group.name === p.category.name); data.templateData.posts = f; callback(null,data); }
The result was that it limited the results on the group details to only reflect the posts that match the category. However, I then will need to requery the database and re-render the data and re-generate new objects to get more posts that belong only to this specific category.
All I simply want to do is make the group details only show the posts that belong to that specific group. Currently the nodeBB is showing all of the posts that a member of the group has made even when the posts could be from a totally different group.
Any suggestions or advice, greatly appreciated. I am trying to avoid making changes to nodebb base and do all of this from my plugin.
-
Scrolling to bottom of category produces the ERROR: You do not have enough privileges for this actionWhen the user scrolls to the bottom of a category they are a member of they get the error below:
The dev logging shows the following:
verbose: [plugins/fireHook] {"meta":"filter:privileges.categories.get"}
Inside the ACP > Privileges for this specific category I have a group assigned and members of this group has full access to all of the permissions for this associated category.
Why is this message coming up?
Any ideas?
Thanks!
-
What is this blue highlight that appears sometimes on a timeoutIt appears that if you have long thread and you use back navigation on browser it highlights to show you the last post you clicked.
-
What is this blue highlight that appears sometimes on a timeoutWhat does this highlight mean ? Sometimes when I load a category the page will highlight a topic with a blue background... I want to know what this is used for. I want to disable this functionality.
I'm trying to catch the css class that is getting adjusted on the DOM, but its going quick and I am having trouble locating it.
UPDATE: the class appears to be called .highlight
-
Overriding language json files from pluginRESOLVED
If anyone else sees this thread... Don't be the american who thinks the default should be en-US....
It appears that the nodeBB default language was set for en-GB
If you need to adjust the language default setting:
Go to your NodeBB ACP (admin control panel) => General => Languages
-
Overriding language json files from pluginI might have found the issue....
I see that my nodebb is defaulted to en-GB
Let me switch this! One moment....
-
Overriding language json files from pluginI am using grunt for development, but i have fully killed the grunt watcher and have manually started up the ./nodebb build and made sure to fully kill and start up nodebb so it rebuilds all assets.... Still Its not using the language file.
Where can I check the default nodebb language setting that is currently in use?
-
Overriding language json files from pluginI have reviewed this older discussion:
https://community.nodebb.org/topic/4647/how-to-override-language-login-json-file-through-pluginI have attempted to follow everything in the latest 1.11.1 , but I cannot make the language file override the existing file...
Here is my basic setup
Persona theme
NodeBB 1.11.1
My PluginIn my plugin.json I have added:
"languages": "static/languages"
In my plugin folder I have a folder:
static/languages
Inside this folder I have 1 folder only:
en-US
Inside this folder I have 1 file only:
category.json
This category.json was copied from the default nodebb base folder
nodebb/public/language/en-US/category.json
To test if my plugin is overriding the default category.json included in the base I have updated the category.json my plugin/static/languages/en-US/category.json with the following:
"new_topic_button": "HELLO WORLD!",
I have re-built all assets and restarted the entire nodebb service.
I have refreshed my browser and still the new_topic_button continues to show the old "New Topic" text.
I am expecting "HELLO WORLD!"
What am I doing wrong? How can my plugin update the text inside these language files?
Thank you!
-
notifications.create then notifications.push not showing unread notification alertI solved my own problem... I setup a custom notification to fire on the action:post.save hook and I was using the same default standard format for the notifications nid value. Basically I was firing off a notification with the same nid as the notification that auto generates when you post a new topic.
Long story short: Make sure the nid is unique.
-
notifications.create then notifications.push not showing unread notification alert@baris in notification data object passed to notifications.create what option would need to be passed to specify a specific group?
My example above has somehow a relationship to admin group?
-
notifications.create then notifications.push not showing unread notification alertOne other question that maybe you or somebody else knows the answer… I have been testing and have noticed that when you create the notification if the person creating the notification has admin privileges than all the administrators also receive the notification.
So for example the user who creates the post has administrative privileges and the notification is created and pushed and that user is able to see the notification on their account however all of the other users who also have administrative privileges also receive the same notification… Is this the intended default behavior or is this potential bug?
I am trying to determine if there is some setting that I missed or if I need to write a tweak to the code to make sure that the other administrators do not see the notification that was only intended for the administrator who posted the content.
Thx!
-
notifications.create then notifications.push not showing unread notification alertI reviewed my code and my plugin is automatically bringing the user to the new post page via ajaxify.go().... It appears that when you go directly to a new post the unread notification associated with this is automatically marked as read.
Thanks for your help.
-
notifications.create then notifications.push not showing unread notification alert@baris I am using the persona theme with my own custom theme installed . However, my custom theme is not doing any major changes to the default persona theme that are related to the unread counter.
I have added a console.log to:
// nodebb/public/src/modules/notifications.js Notifications.updateNotifCount = function (count) { console.log('updateNotifCount count:', count); // 0 ... }
The notification alert message does appear OK.
I get the following alert message "NEW NOTIFICATION" from the notification being triggered (screenshot):
However the console.log on the count object coming from the Notifications.updateNotifCount === 0
So to answer your question: The result of the console.log related to the count object is showing 0.
What should I try next?
Thank you!
-
notifications.create then notifications.push not showing unread notification alertI am able to get the notification alert to appear but it does not show inside the header notifications/icon.
What am i doing wrong here?
var websockets = require.main.require('./src/socket.io/'); notifications.create({ bodyShort: `Yay, this is a notification!`, pid: pid, path: '/post/' + pid, nid: 'tid:' + tid + ':uid:' + uid, tid: tid, from: 1, // 1 is my admin account }, (err, notification)=>{ console.log(notification); // this response object is OK notifications.push(notification, [uid], ()=>{ console.log('Notification created') }); });
I just want to make this notification show inside the notifications icon.
Note: When this code triggers the client user logged in does see a small alert message appear, however, the actual notification icon does not show the unread status indicator.
Do I need to set a special 'type' key on the notifications object I'm creating?
Thank you everyone for your help. Happy holidays.
-
What hook can I use to filter the topics that appear when accessing /groups/mygroupname ?@julian said in What hook can I use to filter the topics that appear when accessing /groups/mygroupname ?:
filter:groups/details.build
Hi Julian,
Thank you for this info. My issue is now solved. I was able to perform my serverside filter logic and now everything is great.
FYI - I'm the same guy (username: jremi) that you helped related to the sharing sessions plugin. I was asking you about if using the cross storage solution would work for cross domain cookies.
Thanks again for your help. I really appreciate your assistance.
-
What hook can I use to filter the topics that appear when accessing /groups/mygroupname ?I'm having trouble finding the best server-side hook to use so I can filter the topics that show for the users (members) who are part of the group. The route is (/groups/<mygroupname>)
I was starting to look at the different hooks but I was having trouble finding the one that is best suited for the topics that display from the members when accessing this /groups/<mygroupname>
The reason I ask:
Currently the default functionality for the groups/<mygroupname> is showing all of the posts that a member made thru out the nodebb categories. I need to filter it to only show the posts the members made for the group they are currently viewing. I was able to accomplish this with some clientside code. However, it is ugly hack because I am removing the already rendered posts that do not belong to the group that the user is viewing. I need to filter this out most likely server-side to get the best user experience.I tried a few different hooks but I can't seem to find the best one to get this done. I am trying to avoid messing with the nodebb core since I am writing a plugin and wish to just make my adjustments without touching the base.
Basically I have currently a matching category that links to an associated group. I only want the topics posted from that specific group to show inside the group. Just looking for suggestions on best place to filter.
Thanks for any advice.
-
Old/Bad Category CID somehow stuck in nodeBB cache. How to clear?I already re-installed onto a new server. I was only testing .. If I do reproduce I will make sure to provide stacktrace. I do appreciate you looking into this. I will make sure in the future that I can provide more details.