[Tutorial] Adding Thread Type (Sticky)
#1
Hello guys.
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:
		if($thread['sticky'] == "1" && !$donestickysep)
		{
			eval("\$threads .= \"".$templates->get("forumdisplay_sticky_sep")."\";");
			$shownormalsep = true;
			$donestickysep = true;
		}
		else if($thread['sticky'] == 0 && $shownormalsep)
		{
			eval("\$threads .= \"".$templates->get("forumdisplay_threads_sep")."\";");
			$shownormalsep = false;
		}

Below add:
		if($thread['sticky'])
		{
			$prefix = $lang->sticky_prefix;
		}


2- Now go to the inc/languages/english/global.lang.php and search for:
$l['poll_prefix'] = "Poll:";

Below add:
$l['sticky_prefix'] = "<strong>Sticky:</strong>";

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

Save all files and upload.


MyBB 1.6: You just need to edit the forumdisplay part.

LIVE DEMO
[Image: 468x602b.png]
Reply
#2
nice tutorial , good one
Reply
#3
I agree. It is a nice tutorial. Thanks for the share Smile
[Image: sig.gif]

Contact me in private only if you need paid help with mybb-related issues. Otherwise, please don''t, unless I invite you to. Thanks Smile
Reply
#4
Thank you guys.
[Image: 468x602b.png]
Reply
#5
Thanks a lot. i badly needed this tutorial.
Works like charm
Reply
#6
ah, nice and cute tutorial Smile
I am using image for global.lang.php
<img src=\"images/sticky.gif\" />
grabbed from from Google Images

or using Red Font color
<font color=\"red\">Sticky: </font>
Hello, Welcome to MyBB Indonesia to get local support
My 'Simple' Unique Plugin here Smile
Reply
#7
This was easy to do and worked like a dream. I was so scared as I have f ' ed up a few things when I have to go into the code. Thanks so much for the simple steps.
Reply
#8
MyBB 1.6: You just need to edit the forumdisplay part.

LIVE DEMO
[Image: 468x602b.png]
Reply
#9
Ive created a plugin to do this and other features too : http://www.mybbextras.com/showthread.php?tid=399
Reply
#10
Thank you fr the plugin. You need to pay for that. This guide is free.
[Image: 468x602b.png]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)