Title: Contact Us v1.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:  2006 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 Engage Final SP3

Updated for 1.9.8 by: WormHole @ XMB Garage

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

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

==============================================================================================================
=======
Step 2:
=======
=======================
Edit File: lang/English.lang.php
=======================
==================================
Add Code At Very Bottom Of File Above ?>
==================================

// Contact Us Mod Begin
$lang['contactus'] = "Contact Us";
$lang['contactus_status'] = "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:
==========

        $onlinetoday_statuson = $onlinetoday_statusoff = '';
        settingHTML('onlinetoday_status', $onlinetoday_statuson, $onlinetoday_statusoff);

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

        // Contact Us Mod Begin
        $contactus_statuson = $contactus_statusoff = '';
        settingHTML('contactus_status', $contactus_statuson, $contactus_statusoff);
        // Contact Us Mod End

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

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

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

        // Contact Us Mod Begin
        printsetting1($lang['contactus_status'], 'contactus_statusnew', $contactus_statuson, $contactus_statusoff);
        // Contact Us Mod End

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

        $onlinetoday_statusnew = formOnOff('onlinetoday_statusnew');

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

        // Contact Us Mod Begin
        $contactus_statusnew = formOnOff('contactus_statusnew');
        // Contact Us Mod End

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

        $db->query("UPDATE ".X_PREFIX."settings SET

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

        $db->query("UPDATE ".X_PREFIX."settings SET
            contactus_status='$contactus_statusnew',

==============================================================================================================
=======
Step 4:
=======

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

// 'Forum Rules'-link
if ($SETTINGS['bbrules'] == 'on') {
    $links[] = '<img src="'.$imgdir.'/top_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_status'] == 'on'){
    $links[] = '<img src="'.$THEME['imgdir'].'/top_contact.gif" alt="'.$lang['contactus'].'" border="0" /> <a href="contact.php"><font class="navtd">'.$lang['contactus'].'</font></a>';
}

===============================================================================================================
=======
Step 5:
=======
=======================
Edit File: include/online.inc.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 Admin Panel -> Templates
==========================
=====================
Create Template: contactus
=====================
=============================
Add Code And Click Submit Changes:
=============================

<form method="post" action="contact.php">
<table cellspacing="0" cellpadding="0" border="0" width="$THEME[tablewidth]" align="center">
<tr>
<td bgcolor="$THEME[bordercolor]">
<table border="0" cellspacing="$THEME[borderwidth]" cellpadding="$THEME[tablespace]" width="100%">
<tr class="category">
<td colspan="2"><font color="$THEME[cattext]"><strong>$lang[contactus]</strong></font></td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="25%">$lang[contactyourname]</td>
<td bgcolor="$THEME[altbg2]" width="75%"><input type="text" name="name" size="50" value="$self[username]" /></td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="25%">$lang[contactyouremail]</td>
<td bgcolor="$THEME[altbg2]" width="75%"><input type="text" name="email" size="50" value="$self[email]" /></td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="25%">$lang[contactsubject]</td>
<td bgcolor="$THEME[altbg2]" width="75%"><input type="text" name="subject" size="50" /></td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" valign="top" width="25%">$lang[contactmessage]</td>
<td bgcolor="$THEME[altbg2]" width="75%"><textarea name="message" rows="9" cols="60"></textarea></td>
</tr>
<tr class="ctrtablerow" bgcolor="$THEME[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 "top_contact.gif" to your theme folders. It's located in the Contents folder.

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

Upload file "contact.php" to your "forum" directory. It's located in the Contents folder.

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