Xeddit [General Addons]

MojoRisin

Active member
Joined
Jul 17, 2025
A new product by MojoRisin is available: Xeddit v1.0.4 - Turn any XenForo forum into a Reddit-style community with nested comments, voting, and threaded discussions.


Xeddit v1.0.4​

Description​

Bring Reddit-Style Discussions to Your XenForo Community

Xeddit transforms any XenForo forum into a modern, Reddit-inspired discussion platform. Give your members the familiar nested comment experience they love while keeping everything integrated within your existing forum.

Key Features

Nested Comment Threading

Comments display in a threaded hierarchy with visual connection lines. Reply to any post or comment and watch the conversation branch naturally. Each reply nests under its parent, making it easy to follow complex discussions.

Voting System
Members can upvote or downvote both threads and individual comments. Vote scores display in real-time without page refresh. The hot score algorithm surfaces popular content automatically.

Collapsible Threads
Long comment chains can be collapsed with a single click. State persists across page loads so members pick up right where they left off.

Smart Pagination
Pagination counts root-level comments only, keeping nested replies together with their parent. Navigate large threads without losing context.

Clean Card-Based Design
Modern card layout with color-coded borders, hover effects, and styled vote buttons. Fully responsive and integrates with your forum's style.

How It Works

Simply set any forum's type to "Xeddit" in the admin panel. That's it - the forum immediately adopts the Reddit-style layout while maintaining full XenForo functionality including permissions, moderation tools, and user tagging.

Extended Product Information​




Read more about this product...
 
There appears to be a bug in the installation script, Setup.php, line 23:

There doesn't appear to be a 'signed()' function in the column schema. Weirdly, you can use unsigned(false), but there is no signed() afaik.

PHP:
    public function installStep1(): void
    {
        $this->schemaManager()->alterTable('xf_thread', function (Alter $table) {
            if (!$table->getColumnDefinition('xeddit_vote_score')) {
                $table->addColumn('xeddit_vote_score', 'int')->signed()->setDefault(0); // BUG: 'signed()' is undefined in the schema
            }
            if (!$table->getColumnDefinition('xeddit_vote_count_up')) {
                $table->addColumn('xeddit_vote_count_up', 'int')->unsigned()->setDefault(0);
            }
            if (!$table->getColumnDefinition('xeddit_vote_count_down')) {
                $table->addColumn('xeddit_vote_count_down', 'int')->unsigned()->setDefault(0);
            }
            if (!$table->getColumnDefinition('xeddit_hot_score')) {
                $table->addColumn('xeddit_hot_score', 'decimal', '15,6')->setDefault(0);
                $table->addKey('xeddit_hot_score');
            }
            if (!$table->getColumnDefinition('xeddit_best_post_id')) {
                $table->addColumn('xeddit_best_post_id', 'int')->nullable()->setDefault(null);
            }
        });
    }
 
Code:
<?php

namespace Blatchy\Xeddit;

use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
use XF\Db\Schema\Alter;
use XF\Db\Schema\Create;
use XF\Repository\ForumTypeRepository;

class Setup extends AbstractSetup
{
    use StepRunnerInstallTrait;
    use StepRunnerUninstallTrait;
    use StepRunnerUpgradeTrait;

    public function installStep1(): void
    {
        $this->schemaManager()->alterTable('xf_thread', function (Alter $table) {
            if (!$table->getColumnDefinition('xeddit_vote_score')) {
                $table->addColumn('xeddit_vote_score', 'int')->setDefault(0);
            }
            if (!$table->getColumnDefinition('xeddit_vote_count_up')) {
                $table->addColumn('xeddit_vote_count_up', 'int')->unsigned()->setDefault(0);
            }
            if (!$table->getColumnDefinition('xeddit_vote_count_down')) {
                $table->addColumn('xeddit_vote_count_down', 'int')->unsigned()->setDefault(0);
            }
            if (!$table->getColumnDefinition('xeddit_hot_score')) {
                $table->addColumn('xeddit_hot_score', 'decimal', '15,6')->setDefault(0);
                $table->addKey('xeddit_hot_score');
            }
            if (!$table->getColumnDefinition('xeddit_best_post_id')) {
                $table->addColumn('xeddit_best_post_id', 'int')->nullable()->setDefault(null);
            }
        });
    }

    public function installStep2(): void
    {
        $this->schemaManager()->alterTable('xf_post', function (Alter $table) {
            if (!$table->getColumnDefinition('xeddit_parent_post_id')) {
                $table->addColumn('xeddit_parent_post_id', 'int')->nullable()->setDefault(null);
                $table->addColumn('xeddit_depth', 'smallint', 5)->setDefault(0);
                $table->addColumn('xeddit_path', 'varchar', 500)->setDefault('');
                $table->addKey('xeddit_parent_post_id');
                $table->addKey(['thread_id', 'xeddit_depth']);
            }
            if (!$table->getColumnDefinition('xeddit_vote_score')) {
                $table->addColumn('xeddit_vote_score', 'int')->setDefault(0);
            }
            if (!$table->getColumnDefinition('xeddit_vote_count_up')) {
                $table->addColumn('xeddit_vote_count_up', 'int')->unsigned()->setDefault(0);
            }
            if (!$table->getColumnDefinition('xeddit_vote_count_down')) {
                $table->addColumn('xeddit_vote_count_down', 'int')->unsigned()->setDefault(0);
            }
        });
    }

    public function installStep3(): void
    {
        $this->schemaManager()->createTable('xf_blatchy_xeddit_vote', function (Create $table) {
            $table->addColumn('vote_id', 'int')->autoIncrement();
            $table->addColumn('thread_id', 'int');
            $table->addColumn('user_id', 'int');
            $table->addColumn('vote_type', 'varchar', 10);
            $table->addColumn('vote_date', 'int')->setDefault(0);
            $table->addPrimaryKey('vote_id');
            $table->addUniqueKey(['thread_id', 'user_id']);
            $table->addKey('user_id');
        });
    }

    public function installStep4(): void
    {
        $this->schemaManager()->createTable('xf_xeddit_post_vote', function (Create $table) {
            $table->addColumn('vote_id', 'int')->autoIncrement();
            $table->addColumn('post_id', 'int');
            $table->addColumn('user_id', 'int');
            $table->addColumn('vote_type', 'varchar', 10);
            $table->addColumn('vote_date', 'int')->setDefault(0);
            $table->addPrimaryKey('vote_id');
            $table->addUniqueKey(['post_id', 'user_id']);
            $table->addKey('user_id');
        });
    }

    public function installStep5(): void
    {
        $exists = $this->db()->fetchOne("SELECT forum_type_id FROM xf_forum_type WHERE forum_type_id = 'xeddit'");
        if (!$exists) {
            $this->db()->insert('xf_forum_type', [
                'forum_type_id' => 'xeddit',
                'handler_class' => 'Blatchy\\Xeddit\\ForumType\\Xeddit',
                'addon_id' => 'Blatchy/Xeddit'
            ]);
        }

        \XF::repository(ForumTypeRepository::class)->rebuildForumTypeCache();
    }

    public function upgrade1000010Step1(): void
    {
        // Placeholder upgrade step
    }

    public function uninstallStep1(): void
    {
        $this->schemaManager()->alterTable('xf_thread', function (Alter $table) {
            $table->dropColumns(['xeddit_vote_score', 'xeddit_vote_count_up', 'xeddit_vote_count_down', 'xeddit_hot_score', 'xeddit_best_post_id']);
        });
    }

    public function uninstallStep2(): void
    {
        $this->schemaManager()->alterTable('xf_post', function (Alter $table) {
            $table->dropColumns(['xeddit_parent_post_id', 'xeddit_depth', 'xeddit_path', 'xeddit_vote_score', 'xeddit_vote_count_up', 'xeddit_vote_count_down']);
        });
    }

    public function uninstallStep3(): void
    {
        $this->schemaManager()->dropTable('xf_blatchy_xeddit_vote');
    }

    public function uninstallStep4(): void
    {
        $this->schemaManager()->dropTable('xf_xeddit_post_vote');
    }

    public function uninstallStep5(): void
    {
        $this->db()->delete('xf_forum_type', "forum_type_id = 'xeddit'");

        \XF::repository(ForumTypeRepository::class)->rebuildForumTypeCache();
    }
}
 
Back
Top