============================================================================================================================
Modification Title: Forum Display Quick Thread v1.0

Author: GuldantheWarlock

Updated By: John Briggs

Description:
This modification will add a block to the bottom of your forum display that will allow you to post a new thread from the threadlist.
This modification is similar to Quick Reply.

Copyright:  2010 GuldantheWarlock. All rights reserved.
Copyright:  2010 John Briggs. All rights reserved.

Compatability: XMB 1.9.5 SP1

Install Note: Before adding this modification to your forum, you should back up all files related to this modification.

License Note: This modification is released under the GPL License. A copy is provided with this software package.

Author Note:
You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.

============================================================================================================================
=======
Step 1:
=======
=======================
Edit File: lang/English.lang.php
=======================
============================
Add Code To End Of File Above  ?>
============================

// Forum Display Quick Thread Mod Begin
$lang['quickthread'] = "Quick Thread";
// Forum Display Quick Thread Mod End

============================================================================================================================
=======
Step 2:
=======
=====================
Edit File: forumdisplay.php
=====================
==========
Find Code:
==========

loadtemplates(

==================
Replace Code With:
==================

loadtemplates(
'forumdisplay_quickthread',
'functions_bbcode',
'functions_smilieinsert_smilie',

==========
Find Code:
==========

eval('echo "'.template('header').'";');

===============
Add Code Above:
===============

// Forum Display Quick Thread Mod Begin
eval('$bbcodescript = "'.template('functions_bbcode').'";');
// Forum Display Quick Thread Mod End

==========
Find Code:
==========

if (!$notexist) {
    if (!postperm($forum, 'thread')) {
        $newtopiclink = $newpolllink = '';
    } else {
        if (X_GUEST && isset($forum['guestposting']) && $forum['guestposting'] != 'on') {
            $newtopiclink = $newpolllink = '';
        } else {
            eval('$newtopiclink = "'.template('forumdisplay_newtopic').'";');
            if (isset($forum['pollstatus']) && $forum['pollstatus'] != 'off') {
                eval('$newpolllink = "'.template('forumdisplay_newpoll').'";');
            } else {
                $newpolllink = '';
            }
        }
    }
}

==================
Replace Code With:
==================

// Forum Display Quick Thread Mod Begin
if (!$notexist) {
    if (!postperm($forum, 'thread')) {
        $newtopiclink = $newpolllink = $quickthread = '';
    } else {
        $usesig = (X_MEMBER && $self['sig'] != '') ? true : false;
        $usesigcheck = $usesig ? 'checked="checked"' : '';
        $codeoffcheck = (isset($bbcodeoff) && $bbcodeoff == 'yes') ? 'checked="checked"' : '';
        $smileoffcheck = (isset($smileyoff) && $smileyoff == 'yes') ? 'checked="checked"' : '';
        $allowimgcode = ($forum['allowimgcode'] == 'yes') ? $lang['texton']:$lang['textoff'];
        $allowhtml = ($forum['allowhtml'] == 'yes') ? $lang['texton']:$lang['textoff'];
        $allowsmilies = ($forum['allowsmilies'] == 'yes') ? $lang['texton']:$lang['textoff'];
        $allowbbcode = ($forum['allowbbcode'] == 'yes') ? $lang['texton']:$lang['textoff'];

        if ($smileyinsert == 'on' && $smiliesnum > 0) {
            $max = ($smiliesnum > 16) ? 16 : $smiliesnum;
            srand((double)microtime() * 1000000);
            $keys = array_rand($smiliecache, $max);
            $smilies = array();
            $smilies[] = '<table border="0"><tr>';
            $i = 0;
            $total = 0;
            $pre = 'opener.';
            foreach ($keys as $key) {
                if ($total == 16) {
                    break;
                }
                $smilie['code'] = $key;
                $smilie['url'] = $smiliecache[$key];
                if ($i >= 4) {
                    $smilies[] = '</tr><tr>';
                    $i = 0;
                }
                eval('$smilies[] = "'.template('functions_smilieinsert_smilie').'";');
                $i++;
                $total++;
            }
            $smilies[] = '</tr></table>';
            $smilies = implode("\n", $smilies);
        }

        if (X_GUEST && isset($forum['guestposting']) && $forum['guestposting'] != 'on') {
            $newtopiclink = $newpolllink = $quickthread = '';
        } else {
            eval('$newtopiclink = "'.template('forumdisplay_newtopic').'";');
            eval('$quickthread = "'.template('forumdisplay_quickthread').'";');
            $newpolllink = '';
            if (isset($forum['pollstatus']) && $forum['pollstatus'] != 'off') {
                eval('$newpolllink = "'.template('forumdisplay_newpoll').'";');
            }
        }
    }
}
// Forum Display Quick Thread Mod End

============================================================================================================================
=======
Step 3:
=======
===============================
Go To Administration Panel --> Templates
===============================
====================================
Create New Template: forumdisplay_quickthread
====================================
===================
Add Code And Submit:
===================

<a name="qthread"></a>
<form method="post" name="input" action="post.php?action=newthread&amp;fid=$fid">
<table width="$tablewidth" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="$bordercolor">
<tr>
<td><input type="hidden" name="subject" value="" />
<table width="100%" border="0" cellpadding="$tablespace" cellspacing="1">
<tr bgcolor="$altbg1">
<td colspan="3" class="category"><div align="left"><font color="$cattext"><strong>&nbsp;&raquo;&nbsp;$lang[quickthread]</strong>&nbsp;- [$lang[loggedin] <strong>$xmbuser</strong>]</font></div></td>
</tr>
<tr bgcolor="$altbg1" class="tablerow">
<td colspan="3"><div align="left"><strong>&nbsp;&raquo;</strong>&nbsp;$whopost2</div></td>
</tr>
<tr bgcolor="$altbg2" class="tablerow">
<td colspan="1"><div align="left">$lang[textsubject]</div></td>
<td colspan="2"><div align="left"><input type="text" name="subject" size="80" value="" /></div></td>
</tr>
<tr class="tablerow">
<td width="8%" height="101" bgcolor="$altbg1">
<div align="left">
<span class="smalltxt">
$lang[texthtmlis] $allowhtml<br />
$lang[textsmiliesare] $allowsmilies<br />
$lang[textbbcodeis] $allowbbcode<br />
$lang[textimgcodeis] $allowimgcode
</span>
<hr />
</div>
<div align="center">
$smilies<br />
<a href="#qthread" onclick="Popup('misc.php?action=smilies', 'Window', 175, 250);">[$lang[moresmilies]]</a>
</div>
</td>
<td bgcolor="$altbg2" width="56%" class="tablerow">
<div align="center">
<textarea rows="10" name="message" id="message" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" style="width: 100%;"></textarea>
</div>
</td>
<td width="20%" height="101" bgcolor="$altbg2" class="tablerow"> <div align="center">
<table width="100%" border="0" class="tablerow" cellspacing="0" cellpadding="0">
<tr>
<td width="15%"><div align="left"><input type="checkbox" name="smileyoff" value="yes" $smileoffcheck /></div></td>
<td width="85%"><div align="left">$lang[textdissmileys]</div></td>
</tr>
<tr >
<td width="15%"><div align="left"><input type="checkbox" name="usesig" value="yes" $usesigcheck /></div></td>
<td width="85%"><div align="left">$lang[textusesig]</div></td>
</tr>
<tr>
<td width="15%"><div align="left"><input type="checkbox" name="bbcodeoff" value="yes" $codeoffcheck /></div></td>
<td width="85%"><div align="left">$lang[bbcodeoff] </div></td>
</tr>
<tr>
<td width="15%"><div align="left"><input type="checkbox" name="emailnotify" value="yes" /></div></td>
<td width="85%"><div align="left">$lang[textemailnotify] </div></td>
</tr>
</table>
</div>
<div align="left">
<br />&nbsp;&nbsp;<input class="submit" type="submit" name="topicsubmit" value="$lang[textpostnew]" />
</div>
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<br />

============================================================================================================================
=======
Step 4:
=======
===============================
Go To Administration Panel --> Templates
===============================
=======================================
Edit Templates: forumdisplay and forumdisplay_admin
=======================================
==========
Find Code:
==========

</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />

===============
Add Code Below:
===============

$quickthread

============================================================================================================================
Enjoy!