Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Prefix on Forum Index
#1
Hi guys,
I developed and just tested out on mybb 1.6 a code modification to showing up thread prefixes on forum index.

Original dev-link:
http://www.methack.it/forum/thread-modif...forum.html


Follow these simple steps and enjoy... Wink

Open /inc/functions_forumlist.php
Find:
global $fcache, $moderatorcache, $forumpermissions, $theme, $mybb, $templates, $bgcolor, $collapsed, $lang, $showdepth, $plugins, $parser, $forum_viewers;

Replace with:
global $db, $fcache, $moderatorcache, $forumpermissions, $theme, $mybb, $templates, $bgcolor, $collapsed, $lang, $showdepth, $plugins, $parser, $forum_viewers;


Find:
elseif($hideinfo != true)
{

Replace with:
elseif($hideinfo != true)
{
	/************** Show prefix on index ************ */
        // @Author: Mattia
        // @Web: www.methack.it/forum/
	// Get the thread details from the database.
	$thread = get_thread($lastpost_data['lastposttid']);
	// Get thread prefix if there is one.
	$thread['threadprefix'] = '';
	$thread['displayprefix'] = '';
	if($thread['prefix'] != 0)
	{
		$query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'");
		$threadprefix = $db->fetch_array($query);
					
		$thread['threadprefix'] = $threadprefix['prefix'].' ';
		$thread['displayprefix'] = $threadprefix['displaystyle'].' ';
	}
	/************** End show prefix ***************** */

Find:
$lastpost_subject = $full_lastpost_subject = $parser->parse_badwords($lastpost_data['lastpostsubject']);

Replace with:
$lastpost_subject = $full_lastpost_subject = $thread['threadprefix'] . $parser->parse_badwords($lastpost_data['lastpostsubject']);
Reply
#2
Approved.

Looks cool might use it sometime Smile
Thanks, Polarbear541
Reply
#3
Error.

Call to a member function simple_select() on a non-object in........................
Reply
#4
Fatal error: Call to a member function simple_select() on a non-object in /home/walkman/public_html/foro/inc/functions_forumlist.php on line 234
Exclamation MyBB-Es.Com, spanish support for MyBB Wink
Reply
#5
(09-02-2010, 01:10 AM)ozanakkaya Wrote: Error.

Call to a member function simple_select() on a non-object in........................

(09-02-2010, 07:57 PM)Walkman 5.0 Wrote: Fatal error: Call to a member function simple_select() on a non-object in /home/walkman/public_html/foro/inc/functions_forumlist.php on line 234

Sorry, i forgot writing one step. Check the new one into the first post! Sorry again!
Reply
#6
to showing the prefix you need add tis to your template
{$thread['displayprefix']}
Exclamation MyBB-Es.Com, spanish support for MyBB Wink
Reply
#7
This isn't actually a plugin, user submitted tutorials is where this belongs.
[Image: hdoE.png]
m1ne.net - coming soon
Reply
#8
I get this error.
Parse error: syntax error, unexpected $end in /mcmines.com/inc/functions_forumlist.php on line 514
Ansem Wrote:Lets admit, phpbb is a joke, smf is a joke but atleast thats a little funny, things like xmb or punbb just don't cut it and vb is like the douchbag of them all. Mybb wins.
My mods Clicky!
Reply
#9
so it works on my forum (1.6.3)
but one little thing. leave step 3 and edit the "forumbit_depth2_forum_lastpost" template
add {$thread['displayprefix']} after <span class="smalltext"> and save.
your prefixes will be shown with the right formatting and will not be a part of the url.

thanks for this little helpfully snippet

@blake
there is no $end variable in the snippet. check your code on syntax errors e.g. missing () {} or undefined variables
Reply
#10
(05-22-2011, 10:21 AM)h4ppycor3 Wrote: so it works on my forum (1.6.3)
but one little thing. leave step 3 and edit the "forumbit_depth2_forum_lastpost" template
add {$thread['displayprefix']} after <span class="smalltext"> and save.
your prefixes will be shown with the right formatting and will not be a part of the url.

thanks for this little helpfully snippet

@blake
there is no $end variable in the snippet. check your code on syntax errors e.g. missing () {} or undefined variables

Thanks for your suggest! Wink
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)