MyBB Hacks

Full Version: Changing The Way MyBB Does Threads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Well, probably you don't need any kind of hacks, you can set your DirectoryIndex to "forumdisplay.php" and force a FID using a plugin.
Alright, any suggestions on plugins that might do this for me?

@Seabody - the code you gave me didn't work, I'm getting this error:

Parse error: syntax error, unexpected T_CLASS in /home/auderic/public_html/index.php(399) : eval()'d code(19) : eval()'d code on line 10

The only changed I made was replacing "INSERT fid HERE" with "2".
Well, just create a simple plugin file with the _info() (you can find examples in any plugin) function within it and the following code at the end of the file:

PHP Code:
global $mybb;$mybb->input['fid'] == 1; // 1 = FID


The may probably be some issues in some areas (can't really think of any) but since you don't plan on using ALL the core features...

Nvm, got it working with this:

PHP Code:
<?php
$id = "0";
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads WHERE fid = 2 ORDER BY `tid`");
$threads = '';
while($thread = $db->fetch_array($query)) {
	$id++;
	$threads .= "<a href=\"showthread.php?tid={$thread['tid']}\"><div class=\"theme-listing theme-".$id."\"><div class=\"like-count\"><i class=\"icon-heart\"></i> 0</div><div class=\"theme-name\"><div class=\"float_right\"><span><i class=\"icon-eye-open\"></i> </span>{$thread['views']}<span> | <i class=\"icon-comment\"></i> </span>{$thread['replies']}</div>".htmlspecialchars_uni($thread['subject'])."</div></div></a>";
}
?>


and the outcome:

Demo: http://mybb-themes.com/index.php

Using a css background image to get the theme picture? Nice trick.
(01-05-2013 08:16 PM)leefish Wrote: [ -> ]Using a css background image to get the theme picture? Nice trick.

Yep, thanks. xD

Does anyone know what an SQL query pulling the amount of likes from the first post of a thread would look like? And I would have to do it in the while statement somehow right?
Depends on the plugin you are using. It could be better to query all likes for the threads outside the while loop.

BTW, any reason you are using item tags without a list tag? Just curious.
It would be the popular one if it's still around (By G33K).

What do you mean item tags? I used italic tags if that's what you mean. The glyph font uses them to display icons.
You're going to either need to pull the count column, if the plugin has such a thing, otherwise a COUNT and GROUP BY on the likes table.
That plugin adds a column to the posts table so you will need to query the column for the first psot of the thread (firspost=pid), this can certainly be done outside the while loop if you care about performance.

Quote:What do you mean item tags? I used italic tags if that's what you mean. The glyph font uses them to display icons.

I mean <li> without <ul/ol>.
Pages: 1 2 3
Reference URL's