Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Changing The Way MyBB Does Threads
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #11
RE: Changing The Way MyBB Does Threads
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.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
01-05-2013 01:48 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Eric J. Offline
Junior Member
**
Posts: 8
Joined: Jan 2013
Post: #12
RE: Changing The Way MyBB Does Threads
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".
(This post was last modified: 01-05-2013 02:39 PM by Eric J..)
01-05-2013 01:59 PM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #13
RE: Changing The Way MyBB Does Threads
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...


Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 01-05-2013 03:35 PM by Sama34.)
01-05-2013 03:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Eric J. Offline
Junior Member
**
Posts: 8
Joined: Jan 2013
Post: #14
RE: Changing The Way MyBB Does Threads
Nvm, got it working with this:

PHP Code:
1
2
3
4
5
6
7
8
9
<?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

(This post was last modified: 01-05-2013 06:44 PM by Eric J..)
01-05-2013 04:32 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #15
RE: Changing The Way MyBB Does Threads
Using a css background image to get the theme picture? Nice trick.


[Image: leelink.gif]
MYBB1.6 & XThreads
01-05-2013 08:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Eric J. Offline
Junior Member
**
Posts: 8
Joined: Jan 2013
Post: #16
RE: Changing The Way MyBB Does Threads
(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?
01-06-2013 02:51 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #17
RE: Changing The Way MyBB Does Threads
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.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 01-06-2013 07:00 AM by Sama34.)
01-06-2013 06:56 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Eric J. Offline
Junior Member
**
Posts: 8
Joined: Jan 2013
Post: #18
RE: Changing The Way MyBB Does Threads
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.
01-06-2013 08:52 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #19
RE: Changing The Way MyBB Does Threads
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.

My Blog
01-06-2013 09:50 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #20
RE: Changing The Way MyBB Does Threads
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>.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 01-06-2013 10:06 AM by Sama34.)
01-06-2013 10:04 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: