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.
Great. Thanks.
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'
@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
No problem.
I only noticed it 'cause I changed all the values to say "pinned" instead of "stickied"
Nice modification, LHVWB.
Thanks for the mod man. :D
good work
nice mod
Thanks worked great and went in easy. ;) ;)
fantastic!!! works a treat!!
:D easy as 1, 2, 3!
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
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?
You most likely don't have to do any edits. Just install it and see if it'll work. :P
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 !
@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.
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?
@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.
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 :)
@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.
Thanks again for all your help! :)
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..
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..
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..
@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)
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
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.
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
@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. ;)
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>
<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
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.
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
@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. :)
A very handy mod :)
Thanks buddy
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
The files attached should work. Although if you want a button then you will have to create your own image. ;)
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
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.
@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. ;)
ooo.. then why does it change its location there ? it should just change the numbers besides it isnt it ?
Yep, can you post a screenshot of the issue that you are having?
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. :)
@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?
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?
Let me translation in to the turkish this mod
Please :D
@.: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. ;)
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 :)
version 1.1.7 is not listed as compatible, though beta 2.0 is...will this work if i upgrade?
@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. :)
Thank you !
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!
@zoula,
Hmm, I will have a think about that, AJAX would be useful there as well. ;)
LHVWB ! Take your time! I can live with the actual version. But hey, buzz me if you do it on day! ;D
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
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
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.
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.
this is great, I was looking for this, works nicely
thank you :D
Michael
How to make it compatable with babylon...??
Go to the Download page the instructions for custom these are on that page.
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'),
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;'),
@Don Pepito,
Did you have any luck with that? Do you need any more help?
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...
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
®
@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.
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
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...
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
Look in a board that has stickies. You should notice a "Order stickied topics" button right of "New topic".
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
:-\
Check the docs on the mod. It's nicely and clearly written what to check if you run into that (check the button code). ;)
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 :)
Fixed it thank you great mod by the way
Please answer me....
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>';
Cool....thx for this mod !
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
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.
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>
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. :)
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)
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(' | ', $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
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
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.
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
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
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?
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;
@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(' | ', $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".
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.
@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'
Marvellous, works a treat.
Thanks very much!
Great Mod! Worked first time!! :D
Thank you!
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.
@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.'.
Im still having problems getting the sticky topics in order, how do I manually put them in order from the database?
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.
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)
Does this one work in the Dutch Language? I installed it, get no errows. But so no button.
@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).
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?
@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 ;)).
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
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.
thanks for looking..
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. :)
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
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:
AND (t.locked = 0' . (empty($moderate_boards) ? '' : ' OR b.ID_BOARD IN (' . implode(', ', $moderate_boards)) . ')' . ')') . "
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.
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.
Ive gotten the board upgraded to 1.1.9, but i am still getting the error:
2. Execute Modification ./Sources/Post.php Test failed
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?
@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.
Thanks but that isn't the answer I was looking for. I've uninstalled this mod.
Thanks Nathaniel, i appreciate your effort.
any luck with the current post.php?
Hoping you found something in that post.php...
@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.
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?
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.
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?
If you have no other previous mods that wrote changes to post.php, then you can safely delete all the old versions.
how do i know that?
Right now the forums seems to be working without issue with the new post.php
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.
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?
Any chance this could be upgraded or edited for 1.1.10?
Where can I find the 'MessageIndex.template.php' and 'Post.template.php' files?
Thanks!
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 ;)
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">
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.
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?
Bump.
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.
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?
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...
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.
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.
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. :'(
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?
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.
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. :(
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. :(
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!
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?
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.
not sure what you mean...what code is duplicated?
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>
<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>';
}
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 !
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.
very good, i will check the other templates.
Again, i appreciate your attention to this !
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? ::)
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.
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?
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!
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. ;)
I havent tried to install this mod as yet... just curious to know if its compatible with 2.0 RC1.2
Are you planning on updating this to RC2 anytime soon? If not I will do it for you.
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.
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.
Would love to see an updated version for 2.0
Any idea how this could work on 1.1.11? Anyone succeeded? Any plans for an update?
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.
:)
Nathaniel - Just wanted to let you know that the edits for 1.1.10 work perfectly with 1.1.11.
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
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.
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.
I could see if even one of the edits was different, however, that's no the case in this scenario.
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.
Any word on a version for 2.0 RC2 yet by any chance?
Problem solved. Thanks.
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!
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
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.
Yeah, i have no problem uploading other mods.
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 ....
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!
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?
I doubt it will work properly, I'd avoid it unless you're willing to edit code manually to fix it up.
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.
That's the problem, no-one who does has sat down to do it.
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.
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??? ???
Mod for version RC3 is available? i tried to install it but test MessageIndex.php is failing.
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?
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
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.
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
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.
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.
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!
seems you've already made the edits there
note the files that need to be modified are different
look at ./sources/messageindex.php
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?
Switch to the smf default theme and see if its working
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?
make the edits made to themes/default/messageindex.template.php to themes/your theme/messageindex.template.php if you theme has one
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
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?
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.
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 ')'
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?
Usually when a certain file is not included in a custom theme the default is used.
Awesome, I'm forever grateful! Thank You so much!
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.
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 ....
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.
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?
Also works perfectly on later versions if the correct edits are made
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.
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...
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.
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!
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
®
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*
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
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 Value: <input name="newstickyvalue" type="text" style="width:25px;font-weight:bold;"/> <input type="submit" value="Set"> <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!
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ück zum Thema';
$txt['OrderStickiedTopics_modify'] = '\'Sticky\' Wert ändern';
$txt['OrderStickiedTopics_unsticky'] = 'Lösen';
$txt['OrderStickiedTopics_increase'] = 'höher';
$txt['OrderStickiedTopics_decrease'] = 'tiefer;';
$txt['OrderStickiedTopics_emptylist'] = 'Dieses Board hat keine fixierten Themen.';
cheers Inti31
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!
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?
Is there still support for this mod as i have done everything stating in editing with no such luck.
How to run this mod with SMF 2.0.8?
Use this one instead:
http://custom.simplemachines.org/mods/index.php?mod=3425