Add-on pre-formatted threads.

I think he wants a thread template.
Example: tech support template:

What Operating System are you using ?
Which browser are you using ?
Do you have anti-virus software installed ?
email address:

A better solution would be to use Simple forms to create dropdown options. The form selections are then posted to a new thread.
 
It's already done by Ragtek , but another guy is looking for a which , when you hover above it ( or click ) it disappears.
 
Would be cool if somebody could test this version... (it's just a quick automatic created addon, missing phrases and templates... i just want to test if it's working before i finish the templates and phrases...)
Haha dont want to sound stupid but when I unzipped the file, another zip file appear! Lol.
 
what program are use using to unzip it?
it seems that it's working with winrar but users using the windows explorer or the php ziparchive class have problems:(
 
This is awesome, ragtek. Hope you develop it further with suggestions from Digital Doctor and the others. A suggestion I have is if the pre-formatted text could be made permanent so it can't be deleted or edited by the user.
 
It's already done by Ragtek , but another guy is looking for a which , when you hover above it ( or click ) it disappears.
Yes, you got it. Of course it has to be an option activated from a checkbox from the admin in the ACP.
 
This is awesome, ragtek. Hope you develop it further with suggestions from Digital Doctor and the others. A suggestion I have is if the pre-formatted text could be made permanent so it can't be deleted or edited by the user.
DD didn't suggest anything:D


And yea, i'll try to develop it further...... but it's hard with all the other addons & clientprojects i have to support & work on:D
(that's why it takes some time to get this finished.......
1. version won't get the editor, i'll just create the templates & phrases and release it)
 
No problem ragtek. My suggestions is only a plus.
Only something to force lazy people to read some rules before posting instead of tell theme to read rules page/thread. ;-)
At this state your addon (with templates and phrases) it's ready for the resource manager.

p.s. How about usergroups permission to see or not the text? :-)
 
I just tried to uninstall it and got this error.
Use of undefined constant xf_forum - assumed 'xf_forum'
  1. XenForo_Application::handlePhpError() in Ragtek/PDT/Install.php at line 51
  2. Ragtek_PDT_Install::uninstall()
  3. call_user_func() in XenForo/DataWriter/AddOn.php at line 193
  4. XenForo_DataWriter_AddOn->_postDelete() in XenForo/DataWriter.php at line 1738
  5. XenForo_DataWriter->delete() in XenForo/ControllerAdmin/AddOn.php at line 116
  6. XenForo_ControllerAdmin_AddOn->actionDelete() in XenForo/FrontController.php at line 310
  7. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  8. XenForo_FrontController->run() in /home//public_html/admin.php at line 13
 
my fault

if you want to fix it

file: Ragtek_PDT_Install

replace it with
PHP:
<?php
 
 
class Ragtek_PDT_Install
{
 
 
##additional_install_methods##
 
 
    protected function _installVersion1()
    {
        $query = array();
        /** autogenerated */
 
        self::addColumn('xf_forum', 'ragtek_defaultThread', "mediumtext NOT NULL");
 
        self::_runQuery($query);
        /** autogenerated end */
 
    }
 
 
    public static function uninstall()
    {
        $query = array();
 
        /** autogenerated */
        if (self::_checkIfExist('xf_forum', 'ragtek_defaultThread')) {
            $query['remove_xf_forum::ragtek_defaultThread'] = "ALTER TABLE 'xf_forum' DROP COLUMN 'ragtek_defaultThread' ";
        }
        /** autogenerated end */
 
 
        self::_runQuery($query);
    }
 
 
    /** everything else here are only helper methods */
 
 
    public static function install($existingAddOn, $addOnData)
    {
        $startVersionId = 1;
        $endVersionId = $addOnData['version_id'];
 
        if ($existingAddOn) {
            $startVersionId = $existingAddOn['version_id'] + 1;
        }
        $install = self::getInstance();
 
        for ($i = $startVersionId; $i <= $endVersionId; $i++) {
            $method = '_installVersion' . $i;
            if (method_exists($install, $method) === false) {
                continue;
            }
            $install->$method();
        }
    }
 
    public static function _runQuery(array $queries)
    {
        $db = XenForo_Application::getDb();
        foreach ($queries AS $id => $query) {
            $db->query($query);
        }
    }
 
    static private $instance = null;
 
    public static function getInstance()
    {
 
        if (self::$instance == null) {
            self::$instance = new self();
        }
        return self::$instance;
    }
 
    public static function addColumn($table, $field, $attr)
    {
        if (!self::_checkIfExist($table, $field)) {
            $db = XenForo_Application::get('db');
            return $db->query("ALTER TABLE `" . $table . "` ADD `" . $field . "` " . $attr);
        }
    }
 
    protected static function _checkIfExist($table, $field)
    {
        $db = XenForo_Application::get('db');
        if ($db->fetchRow('SHOW columns FROM `' . $table . '` WHERE Field = ?', $field)) {
            return true;
        } else {
            return false;
        }
    }
 
 
    protected static function _checkIfAddonExists($addonId)
    {
        /** @var $addonModel    XenForo_Model_AddOn */
        $addonModel = XenForo_Model::create('XenForo_Model_AddOn');
        if (!$addonModel->getAddOnById($addonId)) {
            throw new XenForo_Exception('This addon requires ' . $addonId);
        }
        return true;
    }
 
    protected function checkIfIndexExists($table, $name)
    {
        $db = XenForo_Application::getDb();
        $query = "SHOW INDEX FROM $table WHERE KEY_NAME = " . $db->quote($name);
 
        if ($db->fetchRow($query)) {
            return true;
        }
        return false;
    }
 
}
 
I would like to see it set up as an official add-on, or at least somewhere near stable before I use it in a production environment (y)
 
Top Bottom