Adding Sticky to thread just like Poll : name

by linkzy - 01-07-2015, 04:33 PM
لا إله إلا الله‎
Posts:
6,326
Joined:
Jan 2015
Likes:
296
Credits:
252
Reputation:
162
2 Years of Service
#1
OP
Posted: 01-07-2015, 04:33 PM
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:

Please register or login in order to unlock hidden content.


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:
| Monopoly- Best forever .. | Nadjib - ;) | Addicted | Senpai | Nyan | Sensei | H | fdigl |
[Image: gZD4Fba.png]

We are!
Posts:
1,044
Joined:
Jan 2015
Likes:
107
Credits:
1,858
Reputation:
25
2 Years of Service
#2
Posted: 01-07-2015, 07:38 PM
Quiet useful, but uneeded at the same time. Thanks for sharing.
Active Member
Posts:
315
Joined:
Jun 2015
Likes:
17
Credits:
1,694
Reputation:
11
Potential Scammer
1 Year of Service
#3
Posted: 01-07-2015, 07:45 PM
Well, if it's a tutorial why adding a hidden content? :noh:
[Image: 0f444f4434.png]
Newbie
Posts:
15
Joined:
Nov 2015
Likes:
0
Credits:
16
Reputation:
0
1 Year of Service
#4
Posted: 20-11-2015, 06:05 PM
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.
Novice
Prime
Posts:
38
Joined:
May 2016
Likes:
0
Credits:
0
Reputation:
0
1 Year of Service
#5
Posted: 01-05-2016, 10:51 PM
You can also use prefixes if you dont want to do any edits. Thats what I did and it looks good
The last reply on this thread is older than a month. Please do not unnecessarily bump it.
Register an account or login to reply
Create an account
Create a free account today and start posting right away. It only takes a few seconds.
Login
Log into an existing account.
1 Guest(s)