Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Nathaniel on August 09, 2008, 06:39:32 AM

Title: Order Stickied Topics
Post by: Nathaniel on August 09, 2008, 06:39:32 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1321)
Order Stickied Topics version 1.01 by LHVWB (http://custom.simplemachines.org/mods/index.php?mod=1321)
Overview:

This mod allows you to order your stickied topics the way that you want them to be. It allows anyone with permissions to create a sticky in a particular board, to order those stickied topics by clicking on the "Order Stickied Topics" link, on the topic list page for any particular board.

Version Changes:

v1.01
Fixed a spelling mistake, for the title ('Sticked ' => 'Stickied ').

v1.0
Original Mod release.
Title: Re: Order Stickied Topics
Post by: jossanaijr on August 09, 2008, 08:41:56 PM
Great.  Thanks.
Title: Re: Order Stickied Topics
Post by: Simplemachines Cowboy on August 09, 2008, 11:10:14 PM
Excellent.
Been wanting this for quite some time.

Spelling error, tho:
In Modifications.english.php & utf8:

// Text for the Order Stickied Topics Mod.
$txt['OrderStickiedTopics_title'] = 'Order Sticked Topics';


Should be 'Order Stickied Topics'
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 09, 2008, 11:15:56 PM
@Simplemachines Cowboy,
Argggggggg, ;) You don't know how happy and annoyed I am, all at the same time. A very big thank you for finding this annoying little error. :D

* Bug fixed. Mod is now at version 1.01.

Thank you,
LHVWB
Title: Re: Order Stickied Topics
Post by: Simplemachines Cowboy on August 09, 2008, 11:18:38 PM
No problem.
I only noticed it 'cause I changed all the values to say "pinned" instead of "stickied"
Title: Re: Order Stickied Topics
Post by: ccbtimewiz on August 10, 2008, 12:13:24 AM
Nice modification, LHVWB.
Title: Re: Order Stickied Topics
Post by: AlkaSeltxer on August 10, 2008, 01:27:34 AM
Thanks for the mod man.  :D
Title: Re: Order Stickied Topics
Post by: Apllicmz on August 10, 2008, 02:58:42 AM
good work
nice mod
Title: Re: Order Stickied Topics
Post by: evil-angelist on August 10, 2008, 03:56:24 AM
Thanks worked great and went in easy. ;) ;)
Title: Re: Order Stickied Topics
Post by: m1ss1nnocent on August 10, 2008, 10:57:03 AM
fantastic!!! works a treat!!
Title: Re: Order Stickied Topics
Post by: tk2012 on August 11, 2008, 03:13:04 AM
 :D  easy as 1, 2, 3!
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 11, 2008, 03:14:52 AM
Quote from: tk2012 on August 11, 2008, 03:13:04 AM
:D  easy as 1, 2, 3!

Actually the limit on the 'Sticky' value is 127, but anyway. :P

I am glad you guys like it. Thanks all. :D
Title: Re: Order Stickied Topics
Post by: Nodaz on August 11, 2008, 10:15:14 PM
i haven't tried it yet but THANKS !
Edit downloaded and started the install when i see this:
    Description
1.    Execute Modification    ./index.php    Test successful
2.    Execute Modification    ./Sources/Post.php    Test successful
3.    Execute Modification    ./Sources/MessageIndex.php    Test successful
4.    Execute Modification    ./Themes/default/MessageIndex.template.php    Test successful
5.    Execute Modification    ./Themes/default/Post.template.php    Test successful
6.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
7.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file

Any issue?
That said...i am using a theme, how do i apply it to that?
Title: Re: Order Stickied Topics
Post by: ccbtimewiz on August 11, 2008, 10:23:36 PM
You most likely don't have to do any edits. Just install it and see if it'll work. :P
Title: Re: Order Stickied Topics
Post by: Nodaz on August 12, 2008, 01:21:40 AM
Quote from: ccbtimewiz on August 11, 2008, 10:23:36 PM
You most likely don't have to do any edits. Just install it and see if it'll work. :P
Like it was meant to be there  !
AWESOME LHVWB !
Thank you  !
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 12, 2008, 01:59:42 AM
@UbinTook,
ccbtimewiz is correct (it happens sometimes :P), you shouldn't need to make any edits to custom themes, unless they contain the 'Post.template.php' or 'MessageIndex.template.php' template files, I will try to add some documentation which shows you how to edit these files, if you ever get a theme which has their own copies of these files.
Title: Re: Order Stickied Topics
Post by: DSollick on August 12, 2008, 02:44:26 AM
When installing this mod, I get the following error:

2.   Execute Modification   ./Sources/Post.php   Test failed

Mod seems to work fine, so should I be worried about that at all?
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 12, 2008, 03:53:48 AM
@DSollick,
The edits to that file are important, the most important edit to that file adds most of the code for the mod so if its working properly then thats not an issue. However the other changes fix some annoying behaviour which cause the 'sticky' value will be set to 1 whenever you edit a stickied topic or message. If you post your Post.php then I can install the parts which the package manager failed to install, thus fixing that problem.
Title: Re: Order Stickied Topics
Post by: DSollick on August 12, 2008, 06:17:53 AM
Sorry for taking so long, I was attempting to manually install another package [Which I will never, ever, do again] that involved this file.

Thanks again for looking into this for me :)
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 12, 2008, 06:26:14 AM
@DSollick,
Most of the mod installed fine for that file, the only edit that didn't work is below, if you want to do it personally for your file. I have also attached it.

Find this code (line 2167 for your file):
    // Assume the first message if no message ID was given.
    $request = db_query("
            SELECT
                m.subject,
                t.locked, t.numReplies, t.ID_MEMBER_STARTED, t.ID_FIRST_MSG,


Replace with:
    // Assume the first message if no message ID was given.
     $request = db_query("
             SELECT
                 m.subject,
                 t.locked, t.numReplies, t.ID_MEMBER_STARTED, t.ID_FIRST_MSG, t.isSticky,


The only difference which made the install fail for that edit was the 'm.subject' part, that's probably from a different mod. It should definetly work properly now.
Title: Re: Order Stickied Topics
Post by: DSollick on August 12, 2008, 06:28:06 AM
Thanks again for all your help! :)
Title: Re: Order Stickied Topics
Post by: Adish - (F.L.A.M.E.R) on August 13, 2008, 09:21:31 PM
I tried to install the mod via package manager and it gave me this error:-
The package you tried to upload either is not a valid package or has become corrupted.

I am using 2.0 beta 3.1 version...

I actually tried it install from the latest mods shown up while viewing the packages installed and then tried it here... both told me the same... i think there might be some bug..
Title: Re: Order Stickied Topics
Post by: ccbtimewiz on August 13, 2008, 09:28:39 PM
L, you defined it as:

<install for="2.0 - 2.99.99">

I don't think you can do that for the public beta version..
Title: Re: Order Stickied Topics
Post by: Adish - (F.L.A.M.E.R) on August 13, 2008, 09:33:53 PM
oh mannn... this is bad... maximum mods i am interested in...all are still compatible with 1.1.5 but not the public beta...:( i will have to wait long way for it i think....well i'll try keeping an eye on these mods so as soon as they get released, i will be using them.. :D

Well, it does allow to do the parser or whatever... on the mod page... i dunno what maybe the problem then..

Please help me out if its compatible..
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 14, 2008, 02:20:43 AM
@ccbtimewiz,
2.0 Beta 3.1 is still a subversion of the 2.0 version, so it will work. This mod is definetly compatible with SMF 2 Beta 3.1, I especially made it so.... :P

@F.L.A.M.E.R
Okay, this is definetly not an issue with the mod, I have tested it on multiple versions of SMF 2 Beta and I just tested it again on a clean version. I would suspect that either the packages that you have downloaded have become corrupted (unlikely to happen twice), or there is something wrong with your package manager.

Try to re-download the package, and install it again. Make sure that the package directory and the necessary files are chommed to 0777, or are writable.
How do I chmod? / what is chmod? (http://docs.simplemachines.org/index.php?topic=477)

Title: Re: Order Stickied Topics
Post by: BYUFanatic on August 15, 2008, 11:30:56 AM
Ok, I've installed this mod (version 1.01) on my forum (version 1.1.5) but I do not see anywhere that gives me the option of ordering stickies. This is the only mod I have installed. I am using the ApolloBB theme.

Thanks!

Rob
Title: Re: Order Stickied Topics
Post by: Adish - (F.L.A.M.E.R) on August 15, 2008, 01:20:49 PM
its only this mod which is giving me this error.

The package you tried to upload either is not a valid package or has become corrupted.

thats the message. Tried lots of things, yet it is giving me the same thing.

Please check out, i actually need this mod.
Title: Re: Order Stickied Topics
Post by: BYUFanatic on August 15, 2008, 01:38:28 PM
Quote from: BYUFanatic on August 15, 2008, 11:30:56 AM
Ok, I've installed this mod (version 1.01) on my forum (version 1.1.5) but I do not see anywhere that gives me the option of ordering stickies. This is the only mod I have installed. I am using the ApolloBB theme.

Thanks!

Rob

I just changed from the ApolloBB theme to the generic SMF theme and the "Order Sticked Topics" tab came up. So, unfortunately it won't work with the ApolloBB theme. Can anyone give me a pointer on how I can add it to the theme?

Thanks!

Rob
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 15, 2008, 08:43:51 PM
@BYUFanatic,
I have posted instructions for using this mod for custom themes, on the download page:
http://custom.simplemachines.org/mods/index.php?mod=1321

@F.L.A.M.E.R,
If you really can't get the automatic install to work, then try to install it manually. The package on the server is definetly not corrupted. ;)
Title: Re: Order Stickied Topics
Post by: BYUFanatic on August 15, 2008, 11:00:42 PM
Thanks for the help!

I've done the changes you outlined, but no luck.

Here are the code changes I did:
(my additions to the code are in bold.)

Quote from: MessageIndex.template.php
   // How about new polls, can the user post those?
   if ($context['can_post_poll'])
      $buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll">' . $txt['smf20'] . '</a>';
   // How about order stickied topics, can the user order those?
   if ($context['can_order_stickied_topics'])
      $buttonArray[] = '<a href="' . $scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0;poll">' . $txt['OrderStickiedTopics_title'] . '</a>';


Quote from: MessageIndex.template.php
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      //   Show the Link/Button for the Order Stickied Topics Mod.
      'order_stickied_topics' => array('test' => 'can_order_stickied_topics', 'text' => 'OrderStickiedTopics_title', 'lang' => true, 'url' => $scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0'),

   );

And this was added at the bottom of the Post.template.php..

Quote from: Post.template.php
//   Function to display the list of stickiedtopics.
function template_orderstickiedtopics()
{
   global $context, $txt, $board_info, $scripturl, $settings;
     
   //   Show the start of the table, as well as the main heading and the column headings.
   echo '
      <br />
      <table border="0" align="center" cellspacing="1" cellpadding="4" class="bordercolor" width="60%">
         <tr class="catbg3">
            <td colspan="5" align="left">
               <div style="float: left;">
                  <b>', $txt['OrderStickiedTopics_title'] ,'</b> - <a href="' . $scripturl . '?board=', $context['current_board'], '.0">', $board_info['name'], '</a>
               </div>
            </td>
         </tr>
         <tr class="titlebg">
            <th>', $txt[70], '</th>
            <th>', $txt['OrderStickiedTopics_current'], '</th>
            <th>', $txt['OrderStickiedTopics_modify'], '</th>
         </tr>';
   
   //   Show a list of the topics.
   foreach($context['topics'] as $topic)
   {
      echo '
         <tr>
            <td align="left" valign="top" class="windowbg"><b><a href="', $scripturl, '?topic=', $topic['id'], '.0">', $topic['title'], '</a></b></td>
            <td align="left" valign="top" class="windowbg2" style="text-align:center;">', $topic['value'], '</td>
            <td align="center" valign="top" class="windowbg2">
               <a href="', $scripturl, '?action=orderstickiedtopics;topic=', $topic['id'],';decrease"><img src="', $settings['images_url'], '/sort_down.gif" alt="', $txt['OrderStickiedTopics_decrease'], '" border="0" /></a>
               <a href="', $scripturl, '?action=orderstickiedtopics;topic=', $topic['id'],';increment"><img src="', $settings['images_url'], '/sort_up.gif" alt="', $txt['OrderStickiedTopics_increase'], '" border="0" /></a>
               &nbsp;&nbsp;&nbsp;<a href="', $scripturl, '?action=orderstickiedtopics;topic=', $topic['id'],';unsticky">', $txt['OrderStickiedTopics_unsticky'], '</a>
            </td>
         </tr>';
   }
   
   //   If we have no topics, then show a short message telling the moderator.
   if(empty($context['topics']))
      echo '
         <tr>
            <td colspan="3" valign="top" class="windowbg">', $txt['OrderStickiedTopics_emptylist'], '</td>
         </tr>';
     
   //   Finish the table.
   echo '
         <tr class="catbg3">
            <td colspan="5" align="left">
            <b style="font-size:14px;"><a href="', $scripturl, '?board=', $context['current_board'], '.0">', $txt['OrderStickiedTopics_back'], ' ', $board_info['name'], '</a></b>
            </td>
         </tr>
      </table>';
}


Perhaps a typo somewhere with one of the variables?

Rob
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 15, 2008, 11:24:22 PM
Nope, that code which you posted should work perfectly. The issue is that the theme has its own 'languages/Modifications.english.php' file, so when the Modifications language file is loaded its uses the one from that theme, which doesn't have the langauge strings for any of your mods, to fix this problem you can open up your 'default/langauges/Modifications.english.php' file and then copy the language strings into your 'ApolloBB/langauges/Modifications.english.php' file, be careful that you leave the strings that are already in that file alone, otherwise the entire theme will stop working.
Title: Re: Order Stickied Topics
Post by: BYUFanatic on August 16, 2008, 12:15:31 AM
There we go. That did the trick. I modified the Modifications.english-utf8.php file and it works like a charm.

Thanks a bunch! Now I can put all the stickies in order for my students before the school year starts. *grin*

Rob
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 16, 2008, 12:28:09 AM
@BYUFanatic,
I have added some more information in the troubleshooting area, that covers what to do if your theme has its own 'Modifications.english.php' file. Thank you. :)
Title: Re: Order Stickied Topics
Post by: Sabre™ on August 16, 2008, 08:02:14 PM
A very handy mod :)
Thanks buddy
Title: Re: Order Stickied Topics
Post by: justjim on September 04, 2008, 02:55:21 PM
I would like some help editing my custom theme files Please  :)

MessageIndex.template.php

and

Post.template.php

To get this mod to work (Ordered Stickie Topics)

I am using Vs 1.1.5

And the Custom theme I am using is Black_phoenix3

I have attached the 2 files listed in the mod instructions.

I also do not know if this theme uses custom images for any of the buttons

Thank you in advance
Title: Re: Order Stickied Topics
Post by: Nathaniel on September 05, 2008, 02:52:07 AM
The files attached should work. Although if you want a button then you will have to create your own image. ;)
Title: Re: Order Stickied Topics
Post by: justjim on September 05, 2008, 08:15:12 AM
Quote from: LHVWB on September 05, 2008, 02:52:07 AM
The files attached should work. Although if you want a button then you will have to create your own image. ;)
Thank you I'll load it up and see how they do.
I am going to apply the mod, then upload the 2 files you fixed for me.

Is that the right order?

As far as the button, will it just show a button with no image in it?

Thank you very much for your help
Title: Re: Order Stickied Topics
Post by: Adish - (F.L.A.M.E.R) on September 05, 2008, 08:18:44 AM
hey isnt there a bug that the topics jump up and down ? like if i hit the up arrow for the 3rd stickied topic, it will take it to the 1st one instead of the second one... any ideas what i could have done wrong or if you are aware about it then please let me know the solution.
Title: Re: Order Stickied Topics
Post by: Nathaniel on September 05, 2008, 08:20:50 AM
@justjim,
Yep, that order should work correctly. ;)

At the moment, it will show a text link, which doesn't look very good. If you make an image for it, then I can show you how to upload that and use it instead of the text link. ;)

@F.L.A.M.E.R,
The arrows do not actually change the 'order' of the stickies, they change the 'stickiness' or 'sticky value' of the stickes, the higher that value, the higher up your stickies will be. ;)
Title: Re: Order Stickied Topics
Post by: Adish - (F.L.A.M.E.R) on September 05, 2008, 08:25:25 AM
ooo.. then why does it change its location there ? it should just change the numbers besides it isnt it ?
Title: Re: Order Stickied Topics
Post by: Nathaniel on September 05, 2008, 08:27:26 AM
Yep, can you post a screenshot of the issue that you are having?
Title: Re: Order Stickied Topics
Post by: Garou on October 22, 2008, 01:42:00 PM
Quote from: LHVWB on September 05, 2008, 08:20:50 AM
At the moment, it will show a text link, which doesn't look very good. If you make an image for it, then I can show you how to upload that and use it instead of the text link. ;)

Anyone using this with the WoWDK theme?

Ive followed all the info in the trouble shooting area and it works just fine as long as I enter the action url by hand, ie.  http://boardurl/index.php?action=orderstickiedtopics;board=board number;

However on the board's page I dont see the text link or anything for it. Also Im not excatly sure which directory to drop the image in when I do make one for the mod or if theres more code to change.

Correction: Its preforming the code but re-using the themes "new_topic.gif" for the board image. And all fixed now.  :)
Title: Re: Order Stickied Topics
Post by: Nathaniel on October 23, 2008, 02:17:40 AM
@Garou,
I'm glad it was fixed. If you need any more help then ask. :)

@tjhanes,
The database issue is extremely odd, since this mod changes nothing in your database. It also shouldn't change anything in your BoardIndex files either. I will need some more information to try and work out what the issue is.

Firstly, What is your custom theme?
Do you have any related errors in your Forum Error Log (http://docs.simplemachines.org/index.php?topic=150)?
Does everything work if you swap back to the default theme?
Title: Re: Order Stickied Topics
Post by: Nathaniel on October 23, 2008, 03:34:20 AM
Well, if those errors are 'undefined variable' errors, then its likely that they relate to the language files for the mods. Although it would be good if you could post some of the actual errors so that I can see what they refer to.

Also, which versions of SMF and SimplePortal are you running?
Title: Re: Order Stickied Topics
Post by: B u m u™ on October 23, 2008, 03:43:28 AM
Let me translation  in to the turkish this mod

Please :D

Title: Re: Order Stickied Topics
Post by: Nathaniel on October 23, 2008, 03:48:23 AM
@.:Can:.,
This mod currently isn't translated into Turkish. Although any translations would be welcome. You can find the language strings in the 'english.xml' file within the mod package itself. ;)
Title: Re: Order Stickied Topics
Post by: B u m u™ on October 23, 2008, 03:52:10 AM
Quote from: LHVWB on October 23, 2008, 03:48:23 AM
@.:Can:.,
This mod currently isn't translated into Turkish. Although any translations would be welcome. You can find the language strings in the 'english.xml' file within the mod package itself. ;)

Ok thank you this mod :)
Title: Re: Order Stickied Topics
Post by: Nodaz on November 11, 2008, 02:44:14 AM
version 1.1.7 is not listed as compatible, though beta 2.0 is...will this work if i upgrade?
Title: Re: Order Stickied Topics
Post by: Nathaniel on November 11, 2008, 04:08:28 AM
@UbinTook,
The reason that this mod didn't have 1.1.7 marked as compatible, is because I haven't had time to check through all of my mods to see if they are still compatible (I am in the middle of exams.), while there are very few changes between 1.1.x versions, I always like to make sure. ;)

After some quick testing, it seems that this mod is fully compatible with SMF 1.1.7. I have updated the mod download page. :)
Title: Re: Order Stickied Topics
Post by: Nodaz on November 11, 2008, 02:03:23 PM
Thank you !
Title: Re: Order Stickied Topics
Post by: zoula on November 12, 2008, 12:00:40 PM
Thanks LHVWB! Great work. I installed it manually and it is easy to use.

"It would be great however if we could change the Sticky value manually by entering a number. Just a suggestions!"

Thanks again for the great efforts!
Title: Re: Order Stickied Topics
Post by: Nathaniel on November 13, 2008, 03:16:44 AM
@zoula,
Hmm, I will have a think about that, AJAX would be useful there as well. ;)
Title: Re: Order Stickied Topics
Post by: zoula on November 13, 2008, 08:32:40 AM
LHVWB ! Take your time! I can live with the actual version. But hey, buzz me if you do it on day!  ;D
Title: Re: Order Stickied Topics
Post by: offrocker on November 14, 2008, 10:36:00 AM
I installed this and didn't see the link to order the topics, knowing that i had a custom theme. I had to change the code for message index, but I was scared I'd mess something up. I didn't. It works.  :D
Title: Re: Order Stickied Topics
Post by: Sabre™ on November 15, 2008, 02:59:02 AM
congrats offrocker,
good job :)

Quote from: LHVWB on November 13, 2008, 03:16:44 AM
@zoula,
Hmm, I will have a think about that, AJAX would be useful there as well. ;)

+k
Title: Re: Order Stickied Topics
Post by: Boby_ on November 19, 2008, 03:18:18 AM
Nice mod! Very useful!

I had to make the modifications to my Post.php by hand but anyway it works just fine! :)

I have one question though. It shows the button to order sticky topics to Admins, Global Moderators and Moderators and not to ordinary users. But how can I as an Admin give or take permission to order sticky topics to these and other groups? I wasn't able to find this option.
Title: Re: Order Stickied Topics
Post by: Nathaniel on November 19, 2008, 03:15:26 PM
Boby_,
Its based off the moderation permission called 'make_sticky'. If a member can make a sticky, then they also have the ablity to order them as well.
Title: Re: Order Stickied Topics
Post by: editor1 on December 06, 2008, 04:52:24 AM
this is great, I was looking for this, works nicely
thank you :D
Michael
Title: Re: Order Stickied Topics
Post by: Don Pepito on December 15, 2008, 08:43:04 AM
How to make it compatable with babylon...??
Title: Re: Order Stickied Topics
Post by: Garou on December 15, 2008, 11:50:17 AM
Go to the Download page the instructions for custom these are on that page.
Title: Re: Order Stickied Topics
Post by: Don Pepito on December 15, 2008, 02:03:34 PM
Problem is that this part of code in babylon's MessageIndex.template doesn't exist....
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
Title: Re: Order Stickied Topics
Post by: Garou on December 16, 2008, 09:55:28 PM
I haven't tested it but after a quick glance at the theme Id suggest trying...
Find...
// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new_poll.gif" alt="' . $txt['smf20'] . '" border="0" />' : $txt['smf20']) . '</a>';


Add After...
// Show the Link/Button for the Order Stickied Topics Mod.
'order_stickied_topics' => array('test' => 'can_order_stickied_topics', 'text' => 'OrderStickiedTopics_title', 'lang' => true, 'url' => $scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0;'),
Title: Re: Order Stickied Topics
Post by: Nathaniel on December 21, 2008, 06:00:57 AM
@Don Pepito,
Did you have any luck with that? Do you need any more help?
Title: Re: Order Stickied Topics
Post by: Don Pepito on December 22, 2008, 05:37:05 PM
I'll try it in two days, i am not at home...having some rest...then back to job....
I'll look forward to answer you as soon as i can, anyway i appreciate your labour and helpness...
Title: Re: Order Stickied Topics
Post by: habakuk on December 29, 2008, 06:24:19 AM
First of all, thanks for the mod. Comes in handy!

Installed fine but produced an error:

ERROR: syntax error at or near ")"
LINE 3: FROM (psf_topics as t)
^
File: /Library/Apache2/htdocs/xxx/Sources/Post.php
Line: 2836


This is on 2.0b4 using PostgreSQL as the database backend. Using a customized theme based on the default theme. No other mods installed, nothing changed in the files. Only CSS fixes so far.

Changing
FROM ({db_prefix}topics as t)

into

FROM {db_prefix}topics as t

cured the problem. Might be a difference in pgsql vs mysql SQL syntax ?

Just thought I let you know...

cheers
®


Title: Re: Order Stickied Topics
Post by: Nathaniel on December 30, 2008, 03:17:41 AM
@habakuk,
As you said, that is most likely an issue with a difference between pgsql and mysql SQL syntaz. Next time I update the mod I will remove that issue.
Title: Re: Order Stickied Topics
Post by: habakuk on December 30, 2008, 04:51:25 AM
Thanks. Not a big issue, it's easy to fix on the user side.

While we're at it: I do have a question about the ordering functionality. Once I've ordered let's say 5 stickies and later add three more, I get duplicate position numbers first. Then I juggle the items around up and down until each one has a unique number.

It would be cool to see the function scan the result list for missing (empty) position numbers and assign unique numbers to those. That would make it probably more reliable to order them.

Thanks & regards
Title: Re: Order Stickied Topics
Post by: Don Pepito on January 05, 2009, 03:46:15 PM
Quote from: Garou on December 16, 2008, 09:55:28 PM
I haven't tested it but after a quick glance at the theme Id suggest trying...
Find...
// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new_poll.gif" alt="' . $txt['smf20'] . '" border="0" />' : $txt['smf20']) . '</a>';


Add After...
// Show the Link/Button for the Order Stickied Topics Mod.
'order_stickied_topics' => array('test' => 'can_order_stickied_topics', 'text' => 'OrderStickiedTopics_title', 'lang' => true, 'url' => $scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0;'),


Now i have parse error....
unexpected T_DOUBLE_ARROW ...
Help please...
Title: Re: Order Stickied Topics
Post by: JaGuR on January 07, 2009, 06:53:25 PM
Installed this and changed all the correct files and the install went with out a hitch, but I can't find anything where I get to order the Sticky's  ??

Could somebody tell me what I should be looking for or post a Screenshot of what the mod should look like so I know where I may be going wrong ?

Cheers
Title: Re: Order Stickied Topics
Post by: habakuk on January 07, 2009, 07:11:29 PM
Look in a board that has stickies. You should notice a "Order stickied topics" button right of "New topic".

Title: Re: Order Stickied Topics
Post by: JaGuR on January 07, 2009, 07:24:14 PM
OK thats the problem then all I have is "mark as read", "notify", "new topic", "add poll"

So obviously a problem in my messageindex.template file

:-\
Title: Re: Order Stickied Topics
Post by: habakuk on January 07, 2009, 07:26:04 PM
Check the docs on the mod. It's nicely and clearly written what to check if you run into that (check the button code). ;)
Title: Re: Order Stickied Topics
Post by: JaGuR on January 07, 2009, 08:16:56 PM
Yes thanks, now that I no what I am looking for I should be able to find the problem ...... wasn't sure if it had to be enabled in admin and stuff, so was scratching my head  :)
Title: Re: Order Stickied Topics
Post by: JaGuR on January 07, 2009, 09:17:25 PM
Fixed it thank you great mod by the way
Title: Re: Order Stickied Topics
Post by: Don Pepito on January 09, 2009, 12:30:19 PM
Please answer me....
Title: Re: Order Stickied Topics
Post by: Don Pepito on January 11, 2009, 12:47:22 PM
After some programming i found how to implement this mod to your babylon theme...
Find

// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new_poll.gif" alt="' . $txt['smf20'] . '" border="0" />' : $txt['smf20']) . '</a>';


Add after:
// Show the Link/Button for the Order Stickied Topics Mod.
if ($context['can_order_stickied_topics'])
$buttonArray[] =  '<a href=" ' .$scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0;"> Order stickies </a>';
Title: Re: Order Stickied Topics
Post by: .Vapor on January 11, 2009, 05:01:23 PM
Cool....thx for this mod !
Title: Re: Order Stickied Topics
Post by: thedesigner on February 23, 2009, 03:42:47 PM
Im having a problem using this mod. Its installed fine but I cant get the sticky topics to order correctly. I want it to go up one so I click the up arrow and it skips up 5 spots, I want it to go down one and it doesnt go down at all. Whats with the values? How can I manually change them? Thanks.

Sample Lover
http://samplesite.info
Title: Re: Order Stickied Topics
Post by: habakuk on February 23, 2009, 06:09:25 PM
Well, you see the index value and you need to click as many times in the proper sequence to get the topic you want at top to have the highest value. It's a bit tricky to get that done, e.g. if you have 10 sticky topics ordered and add a eleventh which should end up somewhere in the middle or so... I consider it to be a fun game to guess where to click to get it done as quickly as possible.
:-)

or you can go directly to the database and manage the topics there.
Title: Re: Order Stickied Topics
Post by: DeviDarkL on March 16, 2009, 07:10:31 PM
Great Mod :D

Portuguese_pt translation for it ;)

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Text for the Order Stickied Topics Mod.
$txt['OrderStickiedTopics_title'] = 'Ordenar Tópicos Inamovíveis';
$txt['OrderStickiedTopics_current'] = 'Actual Valor do \'Inamovível\' ';
$txt['OrderStickiedTopics_back'] = 'Voltar a';
$txt['OrderStickiedTopics_modify'] = 'Modificar Valor do Inamovível';
$txt['OrderStickiedTopics_unsticky'] = 'Deixar de ser Inamovível';
$txt['OrderStickiedTopics_increase'] = 'Subir';
$txt['OrderStickiedTopics_decrease'] = 'Descer';
$txt['OrderStickiedTopics_emptylist'] = 'Este quadro, de momento, não tem tópicos Inamovíveis.';
]]></add>
</operation>
</file>
Title: Re: Order Stickied Topics
Post by: Nathaniel on March 17, 2009, 01:01:49 AM
I have been away for a while, I only just noticed this topic in my unread list. ;)

Sorry to Don Pepito and JaGuR, I didn't notice your suppot requests. I am happy that you managed to solve your issues.

@grfkdesign,
I believe that habakuk explained to you how the ordering system works, I am going to fix that (hopefully) with the next version of this mod, so that its easier to use.

@V@POR,
I'm glad you like it.

@DeviDarkL,
Thank you for the translation, I'll try to update this mod sometime in the next few weeks, when I do I'll add that translation. :)
Title: Re: Order Stickied Topics
Post by: vristang on April 11, 2009, 01:04:36 AM
Quote from: Don Pepito on January 11, 2009, 12:47:22 PM
After some programming i found how to implement this mod to your babylon theme...
Find

// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new_poll.gif" alt="' . $txt['smf20'] . '" border="0" />' : $txt['smf20']) . '</a>';


Add after:
// Show the Link/Button for the Order Stickied Topics Mod.
if ($context['can_order_stickied_topics'])
$buttonArray[] =  '<a href=" ' .$scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0;"> Order stickies </a>';



I'm using the Babylon Theme as well, but did it a little different....

//   Show the Link/Button for the Order Stickied Topics Mod.
   if ($context['can_order_stickied_topics'])
$buttonArray[] = '<a href="' . $scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0;poll">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/ReOrder.gif" alt="' . $txt['ReOrder'] . '" border="0" />' : $txt['ReOrder']) . '</a>';

Then I added the appropriate text entry into Themes/default/languages/Index.English.php

I've attached the button I created at...
http://www.marcovanveelen.nl/buttongenerator/

Great Mod, I appreciate having it  8)
Title: Re: Order Stickied Topics
Post by: portlandstand-up on April 12, 2009, 06:21:32 PM
I so much appreciate this mod. However, I installed it and I can not seem to get it to show the option tab. It uploaded correctly to my server, and it installed correctly. It is for 1.1.8

I have a third party theme: B l a c k - R a i n V.2 by C r i p.

The file I have is MessageIndex.template.php:

I altered it per your instructions and this is what I have for that file:

Here is the important part of the altered code:

// Are they allowed to post new topics?
if ($context['can_post_new'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' .

$context['current_board'] . '.0">' . $txt['smf258'] . '</a>';

// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' .

$context['current_board'] . '.0;poll">' . $txt['smf20'] . '</a>';

// How about new polls, can the user post those?
if ($context['can_order_stickied_topics'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' .

$context['current_board'] . '.0;poll">' . $txt['OrderStickiedTopics_title'] .

'</a>';

return implode(' &nbsp;|&nbsp; ', $buttonArray);
}


?>


I you would like the entire file I can attach it for you if you like.

I have no errors at the moment and i back up everything I alter .
Any help would great

Thanks
LB
Title: Re: Order Stickied Topics
Post by: couchre on April 16, 2009, 05:08:23 PM
   I installed using the Upload a Package function in SMF 1.1.8 and is detected no problems but skipped the last edit.

Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./index.php    Test successful
2.    Execute Modification    ./Sources/Post.php    Test successful
3.    Execute Modification    ./Sources/MessageIndex.php    Test successful
4.    Execute Modification    ./Themes/default/MessageIndex.template.php    Test successful
5.    Execute Modification    ./Themes/default/Post.template.php    Test successful
6.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
7.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file

   After I click the "Order Stickied Topics" tab I receive this error.

Fatal error: Cannot redeclare orderstickiedtopics() (previously declared in /hermes/bosweb/web242/b2420/web.website/public_html/forum/Sources/Post.php:2343) in /hermes/bosweb/web242/b2420/Web.Website/public_html/forum/Sources/Post.php on line 2506

Any Help would be greatly appreciated

Thanks
Title: Re: Order Stickied Topics
Post by: Moif on May 12, 2009, 06:49:02 AM
Hi,

I've followed the instructions to the letter but cannot for the life of me work out how to get a custom image for a button. Can someone advise as to what I need to post here to get some help?

I have a theme called june2008 but it uses the default themes Modifications.english.php, MessageIndex.template.php and Post.template.php

All edits seem to be in place and I have a gif called reorder.gif in both the english and june2008 images/english/ folders.
Title: Re: Order Stickied Topics
Post by: Magicjax on May 12, 2009, 08:21:11 PM
I can't find where the "Tab is to change the order. Can someone please walk me through where to find this link?

I have two posts that are sticky in one section of my forum and I just wan't to change the order of them. I don't see a link anywhere that says the word "Order" in it.

Thanks for your help.

Ron
Title: Re: Order Stickied Topics
Post by: Magicjax on May 13, 2009, 12:51:53 PM
I still can't figure this out. I have it installed but how do I use it?

I'm using version 1.1.8

Theme is Anecdota

Quote
It allows anyone with permissions to create a sticky in a particular board, to order those stickied topics by clicking on the "Order Stickied Topics" link, on the topic list page for any particular board.

I'm administrator so I should have permission already shouldn't I?

Can someone walk me through how to use this because I just can't figure it out.

Thanks.

Ron
Title: Re: Order Stickied Topics
Post by: Magicjax on May 13, 2009, 07:42:08 PM
I take it support is no longer available for this mod.

Thanks anyway. I'll see if there's another solution.

Any suggestions on another one that'll allow you to change the order of the sticky posts?
Title: Re: Order Stickied Topics
Post by: Simplemachines Cowboy on May 13, 2009, 08:19:28 PM
Funny, if you cannot see the "Ordered Stickied Topics" button, instead of faulting the mod, maybe you didn't install it correctly?
Did you try the default theme to see if it was there?

In the board view of which you have multiple sticky posts, in the same row of tabs which have     New Topic  |  Mark Read  |  Post new poll  |  Notify
you will have another one which reads Order Stickied Topics.

Click it.

The action is .../forum/index.php?action=orderstickiedtopics;board=1.0;
Title: Re: Order Stickied Topics
Post by: Nathaniel on May 14, 2009, 02:08:43 AM
@everyone,
I still support this mod, but mostly for upgrades when new versions of SMF come out, I believe that this mod works fine for the latest versions. The best place to ask for actual support would be the SMF Coding Discussion (http://www.simplemachines.org/community/index.php?board=60.0) board or the relevant theme's topic if you want to install it for a custom theme, because I don't really have time to go through many support requests.

@vristang,
Glad you like the mod. :)

@portlandstand-up,
Try this code (not tested):
// Are they allowed to post new topics?
   if ($context['can_post_new'])
      $buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0">' . $txt['smf258'] . '</a>';

   // How about new polls, can the user post those?
   if ($context['can_post_poll'])
      $buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll">' . $txt['smf20'] . '</a>';

   // How about new polls, can the user post those?
   if ($context['can_order_stickied_topics'])
      $buttonArray[] = '<a href="' . $scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '">' . $txt['OrderStickiedTopics_title'] . '</a>';

   return implode(' &nbsp;|&nbsp; ', $buttonArray);
}


?>


@couchre,
That error suggests that you have accidentally installed parts of the mod twice, its likely that you will have to manually remove some code. You can get a list of edits made by this mod with the 'Manual Install Instructions for SMF' function on the mod page. Try removing the extra 'orderstickiedtopics' function from your 'Post.php' file.

@Moif,
I can't really help you without any knowledge of that theme, try asking the theme author if they have any idea. I couldn't actually find that theme on the SMF theme site. :/

@Magicjax,
Simplemachines Cowboy is correct, please check to see if it works for the default theme. If it does then its an issue with your custom theme, try following the instructions for installing the mod on custom themes, which can be found on the mod download page under the heading "Custom Themes".
Title: Re: Order Stickied Topics
Post by: Moif on May 14, 2009, 05:24:16 AM
Quote from: Nathaniel on May 14, 2009, 02:08:43 AM
@Moif,
I can't really help you without any knowledge of that theme, try asking the theme author if they have any idea. I couldn't actually find that theme on the SMF theme site. :/

Hi,

Sorry, I should have been clearer. It's a copy of the default theme that I've customised myself. It still pulls all the mentioned PHP files from the default theme folder though so for all intents and purposes it's essentially a default theme still :)

I've looked at the PHP files mentioned in the instructions and I can see where the edits are and have made the changes but still can't get an image to show up.
Title: Re: Order Stickied Topics
Post by: Nathaniel on May 14, 2009, 06:28:05 AM
@Moif,
Perform the edit below for your 'MessageIndex.template.php' file. It adds the image name into the code. ;)

Find this code:
'order_stickied_topics' => array('test' => 'can_order_stickied_topics', 'text' => 'OrderStickiedTopics_title', 'lang' => true, 'url' => $scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0'

Replace with this code:
'order_stickied_topics' => array('test' => 'can_order_stickied_topics', 'text' => 'OrderStickiedTopics_title', 'image' => 'reorder.gif', 'lang' => true, 'url' => $scripturl . '?action=orderstickiedtopics;board=' . $context['current_board'] . '.0'
Title: Re: Order Stickied Topics
Post by: Moif on May 14, 2009, 09:42:34 AM
Marvellous, works a treat.

Thanks very much!
Title: Re: Order Stickied Topics
Post by: LHW on May 14, 2009, 10:56:23 AM
Great Mod!  Worked first time!!  :D

Thank you! 
Title: Re: Order Stickied Topics
Post by: Magicjax on May 14, 2009, 02:58:30 PM
Quote from: Simplemachines Cowboy on May 13, 2009, 08:19:28 PM
Funny, if you cannot see the "Ordered Stickied Topics" button, instead of faulting the mod, maybe you didn't install it correctly?
Did you try the default theme to see if it was there?

In the board view of which you have multiple sticky posts, in the same row of tabs which have     New Topic  |  Mark Read  |  Post new poll  |  Notify
you will have another one which reads Order Stickied Topics.

Click it.

The action is .../forum/index.php?action=orderstickiedtopics;board=1.0;

Oh, I didn't mean to come across in any negative way. I've been coming here for help for the last few weeks and everyone has been very helpful and I've gotten support very quickly. When this question went unanswered for some long I just figured it might be kind of old or outdated and no one was really fallowing it much anymore. So sorry if I came across in a negative way.

You helped in that I now know where the link is suppose to be found. It's not there and I did try it in the default theme as well. Still no "Order Stickied Topics" link. I loaded it with the package loader and no errors where found.
Title: Re: Order Stickied Topics
Post by: Nathaniel on May 14, 2009, 05:34:11 PM
@Magicjax,
Try uninstalling/reinstalling the mod.

There are a few possibilities for things that could have gone wrong:
1) Edits applied badly: Go to "/index.php?action=orderstickiedtopics;board=1.0" for your site, to check that the correct page is there.
2) Language Strings Applied badly: Check your '/themes/Default/languages/Modifications.english.php' file for this text 'Text for the Order Stickied Topics Mod.'.
Title: Re: Order Stickied Topics
Post by: thedesigner on May 17, 2009, 11:40:00 AM
Im still having problems getting the sticky topics in order, how do I manually put them in order from the database?
Title: Re: Order Stickied Topics
Post by: Garou on May 17, 2009, 12:12:35 PM
You don't order them from the database there is a button on each board that says Order Sticky Topics. It will pull up a page with the tobics in the board that are stickied and there you can adjust them as you need.
Title: Re: Order Stickied Topics
Post by: thedesigner on May 17, 2009, 01:01:43 PM
Yes I understand that but I cant get them to go in order correctly. Im trying to put my sticky topics in alphebetical order. When I get to H, it either goes above the G or after the M. Most of them are set at a value of 1. :(

http://samplesite.info (see Online Coupon Codes board)
Title: Re: Order Stickied Topics
Post by: usa4all on May 29, 2009, 06:02:10 PM
Does this one work in the Dutch Language? I installed it, get no errows. But so no button.
Title: Re: Order Stickied Topics
Post by: Nathaniel on May 29, 2009, 07:33:49 PM
@grfkdesign,
Topics are always ordered by SMF using their Sticky value, then their id. That means that stickies will go at the top, every sticky will be ordered by how recently a post has been made in them (normal topics will do the same, but under the stickies). That is by SMF design, if you want to put your stickies in alphabetical order, then you will have to change their sticky order values (which is the point of this mod). ;)

@usa4all,
There is no dutch translation for this mod. You can make it work for the dutch language by adding this code to the bottom of your '/Themes/default/languages/Modifications.dutch.php' file:

// Text for the Order Stickied Topics Mod.
$txt['OrderStickiedTopics_title'] = 'Order Stickied Topics';
$txt['OrderStickiedTopics_current'] = 'Current \'Sticky\' Value';
$txt['OrderStickiedTopics_back'] = 'Back To';
$txt['OrderStickiedTopics_modify'] = 'Modify Sticky Value';
$txt['OrderStickiedTopics_unsticky'] = 'Un-Sticky';
$txt['OrderStickiedTopics_increase'] = 'Increase';
$txt['OrderStickiedTopics_decrease'] = 'Decrease';
$txt['OrderStickiedTopics_emptylist'] = 'This board currently has no stickied topics.';


You will then have to translate the strings like 'Decrease'. (not the bits within the $txt[''] area).
Title: Re: Order Stickied Topics
Post by: Nodaz on June 02, 2009, 06:51:37 PM
Ive run in to a little issue, i recently did a large upgrade to 1.1.9 and now the order stickied topics mod doesn't work.
Its show the tag, but when i click it it just takes me back to the forums main page.
Any ideas?
Should i just reinstall it, do i need to remove the first instance?

Title: Re: Order Stickied Topics
Post by: Nathaniel on June 02, 2009, 07:41:44 PM
@UbinTook,
If you did a large upgrade then that replaces all SMF files (apart from custom theme files), so the tab will be there only on your custom theme (not the default). So effectively the mod has been uninstalled. Reinstalling it should work. Although if you have to uninstall it first, then you will have ignore any errors that it shows (you should only worry if it actually tries to remove code ;)).
Title: Re: Order Stickied Topics
Post by: Nodaz on June 04, 2009, 07:02:52 AM
I am getting a failure in the test:
I see a code modification early on in the thread, but want to make sure i do the right thing..
how do i proceed?
Mod has not yet been installed.


Install Actions

2.    Execute Modification    ./Sources/Post.php    Test failed

7.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file
Title: Re: Order Stickied Topics
Post by: Nathaniel on June 04, 2009, 07:24:47 AM
Can you please post your '/Sources/Post.php' file as an attachment?

You can ignore the 'Modifications.english-utf8.php' file skip, as you don't have English-UTF8 installed.
Title: Re: Order Stickied Topics
Post by: Nodaz on June 04, 2009, 01:39:18 PM
thanks for looking..
Title: Re: Order Stickied Topics
Post by: Nathaniel on June 05, 2009, 04:19:21 AM
A few parts of the mod were still there, I have removed them. You should be able to continue with the installation, as all the edits should be able to be applied for that file now. :)
Title: Re: Order Stickied Topics
Post by: Nodaz on June 05, 2009, 03:47:56 PM
I am still getting the same error:
That said, i came across an entry when tracking an IP of a new member:  Its references the post.php file...

Error messages from IP (range) 208.7.225.101
Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
LIMIT 1' at line 8
File: /home/casinoar/public_html/Sources/Post.php
Line: 2042
?action=quotefast;quote=1073;sesc;modify;xml
Title: Re: Order Stickied Topics
Post by: Nathaniel on June 05, 2009, 08:27:56 PM
Did you reinstall the mod?

The attached file should have that issue resolved (although it wasn't related to this mod), but the mod is not installed on the file.

If you have installed the mod then here is the change I made:
Code (Find) Select
AND (t.locked = 0' . (empty($moderate_boards) ? '' : ' OR b.ID_BOARD IN (' . implode(', ', $moderate_boards)) . ')' . ')') . "


Code (Replace) Select
AND (t.locked = 0' . (empty($moderate_boards) ? '' : ' OR b.ID_BOARD IN (' . implode(', ', $moderate_boards) . ')') . ')') . "


Please note that that issue is not caused by this mod.
Title: Re: Order Stickied Topics
Post by: Nodaz on June 07, 2009, 01:58:16 AM
ok, uploaded the new file.
when i attempt to "apply mod" from package manager I am still getting the errors:

2.    Execute Modification    ./Sources/Post.php    Test failed
7.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file

As well this still shows when i track the new members IP from his profile page:
Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
LIMIT 1' at line 8
File: /home/casinoar/public_html/Sources/Post.php
Line: 2042
?action=quotefast;quote=1073;sesc;modify;xml
Is that just a log of what happened then( dated june 4th)  is there a way to test anything that may need to be tested?

The error shows in the forum error log as:
Apply Filter: Only show the error messages of this member  cheers       June 04, 2009, 06:53:57 PM
Apply Filter: Only show the error messages of this IP address 208.7.225.101      Apply Filter: Only show the error messages of this session f9410daed419ed369f01638ee73e70e6
Apply Filter: Only show the error messages of this URL http://www.ubintooksforum.com/index.php?action=quotefast;quote=1073;sesc;modify;xml
Apply Filter: Only show the errors with the same message
Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
LIMIT 1' at line 8
File: /home/casinoar/public_html/Sources/Post.php
Line: 2042

No other similar errors are present before or after the 4th.
Title: Re: Order Stickied Topics
Post by: Nodaz on June 08, 2009, 02:40:14 PM
Ive gotten the board upgraded to 1.1.9, but i am still getting the error:

2.    Execute Modification    ./Sources/Post.php    Test failed

Title: Re: Order Stickied Topics
Post by: thedesigner on June 10, 2009, 12:45:20 PM
Quote from: Nathaniel on May 29, 2009, 07:33:49 PM
@grfkdesign,
Topics are always ordered by SMF using their Sticky value, then their id. That means that stickies will go at the top, every sticky will be ordered by how recently a post has been made in them (normal topics will do the same, but under the stickies). That is by SMF design, if you want to put your stickies in alphabetical order, then you will have to change their sticky order values (which is the point of this mod). ;)

How do I change their sticky order values?
Title: Re: Order Stickied Topics
Post by: Nathaniel on June 10, 2009, 06:29:41 PM
@UbinTook,
Sorry about the wait. Can you please post your updated Post.php file?

@thedesigner,
Please read the relevant documentation before wasting my time:
Quote from: From Mod PageThis mod allows you to order your stickied topics the way that you want them to be. It allows anyone with permissions to create a sticky in a particular board, to order those stickied topics by clicking on the "Order Stickied Topics" link, on the topic list page for any particular board.
Title: Re: Order Stickied Topics
Post by: thedesigner on June 10, 2009, 06:42:02 PM
Thanks but that isn't the answer I was looking for. I've uninstalled this mod.
Title: Re: Order Stickied Topics
Post by: Nodaz on June 11, 2009, 06:54:46 AM
Thanks Nathaniel, i appreciate your effort.
Title: Re: Order Stickied Topics
Post by: Nodaz on June 16, 2009, 07:31:54 PM
any luck with the current post.php?
Title: Re: Order Stickied Topics
Post by: Nodaz on June 23, 2009, 04:35:38 PM
Hoping you found something in that post.php...
Title: Re: Order Stickied Topics
Post by: Nathaniel on June 23, 2009, 07:56:07 PM
@UbinTook,
Sorry about that wait, try the attached file.

I can't see why that db error is occuring though. Try uploading a clean version of that file if the attached file doesn't help.
Title: Re: Order Stickied Topics
Post by: Nodaz on June 27, 2009, 08:34:42 PM
Hmmmmmm, Still failing...
one thing i noticed in the source folder is there is a file( actually like a duplicate of many files that have a ~ following them.
I.E:   post.php~ ( which i attached)
there are a LOT of those...could that be causing an issue?
Should i delete all the files with the "tilde" ~...
there are a couple in the root, and a BUNCH in the sources folder

By uploading a clean version of "that" file, do you mean the post.php file?
Title: Re: Order Stickied Topics
Post by: Simplemachines Cowboy on June 27, 2009, 10:53:00 PM
UbinTook,
When SMF modifies a file it saves the original file by adding the ~ to the end of the name.
It's so if a mod failed badly one way you can recover is to just go back to the pre-mod state by restoring the ~ marked file.
Title: Re: Order Stickied Topics
Post by: Nodaz on June 27, 2009, 11:18:24 PM
ok, that makes sense,  so could this modified file be causing problems as outlined above? perhaps the mod is "seeing" something? ( i doubt that, but i am grasping)

EDIT:  Success !  so it seems.

ok, renamed post.php, saved a copy of the post.php~ uploaded a "clean"  post.php from the upgrade ran the install on the mod and every succeed.
I haven't installed it though.
Have i or will i cause any issue by deleting the oldpost.php or  post.php~ file, i assume that once i actually run the install it will create another post.php~ when it modifies the new post.php.

In other words the post.php that WAS there and had been modified previously from other mods and such, by uploading a new "clean version, will it affect the current installation of anything?


Then i can delete the renamed original...correct?
Title: Re: Order Stickied Topics
Post by: Simplemachines Cowboy on June 28, 2009, 10:37:01 PM
If you have no other previous mods that wrote changes to post.php, then you can safely delete all the old versions.
Title: Re: Order Stickied Topics
Post by: Nodaz on June 30, 2009, 03:54:18 PM
how do i know that?

Right now the forums seems to be working without issue with the new post.php
Title: Re: Order Stickied Topics
Post by: Simplemachines Cowboy on June 30, 2009, 04:20:36 PM
If you don't remember, and want to make sure, make a list of the other mods you have installed, then go to the mod site and use the Parser to check and see if it modified post.php.
If it did, then it's simple to manually edit the required bits into your new post.php.
There may be an easier way but I know just enough about all of this to be dangerous... :)

Or you could just go along until someone does something that throws an error and fix it then.
Title: Re: Order Stickied Topics
Post by: Nodaz on July 01, 2009, 06:15:33 AM
Ok, so now when the mod is applied, and i try to post a new topic OR hit the "order sticky topics" control
I get this:
Fatal error: Cannot redeclare template_orderstickiedtopics() (previously declared in /home/subfolderar/public_html/Sources/Load.php(1726) : eval()'d code:1192) in /home/subfolderar/public_html/Sources/Load.php(1726) : eval()'d code on line 1295

If I uninstall it, i am able to post, bu the "order sticky topics" control remains visible.

Also my twitter mod no longer works.

Should i put the old post.php back and "start over" so to speak?

should i install the mods again before doing so?
Title: Re: Order Stickied Topics
Post by: SWR on July 26, 2009, 08:20:42 PM
Any chance this could be upgraded or edited for 1.1.10?
Title: Re: Order Stickied Topics
Post by: [A-US]James246 on July 27, 2009, 05:12:26 AM
Where can I find the 'MessageIndex.template.php' and 'Post.template.php' files?

Thanks!
Title: Re: Order Stickied Topics
Post by: TurtleKicker on August 06, 2009, 04:01:56 PM
Won't install on 1.1.10. Get the error: "The package you are trying to download or install is either corrupt or not compatible with this version of SMF."

According to the package-info.xml, it's not the version check... should be good through 1.99.99 ;)
Title: Re: Order Stickied Topics
Post by: Garou on August 06, 2009, 11:35:55 PM
Quote from: sremick on August 06, 2009, 04:01:56 PM
According to the package-info.xml, it's not the version check... should be good through 1.99.99 ;)
Actually it is the version check. Mathematically .1 and .10 is the same thing, so when the package reads as 1.1.4 through 1.99.99 SMF is throwing it out as it thinks its really 1.1.1 and not 1.1.10

Change
<install for="1.1.4 - 1.99.99"> and <uninstall for="1.1.4 - 1.99.99">

to
<install for="1.1.1 - 1.99.99"> and <uninstall for="1.1.1 - 1.99.99">
Title: Re: Order Stickied Topics
Post by: TurtleKicker on August 10, 2009, 10:09:11 AM
Quote from: Garou on August 06, 2009, 11:35:55 PM
Actually it is the version check. Mathematically .1 and .10 is the same thing, so when the package reads as 1.1.4 through 1.99.99 SMF is throwing it out as it thinks its really 1.1.1 and not 1.1.10

Well that's a pretty serious bug then. If SMF is going to have a defined version check inside its standard packaging format, it should at least be able to handle the standard versioning format.
Title: Re: Order Stickied Topics
Post by: Altair on August 10, 2009, 11:23:20 PM
I am surprised that this is a Mod and not an actual feature of SMF. It's really odd to have stickies, but no way to organize them.

Onto my question. Will this end up working for SMF 2.0 Final?
Title: Re: Order Stickied Topics
Post by: Altair on August 16, 2009, 05:35:46 PM
Bump.
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 16, 2009, 11:38:15 PM
Sorry about not replying to any of these support requests, been a bit busy.

Quote from: Altair on August 10, 2009, 11:23:20 PM
Onto my question. Will this end up working for SMF 2.0 Final?

Yes, I will definitely have this mod working with SMF 2 Final. I am planning on updating it, with AJAX/js for the list order changing, when Curve finally comes out with SMF 2 RC2.
Title: Re: Order Stickied Topics
Post by: Altair on August 17, 2009, 02:09:59 PM
Quote from: Nathaniel on August 16, 2009, 11:38:15 PM
Sorry about not replying to any of these support requests, been a bit busy.

Quote from: Altair on August 10, 2009, 11:23:20 PM
Onto my question. Will this end up working for SMF 2.0 Final?

Yes, I will definitely have this mod working with SMF 2 Final. I am planning on updating it, with AJAX/js for the list order changing, when Curve finally comes out with SMF 2 RC2.

It's cool. Some things come before others.

Awesome! Will you also be incorporating it into the permissions this time around?
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 17, 2009, 05:48:34 PM
Quote from: Altair on August 17, 2009, 02:09:59 PM
Awesome! Will you also be incorporating it into the permissions this time around?

I'm not sure what you mean, although I haven't looked over this mod for a while. It does use the sticky permission...
Title: Re: Order Stickied Topics
Post by: Altair on August 17, 2009, 10:30:53 PM
Quote from: Nathaniel on August 17, 2009, 05:48:34 PM
Quote from: Altair on August 17, 2009, 02:09:59 PM
Awesome! Will you also be incorporating it into the permissions this time around?

I'm not sure what you mean, although I haven't looked over this mod for a while. It does use the sticky permission...

I think I was playing around with my membergroups at one point and found out that Global Mods can't use it or something like that. Cause it wasn't in their permissions. I can check again, but I dunno.
Title: Re: Order Stickied Topics
Post by: Nathaniel on August 18, 2009, 02:17:07 AM
Quote from: Altair on August 17, 2009, 10:30:53 PM
I think I was playing around with my membergroups at one point and found out that Global Mods can't use it or something like that. Cause it wasn't in their permissions. I can check again, but I dunno.

This mod uses the default permission that allows users to sticky posts. There shouldn't be any issues as long as you have set the permissions correctly.
Title: Re: Order Stickied Topics
Post by: Lolafish on September 22, 2009, 09:59:04 PM
I'm running v. 1.1.10, so made the version modifications and thought I had it in the bag.  The buttons showed up and were clickable..but as soon as I was transferred to the page that shows the tables for reordering, it caused an error.  I did all the suggestions for the mod from the mod site (the TROUBLESHOOTING area), but it didn't help, and also caused my forum's posting to stop working so had to replace the files with the originals again. I'm running the default theme, so don't understand why all the hassle.  I had a custom theme a few months ago and it worked like a charm.  But now the default theme is giving me a hard time.   :'(
Title: Re: Order Stickied Topics
Post by: Lolafish on September 24, 2009, 09:22:07 PM
Does anyone know if my 1.1.10 version is just not compatible with this mod? I love this mod. I need it sooooooooooooo bad.   ;D

Do I need 2.0 to get it to work?
Title: Re: Order Stickied Topics
Post by: Garou on September 26, 2009, 09:40:55 AM
Quote from: Garou on August 06, 2009, 11:35:55 PM
Quote from: sremick on August 06, 2009, 04:01:56 PM
According to the package-info.xml, it's not the version check... should be good through 1.99.99 ;)
Actually it is the version check. Mathematically .1 and .10 is the same thing, so when the package reads as 1.1.4 through 1.99.99 SMF is throwing it out as it thinks its really 1.1.1 and not 1.1.10

Change
<install for="1.1.4 - 1.99.99"> and <uninstall for="1.1.4 - 1.99.99">

to
<install for="1.1.1 - 1.99.99"> and <uninstall for="1.1.1 - 1.99.99">

Modify the package-info.xml drop it back into your zip file, upload that to your site, then install. After that the only other reason that this mod wouldn't work properly is if it installed incorrectly due to conflicts with other mods, in which case you will have to install those files manually.
Title: Re: Order Stickied Topics
Post by: Lolafish on September 26, 2009, 01:29:25 PM
Quote from: Garou on September 26, 2009, 09:40:55 AM
After that the only other reason that this mod wouldn't work properly is if it installed incorrectly due to conflicts with other mods, in which case you will have to install those files manually.

Yep, we know that.  Installed it manually twice now, once on v. 1.1.9 and got it to work, and again on 1.1.10 and it won't work.

I'm so depressed. I wish I understood php coding better so I could figure this out on my own.  :(
Title: Re: Order Stickied Topics
Post by: Garou on September 26, 2009, 10:07:05 PM
I don't know what to tell you. I made the changes to the install file I mentioned earlier, uploaded it to a 1.1.10 site, installed it, and it worked like a charm.

If you do that and its failing make a note of what files are failing on install and attach them here. I can make the changes to those files for you and we can see what happens then.

The only other thing I know to do is find someone that does know how to code and get them to work directly on your site (sometime they want to be paid for that). Just be sure to check them out before giving them access to your site. Not everyone that offers those services, free or paid, is honest and some have been know to hack a site that they have worked on. :(
Title: Re: Order Stickied Topics
Post by: Lolafish on September 27, 2009, 01:40:45 AM
Quote from: Garou on September 26, 2009, 10:07:05 PM
I don't know what to tell you. I made the changes to the install file I mentioned earlier, uploaded it to a 1.1.10 site, installed it, and it worked like a charm.

If you do that and its failing make a note of what files are failing on install and attach them here. I can make the changes to those files for you and we can see what happens then.

I might just wait until I upgrade to SMF 2.0 and try again.  It's such a PIA.  I was really close, but no banana.  I'd have to shut down my forum to try again, and I am too lazy to do it anytime soon.  ;)

I'll report back when I'm on the new version. Thank you!
Title: Re: Order Stickied Topics
Post by: Nodaz on September 29, 2009, 02:29:54 AM
Quote from: Garou on August 06, 2009, 11:35:55 PM
Quote from: sremick on August 06, 2009, 04:01:56 PM
According to the package-info.xml, it's not the version check... should be good through 1.99.99 ;)
Actually it is the version check. Mathematically .1 and .10 is the same thing, so when the package reads as 1.1.4 through 1.99.99 SMF is throwing it out as it thinks its really 1.1.1 and not 1.1.10

Change

<install for="1.1.4 - 1.99.99"> and <uninstall for="1.1.4 - 1.99.99">

to
<install for="1.1.1 - 1.99.99"> and <uninstall for="1.1.1 - 1.99.99">

I made these changes, and the mod uploaded and installed fine. 
When i tried to use it  received this error:
Fatal error: Cannot redeclare template_orderstickiedtopics() (previously declared in /home/abcdefgar/public_html/Sources/Load.php(1730) : eval()'d code:1192) in /home/abcdefgar/public_html/Sources/Load.php(1730) : eval()'d code on line 1295

I read on the mods page that that" the edits below are only necessary if your custom theme has the 'Post.template.php' or 'MessageIndex.template.php' template files."

My theme has neither ( outline from dziner)
Ideas as to what may be happening?
Title: Re: Order Stickied Topics
Post by: Sabre™ on September 29, 2009, 04:05:39 AM
You have the code twice, or maybe even more times in your templates.
This error probably stems from your Post.template.php, so check that, and remove the duplicate code.

You should also go over the other templates this mod alters and check if they have multiple occurances of the code also.
Title: Re: Order Stickied Topics
Post by: Nodaz on September 29, 2009, 02:29:55 PM
not sure what you mean...what code is duplicated?
Title: Re: Order Stickied Topics
Post by: Sabre™ on September 29, 2009, 02:52:43 PM
Look in your Post.template.php at the bottom, and if there is more than one occurrence of this code, then delete the duplicates.


// Function to display the list of stickiedtopics.
function template_orderstickiedtopics()
{
global $context, $txt, $board_info, $scripturl, $settings;

// Show the start of the table, as well as the main heading and the column headings.
echo '
<br />
<table border="0" align="center" cellspacing="1" cellpadding="4" class="bordercolor" width="60%">
<tr class="catbg3">
<td colspan="5" align="left">
<div style="float: left;">
<b>', $txt['OrderStickiedTopics_title'] ,'</b> - <a href="' . $scripturl . '?board=', $context['current_board'], '.0">', $board_info['name'], '</a>
</div>
</td>
</tr>
<tr class="titlebg">
<th>', $txt[70], '</th>
<th>', $txt['OrderStickiedTopics_current'], '</th>
<th>', $txt['OrderStickiedTopics_modify'], '</th>
</tr>';

// Show a list of the topics.
foreach($context['topics'] as $topic)
{
echo '
<tr>
<td align="left" valign="top" class="windowbg"><b><a href="', $scripturl, '?topic=', $topic['id'], '.0">', $topic['title'], '</a></b></td>
<td align="left" valign="top" class="windowbg2" style="text-align:center;">', $topic['value'], '</td>
<td align="center" valign="top" class="windowbg2">
<a href="', $scripturl, '?action=orderstickiedtopics;topic=', $topic['id'],';decrease"><img src="', $settings['images_url'], '/sort_down.gif" alt="', $txt['OrderStickiedTopics_decrease'], '" border="0" /></a>
<a href="', $scripturl, '?action=orderstickiedtopics;topic=', $topic['id'],';increment"><img src="', $settings['images_url'], '/sort_up.gif" alt="', $txt['OrderStickiedTopics_increase'], '" border="0" /></a>
&nbsp;&nbsp;&nbsp;<a href="', $scripturl, '?action=orderstickiedtopics;topic=', $topic['id'],';unsticky">', $txt['OrderStickiedTopics_unsticky'], '</a>
</td>
</tr>';
}

// If we have no topics, then show a short message telling the moderator.
if(empty($context['topics']))
echo '
<tr>
<td colspan="3" valign="top" class="windowbg">', $txt['OrderStickiedTopics_emptylist'], '</td>
</tr>';

// Finish the table.
echo '
<tr class="catbg3">
<td colspan="5" align="left">
<b style="font-size:14px;"><a href="', $scripturl, '?board=', $context['current_board'], '.0">', $txt['OrderStickiedTopics_back'], ' ', $board_info['name'], '</a></b>
</td>
</tr>
</table>';
}
Title: Re: Order Stickied Topics
Post by: Nodaz on September 29, 2009, 06:44:05 PM
Where is the post.template.php? 
As i said before, the theme i am using does not have it, and i cant find it anywhere else.
EDIT: found it in the default folder...the mod was uninstalled but the code was there, so i deleted it.
Reinstalled the mod and BINGO, works like a charm.
Thanks much !
Title: Re: Order Stickied Topics
Post by: Sabre™ on September 29, 2009, 08:47:37 PM
My pleasure mate. :)
I should have actually given you specific details as to where to find the file.
There may also be duplicate code in other templates this mod alters, so it may pay to check them as well.
Title: Re: Order Stickied Topics
Post by: Nodaz on October 02, 2009, 06:51:58 AM
very good, i will check the  other templates.
Again, i appreciate your attention to this !
Title: Re: Order Stickied Topics
Post by: FragaCampos on October 02, 2009, 02:34:58 PM
Thank you Nathaniel for yet another handy mod ;)

I installed it with no errors and everything seems fine. Still, i did find one problem. When i try to change the sticky posts' order, i'm only able to use the up arrow, if i try to use the down arrow, nothing happens... i can workaround only with the up arrow, but maybe something is wrong?  ::)
Title: Re: Order Stickied Topics
Post by: Nodaz on October 02, 2009, 06:36:21 PM
Quote from: FragaCampos on October 02, 2009, 02:34:58 PM
Thank you Nathaniel for yet another handy mod ;)

I installed it with no errors and everything seems fine. Still, i did find one problem. When i try to change the sticky posts' order, i'm only able to use the up arrow, if i try to use the down arrow, nothing happens... i can workaround only with the up arrow, but maybe something is wrong?  ::)
I just double checked my installed and the arrows work both directions.
Title: Re: Order Stickied Topics
Post by: Nathaniel on October 02, 2009, 07:14:27 PM
Quote from: FragaCampos on October 02, 2009, 02:34:58 PM
Thank you Nathaniel for yet another handy mod ;)

I installed it with no errors and everything seems fine. Still, i did find one problem. When i try to change the sticky posts' order, i'm only able to use the up arrow, if i try to use the down arrow, nothing happens... i can workaround only with the up arrow, but maybe something is wrong?  ::)

I'm glad you like the mod.

Did you receive any install errors when you tried to install the mod?
Title: Re: Order Stickied Topics
Post by: FragaCampos on October 02, 2009, 09:13:02 PM
Nope, no install errors.

Ok, i got it... it only does something when the values are all different of 1... :P
I have to change the values, and than change the position, right?
Anyways, it's working, so everything's fine. Thanks!
Title: Re: Order Stickied Topics
Post by: Nathaniel on October 02, 2009, 10:07:46 PM
Quote from: FragaCampos on October 02, 2009, 09:13:02 PM
Nope, no install errors.

Ok, i got it... it only does something when the values are all different of 1... :P
I have to change the values, and than change the position, right?
Anyways, it's working, so everything's fine. Thanks!

That sounds correct, you can't decrease the order value of a sticky, if its already on 1. ;)

The system with a 'value' annoys me, its one of the things which I will change when I update the mod when SMF 2 RC2 comes out. It should be easier than that. ;)
Title: Re: Order Stickied Topics
Post by: Spoogs on October 12, 2009, 07:26:21 PM
I havent tried to install this mod as yet... just curious to know if its compatible with 2.0 RC1.2
Title: Re: Order Stickied Topics
Post by: Robbo_ on December 03, 2009, 11:16:30 PM
Are you planning on updating this to RC2 anytime soon? If not I will do it for you.
Title: Re: Order Stickied Topics
Post by: Nathaniel on December 06, 2009, 08:06:56 PM
Quote from: Robbo_ on December 03, 2009, 11:16:30 PM
Are you planning on updating this to RC2 anytime soon? If not I will do it for you.

I am planning an upgrade, although I am not sure when I will get around to doing it.
Title: Re: Order Stickied Topics
Post by: Robbo_ on December 06, 2009, 08:09:59 PM
Well if you haven't done it by the time I need it done by then I'll send you the package when I update it if you want.
Title: Re: Order Stickied Topics
Post by: SgtMic on December 10, 2009, 03:09:41 PM
Would love to see an updated version for 2.0
Title: Re: Order Stickied Topics - 1.1.11?
Post by: jantila on January 02, 2010, 01:10:51 PM
Any idea how this could work on 1.1.11? Anyone succeeded? Any plans for an update?
Title: Re: Order Stickied Topics - 1.1.11?
Post by: gbsothere on January 02, 2010, 04:08:32 PM
Quote from: jantila on January 02, 2010, 01:10:51 PM
Any idea how this could work on 1.1.11? Anyone succeeded? Any plans for an update?


You can use the parsing instructions for 1.1.10 on your 1.1.11 forum.  I have this on both my 1.1.11 forums and it works just fine. 

:)
Title: Re: Order Stickied Topics
Post by: Matthew K. on January 05, 2010, 06:37:41 PM
Nathaniel - Just wanted to let you know that the edits for 1.1.10 work perfectly with 1.1.11.
Title: Re: Order Stickied Topics
Post by: Matthew K. on January 05, 2010, 06:55:39 PM
Updated the Package for you. Attached, you can change something if you want or review it.

Added file: modifications_smf1.1.11.xml with the edits for the 1.1 that work.
Added the proper information to package-info.xml to include 1.1.11.

Labradoodle-360
Title: Re: Order Stickied Topics
Post by: Arantor on January 05, 2010, 07:39:37 PM
It should be noted that just updating others' mods isn't always appreciated by their authors, especially as it's a breach of their copyright.

Generally just providing instructions is OK though.
Title: Re: Order Stickied Topics
Post by: Matthew K. on January 05, 2010, 07:45:49 PM
As the edits are the same from 1.1.10 to 1.1.11 I only added it to the package-info and added the ORIGINAL edits for him. I updated no edits or other mod content.
Title: Re: Order Stickied Topics
Post by: Matthew K. on January 05, 2010, 07:47:09 PM
I could see if even one of the edits was different, however, that's no the case in this scenario.
Title: Re: Order Stickied Topics
Post by: Arantor on January 05, 2010, 07:48:08 PM
It doesn't matter - mod authors don't normally like their files being redistributed outside of the mod site.

Please note you do have an edit button, no need to double post.
Title: Re: Order Stickied Topics
Post by: khamseen on January 09, 2010, 06:02:38 PM
Any word on a version for 2.0 RC2 yet by any chance?
Title: Re: Order Stickied Topics
Post by: gastan on February 05, 2010, 12:56:28 PM

Problem solved.  Thanks.
Title: Re: Order Stickied Topics
Post by: C4G-TK on February 21, 2010, 03:06:16 AM
Quote from: khamseen on January 09, 2010, 06:02:38 PM
Any word on a version for 2.0 RC2 yet by any chance?

Nope, but if you get it working on RC2, let me know how you did it, please!
Title: Re: Order Stickied Topics
Post by: gmoneyluv on March 02, 2010, 08:00:43 AM
Hey folks,

I'm trying to upload the modded package from Labradoodle-360 for my smf 1.1.11 forum and i'm getting the error message that the "The package you tried to upload either is not a valid package or has become corrupted."

Any idea what's going on?

Thanks 
Title: Re: Order Stickied Topics
Post by: aprild on March 02, 2010, 01:56:50 PM
Quote from: gmoneyluv on March 02, 2010, 08:00:43 AM
Hey folks,

I'm trying to upload the modded package from Labradoodle-360 for my smf 1.1.11 forum and i'm getting the error message that the "The package you tried to upload either is not a valid package or has become corrupted."

Any idea what's going on?

Thanks

I've downloaded both versions and have tried to install both with the same error message.

I don't think it's me because I can download then upload and install other approved .tar.gz files just fine.
Title: Re: Order Stickied Topics
Post by: gmoneyluv on March 02, 2010, 04:40:49 PM
Yeah, i have no problem uploading other mods.

Title: Re: Order Stickied Topics
Post by: Joker™ on March 03, 2010, 02:33:01 AM
working perfectly fine on RC2

i just tested it on my test site....

it'll give u error in /sorces/MessageIndex.php

Just do these edits in it

Find:
$context['can_post_poll'] = $modSettings['pollMode'] == '1' && allowedTo('poll_post') && $context['can_post_new'];

Add After:
// Add the 'can_order_stickied_topics' permission, for the Order Stickied Topics mod.
$context['can_order_stickied_topics'] = allowedTo('make_sticky') && !empty($modSettings['enableStickyTopics']);


It working properly on Default curve theme ....
Title: Re: Order Stickied Topics
Post by: aprild on March 04, 2010, 12:37:35 PM
NEVERMIND!! I did it myself!!

I had to do the changes by hand, and remember to put things that modify in the default theme into the code files of the theme I was using... BUT IT WORKED.

THANK GOD, I thought I was going to go crazy!
Title: Re: Order Stickied Topics
Post by: MATTEK on April 28, 2010, 07:07:30 PM
Please update for RC3!!

This is a very valuable mod!  ;D

On a side note; Do you think it's safe to install the mod and test it even though a few tests failed?
Title: Re: Order Stickied Topics
Post by: Arantor on April 28, 2010, 07:08:10 PM
I doubt it will work properly, I'd avoid it unless you're willing to edit code manually to fix it up.
Title: Re: Order Stickied Topics
Post by: MATTEK on April 28, 2010, 07:23:27 PM
Quote from: Arantor on April 28, 2010, 07:08:10 PM
I doubt it will work properly, I'd avoid it unless you're willing to edit code manually to fix it up.
I am willing to insert the edits. I just don't know how to create the edits properly.
Title: Re: Order Stickied Topics
Post by: Arantor on April 28, 2010, 07:25:00 PM
That's the problem, no-one who does has sat down to do it.
Title: Re: Order Stickied Topics
Post by: MATTEK on April 29, 2010, 03:52:10 PM
Quote from: Arantor on April 28, 2010, 07:25:00 PM
That's the problem, no-one who does has sat down to do it.

Damn. Well....this could be very useful. Hope someone does it.
Title: Re: Order Stickied Topics
Post by: TAB004 on May 03, 2010, 02:55:46 PM
1.1.11

I don't know if support for this mod is ongoing; but I have installed it according to the parser instructions on the mod download page.

I see no "Order Sticky Topics" button. I went to "/index.php?action=orderstickiedtopics;board=1.0" for my site, and:

"An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you."  :o

Help???  ???
Title: Re: Order Stickied Topics
Post by: Sad_Angel on July 04, 2010, 01:32:51 PM
Mod for version RC3 is available? i tried to install it but test MessageIndex.php is failing.
Title: Re: Order Stickied Topics
Post by: gbsothere on July 04, 2010, 06:18:19 PM
Quote from: TAB004 on May 03, 2010, 02:55:46 PM
1.1.11

I don't know if support for this mod is ongoing; but I have installed it according to the parser instructions on the mod download page.

I see no "Order Sticky Topics" button. I went to "/index.php?action=orderstickiedtopics;board=1.0" for my site, and:

"An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you."  :o

Help???  ???



Are you using a custom theme and, if so, did you modify the templates for that theme? 
Title: Re: Order Stickied Topics
Post by: BYUFanatic on July 26, 2010, 06:28:28 PM
If anyone has this mod (or a similar mod) working on 2.0 RC3 please let me know. I am a teacher and used this mod to order stickies for important announcements/assignments for my students.

Thanks!

Rob
Title: Re: Order Stickied Topics
Post by: C4G-TK on July 26, 2010, 07:36:40 PM
Yes, I have it working on RC3.

I used the package updated by member in Reply #163
I only had 1 error which was the 1st edit MessageIndex.php which I fixed manually using reply #174.
In my notes, it says that I emulated RC2 when installing as well.

I've used the mod and it is working for me.
Title: Re: Order Stickied Topics
Post by: BYUFanatic on July 26, 2010, 09:38:21 PM
Quote from: C4G-TK on July 26, 2010, 07:36:40 PM
Yes, I have it working on RC3.

I used the package updated by member in Reply #163
I only had 1 error which was the 1st edit MessageIndex.php which I fixed manually using reply #174.
In my notes, it says that I emulated RC2 when installing as well.

I've used the mod and it is working for me.

Thanks for the help! I also had to do a little bit of extra tweaking (MessageIndex.Template.php because I don't use the default theme) but it works great now! Just like it did before. Whew!

Rob
Title: Re: Order Stickied Topics
Post by: C4G-TK on December 07, 2010, 12:55:48 PM
Quote from: C4G-TK on July 26, 2010, 07:36:40 PM
Yes, I have it working on RC3.

I used the package updated by member in Reply #163
I only had 1 error which was the 1st edit MessageIndex.php which I fixed manually using reply #174.
In my notes, it says that I emulated RC2 when installing as well.

I've used the mod and it is working for me.

For RC4, do the same thing as posted previously.
Title: Re: Order Stickied Topics
Post by: technicolorpunky on December 21, 2010, 04:54:55 PM
I know this has probably been done, over and over, but I need help.

I'm currently running 1.1.11, using the theme Lil_MC.
After a few frustrations and a bit of tweaking, I have successfully installed this mod.
Only problem is, there's no button for it.  I've tried adding the code for showing the link for Order Stickied Topics, but I end up with a Parse Error, and I have no idea how to fix it.  I've looked through this thread several times, trying several different things to get the button to show up, and every time I seem to screw it up lol.
My forum is http://ludlow.poison-lesson.org/forum/index.php

I've tried going to that orderstickiedtopics board=1.0 thing lol, and it brings up Error, this board appears to be missing or off-limits to you.

I love this mod, I've used it before on earlier forums, and I'm desperate for it now lol.

I've attached my MessageIndex template in the hopes that someone noble and wise here can help me!

Edit: And if I've put this in the wrong place, let me know and I'll move it.
Title: Problem with a Mod.
Post by: technicolorpunky on December 22, 2010, 07:27:33 PM
I posted this in the thread for the mod, Order Stickied Topics, and haven't had a reply.  I'm desperate to get this working!

I'm currently running 1.1.11, using the theme Lil_MC.
After a few frustrations and a bit of tweaking, I have successfully installed this mod.
Only problem is, there's no button for it.  I've tried adding the code for showing the link for Order Stickied Topics, but I end up with a Parse Error, and I have no idea how to fix it.  I've looked through this thread several times, trying several different things to get the button to show up, and every time I seem to screw it up lol.
My forum is http://ludlow.poison-lesson.org/forum/index.php

I've tried going to that orderstickiedtopics board=1.0 thing lol, and it brings up Error, this board appears to be missing or off-limits to you.

I love this mod, I've used it before on earlier forums, and I'm desperate for it now lol.

I've attached my MessageIndex template in the hopes that someone noble and wise here can help me!
Title: Re: Problem with a Mod.
Post by: Spoogs on December 22, 2010, 07:41:59 PM
seems you've already made the edits there

note the files that need to be modified are different

look at ./sources/messageindex.php
Title: Re: Problem with a Mod.
Post by: technicolorpunky on December 22, 2010, 08:00:34 PM
What do I need to modify in that file?  I had a quick look at it, and found it had this:

Quote//   Add the 'can_order_stickied_topics' permission, for the Order Stickied Topics mod.
   $context['can_order_stickied_topics'] = allowedTo('make_sticky') && !empty($modSettings['enableStickyTopics']);
   $context['can_moderate_forum'] = allowedTo('moderate_forum');

At line 154-156.  Is there anything else that needs to be added or adjusted?
Title: Re: Problem with a Mod.
Post by: Spoogs on December 22, 2010, 08:12:13 PM
Switch to the smf default theme and see if its working
Title: Re: Problem with a Mod.
Post by: technicolorpunky on December 22, 2010, 08:18:23 PM
Yes, it works perfectly fine in the default theme.  So, that means it's something in the theme I'm using that needs to be adjusted?
Title: Re: Problem with a Mod.
Post by: Spoogs on December 22, 2010, 08:22:50 PM
make the edits made to themes/default/messageindex.template.php to themes/your theme/messageindex.template.php if you theme has one
Title: Re: Problem with a Mod.
Post by: technicolorpunky on December 22, 2010, 08:31:47 PM
What I attached in my initial post was the messageindex.template for the theme I was using.  I copied what I had in the default post, to the Lil_MC post, and got this error when I go to a board that has stickies on it:

syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'

which is what happened before when I tried to fix it!  Ergh what have I done wrong? lol
Title: Re: Problem with a Mod.
Post by: Spoogs on December 22, 2010, 08:40:37 PM
Quote from: technicolorpunky on December 22, 2010, 08:31:47 PM
I copied what I had in the default post, to the Lil_MC post
What do you mean here?
Title: Re: Problem with a Mod.
Post by: technicolorpunky on December 22, 2010, 08:43:45 PM
I found the section what I had quote in the earlier post -points up- in the messageindex.template from the default theme.  I copied that, and posted it in the messageindex.template from the Lil_MC theme.

Then I went to test it, and got the Template Parse Error.
Title: Re: Problem with a Mod.
Post by: mashby on December 22, 2010, 08:43:56 PM
Can you try this? Download MessageIndex.template.php from that theme to your computer and then delete it from your server via FTP. However, I looked at the file you attached and I don't see any issue with the edits you made unless you made other edits to said file. Is there a line referenced in this?

syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'
Title: Re: Problem with a Mod.
Post by: technicolorpunky on December 22, 2010, 08:48:44 PM
No there wasn't a line referenced.  Should I delete it completely and upload a clean file and start again?  Or just delete it and leave it without that file?

Edit:  Whoa.  I just deleted the file completely, and now I can see the button and it appears to work fine!  How the heck does that work?  Or should I just be grateful and not say anything? lol  To be a perfectly normal functioning theme, does it need that file?
Title: Re: Problem with a Mod.
Post by: Spoogs on December 22, 2010, 08:54:47 PM
Usually when a certain file is not included in a custom theme the default is used.
Title: Re: Problem with a Mod.
Post by: technicolorpunky on December 22, 2010, 08:55:20 PM
Awesome, I'm forever grateful!  Thank You so much!
Title: Re: Order Stickied Topics
Post by: winky100 on April 27, 2011, 10:32:29 PM
I am using smf 2.0rc3.

I tried to install the Order Stickied Topics mod today and it would not install and gave me the message it needed smf 2.0 beta 3.1.

Title: Re: Order Stickied Topics
Post by: Garou on April 28, 2011, 06:17:01 AM
first as stated on the mod page...
Latest Version:1.01
Compatible With:1.1.5, 1.1.6, 1.1.7, 2.0 Beta 3.1 Public, 2.0 Beta 4

second update to rc5 you are putting your site at a security risk.

lastly if you search the thread you'll find this post...
Quote from: Joker™ on March 03, 2010, 02:33:01 AM
working perfectly fine on RC2

i just tested it on my test site....

it'll give u error in /sorces/MessageIndex.php

Just do these edits in it

Find:
$context['can_post_poll'] = $modSettings['pollMode'] == '1' && allowedTo('poll_post') && $context['can_post_new'];

Add After:
// Add the 'can_order_stickied_topics' permission, for the Order Stickied Topics mod.
$context['can_order_stickied_topics'] = allowedTo('make_sticky') && !empty($modSettings['enableStickyTopics']);


It working properly on Default curve theme ....
Title: Re: Order Stickied Topics
Post by: winky100 on April 28, 2011, 09:47:42 PM
I got this to install but it was a real pain in the butt and it did not work when I did get it installed.

To get this to install I needed to edit the modifications_smf2.xml file.

The modification to the MessageIndex.php file was incorrectly specified in the modifications_smf2.xml file.
I needed to add " && $context['can_post_new'];" to the search operation.

In my MessageIndex.php file the searched for code had that extra bit on the end ( && $context['can_post_new']; )

After making that edit i had to recreate a .tar.gz file.
To recreate the .tar.gz file I copied the directory over to linux and did a tar cvf  tarfile dir and gzip tarfile.

Tried to uninstall it and got a sea of red.

Title: Re: Order Stickied Topics
Post by: Arantor on April 28, 2011, 09:55:26 PM
Quote from: winky100 on April 28, 2011, 09:47:42 PM
I got this to install but it was a real pain in the butt and it did not work when I did get it installed.

...

THIS MOD SHOULD BE AVOIDED!

It works fine on the versions it claims to which predates SMF 2.0 RC1. Taking a mod, making changes to it then claiming it doesn't work... isn't really the mod's fault now, is it?
Title: Re: Order Stickied Topics
Post by: Spoogs on April 28, 2011, 10:02:33 PM
Also works perfectly on later versions if the correct edits are made
Title: Re: Order Stickied Topics
Post by: winky100 on April 28, 2011, 10:31:36 PM
Well I can tell you that there needs to be more edits than the one to MessageIndex.php.

Also, for my case the edit presented was not correct.

In my MessageIndex.php file there was an extra bit that was not in the modification file.


I do not dispute that if you make the correct edits it will work. But finding out what those correct edits are can take a long time. and then, once you do that you paint yourself into a box where you cannot upgrade the smf platform. I know this from experience because everytime I upgrade I have to enter the same edits ( a lot of them) to get Aeva Media to work properly.

Overall, its a bad idea to make individual edits to get a particular mod to work, but sometimes you cant avoid it.

This orderstickytopic is one that I might be willing to make those edits for but I need to know all of those edits.
Title: Re: Order Stickied Topics
Post by: Arantor on April 28, 2011, 10:33:40 PM
QuoteIn my MessageIndex.php file there was an extra bit that was not in the modification file.

I wonder why that is... given that it was written for a version of SMF that's a couple of years older than your version of SMF...
Title: Re: Order Stickied Topics
Post by: Garou on April 29, 2011, 08:28:43 AM
winky100, I'm using the fix above on several sites and it works. You just install the current version of the mod, tell it to install with errors and then add the code. Actually for my own uses I edited the package itself so its easier to install on multiple sites.

If its not working for you there could possibly be a conflict with another mod.
Title: Re: Order Stickied Topics
Post by: winky100 on May 01, 2011, 09:45:38 AM
I finally did get this mod installed and I have to say it is very very cool the way it works. I like it a lot. It is simple and elegant!

Title: Re: Order Stickied Topics
Post by: habakuk on May 15, 2011, 06:50:10 AM
Just in case someone wants to apply this mod to a rc5 using postgresql, there is a change required:

In Sources/post.php

The code :

$result = $smcFunc['db_query']('','
SELECT t.id_topic, t.is_sticky, m.subject
FROM ({db_prefix}topics as t)
LEFT JOIN {db_prefix}messages as m on (m.id_msg = t.id_first_msg)
WHERE is_sticky != 0
AND t.id_board = {int:board_id}
ORDER BY t.is_sticky DESC, t.id_last_msg DESC',
array(
'board_id' => $board,
)
);


should not contain the parenthesis in the FROM part. This code here works:

$result = $smcFunc['db_query']('','
SELECT t.id_topic, t.is_sticky, m.subject
FROM {db_prefix}topics as t
LEFT JOIN {db_prefix}messages as m on (m.id_msg = t.id_first_msg)
WHERE is_sticky != 0
AND t.id_board = {int:board_id}
ORDER BY t.is_sticky DESC, t.id_last_msg DESC',
array(
'board_id' => $board,
)
);



HTH
®
Title: Re: Order Stickied Topics
Post by: talidorn on August 24, 2011, 12:05:14 PM
Hey,

I'm running 2.0.

I've added this mod.  It required that I manually edit the files... idk why.

Anyway I've done that but now I have an issue.

In a board where I keep a top 10 list (all topics stickied) and I click on the ordered sticky button I get the following message.

"An Error Has Occurred!
Unable to load the 'orderstickiedtopics' template."

Any suggestions?

SOLVED:

It helps if the manual editor puts the function in the post.template.php file instead of the poll.template.php... *FACEPALM*
Title: Re: Order Stickied Topics
Post by: Phi1ip on September 16, 2011, 08:58:10 AM
This mod looks just what I need. Like the above user I am using 2.0, but unlike them I am not confident about manually messing about with files, things usually go wrong if I try :(

Is there a similar mod available which will automatically install using the package manager?  Have tried a couple but get error messages, presumably because they are not compatible with 2.0 or my theme WoW_2.0.

I am prepared to try a manual install if there is an idiots guide available. I find it very frustrating that many mod instructions assume the user has some knowledge and isn't a complete novice. Please, please for people like me assume the user has no knowledge and write an idiots guide with clear step by step instructions. It will save a lot of time and aggravation for all ;D
Title: Re: Order Stickied Topics
Post by: epseja on September 29, 2011, 07:03:43 PM
Just made a change to this mod that allows for the text entry of a value you want to assign a sticky instead of having to increment by single points.  To implement, simply add this code after the increment / decrement options in Post.template.php, replacing the unsticky line as well, which is included in the code below.  It should look like this:


<form action="', $scripturl, '?action=orderstickiedtopics;topic=', $topic['id'],';newvalue" method="post">New&nbsp;Value:&nbsp;<input name="newstickyvalue" type="text" style="width:25px;font-weight:bold;"/>&nbsp;<input type="submit" value="Set">&nbsp;&nbsp;&nbsp;<a href="', $scripturl, '?action=orderstickiedtopics;topic=', $topic['id'],';unsticky">', $txt['OrderStickiedTopics_unsticky'], '</a></form>


And then add the following to Post.php where it evaluates what to do with the sticky value.  It should look like this:

// Get a correct value to set for the 'stickyness' of this topic. :D
if(isset($_GET['unsticky']))
$value = '0';
// Increment?
elseif(isset($_GET['increment']))
$value = "is_sticky + 1";
// Decrease?
elseif(isset($_GET['decrease']))
$value = "is_sticky - 1";
// Set New Value?
elseif(isset($_GET['newvalue']))
$value = $_REQUEST['newstickyvalue'];
// If we have no valid value, then we can't do anything. :(
else
redirectexit('action=orderstickiedtopics;board='.$board.'.0');


Then, enter a value you want to set for the sticky and press the "Set" button to set it.  This works for my manual installation for 2.0.1.  Hope this information helps some of you!
Title: Re: Order Stickied Topics
Post by: Inti31 on November 09, 2011, 12:18:08 PM
nice mod - works fine now with 2.0.1 after I did one little change.

Modification-german(-utf8).php

// Text for the Order Stickied Topics Mod.
$txt['OrderStickiedTopics_title'] = 'Fixierte Themen anordnen';
$txt['OrderStickiedTopics_current'] = 'Aktueller \'Sticky\' Wert';
$txt['OrderStickiedTopics_back'] = 'Zur&#252;ck zum Thema';
$txt['OrderStickiedTopics_modify'] = '\'Sticky\' Wert &#228;ndern';
$txt['OrderStickiedTopics_unsticky'] = 'L&#246;sen';
$txt['OrderStickiedTopics_increase'] = 'h&#246;her';
$txt['OrderStickiedTopics_decrease'] = 'tiefer;';
$txt['OrderStickiedTopics_emptylist'] = 'Dieses Board hat keine fixierten Themen.';


cheers Inti31
Title: Re: Order Stickied Topics
Post by: Potassium on January 22, 2012, 08:37:09 PM
Hello,

I've installed the mod and stuff, but when I click the "order stickied topics" button, it says:

QuoteAN ERROR HAS OCCURRED!
Unable to load the 'main' template.

I am using the theme "Joli" on version SMF 2.0.1

Thank you

EDIT: Fixed the issue by starting over and using the Package Installer instead o trying to do it manually!
Title: Re: Order Stickied Topics
Post by: avepeachy on April 13, 2012, 07:56:00 PM
Ooooookay.

I am running 2.0.2 with a custom theme that is a Curve variation called Outline.

I installed this mod through the package manager and had to do some manual installation. The mod works BEAUTIFULLY and I love it... only I just now realized that I no longer have my new poll option. I am assuming that I lost it when I did the manual portion, but I don't know enough to be completely sure...

Help?
Title: Re: Order Stickied Topics
Post by: Media-Bay on August 13, 2014, 11:34:52 AM
Is there still support for this mod as i have done everything stating in editing with no such luck.
Title: Re: Order Stickied Topics
Post by: Tunicman on August 23, 2014, 09:57:44 AM
How to run this mod with SMF 2.0.8?
Title: Re: Order Stickied Topics
Post by: Steve on August 23, 2014, 10:50:22 AM
Use this one instead:

http://custom.simplemachines.org/mods/index.php?mod=3425