Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: gbsothere on March 01, 2009, 10:43:51 AM

Title: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 01, 2009, 10:43:51 AM
My posters like to do what they call "catch up" on long, popular threads, and post their comments, along the way.  I'm getting PMs from them asking if, after they post, they can be returned, not to the last (most recent) post on the thread, but to where they, themselves, last posted, so that they can continue "catching up" without having to figure out where they left off.   Our board is SMF 1.1.8, Default.  Is this something that can become a reality?   (I'm just a guy trying to run a message board, the only thing I know about code is how to methodically do what I'm told on installation instructions and even then, with extreme caution.)   *grin*   

Would you guys please advise?  Thanks.


Title: Re: Is what my posters are asking for even possible? (Return)
Post by: karlbenson on March 01, 2009, 10:47:03 AM
The last msg icon actually returns them where they have read upto.
(their last post if that was the last thing they read/did in that topic)
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Aleksi "Lex" Kilpinen on March 01, 2009, 10:49:43 AM
If you read one page of posts, out of say 5 new pages, and then post an answer, it would be the same as to read all 5 pages. At least that's how it works for me - so if I did that, I'd just have to guess where I was before I posted my own comment.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: tyty1234 on March 01, 2009, 01:21:48 PM
There is an option in the User's Profile in the Look and Layout Preferences that says "Return to topics after posting by default."
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 01, 2009, 02:50:01 PM
When they click on the button in the image below, it takes them to the "most recent" post (which would be the one they just posted) and the issue they're having is that they weren't done playing "catch up" yet and weren't ready to be sent there. 

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwhereikeepmystuff.com%2Fnm.jpg&hash=5abee2dc08845c2632ec5779f2568555324adf56)

Here's an excerpt from another PM I just found in my Inbox:

"Not to be demanding of your precious time Boss, but I would like to be able to play ketchup and reply as I am moved to and then be returned to the same point in the thread at which I left off rather than being sent to the end of the thread some (at the current rate of posting) 20 pages forward from where I was. I know I could make a note of the page I was on but in my eagerness to respond I will have forgotten to do so."

I hope I'm able to communicate this.  *grin*   They don't want to be sent to the post they just made.  They want to be sent back to the post they responded to, so that they can continue to catch up on what they missed and continue commenting. 

Is that possible?  Can the files be modified in any way to accomplish this?

Title: Re: Is what my posters are asking for even possible? (Return)
Post by: tyty1234 on March 01, 2009, 03:01:48 PM
I see what you mean now.
However, I'm not sure how to approach this... :(
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 01, 2009, 03:32:32 PM
Quote from: tyty1234 on March 01, 2009, 03:01:48 PM
I see what you mean now.
However, I'm not sure how to approach this... :(


I have to hand it to them, tyty, it's a pretty good idea, isn't it?   I visited a few forums a while back to see what their features were and I noticed that the American Idol forum has that feature...   Wonder if I can steal it?   *grin*


Title: Re: Is what my posters are asking for even possible? (Return)
Post by: asmith on March 01, 2009, 04:00:19 PM
I don't know where exactly is the redirect page. But since smf uses an anchor at the end of the url for the message,

at the redirect line after posting :
a query can be like this :

select ID_MSG from smf_messages where ID_TOPIC = 'that topic id' and ID_MEMBER = $context['user']['id'] order by posterTime desc limit 1,1

You got the msg id, now put #msg{messgae id here} as an anchor at the end of redirect.

I'm no expert at SMF. but I guess that should do it. Since you don't know anything about coding as you said, I hope the code above make someone to give you an standard modify code ;)
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 01, 2009, 04:36:20 PM
Quote from: asmith on March 01, 2009, 04:00:19 PM
I don't know where exactly is the redirect page. But since smf uses an anchor at the end of the url for the message,

at the redirect line after posting :
a query can be like this :

select ID_MSG from smf_messages where ID_TOPIC = 'that topic id' and ID_MEMBER = $context['user']['id'] order by posterTime desc limit 1,1

You got the msg id, now put #msg{messgae id here} as an anchor at the end of redirect.

I'm no expert at SMF. but I guess that should do it. Since you don't know anything about coding as you said, I hope the code above make someone to give you an standard modify code ;)


Seriously, when you guys type out stuff like that, I am amazed, and I mean that.  The only thing I can do with code is to follow the installation instructions on mods and copy and paste.  *grin*   Would this be the display.template.php?  (See how dumb I am?) 

This gives me hope that there's something to make it work.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: asmith on March 02, 2009, 05:30:35 AM
The reason I don't want you to use mine is, I'm sure mine is not 100% standard for SMF. That's why you have ask for a smf expert, like lovely Blue Dream ;)
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 02, 2009, 05:38:02 AM
Let me see if I understood it correctly, once the user makes a post, he wants to be redirected to the previous page he was viewing rather than to the last page(Or the board index)..am I right? If so then I don't think asmith's way would work. However what you're asking is quite easy by using SESSION data to store there last page visited.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: asmith on March 02, 2009, 06:39:02 AM
Quote from: gbsothere on March 01, 2009, 10:43:51 AM
after they post, they can be returned, not to the last (most recent) post on the thread, but to where they, themselves, last posted

I sounds a bit strange to me since I don't know what subjects he is discussing in his forum.
But to me it seems,  he wants that when a user posts, it redirect him to that user previous posts in the same thread. (don't know what if, it is his first post).such thing would work fine in big threas with tons of replies.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 08:13:47 AM
Quote from: Dragooon on March 02, 2009, 05:38:02 AM
Let me see if I understood it correctly, once the user makes a post, he wants to be redirected to the previous page he was viewing rather than to the last page(Or the board index)..am I right? If so then I don't think asmith's way would work. However what you're asking is quite easy by using SESSION data to store there last page visited.


Do you mind if I ask you to explain about using SESSION data, Dragooon?  (I can't stress enough what a rookie guy I am, just trying to run a little message board and keep a group of chatty posters happy.)   

They have threads that are dedicated to specifics that probably don't get hit as much and it shouldn't be a big ordeal for them to find where they were.  But there's this one thread in particular...   they hit it with a vengeance and discuss everything from "Desperate Housewives" to their grandbaby's first poopie to whether or not they saw their neighbor on "America's Most Wanted".  That thread moves so quickly that it feels more like a chat room than a thread.  They like to get their coffee in the morning and settle down to see what they missed and make comments along the way, but they don't want to be deterred from their important "catching up" and get sent to the end of the thread when there were still 8 more pages to go about how you can tell if yogurt has gone bad.  So they want to get taken back to the last post they replied to, rather than the end, so that they can reply to the next post in line that declares that red meat is bad for you and assert that, "no, red meat is not bad for you, but bluish-green meat probably is"....   

*grin*   See what I'm up against? 

I can't tell you how I long to to resolve this so that they can focus their efforts on complaining about something new.   *grin* 

Thank you guys for any advice to help me do this.



 
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: buspass on March 02, 2009, 11:22:25 AM
Quote from: Dragooon on March 02, 2009, 05:38:02 AM
Let me see if I understood it correctly, once the user makes a post, he wants to be redirected to the previous page he was viewing rather than to the last page(Or the board index)..am I right? If so then I don't think asmith's way would work. However what you're asking is quite easy by using SESSION data to store there last page visited.

Using SESSION to store the last page would partially work. It'd get you back to at least the right page, but if you reply to the last post on a page, you'll probably get returned to the top of that page after you post

Look at the actual links used when replying to a message.. when just hitting the REPLY button, the link it's taking you to is /index.php?action=post;topic=296378.0;num_replies=12
When you hit the Quote button(like I did to get here) the link it goes to is /index.php?action=post;quote=1957737;topic=296378.0;num_replies=12;sesc=2da5.....

1957737 is Dragoon's post in the original thread. So you would need to keep passing this value and when the user is finished posting, they should be redirected to post#1957737. The existing way probably passes the topic id(296378.0) instead, which is why after posting you're being redirected to the end of that topic(where your new reply is)
I don't know how that would be done in the SMF code- unfortuantely I haven't done much digging in the actual "forums" part of SMF code

This should work well with the QUOTE button on each post since it already has the ID of the post you're last viewing. Perhaps the REPLY button(top and bottom of each thread) could return you to the right page at least, unless you're going to add a REPLY button to each post- so each would have REPLY and QUOTE. That'd be a bit cumbersome IMO
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 02, 2009, 12:04:52 PM
buspass...you gave me a pretty nice idea of using the URL variables for redirection.
Here is something I made, untested so dunno if this works. Detecting quote would only work on normal reply and not quick reply(Unfortunately I don't know regular expression to match quotes).

Post.php
Code (Find) Select
// Return to post if the mod is on.
Code (Add before) Select

        // Custom redirection
        // WE got a quote?
        if (isset($_REQUEST['topic']) && isset($_REQUEST['quote']))
            redirectexit('topic=' . $_REQUEST['topic'] . (strpos($_REQUEST['topic'], '.') ? '#' : '.') . 'msg' . $_REQUEST['quote']);
        // No quote? :(
        elseif (isset($_REQUEST['topic']))
            redirectexit('topic=' . $_REQUEST['topic']);

Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 12:22:07 PM
Well.....    they almost always do use the quote button when they're doing their many-paged "catch up" thing.  They usually want to stop and comment on something they saw before they continue on reading the rest, so it's pretty much a sure bet that the quote button is what they will use to post with. 

Does that help at all?


*laughing at the idea of me helping anything around here*

Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 02, 2009, 12:24:36 PM
Quote from: gbsothere on March 02, 2009, 12:22:07 PM
Well.....    they almost always do use the quote button when they're doing their many-paged "catch up" thing.  They usually want to stop and comment on something they saw before they continue on reading the rest, so it's pretty much a sure bet that the quote button is what they will use to post with. 

Does that help at all?


*laughing at the idea of me helping anything around here*


Yea then my code *should* work perfectly...give it a shot.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 12:35:43 PM
Quote from: Dragooon on March 02, 2009, 12:24:36 PM
Yea then my code *should* work perfectly...give it a shot.



I'm going to stop breathing for a moment and try it.  *grin*

Now....     /Sources/Post.php   and that's the only file; this has nothing at all to do with /Themes/Default/Post.template.php, right?  (I have to ask proactively, to try to circumvent random stupidity on my part).  *grin*

*standing on "G", waiting on "o"*   




Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 12:43:34 PM



Dragooon, I picked page one of a 9 page thread and quoted a random post there.  It did return me to page one, but it also made my post the first post on the thread, ahead of the threadstarter's post.


Did I break it?   
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 12:45:29 PM
Quote from: gbsothere on March 02, 2009, 12:43:34 PM



Dragooon, I picked page one of a 9 page thread and quoted a random post there.  It did return me to page one, but it also made my post the first post on the thread, ahead of the threadstarter's post.


Did I break it?   




Wait.....  scratch that.... I have my settings to show the most recent posts first, so let me try that again on another thread....   brb...





Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 12:55:17 PM
Well, no...

I logged in as a new user who's never read any of the posts and picked the very first page of a long thread to quote and reply to, but landed at the very last page of the thread, last post.   (I expected my post to land there, I don't mean that.)  I mean, me, myself... the page never defaulted back to where I was when I posted.

I'm pretty sure I copied and pasted correctly, placing the code before the searched for string, but let me try again...


Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 01:02:04 PM
*sigh*


It be hatin' on me.     No dice.


Thanks, guys for trying to help and I'll keep peeking back in for any new suggestions (that aren't for me to do things that are, for the most part, physically impossible and hurt).

*grin*



Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 02, 2009, 01:51:55 PM
When you post as the user...on the posting page what is the URL?
And can you attach your Post.php?
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 02:00:48 PM
Quote from: Dragooon on March 02, 2009, 01:51:55 PM
When you post as the user...on the posting page what is the URL?
And can you attach your Post.php?



Hi, Dragooon.

The URL for the posting page is http://mywebsite.com/smf/index.php?topic=51.msg0#new

(Or do you need my actual domain?)  That's just a random unread thread I picked, without having selected a post to reply to.

I've attached the Post.php, hopefully. 


Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 02, 2009, 02:10:11 PM
Actually I just realised something....do this.
Move that block of code before
// Returning to the topic?
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 02:24:05 PM
*grin* 

I think that's it!

I mean, they can't inspect their own reply, without going to the last page, so they'd better learn to use the preview function, but they can't have everything.   

I think you've pulled a rabbit out of a hat, Dragooon!


I'm way impressed! 


Thanks so much!
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 03:03:43 PM
Well.......

I know you guys are getting ready to string me up...   


They're telling me that they are getting sent all the way back to page one of the thread, instead of to the post they quoted.  Apparently, I was on a thread that only had a couple of pages. 


Is there an adjustment for that?





Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 02, 2009, 10:20:24 PM
Well ask them the URL of the replying page(the one where you fill your reply) And also attach your latest Post.php.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 10:34:16 PM
Quote from: Dragooon on March 02, 2009, 10:20:24 PM
Well ask them the URL of the replying page(the one where you fill your reply) And also attach your latest Post.php.



Thank you, Dragooon.

The link she was on to quote and post was:

http://mywebsite.com/smf/index.php?action=post;quote=6105;topic=3.150;num_replies=3617;sesc=06f2c17a1f84259c1d5eaaed230a6c40

She ended up at post 1.

Thanks for taking a look at this. 


Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 02, 2009, 10:59:12 PM
Hm I can't view that file from my iPod. Can you post your Post2 function?
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 11:03:24 PM
Quote from: Dragooon on March 02, 2009, 10:59:12 PM
Hm I can't view that file from my iPod. Can you post your Post2 function?


I could try to bluff and pretend that I know what that is...
or I could just suck it up and admit that I don't.

Let's go with that.  *grin*

I'm sorry, I don't understand what Post2 function is.

Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 02, 2009, 11:08:49 PM
Ok do this, post the lines around the block of code you added.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 02, 2009, 11:13:59 PM
Quote from: Dragooon on March 02, 2009, 11:08:49 PM
Ok do this, post the lines around the block of code you added.



Before:

// Notify any members who have notification turned on for this topic.
   if ($newTopic)
      notifyMembersBoard();
   elseif (empty($_REQUEST['msg']))
      sendNotifications($topic, 'reply');




the added code:


// Custom redirection
        // WE got a quote?
        if (isset($_REQUEST['topic']) && isset($_REQUEST['quote']))
            redirectexit('topic=' . $_REQUEST['topic'] . (strpos($_REQUEST['topic'], '.') ? '#' : '.') . 'msg' . $_REQUEST['quote']);
        // No quote? : (
        elseif (isset($_REQUEST['topic']))
            redirectexit('topic=' . $_REQUEST['topic']);


(I added the space between : and ( following //no quote? because it was making a frown smiley when I posted it here).



and after:


// Returning to the topic?
   if (!empty($_REQUEST['goback']))
   {
      // Mark the board as read.... because it might get confusing otherwise.
      db_query("
         UPDATE {$db_prefix}log_boards
         SET ID_MSG = $modSettings[maxMsgID]
         WHERE ID_MEMBER = $ID_MEMBER
            AND ID_BOARD = $board", __FILE__, __LINE__);
   }
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 03, 2009, 02:13:31 AM
Lets see if this works
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 03, 2009, 08:29:22 AM
I'm sorry, Dragooon, but, if I pick page 7 out of 14 of a thread I've never been on and quote someone, my post does arrive on page 7, as it should but I land back on page 1.

And, the bad thing is that I can't shake my head slowly and say, "Well....  I'm stumped!"  because I was stumped when I got here.   *grin* 


I appreciate your efforts with this, thanks so much.

Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 03, 2009, 10:19:42 AM
Here try this....I realised a few things.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 03, 2009, 10:42:30 AM
Quote from: Dragooon on March 03, 2009, 10:19:42 AM
Here try this....I realised a few things.



Dragooon, it's taking me back to the page where the post is that I quoted, and that's good enough!  If they're too lazy to scroll a bit when they're returned to where they were reading to continue catching up, then they're on their own!  *grin*


I can't thank you enough.  You're a lifesaver!


Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 03, 2009, 11:00:18 AM
It should take back to there last post if they use quote along with full reply(And not quick reply)...but thanks :).
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on March 03, 2009, 11:26:34 AM
Quote from: Dragooon on March 03, 2009, 11:00:18 AM
It should take back to there last post if they use quote along with full reply(And not quick reply)...but thanks :).




They're over there chattering now like a tree full of starlings, Dragooon.  *grin*   You'd think they struck oil. 


I can't thank you enough!   I'll mark this "Solved" and you rock, seriously!



EDIT:   Well...   *looking around* ...  I don't see a "Solved" link...

but I'm calling it "Solved".  *grin*


Thanks, again!


Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Dragooon on March 03, 2009, 12:52:12 PM
You can change the topic's icon to tick to mark it as solved.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Xavi-Nena on April 21, 2009, 01:49:28 AM
ok wait a min so what is the exact code to get this working? Sorry I know you attached the post template but i have modifications on mine and dont want to lose those by replacing it with this? thanks in advance.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on July 31, 2009, 09:10:22 AM
Forgive me for bumping my old thread, but I keep trying to remember to ask this and then get side-tracked.

(And NenaGb, I didn't realize you had asked about the code.  I'm attaching it here, before I proceed with my question.)

Sources/Post.php

Find:
// Notify any members who have notification turned on for this topic.
if ($newTopic)
notifyMembersBoard();
elseif (empty($_REQUEST['msg']))
sendNotifications($topic, 'reply');


Add after:

        // Custom redirection
        // WE got a quote?
        if (isset($_REQUEST['topic']) && isset($_REQUEST['quote']))
            redirectexit('topic=' . $_REQUEST['topic'] . '.msg' . $_REQUEST['quote'] . '#msg' . $_REQUEST['quote']);
        // No quote? :(
        elseif (isset($_REQUEST['topic']))
            redirectexit('topic=' . $_REQUEST['topic'] . '.' . $_REQUEST['start']);






This code was provided by Dragooon and I can't thank him enough, my posters love it  This is what it does:

If a poster is reading a very long thread, with pages of "catch up" to go and wants to make a reply here and there but continue to read on, then, rather than be sent to the end of the thread along with his reply, the reply goes there (of course) but the poster is redirected back to the page he was reading when he made the reply so that he can continue to catch up.  We love this on my forum! 

Now....   I just have a request to tweak it a bit.  We do get sent back to the actual page we were on when we posted and, if that's as close as we can cut it, then no complaints; we're quite happy with that.  But I was wondering if there is a way to be returned to the actual post where "reply" or "quote" was clicked?  In other words, be sent back to where you stopped to reply, so that you can continue on, rather than having to scroll that page trying to find your place?

This does remind me; we do have the "Reply Button In Every Post" mod installed, although I can't remember if we did when Dragooon helped me with this.  The link for that mod is HERE (http://custom.simplemachines.org/mods/index.php?mod=1755).  All it does is add these two codes to Display.template.php:

Find:

// Can they reply? Have they turned on quick reply?

Add before:

      // Simple Reply Button
      if ($context['can_reply'] && !empty($options['display_quick_reply']))
      echo '<a href="#quickreply">', $respond_button, '</a>';
      else
      echo '<a href="', $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'], '">', $respond_button, '</a>';
               
               


Find:

$reply_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');

Add before:

   $respond_button = create_button('reply.gif', 146, 146, 'align="middle"');




I only mention this because I wonder if it would have to be incorporated, somehow, in the ability to be returned to a specific post, or if it really has nothing to do with it and only the Post.php is in play, here.



All that to ask this:

Could someone weigh in on whether or not the code Dragooon provided can be tweaked to allow one to be returned to the actual post he replied to, rather than just the general page?



Again, Dragooon, thank you for this.  We absolutely love it.   :)



ETA:  *removing "solved" check just long enough to determine the answer*
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 01, 2009, 04:09:52 PM
*hopeful weekend bump in case any coders are out there*
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 03:47:30 PM
One more bump, not quite as hopeful, and then I'll let it go.   :)
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 07:12:12 PM
The only way I can get it to work is not to use quick reply when the reply button is clicked.

In Display.template.php change the reply button to this:


      // Simple Reply Button
      if ($context['can_reply'])
     echo '<a href="', $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'], ';m=', $message['id'], '">', $respond_button, '</a>';


In Post.php change the Custom reirection code to this:


       // Custom redirection
        // WE got a quote?
        if (isset($_REQUEST['topic']) && isset($_REQUEST['quote']))
            redirectexit('topic=' . $_REQUEST['topic'] . '.msg' . $_REQUEST['quote'] . '#msg' . $_REQUEST['quote']);
        // Just replying
        elseif (isset($_REQUEST['m']))
          redirectexit('topic=' . $_REQUEST['topic'] . '.msg' . $_REQUEST['m'] . '#msg' . $_REQUEST['m']);
        // No quote? :(
        elseif (isset($_REQUEST['topic']))
          redirectexit('topic=' . $_REQUEST['topic'] . '.' . $_REQUEST['start']);


Now in Post.template.php. Default theme unless there's one in the theme you are using.

Find:

// Assuming this isn't a new topic pass across the number of replies when the topic was created.


and above it add:

if (isset($_REQUEST['m']))
echo '
<input type="hidden" name="m" value="', $_REQUEST['m'], '" />';
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 07:33:06 PM
Hi, Kays, and thanks! 

I'm going to go try this on my test site, but I wanted to ask, first:

Does this coding either take into account or work around the Reply Button In Every Post mod that we have installed?   (LINK TO MOD) (http://custom.simplemachines.org/mods/index.php?mod=1755)

The forum is SMF 1.1.10/Default. 




EDIT:   Sorry, I should have studied your code a little closer; of course it does.    :)  I was distracted by a PM from a poster with a whole new set of problems and missed that the mod is accommodated. 

Trying it now on my test site. 
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 07:51:37 PM
The reply button remains, it just doesn't take the user to quick reply. I couldn't see a way to carry the message id into quick reply.

A little bonus, this will add a link to the topic being replied to. It's not language freindly so translare it if you need to.

In Post.templte.php look for:


// Finally the most important bit - the actual text box to write in!


And above it add:


if(isset($_REQUEST['m']))
$message = 'Reply to message # [url=?topic=' . $_REQUEST['topic'] . '.msg' . $_REQUEST['m'] . '#msg' . $_REQUEST['m'] . ']' . $_REQUEST['m'] . '[/url][hr]' . "\n";
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 07:52:39 PM
Kays, beautiful!   It does exactly what I want it to.   

Much thanks to Dragooon for getting me to the right page and to you for getting me precisely where I need to land on it.   :)

Brilliant, and I'm, once again, marking this topic solved.   (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwhereitestmystuff.com%2Fimages%2Fthumb.gif&hash=fbe057efff6d88bc8293617d752cf12a98abaa09)





EDIT:   The added link is very nice.  Amazing work, thanks again, so much.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 08:10:50 PM
I'm glad it works the way you want it to.

QuoteThe added link is very nice.  Amazing work, thanks again, so much.

I thought that it was a bit silly replying without a quote since there is no referance to what the user is posting about or replying to
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 08:18:35 PM
Especially on a very large thread, that just makes perfect sense.   :)

My posters are loving you right now.  *grin*


Thanks, again!
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 08:30:30 PM
Kays, if you don't mind my asking....

is this only meant to work with a simple reply but not when quoting? 


I'm not being returned to my place on the thread when quoting, only when replying, so I thought I'd ask?  (I'm sorry for waiting until now to ask, but I hadn't thought to try quoting until now.)




EDIT:  It all comes back to my posters' desire to keep reading the long thread and, if they quote, it appears that they may end up at the end of the thread, instead of where they were.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 08:49:36 PM
I don't know what happened there since I didn't touch that. But I agree, it's not working now and it used to.

I'll look into it.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 08:51:49 PM
Quote from: Kays on August 02, 2009, 08:49:36 PM
I don't know what happened there since I didn't touch that. But I agree, it's not working now and it used to.

I'll look into it.



Thank you for checking into it and I really do appreciate your help.   :)
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 10:12:41 PM
I can't even get it to work if I reverted back to what you first posted. Plus the thing is, I can't see why it worked place. Unless Dragoon made some changes elsewhere.

Can you attach your Display.template.php and Post.php to a post so I can have a look at them.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 10:15:57 PM
Yes, Kays; would you like the files as they were before we made the edits this evening?
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 10:20:46 PM
Actually from before might be best.

Thanks.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 10:24:48 PM
Here they are, Kays and, also, I was just scrolling back over this thread from the beginning and, unless I'm reading this wrong, I may have found an extra bit of code on this link.  (It's been a long time since we first did this, but glancing at this post suggests that there were two edits on Post.php, not just the one)  Reply #33:

http://www.simplemachines.org/community/index.php?topic=296378.20 (http://www.simplemachines.org/community/index.php?topic=296378.20)





EDIT:  (I'm always editing.)   *grin*    No, I read that wrong.   I thought it was something but it was nothing. 
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 10:35:14 PM
One thought though in looking at it. If you're not hungup on using the quick reply for quotes.

If the quotes also used the regular post screen like for replies then it should be possible to redirect the poster back to the post he was quoting. Since the post id is available there.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 10:38:14 PM
Honestly, Kays, I don't think any of my posters have ever used the quick reply.  I think the default on the forum is to not show it.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 10:51:35 PM
Well if that's the case, we should be able to redirect your users back to the post they were quoting also. :D
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 10:55:09 PM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwhereikeepmystuff.com%2Fsmf%2FSmileys%2Fclassic%2Fditzy.gif&hash=4ce42def050fffa2e0837dc9f080482e426e16b6)
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: tyty1234 on August 02, 2009, 11:35:53 PM
So is this issue resolved now?
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 02, 2009, 11:38:06 PM
No, not yet.  Kays is having a look at how to get the quote to behave as the reply does.

:)
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 02, 2009, 11:58:30 PM
I think so now.  8)

Here's the changes to be made.

In Display.template.php replace from the start of the reply button down to:


// Can the user modify the contents of this post?


With

  // Simple Reply Button
  if ($context['can_reply'])
echo '<a href="', $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'], ';m=', $message['id'], ';poster=', $message['member']['name'], '">', $respond_button, '</a>';
               
// So... quick reply is off, but they *can* reply?
if ($context['can_reply'])
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '">', $reply_button, '</a>';



In Post.php above:



// Returning to the topic?


Add:

// Custom redirection
if (isset($_REQUEST['m']))
redirectexit('topic=' . $_REQUEST['topic'] . '.msg' . $_REQUEST['m'] . '#msg' . $_REQUEST['m']);


In Post.template.php above ;


// Assuming this isn't a new topic pass across the number of replies when the topic was created.


Add this:


if (isset($_REQUEST['m']))
echo '
<input type="hidden" name="m" value="', $_REQUEST['m'], '" />';

if (isset($_REQUEST['quote']))
echo '
<input type="hidden" name="m" value="', $_REQUEST['quote'], '" />';




Also find


// Finally the most important bit - the actual text box to write in!


And above it add:


if(isset($_REQUEST['m']))
$message = 'Reply to message # [url=?topic=' . $_REQUEST['topic'] . '.msg' . $_REQUEST['m'] . '#msg' . $_REQUEST['m'] . ']' . $_REQUEST['m'] . '[/url] by ' . stripslashes($_REQUEST['poster']) . '[hr]' . "\n";


Edited to add all corrections so that it's a bit more comprehensible.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 03, 2009, 12:06:10 AM
I'm looking for a hole to crawl in before I tell you that it's now working beautifully for quoting but that straight replies aren't returning me, now.   :D
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 03, 2009, 12:13:20 AM
Strange, it's working for me.

In Post.template, do you have


if (isset($_REQUEST['m']))
echo '
<input type="hidden" name="m" value="', $_REQUEST['m'], '" />';

if (isset($_REQUEST['quote']))
echo '
<input type="hidden" name="m" value="', $_REQUEST['quote'], '" />';



Above:


// Assuming this isn't a new topic pass across the number of replies when the topic was created.


Both statements need to be there.
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 03, 2009, 12:19:55 AM
Ah!   I replaced, rather than added this code:

   if (isset($_REQUEST['quote']))
      echo '
         <input type="hidden" name="m" value="', $_REQUEST['quote'], '" />';



Yes, it's working great, now!    :D


There was some weird sequential thing happening in the URLs.  For instance, on my test site, there are only 29 posts in the entire thread I'm using to test this but it had me replying to "post 61", etc.  The last 2 haven't done that, however, so this may have fixed that as well! 


Thank you so much for your extreme patience!  This should actually be a mod, because many forums have that one "home base" thread where everyone "meets and greets" and gets caught up:  a thread about "nothing".  And being able to catch up, comment along the way and continue to read is important to many. 

Thank you again!  I can put the "Solved" check back.   :)





EDIT:  It didn't fix the "over-numbering" of the posts, but seriously, I'm so happy with this, I don't even care.  It's great!
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 03, 2009, 12:34:51 AM
I'm glad it's finally working now.

I agree that maybe it should be a mod because it's sometimes nice to return to the post you are replying to even if it's on the same page. However it should be done by using quick reply which is a quicker than loading the post page. But it's beyond me how that worls.

One thing I forgot, to show the name of the poster in a reply

In Post.template above


// Finally the most important bit - the actual text box to write in!


Replace what you have added with:


if(isset($_REQUEST['m']))
$message = 'Reply to message # [url=?topic=' . $_REQUEST['topic'] . '.msg' . $_REQUEST['m'] . '#msg' . $_REQUEST['m'] . ']' . $_REQUEST['m'] . '[/url] by ' . stripslashes($_REQUEST['poster']) . '[hr]' . "\n";
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 03, 2009, 12:44:49 AM
Adding the names is even nicer!  It did just call post #5 "post $46" in the URL but, as I said, I'm so happy with the way it functions, that I can even remove this portion, rather than have you keep chipping away at it. 

You've been more than patient!   :)
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 03, 2009, 01:01:53 AM
It was intersting and I'm thinking of maybe ading it to my boards.

That message you can configure it as you want. maybe something like "In reply to  this post (http://home) by PosterName"


$message = 'In reply to [url=?topic=' . $_REQUEST['topic'] . '.msg' . $_REQUEST['m'] . '#msg' . $_REQUEST['m'] . ']this post[/url] by ' . stripslashes($_REQUEST['poster']) . '[hr]' . "\n";

Title: Re: Is what my posters are asking for even possible? (Return)
Post by: gbsothere on August 03, 2009, 01:06:54 AM
I'm going to try doing that in the morning but if you hear a loud noise and smell smoke, please come running.   :D 

Right now, I'm staring at it and thinking that I wouldn't even know how to begin configuring it but I'm willing to try. 

Kays, you've been outstanding!  Seriously.  I can't thank you enough. 

I don't know what part of the world you're in but it's after midnight in Tennessee so I'm going to "go horizontal" for a while, but again....   you've just been so helpful.  I really appreciate it. 

I'll try my hand at configuring that portion of code in the morning... after much coffee. 
Title: Re: Is what my posters are asking for even possible? (Return)
Post by: Kays on August 03, 2009, 01:16:04 AM
I'm up north from you some what so it's late here also.

The code in my previous post does have the alterations, so give that a try.

Good night. :)