MyBB Hacks

Full Version: XThreads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(05-13-2021 05:36 AM)TheStoryteller Wrote: [ -> ]Hello all,

I have a question regarding xThread prefixes.

I have a code to randomly show me the mybb prefixes, title, description and author of a topic in a specific forum.

Because I do not want to use the mybb prefix function but xThreads prefix, I want to amend the code accordingly, so my 3 xThread prefixes (which are displayed as fontawesom icons) are displayed in a div container on the welcome_block templates.

I also have „php in templates“ active.

Could somebody tell me, how do I get the correct data from the database? I am absolutely new to php…

The Code I have is this:

PHP Code:
 <?php
$query = $db->query("SELECT *, t.description FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (p.fid=f.fid) LEFT JOIN ".TABLE_PREFIX."threadprefixes ON (t.pid=t.prefix) WHERE f.fid IN (27, 28, 29) AND t.visible = '1' ORDER BY RAND() LIMIT 6");
while($data = $db->fetch_array($query))
echo etc. etc.


Thank you very much and cool plugin btw Wink



EDIT: found it. it was

PHP Code:
<?php
$query = $db->query("SELECT *, t.description FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (p.fid=f.fid) LEFT JOIN ".TABLE_PREFIX."threadfields_data td ON (td.tid=t.tid) WHERE t.visible=1 AND f.fid IN ('27', '28','29','30') ORDER BY RAND() LIMIT 1");
while($data = $db->fetch_array($query))
            {
$prefix = $data['prefix']; 
 echo "etc. etc.";}
?>

(04-10-2021 04:51 PM)Sama34 Wrote: [ -> ]Btw, your board doesn't support unicode emojis, I had to remove my awesome finger pointing at my awesome eagle, :cryingface:
Database encoding is still utf8 instead of utf8_mb4.
I might switch it over if I'm bored some day, but as you can probably guess, it's very low on the priority list.

(04-11-2021 08:03 AM)Sama34 Wrote: [ -> ]Ugh, forgot the main point I was going to make yesterday.

Could you perhaps add support (hooks) for the attachment upload process? I would like to be able to store attachments over at some cloud service, I think some hooks around the following line should work:
https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/blob/2fd64cd0e12054684a0e03ef10c8c0ec5487e3fa/Upload/inc/xthreads/xt_uploa
https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/blob/2fd64cd0e12054684a0e03ef10c8c0ec5487e3fa/Upload/xthreads_attac
The system wasn't really designed for external storage in mind, but if you can get it working, feel free to submit a pull request.

(04-18-2021 04:36 PM)Sama34 Wrote: [ -> ]

Code:
Fatal error: Uncaught Exception: Serialization of 'PDO' is not allowed in


I think the following affects your control_object() function.
https://github.com/mybb/mybb/pull/4193

Urgh, that's a bit ugly to deal with...
Thanks for letting me know.
using Xthread i created thread description. is it possible that some user who don't want to see thread description, can disable that xthread field?

how to increase the textbox height. there is only wide available
Hi Zinga, everyone —

I just updated to MyBB 1.8.27. All of my custom thread fields came through without a hitch, but postbit_first is no longer replacing the first posts in my threads. I deactivated and reactivated XThreads 1.68.

I've been combing the internet for several hours now and haven't found any reference to this. Any idea of what could be happening here?

Thanks for any help!

ETA: I just previewed a first post and postbit_first loaded for that, but still isn't loading on the published page.
(06-29-2021 06:24 PM)firekid Wrote: [ -> ]using Xthread i created thread description. is it possible that some user who don't want to see thread description, can disable that xthread field?
XThreads doesn't provide user options - you'll need a custom modification for that.

(06-29-2021 06:24 PM)firekid Wrote: [ -> ]how to increase the textbox height. there is only wide available
Field Input Height option.

(06-30-2021 05:57 PM)Keaton Wrote: [ -> ]I just updated to MyBB 1.8.27. All of my custom thread fields came through without a hitch, but postbit_first is no longer replacing the first posts in my threads. I deactivated and reactivated XThreads 1.68.
There's a fix here https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin
Okay, now I have another question.
In Formatting Map List I can style my prefixes. But when I make the database query with

PHP Code:
".htmlspecialchars_uni($data['key'])."

  it shows me the plain text.

What do I need to enter instead, so my html style for the prefixes is also caught.

Thx Wink

Is this the plugin to make the 'Important' section above 'Normal' forums like on myBB.com Forum?

I'm trying to add 'Forum Rules' sticky threads that show above all other Threads in a Forum Section (these Forum Rules are different for each section), then a Have a Site Rules which  also need to be 'Global'.... and I want to add my 'Donate' thread to 'Important' also!

Will xThreads alo me to do the above, I heard somewhere this is the Plugin to setup my Forum like this...

Cheers Guys!
After upgrading from 1.8.24 to 1.8.29, custom thread fields disappear from thread display even all variables are present in all dld_ templates and postbit_first and postbit_first_classic templates. I had compared all templates related to xthreads with the 1.8.24 board, all are the same
On edit of the first post, there are all custom thread fields shown but on the thread, it's not shown.
Please help to fix this.
Thanks Zinga Burga and Sama for fix.
Dear Zinga Burga and MyBBHacks team,

I am probably one of your biggest fans, and the "XThreads" plugin is one of the most important parts of my own MyBB.

[Edit] I wanted to ask for PHP8 support, because the regular 1.68 xThreads version crashes my forum when I activate PHP8.... but now I used the GitHub version and nearly anything seems to run perfectly. Thanks so much you guys!

Do you have a donation link so I can support your amazing work, Zinga?
Reference URL's