============================================================================================================================
Modification Title: Contact Us

Version: 1.0

Author: John Briggs

Description: This modification will add a contact page to your board for members and guests to contact the board administrator.

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 v3. 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:
=======
====================================
Go To Administration Panel --> Insert Raw SQL
====================================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

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

// Contact Us Mod Begin
$lang['contactus'] = "Contact Us";
$lang['contactusstatus'] = "Contact Us Status:";
$lang['contactyourname'] = "Your Name:";
$lang['contactyouremail'] = "Your E-mail Address:";
$lang['contactsubject'] = "Subject:";
$lang['contactmessage'] = "Message:";
$lang['contactsendmessage'] = "Send Message";
$lang['contactclearform'] = "Clear Form";
$lang['contactempty'] = "Sorry, you must fill all of the form out.";
$lang['contactonline'] = "Using contact form";
$lang['contactsubmitted'] = "Your message was submitted successfully!";
$lang['contactbademail'] = "Your e-mail address did not pass validation, please enter a valid e-mail address";
// Contact Us Mod End

============================================================================================================================
=======
Step 3:
=======
==============
Edit File: cp.php
==============
==========
Find Code:
==========

        $resetSigOn = $resetSigOff = '';
        if($SETTINGS['resetsigs'] == 'on') {
            $resetSigOn = $selHTML;
        } else {
            $resetSigOff = $selHTML;
        }

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

        // Contact Us Mod Begin
        $contactus_on = $contactus_off = '';
        switch ($SETTINGS['contactus']) {
            case 'on':
                $contactus_on = $selHTML;
                break;
            default:
                $contactus_off = $selHTML;
                break;
        }
        // Contact Us Mod End

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

        printsetting1($lang['reportpoststatus'], 'reportpostnew', $reportposton, $reportpostoff);

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

        // Contact Us Mod Begin
        printsetting1($lang['contactusstatus'], 'contactusnew', $contactus_on, $contactus_off);
        // Contact Us Mod End

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

        $resetSigNew = ($resetSigNew == 'on') ? 'on' : 'off';

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

        // Contact Us Mod Begin
        $contactusnew = ($contactusnew == 'on') ? 'on' : 'off';
        // Contact Us Mod End

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

$db->query("UPDATE $table_settings SET langfile='$langfilenew'

=============================
Find Code At End Of Above Statement
=============================

");

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

, contactus='$contactusnew'");

============================================================================================================================
=======
Step 4:
=======
=================
Edit File: header.php
=================
==========
Find Code:
==========

// 'Forum Rules'-link
if ($SETTINGS['bbrules'] == "on") {
    $links[] = "<img src=\"$imgdir/bbrules.gif\" alt=\"$lang[altrules]\" border=\"0\" /> <a href=\"faq.php?page=forumrules\"><font class=\"navtd\">$lang[textbbrules]</font></a>";
}

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

// Contact Us-link
if ($SETTINGS['contactus'] == 'on'){
    $links[] = '<img src="'.$imgdir.'/contact.gif" alt="'.$lang['contactus'].'" border="0" /> <a href="contact.php"><font class="navtd">'.$lang['contactus'].'</font></a>';
}

============================================================================================================================
=======
Step 5:
=======
===============
Edit File: misc.php
===============
==========
Find Code:
==========

    } elseif (false !== strpos($url, "/topicadmin.php")) {
        $location = $lang['onlinetopicadmin'];

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

    // Contact Us Mod Begin
    } elseif (false !== strpos($url, '/contact.php')) {
        $location = $lang['contactonline'];
    // Contact Us Mod End

============================================================================================================================
=======
Step 6:
=======
===============================
Go To Administration Panel --> Templates
===============================
=========================
Create New Template: contactus
=========================
=========================
Add Code And Submit Changes
=========================

<form method="post" action="contact.php">
<table cellspacing="0" cellpadding="0" border="0" width="$tablewidth" align="center">
<tr>
<td bgcolor="$bordercolor">
<table border="0" cellspacing="$borderwidth" cellpadding="$tablespace" width="100%">
<tr class="category">
<td colspan="2"><font color="$cattext"><strong>$lang[contactus]</strong></font></td>
</tr>
<tr class="tablerow">
<td bgcolor="$altbg1" width="25%">$lang[contactyourname]</td>
<td bgcolor="$altbg2" width="75%"><input type="text" name="name" size="50" value="$self[username]" /></td>
</tr>
<tr class="tablerow">
<td bgcolor="$altbg1" width="25%">$lang[contactyouremail]</td>
<td bgcolor="$altbg2" width="75%"><input type="text" name="email" size="50" value="$self[email]" /></td>
</tr>
<tr class="tablerow">
<td bgcolor="$altbg1" width="25%">$lang[contactsubject]</td>
<td bgcolor="$altbg2" width="75%"><input type="text" name="subject" size="50" /></td>
</tr>
<tr class="tablerow">
<td bgcolor="$altbg1" valign="top" width="25%">$lang[contactmessage]</td>
<td bgcolor="$altbg2" width="75%"><textarea name="message" rows="9" cols="60"></textarea></td>
</tr>
<tr class="ctrtablerow" bgcolor="$altbg2">
<td colspan="2"><input class="submit" type="submit" name="contactsubmit" value="$lang[contactsendmessage]" />&nbsp;<input type="reset" value="$lang[contactclearform]" /></td>
</tr>
</table>
</td>
</tr>
</table>
</form>

============================================================================================================================
=======
Step 7:
=======

upload image "contact.gif" to your theme folders.

============================================================================================================================
=======
Step 8:
=======

upload file "contact.php" to your "forum" directory.

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