News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Up and Down Post by Post

Started by revwill, December 21, 2012, 06:25:32 PM

Previous topic - Next topic

revwill

Greetings all,

We have the move down, move up in SMF and after reviewing several of our topics online, many of the topics and replys could be very long and complete.  It would be nice to have, if admin likes, to have in addition a scroller to move from post to post, up and down.

I have yet to see a mod that can do this and kept up to date with SMF revisions.

Thank you so much for taking the time in reading, even more for your consideration and a Super Thank you if you could implement it.

Thanks all

William

Kindred

In general,  think this should stay as a mod..

Remember, mods for 1.1.x will generally work on all 1.1.x versions and mods for 2.0.x should generally work on any 2.0.x version.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

revwill

Quote from: Kindred on December 21, 2012, 07:52:39 PM
In general,  think this should stay as a mod..

Remember, mods for 1.1.x will generally work on all 1.1.x versions and mods for 2.0.x should generally work on any 2.0.x version.

Thank you Kindred,

Can you steer me in the right direction to a working Mod?  I know of 2 of them and neither work.  When I inquired for support from the one MOD they stated they are no longer keeping up with their mods and they would be glad to help me get it working if I would hire them.  Of course, the site is all free and no income of any kind is being derived from it this no cash for me to even offer.  The other one did not work either but the author left a way to contact him for help that he would be glad to help but seen that we were a christian site and mailed me back saying his religion would not allow him to help us get his mod working on our site.  Its an awesome idea but I guess I dont know which way to turn but to see if it could be added along with the up and down which is already built in.

Thanks for helping and any suggestion would be awesome.

William

Antechinus

#3
Quote from: revwill on December 22, 2012, 12:22:31 AMThank you Kindred,

Can you steer me in the right direction to a working Mod?  I know of 2 of them and neither work.  When I inquired for support from the one MOD they stated they are no longer keeping up with their mods and they would be glad to help me get it working if I would hire them.  Of course, the site is all free and no income of any kind is being derived from it this no cash for me to even offer.  The other one did not work either but the author left a way to contact him for help that he would be glad to help but seen that we were a christian site and mailed me back saying his religion would not allow him to help us get his mod working on our site.

I'm an atheist* and I think that's pretty pathetic. I also help admin a forum for ex-Muslims, and I don't refuse to help Muslims with coding problems. Which mod was it?

*Well ok, technically agnostic if anyone wants to be picky, but for all practical purposes it's the same thing.

revwill

It was the mod called: Add Posts Navigation.  Its alright, not wanting to start anything though it could have hurt my feelings.  We also have a site for my Son and we have many followers of all faiths and answer their personal questions about CHD.  I would not could I ever wish to turn someone away because of their faith or non faith.  Our desire is to save all childrens lives because we find them important and to support the parents going through such.

But, would love to have it for our prayer group.  Some of the replies and topics can be long in nature and to scroll from post to post would be such an awesome addition.

Never the Less...  Happy and safe Holidays all.  In Fact Thanks to all that help as like it is said here in theis following Post: Thanks to those That Help Post

William

Antechinus

Easy. You want it for 2.0.x or 1.1.x? Can change the presentation easily too if you like. Might be better with two bigger arrows side by side, as long as you have the screen width for it.
It's a piece of cake anyway.

revwill

#6
its for 2.0.3 Wow, awesome Yes sir.  our site is: divinemercystpauls.com umm let me get you to one of our topics thats great for all, Reading 101 its a simple reading course to speed up your reading.  To see an example of long replies ect if you dont ming the subject you can visit our beloved saints and select a good one would be saint padre pio.  You will see some very lengthy replies and topic....

Wow, that is so awesome of you--Thank you very Much!  I gave you a link because I trust your thoughts on if there is enough room or not. 

Thank you again!  Today we learned our Son can finally get in for another heart surgery come January 8th, which is great--Its been truly a marvelous day and thanks for being part of it!

William

FrizzleFried

Damn... that is pretty crappy that he actually said that... I mean sheesh,  if you really "feel" that way,  just don't reply... and I'm wondering where in his religious writings it says "Thou must not code for Christians"...


Antechinus

Quote from: revwill on December 22, 2012, 01:05:28 AMWow, that is so awesome of you--Thank you very Much!  I gave you a link because I trust your thoughts on if there is enough room or not. 

Thank you again!  Today we learned our Son can finally get in for another heart surgery come January 8th, which is great--Its been truly a marvelous day and thanks for being part of it!

William
It's fine. I rip templates apart for fun. Wrote a lot of the 2.0.x stuff anyway.

The width thing depends on how wide your members' screens are, and what permissions they have (the latter affects how many buttons are displayed). It can get a bit crowded up top with all the buttons, etc.

I usually prefer to put the buttons after the post content (seems to me I want to read it before deciding whether to quote it or whatever) but if your lot are used to the default that may confuse them. I'll just add the arrows up top and you can see how it is.

If you want the files edited for you just attach them here, but the basic edits aren't difficult if you want to try doing it yourself.

Display.template.php (starting on Line 230 of an unaltered file)

Find: // Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';


Replace: // Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a id="msg', $message['id'], '"></a>', $message['first_new'] ? '<a id="new"></a>' : '';

/* Add Posts Navigation code starts here */
echo '<a name="', $message['counter'], '"></a>';
/* Add Posts Navigation code ends here */


Find (on Line 419 of an unaltered file): // If this is the first post, (#0) just say when it was posted - otherwise give the reply #.

Replace: /* Add Posts Navigation code starts here */

// Base url for posts
if(empty($postsnavbase))
$postsnavbase = implode('.', explode('.', $message['href'], -1)).'.';
$pageprev = $postsnavbase.($context['page_info']['current_page']-2)*$context['messages_per_page'];
$pagenext = $postsnavbase.($context['page_info']['current_page']-0)*$context['messages_per_page'];

// Previous post link calculations
{
if($message['counter'] === 0)
$postsnavprev = FALSE;
else if($message['counter'] % $context['messages_per_page'] === 0)
$postsnavprev = $pageprev.'#'.($message['counter']-1);
else
$postsnavprev = '#'.($message['counter']-1);

// Next post link calculations
if($message['counter']+1 === $context['total_visible_posts'])
$postsnavnext = FALSE;
else if($message['counter'] % $context['messages_per_page'] === $context['messages_per_page'] -1)
$postsnavnext = $pagenext.'#'.($message['counter']+1);
else
$postsnavnext = '#'.($message['counter']+1);

// Display
echo '<div class="postsnav">';
if($postsnavprev)
echo '<a class="postsnavprev" href="'.$postsnavprev.'"></a> ';
if($postsnavnext)
echo '<a class="postsnavnext'.($message['counter']?'':' postsnavnext2').'" href="'.$postsnavnext.'"></a> ';
echo '</div>';

}
/* Add Posts Navigation code ends here */


// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.



index.css - Just add this to the end of the file:/* Add Posts Navigation styles start here */
.postsnav{
float: right;
margin-top: 2px;
}

.postsnavprev, .postsnavnext{
display: block;
height: 7px;
width: 12px;
padding:1px 0px;
}

.postsnavprev{
background-image: url(../images/sort_up.gif);
background-position: 0 -2px;
}
.postsnavnext{
background-image: url(../images/sort_down.gif);
background-position: 0 -3px;
}

.postsnavnext2{
margin-top: 7px;
}

/* Add Posts navigation styles end here */
/* CATHOLICS FTW! NYA NYA NYA! */

FrizzleFried

Before I go using that code... I assume it should work with stock Curve (his site appeared to curve)... right?

Thanks!

Antechinus

Yes I tested it on a standard Curve. Should be fine. I quite like the functionality. Might tart it up a bit and use it myself.

revwill

Thank you So Much Will try it now to add it.  Thank you again!

Wow, you are quick!

William

revwill

It works Fantatsically!  Thank you Sir!  Awesome....  Hehe Now wait when I hit prayer group and I tell them no more forever scrolling Thank you So!

William!


FrizzleFried

Tiny problem...

See how the arrows move my icons down?  Any way to put the arrows in the purple space in the image below (i moved the icons over to make room in the image)?  I think that may solve the issue with spacing...

EDIT: OOps... I sent the wrong image... no biggie... I'm looking to move the arrows next to SPLIT TOPIC on the far right...

Antechinus

Ok, played around with it a bit. This puts the indicators at the end of the quickbuttons row, and gives the indicators a bit of padding for a larger target area.

Up here: /* Add Posts Navigation code starts here */

// Base url for posts
if(empty($postsnavbase))
$postsnavbase = implode('.', explode('.', $message['href'], -1)).'.';
$pageprev = $postsnavbase.($context['page_info']['current_page']-2)*$context['messages_per_page'];
$pagenext = $postsnavbase.($context['page_info']['current_page']-0)*$context['messages_per_page'];

// Previous post link calculations
{
if($message['counter'] === 0)
$postsnavprev = FALSE;
else if($message['counter'] % $context['messages_per_page'] === 0)
$postsnavprev = $pageprev.'#'.($message['counter']-1);
else
$postsnavprev = '#'.($message['counter']-1);

// Next post link calculations
if($message['counter']+1 === $context['total_visible_posts'])
$postsnavnext = FALSE;
else if($message['counter'] % $context['messages_per_page'] === $context['messages_per_page'] -1)
$postsnavnext = $pagenext.'#'.($message['counter']+1);
else
$postsnavnext = '#'.($message['counter']+1);

// Display
echo '<div class="postsnav">';
if($postsnavprev)
echo '<a class="postsnavprev" href="'.$postsnavprev.'"></a> ';
if($postsnavnext)
echo '<a class="postsnavnext'.($message['counter']?'':' postsnavnext2').'" href="'.$postsnavnext.'"></a> ';
echo '</div>';

}
/* Add Posts Navigation code ends here */


// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.


Delete exactly this bit:

// Display
echo '<div class="postsnav">';
if($postsnavprev)
echo '<a class="postsnavprev" href="'.$postsnavprev.'"></a> ';
if($postsnavnext)
echo '<a class="postsnavnext'.($message['counter']?'':' postsnavnext2').'" href="'.$postsnavnext.'"></a> ';
echo '</div>';



Then comment out this line: if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])


by putting a double forward slash in front of it: //if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])


Now find this: if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
</ul>';


Change to this: //if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
<li class="postsnav">';
if($postsnavprev)
echo '
<a class="postsnavprev" href="'.$postsnavprev.'">&nbsp;</a> ';
if($postsnavnext)
echo '
<a class="postsnavnext'.($message['counter']?'':' postsnavnext2').'" href="'.$postsnavnext.'">&nbsp;</a> ';
echo '
</li>
</ul>';


Now for the css. Get rid of the other css and replace it with this:/* Add Posts Navigation styles start here */
.quickbuttons li.postsnav {
margin-top: -8px;
padding: 0;
}
.quickbuttons  li.postsnav a.postsnavprev, .quickbuttons  li.postsnav a.postsnavnext {
display: block;
float: none;
height: 7px;
width: 12px;
padding: 4px;
}
.quickbuttons  li.postsnav a.postsnavprev {
background: url(../images/sort_up.gif) center center no-repeat;
}
.quickbuttons  li.postsnav a.postsnavnext {
background: url(../images/sort_down.gif) center center no-repeat;
}
.quickbuttons  li.postsnav .postsnavnext2 {
margin-top: 10px;
}
/* Add Posts navigation styles end here */



FrizzleFried

Thank you for the very explicit instructions.  It's much appreciated.

EDIT: Works great... I'd forgotten to CTRL-F5 the page....

THANK YOU AGAIN!

Merry Christmas!

revwill

Good Morning, Antechinus

Works flawlessly!  Thank you so much.  Gives a reason for people to become members   O:)

I really do appreciate this and I hope you and your family have a safe but happy Holiday Season...

William

FrizzleFried

Thank you Revwill for bringing up this nifty little mod.  I've actually attempted to install it a number of months ago but just gave up.

revwill

Good morning Frizzle,

I am just amazed how quickly Antechinus got this thing up and running.  It is an awesome little mod that truly is useful and I hope he will package it and I will be one of the first to say -- This one works.  Maybe the SMF team will just give him credit and adopt it into the next version of SMF.

Once again, Hat's off to Antechinus for freely helping -- Thank you...

You have a big day planned for Christmas?  As for us, not much--I hope to scrape enough to buy a slice or two of Ham and we will simply enjoy each other this year.  I can't wait until next year where hope brings a better year.

Merry Christmas to Both of you!

William

Antechinus

There are umpteen people here who could have done it just as quickly. Once you can recognise what the different code blocks are for, shunting them around a bit isn't hard. It all worked. The only problem was the inserts for the mod package were looking for clues that hadn't existed since RC1. I basically just added them in the corresponding places for 2.0.x.

I probably wont package it because that would involve nicking someone else's work. I'll just link the posts with the edits to the support thread for the mod. That way if anyone else wants to use it they can.

Enjoy your Christmas, and best of luck for your son. :).

revwill

Quote from: Antechinus on December 22, 2012, 01:58:15 PM
There are umpteen people here who could have done it just as quickly. Once you can recognise what the different code blocks are for, shunting them around a bit isn't hard. It all worked. The only problem was the inserts for the mod package were looking for clues that hadn't existed since RC1. I basically just added them in the corresponding places for 2.0.x.

I probably wont package it because that would involve nicking someone else's work. I'll just link the posts with the edits to the support thread for the mod. That way if anyone else wants to use it they can.

Enjoy your Christmas, and best of luck for your son. :).

As well as you and your family have a great Christmas and Thank you.  We will be bringing him in the 8th of January for an emergency Heart Stint so it will buy us a short amount of time for his next surgery and get it scheduled.

William...

Advertisement: