Pages:
Author

Topic: Skipping to the next/previous post within a topic by the same author (SMF patch) (Read 538 times)

member
Activity: 135
Merit: 52
Peekaboo!

Thanks so much OP for your hardwork. I visited this forums after many months and was pleased that this thread was created. Hope to see its full implementation one day!
legendary
Activity: 2730
Merit: 7065
If the codes you wrote are 100% ready for deployment and it wouldn't mess with any other forum features, why not!? I say add it theymos. 

I often use "CTRL-F username", and this would be easier. To search for a user's posts, I use "show All" to search more pages at once, but that's not possible for very large topics.
I did that as well in the past. But I think it was you who told me about a better way. Instead of doing a "CTRL + F + username" search, I now do "CTRL + F + Activity count" of that user. There is a benefit to doing that. "CTRL + F + username" also highlights every time that person was quoted in the thread. But unless someone else has the exact same activity points, "CTRL + F + Activity count" is better. And if we are searching for posts written by the OP, thanks to PowerGlove, we can now run a search for "(OP)".
hero member
Activity: 510
Merit: 4005
I left a half-joking line in the initial post about being preemptively annoyed that people (and ajaxtempest specifically) would probably ask for up/down arrows instead of left/right ones. I just want to add some context to that, in case it rubbed anyone the wrong way or gave off the impression that I don't appreciate feedback: One thing that may not be obvious to anyone watching from home is that when I do these patches, I'm working within the confines of an existing scaffolding of HTML/CSS/PHP that I'm trying to disturb as little as possible. Because of this, there are often only a small handful of possible design decisions that "make sense". I also like to keep the patches as small as I'm able to, because I believe that theymos is more likely to accept them that way. Please keep that in mind if my approach to feedback ever seems standoffish, because I definitely do appreciate feedback, but it's not always possible to apply (given the constraints).

Would it take more than a line break in the "report to moderator" button (so it stays at the very bottom) and one in those two buttons to make it vertical though?


works for HTML, I'm not sure if there's something for it on php or if this would be too much adapting for the stylesheet.
Yep, after LoyceV's input (which I misunderstood) I tried experimenting with line breaks in various places and in various ways, and while a few attempts did kind of work, there were always layout and spacing artifacts that made things look a little too messy. I also played around with some other techniques, like inline styles applied to different combinations of container elements, but those experiments also only produced results that kind of worked and had their own layout and spacing problems. Because horizontally laid out left/right arrows make just as much sense (to me) as vertically laid out up/down arrows, I gave up after that. Smiley

Adding numbers between the two arrows (Next and Prev) to easily see the number of posts by the user will easily solve this and allow the user to easily refer to his previous post. For example, (as I mentioned in my 2 (second) post that......) this is just my 0.004 cent.
That's a good idea, I like it! Unfortunately, it would require the kind of "eager" database lookups that I'm trying to avoid (details in initial post).
hero member
Activity: 510
Merit: 4005
Yes, my fault, I have missed that cast to int. As I am allergic to variables encoded in queries, it blinded me and I haven't seen the whole picture.
Yep, I sympathize; that query being safe is not obvious at first glance.

As a penance I will listen 10 times "The Best of Bryan Adams".  Cry
That's too much self-flagellation for an honest mistake, maybe just one listen to Michael Bublé's christmas album. Grin

But still take a look, maybe using prepared statement would give a (marginal) benefit.
They improved things in later versions, but putting together SQL queries by string interpolation is canonical on this old version of SMF.
legendary
Activity: 952
Merit: 1386
$param_topic, $param_user and $param_message are all forced to integer values, $gt_lt can only be '>' or '<', $direction can only be 'DESC' or empty. If you can see something that I can't, then please point it out, I would appreciate it!

Yes, my fault, I have missed that cast to int. As I am allergic to variables encoded in queries, it blinded me and I haven't seen the whole picture. As a penance I will listen 10 times "The Best of Bryan Adams".  Cry
But still take a look, maybe using prepared statement would give a (marginal) benefit.
hero member
Activity: 510
Merit: 4005
@PawGo: Please respond to post #14. I thought very carefully about security before posting any code, and I resent the lazy security review you left on page 1. Either tell me specifically what you think I missed, without vague references or admit that you jumped the gun and didn't actually read/understand the code before you posted.

Am I to do something to enable this? 'OP' patch was directly shown without doing anything on my part. Is it cause I'm on mobile?
Don't worry, there's no way for you to enable this at the moment. It's just a proposal right now; if theymos accepts the patch then you'll see it automatically, just like last time.

Wow I would love to have this feature and I’m sure all those who have been to WO they will love this the most.
Yeah, I have my own reasons for liking it, but I also very much had the WO folks in mind when I decided to start working on this; it's a feature that really shines in megathreads!

This is a fantastic addition that I would love to see. It would be more useful to bounty sections because the manager would be able to easily track weekly reports because you only need to be on the user's first comment to navigate to the last page without having to scroll the entire page.
I'm happy you think it will be useful! I was getting discouraged after the first few responses (except LoyceV's). It was looking bleak there, for a minute. Cheesy
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Am I to do something to enable this?
It's up to Admin to apply patches.
hero member
Activity: 2520
Merit: 952
Am I to do something to enable this? 'OP' patch was directly shown without doing anything on my part. Is it cause I'm on mobile? As previously pointed, 'it's hard to see on mobile' but I don't see anything next to report to moderator at  all Huh
staff
Activity: 1316
Merit: 1610
The Naija & BSFL Sherrif 📛
This is a fantastic addition that I would love to see. It would be more useful to bounty sections because the manager would be able to easily track weekly reports because you only need to be on the user's first comment to navigate to the last page without having to scroll the entire page.

Unfortunately, this "deferred" approach has a small usability flaw, and that is that because the information about the next/previous post is unavailable at render time, the buttons are not "smart", and they appear whether there is a post to skip to or not. In cases where you're already on the first post (no previous post to skip to) or already on the last post (no next post to skip to), clicking on the respective button will simply take you to where you already are. I don't think this is a big deal,
 it queries the database for the appropriate destination message and then redirects there.

Adding numbers between the two arrows (Next and Prev) to easily see the number of posts by the user will easily solve this and allow the user to easily refer to his previous post. For example, (as I mentioned in my 2 (second) post that......) this is just my 0.004 cent.

Is it possible to do a local board SMF patch?  Cool
hero member
Activity: 510
Merit: 4005
This sounds interesting and I would use this, not all the time but sometimes for sure, and your SMF patch would certainly be a big simplification for me.
Yup, it's not a feature that I would reach for all the time, either. But it's very useful when it's needed, and it's much less tedious than the alternative (which for me, involves either clicking on "All" or clicking on each page, and then doing a CTRL+F).

What I am doing now is that I visit ninjastic website archive of specific post, than I click on Users tab, and select user with all his post in that topic.
That's pretty clever! Smiley

I am not sure if theymos will accept this patch update quickly as he did your previous contribution, but I don't see any obstacles if there is no impact on forum security.
Yeah, I'm also guessing theymos will need a bit of time with this one. I don't believe there will be any impact on forum security (see post 14).

I don't know if this is possible, but one suggestion I would add is filling inside of both arrows (left and right) with some darker color to be more visible, or make them thicker.
I slightly prefer the hollow arrows, but I can definitely see the appeal of darker ones, too. You're not the first person to mention that, so the second set of arrows that I left in the initial post (◀ and ▶, U+25C0 and U+25B6) might end up being the ones that get used (it's easy for theymos to change them, and I'm sure he'll consider everyone's feedback before merging).



But I don't really see how this would be helpful, when author post history can already be accessed in chronological order.

I just realized that the topic title is a bit misleading and was probably the reason for this comment.

So, I've changed it to: Skipping to the next/previous post within a topic by the same author (SMF patch) Cheesy
copper member
Activity: 1526
Merit: 2890
Hey, everybody! Smiley
….




Wow I would love to have this feature and I’m sure all those who have been to WO they will love this the most.

Currently I’m doing this somehow manually like going to the profile of the user and finding his individual posts. But you know it can be hard when your targeted user is like LoyceV then good luck finding the next post.

Maybe it’s too much to ask but do you have any working sample or demo on the actual SMF version? Maybe it will help theymos to decide faster and give us a better opportunity to support the feature.


legendary
Activity: 952
Merit: 1386
Can't wait to have that feature implemented that way to delete all the messages from DB...
Can you please write English LOL

No worries. You need to understand only „sql injection” phrase.

Apart of obvious issue of not using parameters, isn’t there any cache on db level (I did not use php for ages), to benefit from prepared statements?
legendary
Activity: 2212
Merit: 7064
Anyway, now that I've bored you all to tears, here's what the final result looks like (buttons are next to "Report to moderator")
This sounds interesting and I would use this, not all the time but sometimes for sure, and your SMF patch would certainly be a big simplification for me.
What I am doing now is that I visit ninjastic website archive of specific post, than I click on Users tab, and select user with all his post in that topic.
I am not sure if theymos will accept this patch update quickly as he did your previous contribution, but I don't see any obstacles if there is no impact on forum security.

PS
I don't know if this is possible, but one suggestion I would add is filling inside of both arrows (left and right) with some darker color to be more visible, or make them thicker.
hero member
Activity: 510
Merit: 4005
Oh WoW! Do not tell me the rest of DB queries looks like that. Can't wait to have that feature implemented that way to delete all the messages from DB...

https://www.drupal.org/docs/7/security/writing-secure-code/database-access
https://www.php.net/manual/en/security.database.sql-injection.php
I'm pretty sure I've already taken care of that. I mean, the things in that query that are user-provided ($param_topic, $param_user and $param_message) or are derived from something user-provided ($gt_lt and $direction) have all been properly sanitized. There's even a comment at the top of the script about SQL injections. Did I miss something?

$param_topic, $param_user and $param_message are all forced to integer values, $gt_lt can only be '>' or '<', $direction can only be 'DESC' or empty. If you can see something that I can't, then please point it out, I would appreciate it!
legendary
Activity: 2464
Merit: 3878
Hire Bitcointalk Camp. Manager @ r7promotions.com
It was to have a "Top Button" on every page, so that the person who has just read a topic, can go back to the top quickly without having to use the scroll.
Don't you think it would be useful? Roll Eyes
Since PowerGlove has real interested doing this patchs, I have vote for this "Top" button thing. It's helpful when you are at "All" page of a topic, it's also useful when a topic is really long and you need to keep scrolling to go up.

It's on your keyboard: CTRL-HOME (CTRL-END works too).
Not many knows about it. Even I was not too. I just learnt it :-)
Having a floating icon / button at the bottom right corner will be nice.

Can't wait to have that feature implemented that way to delete all the messages from DB...
Can you please write English LOL
legendary
Activity: 952
Merit: 1386

Code:
    $request db_query("SELECT ID_MSG FROM {$db_prefix}messages WHERE ID_TOPIC = $param_topic AND ID_MEMBER = $param_user AND ID_MSG $gt_lt $param_message ORDER BY ID_MSG $direction LIMIT 1"__FILE____LINE__);
?>



Oh WoW! Do not tell me the rest of DB queries looks like that. Can't wait to have that feature implemented that way to delete all the messages from DB...

https://www.drupal.org/docs/7/security/writing-secure-code/database-access
https://www.php.net/manual/en/security.database.sql-injection.php
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
I was thinking of a very simple △▽, but now that I see it, it looks more like a diagonal arrow in both directions than 2 individual up and down arrows.
Okay, I see. I didn't try up/down arrows laid out horizontally, and now that I see them; I agree with you, they do look a little confusing.

Would it take more than a line break in the "report to moderator" button (so it stays at the very bottom) and one in those two buttons to make it vertical though?


works for HTML, I'm not sure if there's something for it on php or if this would be too much adapting for the stylesheet.

I'm really not sure how this can be useful in a thread. When I read a thread, I don't or barely look at the poster/username. What I only check is the content but yes, after reading the post if I found it good quality, I'm definitely looking at the author.

For some very long discussion threads on certain topics I could see it being useful to determine whether the op has changed their decision since making the thread (and not updated the op as often happens). It might also be an interesting idea for checking what users have posted before on a certain thread too (perhaps if someone makes an interesting post on the wall observer, you could jump between what their last ones were without having to search through 10 or 20 pages). This is something that can already be done with he search function (but search does weird things sometimes).
legendary
Activity: 1862
Merit: 5154
**In BTC since 2013**
It was to have a "Top Button" on every page, so that the person who has just read a topic, can go back to the top quickly without having to use the scroll.
It's on your keyboard: CTRL-HOME (CTRL-END works too).

This is true, on PC it is always at hand, or at your fingertips.  Cool

But when using a cell phone we don't have that.
But ready. Here are the tips, useful.
hero member
Activity: 510
Merit: 4005
I was thinking of a very simple △▽, but now that I see it, it looks more like a diagonal arrow in both directions than 2 individual up and down arrows.
Okay, I see. I didn't try up/down arrows laid out horizontally, and now that I see them; I agree with you, they do look a little confusing.

Quote
I trust your judgment
Bad idea, it didn't work.
I think it worked just fine. I asked you if you felt strongly about it and you double-checked your thinking before saying that you do, so good judgment fully intact, IMO. Cheesy
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
If I'm honest, horizontal arrows required less thinking, no CSS and less testing, so that's why I reached for them; not because I believe they make much more sense, or anything.
I was thinking of a very simple △▽, but now that I see it, it looks more like a diagonal arrow in both directions than 2 individual up and down arrows.

Quote
I trust your judgment
Bad idea, it didn't work.
Pages:
Jump to: