News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Sticky First Post (extends sticky topic)

Started by kuklovod, December 16, 2005, 01:21:28 AM

Previous topic - Next topic

CeZa


perplexed

Quote from: kuklovod on March 28, 2006, 01:38:33 PM
Can you check Themes/default/Modifications.english.php then, whether it exists and has sticky and non_sticky defined? You probably downloaded older version which did not have it, or your languagedir is not default.

It modifies/creates the $languagedir/Modifications.english.php and adds the following two lines to it:

$txt['non_sticky_topics'] = "Regular topics";
$txt['sticky_topics'] = "Sticky topics";


can you please tell me where this should be in the file and where I should add it?

Thanks

kuklovod

Any place really :) Right on the line before the last ?> would do. This file should usually be empty or with just a few lines in it, it's where mods add new strings.

ShawnX

#44
I installed this mod and it's working great!

Only one problem:

Not all of my boards have sticky topics.  The boards that do not have sticky topics shows "Sticky Topics" at the top.  It's kinda hard to explain.

For example: on a board with sticky topics, the topics are split into two groups "Sticky Topics" and "Regular Topics"  wich is a great feature, and the reason I wanted to use this mod.

The problem is that on boards without sticky topics, the header says "Sticky Topics" instead of "Regular Topics" or not having a title at all.

Here's a link to one of my boards with sticky topics. 

Here's a link to one of my boards with no sticky topics.

It makes it look like all of the topics are sticky on a board with no sticky topics.

How can I make it so that the boards with no sticky topics say "Regular Topics" or nothing at all? 

kuklovod

#45
bloodlust, you are totally right, I didn't catch this as I have stickies in all boards - bummer. Uploading versions 1.2.1 both for 1.0.7 and 1.1RC2 with this fixed, need to uninstall 1.2 before applying the fix. Thanks for the tip!

perplexed

I have this problem too but I thought it was a problem with my theme and was trying to work out why it was like that lol

perplexed

I tried to uninstall 1.2 but got the following errors :(

Uninstall Actions "Sticky First Post (extends sticky topic)":
Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Sources/Display.php    Test successful
2.    Execute Modification    ./Themes/default/Display.template.php    Test failed3.    Execute Modification    ./Themes/default/MessageIndex.template.php    Test successful
4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test failed5.    Execute Modification    ./Themes/classic/MessageIndex.template.php    Test successful
6.    Execute Modification    ./Themes/classic/Display.template.php    Test successful

kuklovod

strange, probably you modified something? Do the uninstall (ignore the warnings), after that:

In Modifications.english.php, remove two lines with "sticky" in them

In Display.template.php, find


if($context['is_sticky'] && ($message['id']==$context['topic_first_message'])) {
echo '<tr><td class="titlebg" style="padding: 3px 0px;">&nbsp;</td></tr>';
}


(or similar code, in one place) and remove all three lines.

Kavadias

#49
well i got the following (simple as it seems, but difficult to trace) problem.

I upload the 1.2.1 for the 1.0.7 smf in the packages folder and then i apply the mod. I have double and triple checked that all the files that have to be modified have permissions set correctly but whatever i do i cannot get past this screen. where it shows me that everything has to be succesful, but in a matter of fact it's not...  :-\

[nofollow]

any ideas??  :-[

kuklovod

there is a link right below this, something like "Proceed" or "Install", dont remember what it was in 1.0.x. Click it :)

Kavadias

yes i know. proceed. I am clicking it. and instead of getting on the next screen i get the same screen again... :-[

kuklovod

hm that really strange. worked without any troubles on my 1.0.7 test forum, just tried removing/installing it once more. no clue then :(

beemer

Great mod works fine in Rc2 :D

Has anyone made this work with Bloc's Helios theme.

I cant figure out where to put the code  ??? in MessageIndex.template.php or Display.template.php
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

ShawnX

Thanks kuklovod! 

Only problem is that I'm running SMF RC1, and get errors when I try to install the new version of the mod.   Not really a big deal though as I will be upgrading to SMF RC2 at the end of this month.  I'll just keep using 1.2 until then ;)

Over all a great mod! 8)

kuklovod

beemer, there are changes needed in both of the files. MessageIndex is to add separator between topics, Display to add first post on every page in multi-page topic. You can see needed changes in install.xml file.

perplexed

Quote from: kuklovod on April 08, 2006, 02:11:07 PM
strange, probably you modified something? Do the uninstall (ignore the warnings), after that:

In Modifications.english.php, remove two lines with "sticky" in them

In Display.template.php, find


if($context['is_sticky'] && ($message['id']==$context['topic_first_message'])) {
echo '<tr><td class="titlebg" style="padding: 3px 0px;">&nbsp;</td></tr>';
}


(or similar code, in one place) and remove all three lines.

I removed the text from modifications.english.php

BUT

I dont have any lines that resemble your code for the display.template.php  ???

I searched the template and the only places where the word 'sticky' appears is here:


$mod_buttons = array(
'move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),
'delete' => array('test' => 'can_delete', 'text' => 63, 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt[162] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),
'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'smf279' : 'smf280', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_locked']) ? 'smf277' : 'smf278', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),



Any suggestions?

I now have the mod uninstalled and the change made to modifications only ???


kuklovod

Try looking for this snippet then:

($message['id'] == $context['topic_first_message'])


It should be replaced with

empty($message['counter'])


All verbatim. If you don't find this one either, then all is fine and the mod is not there :) Verified by installing newer version, if installation preview says that all passed then you're fine.

perplexed

ok all seems to be well, that code wasnt there either and I installed the new version 1.2.1

Just one question... are the words 'sticky' topic meant to be at the top of the boards?  I thought it was meant to show an image with a pin in it or nothing at all?  I just see the words :(

kuklovod

Yes but if you edit Modifications.english.php and replace the words which appear there for $txt['sticky_topics'] = "..." with an "<img src='...wherever_the_pin_is.gif' />" it will show the img :)

Advertisement: