News:

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

Main Menu

Order Stickied Topics

Started by Nathaniel, August 09, 2008, 06:39:32 AM

Previous topic - Next topic

DSollick

Thanks again for all your help! :)

Adish - (F.L.A.M.E.R)

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..

ccbtimewiz

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..

Adish - (F.L.A.M.E.R)

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..

Nathaniel

@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?

SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

BYUFanatic

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

Adish - (F.L.A.M.E.R)

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.

BYUFanatic

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

Nathaniel

@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. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

BYUFanatic

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

Nathaniel

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.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

BYUFanatic

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

Nathaniel

@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. :)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Sabre™

A very handy mod :)
Thanks buddy
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


justjim

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

Nathaniel

The files attached should work. Although if you want a button then you will have to create your own image. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

justjim

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

Adish - (F.L.A.M.E.R)

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.

Nathaniel

@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. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Adish - (F.L.A.M.E.R)

ooo.. then why does it change its location there ? it should just change the numbers besides it isnt it ?

Advertisement: