/*
# UBB.threads, Version 6
# Official Release Date for UBB.threads Version6: 06/05/2002
# First version of UBB.threads created July 30, 1996 (by Rick Baker).
# This entire program is copyright Infopop Corporation, 2002.
# For more info on the UBB.threads and other Infopop
# Products/Services, visit: http://www.infopop.com
# Program Author: Rick Baker.
# You may not distribute this program in any manner, modified or otherwise,
# without the express, written written consent from Infopop Corporation.
# Note: if you modify ANY code within UBB.threads, we at Infopop Corporation
# cannot offer you support-- thus modify at your own peril :)
# ---------------------------------------------------------------------------
#
#
# "Contact Us Add On" by Joshua Pettit - aka JoshPet www.JoshuaPettit.com
# for discussion and bug reports visit www.threadsdev.com
#
# Modify your threads code at your own peril. Not responsible for this or
# any other modifications to your forum. Always backup your files and database
# first.
#
#
*/
// -----------------
// Variables you can edit:
//
// Are we sending the emails to ALL Admins?
$sendtoall = "0"; // 1= All Admins - 0= You will specifiy Specific Users below
// If we are not sending to All Admins, what User Number(s) should we mail to?
// In order to specify users, you must set $sendtoall above to '0'
$sendto = "2"; // (Separate User Numbers with a coma)
// Do you want the user to receive an email confirming? (auto-reply)
// You may edit the reply text in the contactus.php language file.
$autoreply = "1"; // 1= Auto Reply On - 0=Auto Reply Off
// End of Variables - DO NOT EDIT BELOW THIS LINE
// -----------------
// Require the library
require ("main.inc.php");
require ("languages/${$config['cookieprefix']."w3t_language"}/contactus.php");
// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Username,U_Email,U_Language");
$Username = $user['U_Username'];
$Useremail = $user['U_Email'];
$Useragent = find_environmental("HTTP_USER_AGENT");
$IPAddress = find_environmental ("REMOTE_ADDR");
// -----------------
// Figure out what language FAQ they should be shown
$faqlanguage = $user['U_Language'];
if (!$faqlanguage) {
$faqlanguage = $config['language'];
}
// ------------------
// What type of line breaks
$newline = "\n";
if (stristr(PHP_OS,"win")) {
$newline = "\r\n";
}
//-------------------
// If we have a username, let's list it, otherwise let them fill it in
if ($Username) {
$UsernameInput = "$Username";
}
else {
$UsernameInput = "";
}
// -----------------
// Set up the query
if ($sendtoall == "1") {
$select = "WHERE U_STATUS = \"Administrator\"";
}
else {
if (($sendto == "") || ($sendto == "0")) {
$sendto = "2";
}
$select = "WHERE U_NUMBER in ($sendto)";
}
$query = "
SELECT U_EMAIL
FROM {$config['tbprefix']}Users
$select
";
$sth = $dbh -> do_query($query);
while ( list($Email) = $dbh -> fetch_array($sth)) {
if (strcmp($Email,"") != 0) { $ToEmail .= "$Email,"; }
}
$dbh -> finish_sth($sth);
if (!$ToEmail) {
$ToEmail = "{$config['emailaddy']}";
}
// ---------------------
// Send the page to them
$html = new html;
$html -> send_header("{$ubbt_lang['CONTACT']}",$Cat,0,$user);
// ---------------------
// Grab the tablewrapper
list($tbopen,$tbclose) = $html -> table_wrapper();
if (!$debug) {
include("$thispath/templates/$tempstyle/contactus.tmpl");
}
// -------------
// Send a footer
$html -> send_footer();