Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Changing The Way MyBB Does Threads
Eric J. Offline
Junior Member
**
Posts: 8
Joined: Jan 2013
Post: #1
Changing The Way MyBB Does Threads
So, I have a pretty ambitious project I'm working on and Xthreads seems to be the only option. I'll try to explain it in as much detail as I can, and hopefully I can combine some already existing tutorials to get most of it done.

So first off, I want the index page to be a list of threads from a certain section (The forum will only have one section). I'd prefer if they could be ordered by either view count or reply count. It would be nice if each thread could have a custom class, for example class="fid1" so that I can style them on a per thread basis.

This will be a very barebones layout, simple information, users won't be able to post threads, only reply to them. They won't be able to PM, the control panel will be mostly stripped. But if I can get what I listed before, that would be a big step in the right direction.

I'd probably be better off with a different software, but I'm extremely comfortable in the MyBB ACP, and the topic of the site is MyBB so I'd love to be able to get this done with XThreads.

I have some other stuff to ask, but I'll stick with this for now.
(This post was last modified: 01-04-2013 12:06 PM by Eric J..)
01-04-2013 12:06 PM
Find all posts by this user Quote this message in a reply
Seabody Offline
Member
***
Posts: 54
Joined: Aug 2012
Post: #2
RE: Changing The Way MyBB Does Threads
Not tested this, but this should work. It's an altered version of my own query.

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$id = 0;
foreach ($id as $ids): 
$id++;
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads WHERE fid == (INSERT fid HERE) ORDER BY `tid`);
$threads = '';
while($thread = $db->fetch_array($query))
{
$threads .= "<span class=\"tid".$id."\">";
$threads .= "<strong><a href=\"showthread.php?tid={$thread['tid']}\" target=\"_blank\">".htmlspecialchars_uni($thread['subject'])."</a></strong>";
$author = "<a href=\"member.php?action=profile&uid=".$thread['uid']."\">{$thread['username']}</a>";
$threads .= " ({$author})";
$threads .= "</span>";
$threads .= "<br /><br />";
}


Now in your templates, use "{$threads}" and it'll display like this:

Changing The Way MyBB Does Threads (Eric J.)

That should give you a basic idea of how to work it, but as I say, I'm not 100% sure it'll work.

E: Missed some of your post, but this is what needs to be done to display all threads.

E2: And the classes are tid1, tid2, etc. ZiNgA mentions doing it with xThreads below, but since I was doing this, I figured it could be easily integrated.

(This post was last modified: 01-04-2013 02:15 PM by Seabody.)
01-04-2013 01:44 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #3
RE: Changing The Way MyBB Does Threads
I don't think XThreads would be relevant to most of that.
Redirecting to a thread listing is something you'll need to do.
Default thread ordering is a MyBB option.
Denying users the ability to create threads is MyBB permissions.
Stripping other functionality is either MyBB permissions or unrelated to threads.

The only place where XThreads would be relevant would be with styling threads, which is rather trivial to do, as shown in http://mybbhacks.zingaburga.com/forumdisplay.php?fid=25

My Blog
01-04-2013 02:08 PM
Find all posts by this user Quote this message in a reply
Eric J. Offline
Junior Member
**
Posts: 8
Joined: Jan 2013
Post: #4
RE: Changing The Way MyBB Does Threads
Yeah, everything listed (Other than what's in bold), I plan to do myself. So where would I add that code Seabody?

Alright, so since that's possible, the next thing I wanted to do was the thread view. It's for a theme website, so basically what I'd like to do is have the first post not display as a post (I don't want my information about my profile), but just as whatever content I have in the post. I'll be using HTML in posts so I can just style it all there. I would however have the like button installed, and I'd like to show that in the first post, but not in any others.

Any help is appreciated. Biggrin
01-04-2013 02:26 PM
Find all posts by this user Quote this message in a reply
Seabody Offline
Member
***
Posts: 54
Joined: Aug 2012
Post: #5
RE: Changing The Way MyBB Does Threads
Should be viable to do it in index.php. Though my preferred method (and the one this was really designed for) is to put it in templates via PHP in Templates.

As for the postbit, create and modify a postbit_first template, leaving out what you don't want.

And for the thank you button, omit the button from the postbit template, and put it in postbit_first.
(This post was last modified: 01-04-2013 02:54 PM by Seabody.)
01-04-2013 02:31 PM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #6
RE: Changing The Way MyBB Does Threads
(01-04-2013 02:08 PM)ZiNgA BuRgA Wrote:  The only place where XThreads would be relevant would be with styling threads, which is rather trivial to do, as shown in http://mybbhacks.zingaburga.com/forumdisplay.php?fid=25

Maybe not even there if he doesn't care about editing styles from the end-view and is comfortable doing it directly from the css panel in the ACP.

@OP, You can currently do something like (forumdisplay_thread* templates):

HTML Code
class="thread_{$thread['tid']}"


Code:
1
2
3
4
5
6
7
*[class*='thread_'] {
/*to all threads*/
}

.thread_1 {
/* self explanatory, I think.*/
}

* There is not css tag xD

(01-04-2013 12:06 PM)Eric J. Wrote:  So first off, I want the index page to be a list of threads from a certain section (The forum will only have one section).[/b]

Should be easy to rename the forumdisplay.php file to index.php and make the core edits to force the FID in it? Then you edit the forumdisplay templates as you normally will.

You may need some htaccess redirection (or core edits) from forumdisplay.php to index.php too.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 01-05-2013 05:29 AM by Sama34.)
01-05-2013 05:28 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: #7
RE: Changing The Way MyBB Does Threads
(01-05-2013 05:28 AM)Sama34 Wrote:  
(01-04-2013 02:08 PM)ZiNgA BuRgA Wrote:  The only place where XThreads would be relevant would be with styling threads, which is rather trivial to do, as shown in http://mybbhacks.zingaburga.com/forumdisplay.php?fid=25

Maybe not even there if he doesn't care about editing styles from the end-view and is comfortable doing it directly from the css panel in the ACP.

@OP, You can currently do something like (forumdisplay_thread* templates):

HTML Code
class="thread_{$thread['tid']}"


Code:
1
2
3
4
5
6
7
*[class*='thread_'] {
/*to all threads*/
}

.thread_1 {
/* self explanatory, I think.*/
}

* There is not css tag xD

(01-04-2013 12:06 PM)Eric J. Wrote:  So first off, I want the index page to be a list of threads from a certain section (The forum will only have one section).[/b]

Should be easy to rename the forumdisplay.php file to index.php and make the core edits to force the FID in it? Then you edit the forumdisplay templates as you normally will.

You may need some htaccess redirection (or core edits) from forumdisplay.php to index.php too.

I was really hoping to avoid hacks (changing forumdisplay.php to index.php) in completing this, just so I don't have random bugs. xD But thanks for the help, I'll definitely update this once I've started getting stuff done with it.

Also did RateU(?) ever get ckeditor working fully as a replacement for the MyBB editor? I would LOVE to have that.
(This post was last modified: 01-05-2013 07:46 AM by Eric J..)
01-05-2013 06:11 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: Changing The Way MyBB Does Threads
(01-05-2013 06:11 AM)Eric J. Wrote:  I was really hoping to avoid hacks in completing this, just so I don't have random bugs.
If you want to avoid hacks, don't try to shoehorn MyBB into doing this in the first place... >_>

My Blog
01-05-2013 07:46 AM
Find all posts by this user Quote this message in a reply
Eric J. Offline
Junior Member
**
Posts: 8
Joined: Jan 2013
Post: #9
RE: Changing The Way MyBB Does Threads
To be completely honest, I'm not really asking if you want me to use MyBB or not, just for help to do what I need. :/
01-05-2013 08:45 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #10
RE: Changing The Way MyBB Does Threads
(01-05-2013 08:45 AM)Eric J. Wrote:  To be completely honest, I'm not really asking if you want me to use MyBB or not, just for help to do what I need. :/
And to be completely honest as well, we're not here to read your complaints, just giving advice is all.

My Blog
01-05-2013 09:25 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: