[Installed] Notifications on new posts in own threads

Discuss issues and requests related with the forum software
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

09 Oct 2014, 17:09

joedf wrote:alright sorry about the packing thing :P anyway. no problemo, mi amigo! :D
thank Bruttosozialprodukt too! ;)
Yes yes! Thanks, Bruttosozialprodukt!

Watching you work this out is kinda cool. Sorta like a surgical theater.
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Notifications on new posts in own threads

09 Oct 2014, 18:51

Ezriilc wrote:Watching you work this out is kinda cool. Sorta like a surgical theater.
LOL :lol:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: Notifications on new posts in own threads

10 Oct 2014, 06:04

Glad that you like our work. :D

Any news on the approval?
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Notifications on new posts in own threads

10 Oct 2014, 12:52

I understand the excitement (me too ;) ). Soon.. Patience
Spoiler
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: Notifications on new posts in own threads

10 Oct 2014, 13:58

Okay.

*reloading the thread every 5 minutes*
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

10 Oct 2014, 16:52

So I see that you're accessing the database directly on your own, rather than using phpBB - I'm assuming there's a way of using phpBB's db info. For instance, I'm using SQLite instead of MySQL. Using phpBB's access seems safer and more robust to me. I didn't read through this entire thread, is there a reason you didn't use phpBB?

Also, I'm wondering if there's a way to do this without modifying every style's HTML - maybe not.

I'm going to see if I can turn this into a true "mod" for phpBB, just for giggles.
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: Notifications on new posts in own threads

10 Oct 2014, 17:22

What do you mean by "using phpBB"?
Our way is very likely more efficient then including a buch of phpBB libs etc.
We are simply using phpBB to verify the user is logged in and then we read our stuff from the database, which shold be 100% safe.
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

10 Oct 2014, 17:25

Bruttosozialprodukt wrote:What do you mean by "using phpBB"?
Our way is very likely more efficient then including a buch of phpBB libs etc.
We are simply using phpBB to verify the user is logged in and then we read our stuff from the database, which shold be 100% safe.
It's been a long time since I've been under the hood of phpBB, but don't most apps like it have open handles already going for db and other stuff?

I should think that at least the PDO string would be available already, taken from phpBB's config.php.

It may be a matter of extending phpBB's classes that already access the db or whatever.

Like I say, it's been a long time, so I may not have any idea what I'm talking about.
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: Notifications on new posts in own threads

10 Oct 2014, 17:29

But you realize that the php file that we call from javascript is it's own file, right?
So there are no handles or anything form phpBB by default and since php script instances can't communicate with each other I don't really see how such handles could be of any help.
Also I don't think that the mySQL functions do return a handle or something like that.
edit:
Oh wait, yeah the connection handle...
We are only using one handle in the php file, so this shouldn't be optimizable.
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

10 Oct 2014, 17:33

Bruttosozialprodukt wrote:But you realize that the php file that we call from javascript is it's own file, right?
So there are no handles or anything form phpBB by default and since php script instances can't communicate with each other I don't really see how such handles could be of any help.
Also I don't think that the mySQL functions do return a handle or something like that.
I may be misunderstanding how this executes. I apologize - I didn't get it working yet since I'm using SQLite, and I didn't read the JS at all.
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

10 Oct 2014, 17:38

Now I see. You're using Ajax to hit the notifs.php in isolation. That makes a bit more sense now. However, you are already including common.php which has the $db in it.
EDIT: In fact, it appears that common.php includes nearly all the phpBB libraries and classes.

Once I get this tweaked to use SQLite, how can I trigger a notification for testing?
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: Notifications on new posts in own threads

10 Oct 2014, 17:43

Subscribe to a thread and make sure someone answers to it without you reading the post.

For a future update we could maybe validate the user login cookie manually to get rid of the common lib include.
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Notifications on new posts in own threads

10 Oct 2014, 23:37

Ezriilc wrote:Once I get this tweaked to use SQLite, how can I trigger a notification for testing?
Use an interface like phpmyadmin to change the "Topic_watch table"
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

11 Oct 2014, 11:38

Bruttosozialprodukt wrote:For a future update we could maybe validate the user login cookie manually to get rid of the common lib include.
Well, that duplicates even more code and so seems to be a step in the wrong direction to me. Also, it seems like that might be a bad idea from a security point of view. Personally, I consider cookie logins to be one of the least secure aspects of user control, and it might be wiser to trust phpBB to handle it.

In my opinion, using phpBB's framework is a very good thing that should be embraced - and is the whole point of using such a system. Otherwise, instead of a "mod", you've built a forked version of phpBB as well as all your styles.

In my world, duplicating code is a big no-no, and you're duplicating much of the work that phpBB has already done for you. There is efficiency from the machine's point of view, then there's efficiency for the humans who must maintain the machine. If those fine people who forked phpBB are no longer around when a breaking update comes down, then tracing and fixing the break may be much more difficult - not so with an actual "mod" that fits the framework.

In my experience, it's best to use the strengths of whichever framework you've chosen, and not to fight it. However, it may just be a matter of opinion what is actually best. I'm just calling it as I see it. :)
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

11 Oct 2014, 11:41

Am I correct in thinking that this only works if the user has PM notifications turned on? It seems there should be a way to include another option in the UCP for this.
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

11 Oct 2014, 11:48

joedf wrote:Use an interface like phpmyadmin to change the "Topic_watch table"
Ah yes, thanks. But I'll use phpLiteAdmin. ;)
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: Notifications on new posts in own threads

11 Oct 2014, 12:10

Yeah, of course this would kind of duplicate code because there will be multiple file that can validate a login cookie, but therefore it would drastically reduce CPU/RAM usage which is much more valuable than disk space.

Just believe me loading 10000 functions/variables into the RAM just because you want to use one of those functions is not very efficient.


It will simply work if you have an account here. If you don't wanna use it then you shouldn't subscribe to threads or simply unsubscribe if you already did.
User avatar
Ezriilc
Posts: 51
Joined: 07 Oct 2014, 17:42

Re: Notifications on new posts in own threads

11 Oct 2014, 12:26

Bruttosozialprodukt wrote:Yeah, of course this would kind of duplicate code because there will be multiple file that can validate a login cookie, but therefore it would drastically reduce CPU/RAM usage which is much more valuable than disk space.

Just believe me loading 10000 functions/variables into the RAM just because you want to use one of those functions is not very efficient.
I do believe you. That makes a lot of sense.
[reads more of the .js]
Especially since you're hitting notifs.php every 60 seconds. Stripping it to the bones is the sensible way.

However, you could include config.php to get those vals without much overhead, and that would preclude the need to duplicate the db name/username/password in notifs.php, for what that's worth.
I support: AutoHotkey | PCs & Mobile | Networking, Inet/Web & Software Development | Games | Life, The Universe & Everything.

Behold the awesome that is my more-beard! :morebeard: <-- That's me!
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: Notifications on new posts in own threads

12 Oct 2014, 05:24

With this we could make the topic url link to the first unread post:
"/boards/viewtopic.php?t=" + topicId + "&view=unread#unread"
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Notifications on new posts in own threads

12 Oct 2014, 17:29

hmm interesting idea, the only problem is that, if the topic is "all-read" then it wont directy scroll to the last post :(

Edit: http://ahkscript.org/boards/viewtopic.p ... ead#p28130??
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “Forum Issues”

Who is online

Users browsing this forum: No registered users and 35 guests