Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sticky: Prefix
Author Message
Conor Calby
Posting Freak


Posts: 946
Joined: Jan 2010
Reputation: 15
Post: #1
Sticky: Prefix
Have you noticed in vBulletin how sticky threads appear like
Sticky: Thread Subject
?

Well, this is also possible in MyBB. First, take a backup of forumdisplay.php and global.lang.php incase something happens and you need to revert to the old files.

Now, open ./forumdisplay.php and find
PHP Code:
if($thread['sticky'] == "1" && !$donestickysep)
        {
            eval(
"\$threads .= \"".$templates->get("forumdisplay_sticky_sep")."\";");
            
$shownormalsep true;
            
$donestickysep true;
        }
        else if(
$thread['sticky'] == && $shownormalsep)
        {
            eval(
"\$threads .= \"".$templates->get("forumdisplay_threads_sep")."\";");
            
$shownormalsep false;
        } 
Now, add below
PHP Code:
if($thread['sticky'])
        {
            
$prefix $lang->sticky_prefix;
        } 
Now, in your ./inc/languages/english/global.lang.php

find
PHP Code:
$l['poll_prefix'] = "Poll:"
and add below that
PHP Code:
$l['sticky_prefix'] = "<em><strong>Sticky:</strong></em>"


Where you see
Quote:<em><strong>Sticky:</strong></em>
replace with whatever you want in HTML format and now when looking at a forum, all the important stickied threads will appear as Sticky: Subject

Regards,

--Conor

MyBBSource Support Team Member - MyBBSource Tutorials Team Leader
Official MyBB Support Tech
If I helped, why not rep me
05-29-2010, 11:59 PM
kdog2fast
Member


Posts: 101
Joined: Jan 2010
Reputation: 1
Post: #2
RE: Sticky: Prefix
I'm guessing this will work for both 1.6 and 1.4 correct? And thank you for the tutorial, I was trying to figure something like this out and this gave me the right idea
06-04-2010, 03:56 AM
Conor Calby
Posting Freak


Posts: 946
Joined: Jan 2010
Reputation: 15
Post: #3
RE: Sticky: Prefix
I think it should, I will confirm it tomorrow however since I have no school xD

MyBBSource Support Team Member - MyBBSource Tutorials Team Leader
Official MyBB Support Tech
If I helped, why not rep me
06-04-2010, 05:16 AM
Mikers
Tutorials Team Member


Posts: 141
Joined: Mar 2010
Reputation: 6
Post: #4
RE: Sticky: Prefix
Yes, it'll work for both 1.6 and 1.4.
06-06-2010, 10:48 AM
micro1000
Junior Member


Posts: 13
Joined: Aug 2010
Reputation: 0
Post: #5
RE: Sticky: Prefix
Nice tutorial thanks for sharing.
08-17-2010, 02:03 AM
asgard
Premium User


Posts: 4
Joined: Aug 2010
Reputation: 0
Post: #6
RE: Sticky: Prefix
thanks for sharing.
08-17-2010, 04:12 AM
Don+
Member


Posts: 64
Joined: Aug 2010
Reputation: 0
Post: #7
RE: Sticky: Prefix
It is posted before. But nice effort.
08-21-2010, 10:05 AM
1master1
Member


Posts: 88
Joined: Aug 2010
Reputation: 0
Post: #8
RE: Sticky: Prefix
add/include the ; into the php code tag of last line
02-24-2011, 09:43 AM
Conor Calby
Posting Freak


Posts: 946
Joined: Jan 2010
Reputation: 15
Post: #9
RE: Sticky: Prefix
(02-24-2011 09:43 AM)1master1 Wrote:  add/include the ; into the php code tag of last line

Fixed thanks.

MyBBSource Support Team Member - MyBBSource Tutorials Team Leader
Official MyBB Support Tech
If I helped, why not rep me
02-24-2011, 10:51 PM
fma965
Member


Posts: 78
Joined: Jul 2011
Reputation: 0
Post: #10
RE: Sticky: Prefix
thanks
08-01-2011, 05:54 AM
 




User(s) browsing this thread: