|
From: <vo...@us...> - 2013-02-24 07:07:49
|
Revision: 11088
http://sourceforge.net/p/xoops/svn/11088
Author: voltan1
Date: 2013-02-24 07:07:43 +0000 (Sun, 24 Feb 2013)
Log Message:
-----------
Update to new version
Modified Paths:
--------------
XoopsModules/contact/trunk/contact/admin/contact.php
XoopsModules/contact/trunk/contact/admin/menu.php
XoopsModules/contact/trunk/contact/class/contact.php
XoopsModules/contact/trunk/contact/docs/changelog.txt
XoopsModules/contact/trunk/contact/docs/install.txt
XoopsModules/contact/trunk/contact/docs/readme.txt
XoopsModules/contact/trunk/contact/include/functions_update.php
XoopsModules/contact/trunk/contact/language/english/admin.php
XoopsModules/contact/trunk/contact/language/english/modinfo.php
XoopsModules/contact/trunk/contact/sql/mysql.sql
XoopsModules/contact/trunk/contact/templates/admin/contact_contact.html
XoopsModules/contact/trunk/contact/xoops_version.php
Added Paths:
-----------
XoopsModules/contact/trunk/contact/admin/log.php
XoopsModules/contact/trunk/contact/docs/readme.html
XoopsModules/contact/trunk/contact/language/persian/
XoopsModules/contact/trunk/contact/language/persian/admin.php
XoopsModules/contact/trunk/contact/language/persian/index.html
XoopsModules/contact/trunk/contact/language/persian/main.php
XoopsModules/contact/trunk/contact/language/persian/modinfo.php
XoopsModules/contact/trunk/contact/templates/admin/contact_logs.html
Removed Paths:
-------------
XoopsModules/contact/trunk/contact/readme.html
Modified: XoopsModules/contact/trunk/contact/admin/contact.php
===================================================================
--- XoopsModules/contact/trunk/contact/admin/contact.php 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/admin/contact.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -192,7 +192,7 @@
exit ();
}
- redirect_header ( 'contact.php', 1, _AM_CONTACT_MSG_DELETED );
+ redirect_header ( 'contact.php', 1, _AM_CONTACT_MSG_DELETEDO );
xoops_cp_footer ();
exit ();
break;
Added: XoopsModules/contact/trunk/contact/admin/log.php
===================================================================
--- XoopsModules/contact/trunk/contact/admin/log.php (rev 0)
+++ XoopsModules/contact/trunk/contact/admin/log.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -0,0 +1,57 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+/**
+ * Contact module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author Kazumi Ono (aka Onokazu)
+ * @author Trabis <lus...@gm...>
+ * @author Hossein Azizabadi (AKA Voltan)
+ * @version $Id$
+ */
+
+// Call header
+require dirname(__FILE__) . '/header.php';
+// Display Admin header
+xoops_cp_header();
+// Define default value
+$op = $contact_handler->Contact_CleanVars($_REQUEST, 'op', 'form', 'string');
+
+switch ($op)
+{
+ case 'form':
+ // prune manager
+ $form = new XoopsThemeForm(_AM_CONTACT_LOGS_FORM, 'logs', 'log.php', 'post');
+ $column = new XoopsFormSelect(_AM_CONTACT_LOGS_COLUME, 'column','contact_phone');
+ $column->addOption("contact_phone", _AM_CONTACT_LOGS_COLUME_PHONE);
+ $column->addOption("contact_url", _AM_CONTACT_LOGS_COLUME_URL);
+ $column->addOption("contact_mail", _AM_CONTACT_LOGS_COLUME_MAIL);
+ $form->addElement($column);
+ $form->addElement(new XoopsFormHidden('op', 'getlog'));
+ $form->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit'));
+ $xoopsTpl->assign('form', $form->render());
+ break;
+
+ case 'getlog':
+ $column = $contact_handler->Contact_CleanVars($_REQUEST, 'column', '', 'string');
+ $log = $contact_handler->Contact_Logs($column);
+ $xoopsTpl->assign('logs', $log);
+ break;
+}
+
+$xoopsTpl->assign('navigation', $admin_class->addNavigation('log.php'));
+// Call template file
+$xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/contact/templates/admin/contact_logs.html');
+// Call footer
+require dirname(__FILE__) . '/footer.php';
+?>
\ No newline at end of file
Modified: XoopsModules/contact/trunk/contact/admin/menu.php
===================================================================
--- XoopsModules/contact/trunk/contact/admin/menu.php 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/admin/menu.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -42,6 +42,11 @@
$adminmenu[$i]["desc"] = _MI_CONTACT_MENU_CONTACT_DESC;
$adminmenu[$i]["icon"] = $pathIcon32.'/content.png';
$i++;
+$adminmenu[$i]["title"] = _MI_CONTACT_MENU_LOGS;
+$adminmenu[$i]["link"] = "admin/log.php";
+$adminmenu[$i]["desc"] = _MI_CONTACT_MENU_LOGS_DESC;
+$adminmenu[$i]["icon"] = $pathIcon32.'/exec.png';
+$i++;
$adminmenu[$i]["title"] = _MI_CONTACT_MENU_TOOLS;
$adminmenu[$i]["link"] = "admin/tools.php";
$adminmenu[$i]["desc"] = _MI_CONTACT_MENU_TOOLS_DESC;
Modified: XoopsModules/contact/trunk/contact/class/contact.php
===================================================================
--- XoopsModules/contact/trunk/contact/class/contact.php 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/class/contact.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -21,374 +21,453 @@
*/
if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
+ die("XOOPS root path not defined");
}
class contact extends XoopsObject
{
-
- function __construct()
- {
- $this->XoopsObject();
- $this->initVar("contact_id", XOBJ_DTYPE_INT, null, false, 11);
- $this->initVar("contact_uid", XOBJ_DTYPE_INT, null, false, 11);
- $this->initVar("contact_cid", XOBJ_DTYPE_INT, null, false, 11);
- $this->initVar("contact_name", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_subject", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_mail", XOBJ_DTYPE_EMAIL, null, false);
- $this->initVar("contact_url", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_create", XOBJ_DTYPE_INT, null, false);
- $this->initVar("contact_icq", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_company", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_location", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_phone", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_department", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_ip", XOBJ_DTYPE_TXTBOX, null, false);
- $this->initVar("contact_message", XOBJ_DTYPE_TXTAREA, null, false);
- $this->initVar("contact_address", XOBJ_DTYPE_TXTAREA, null, false);
- $this->initVar("contact_reply", XOBJ_DTYPE_INT, null, false, 1);
-
- $this->db = $GLOBALS ['xoopsDB'];
- $this->table = $this->db->prefix('contact');
- }
-
- function Contact_ContactForm($department)
- {
-
- global $xoopsConfig, $xoopsOption, $xoopsUser;
-
- if ($this->isNew()) {
- if (!empty($xoopsUser)) {
- $contact_uid = $xoopsUser->getVar('uid');
- $contact_name = $xoopsUser->getVar('uname');
- $contact_mail = $xoopsUser->getVar('email');
- $contact_url = $xoopsUser->getVar('url');
- $contact_icq = $xoopsUser->getVar('user_icq');
- $contact_location = $xoopsUser->getVar('user_from');
-
- } else {
- $contact_uid = 0;
- $contact_name = '';
- $contact_mail = '';
- $contact_url = '';
- $contact_icq = '';
- $contact_location = '';
- }
- } else {
- $contact_uid = $this->getVar('contact_uid');
- $contact_name = $this->getVar('contact_name');
- $contact_mail = $this->getVar('contact_mail');
- $contact_url = $this->getVar('contact_url');
- $contact_icq = $this->getVar('contact_icq');
- $contact_location = $this->getVar('contact_location');
+
+ public function __construct()
+ {
+ $this->XoopsObject();
+ $this->initVar("contact_id",XOBJ_DTYPE_INT,null,false,11);
+ $this->initVar("contact_uid",XOBJ_DTYPE_INT,null,false,11);
+ $this->initVar("contact_cid",XOBJ_DTYPE_INT,null,false,11);
+ $this->initVar("contact_name",XOBJ_DTYPE_TXTBOX, null, false);
+ $this->initVar("contact_subject",XOBJ_DTYPE_TXTBOX, null, false);
+ $this->initVar("contact_mail",XOBJ_DTYPE_EMAIL, null, false);
+ $this->initVar("contact_url",XOBJ_DTYPE_TXTBOX, null, false);
+ $this->initVar("contact_create", XOBJ_DTYPE_INT, null, false);
+ $this->initVar("contact_icq",XOBJ_DTYPE_TXTBOX, null, false);
+ $this->initVar("contact_company",XOBJ_DTYPE_TXTBOX, null, false);
+ $this->initVar("contact_location",XOBJ_DTYPE_TXTBOX, null, false);
+ $this->initVar("contact_phone",XOBJ_DTYPE_TXTBOX,null,false);
+ $this->initVar("contact_department",XOBJ_DTYPE_TXTBOX, null, false);
+ $this->initVar("contact_ip",XOBJ_DTYPE_TXTBOX, null, false);
+ $this->initVar("contact_message",XOBJ_DTYPE_TXTAREA, null, false);
+ $this->initVar("contact_address",XOBJ_DTYPE_TXTAREA, null, false);
+ $this->initVar("contact_reply",XOBJ_DTYPE_INT,null,false,1);
+ $this->initVar("contact_platform",XOBJ_DTYPE_ENUM,null,false,'','',array('Android','Ios','Web'));
+ $this->initVar("contact_type",XOBJ_DTYPE_ENUM,null,false,'','',array('Contact','Phone','Mail'));
+
+ $this->db = $GLOBALS ['xoopsDB'];
+ $this->table = $this->db->prefix ( 'contact' );
+ }
+
+ public function Contact_ContactForm($department)
+ {
+ global $xoopsConfig, $xoopsOption, $xoopsUser;
+ if($this->isNew()) {
+ if(!empty($xoopsUser)) {
+ $contact_uid = $xoopsUser->getVar('uid');
+ $contact_name = $xoopsUser->getVar('uname');
+ $contact_mail = $xoopsUser->getVar('email');
+ $contact_url = $xoopsUser->getVar('url');
+ $contact_icq = $xoopsUser->getVar('user_icq');
+ $contact_location = $xoopsUser->getVar('user_from');
+
+ } else {
+ $contact_uid = 0;
+ $contact_name = '';
+ $contact_mail = '';
+ $contact_url = '';
+ $contact_icq = '';
+ $contact_location = '';
+ }
+ } else {
+ $contact_uid = $this->getVar ( 'contact_uid');
+ $contact_name = $this->getVar ( 'contact_name');
+ $contact_mail = $this->getVar ( 'contact_mail');
+ $contact_url = $this->getVar ( 'contact_url');
+ $contact_icq = $this->getVar ( 'contact_icq');
+ $contact_location = $this->getVar ( 'contact_location');
+ }
+
+ $form = new XoopsThemeForm(_MD_CONTACT_FORM, 'save', 'index.php', 'post', true);
+ $form->setExtra ( 'enctype="multipart/form-data"' );
+ $form->addElement ( new XoopsFormHidden ( 'op', 'save' ) );
+ $form->addElement ( new XoopsFormHidden ( 'contact_id', $this->getVar ( 'contact_id', 'e' ) ) );
+ $form->addElement ( new XoopsFormHidden ( 'contact_uid', $contact_uid ) );
+ $form->addElement ( new XoopsFormText ( _MD_CONTACT_NAME, 'contact_name', 50, 255, $contact_name), true );
+ $form->addElement ( new XoopsFormText ( _MD_CONTACT_MAIL, 'contact_mail', 50, 255, $contact_mail), true );
+
+ if(xoops_getModuleOption('form_url','contact')) {
+ $form->addElement ( new XoopsFormText ( _MD_CONTACT_URL, 'contact_url', 50, 255, $contact_url), false );
+ }
+ if(xoops_getModuleOption('form_icq','contact')) {
+ $form->addElement ( new XoopsFormText ( _MD_CONTACT_ICQ, 'contact_icq', 50, 255, $contact_icq), false );
+ }
+ if(xoops_getModuleOption('form_company','contact')) {
+ $form->addElement ( new XoopsFormText ( _MD_CONTACT_COMPANY, 'contact_company', 50, 255, $this->getVar ( 'contact_company')), false );
+ }
+ if(xoops_getModuleOption('form_location','contact')) {
+ $form->addElement ( new XoopsFormText ( _MD_CONTACT_LOCATION, 'contact_location', 50, 255, $contact_location), false );
+ }
+ if(xoops_getModuleOption('form_phone','contact')) {
+ $form->addElement ( new XoopsFormText ( _MD_CONTACT_PHONE, 'contact_phone', 50, 255, $this->getVar ( 'contact_phone')), false );
+ }
+ if(xoops_getModuleOption('form_address','contact')) {
+ $form->addElement ( new XoopsFormTextArea ( _MD_CONTACT_ADDRESS, 'contact_address', $this->getVar ( 'contact_address', 'e' ), 3, 60 ), false );
+ }
+ if(xoops_getModuleOption('form_dept','contact')) {
+ // show a drop down with the correct departments listed
+ $departmentlist = new XoopsFormSelect( _MD_CONTACT_DEPARTMENT, 'contact_department' );
+ $departments = xoops_getModuleOption('contact_dept','contact');
+ foreach( $departments as $val ) {
+ $valexplode = explode( ',', $val );
+ $departmentlist->addOption($valexplode[0]);
}
-
- $form = new XoopsThemeForm(_MD_CONTACT_FORM, 'save', 'index.php', 'post', true);
- $form->setExtra('enctype="multipart/form-data"');
- $form->addElement(new XoopsFormHidden ('op', 'save'));
- $form->addElement(new XoopsFormHidden ('contact_id', $this->getVar('contact_id', 'e')));
- $form->addElement(new XoopsFormHidden ('contact_uid', $contact_uid));
- $form->addElement(new XoopsFormText (_MD_CONTACT_NAME, 'contact_name', 50, 255, $contact_name), true);
- $form->addElement(new XoopsFormText (_MD_CONTACT_MAIL, 'contact_mail', 50, 255, $contact_mail), true);
-
- if (xoops_getModuleOption('form_url', 'contact')) {
- $form->addElement(new XoopsFormText (_MD_CONTACT_URL, 'contact_url', 50, 255, $contact_url), false);
- }
- if (xoops_getModuleOption('form_icq', 'contact')) {
- $form->addElement(new XoopsFormText (_MD_CONTACT_ICQ, 'contact_icq', 50, 255, $contact_icq), false);
- }
- if (xoops_getModuleOption('form_company', 'contact')) {
- $form->addElement(new XoopsFormText (_MD_CONTACT_COMPANY, 'contact_company', 50, 255, $this->getVar('contact_company')), false);
- }
- if (xoops_getModuleOption('form_location', 'contact')) {
- $form->addElement(new XoopsFormText (_MD_CONTACT_LOCATION, 'contact_location', 50, 255, $contact_location), false);
- }
- if (xoops_getModuleOption('form_phone', 'contact')) {
- $form->addElement(new XoopsFormText (_MD_CONTACT_PHONE, 'contact_phone', 50, 255, $this->getVar('contact_phone')), false);
- }
- if (xoops_getModuleOption('form_address', 'contact')) {
- $form->addElement(new XoopsFormTextArea (_MD_CONTACT_ADDRESS, 'contact_address', $this->getVar('contact_address', 'e'), 3, 60), false);
- }
- if (xoops_getModuleOption('form_dept', 'contact')) {
- // show a drop down with the correct departments listed
- $departmentlist = new XoopsFormSelect(_MD_CONTACT_DEPARTMENT, 'contact_department');
- $departments = xoops_getModuleOption('contact_dept', 'contact');
- foreach ($departments as $val) {
- $valexplode = explode(',', $val);
- $departmentlist->addOption($valexplode[0]);
- }
- $form->addElement($departmentlist);
- }
-
- $form->addElement(new XoopsFormText (_MD_CONTACT_SUBJECT, 'contact_subject', 50, 255, $this->getVar('contact_subject')), true);
- $form->addElement(new XoopsFormTextArea (_MD_CONTACT_MESSAGE, 'contact_message', $this->getVar('contact_message', 'e'), 5, 60), true);
-
- xoops_load('XoopsFormCaptcha');
- $form->addElement(new XoopsFormCaptcha(), true);
-
- $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
- return $form;
- }
-
- function Contact_ReplyForm()
- {
- global $xoopsConfig;
- $form = new XoopsThemeForm(_AM_CONTACT_REPLY, 'doreply', 'contact.php', 'post', true);
- $form->setExtra('enctype="multipart/form-data"');
- $form->addElement(new XoopsFormHidden ('op', 'doreply'));
- $form->addElement(new XoopsFormHidden ('contact_id', $this->getVar('contact_id', 'e')));
- $form->addElement(new XoopsFormHidden ('contact_uid', $this->getVar('contact_uid', 'e')));
- $form->addElement(new XoopsFormLabel(_AM_CONTACT_FROM, '', ''));
- $form->addElement(new XoopsFormText (_AM_CONTACT_NAMEFROM, 'contact_name', 50, 255, XoopsUser::getUnameFromId($this->getVar('contact_uid'))), true);
- $form->addElement(new XoopsFormText (_AM_CONTACT_MAILFROM, 'contact_mail', 50, 255, $xoopsConfig['adminmail']), true);
- $form->addElement(new XoopsFormLabel(_AM_CONTACT_TO, '', ''));
- $form->addElement(new XoopsFormText (_AM_CONTACT_NAMETO, 'contact_nameto', 50, 255, $this->getVar('contact_name')), true);
- $form->addElement(new XoopsFormText (_AM_CONTACT_MAILTO, 'contact_mailto', 50, 255, $this->getVar('contact_mail')), true);
- $form->addElement(
- new XoopsFormText (_AM_CONTACT_SUBJECT, 'contact_subject', 50, 255,
- _RE . $this->getVar('contact_subject')), true
- );
- $form->addElement(new XoopsFormTextArea (_AM_CONTACT_MESSAGE, 'contact_message', '', 5, 60), true);
- $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
- return $form;
- }
-
- /**
- * Returns an array representation of the object
- *
- * @return array
- **/
- function toArray()
- {
- $ret = array();
- $vars = $this->getVars();
- foreach (array_keys($vars) as $i) {
- $ret [$i] = $this->getVar($i);
- }
- return $ret;
- }
+ $form->addElement( $departmentlist );
+ }
+
+ $form->addElement ( new XoopsFormText ( _MD_CONTACT_SUBJECT, 'contact_subject', 50, 255, $this->getVar ( 'contact_subject' )), true );
+ $form->addElement(new XoopsFormTextArea ( _MD_CONTACT_MESSAGE, 'contact_message', $this->getVar ( 'contact_message', 'e' ), 5, 60 ), true );
+
+ xoops_load('XoopsFormCaptcha');
+ $form->addElement(new XoopsFormCaptcha(), true);
+
+ $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ return $form;
+ }
+
+ public function Contact_ReplyForm()
+ {
+ global $xoopsConfig;
+ $form = new XoopsThemeForm(_AM_CONTACT_REPLY, 'doreply', 'contact.php', 'post', true);
+ $form->setExtra ( 'enctype="multipart/form-data"' );
+ $form->addElement ( new XoopsFormHidden ( 'op', 'doreply' ) );
+ $form->addElement ( new XoopsFormHidden ( 'contact_id', $this->getVar ( 'contact_id', 'e' ) ) );
+ $form->addElement ( new XoopsFormHidden ( 'contact_uid', $this->getVar ( 'contact_uid', 'e' ) ) );
+ $form->addElement ( new XoopsFormLabel( _AM_CONTACT_FROM, '',''));
+ $form->addElement ( new XoopsFormText ( _AM_CONTACT_NAMEFROM, 'contact_name', 50, 255, XoopsUser::getUnameFromId ( $this->getVar ( 'contact_uid' ) )), true );
+ $form->addElement ( new XoopsFormText ( _AM_CONTACT_MAILFROM, 'contact_mail', 50, 255, $xoopsConfig['adminmail']), true );
+ $form->addElement ( new XoopsFormLabel( _AM_CONTACT_TO, '',''));
+ $form->addElement ( new XoopsFormText ( _AM_CONTACT_NAMETO, 'contact_nameto', 50, 255, $this->getVar ( 'contact_name' )), true );
+ $form->addElement ( new XoopsFormText ( _AM_CONTACT_MAILTO, 'contact_mailto', 50, 255, $this->getVar ( 'contact_mail' )), true );
+ $form->addElement ( new XoopsFormText ( _AM_CONTACT_SUBJECT, 'contact_subject', 50, 255, _RE . $this->getVar ( 'contact_subject' )), true );
+ $form->addElement(new XoopsFormTextArea ( _AM_CONTACT_MESSAGE, 'contact_message', '', 5, 60 ), true );
+ $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ return $form;
+ }
+
+ /**
+ * Returns an array representation of the object
+ *
+ * @return array
+ **/
+ public function toArray()
+ {
+ $ret = array ();
+ $vars = $this->getVars ();
+ foreach ( array_keys ( $vars ) as $i ) {
+ $ret [$i] = $this->getVar ( $i );
+ }
+ return $ret;
+ }
}
class ContactContactHandler extends XoopsPersistableObjectHandler
{
- function __construct(&$db)
- {
- parent::__construct($db, "contact", 'contact', 'contact_id', 'contact_mail');
- }
+ public function __construct(&$db)
+ {
+ parent::__construct($db, "contact", 'contact', 'contact_id', 'contact_mail');
+ }
+
+ /**
+ * Get variables passed by GET or POST method
+ *
+ */
+ public function Contact_CleanVars(&$global, $key, $default = '', $type = 'int')
+ {
+
+ switch ($type) {
+ case 'array':
+ $ret = (isset($global[$key]) && is_array($global[$key])) ? $global[$key] : $default;
+ break;
+ case 'date':
+ $ret = (isset($global[$key])) ? strtotime($global[$key]) : $default;
+ break;
+ case 'string':
+ $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_SANITIZE_MAGIC_QUOTES) : $default;
+ break;
+ case 'mail':
+ $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_VALIDATE_EMAIL) : $default;
+ break;
+ case 'url':
+ $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) : $default;
+ break;
+ case 'ip':
+ $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_VALIDATE_IP) : $default;
+ break;
+ case 'amp':
+ $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_FLAG_ENCODE_AMP) : $default;
+ break;
+ case 'text':
+ $ret = (isset($global[$key])) ? htmlentities($global[$key], ENT_QUOTES, 'UTF-8') : $default;
+ break;
+ case 'platform':
+ $ret = (isset($global[$key])) ? $this->Contact_Platform($global[$key]) : $this->Contact_Platform($default);
+ break;
+ case 'type':
+ $ret = (isset($global[$key])) ? $this->Contact_Type($global[$key]) : $this->Contact_Type($default);
+ break;
+ case 'int': default:
+ $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_SANITIZE_NUMBER_INT) : $default;
+ break;
+
+ }
+ if ($ret === false) {
+ return $default;
+ }
+ return $ret;
+ }
+
+ public function Contact_InfoProcessing($global)
+ {
+ $contact = array();
+ $contact['contact_cid'] = $this->Contact_CleanVars($_POST, 'contact_id', '', 'int');
+ $contact['contact_uid'] = $this->Contact_CleanVars($_POST, 'contact_uid', '', 'int');
+ $contact['contact_name'] = $this->Contact_CleanVars($_POST, 'contact_name', '', 'string');
+ $contact['contact_nameto'] = $this->Contact_CleanVars($_POST, 'contact_nameto', '', 'string');
+ $contact['contact_subject'] = $this->Contact_CleanVars($_POST, 'contact_subject', '', 'string');
+ $contact['contact_mail'] = $this->Contact_CleanVars($_POST, 'contact_mail', '', 'mail');
+ $contact['contact_mailto'] = $this->Contact_CleanVars($_POST, 'contact_mailto', '', 'mail');
+ $contact['contact_url'] = $this->Contact_CleanVars($_POST, 'contact_url', '', 'url');
+ $contact['contact_create'] = time();
+ $contact['contact_icq'] = $this->Contact_CleanVars($_POST, 'contact_icq', '', 'string');
+ $contact['contact_company'] = $this->Contact_CleanVars($_POST, 'contact_company', '', 'string');
+ $contact['contact_location'] = $this->Contact_CleanVars($_POST, 'contact_location', '', 'text');
+ $contact['contact_phone'] = $this->Contact_CleanVars($_POST, 'contact_phone', '', 'int');
+ $contact['contact_department'] = $this->Contact_CleanVars($_POST, 'contact_department', _MD_CONTACT_DEFULTDEP, 'string');
+ $contact['contact_ip'] = getenv ( "REMOTE_ADDR" );
+ $contact['contact_message'] = $this->Contact_CleanVars($_POST, 'contact_message', '', 'text');
+ $contact['contact_address'] = $this->Contact_CleanVars($_POST, 'contact_address', '', 'text');
+ $contact['contact_platform'] = $this->Contact_CleanVars($_POST, 'contact_platform', 'Web', 'platform');
+ $contact['contact_type'] = $this->Contact_CleanVars($_POST, 'contact_type', 'Contact', 'type');
+ return $contact;
+ }
+
+ public function Contact_SendMail($contact)
+ {
+ $xoopsMailer = xoops_getMailer();
+ $xoopsMailer->useMail();
+ $xoopsMailer->setToEmails($this->Contact_ToEmails($contact['contact_department']));
+ $xoopsMailer->setFromEmail($contact['contact_mail']);
+ $xoopsMailer->setFromName($contact['contact_name']);
+ $xoopsMailer->setSubject($contact['contact_subject']);
+ $xoopsMailer->setBody($contact['contact_message']);
+ if($xoopsMailer->send()) {
+ $message = _MD_CONTACT_MES_SEND;
+ } else {
+ $message = $xoopsMailer->getErrors();
+ }
+ return $message;
+ }
+
+ public function Contact_ReplyMail($contact)
+ {
+ $xoopsMailer = xoops_getMailer();
+ $xoopsMailer->useMail();
+ $xoopsMailer->setToEmails($contact['contact_mailto']);
+ $xoopsMailer->setFromEmail($contact['contact_mail']);
+ $xoopsMailer->setFromName($contact['contact_name']);
+ $xoopsMailer->setSubject($contact['contact_subject']);
+ $xoopsMailer->setBody($contact['contact_message']);
+ if($xoopsMailer->send()) {
+ $message = _MD_CONTACT_MES_SEND;
+ } else {
+ $message = $xoopsMailer->getErrors();
+ }
+ return $message;
+ }
- /**
- * Get variables passed by GET or POST method
- *
- */
- function Contact_CleanVars(&$global, $key, $default = '', $type = 'int')
- {
-
- switch ($type) {
- case 'array':
- $ret = (isset($global[$key]) && is_array($global[$key])) ? $global[$key] : $default;
- break;
- case 'date':
- $ret = (isset($global[$key])) ? strtotime($global[$key]) : $default;
- break;
- case 'string':
- $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_SANITIZE_MAGIC_QUOTES) : $default;
- break;
- case 'mail':
- $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_VALIDATE_EMAIL) : $default;
- break;
- case 'url':
- $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) : $default;
- break;
- case 'ip':
- $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_VALIDATE_IP) : $default;
- break;
- case 'amp':
- $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_FLAG_ENCODE_AMP) : $default;
- break;
- case 'text':
- $ret = (isset($global[$key])) ? htmlentities($global[$key], ENT_QUOTES, 'UTF-8') : $default;
- break;
- case 'int':
- default:
- $ret = (isset($global[$key])) ? filter_var($global[$key], FILTER_SANITIZE_NUMBER_INT) : $default;
- break;
- }
- if ($ret === false) {
- return $default;
- }
- return $ret;
- }
-
- function Contact_InfoProcessing($global)
- {
- $contact = array();
- $contact['contact_cid'] = $this->Contact_CleanVars($_POST, 'contact_id', '', 'int');
- $contact['contact_uid'] = $this->Contact_CleanVars($_POST, 'contact_uid', '', 'int');
- $contact['contact_name'] = $this->Contact_CleanVars($_POST, 'contact_name', '', 'string');
- $contact['contact_nameto'] = $this->Contact_CleanVars($_POST, 'contact_nameto', '', 'string');
- $contact['contact_subject'] = $this->Contact_CleanVars($_POST, 'contact_subject', '', 'string');
- $contact['contact_mail'] = $this->Contact_CleanVars($_POST, 'contact_mail', '', 'mail');
- $contact['contact_mailto'] = $this->Contact_CleanVars($_POST, 'contact_mailto', '', 'mail');
- $contact['contact_url'] = $this->Contact_CleanVars($_POST, 'contact_url', '', 'url');
- $contact['contact_create'] = time();
- $contact['contact_icq'] = $this->Contact_CleanVars($_POST, 'contact_icq', '', 'string');
- $contact['contact_company'] = $this->Contact_CleanVars($_POST, 'contact_company', '', 'string');
- $contact['contact_location'] = $this->Contact_CleanVars($_POST, 'contact_location', '', 'text');
- $contact['contact_phone'] = $this->Contact_CleanVars($_POST, 'contact_phone', '', 'int');
- $contact['contact_department'] = $this->Contact_CleanVars($_POST, 'contact_department', _MD_CONTACT_DEFULTDEP, 'string');
- $contact['contact_ip'] = getenv("REMOTE_ADDR");
- $contact['contact_message'] = $this->Contact_CleanVars($_POST, 'contact_message', '', 'text');
- $contact['contact_address'] = $this->Contact_CleanVars($_POST, 'contact_address', '', 'text');
- return $contact;
- }
-
- function Contact_SendMail($contact)
- {
- $xoopsMailer = xoops_getMailer();
- $xoopsMailer->useMail();
- $xoopsMailer->setToEmails($this->Contact_ToEmails($contact['contact_department']));
- $xoopsMailer->setFromEmail($contact['contact_mail']);
- $xoopsMailer->setFromName($contact['contact_name']);
- $xoopsMailer->setSubject($contact['contact_subject']);
- $xoopsMailer->setBody($contact['contact_message']);
- if ($xoopsMailer->send()) {
- $message = _MD_CONTACT_MES_SEND;
- } else {
- $message = $xoopsMailer->getErrors();
- }
- return $message;
- }
-
- function Contact_ReplyMail($contact)
- {
- $xoopsMailer = xoops_getMailer();
- $xoopsMailer->useMail();
- $xoopsMailer->setToEmails($contact['contact_mailto']);
- $xoopsMailer->setFromEmail($contact['contact_mail']);
- $xoopsMailer->setFromName($contact['contact_name']);
- $xoopsMailer->setSubject($contact['contact_subject']);
- $xoopsMailer->setBody($contact['contact_message']);
- if ($xoopsMailer->send()) {
- $message = _MD_CONTACT_MES_SEND;
- } else {
- $message = $xoopsMailer->getErrors();
- }
- return $message;
- }
-
- function Contact_ToEmails($department = null)
- {
- global $xoopsConfig;
- $department_mail[] = $xoopsConfig['adminmail'];
- if (!empty($department)) {
- $departments = xoops_getModuleOption('contact_dept', 'contact');
- foreach ($departments as $vals) {
- $vale = explode(',', $vals);
- if ($department == $vale[0]) {
- $department_mail[] = $vale[1];
- }
- }
- }
- return $department_mail;
- }
-
- function Contact_AddReply($contact_id)
- {
- $obj = $this->get($contact_id);
- $obj->setVar('contact_reply', 1);
- if (!$this->insert($obj)) {
- return false;
- }
- return true;
- }
-
- function Contact_GetReply($contact_id)
- {
-
- $criteria = new CriteriaCompo ();
- $criteria->add(new Criteria ('contact_cid', $contact_id));
- $contacts = $this->getObjects($criteria, false);
- if ($contacts) {
- $ret = array();
- foreach ($contacts as $root) {
- $tab = array();
- $tab = $root->toArray();
- $tab['contact_owner'] = XoopsUser::getUnameFromId($root->getVar('contact_uid'));
- $tab['contact_create'] = formatTimestamp($root->getVar('contact_create'), _MEDIUMDATESTRING);
- $ret [] = $tab;
- }
- return $ret;
- } else {
- return false;
- }
- }
-
- function Contact_GetAdminList($contact, $id)
- {
- $ret = array();
- $criteria = new CriteriaCompo ();
- $criteria->add(new Criteria ($id, '0'));
- $criteria->setSort($contact['sort']);
- $criteria->setOrder($contact['order']);
- $criteria->setStart($contact['start']);
- $criteria->setLimit($contact['limit']);
- $contacts = $this->getObjects($criteria, false);
- if ($contacts) {
- foreach ($contacts as $root) {
- $tab = array();
- $tab = $root->toArray();
- $tab['contact_owner'] = XoopsUser::getUnameFromId($root->getVar('contact_uid'));
- $tab['contact_create'] = formatTimestamp($root->getVar('contact_create'), _MEDIUMDATESTRING);
- $ret [] = $tab;
- }
- }
- return $ret;
- }
-
- /**
- * Get file Count
- */
- function Contact_GetCount($id)
- {
- $criteria = new CriteriaCompo ();
- $criteria->add(new Criteria ($id, '0'));
- return $this->getCount($criteria);
- }
-
- /**
- * Get Insert ID
- */
- function getInsertId()
- {
- return $this->db->getInsertId();
- }
-
- /**
- * Contact Prune Count
- */
- function Contact_PruneCount($timestamp, $onlyreply)
- {
- $criteria = new CriteriaCompo ();
- $criteria->add(new Criteria ('contact_create', $timestamp, '<='));
- if ($onlyreply) {
- $criteria->add(new Criteria ('contact_reply', 1));
- }
- return $this->getCount($criteria);
- }
-
- /**
- * Contact Delete Before Date
- */
- function Contact_DeleteBeforeDate($timestamp, $onlyreply)
- {
- $criteria = new CriteriaCompo ();
- $criteria->add(new Criteria ('contact_create', $timestamp, '<='));
- if ($onlyreply) {
- $criteria->add(new Criteria ('contact_reply', 1));
- }
- $this->deleteAll($criteria);
- }
-
+ public function Contact_ToEmails($department = null)
+ {
+ global $xoopsConfig;
+ $department_mail[] = $xoopsConfig['adminmail'];
+ if(!empty($department)) {
+ $departments = xoops_getModuleOption('contact_dept','contact');
+ foreach( $departments as $vals ) {
+ $vale = explode( ',', $vals );
+ if($department == $vale[0]) $department_mail[] = $vale[1];
+ }
+ }
+ return $department_mail;
+ }
+
+ public function Contact_AddReply($contact_id)
+ {
+ $obj = $this->get ( $contact_id );
+ $obj->setVar ( 'contact_reply', 1 );
+ if(!$this->insert ( $obj )) {
+ return false;
+ }
+ return true;
+ }
+
+ public function Contact_GetReply($contact_id)
+ {
+
+ $criteria = new CriteriaCompo ();
+ $criteria->add ( new Criteria ( 'contact_cid', $contact_id ) );
+ $criteria->add ( new Criteria ( 'contact_type', 'Contact' ) );
+ $contacts = $this->getObjects ( $criteria, false );
+ if ($contacts) {
+ $ret = array ();
+ foreach ( $contacts as $root ) {
+ $tab = array ();
+ $tab = $root->toArray ();
+ $tab['contact_owner'] = XoopsUser::getUnameFromId ( $root->getVar ( 'contact_uid' ) );
+ $tab['contact_create'] = formatTimestamp ( $root->getVar ( 'contact_create' ), _MEDIUMDATESTRING );
+ $ret [] = $tab;
+ }
+ return $ret;
+ } else {
+ return false;
+ }
+ }
+
+ public function Contact_GetAdminList($contact , $id)
+ {
+ $ret = array ();
+ $criteria = new CriteriaCompo ();
+ $criteria->add ( new Criteria ( $id, '0' ) );
+ $criteria->add ( new Criteria ( 'contact_type', 'Contact' ) );
+ $criteria->setSort ( $contact['sort'] );
+ $criteria->setOrder ( $contact['order'] );
+ $criteria->setStart ( $contact['start'] );
+ $criteria->setLimit ( $contact['limit'] );
+ $contacts = $this->getObjects ( $criteria, false );
+ if ($contacts) {
+ foreach ( $contacts as $root ) {
+ $tab = array ();
+ $tab = $root->toArray ();
+ $tab['contact_owner'] = XoopsUser::getUnameFromId ( $root->getVar ( 'contact_uid' ) );
+ $tab['contact_create'] = formatTimestamp ( $root->getVar ( 'contact_create' ), _MEDIUMDATESTRING );
+ $ret [] = $tab;
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * Get file Count
+ */
+ public function Contact_GetCount($id)
+ {
+ $criteria = new CriteriaCompo ();
+ $criteria->add ( new Criteria ( $id, '0' ) );
+ $criteria->add ( new Criteria ( 'contact_type', 'Contact' ) );
+ return $this->getCount ( $criteria );
+ }
+
+ /**
+ * Get Insert ID
+ */
+ public function getInsertId()
+ {
+ return $this->db->getInsertId ();
+ }
+
+ /**
+ * Contact Prune Count
+ */
+ public function Contact_PruneCount($timestamp, $onlyreply)
+ {
+ $criteria = new CriteriaCompo ();
+ $criteria->add ( new Criteria ( 'contact_create', $timestamp , '<=' ));
+ if($onlyreply) {
+ $criteria->add ( new Criteria ( 'contact_reply', 1 ));
+ }
+ return $this->getCount ( $criteria );
+ }
+
+ /**
+ * Contact Delete Before Date
+ */
+ public function Contact_DeleteBeforeDate($timestamp, $onlyreply)
+ {
+ $criteria = new CriteriaCompo ();
+ $criteria->add ( new Criteria ( 'contact_create', $timestamp , '<=' ));
+ if($onlyreply) {
+ $criteria->add ( new Criteria ( 'contact_reply', 1 ));
+ }
+ $this->deleteAll($criteria);
+ }
+
+ /**
+ * Contact Platform
+ */
+ public function Contact_Platform($platform)
+ {
+ $platform = strtolower($platform);
+ switch($platform) {
+ case 'Android':
+ $ret = 'Android';
+ break;
+
+ case 'Ios':
+ $ret = 'Ios';
+ break;
+
+ case 'Web':
+ default:
+ $ret = 'Web';
+ break;
+ }
+ return $ret;
+ }
+
+ /**
+ * Contact type
+ */
+ public function Contact_Type($type)
+ {
+ $type = strtolower($type);
+ switch($type) {
+ case 'Mail':
+ $ret = 'Mail';
+ break;
+
+ case 'Phone':
+ $ret = 'Phone';
+ break;
+
+ case 'Contact':
+ default:
+ $ret = 'Contact';
+ break;
+ }
+ return $ret;
+ }
+
+ /**
+ * Contact logs
+ */
+ public function Contact_Logs($column, $timestamp = null)
+ {
+ $ret = array();
+ if(!in_array($column, array('contact_mail', 'contact_url', 'contact_phone'))) {
+ return $ret;
+ }
+ $criteria = new CriteriaCompo();
+ $criteria->add( new Criteria('contact_cid', '0'));
+ if(!empty($timestamp)) {
+ $criteria->add( new Criteria('contact_create', $timestamp, '<='));
+ }
+ $criteria->setSort('contact_create');
+ $criteria->setOrder('DESC');
+ $contacts = $this->getObjects($criteria, false);
+ if ($contacts) {
+ foreach ( $contacts as $root ) {
+ $rootColumn = $root->getVar($column);
+ if(!empty($rootColumn)) {
+ $ret[] = $root->getVar($column);
+ unset($root);
+ }
+ }
+ }
+ return array_unique($ret);
+ }
}
-
?>
\ No newline at end of file
Modified: XoopsModules/contact/trunk/contact/docs/changelog.txt
===================================================================
--- XoopsModules/contact/trunk/contact/docs/changelog.txt 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/docs/changelog.txt 2013-02-24 07:07:43 UTC (rev 11088)
@@ -1,7 +1,7 @@
Version 1.80 from 2012-1-19
=================================
-- Rewritten to add DB capability (Voltan)
-
+- Rebuild Module (Voltan)
+
Version 1.71 from 2011-12-12
=================================
- converted to XOOPS Standard Module GUI (Mamba)
Modified: XoopsModules/contact/trunk/contact/docs/install.txt
===================================================================
--- XoopsModules/contact/trunk/contact/docs/install.txt 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/docs/install.txt 2013-02-24 07:07:43 UTC (rev 11088)
@@ -1,6 +1,4 @@
INSTALL/UNISTALL
=================
-No special measures necessary, follow the standard installation process and extract the module folder into the ../modules directory. Install the module through Admin -> System Module -> Modules.
-
-Detailed instructions on installing modules are available in the XOOPS Operations Manual: http://goo.gl/adT2i
\ No newline at end of file
+In order to install the module please do following:
\ No newline at end of file
Added: XoopsModules/contact/trunk/contact/docs/readme.html
===================================================================
--- XoopsModules/contact/trunk/contact/docs/readme.html (rev 0)
+++ XoopsModules/contact/trunk/contact/docs/readme.html 2013-02-24 07:07:43 UTC (rev 11088)
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Contact v1.6 for XOOPS 2.0.13x</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body>
+<h1>Contact - Not just another <u>Contact Us</u> page!</h1>
+<p>The first question that always comes to mind when someone see's a module like this is - <i>Why?</i><br /><br />
+For starters, there are many other versions of a Contact Us module out there - but guess what, none of them
+did what I needed, or the client I wrote this for. As with any module <a href="http://xoops.ibdeeming.com" target="_blank">XOOPS</a>@<a href="http://www.ibdeeming.com" target="_blank">IBDeeming!</a>
+puts out, I always find more options and configs that can be added. I think I have stretched this one out, and
+really expect it will meet most any need out there! Whew - now check this out...</p>
+<h2>Contact v1.6 - Updates to email deep check and From addressee</h2>
+<p>For the most part, this module is the same as v1.5. The upgrade path is very simple. The changes made are
+<ul><li>New deep check validation on submitted return email addresses<ul><li>The problem was with the socket command. Added routine to verify
+MX records first. This sped up the overall check routine.</li></ul></li><li>Added AAINC (XOOPS@IBDeeming! User) suggestion for Fomr email who</li></ul>
+</p>
+<p>Upgrading from V1.5 - V1.6 is very easy! Just copy the files, log-in as admin, go to Modules control, and Update the Contact-Us module.
+If you are successful, you should see version 1.6.</p>
+<h2>Contact V1.5 - Based on the original by Skalpa - but nothing like it anymore!</h2>
+<p><u>Contact v1.5</u> has many new features, so many that it doesn't really look like the original. First off, there are
+<b>Settings</b> and <b>General</b> configs that can be applied to the <u>Contact</u> module.
+<ul>
+ <li>Settings
+ <ul>
+ <li>Send Confirmation Switch - Basically allows the user to copy themselves on correspondence to you of your department (more on that).</li>
+ <li>Collect ICQ - on or off</li>
+ <li>Collect URL - on or off</li>
+ <li>Collect Company - on or off</li>
+ <li>Collect Location - on or off</li>
+ <li>Collect Address - on or off</li>
+ <li>Add Security Check - Security graphic - know why? It's really easy to SPAM your site with <u>Contact</u> emails, this will help deter
+ <ul>
+ <li>Sitekey definition - allows you to seed granularity</li>
+ </ul>
+ </li>
+ <li>Redirect Timeout - Allows you to set how long the redirect page is shown to the user</li>
+ <li>Validate Domain - Allows you to actually "deep-scan" the domain and tld for validity</li>
+ </ul>
+ </li>
+ <li>General
+ <ul>
+ <li>Intorduction - You can turn it on, set the heading, and the text displayed. This is great for businesses that want to show off their SNAIL address and phone numbers</li>
+ <li>Contact heading - What is your form called?</li>
+ <li>Thank You message - what your user sees</li>
+ <li>Department Definition - this is cool! Basically you can set up departments and have them assigned to dirfferent email addresses than just the site admin.</li>
+ <li>More Info - Have you ever seen those commercial contact pages where you can select from various topics to get more info? Now you can do it too!</li>
+ </ul>
+ </li>
+</ul>
+</p>
+<h2>So, How do I install <u>Contact?</u></h2>
+<p>It's really simple!
+ <ol>
+ <li>Deactivate your current Contact module</li>
+ <li>Uninstall the current Contact module</li>
+ <li>Copy <u>Contact v1.5</u> top your modules directory, overwrite all files!</li>
+ <li>Install <u>Contact v1.5</u></li>
+ <li>Verify your <u>Setting</u> and <u>General</u> sections of Contact from the Admin screen</li>
+ <li>Done!</li>
+ </ol>
+</p>
+<h2><a href="http://xoops.ibdeeming.com" target="_blank">XOOPS</a>@<a href="http://www.ibdeeming.com" target="_blank">IBDeeming!</a> Thanks You!</h2>
+<p>I appreciate you taking the time to download and use the modules created by us. If you have nay questions, you are encouraged
+to stop by and post them on our site.<br /><br />If you find our modules are worthwhile, and feel
+the need to somehow donate back to our time spent, feel free to visit the site and select the donation icon! We appreciate your support!</p>
+</body>
+</html>
Modified: XoopsModules/contact/trunk/contact/docs/readme.txt
===================================================================
--- XoopsModules/contact/trunk/contact/docs/readme.txt 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/docs/readme.txt 2013-02-24 07:07:43 UTC (rev 11088)
@@ -11,8 +11,8 @@
_____________________________________________________________________
CONTACT is a XOOPS module designed to provide XOOPS website with Contact Us area.
- This module provides Contact Information Area which can be configured in the Admin area.
-
+ This module provides Contact Information Area which can be configurated by adminstrator panel.
+
3. Requirements
_____________________________________________________________________
Modified: XoopsModules/contact/trunk/contact/include/functions_update.php
===================================================================
--- XoopsModules/contact/trunk/contact/include/functions_update.php 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/include/functions_update.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -23,8 +23,9 @@
function xoops_module_update_contact($module, $version) {
+ $xoopsDB = Database::getInstance();
+
if($version < 180) {
- $db =& Database::getInstance();
$sql = "CREATE TABLE " . $xoopsDB->prefix('contact') . " (
contact_id int(10) unsigned NOT NULL auto_increment,
contact_uid int(10) NOT NULL,
@@ -45,9 +46,37 @@
contact_reply tinyint(1) NOT NULL,
PRIMARY KEY (contact_id)
) ENGINE=MyISAM;";
- $db->query($sql);
+ $xoopsDB->query($sql);
}
-
+
+ if($version < 181) {
+ // Add contact_platform
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD `contact_platform` ENUM('Android','Ios','Web') NOT NULL DEFAULT 'Web'";
+ $xoopsDB->query($sql);
+ // Add contact_type
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD `contact_type` ENUM('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact'";
+ $xoopsDB->query($sql);
+ // Add index contact_uid
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_uid` ( `contact_uid` )";
+ $xoopsDB->query($sql);
+ // Add index contact_cid
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_cid` ( `contact_cid` )";
+ $xoopsDB->query($sql);
+ // Add index contact_create
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_create` ( `contact_create` )";
+ $xoopsDB->query($sql);
+ // Add index contact_mail
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_mail` ( `contact_mail` )";
+ $xoopsDB->query($sql);
+ // Add index contact_phone
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_phone` ( `contact_phone` )";
+ $xoopsDB->query($sql);
+ // Add index contact_platform
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_platform` ( `contact_platform` )";
+ $xoopsDB->query($sql);
+ // Add index contact_type
+ $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_type` ( `contact_type` )";
+ $xoopsDB->query($sql);
+ }
}
-
?>
\ No newline at end of file
Modified: XoopsModules/contact/trunk/contact/language/english/admin.php
===================================================================
--- XoopsModules/contact/trunk/contact/language/english/admin.php 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/language/english/admin.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -45,4 +45,10 @@
define("_AM_CONTACT_TOOLS_PRUNE","Delete Messages");
define("_AM_CONTACT_TOOLS_PRUNE_BEFORE","Delete messages that were published before");
define("_AM_CONTACT_TOOLS_PRUNE_REPLYONLY","Delete only messages with replies");
+
+define("_AM_CONTACT_LOGS_FORM","Log form");
+define("_AM_CONTACT_LOGS_COLUME","Select Colume");
+define("_AM_CONTACT_LOGS_COLUME_PHONE","Phone");
+define("_AM_CONTACT_LOGS_COLUME_URL","URL");
+define("_AM_CONTACT_LOGS_COLUME_MAIL","Email");
?>
\ No newline at end of file
Modified: XoopsModules/contact/trunk/contact/language/english/modinfo.php
===================================================================
--- XoopsModules/contact/trunk/contact/language/english/modinfo.php 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/language/english/modinfo.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -13,6 +13,8 @@
define("_MI_CONTACT_MENU_CONTACT_DESC","List of Messages");
define('_MI_CONTACT_MENU_TOOLS',"Purge");
define("_MI_CONTACT_MENU_TOOLS_DESC","Purge Tools");
+define('_MI_CONTACT_MENU_LOGS',"Logs");
+define("_MI_CONTACT_MENU_LOGS_DESC","Get Logs");
define("_MI_CONTACT_MENU_ABOUT", "About");
define("_MI_CONTACT_MENU_ABOUT_DESC" , "About this module");
define("_MI_CONTACT_MENU_HELP","Help");
Added: XoopsModules/contact/trunk/contact/language/persian/admin.php
===================================================================
--- XoopsModules/contact/trunk/contact/language/persian/admin.php (rev 0)
+++ XoopsModules/contact/trunk/contact/language/persian/admin.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -0,0 +1,54 @@
+<?php
+
+// index
+define("_AM_CONTACT_INDEX_ADMENU1","تماس با ما");
+define("_AM_CONTACT_INDEX_TOTAL","<span class='green'>%s</span> پیام درپایگاه داده ها موجود است");
+
+// Contact
+define("_AM_CONTACT_ID","شماره");
+define("_AM_CONTACT_SUBJECT","موضوع");
+define("_AM_CONTACT_DEPARTMENT","بخش");
+define("_AM_CONTACT_SUBMITTER","فرستنده");
+define("_AM_CONTACT_DATE","تاریخ ارسال");
+define("_AM_CONTACT_MESSAGE","پیام");
+define("_AM_CONTACT_EMAIL","ایمیل");
+define("_AM_CONTACT_URL","آدرس وب سایت");
+define("_AM_CONTACT_VIEWURL","مشاهده وب سایت");
+define("_AM_CONTACT_ICQ","ICQ");
+define("_AM_CONTACT_COMPANY","شرکت");
+define("_AM_CONTACT_LOCATION","شهر محل زندگی");
+define("_AM_CONTACT_IP","آی پی");
+define("_AM_CONTACT_PHONE","تلفن");
+define("_AM_CONTACT_ADDRESS","آدرس");
+define("_AM_CONTACT_ACTION","فعالیت");
+define("_AM_CONTACT_VIEW","نمایش");
+define("_AM_CONTACT_REPLY","پاسخ");
+define("_AM_CONTACT_HAVEREPLY","پاسخ داده شده");
+define("_AM_CONTACT_HAVENTREPLY","بدون پاسخ");
+
+define("_AM_CONTACT_FROM","از");
+define("_AM_CONTACT_NAMEFROM","نام");
+define("_AM_CONTACT_MAILFROM","ایمیل");
+define("_AM_CONTACT_TO","به");
+define("_AM_CONTACT_NAMETO","نام");
+define("_AM_CONTACT_MAILTO","ایمیل");
+
+define("_AM_CONTACT_TITLE","عنوان");
+define("_AM_CONTACT_INFO","اطلاعات");
+
+define("_AM_CONTACT_MSG_EXIST","پیام انتخاب شده موجود نیست");
+define("_AM_CONTACT_MSG_DELETE","آیا اطمینان دارید که میخواهید این پیام و تمام پاسخ های آن را حذف کنید؟");
+define("_AM_CONTACT_MSG_DELETEDO","پیام انتخابی شما حذف شد");
+define("_AM_CONTACT_MSG_DELETEERROR","خطا در حذف پیام");
+define("_AM_CONTACT_MSG_PRUNE_DELETED","%s پیام حذف شپ");
+
+define("_AM_CONTACT_TOOLS_PRUNE","حذف پیام ها");
+define("_AM_CONTACT_TOOLS_PRUNE_BEFORE","حذف پیام های ارسال شده قبل از ");
+define("_AM_CONTACT_TOOLS_PRUNE_REPLYONLY","فقط پیام های پاسخ داده شده را حذف کن");
+
+define("_AM_CONTACT_LOGS_FORM","فرم گزارش");
+define("_AM_CONTACT_LOGS_COLUME","انتخاب ستون مورد نیاز");
+define("_AM_CONTACT_LOGS_COLUME_PHONE","شماره تلفن");
+define("_AM_CONTACT_LOGS_COLUME_URL","وب سایت");
+define("_AM_CONTACT_LOGS_COLUME_MAIL","ای میل");
+?>
\ No newline at end of file
Added: XoopsModules/contact/trunk/contact/language/persian/index.html
===================================================================
--- XoopsModules/contact/trunk/contact/language/persian/index.html (rev 0)
+++ XoopsModules/contact/trunk/contact/language/persian/index.html 2013-02-24 07:07:43 UTC (rev 11088)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/contact/trunk/contact/language/persian/main.php
===================================================================
--- XoopsModules/contact/trunk/contact/language/persian/main.php (rev 0)
+++ XoopsModules/contact/trunk/contact/language/persian/main.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -0,0 +1,22 @@
+<?php
+define("_MD_CONTACT_FORM","فرم تماس");
+define("_MD_CONTACT_NAME","نام");
+define("_MD_CONTACT_MAIL","پست الکترونیک");
+define("_MD_CONTACT_URL","وب سایت");
+define("_MD_CONTACT_ICQ","ICQ");
+define("_MD_CONTACT_COMPANY","شرکت");
+define("_MD_CONTACT_LOCATION","شهر محل زندگی");
+define("_MD_CONTACT_PHONE","شماره تماس");
+define("_MD_CONTACT_ADDRESS","آدرس");
+define("_MD_CONTACT_SUBJECT","موضوع");
+define("_MD_CONTACT_MESSAGE","پیام");
+define("_MD_CONTACT_DEPARTMENT","بخش");
+define("_MD_CONTACT_DEFULTDEP","تماس");
+
+define("_MD_CONTACT_MES_SEND","از شما به خاطر تماس سپاسگذاریم");
+define("_MD_CONTACT_MES_NOVALIDEMAIL","پست الکترونیک شما صحیح نیست");
+define("_MD_CONTACT_MES_NOTSAVE","پیام شما در پیاگاه داده ها ذخیره نشد");
+define("_MD_CONTACT_MES_SAVEINDB","پیام شما در پایگاه داده ها ذخیره شد");
+define("_MD_CONTACT_MES_SENDERROR","خطا در هنگام ارسال پیام");
+define("_MD_CONTACT_MES_ERROR","خطا");
+?>
\ No newline at end of file
Added: XoopsModules/contact/trunk/contact/language/persian/modinfo.php
===================================================================
--- XoopsModules/contact/trunk/contact/language/persian/modinfo.php (rev 0)
+++ XoopsModules/contact/trunk/contact/language/persian/modinfo.php 2013-02-24 07:07:43 UTC (rev 11088)
@@ -0,0 +1,58 @@
+<?php
+// $Id$
+// Module Info
+
+// The name of this module
+define("_MI_CONTACT_NAME","تماس با ما");
+define("_MI_CONTACT_DESC","ساخت صفحه تماس با ما");
+
+// Admin menu
+define('_MI_CONTACT_MENU_HOME',"خانه");
+define("_MI_CONTACT_MENU_HOME_DESC","بازگشت به خانه");
+define('_MI_CONTACT_MENU_CONTACT',"تماس ها");
+define("_MI_CONTACT_MENU_CONTACT_DESC","فهرست تماس ها");
+define('_MI_CONTACT_MENU_TOOLS',"ابزار ها");
+define("_MI_CONTACT_MENU_TOOLS_DESC","ابزار های ماژول");
+define('_MI_CONTACT_MENU_LOGS',"گزارش");
+define("_MI_CONTACT_MENU_LOGS_DESC","گرفتن گزارش");
+define("_MI_CONTACT_MENU_ABOUT", "درباره");
+define("_MI_CONTACT_MENU_ABOUT_DESC" , "درباره ماژول");
+define("_MI_CONTACT_MENU_HELP", "راهنمایی");
+define("_MI_CONTACT_MENU_HELP_DESC" , "راهنمای ماژول");
+
+// Module Settings
+define("_MI_CONTACT_FORM_URL", "Get URL");
+define("_MI_CONTACT_FORM_URL_DESC", "");
+define("_MI_CONTACT_FORM_ICQ", "Get ICQ");
+define("_MI_CONTACT_FORM_ICQ_DESC", "");
+define("_MI_CONTACT_FORM_COMPANY", "Get Company");
+define("_MI_CONTACT_FORM_COMPANY_DESC", "");
+define("_MI_CONTACT_FORM_LOCATION", "Get Location");
+define("_MI_CONTACT_FORM_LOCATION_DESC", "");
+define("_MI_CONTACT_FORM_PHONE", "Get Phone");
+define("_MI_CONTACT_FORM_PHONE_DESC", "");
+define("_MI_CONTACT_FORM_ADDRESS", "Get Address");
+define("_MI_CONTACT_FORM_ADDRESS_DESC", "");
+define("_MI_CONTACT_FORM_DEPT", "Select Departments");
+define("_MI_CONTACT_FORM_DEPT_DESC", "");
+define("_MI_CONTACT_FORM_CAPTCHA", "Use Captcha");
+define("_MI_CONTACT_FORM_CAPTCHA_DESC", "");
+
+define("_MI_CONTACT_DEPT", "Departments");
+define("_MI_CONTACT_DEPT_DESC", "Departments allow you to define a department/email combination. Users selecting<br />"
+."from a defined department will have their contact information sent to the corresponding<br />"
+."email address you define.<br /><br />"
+."Define each department/email as follows:<br /><br />"
+."dept1,email1|dept2,email2|dept3,email3 etc. - each department and email must be seperated<br />"
+."by a comma ',', and each department email combination bust be seperated by a pipe '|'" );
+
+define("_MI_CONTACT_PERPAGE", "Perpage");
+define("_MI_CONTACT_PERPAGE_DESC", "");
+
+define("_MI_CONTACT_TOPINFO", "Header contact form");
+define("_MI_CONTACT_TOPINFO_DESC", "Set HTML codes for show in contact page");
+
+define("_MI_CONTACT_HEAD_OPTIONS", "Form Options");
+define("_MI_CONTACT_HEAD_ADMIN", "Admin setting");
+define("_MI_CONTACT_HEAD_INFO", "Information");
+?>
\ No newline at end of file
Deleted: XoopsModules/contact/trunk/contact/readme.html
===================================================================
--- XoopsModules/contact/trunk/contact/readme.html 2013-02-24 06:58:04 UTC (rev 11087)
+++ XoopsModules/contact/trunk/contact/readme.html 2013-02-24 07:07:43 UTC (rev 11088)
@@ -1,70 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>Contact v1.6 for XOOPS 2.0.13x</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-</head>
-
-<body>
-<h1>Contact - Not just another <u>Contact Us</u> page!</h1>
-<p>The first question that always comes to mind when someone see's a module like this is - <i>Why?</i><br /><br />
-For starters, there are many other versions of a Contact Us module out there - but guess what, none of them
-did what I needed, or the client I wrote this for. As with any module <a href="http://xoops.ibdeeming.com" target="_blank">XOOPS</a>@<a href="http://www.ibdeeming.com" target="_blank">IBDeeming!</a>
-puts out, I always find more options and configs that can be added. I think I have stretched this one out, and
-really expect it will meet most any need out there! Whew - now check this out...</p>
-<h2>Contact v1.6 - Updates to email deep check and From addressee</h2>
-<p>For the most part, this module is the same as v1.5. The upgrade path is very simple. The changes made are
-<ul><li>New deep check validation on submitted return email addresses<ul><li>The problem was with the socket command. Added routine to verify
-MX records first. This sped up the overall check routine.</li></ul></li><li>Added AAINC (XOOPS@IBDeeming! User) suggestion for Fomr email who</li></ul>
-</p>
-<p>Upgrading from V1.5 - V1.6 is very easy! Just copy the files, log-in as admin, go to Modules control, and Update the Contact-Us module.
-If you are successful, you should see version 1.6.</p>
-<h2>Contact V1.5 - Based on the original by Skalpa - but nothing like it anymore!</h2>
-<p><u>Contact v1.5</u> has many new features, so many that it doesn't really look like the original. First off, there are
-<b>Settings</b> and <b>General</b> configs that can be applied to the <u>Contact</u> module.
-<ul>
- <li>Settings
- <ul>
- <li>Send Confirmation Switch - Basically allows the user to copy themselves on correspondence to you of your department (more on that).</li>
- <li>Collect ICQ - on or off</li>
- <li>Collect URL - on or off</li>
- <li>Collect Company - on or off</li>
- <li>Collect Location - on or off</li>
- <li>Collect Address - on or off</li>
- <li>Add Security Check - Security graphic - know why? It's really easy to SPAM your site with <u>Contact</u> emails, this will help deter
- <ul>
- <li>Sitekey definition - allows you to seed granularity</li>
- </ul>
- </li>
- <li>Redirect Timeout - Allows you to set how long the redirect page is shown to the user</li>
- <li>Validate Domain - Allows you to actually "deep-scan" the domain and tld for validity</li>
- </ul>
- </li>
- <li>General
- <ul>
- <li>Int...
[truncated message content] |