MyBB Tutorials

Adding Sticky to thread just like Poll : name

Submitted by linkzy, , Thread ID: 5421

Thread Closed
linkzy
No pressure, no diamonds
Level:
0
Reputation:
181
Posts:
5.34K
Likes:
341
Credits:
54
01-07-2015, 04:33 PM
#1
not mine.


I made this tutorial to show you how to add the thread type before the post like "Poll:" (already in MyBB).

The Poll is already in MyBB. When you create a poll the forum display will input the "Poll: THREAD NAME".

After this tutorial you will make a sticky thread and before the name it will display "Sticky: THREAD NAME".

So...lets start? =D

First of all make a backup of the ./MYBB_ROOT/forumdisplay.php and inc/languages/english/global.lang.php in case you need to back to the old files.

1- Go to ./MYBB_ROOT/forumdisplay.php and search for:


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;
        } 

Below add this:

Content locked
This content has been locked. Please login or register in order to unlock it.


save it then.

2- Now go to the inc/languages/english/global.lang.php and search for:


PHP Code:
$l['poll_prefix'] = "Poll:"

add below :

PHP Code:
$l['sticky_prefix'] = "<strong>Sticky:</strong>"

Note: You can change the "Sticky" for whatever you want to call the sticky thread (Pinned/Stickied...).

And now your done D:
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: Adding Sticky to thread just like Poll : name

Akay
We are!
Level:
0
Reputation:
28
Posts:
946
Likes:
109
Credits:
2.05K
01-07-2015, 07:38 PM
#2
Quiet useful, but uneeded at the same time. Thanks for sharing.

RE: Adding Sticky to thread just like Poll : name

-Correct
Active Member
Level:
0
Reputation:
11
Posts:
289
Likes:
17
Credits:
1.69K
01-07-2015, 07:45 PM
#3
Well, if it's a tutorial why adding a hidden content? :noh:
[Image: 0f444f4434.png]

RE: Adding Sticky to thread just like Poll : name

Maximus
Newbie
Level:
0
Reputation:
0
Posts:
14
Likes:
0
Credits:
16
20-11-2015, 06:05 PM
#4
This can actually be achieved with just a template edit Smile You can edit the template, and then style it using CSS. I will post a tutorial soon.

RE: Adding Sticky to thread just like Poll : name

Danimals
Novice
Level:
0
Reputation:
0
Posts:
37
Likes:
0
Credits:
1
01-05-2016, 10:51 PM
#5
You can also use prefixes if you dont want to do any edits. Thats what I did and it looks good

Users browsing this thread: 1 Guest(s)