You can subscribe to this list here.
2012 |
Jan
|
Feb
(214) |
Mar
(139) |
Apr
(198) |
May
(187) |
Jun
(151) |
Jul
(210) |
Aug
(169) |
Sep
(58) |
Oct
(53) |
Nov
(54) |
Dec
(301) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2013 |
Jan
(348) |
Feb
(178) |
Mar
(219) |
Apr
(154) |
May
(117) |
Jun
(194) |
Jul
(61) |
Aug
(132) |
Sep
(121) |
Oct
(110) |
Nov
(11) |
Dec
(18) |
2014 |
Jan
(34) |
Feb
(50) |
Mar
(82) |
Apr
(98) |
May
(39) |
Jun
(111) |
Jul
(67) |
Aug
(36) |
Sep
(33) |
Oct
(26) |
Nov
(53) |
Dec
(44) |
2015 |
Jan
(29) |
Feb
(47) |
Mar
(25) |
Apr
(19) |
May
(23) |
Jun
(20) |
Jul
(49) |
Aug
(7) |
Sep
(10) |
Oct
(10) |
Nov
(4) |
Dec
(25) |
2016 |
Jan
(8) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(5) |
2017 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(15) |
Jun
|
Jul
(18) |
Aug
(24) |
Sep
|
Oct
(14) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
(22) |
Mar
|
Apr
(11) |
May
(1) |
Jun
(17) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(5) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <du...@us...> - 2012-10-17 00:12:36
|
Revision: 10225 http://sourceforge.net/p/xoops/svn/10225 Author: dugris Date: 2012-10-17 00:12:33 +0000 (Wed, 17 Oct 2012) Log Message: ----------- Fix for compatibility Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2012-10-16 07:36:36 UTC (rev 10224) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/include/functions.php 2012-10-17 00:12:33 UTC (rev 10225) @@ -171,7 +171,7 @@ { $xoops = Xoops::getInstance(); $xoops->logger->addDeprecated(__FUNCTION__ . ' is deprecated since XOOPS 2.6.0. See how to replace it in file ' . __FILE__ . ' line ' . __LINE__); - $xoops->error($hiddens, $action, $msg, $submit, $addtoken); + $xoops->confirm($hiddens, $action, $msg, $submit, $addtoken); } /** |
From: <wis...@us...> - 2012-10-16 07:36:51
|
Revision: 10224 http://sourceforge.net/p/xoops/svn/10224 Author: wishcraft Date: 2012-10-16 07:36:36 +0000 (Tue, 16 Oct 2012) Log Message: ----------- XFriendica Class & Packages Design (Alpha) Modified Paths: -------------- XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/hash.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/md5/md5.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/password/password.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/sha1/sha1.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/xoopscrc/xoopscrc.php Added Paths: ----------- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/ciphers.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/3des/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/3des/3des.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/crypt/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/crypt/crypt.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mars/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mars/mars.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mcrypt.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/panama/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/panama/panama.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc2/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc2/rc2.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc4/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc4/rc4.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc6/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc6/rc6.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer128/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer128/safer128.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer64/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer64/safer64.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/saferplus/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/saferplus/saferplus.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/serpent/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/serpent/serpent.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/skipjack/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/skipjack/skipjack.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/threeway/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/threeway/threeway.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/tripledes/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/tripledes/tripledes.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/twofish/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/twofish/twofish.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/wake/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/wake/wake.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/xtea/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/xtea/xtea.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/openssl/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/openssl/certificates/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/openssl/certificates/certificates.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/openssl/certificates/generate.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/openssl/certificates/mount.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/openssl/certificates/private.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/openssl/certificates/public.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/openssl/openssl.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/php/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/php/aes/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/php/aes/aes.class.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/php/aes/aes.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/php/php.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/guid/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/guid/guid.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/guid/index.html XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/salt/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/salt/index.html XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/salt/salt.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/base64/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/base64/base64.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/json/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/json/json.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/packages.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/serial/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/serial/serial.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/url/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/url/url.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/xml/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/packages/xml/xml.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/transport/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/transport/curl/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/transport/soap/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/transport/wget/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/curl/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/curl/curl.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/curl/pull/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/curl/pull/pull.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/curl/push/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/curl/push/push.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/protocols.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/rest/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/rest/pull/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/rest/pull/pull.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/rest/push/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/rest/push/push.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/rest/rest.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/soap/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/soap/pull/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/soap/pull/pull.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/soap/push/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/soap/push/push.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/soap/soap.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/wget/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/wget/curl.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/wget/pull/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/wget/pull/pull.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/wget/push/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/wget/push/push.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xips/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xips/pull/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xips/pull/pull.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xips/push/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xips/push/push.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xips/xips.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xsnep/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xsnep/pull/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xsnep/pull/pull.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xsnep/push/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xsnep/push/push.php XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/xsnep/xsnep.php Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/ciphers.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/ciphers.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/ciphers.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,208 @@ +<?php +/** + * XOOPS checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: xoopshash.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + +/** + * A checksum Class for hashing data. + * + * @abstract + */ +class XFriendicaCiphers { + + // Child Checksum/Ciphers Storage + var $_class = array(); + + // Errors Storage Mechanism + var $_errors = array(); + + // Last Checksum Calculated + var $_data = ''; + + // Last Type Cipherses/Checksums Used + var $_type = 'php'; + + // Default Options for the Preset Cipherses/Checksums + var $_options = array( 'php' => array('algorithm'=>'aes'), + 'mcrypt' => array('algorithm'=>'tripledes'), + 'openssl' => array() + ); + + private static $_vars = array( 'class' => array(), + 'data' => '', + 'type' => 'php', + 'options' => array( 'php' => array('algorithm'=>'aes'), + 'mcrypt' => array('algorithm'=>'tripledes'), + 'openssl' => array()) + ); + + /** + * Constructor + * + * @param string $data + * @param string $type + * @param array $options + */ + function __construct() { + foreach($this->_options as $package => $options) { + $this->setType($package); + } + } + + /** + * function __call + * magic method for calling checksum types as a function + * + * ie. + * $objsCiphers = new XFriendicaCiphers(); // Instanciate the Object + * $objsCiphers->md5($data); // Returns MD5 Checksum + * $objsCiphers->sha1($data); // Returns SHA1 Checksum + * $objsCiphers->xoopscrc($data); // Returns XoopsCrc Checksum + * $objsCiphers->password($data); // Returns Password Checksum + * + * @param string $type + * @param array $args + */ + function __call($type, $args) { + $parts = array(); + foreach($this->_class as $type => $handler) { + if (substr($type, 0, strlen('encrypt_'))=='encrypt_') { + $parts = explode('_', $type); + } elseif (substr($type, 0, strlen('decrypt_'))=='decrypt_') { + $parts = explode('_', $type); + } + if (count($parts)==2 && method_exists($handler, $type)) { + return $handler->{$type}($args[0], $args[1]); + } + }; + } + + /** + * function __callStatic + * magic method for calling checksum statically as types in function + * + * ie. + * XFriendicaCiphers::md5($data); // Returns MD5 Checksum + * XFriendicaCiphers::sha1($data); // Returns SHA1 Checksum + * XFriendicaCiphers::xoopscrc($data); // Returns XoopsCrc Checksum + * XFriendicaCiphers::password($data); // Returns Password Checksum + * + * @param string $type + * @param array $args + */ + function __callStatic($type, $args) { + if (empty($args[1])&&isset(self::$_vars['options'][$type])) + $args[1] = self::$_vars['options'][$type]; + return self::calcStatic($args[0], $type, $args[1]); + } + + /** + * function calc + * For calculating a hash/checksum after class is instanciated + * + * @param string $data + * @param string $type + * @param array $options + */ + function encrypt($data, $salt = '', $type = 'php') { + if (isset($this->_class[$type])) { + $this->_type = $type; + } elseif ($this->setType($type)) { + $this->_type = $type; + } + if (is_object($this->_class[$type])) + return $this->_class[$type]->encrypt($data, $salt); + else + $this->_errors[] = 'Error: XFriendicaCiphers Class Not Set'; + return false; + } + + /** + * function calc + * For calculating a hash/checksum after class is instanciated + * + * @param string $data + * @param string $type + * @param array $options + */ + function decrypt($data, $salt = '', $type = 'php') { + if (isset($this->_class[$type])) { + $this->_type = $type; + } elseif ($this->setType($type)) { + $this->_type = $type; + } + if (is_object($this->_class[$type])) + return $this->_class[$type]->decrypt($data, $salt); + else + $this->_errors[] = 'Error: XFriendicaCiphers Class Not Set'; + return false; + } + + /** + * private function setType + * For load a child Class and instaniating it + * + * @param string $type + * @param string $data + * @param array $options + */ + private function setType($type) { + if (file_exists(dirname(__FILE__).DS.$type.DS.$type.'.php')) { + if (!class_exists('XFriendicaCiphers'.ucfirst($type))) + include_once(dirname(__FILE__).DS.$type.DS.$type.'.php'); + $class = 'XFriendicaCiphers'.ucfirst($type); + if (class_exists($class)) { + $this->_type = $type; + $this->_class[$type] = new $class($this); + return true; + } else { + $this->_errors[] = 'Error: XFriendicaCiphers Child Class Does not Exist - '.$class.' missing.'; + } + } else { + $this->_errors[] = 'Error: XFriendicaCiphers Child Class Definition File Does not Exist - '.DS.$type.DS.$type.'.php missing.'; + } + return false; + } + + /** + * private function setTypeStatic + * For using child class statically + * + * @param string $type + * @param string $data + * @param array $options + */ + private function setTypeStatic($type, $data, $options) { + if (file_exists(dirname(__FILE__).DS.$type.DS.$type.'.php')) { + include_once(dirname(__FILE__).DS.$type.DS.$type.'.php'); + $class = 'XFriendicaCiphers'.ucfirst($type).'Static'; + if (class_exists($class)) { + return new $class(null, 'static'); + } + } + return false; + } + + /** + * function getErrorsHtml + * Gets the Errors as HTML for xoops_error() Function + * + */ + function getErrorsHtml() { + return implode('<br/>', $this->_errors); + } +} \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/3des/3des.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/3des/3des.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/3des/3des.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCrypt3Des extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_3DES; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data)) + $this->_data = $this->{$this->_method['encrypt']}($data, $salt); + break; + case 'static': + return $this->{$this->_method['encrypt']}($data, $salt); + } + } else { + trigger_error('MCrypt PHP Extension not Loaded is Required for '.__CLASS__. '::'.__FUNCTION__.' in file '.__FILE__, E_ERROR); + } + } + + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->{$this->_method['encrypt']}($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->{$this->_method['decrypt']}($data, $salt); + } + + /** + * private function crypt + * For calculating an Encryption + * + * @param string $data + * @param string $salt + */ + private function encrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $encrypted_data = mcrypt_generic($this->_cipher, $data); + return $encrypted_data; + } + + /** + * private function decrypt + * For calculating an Decryption + * + * @param string $data + * @param string $salt + */ + private function decrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $decrypted_data = mdecrypt_generic($this->_cipher, $data); + return $decrypted_data; + } + + function __destruct() { + mcrypt_generic_deinit($this->_cipher); + mcrypt_module_close($this->_cipher); + } +} + +/** + * A 3Des MCrypt wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCiphersMCrypt3DesStatic extends XFriendicaCiphersMCrypt3Des +{ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + return parent::__construct($data, $salt, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/crypt/crypt.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/crypt/crypt.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/crypt/crypt.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCryptCrypt extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_CRYPT; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data)) + $this->_data = $this->{$this->_method['encrypt']}($data, $salt); + break; + case 'static': + return $this->{$this->_method['encrypt']}($data, $salt); + } + } else { + trigger_error('MCrypt PHP Extension not Loaded is Required for '.__CLASS__. '::'.__FUNCTION__.' in file '.__FILE__, E_ERROR); + } + } + + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->{$this->_method['encrypt']}($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->{$this->_method['decrypt']}($data, $salt); + } + + /** + * private function crypt + * For calculating an Encryption + * + * @param string $data + * @param string $salt + */ + private function encrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $encrypted_data = mcrypt_generic($this->_cipher, $data); + return $encrypted_data; + } + + /** + * private function decrypt + * For calculating an Decryption + * + * @param string $data + * @param string $salt + */ + private function decrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $decrypted_data = mdecrypt_generic($this->_cipher, $data); + return $decrypted_data; + } + + function __destruct() { + mcrypt_generic_deinit($this->_cipher); + mcrypt_module_close($this->_cipher); + } +} + +/** + * A Crypt MCrypt wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCiphersMCryptCryptStatic extends XFriendicaCiphersMCryptCrypt +{ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + return parent::__construct($data, $salt, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mars/mars.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mars/mars.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mars/mars.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCryptMars extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_MARS; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data)) + $this->_data = $this->{$this->_method['encrypt']}($data, $salt); + break; + case 'static': + return $this->{$this->_method['encrypt']}($data, $salt); + } + } else { + trigger_error('MCrypt PHP Extension not Loaded is Required for '.__CLASS__. '::'.__FUNCTION__.' in file '.__FILE__, E_ERROR); + } + } + + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->{$this->_method['encrypt']}($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->{$this->_method['decrypt']}($data, $salt); + } + + /** + * private function crypt + * For calculating an Encryption + * + * @param string $data + * @param string $salt + */ + private function encrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $encrypted_data = mcrypt_generic($this->_cipher, $data); + return $encrypted_data; + } + + /** + * private function decrypt + * For calculating an Decryption + * + * @param string $data + * @param string $salt + */ + private function decrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $decrypted_data = mdecrypt_generic($this->_cipher, $data); + return $decrypted_data; + } + + function __destruct() { + mcrypt_generic_deinit($this->_cipher); + mcrypt_module_close($this->_cipher); + } +} + +/** + * A Crypt MCrypt wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCiphersMCryptMarsStatic extends XFriendicaCiphersMCryptMars +{ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + return parent::__construct($data, $salt, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mcrypt.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mcrypt.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/mcrypt.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,189 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCipherMcrypt extends XFriendicaCipher +{ + /** + * function name and class typecast + * + */ + var $_preferences = array( 0 => 'tripledes', + 1 => '3des', + 2 => 'threeway', + 3 => 'twofish', + 4 => 'mars', + 5 => 'panama', + 6 => 'serpent', + 7 => 'crypt', + 8 => 'rc2', + 9 => 'rc4', + 10 => 'rc6', + 11 => 'saferplus', + 12 => 'safer128', + 13 => 'safer64', + 14 => 'slipjack', + 15 => 'wake', + 16 => 'xtea' + ); + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCipher ($this) + * + */ + var $_parent = ''; + + + /** + * algorithm for MCrypt from XFriendicaCipher ($this) + * + */ + var $_algorithm = ''; + + /** + * algorithms Objects for MCrypt from XFriendicaCipher ($this) + * + */ + var $_algorithms = array(); + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $options, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_list_algorithms')) { + foreach(mcrypt_list_algorithms() as $algorithm) { + if (empty($this->_algorithm)) { + if ($algorithm == $options['algorithm']) { + $this->_algorithm = $options['algorithm']; + } + if (in_array($algorithm, $this->_preferences)) { + $this->_algorithm = $algorithm; + } + } + } + @loadAlgorithm($this->_algorithm); + } + } + + function getAlgorithms() { + return $_preferences; + } + + /** + * private function loadAlgorithm + * For Loading an Algorithm Child Class + * + * @param string $dirname + */ + private function loadAlgorithm($dirname) { + if (!in_array($dirname, mcrypt_list_algorithms())) { + trigger_error('MCrypt Algorithm '. $dirname. ' doesn\'t exist in '.__CLASS__.'::'.__FUNCTION__. ' in file '.__FILE__, E_ERROR); + return false; + } + if (!isset($this->_algorithms[$dirname])) { + include_once dirname(__FILE__).DS.$dirname.DS.$dirname.'.php'; + $class = 'XFriendicaCipherMCrypt'.ucfirst($dirname); + $this->_algorithms[$dirname] = new $class('', '', $this, 'inherit'); + } + return true; + } + + + function __call($type, $args) { + $parts = array(); + if (substr($type, 0, strlen('encrypt_'))=='encrypt_') { + $parts = explode('_', $type); + if (!in_array($parts[1], $this->_preferences)) { + return false; + } + } elseif (substr($type, 0, strlen('decrypt_'))=='decrypt_') { + $parts = explode('_', $type); + if (!in_array($parts[1], $this->_preferences)) { + return false; + } + } + if (count($parts)==2&&loadAlgorithm($parts[1])==true) { + switch ($parts[0]) { + case 'encrypt': + return $this->_algorithms[$parts[0]]->cipher($args[0], $args[1]); + break; + case 'decrypt': + return $this->_algorithms[$parts[0]]->decipher($args[0], $args[1]); + break; + } + } + } + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->_algorithms[$this->_algorithm]->cipher($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->_algorithms[$this->_algorithm]->decipher($data, $salt); + } + +} + +/** + * A md5 checksum wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCipherMcryptStatic extends XFriendicaCipherMcrypt +{ + function __construct($data, $options, $parent, $mode = 'inhertit') { + return parent::__construct($data, $options, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/panama/panama.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/panama/panama.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/panama/panama.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCryptPanama extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_PANAMA; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data)) + $this->_data = $this->{$this->_method['encrypt']}($data, $salt); + break; + case 'static': + return $this->{$this->_method['encrypt']}($data, $salt); + } + } else { + trigger_error('MCrypt PHP Extension not Loaded is Required for '.__CLASS__. '::'.__FUNCTION__.' in file '.__FILE__, E_ERROR); + } + } + + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->{$this->_method['encrypt']}($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->{$this->_method['decrypt']}($data, $salt); + } + + /** + * private function crypt + * For calculating an Encryption + * + * @param string $data + * @param string $salt + */ + private function encrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $encrypted_data = mcrypt_generic($this->_cipher, $data); + return $encrypted_data; + } + + /** + * private function decrypt + * For calculating an Decryption + * + * @param string $data + * @param string $salt + */ + private function decrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $decrypted_data = mdecrypt_generic($this->_cipher, $data); + return $decrypted_data; + } + + function __destruct() { + mcrypt_generic_deinit($this->_cipher); + mcrypt_module_close($this->_cipher); + } +} + +/** + * A Crypt MCrypt wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCiphersMCryptPanamaStatic extends XFriendicaCiphersMCryptPanama +{ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + return parent::__construct($data, $salt, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc2/rc2.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc2/rc2.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc2/rc2.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCryptRc2 extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_RC2; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data)) + $this->_data = $this->{$this->_method['encrypt']}($data, $salt); + break; + case 'static': + return $this->{$this->_method['encrypt']}($data, $salt); + } + } else { + trigger_error('MCrypt PHP Extension not Loaded is Required for '.__CLASS__. '::'.__FUNCTION__.' in file '.__FILE__, E_ERROR); + } + } + + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->{$this->_method['encrypt']}($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->{$this->_method['decrypt']}($data, $salt); + } + + /** + * private function crypt + * For calculating an Encryption + * + * @param string $data + * @param string $salt + */ + private function encrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $encrypted_data = mcrypt_generic($this->_cipher, $data); + return $encrypted_data; + } + + /** + * private function decrypt + * For calculating an Decryption + * + * @param string $data + * @param string $salt + */ + private function decrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $decrypted_data = mdecrypt_generic($this->_cipher, $data); + return $decrypted_data; + } + + function __destruct() { + mcrypt_generic_deinit($this->_cipher); + mcrypt_module_close($this->_cipher); + } +} + +/** + * A Crypt MCrypt wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCiphersMCryptRc2Static extends XFriendicaCiphersMCryptRc2 +{ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + return parent::__construct($data, $salt, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc4/rc4.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc4/rc4.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc4/rc4.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCryptRc4 extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_RC4; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data)) + $this->_data = $this->{$this->_method['encrypt']}($data, $salt); + break; + case 'static': + return $this->{$this->_method['encrypt']}($data, $salt); + } + } else { + trigger_error('MCrypt PHP Extension not Loaded is Required for '.__CLASS__. '::'.__FUNCTION__.' in file '.__FILE__, E_ERROR); + } + } + + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->{$this->_method['encrypt']}($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->{$this->_method['decrypt']}($data, $salt); + } + + /** + * private function crypt + * For calculating an Encryption + * + * @param string $data + * @param string $salt + */ + private function encrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $encrypted_data = mcrypt_generic($this->_cipher, $data); + return $encrypted_data; + } + + /** + * private function decrypt + * For calculating an Decryption + * + * @param string $data + * @param string $salt + */ + private function decrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $decrypted_data = mdecrypt_generic($this->_cipher, $data); + return $decrypted_data; + } + + function __destruct() { + mcrypt_generic_deinit($this->_cipher); + mcrypt_module_close($this->_cipher); + } +} + +/** + * A Crypt MCrypt wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCiphersMCryptRc4Static extends XFriendicaCiphersMCryptRc4 +{ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + return parent::__construct($data, $salt, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc6/rc6.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc6/rc6.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/rc6/rc6.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCryptRc6 extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_RC6; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data)) + $this->_data = $this->{$this->_method['encrypt']}($data, $salt); + break; + case 'static': + return $this->{$this->_method['encrypt']}($data, $salt); + } + } else { + trigger_error('MCrypt PHP Extension not Loaded is Required for '.__CLASS__. '::'.__FUNCTION__.' in file '.__FILE__, E_ERROR); + } + } + + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->{$this->_method['encrypt']}($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->{$this->_method['decrypt']}($data, $salt); + } + + /** + * private function crypt + * For calculating an Encryption + * + * @param string $data + * @param string $salt + */ + private function encrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $encrypted_data = mcrypt_generic($this->_cipher, $data); + return $encrypted_data; + } + + /** + * private function decrypt + * For calculating an Decryption + * + * @param string $data + * @param string $salt + */ + private function decrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $decrypted_data = mdecrypt_generic($this->_cipher, $data); + return $decrypted_data; + } + + function __destruct() { + mcrypt_generic_deinit($this->_cipher); + mcrypt_module_close($this->_cipher); + } +} + +/** + * A Crypt MCrypt wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCiphersMCryptRc6Static extends XFriendicaCiphersMCryptRc6 +{ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + return parent::__construct($data, $salt, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer128/safer128.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer128/safer128.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer128/safer128.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCryptSafer128 extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_SAFER128; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data)) + $this->_data = $this->{$this->_method['encrypt']}($data, $salt); + break; + case 'static': + return $this->{$this->_method['encrypt']}($data, $salt); + } + } else { + trigger_error('MCrypt PHP Extension not Loaded is Required for '.__CLASS__. '::'.__FUNCTION__.' in file '.__FILE__, E_ERROR); + } + } + + /** + * function cipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function cipher($data, $salt) { + return $this->{$this->_method['encrypt']}($data, $salt); + } + + /** + * function decipher + * For Calculating an Checksum from Parent Class + * + * @param string $data + * @param string $salt + */ + function decipher($data, $salt) { + return $this->{$this->_method['decrypt']}($data, $salt); + } + + /** + * private function crypt + * For calculating an Encryption + * + * @param string $data + * @param string $salt + */ + private function encrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $encrypted_data = mcrypt_generic($this->_cipher, $data); + return $encrypted_data; + } + + /** + * private function decrypt + * For calculating an Decryption + * + * @param string $data + * @param string $salt + */ + private function decrypt($data, $salt) { + mcrypt_generic_init($this->_cipher, $salt, $this->_cipher_iv); + $decrypted_data = mdecrypt_generic($this->_cipher, $data); + return $decrypted_data; + } + + function __destruct() { + mcrypt_generic_deinit($this->_cipher); + mcrypt_module_close($this->_cipher); + } +} + +/** + * A Crypt MCrypt wrapper class for hashing data statically. + * + * @abstract + */ +class XFriendicaCiphersMCryptSafer128Static extends XFriendicaCiphersMCryptSafer128 +{ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + return parent::__construct($data, $salt, $parent, 'static'); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer64/safer64.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer64/safer64.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ciphers/mcrypt/safer64/safer64.php 2012-10-16 07:36:36 UTC (rev 10224) @@ -0,0 +1,158 @@ +<?php +/** + * XOOPS crypt checksum handler + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package kernel + * @since 2.5.5 + * @author Simon Roberts (AKA wishcraft) http://www.chronolabs.com.au/ + * @version $Id: crypt.php 8066 2012-09-08 12:19:00Z wishcraft $ + */ + + +/** + * A crypt checksum wrapper class for hashing data. + * + */ +class XFriendicaCiphersMCryptSafer64 extends XFriendicaCiphers +{ + /** + * function name and class typecast + * + */ + var $_func = MCRYPT_SAFER64; + + /** + * method name for calculation of checksum + * + */ + var $_method = array( 'encrypt' => 'encrypt', + 'decrypt' => 'decrypt' + ); + + /** + * class name of this class + * + */ + var $_name = __CLASS__; + + /** + * parent object from XFriendicaCiphers ($this) + * + */ + var $_parent = ''; + + /** + * chipher object from XFriendicaCiphers ($this) + * + */ + var $_cipher = ''; + + /** + * chipher_iv object from XFriendicaCiphers ($this) + * + */ + var $_cipher_iv = ''; + + /** + * Constructor + * + * @param string $data + * @param string $salt + * @param object $parent + */ + function __construct($data, $salt, $parent, $mode = 'inhertit') { + if (function_exists('mcrypt_module_open')) { + $this->_cipher = mcrypt_module_open($this->_func); + $this->_cipher_iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($this->_cipher), MCRYPT_RAND); + + switch ($mode) { + default: + $this->_parent = $parent; + if (empty($salt)&&is_object($this->_parent)) + $salt = $this->_parent->_options[$this->_func]; + if (!empty($data... [truncated message content] |
From: <du...@us...> - 2012-10-15 23:26:17
|
Revision: 10223 http://sourceforge.net/p/xoops/svn/10223 Author: dugris Date: 2012-10-15 23:26:13 +0000 (Mon, 15 Oct 2012) Log Message: ----------- xcaptcha 1.00 alpha (Xoops CAPTCHA configuration) System extensions for xoops 2.6.x Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/about.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/footer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/header.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/menu.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/moduladmin.css XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/changelog.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/logo_large.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/logo_small.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/blackglass.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/clean.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/red.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/white.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/xcaptcha_logo.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/help.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/modinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/about.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/about.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/about.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,30 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +include dirname(__FILE__) . '/header.php'; + +$xoops->header(); +$xoops->theme->addStylesheet('modules/xcontact/css/moduladmin.css'); + +$admin_page = new XoopsModuleAdmin(); + +$admin_page->renderNavigation('about.php'); +$admin_page->renderAbout(); +$xoops->footer(); +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/about.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/footer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/footer.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/footer.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,21 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +$xoops->footer(); +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/footer.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/header.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/header.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/header.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,41 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; + +$op = ''; +if ( isset( $_POST ) ){ + foreach ( $_POST as $k => $v ) { + ${$k} = $v; + } +} +if ( isset( $_GET ) ){ + foreach ( $_GET as $k => $v ) { + ${$k} = $v; + } +} + +XoopsLoad::load('system', 'system'); + +$xoops = Xoops::getInstance(); +$system = System::getInstance(); + +include_once dirname(dirname(__FILE__)) . '/class/xcaptcha.php'; +$xcaptcha_handler = new Xcaptcha(); +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/header.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,66 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +include dirname(__FILE__) . '/header.php'; + +switch ( $op ) { + case 'save': + if ( !$GLOBALS['xoopsSecurity']->check() ) { + redirect_header('index.php', 5, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if ( $type == 'config' ) { + $config = $xcaptcha_handler->VerifyData(); + $xcaptcha_handler->writeConfig('captcha.config', $config ); + redirect_header('index.php?type=config', 5, _AM_XCAPTCHA_SAVED); + } else { + if ($xcaptcha_handler->loadPluginHandler( $type )) { + $config = $xcaptcha_handler->Pluginhandler->VerifyData(); + $xcaptcha_handler->writeConfig('captcha.config.' . $type, $config ); + redirect_header('index.php?type=' . $type, 5, _AM_XCAPTCHA_SAVED); + } + } + break; + + case 'default': + default: + $type = isset($type) ? $type : 'config'; + + $xoops->header(); + $xoops->theme->addStylesheet('modules/xcaptcha/css/moduladmin.css'); + + $admin_page = new XoopsModuleAdmin(); + if ( $type == 'config' ) { + $admin_page->renderNavigation('index.php?type=config'); + $admin_page->addInfoBox(_AM_XCAPTCHA_FORM); + $admin_page->addInfoBoxLine($xcaptcha_handler->getForm()); + } else { + if ($xcaptcha_handler->loadPluginHandler( $type )) { + $title = constant('_XCAPTCHA_FORM_' . strtoupper($type) ); + $admin_page->addInfoBox( $title ); + $admin_page->addInfoBoxLine($xcaptcha_handler->Pluginhandler->getForm()); + } else { + redirect_header('index.php', 5, _AM_XCAPTCHA_ERROR); + } + } + $admin_page->renderIndex(); + + break; +} +include dirname(__FILE__) . '/footer.php'; +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/menu.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/menu.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/menu.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,46 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +$cpt = 1; +$adminmenu[$cpt]['title'] = _MI_XCAPTCHA_INDEX; +$adminmenu[$cpt]['link'] = 'admin/index.php'; +$adminmenu[$cpt]['icon'] = 'home.png'; + +static $xcaptcha_handler; +if (!isset($xcaptcha_handler)) { + include_once dirname(dirname(__FILE__)) . '/class/xcaptcha.php'; + $xcaptcha_handler = new Xcaptcha(); +} + +$xoops = Xoops::getInstance(); + +foreach ( array_keys($xcaptcha_handler->getPluginList()) as $key ) { + $cpt++; + $xoops->loadLanguage($key, 'xcaptcha'); + + $adminmenu[$cpt]['title'] = constant('_MI_XCAPTCHA_ADMENU_' . strtoupper($key) ); + $adminmenu[$cpt]['link'] = 'admin/index.php?type=' . $key; + $adminmenu[$cpt]['icon'] = 'administration.png'; +} + +$cpt++; +$adminmenu[$cpt]['title'] = _MI_XCAPTCHA_ABOUT; +$adminmenu[$cpt]['link'] = 'admin/about.php'; +$adminmenu[$cpt]['icon'] = 'about.png'; +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/menu.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,161 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class Xcaptcha extends XoopsCaptcha +{ + public $captchaHandler; + public $config = array(); + public $plugin_List = array(); + public $plugin_config = array(); + public $xcaptcha_path_plugin; + + public function __construct() + { + $this->captchaHandler = XoopsCaptcha::getInstance(); + $this->config = $this->loadConfig(); + $this->plugin_List = $this->getPluginList(); + $this->plugin_config = $this->loadConfigPlugin(); + $this->xcaptcha_path_plugin = XOOPS_ROOT_PATH . '/modules/xcaptcha/plugins'; + } + + public function Xcaptcha() + { + $this->__construct(); + } + + static function getInstance() + { + static $instance; + if (!isset($instance)) { + $class = __CLASS__; + $instance = new $class(); + } + return $instance; + } + + + public function loadConfig( $name = 'config') + { + return $this->captchaHandler->loadConfig( $name ); + } + + public function loadBasicConfig($filename = null) + { + return $this->captchaHandler->loadBasicConfig( $filename ); + } + + public function readConfig( $file = 'config') + { + return $this->captchaHandler->readConfig( $file ); + } + + public function writeConfig($file = 'config', $data) + { + return $this->captchaHandler->writeConfig( $file, $data ); + } + + public function getPluginList() + { + $ret = array(); + + foreach (glob($this->captchaHandler->path_basic . '/config.*.php') as $filename) { + $plugin_List = preg_replace('/(config\.)(.*)(\.php)/', '$2', basename($filename) ); + $ret[$plugin_List] = $plugin_List; + } + return $ret; + } + + public function loadConfigPlugin() + { + $config = array(); + foreach ($this->plugin_List as $key ) { + $config = $this->loadConfig( $key ); + } + return $config; + } + + public function getForm() + { + $captcha_form = new XoopsThemeForm('', 'xcaptchaform', 'index.php', 'post', true); + + $activate = new XoopsFormRadio(_AM_XCAPTCHA_ACTIVATE, 'disabled', $this->config['disabled'] ); + $activate->addOption(1, _AM_XCAPTCHA_ENABLE); + $activate->addOption(0, _AM_XCAPTCHA_DISABLE); + $captcha_form->addElement($activate, false); + + $plugin_List = new XoopsFormSelect(_AM_XCAPTCHA_PLUGINS, 'mode', $this->config['mode'] ); + $plugin_List->addOptionArray( $this->plugin_List ); + $captcha_form->addElement($plugin_List, false); + + $captcha_form->addElement(new XoopsFormText(_AM_XCAPTCHA_NAME, 'name', 50, 50, $this->config['name'] ), true); + + $skipmember = new XoopsFormRadio(_AM_XCAPTCHA_SKIPMEMBER, 'skipmember', $this->config['skipmember'] ); + $skipmember->addOption(1, _AM_XCAPTCHA_ENABLE); + $skipmember->addOption(0, _AM_XCAPTCHA_DISABLE); + $captcha_form->addElement($skipmember, false); + + $captcha_form->addElement(new XoopsFormText(_AM_XCAPTCHA_MAXATTEMPTS, 'maxattempts', 2, 2, $this->config['maxattempts'] ), true); + + + $captcha_form->addElement(new XoopsFormHidden('type', 'config' )); + + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + $button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); + $captcha_form->addElement($button_tray); + + ob_start(); + $captcha_form->render(); + $ret = ob_get_contents(); + ob_end_clean(); + + return $ret; + } + + public function VerifyData() + { + global $system; + $config = array(); + $_POST['disabled'] = $system->CleanVars($_POST, 'disabled', false, 'boolean'); + $_POST['mode'] = $system->CleanVars($_POST, 'mode', 'image', 'string'); + $_POST['name'] = $system->CleanVars($_POST, 'name', 'xoopscaptcha', 'string'); + $_POST['skipmember'] = $system->CleanVars($_POST, 'skipmember', false, 'boolean'); + $_POST['maxattempts'] = $system->CleanVars($_POST, 'maxattempts', 10, 'int'); + foreach ( array_keys($this->config) as $key) { + $config[$key] = $_POST[$key]; + } + return $config; + } + + public function loadPluginHandler($name = null) + { + $name = empty($name) ? 'text' : $name; + $class = 'Xcaptcha' . ucfirst($name); + $this->Pluginhandler = null; + if (file_exists($file = $this->xcaptcha_path_plugin . '/' . $name . '.php')) { + require_once $file; + $this->Pluginhandler = new $class($this); + } + return $this->Pluginhandler; + } +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/moduladmin.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/moduladmin.css (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/moduladmin.css 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,7 @@ +.xo-moduleadmin-icon { + width: 100%!important; + max-width:39%; +} +.xo-moduleadmin-box { + width: 60% !important; +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/moduladmin.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/changelog.txt =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/changelog.txt (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/changelog.txt 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ +xcaptcha 1.0 \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/changelog.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/docs/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/logo_large.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/logo_large.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/logo_small.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/icons/logo_small.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/blackglass.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/blackglass.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/clean.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/clean.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/red.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/red.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/white.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/recaptcha/white.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/xcaptcha_logo.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/images/xcaptcha_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/admin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/admin.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/admin.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,35 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +define('_AM_XCAPTCHA_INDEX', 'Configuration'); +define('_AM_XCAPTCHA_FORM', 'Configuration CAPTCHA'); +define('_AM_XCAPTCHA_SAVED', 'The configuration has been saved'); + +define('_AM_XCAPTCHA_ACTIVATE', 'Disable protection'); +define('_AM_XCAPTCHA_ENABLE', 'Yes'); +define('_AM_XCAPTCHA_DISABLE', 'No'); + +define('_AM_XCAPTCHA_PLUGINS', 'Method'); + +define('_AM_XCAPTCHA_NAME', 'CAPTCHA Variable name '); + +define('_AM_XCAPTCHA_SKIPMEMBER', 'Deactivate for members'); + +define('_AM_XCAPTCHA_MAXATTEMPTS', 'Maximum attempts'); +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/admin.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/help.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/image.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/image.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,45 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +define('_MI_XCAPTCHA_ADMENU_IMAGE', 'Image'); + +if ( !defined('_XCAPTCHA_IMAGE') ) { + define('_XCAPTCHA_FORM_IMAGE', 'Configuration CAPTCHA : Image'); + + define('_XCAPTCHA_NUM_CHARS', 'Number of characters'); + define('_XCAPTCHA_CASESENSITIVE', 'Case insensitive'); + define('_XCAPTCHA_FONTSIZE_MIN', 'Minimum size of the font'); + define('_XCAPTCHA_FONTSIZE_MAX', 'Maximum size of the font'); + define('_XCAPTCHA_BACKGROUND_TYPE', 'Background type'); + + define('_XCAPTCHA_BACKGROUND_BAR', 'Bars'); + define('_XCAPTCHA_BACKGROUND_CIRCLE', 'Circles'); + define('_XCAPTCHA_BACKGROUND_LINE', 'Lines'); + define('_XCAPTCHA_BACKGROUND_RECTANGLE', 'Rectangles'); + define('_XCAPTCHA_BACKGROUND_ELLIPSE', 'Ellipses'); + define('_XCAPTCHA_BACKGROUND_POLYGONE', 'Polygons'); + define('_XCAPTCHA_BACKGROUND_IMAGE', 'Image'); + + define('_XCAPTCHA_BACKGROUND_NUM', 'Number of \"drawing\"'); + define('_XCAPTCHA_POLYGON_POINT', 'Number of points for the polygon'); + define('_XCAPTCHA_SKIP_CHARACTERS', 'Ignore characters'); + + define('_XCAPTCHA_IMAGE', true); +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/image.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/modinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/modinfo.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/modinfo.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,26 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +define('_MI_XCAPTCHA_NAME', 'Xcaptcha'); +define('_MI_XCAPTCHA_DESC', 'Xoops CAPTCHA configuration'); + +define('_MI_XCAPTCHA_INDEX', 'Index'); +define('_MI_XCAPTCHA_CONFIG', 'CAPTCHA configuration'); +define('_MI_XCAPTCHA_ABOUT', 'About this module'); +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/modinfo.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/recaptcha.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/recaptcha.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,32 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +define('_MI_XCAPTCHA_ADMENU_RECAPTCHA', 'Recaptcha'); + +if ( !defined('_XCAPTCHA_RECAPTCHA') ) { + define('_XCAPTCHA_FORM_RECAPTCHA', 'Configuration CAPTCHA : Recaptcha'); + + define('_XCAPTCHA_PRIVATE_KEY', 'Private key'); + define('_XCAPTCHA_PUBLIC_KEY', 'Public key'); + define('_XCAPTCHA_THEME', 'Theme'); + define('_XCAPTCHA_LANG', 'Language'); + + define('_XCAPTCHA_RECAPTCHA', true); +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/recaptcha.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/text.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/text.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,27 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ +define('_MI_XCAPTCHA_ADMENU_TEXT', 'Text'); + +if ( !defined('_XCAPTCHA_TEXT') ) { + define('_XCAPTCHA_FORM_TEXT', 'Configuration CAPTCHA : Texte'); + define('_XCAPTCHA_NUM_CHARS', 'Number of characters'); + + define('_XCAPTCHA_TEXT', true); +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/text.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,119 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class XcaptchaImage extends Xcaptcha +{ + public $config = array(); + public $plugin; + + public function __construct() + { + $this->xcaptcha_handler = Xcaptcha::getInstance(); + $this->config = $this->xcaptcha_handler->loadConfig('image'); + $this->plugin = 'image'; + } + + public function XcaptchaImage() + { + $this->__construct(); + } + + public function getForm() + { + $captcha_form = new XoopsThemeForm('', 'xcaptchaform', 'index.php', 'post', true); + + $captcha_form->addElement(new XoopsFormText(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars'] ), true); + + $captcha_form->addElement(new XoopsFormRadioYN(_XCAPTCHA_CASESENSITIVE, 'casesensitive', $this->config['casesensitive'], _YES, _NO)); + + $fontmin_form = new XoopsFormSelect(_XCAPTCHA_FONTSIZE_MIN, 'fontsize_min', $this->config['fontsize_min']); + for ($i = 10; $i <= 30; $i++) { + $fontmin_form->addOption($i, $i); + } + $captcha_form->addElement($fontmin_form, false); + + $fontmax_form = new XoopsFormSelect(_XCAPTCHA_FONTSIZE_MAX, 'fontsize_max', $this->config['fontsize_max']); + for ($i = 10; $i <= 30; $i++) { + $fontmax_form->addOption($i, $i); + } + $captcha_form->addElement($fontmax_form, false); + + $backtype_form = new XoopsFormSelect(_XCAPTCHA_BACKGROUND_TYPE, 'background_type', $this->config['background_type'], $size = 7); + $backtype_form->addOption(0, _XCAPTCHA_BACKGROUND_BAR); + $backtype_form->addOption(1, _XCAPTCHA_BACKGROUND_CIRCLE); + $backtype_form->addOption(2, _XCAPTCHA_BACKGROUND_LINE); + $backtype_form->addOption(3, _XCAPTCHA_BACKGROUND_RECTANGLE); + $backtype_form->addOption(4, _XCAPTCHA_BACKGROUND_ELLIPSE); + $backtype_form->addOption(5, _XCAPTCHA_BACKGROUND_POLYGONE); + $backtype_form->addOption(100, _XCAPTCHA_BACKGROUND_IMAGE); + $captcha_form->addElement($backtype_form, false); + + $backnum_form = new XoopsFormSelect(_XCAPTCHA_BACKGROUND_NUM, 'background_num', $this->config['background_num']); + for ($i = 10; $i <= 100; $i = $i+10) { + $backnum_form->addOption($i, $i); + } + $captcha_form->addElement($backnum_form, false); + + $polygon_point = new XoopsFormSelect(_XCAPTCHA_POLYGON_POINT, 'polygon_point', $this->config['polygon_point']); + for ($i = 3; $i <= 20; $i++) { + $polygon_point->addOption($i, $i); + } + $captcha_form->addElement($polygon_point, false); + + $value = implode('|', $this->config['skip_characters']); + $captcha_form->addElement(new XoopsFormTextarea(_XCAPTCHA_SKIP_CHARACTERS, 'skip_characters', $value, 5, 50 ), true); + + $captcha_form->addElement(new XoopsFormHidden('type', 'image' )); + + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + $button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); + $captcha_form->addElement($button_tray); + + ob_start(); + $captcha_form->render(); + $ret = ob_get_contents(); + ob_end_clean(); + + return $ret; + } + + public function VerifyData() + { + global $system; + $config = array(); + $_POST['num_chars'] = $system->CleanVars($_POST, 'num_chars', 6, 'int'); + $_POST['casesensitive'] = $system->CleanVars($_POST, 'casesensitive', false, 'boolean'); + $_POST['fontsize_min'] = $system->CleanVars($_POST, 'fontsize_min', 10, 'int'); + $_POST['fontsize_max'] = $system->CleanVars($_POST, 'fontsize_max', 24, 'int'); + $_POST['background_type'] = $system->CleanVars($_POST, 'background_type', 0, 'int'); + $_POST['background_num'] = $system->CleanVars($_POST, 'background_num', 50, 'int'); + $_POST['polygon_point'] = $system->CleanVars($_POST, 'polygon_point', 3, 'int'); + $_POST['skip_characters'] = $system->CleanVars($_POST, 'skip_characters', 'o|0|i|l|1', 'string'); + $_POST['skip_characters'] = explode('|', $_POST['skip_characters']); + foreach ( array_keys($this->config) as $key) { + $config[$key] = $_POST[$key]; + } + return $config; + } +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/index.html 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/index.html ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,112 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class XcaptchaRecaptcha extends Xcaptcha +{ + public $config = array(); + public $plugin; + + function __construct() + { + $this->xcaptcha_handler = Xcaptcha::getInstance(); + $this->config = $this->xcaptcha_handler->loadConfig('recaptcha'); + $this->plugin = 'recaptcha'; + } + + function XcaptchaRecaptcha() + { + $this->__construct(); + } + + function getForm() + { + $captcha_form = new XoopsThemeForm('', 'xcaptchaform', 'index.php', 'post', true); + + $captcha_form->addElement(new XoopsFormTextarea(_XCAPTCHA_PRIVATE_KEY, 'private_key', $this->config['private_key'], 5, 50 ), true); + $captcha_form->addElement(new XoopsFormTextarea(_XCAPTCHA_PUBLIC_KEY, 'public_key', $this->config['public_key'], 5, 50 ), true); + + $theme_form = new XoopsFormSelect(_XCAPTCHA_THEME, 'theme', $this->config['theme'], $size = 4); + $theme_form->addOptionArray($this->getThemes() ); + $captcha_form->addElement($theme_form, false); + + $lang_form = new XoopsFormSelect(_XCAPTCHA_LANG, 'lang', $this->config['lang'], $size = 4); + $lang_form->addOptionArray($this->getLanguages() ); + $captcha_form->addElement($lang_form, false); + + $captcha_form->addElement(new XoopsFormHidden('type', 'recaptcha' )); + + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + $button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); + $captcha_form->addElement($button_tray); + + ob_start(); + $captcha_form->render(); + $ret = ob_get_contents(); + ob_end_clean(); + + return $ret; + } + + function VerifyData() + { + global $xoopsConfig; + $default_lang = array_search(ucfirst($xoopsConfig['language']), $this->getLanguages() ); + $default_lang = (!$default_lang) ? 'en' : $default_lang; + + global $system; + $config = array(); + $_POST['private_key'] = $system->CleanVars($_POST, 'private_key', 'Your private key', 'string'); + $_POST['public_key'] = $system->CleanVars($_POST, 'public_key', 'Your public key', 'string'); + $_POST['theme'] = $system->CleanVars($_POST, 'theme', 'red', 'string'); + $_POST['lang'] = $system->CleanVars($_POST, 'lang', $default_lang, 'string'); + foreach ( array_keys($this->config) as $key) { + $config[$key] = $_POST[$key]; + } + return $config; + } + + function getThemes() + { + return array( + 'red' => 'RED (default theme)', + 'white' => 'WHITE', + 'blackglass' => 'BLACKGLASS', + 'clean' => 'CLEAN', + ); + } + + function getLanguages() + { + return array( + 'en' => 'English', + 'nl' => 'Dutch', + 'fr' => 'French', + 'de' => 'German', + 'pt' => 'Portuguese', + 'ru' => 'Russian', + 'es' => 'Spanish', + 'tr' => 'Turkish', + ); + } +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,72 @@ +<?php +/** + * Xcaptcha extension module + * + * 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. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class XcaptchaText extends Xcaptcha +{ + public $config = array(); + public $plugin; + + function __construct() + { + $this->xcaptcha_handler = Xcaptcha::getInstance(); + $this->config = $this->xcaptcha_handler->loadConfig('text'); + $this->plugin = 'text'; + } + + function XcaptchaText() + { + $this->__construct(); + } + + function getForm() + { + $captcha_form = new XoopsThemeForm('', 'xcaptchaform', 'index.php', 'post', true); + + $captcha_form->addElement(new XoopsFormText(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars'] ), true); + + $captcha_form->addElement(new XoopsFormHidden('type', 'text' )); + + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + $button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); + $captcha_form->addElement($button_tray); + + ob_start(); + $captcha_form->render(); + $ret = ob_get_contents(); + ob_end_clean(); + + return $ret; + } + + function VerifyData() + { + global $system; + $config = array(); + $_POST['num_chars'] = $system->cleanVars($_POST, 'num_chars', 6, 'int'); + foreach ( array_keys($this->config) as $key) { + $config[$key] = $_POST[$key]; + } + return $config; + } +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php 2012-10-15 23:26:13 UTC (rev 10223) @@ -0,0 +1,67 @@ +<?php +/** + * Xcaptcha extension module + * + * You may not change or alter any porti... [truncated message content] |
From: <du...@us...> - 2012-10-15 23:20:37
|
Revision: 10222 http://sourceforge.net/p/xoops/svn/10222 Author: dugris Date: 2012-10-15 23:20:34 +0000 (Mon, 15 Oct 2012) Log Message: ----------- remove test folder Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/TEST3/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/test/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/test2/ |
From: <du...@us...> - 2012-10-15 23:19:12
|
Revision: 10221 http://sourceforge.net/p/xoops/svn/10221 Author: dugris Date: 2012-10-15 23:19:08 +0000 (Mon, 15 Oct 2012) Log Message: ----------- Move configuration files in xoops_data/configs Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/protector.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/protector.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/protector.php 2012-10-15 20:48:06 UTC (rev 10220) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/protector.php 2012-10-15 23:19:08 UTC (rev 10221) @@ -384,12 +384,12 @@ function get_filepath4group1ips() { - return XOOPS_VAR_PATH . '/protector_group1ips_' . substr(md5(XOOPS_ROOT_PATH . XOOPS_DB_USER . XOOPS_DB_PREFIX), 0, 6); + return XOOPS_VAR_PATH . '/configs/protector_group1ips_' . substr(md5(XOOPS_ROOT_PATH . XOOPS_DB_USER . XOOPS_DB_PREFIX), 0, 6); } function get_filepath4confighcache() { - return XOOPS_VAR_PATH . '/protector_configcache_' . substr(md5(XOOPS_ROOT_PATH . XOOPS_DB_USER . XOOPS_DB_PREFIX), 0, 6); + return XOOPS_VAR_PATH . '/configs/protector_configcache_' . substr(md5(XOOPS_ROOT_PATH . XOOPS_DB_USER . XOOPS_DB_PREFIX), 0, 6); } function ip_match($ips) |
From: <ma...@us...> - 2012-10-15 20:48:08
|
Revision: 10220 http://sourceforge.net/p/xoops/svn/10220 Author: mageg Date: 2012-10-15 20:48:06 +0000 (Mon, 15 Oct 2012) Log Message: ----------- Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/TEST3/ Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/TEST3 ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; |
From: <ma...@us...> - 2012-10-15 20:47:19
|
Revision: 10219 http://sourceforge.net/p/xoops/svn/10219 Author: mageg Date: 2012-10-15 20:47:17 +0000 (Mon, 15 Oct 2012) Log Message: ----------- Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/test2/ |
From: <be...@us...> - 2012-10-15 20:28:11
|
Revision: 10218 http://sourceforge.net/p/xoops/svn/10218 Author: beckmi Date: 2012-10-15 20:27:59 +0000 (Mon, 15 Oct 2012) Log Message: ----------- Testing adding a folder Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/test/ Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/test ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; |
From: <du...@us...> - 2012-10-15 20:24:49
|
Revision: 10217 http://sourceforge.net/p/xoops/svn/10217 Author: dugris Date: 2012-10-15 20:24:45 +0000 (Mon, 15 Oct 2012) Log Message: ----------- update xoops_version for paypal donation Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/userrank/xoops_version.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/xoops_version.php 2012-10-15 17:32:44 UTC (rev 10216) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/avatars/xoops_version.php 2012-10-15 20:24:45 UTC (rev 10217) @@ -41,6 +41,13 @@ $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +// paypal +$modversion['paypal'] = array(); +$modversion['paypal']['business'] = 'xoo...@gm...'; +$modversion['paypal']['item_name'] = 'Donation : ' . _MI_AVATARS_DESC; +$modversion['paypal']['amount'] = 0; +$modversion['paypal']['currency_code'] = 'USD'; + // Admin menu // Set to 1 if you want to display menu generated by system module $modversion['system_menu'] = 1; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/xoops_version.php 2012-10-15 17:32:44 UTC (rev 10216) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/xoops_version.php 2012-10-15 20:24:45 UTC (rev 10217) @@ -42,6 +42,13 @@ $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +// paypal +$modversion['paypal'] = array(); +$modversion['paypal']['business'] = 'xoo...@gm...'; +$modversion['paypal']['item_name'] = 'Donation : ' . _MI_BANNERS_DESC; +$modversion['paypal']['amount'] = 0; +$modversion['paypal']['currency_code'] = 'USD'; + // Admin menu // Set to 1 if you want to display menu generated by system module $modversion['system_menu'] = 1; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/xoops_version.php 2012-10-15 17:32:44 UTC (rev 10216) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/mailusers/xoops_version.php 2012-10-15 20:24:45 UTC (rev 10217) @@ -42,6 +42,12 @@ $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +// paypal +$modversion['paypal'] = array(); +$modversion['paypal']['business'] = 'xoo...@gm...'; +$modversion['paypal']['item_name'] = 'Donation : ' . _MI_MAILUSERS_DESC; +$modversion['paypal']['amount'] = 0; +$modversion['paypal']['currency_code'] = 'USD'; // $modversion['adminpath'] = 'admin.php?fct=mailusers'; // $modversion['category'] = XOOPS_SYSTEM_MAILU; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/xoops_version.php 2012-10-15 17:32:44 UTC (rev 10216) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/maintenance/xoops_version.php 2012-10-15 20:24:45 UTC (rev 10217) @@ -48,6 +48,13 @@ $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +// paypal +$modversion['paypal'] = array(); +$modversion['paypal']['business'] = 'xoo...@gm...'; +$modversion['paypal']['item_name'] = 'Donation : ' . _MI_MAINTENANCE_DESC; +$modversion['paypal']['amount'] = 0; +$modversion['paypal']['currency_code'] = 'USD'; + /* Admin menu Set to 1 if you want to display menu generated by system module Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php 2012-10-15 17:32:44 UTC (rev 10216) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/pm/xoops_version.php 2012-10-15 20:24:45 UTC (rev 10217) @@ -42,6 +42,13 @@ $modversion['min_xoops'] = "2.6.0"; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +// paypal +$modversion['paypal'] = array(); +$modversion['paypal']['business'] = 'xoo...@gm...'; +$modversion['paypal']['item_name'] = 'Donation : ' . _PM_MI_DESC; +$modversion['paypal']['amount'] = 0; +$modversion['paypal']['currency_code'] = 'USD'; + // Admin menu // Set to 1 if you want to display menu generated by system module $modversion['system_menu'] = 1; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/xoops_version.php 2012-10-15 17:32:44 UTC (rev 10216) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/profile/xoops_version.php 2012-10-15 20:24:45 UTC (rev 10217) @@ -43,6 +43,13 @@ $modversion['min_xoops'] = "2.6.0"; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +// paypal +$modversion['paypal'] = array(); +$modversion['paypal']['business'] = 'xoo...@gm...'; +$modversion['paypal']['item_name'] = 'Donation : ' . _PROFILE_MI_DESC; +$modversion['paypal']['amount'] = 0; +$modversion['paypal']['currency_code'] = 'USD'; + // Admin menu // Set to 1 if you want to display menu generated by system module $modversion['system_menu'] = 1; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/xoops_version.php 2012-10-15 17:32:44 UTC (rev 10216) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/smilies/xoops_version.php 2012-10-15 20:24:45 UTC (rev 10217) @@ -48,6 +48,13 @@ $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +// paypal +$modversion['paypal'] = array(); +$modversion['paypal']['business'] = 'xoo...@gm...'; +$modversion['paypal']['item_name'] = 'Donation : ' . _MI_SMILIES_DESC; +$modversion['paypal']['amount'] = 0; +$modversion['paypal']['currency_code'] = 'USD'; + /* Admin menu Set to 1 if you want to display menu generated by system module Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/userrank/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/userrank/xoops_version.php 2012-10-15 17:32:44 UTC (rev 10216) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/userrank/xoops_version.php 2012-10-15 20:24:45 UTC (rev 10217) @@ -47,6 +47,13 @@ $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +// paypal +$modversion['paypal'] = array(); +$modversion['paypal']['business'] = 'xoo...@gm...'; +$modversion['paypal']['item_name'] = 'Donation : ' . _MI_USERRANK_DESC; +$modversion['paypal']['amount'] = 0; +$modversion['paypal']['currency_code'] = 'USD'; + /* Admin menu Set to 1 if you want to display menu generated by system module |
From: <du...@us...> - 2012-10-15 17:32:47
|
Revision: 10216 http://sourceforge.net/p/xoops/svn/10216 Author: dugris Date: 2012-10-15 17:32:44 +0000 (Mon, 15 Oct 2012) Log Message: ----------- add $modversion['paypal'] in xoops_version.php for moduleadmin->renderAbout() Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_about.html Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-10-15 09:27:16 UTC (rev 10215) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-10-15 17:32:44 UTC (rev 10216) @@ -376,7 +376,7 @@ * @param string $paypal * @param bool $logo_xoops */ - public function renderAbout($paypal = '', $logo_xoops = true) + public function renderAbout($logo_xoops = true) { $xoops = Xoops::getInstance(); @@ -413,7 +413,9 @@ $this->_obj->setInfo('release_date', $release_date); $this->_obj->setInfo('author_list', $author_list); - $this->_obj->setInfo('paypal', $paypal); + if (is_array($this->_obj->getInfo('paypal'))) { + $this->_obj->setInfo('paypal', $this->_obj->getInfo('paypal')); + } $this->_obj->setInfo('changelog', $changelog); $xoops->tpl->assign('module', $this->_obj); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_about.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_about.html 2012-10-15 09:27:16 UTC (rev 10215) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/admin/admin_about.html 2012-10-15 17:32:44 UTC (rev 10216) @@ -16,11 +16,17 @@ <div class="spacer marg5"><a href="http://<{$module->getInfo('website')}>" target="_blank"><{$module->getInfo('website')}></a></div> <{/if}> <{if $module->getInfo('paypal')}> - <form id="paypal-form" action="https://www.paypal.com/cgi-bin/webscr" method="post"> - <input type="hidden" name="cmd" value="_s-xclick"> - <input type="hidden" name="hosted_button_id" value="<{$module->getInfo('paypal')}>"> - <img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$('#paypal-form').submit()" alt="PayPal - The safer, easier way to pay online!" /> - </form> + <form id="paypal-form" name="_xclick" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post"> + <input type="hidden" name="cmd" value="_xclick"> + <{foreachq from=$module->getInfo('paypal') item=value key=key}> + <{if is_numeric($value)}> + <input type="hidden" name="<{$key}>" value=<{$value}>> + <{else}> + <input type="hidden" name="<{$key}>" value="<{$value}>"> + <{/if}> + <{/foreach}> + <img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$('#paypal-form').submit()" alt="PayPal - The safer, easier way to pay online!" /> + </form> <{/if}> <{includeq file="admin:system|admin_infobox.html" class="width100"}> </td> |
From: <ir...@us...> - 2012-10-15 09:27:21
|
Revision: 10215 http://sourceforge.net/p/xoops/svn/10215 Author: irmtfan Date: 2012-10-15 09:27:16 +0000 (Mon, 15 Oct 2012) Log Message: ----------- bug fix: read_mode = 2 (DB) in viewpost.php?status=new AND viewforum.php?forum=FFF&status=unread and list.topic.php?status=unread Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php XoopsModules/newbb/branches/irmtfan/newbb/class/read.php XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.430.sql XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.sql XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -211,7 +211,15 @@ $stats_handler =& xoops_getmodulehandler('stats', 'newbb'); $stats_handler->reset(); break; - + // START irmtfan add read sync + case "read": + mod_loadFunctions("recon", "newbb"); + $result = newbb_synchronization("read"); + if (!empty($result)) { + redirect_header("admin_synchronization.php", 2, _AM_NEWBB_SYNC_TYPE_READ . "<br />" . _AM_NEWBB_DATABASEUPDATED); + } + exit(); + // END irmtfan add read sync case "misc": default: mod_loadFunctions("recon", "newbb"); @@ -257,6 +265,15 @@ $form .= '<input type="submit" name="submit" value=' . _SUBMIT . ' />'; $form .= '</div>'; $form .= '</form>'; +// START irmtfan add read sync +$form .= '<form action="admin_synchronization.php" method="get">'; +$form .= '<div style="padding: 10px 2px;">'; +$form .= '<h2>'._AM_NEWBB_SYNC_TYPE_READ.'</h2>'; +$form .= '<input type="hidden" name="type" value="read">'; +$form .= '<input type="submit" name="submit" value=' . _SUBMIT . ' />'; +$form .= '</div>'; +$form .= '</form>'; +// END irmtfan add read sync $form .= '<form action="admin_synchronization.php" method="get">'; $form .= '<div style="padding: 10px 2px;">'; Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-10-15 09:27:16 UTC (rev 10215) @@ -1,3 +1,21 @@ +date 2012-10-15 +=================================== +1- bug fix: viewpost.php?status=new AND viewforum.php?forum=FFF&status=unread and list.topic.php?status=unread criteria was wrong when read_mode = 2(important) +in newbb/viewpost.php, newbb/class/forum.php, newbb/class/topic.renderer.php + +2- bug fix: in view all topic page: if empty($_GET(status)) it will show all topics include deleted and pendings. + the last solution removed in list.topic.php and move to topic.renderer.php because the last solution cause double query and error. +in newbb/list.topic.php, newbb/class/topic.renderer.php + +3- bug fix: add read_item_uid indexes to avoid duplicate (read_item, uid) when submit a post (very important) +newbb/sql/mysql.sql, newbb/sql/mysql.430.sql + +4- bug fix: add clearDuplicate function for clear duplicate rows in bb_reads_topic and bb_reads_forum tables. old newbb users should click on "Read Data" in newbb -> admin -> syncronization page. (very important) +in newbb/class/read.php, newbb/admin/admin_synchronization.php, newbb/language/LANG/admin.php, newbb/docs/lang_diff.txt + +5- improve: add read_expire = 0 => no clean up reads tables +in newbb/class/read.php, newbb/include/plugin.php + date 2012-10-11 =================================== 1- bug fix: viewpost.php?status=new was wrongly return the new posts and new posts counts based on read_mode=1 (cookie) when the read_mode=2 (database) (important) Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -211,8 +211,15 @@ case 'unread': if (empty($xoopsModuleConfig["read_mode"])) { } elseif ($xoopsModuleConfig["read_mode"] ==2) { - $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id'; - $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; + // START irmtfan use read_uid to find the unread posts when the user is logged in + global $xoopsUser; + $read_uid = is_object($xoopsUser)?$xoopsUser->getVar("uid"):0; + if (!empty($read_uid)) { + $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' '; + $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; + } else { + } + // END irmtfan use read_uid to find the unread posts when the user is logged in } elseif ($xoopsModuleConfig["read_mode"] == 1) { $topics = array(); $topic_lastread = newbb_getcookie('LT', true); @@ -477,8 +484,15 @@ case 'unread': if (empty($xoopsModuleConfig["read_mode"])) { } elseif ($xoopsModuleConfig["read_mode"] ==2) { - $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id'; - $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; + // START irmtfan use read_uid to find the unread posts when the user is logged in + global $xoopsUser; + $read_uid = is_object($xoopsUser)?$xoopsUser->getVar("uid"):0; + if (!empty($read_uid)) { + $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' '; + $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; + } else { + } + // END irmtfan use read_uid to find the unread posts when the user is logged in } elseif ($xoopsModuleConfig["read_mode"] == 1) { $criteria_post = ' p.post_time > ' . max($GLOBALS['last_visit'], $startdate); $topics = array(); Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/read.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/read.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/read.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -101,7 +101,8 @@ $this->ArtObjectHandler($db, 'bb_reads_'.$type, 'Read'.$type, 'read_id', 'post_id'); $this->type = $type; $newbbConfig = newbb_load_config(); - $this->lifetime = !empty($newbbConfig["read_expire"]) ? $newbbConfig["read_expire"] *24*3600 : 30*24*3600; + // irmtfan if read_expire = 0 dont clean + $this->lifetime = isset($newbbConfig["read_expire"]) ? intval($newbbConfig["read_expire"]) *24*3600 : 30*24*3600; $this->mode = isset($newbbConfig["read_mode"]) ? $newbbConfig["read_mode"] : 2; } @@ -110,10 +111,12 @@ * * Delete all expired and duplicated records */ + // START irmtfan rephrase function to 1- add clearDuplicate and 2- dont clean when read_expire = 0 function clearGarbage() { - $expire = time() - intval($this->lifetime); - $sql = "DELETE FROM ".$this->table." WHERE read_time < ". $expire; - $this->db->queryF($sql); + // irmtfan clear duplicaed rows + if(!$result = $this->clearDuplicate()) { + return false; + } /* for MySQL 4.1+ */ if ($this->mysql_major_version() >= 4): @@ -130,9 +133,18 @@ //xoops_error($this->db->error()); return false; } + // irmtfan if read_expire = 0 dont clean + if (empty($this->lifetime)) return true; + // irmtfan move here and rephrase + $expire = time() - intval($this->lifetime); + $sql = "DELETE FROM ".$this->table." WHERE read_time < ". $expire; + if (!$result = $this->db->queryF($sql)) { + //xoops_error($this->db->error()); + return false; + } return true; } - + // END irmtfan rephrase function to 1- add clearDuplicate and 2- dont clean when read_expire = 0 function getRead($read_item, $uid = null) { if (empty($this->mode)) return null; @@ -259,6 +271,45 @@ } return $ret; } - + // START irmtfan add clear duplicated rows function + function clearDuplicate() + { + $sql = "CREATE TABLE " . $this->table . "_duplicate like " . $this->table . "; "; + if (!$result = $this->db->queryF($sql)) { + xoops_error($this->db->error().'<br />'.$sql); + return false; + } + $sql = "INSERT " . $this->table . "_duplicate SELECT * FROM " . $this->table . " GROUP BY read_item, uid; "; + if (!$result = $this->db->queryF($sql)) { + xoops_error($this->db->error().'<br />'.$sql); + return false; + } + $sql = "RENAME TABLE " . $this->table . " TO " . $this->table . "_with_duplicate; "; + if (!$result = $this->db->queryF($sql)) { + xoops_error($this->db->error().'<br />'.$sql); + return false; + } + $sql = "RENAME TABLE " . $this->table . "_duplicate TO " . $this->table . "; "; + if (!$result = $this->db->queryF($sql)) { + xoops_error($this->db->error().'<br />'.$sql); + return false; + } + $sql = "SHOW INDEX FROM " . $this->table . " WHERE KEY_NAME = 'read_item_uid'"; + $result = $this->db->queryF($sql); + if (empty($result)) { + $sql.= "ALTER TABLE " . $this->table . " ADD INDEX read_item_uid ( read_item, uid ); "; + if (!$result = $this->db->queryF($sql)) { + xoops_error($this->db->error().'<br />'.$sql); + return false; + } + } + $sql = "DROP TABLE " . $this->table . "_with_duplicate; "; + if (!$result = $this->db->queryF($sql)) { + xoops_error($this->db->error().'<br />'.$sql); + return false; + } + return true; + } + // END irmtfan add clear duplicated rows function } ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -160,8 +160,15 @@ if (empty($this->config["read_mode"])) { // Use database } elseif ($this->config["read_mode"] == 2) { - $this->query["join"][] = 'LEFT JOIN ' . $this->handler->db->prefix('bb_reads_topic') . ' AS r ON r.read_item = t.topic_id'; - $this->query["where"][] = '(r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; + // START irmtfan use read_uid to find the unread posts when the user is logged in + global $xoopsUser; + $read_uid = is_object($xoopsUser)?$xoopsUser->getVar("uid"):0; + if (!empty($read_uid)) { + $this->query["join"][] = 'LEFT JOIN ' . $this->handler->db->prefix('bb_reads_topic') . ' AS r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' '; + $this->query["where"][] = '(r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; + } else { + } + // END irmtfan change criteria to get from uid p.uid = last post submit user id // User cookie } elseif ($this->config["read_mode"] == 1) { if ($lastvisit =$GLOBALS['last_visit']) { @@ -263,6 +270,8 @@ if (isset($parsed)) return true; if (!isset($this->vars["forum"])) $this->vars["forum"] = null; + //irmtfan parse status for rendering topic correctly - if empty($_GET(status)) it will show all topics include deleted and pendings. + if (!isset($this->vars["status"])) $this->vars["status"] = all; foreach ($this->vars as $var => $val) { $this->parseVar($var, $val); Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-10-15 09:27:16 UTC (rev 10215) @@ -67,4 +67,6 @@ --------- define('_AM_NEWBB_REPORTSAVE','Selected Reports have been processed successfully'); define('_AM_NEWBB_REPORTDELETE','Selected Reports have been deleted from database successfully'); -define('_AM_NEWBB_REPORTNOTSELECT','No Report is selected!'); \ No newline at end of file +define('_AM_NEWBB_REPORTNOTSELECT','No Report is selected!'); +define("_AM_NEWBB_SYNC_TYPE_READ","Read Data"); +define("_AM_NEWBB_DATABASEUPDATED","Database Updated Successfully!"); \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -57,8 +57,8 @@ // storage method for reading records: 0 - none; 1 - cookie; 2 - db $customConfig["read_mode"] = 2; -// expire time for reading records, in days -$customConfig["read_expire"] = 30; +// expire time for reading records, in days; irmtfan add feature: 0 or no cleanup +$customConfig["read_expire"] = 0; // maximum records per forum for one user $customConfig["read_items"] = 100; Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -301,4 +301,6 @@ define('_AM_NEWBB_REPORTSAVE','Selected Reports have been processed successfully'); define('_AM_NEWBB_REPORTDELETE','Selected Reports have been deleted from database successfully'); define('_AM_NEWBB_REPORTNOTSELECT','No Report is selected!'); +define("_AM_NEWBB_SYNC_TYPE_READ","Read Data"); +define("_AM_NEWBB_DATABASEUPDATED","Database Updated Successfully!"); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -300,4 +300,6 @@ define('_AM_NEWBB_UPLOAD','حداکثر اندازه هر فایل برای آپلود:'); define('_AM_NEWBB_MEMLIMITTOLARGE','توجه کنید که متغیر \'memory_limit\' در فایل PHP.INI کمتر از متغیر \'post_max_size\' است.'); define('_AM_NEWBB_MEMLIMITOK','فایل های با حداکثر اندازه %s قابل آپلود در این سایت هستند.'); +define("_AM_NEWBB_SYNC_TYPE_READ","اطلاعات جدول خوانده شده ها"); +define("_AM_NEWBB_DATABASEUPDATED","پایگاه داده با موفقیت به روز شد!"); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -35,8 +35,8 @@ $type = intval( @$_GET['type'] ); $status = (!empty($_GET['status']) && in_array($_GET['status'], array("active", "pending", "deleted", "digest", "unreplied", "unread")))? $_GET['status'] : "all"; -//irmtfan parse status for rendering topic correctly - if empty($_GET(status)) it will show all topics include deleted and pendings. -$topic_renderer->parseVar('status',$status); +//irmtfan parse status for rendering topic correctly - remove here and move to topic.renderer.php +//$topic_renderer->parseVar('status',$status); $mode = (!empty($status) && in_array($status, array("active", "pending", "deleted"))) ? 2 : (!empty($_GET['mode']) ? intval($_GET['mode']) : 0); $isadmin = $GLOBALS["xoopsUserIsAdmin"]; Modified: XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.430.sql =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.430.sql 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.430.sql 2012-10-15 09:27:16 UTC (rev 10215) @@ -2,4 +2,10 @@ ALTER TABLE `bb_posts` ADD INDEX `forumid_uid` ( `forum_id` , `uid` ); ALTER TABLE `bb_posts` ADD INDEX `topicid_uid` ( `topic_id` , `uid` ); -ALTER TABLE `bb_posts` ADD INDEX `forumid_approved_postid` ( `forum_id` , `approved` , `post_id` ); \ No newline at end of file +ALTER TABLE `bb_posts` ADD INDEX `forumid_approved_postid` ( `forum_id` , `approved` , `post_id` ); +-- irmtfan add read_time indexes +ALTER TABLE `bb_reads_topic` + ADD INDEX `read_item_uid` ( `read_item`, `uid` ); + +ALTER TABLE `bb_reads_forum` + ADD INDEX `read_item_uid` ( `read_item`, `uid` ); \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.sql =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.sql 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.sql 2012-10-15 09:27:16 UTC (rev 10215) @@ -220,7 +220,8 @@ PRIMARY KEY (`read_id`), KEY `uid` (`uid`), KEY `read_item` (`read_item`), - KEY `post_id` (`post_id`) + KEY `post_id` (`post_id`), + KEY `read_item_uid` (`read_item`, `uid`) ) ENGINE=MyISAM; -- -------------------------------------------------------- @@ -239,7 +240,8 @@ PRIMARY KEY (`read_id`), KEY `uid` (`uid`), KEY `read_item` (`read_item`), - KEY `post_id` (`post_id`) + KEY `post_id` (`post_id`), + KEY `read_item_uid` (`read_item`, `uid`) ) ENGINE=MyISAM; -- -------------------------------------------------------- Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php 2012-10-12 00:38:13 UTC (rev 10214) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php 2012-10-15 09:27:16 UTC (rev 10215) @@ -99,10 +99,16 @@ //$criteria_status_count->add(new Criteria("approved", 1));// irmtfan commented and removed //$criteria_status_post->add(new Criteria("p.approved", 1));// irmtfan commented and removed } elseif ($xoopsModuleConfig["read_mode"] ==2) { - $join = ' LEFT JOIN ' . $xoopsDB->prefix('bb_reads_topic') . ' AS r ON r.read_item = p.topic_id'; // irmtfan corrected add AS - $criteria_status_post = new CriteriaCompo();// irmtfan new criteria - $criteria_status_post->add(new Criteria("p.post_id", "r.`post_id`", ">")); // irmtfan corrected - should use $value="r.``" to render in XOOPS/class/criteria.php - $criteria_status_post->add(new Criteria("r.read_id", NULL, "IS NULL"), "OR");// irmtfan corrected - should use "IS NULL" to render in XOOPS/class/criteria.php + // START irmtfan use read_uid to find the unread posts when the user is logged in + $read_uid = is_object($xoopsUser)?$xoopsUser->getVar("uid"):0; + if (!empty($read_uid)) { + $join = ' LEFT JOIN ' . $xoopsDB->prefix('bb_reads_topic') . ' AS r ON r.read_item = p.topic_id AND r.uid = ' . $read_uid . ' '; // irmtfan corrected add AS + $criteria_status_post = new CriteriaCompo();// irmtfan new criteria + $criteria_status_post->add(new Criteria("p.post_id", "r.`post_id`", ">")); // irmtfan corrected - should use $value="r.``" to render in XOOPS/class/criteria.php + $criteria_status_post->add(new Criteria("r.read_id", NULL, "IS NULL"), "OR");// irmtfan corrected - should use "IS NULL" to render in XOOPS/class/criteria.php + } else { + } + // END irmtfan use read_uid to find the unread posts when the user is logged in //$criteria_status_post->add(new Criteria("p.approved", 1)); // irmtfan commented and removed //$criteria_status_count =& $criteria_status_post; $criteria_post->add($criteria_status_post); // irmtfan add the status criteria to post criteria |
From: <du...@us...> - 2012-10-12 00:38:15
|
Revision: 10214 http://sourceforge.net/p/xoops/svn/10214 Author: dugris Date: 2012-10-12 00:38:13 +0000 (Fri, 12 Oct 2012) Log Message: ----------- Read/Write config files in xoops_data/configs folder Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php Property Changed: ---------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2012-10-12 00:32:32 UTC (rev 10213) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2012-10-12 00:38:13 UTC (rev 10214) @@ -1,482 +1,537 @@ -<?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. -*/ - -/** - * CAPTCHA configurations for Image mode - * - * Based on DuGris' SecurityImage - * - * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package class - * @subpackage captcha - * @since 2.3.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id$ - */ - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class XoopsCaptcha -{ - /** - * @var bool - */ - public $active; - - /** - * @var XoopsCaptchaMethod - */ - public $handler; - - /** - * @var string - */ - public $path_basic; - - /** - * @var string - */ - public $path_plugin; - - /** - * @var string - */ - public $name; - - /** - * @var array - */ - public $config = array(); - - /** - * @var array - */ - public $message = array(); - - /** - * construct - */ - public function __construct() - { - $xoops = Xoops::getInstance(); - $xoops->loadLanguage('captcha'); - // Load static configurations - $this->path_basic = XOOPS_ROOT_PATH . '/class/captcha'; - $this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/captcha'; - $this->config = $this->loadConfig(); - $this->name = $this->config['name']; - } - - /** - * Get Instance - * - * @return XoopsCaptcha - */ - static function getInstance() - { - static $instance; - if (!isset($instance)) { - $class = __CLASS__; - $instance = new $class(); - } - return $instance; - } - - /** - * XoopsCaptcha::loadConfig() - * - * @param string $filename - * @return array - */ - public function loadConfig($filename = null) - { - $basic_config = array(); - $plugin_config = array(); - $filename = empty($filename) ? 'config.php' : 'config.' . $filename . '.php'; - if (file_exists($file = $this->path_basic . '/' . $filename)) { - $basic_config = include $file; - } - if (file_exists($file = $this->path_plugin . '/' . $filename)) { - $plugin_config = include $file; - } - - $config = array_merge($basic_config, $plugin_config); - foreach ($config as $key => $val) { - $config[$key] = $val; - } - return $config; - } - - /** - * XoopsCaptcha::isActive() - * - * @return bool - */ - public function isActive() - { - $xoops = Xoops::getInstance(); - - if (isset($this->active)) { - return $this->active; - } - if (!empty($this->config['disabled'])) { - $this->active = false; - return $this->active; - } - if (!empty($this->config['skipmember']) && $xoops->isUser()) { - $this->active = false; - return $this->active; - } - if (!isset($this->handler)) { - $this->loadHandler(); - } - $this->active = isset($this->handler); - return $this->active; - } - - /** - * XoopsCaptcha::loadHandler() - * - * @param string $name - * @return XoopsCatchaMethod - */ - public function loadHandler($name = null) - { - $name = !empty($name) ? $name : (empty($this->config['mode']) ? 'text' : $this->config['mode']); - $class = 'XoopsCaptcha' . ucfirst($name); - if (!empty($this->handler) && get_class($this->handler) == $class) { - return $this->handler; - } - $this->handler = null; - if (file_exists($file = $this->path_basic . '/' . $name . '.php')) { - require_once $file; - } else { - if (file_exists($file = $this->path_plugin . '/' . $name . '.php')) { - require_once $file; - } - } - - if (!class_exists($class)) { - $class = 'XoopsCaptchaText'; - require_once $this->path_basic . '/text.php'; - } - /* @var $handler XoopsCaptchaMethod */ - $handler = new $class($this); - if ($handler->isActive()) { - $this->handler = $handler; - $this->handler->loadConfig($name); - } - return $this->handler; - } - - /** - * XoopsCaptcha::setConfigs() - * - * @param mixed $configs - * @return bool - */ - public function setConfigs($configs) - { - foreach ($configs as $key => $val) { - $this->setConfig($key, $val); - } - return true; - } - - /** - * XoopsCaptcha::setConfig() - * - * @param mixed $name - * @param mixed $val - * @return bool - */ - public function setConfig($name, $val) - { - if (isset($this->$name)) { - $this->$name = $val; - } else { - $this->config[$name] = $val; - } - return true; - } - - /** - * XoopsCaptcha::verify() - * - * Verify user submission - * - * @param bool $skipMember - * @param string $name - * @return bool - */ - public function verify($skipMember = null, $name = null) - { - $xoops = Xoops::getInstance(); - $sessionName = empty($name) ? $this->name : $name; - $skipMember = ($skipMember === null) ? $_SESSION["{$sessionName}_skipmember"] : $skipMember; - $maxAttempts = $_SESSION["{$sessionName}_maxattempts"]; - $attempt = $_SESSION["{$sessionName}_attempt"]; - $is_valid = false; - // Skip CAPTCHA verification if disabled - if (!$this->isActive()) { - $is_valid = true; - // Skip CAPTCHA for member if set - } else { - if ($xoops->isUser() && !empty($skipMember)) { - $is_valid = true; - // Kill too many attempts - } else { - if (!empty($maxAttempts) && $attempt > $maxAttempts) { - $this->message[] = _CAPTCHA_TOOMANYATTEMPTS; - // Verify the code - } else { - $is_valid = $this->handler->verify($sessionName); - } - } - } - - if (!$is_valid) { - // Increase the attempt records on failure - $_SESSION["{$sessionName}_attempt"]++; - // Log the error message - $this->message[] = _CAPTCHA_INVALID_CODE; - } else { - // reset attempt records on success - $_SESSION["{$sessionName}_attempt"] = null; - } - $this->destroyGarbage(true); - return $is_valid; - } - - /** - * XoopsCaptcha::getCaption() - * - * @return string - */ - public function getCaption() - { - return defined('_CAPTCHA_CAPTION') ? constant('_CAPTCHA_CAPTION') : ''; - } - - /** - * XoopsCaptcha::getMessage() - * - * @return sdtring - */ - public function getMessage() - { - return implode('<br />', $this->message); - } - - /** - * Destory historical stuff - * - * @param bool $clearSession - * @return bool - */ - public function destroyGarbage($clearSession = false) - { - $this->loadHandler(); - $this->handler->destroyGarbage(); - - if ($clearSession) { - $_SESSION[$this->name . '_name'] = null; - $_SESSION[$this->name . '_skipmember'] = null; - $_SESSION[$this->name . '_code'] = null; - $_SESSION[$this->name . '_maxattempts'] = null; - } - - return true; - } - - /** - * XoopsCaptcha::render() - * - * @return string - */ - public function render() - { - $_SESSION[$this->name . '_name'] = $this->name; - $_SESSION[$this->name . '_skipmember'] = $this->config['skipmember']; - $form = ''; - if (!$this->active || empty($this->config['name'])) { - return $form; - } - - $maxAttempts = $this->config['maxattempts']; - $_SESSION[$this->name . '_maxattempts'] = $maxAttempts; - $attempt = isset($_SESSION[$this->name . '_attempt']) ? $_SESSION[$this->name . '_attempt'] : 0; - $_SESSION[$this->name . '_attempt'] = $attempt; - - // Failure on too many attempts - if (!empty($maxAttempts) && $attempt > $maxAttempts) { - $form = _CAPTCHA_TOOMANYATTEMPTS; - // Load the form element - } else { - $form = $this->loadForm(); - } - return $form; - } - - /** - * XoopsCaptcha::renderValidationJS() - * - * @return string - */ - public function renderValidationJS() - { - if (!$this->active || empty($this->config['name'])) { - return ''; - } - return $this->handler->renderValidationJS(); - } - - /** - * XoopsCaptcha::setCode() - * - * @param mixed $code - * @return bool - */ - public function setCode($code = null) - { - $code = ($code === null) ? $this->handler->getCode() : $code; - if (!empty($code)) { - $_SESSION[$this->name . '_code'] = $code; - return true; - } - return false; - } - - /** - * XoopsCaptcha::loadForm() - * - * @return string - */ - public function loadForm() - { - $form = $this->handler->render(); - $this->setCode(); - return $form; - } -} - -/** - * Abstract class for CAPTCHA method - * - * Currently there are two types of CAPTCHA forms, text and image - * The default mode is "text", it can be changed in the priority: - * 1 If mode is set through XoopsFormCaptcha::setConfig("mode", $mode), take it - * 2 Elseif mode is set though captcha/config.php, take it - * 3 Else, take "text" - */ -class XoopsCaptchaMethod -{ - /** - * @var XoopsCaptcha - */ - public $handler; - - /** - * @var array - */ - public $config; - - /** - * @var string - */ - public $code; - - /** - * XoopsCaptchaMethod::__construct() - * - * @param mixed $handler - */ - public function __construct($handler = null) - { - $this->handler = $handler; - } - - /** - * XoopsCaptchaMethod::isActive() - * - * @return bool - */ - public function isActive() - { - return true; - } - - /** - * XoopsCaptchaMethod::loadConfig() - * - * @param string $name - * @return array - */ - public function loadConfig($name = '') - { - $this->config = empty($name) ? $this->handler->config - : array_merge($this->handler->config, $this->handler->loadConfig($name)); - } - - /** - * XoopsCaptchaMethod::getCode() - * - * @return string - */ - public function getCode() - { - return strval($this->code); - } - - /** - * XoopsCaptchaMethod::render() - * - * @return string - */ - public function render() - { - return ''; - } - - /** - * @return string - */ - public function renderValidationJS() - { - return ''; - } - - /** - * XoopsCaptchaMethod::verify() - * - * @param mixed $sessionName - * @return bool - */ - public function verify($sessionName = null) - { - $is_valid = false; - if (!empty($_SESSION["{$sessionName}_code"])) { - $func = !empty($this->config['casesensitive']) ? 'strcmp' : 'strcasecmp'; - $is_valid = !$func(trim(@$_POST[$sessionName]), $_SESSION["{$sessionName}_code"]); - } - return $is_valid; - } - - /** - * @return bool - */ - public function destroyGarbage() - { - return true; - } - +<?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. +*/ + +/** + * CAPTCHA configurations for Image mode + * + * Based on DuGris' SecurityImage + * + * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package class + * @subpackage captcha + * @since 2.3.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class XoopsCaptcha +{ + /** + * @var bool + */ + public $active; + + /** + * @var XoopsCaptchaMethod + */ + public $handler; + + /** + * @var string + */ + public $path_basic; + + /** + * @var string + */ + public $path_plugin; + + /** + * @var string + */ + public $configPath; + + /** + * @var string + */ + public $name; + + /** + * @var array + */ + public $config = array(); + + /** + * @var array + */ + public $message = array(); + + /** + * construct + */ + public function __construct() + { + $xoops = Xoops::getInstance(); + $xoops->loadLanguage('captcha'); + // Load static configurations + $this->path_basic = XOOPS_ROOT_PATH . '/class/captcha'; + $this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/captcha'; + $this->configPath = XOOPS_VAR_PATH . '/configs/'; + $this->config = $this->loadConfig(); + $this->name = $this->config['name']; + } + + /** + * Get Instance + * + * @return XoopsCaptcha + */ + static function getInstance() + { + static $instance; + if (!isset($instance)) { + $class = __CLASS__; + $instance = new $class(); + } + return $instance; + } + + /** + * XoopsCaptcha::loadConfig() + * + * @param string $filename + * @return array + */ + function loadConfig( $name = 'config') { + if ( $name == 'config' ) { + $filename = 'captcha.config'; + } else { + $filename = 'captcha.config.' . $name; + } + if ( !$config = $this->readConfig($filename) ) { + $config = $this->loadBasicConfig( $name ); + $this->writeConfig($filename, $config ); + } + return $config; + } + + /** + * XoopsCaptcha::loadBasicConfig() + * + * @param string $filename + * @return array + */ + function loadBasicConfig($filename = null) + { + $basic_config = array(); + $plugin_config = array(); + $filename = ($filename == 'config') ? 'config.php' : 'config.' . $filename . '.php'; + if (file_exists($file = $this->path_basic . '/' . $filename)) { + $basic_config = include $file; + } + if (file_exists($file = $this->path_plugin . '/' . $filename)) { + $plugin_config = include $file; + } + + $config = array_merge($basic_config, $plugin_config); + foreach ($config as $key => $val) { + $config[$key] = $val; + } + return $config; + } + + /** + * XoopsCaptcha::readConfig() + * + * @param string $filename + * @return array + */ + function readConfig( $filename = 'config') + { + $path_file = $this->configPath . $filename . '.php'; + XoopsLoad::load('XoopsFile'); + $file = XoopsFile::getHandler('file', $path_file); + return eval(@$file->read()); + } + + /** + * XoopsCaptcha::writeConfig() + * + * @param string $filename + * @param array $config + * @return array + */ + function writeConfig($filename = 'config', $config) + { + $path_file = $this->configPath . $filename . '.php'; + XoopsLoad::load('XoopsFile'); + $file = XoopsFile::getHandler('file', $path_file); + return $file->write( 'return ' . var_export($config, true) . ';'); + } + + /** + * XoopsCaptcha::isActive() + * + * @return bool + */ + public function isActive() + { + $xoops = Xoops::getInstance(); + + if (isset($this->active)) { + return $this->active; + } + if (!empty($this->config['disabled'])) { + $this->active = false; + return $this->active; + } + if (!empty($this->config['skipmember']) && $xoops->isUser()) { + $this->active = false; + return $this->active; + } + if (!isset($this->handler)) { + $this->loadHandler(); + } + $this->active = isset($this->handler); + return $this->active; + } + + /** + * XoopsCaptcha::loadHandler() + * + * @param string $name + * @return XoopsCatchaMethod + */ + public function loadHandler($name = null) + { + $name = !empty($name) ? $name : (empty($this->config['mode']) ? 'text' : $this->config['mode']); + $class = 'XoopsCaptcha' . ucfirst($name); + if (!empty($this->handler) && get_class($this->handler) == $class) { + return $this->handler; + } + $this->handler = null; + if (file_exists($file = $this->path_basic . '/' . $name . '.php')) { + require_once $file; + } else { + if (file_exists($file = $this->path_plugin . '/' . $name . '.php')) { + require_once $file; + } + } + + if (!class_exists($class)) { + $class = 'XoopsCaptchaText'; + require_once $this->path_basic . '/text.php'; + } + /* @var $handler XoopsCaptchaMethod */ + $handler = new $class($this); + if ($handler->isActive()) { + $this->handler = $handler; + $this->handler->loadConfig($name); + } + return $this->handler; + } + + /** + * XoopsCaptcha::setConfigs() + * + * @param mixed $configs + * @return bool + */ + public function setConfigs($configs) + { + foreach ($configs as $key => $val) { + $this->setConfig($key, $val); + } + return true; + } + + /** + * XoopsCaptcha::setConfig() + * + * @param mixed $name + * @param mixed $val + * @return bool + */ + public function setConfig($name, $val) + { + if (isset($this->$name)) { + $this->$name = $val; + } else { + $this->config[$name] = $val; + } + return true; + } + + /** + * XoopsCaptcha::verify() + * + * Verify user submission + * + * @param bool $skipMember + * @param string $name + * @return bool + */ + public function verify($skipMember = null, $name = null) + { + $xoops = Xoops::getInstance(); + $sessionName = empty($name) ? $this->name : $name; + $skipMember = ($skipMember === null) ? $_SESSION["{$sessionName}_skipmember"] : $skipMember; + $maxAttempts = $_SESSION["{$sessionName}_maxattempts"]; + $attempt = $_SESSION["{$sessionName}_attempt"]; + $is_valid = false; + // Skip CAPTCHA verification if disabled + if (!$this->isActive()) { + $is_valid = true; + // Skip CAPTCHA for member if set + } else { + if ($xoops->isUser() && !empty($skipMember)) { + $is_valid = true; + // Kill too many attempts + } else { + if (!empty($maxAttempts) && $attempt > $maxAttempts) { + $this->message[] = _CAPTCHA_TOOMANYATTEMPTS; + // Verify the code + } else { + $is_valid = $this->handler->verify($sessionName); + } + } + } + + if (!$is_valid) { + // Increase the attempt records on failure + $_SESSION["{$sessionName}_attempt"]++; + // Log the error message + $this->message[] = _CAPTCHA_INVALID_CODE; + } else { + // reset attempt records on success + $_SESSION["{$sessionName}_attempt"] = null; + } + $this->destroyGarbage(true); + return $is_valid; + } + + /** + * XoopsCaptcha::getCaption() + * + * @return string + */ + public function getCaption() + { + return defined('_CAPTCHA_CAPTION') ? constant('_CAPTCHA_CAPTION') : ''; + } + + /** + * XoopsCaptcha::getMessage() + * + * @return sdtring + */ + public function getMessage() + { + return implode('<br />', $this->message); + } + + /** + * Destory historical stuff + * + * @param bool $clearSession + * @return bool + */ + public function destroyGarbage($clearSession = false) + { + $this->loadHandler(); + $this->handler->destroyGarbage(); + + if ($clearSession) { + foreach ($this->config as $k => $config ) { + $_SESSION[$this->name . '_' . $k] = null; + } + } + return true; + } + + /** + * XoopsCaptcha::render() + * + * @return string + */ + public function render() + { + $sessionName = $this->config['name']; + $_SESSION[$sessionName . '_name'] = $sessionName; + foreach ($this->config as $k => $config ) { + $_SESSION[$sessionName . '_' . $k] = $config; + } + $form = ''; + if (!$this->active || empty($this->config['name'])) { + return $form; + } + + $maxAttempts = $this->config['maxattempts']; + $attempt = isset($_SESSION[$sessionName . '_attempt']) ? $_SESSION[$sessionName . '_attempt'] : 0; + $_SESSION[$sessionName . '_attempt'] = $attempt; + + // Failure on too many attempts + if (!empty($maxAttempts) && $attempt > $maxAttempts) { + $form = _CAPTCHA_TOOMANYATTEMPTS; + // Load the form element + } else { + $form = $this->loadForm(); + } + return $form; + } + + /** + * XoopsCaptcha::renderValidationJS() + * + * @return string + */ + public function renderValidationJS() + { + if (!$this->active || empty($this->config['name'])) { + return ''; + } + return $this->handler->renderValidationJS(); + } + + /** + * XoopsCaptcha::setCode() + * + * @param mixed $code + * @return bool + */ + public function setCode($code = null) + { + $code = ($code === null) ? $this->handler->getCode() : $code; + if (!empty($code)) { + $_SESSION[$this->name . '_code'] = $code; + return true; + } + return false; + } + + /** + * XoopsCaptcha::loadForm() + * + * @return string + */ + public function loadForm() + { + $form = $this->handler->render(); + $this->setCode(); + return $form; + } +} + +/** + * Abstract class for CAPTCHA method + * + * Currently there are two types of CAPTCHA forms, text and image + * The default mode is "text", it can be changed in the priority: + * 1 If mode is set through XoopsFormCaptcha::setConfig("mode", $mode), take it + * 2 Elseif mode is set though captcha/config.php, take it + * 3 Else, take "text" + */ +class XoopsCaptchaMethod +{ + /** + * @var XoopsCaptcha + */ + public $handler; + + /** + * @var array + */ + public $config; + + /** + * @var string + */ + public $code; + + /** + * XoopsCaptchaMethod::__construct() + * + * @param mixed $handler + */ + public function __construct($handler = null) + { + $this->handler = $handler; + } + + /** + * XoopsCaptchaMethod::isActive() + * + * @return bool + */ + public function isActive() + { + return true; + } + + /** + * XoopsCaptchaMethod::loadConfig() + * + * @param string $name + * @return array + */ + public function loadConfig($name = '') + { + $this->config = empty($name) ? $this->handler->config + : array_merge($this->handler->config, $this->handler->loadConfig($name)); + + } + + /** + * XoopsCaptchaMethod::getCode() + * + * @return string + */ + public function getCode() + { + return strval($this->code); + } + + /** + * XoopsCaptchaMethod::render() + * + * @return string + */ + public function render() + { + return ''; + } + + /** + * @return string + */ + public function renderValidationJS() + { + return ''; + } + + /** + * XoopsCaptchaMethod::verify() + * + * @param mixed $sessionName + * @return bool + */ + public function verify($sessionName = null) + { + $is_valid = false; + if (!empty($_SESSION["{$sessionName}_code"])) { + $func = !empty($this->config['casesensitive']) ? 'strcmp' : 'strcasecmp'; + $is_valid = !$func(trim(@$_POST[$sessionName]), $_SESSION["{$sessionName}_code"]); + } + return $is_valid; + } + + /** + * @return bool + */ + public function destroyGarbage() + { + return true; + } + } \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php ___________________________________________________________________ Deleted: svn:eol-style - native Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php 2012-10-12 00:32:32 UTC (rev 10213) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php 2012-10-12 00:38:13 UTC (rev 10214) @@ -58,6 +58,7 @@ $this->captchaHandler = XoopsCaptcha::getInstance(); $configs['name'] = $name; $configs['skipmember'] = $skipmember; + $configs = $this->captchaHandler->loadConfig(); $this->captchaHandler->setConfigs($configs); if (! $this->captchaHandler->isActive()) { $this->setHidden(); |
From: <du...@us...> - 2012-10-12 00:32:34
|
Revision: 10213 http://sourceforge.net/p/xoops/svn/10213 Author: dugris Date: 2012-10-12 00:32:32 +0000 (Fri, 12 Oct 2012) Log Message: ----------- View index in function renderIndex Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-10-11 08:41:48 UTC (rev 10212) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/moduleadmin.php 2012-10-12 00:32:32 UTC (rev 10213) @@ -258,11 +258,11 @@ $xoops = Xoops::getInstance(); $this->_obj->loadAdminMenu(); foreach (array_keys($this->_obj->adminmenu) as $i) { - if ($this->_obj->adminmenu[$i]['link'] != 'admin/index.php') { +// if ($this->_obj->adminmenu[$i]['link'] != 'admin/index.php') { //$this->_obj->adminmenu[$i]['icon'] = XOOPS_URL . "/modules/" . $this->_obj->getVar('dirname') . "/" . $this->_obj->adminmenu[$i]['icon']; $this->_obj->adminmenu[$i]['icon'] = XOOPS_URL . "/media/xoops/images/icons/32/" . $this->_obj->adminmenu[$i]['icon']; $xoops->tpl->append('xo_admin_index_menu', $this->_obj->adminmenu[$i]); - } +// } } if ($this->_obj->getInfo('help')) { $help = array(); |
From: <ir...@us...> - 2012-10-11 08:41:50
|
Revision: 10212 http://sourceforge.net/p/xoops/svn/10212 Author: irmtfan Date: 2012-10-11 08:41:48 +0000 (Thu, 11 Oct 2012) Log Message: ----------- bug fix: viewpost.php?status=new was wrongly returned Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/post.php XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-10-10 11:01:37 UTC (rev 10211) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-10-11 08:41:48 UTC (rev 10212) @@ -1,3 +1,8 @@ +date 2012-10-11 +=================================== +1- bug fix: viewpost.php?status=new was wrongly return the new posts and new posts counts based on read_mode=1 (cookie) when the read_mode=2 (database) (important) +in newbb/viewpost.php and newbb/class/post.php + date 2012-10-10 =================================== 1- bug fix: in list.topic.php: remove empty arrays in getStatus function Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-10-10 11:01:37 UTC (rev 10211) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-10-11 08:41:48 UTC (rev 10212) @@ -936,12 +936,31 @@ return true; } - - function getPostCount($criteria = null) +// START irmtfan enhance getPostCount when there is join (read_mode = 2) + function getPostCount($criteria = null, $join = null) { - return parent::getCount($criteria); + // If not join get the count from XOOPS/class/model/stats as before + if (empty($join)) + return parent::getCount($criteria); + + $sql = 'SELECT COUNT(*) as count'. + ' FROM ' . $this->db->prefix('bb_posts') . ' AS p'. + ' LEFT JOIN ' . $this->db->prefix('bb_posts_text') . " AS t ON t.post_id = p.post_id"; + // LEFT JOIN + $sql .= $join; + // WHERE + if (isset($criteria) && is_subclass_of($criteria, "criteriaelement")) { + $sql .= " ".$criteria->renderWhere(); + } + if (!$result = $this->db->query($sql)) { + //xoops_error($this->db->error().'<br />'.$sql); + return null; + } + $myrow = $this->db->fetchArray($result); + $count = $myrow['count']; + return $count; } - +// END irmtfan enhance getPostCount when there is join (read_mode = 2) /* * TODO: combining viewtopic.php */ Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php 2012-10-10 11:01:37 UTC (rev 10211) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php 2012-10-11 08:41:48 UTC (rev 10212) @@ -79,45 +79,49 @@ } $join = null; +// START irmtfan solve the status issues and specially status = new issue switch($status) { case "pending": - $criteria_status_count = new Criteria("approved", 0); - $criteria_status_post = new Criteria("p.approved", 0); + $criteria_count->add(new Criteria("approved", 0)); // irmtfan add new criteria + $criteria_post->add(new Criteria("p.approved", 0)); // irmtfan add new criteria break; case "deleted": - $criteria_status_count = new Criteria("approved", -1); - $criteria_status_post = new Criteria("p.approved", -1); + $criteria_count->add(new Criteria("approved", -1)); // irmtfan add new criteria + $criteria_post->add(new Criteria("p.approved", -1)); // irmtfan add new criteria break; case "new": - $criteria_status_count = new CriteriaCompo(new Criteria("post_time", intval($last_visit), ">")); - $criteria_status_post = new CriteriaCompo(new Criteria("p.post_time", intval($last_visit), ">")); - //$criteria_status_count->add(new Criteria("approved", 1)); - //$criteria_status_post->add(new Criteria("p.approved", 1)); - // following is for "unread" -- not finished + //$criteria_status_count = new CriteriaCompo(new Criteria("post_time", intval($last_visit), ">"));// irmtfan commented and removed + //$criteria_status_post = new CriteriaCompo(new Criteria("p.post_time", intval($last_visit), ">"));// irmtfan commented and removed + $criteria_count->add(new Criteria("approved", 1)); // irmtfan uncomment + $criteria_post->add(new Criteria("p.approved", 1)); // irmtfan uncomment + // following is for "unread" -- not finished -- irmtfan Now it is finished! if (empty($xoopsModuleConfig["read_mode"])) { - $criteria_status_count->add(new Criteria("approved", 1)); - $criteria_status_post->add(new Criteria("p.approved", 1)); + //$criteria_status_count->add(new Criteria("approved", 1));// irmtfan commented and removed + //$criteria_status_post->add(new Criteria("p.approved", 1));// irmtfan commented and removed } elseif ($xoopsModuleConfig["read_mode"] ==2) { - $join = ' LEFT JOIN ' . $xoopsDB->prefix('bb_reads_topic') . ' r ON r.read_item = p.topic_id'; - $criteria_status_post = new CriteriaCompo(new Criteria("p.post_id", "r.post_id", ">")); - $criteria_status_post->add(new Criteria("r.read_id", NULL, "IS"), "OR"); - $criteria_status_post->add(new Criteria("p.approved", 1)); + $join = ' LEFT JOIN ' . $xoopsDB->prefix('bb_reads_topic') . ' AS r ON r.read_item = p.topic_id'; // irmtfan corrected add AS + $criteria_status_post = new CriteriaCompo();// irmtfan new criteria + $criteria_status_post->add(new Criteria("p.post_id", "r.`post_id`", ">")); // irmtfan corrected - should use $value="r.``" to render in XOOPS/class/criteria.php + $criteria_status_post->add(new Criteria("r.read_id", NULL, "IS NULL"), "OR");// irmtfan corrected - should use "IS NULL" to render in XOOPS/class/criteria.php + //$criteria_status_post->add(new Criteria("p.approved", 1)); // irmtfan commented and removed //$criteria_status_count =& $criteria_status_post; + $criteria_post->add($criteria_status_post); // irmtfan add the status criteria to post criteria + $criteria_count =& $criteria_post;// irmtfan criteria count is equal to criteria post } elseif ($xoopsModuleConfig["read_mode"] == 1) { - $criteria_status_count = new CriteriaCompo(new Criteria("post_time", intval($last_visit), ">")); - $criteria_status_post = new CriteriaCompo(new Criteria("p.post_time", intval($last_visit), ">")); - $criteria_status_count->add(new Criteria("approved", 1)); - $criteria_status_post->add(new Criteria("p.approved", 1)); - } + $criteria_count->add(new Criteria("post_time", intval($last_visit), ">")); // irmtfan add new criteria + $criteria_post->add(new Criteria("p.post_time", intval($last_visit), ">")); // irmtfan add new criteria + //$criteria_status_count->add(new Criteria("approved", 1));// irmtfan commented and removed + //$criteria_status_post->add(new Criteria("p.approved", 1));// irmtfan commented and removed + } break; default: - $criteria_status_count = new Criteria("approved", 1); - $criteria_status_post = new Criteria("p.approved", 1); + $criteria_count->add(new Criteria("approved", 1)); // irmtfan add new criteria + $criteria_post->add(new Criteria("p.approved", 1)); // irmtfan add new criteria break; } -$criteria_count->add($criteria_status_count); -$criteria_post->add($criteria_status_post); - +//$criteria_count->add($criteria_status_count); // irmtfan commented and removed +//$criteria_post->add($criteria_status_post); // irmtfan commented and removed +// END irmtfan solve the status issues and specially status = new issue $karma_handler =& xoops_getmodulehandler('karma', 'newbb'); $user_karma = $karma_handler->getUserKarma(); @@ -135,8 +139,8 @@ ); $viewmode = in_array($viewmode, $valid_modes) ? $viewmode : $valid_modes[0]; -$postCount = $post_handler->getPostCount($criteria_count); -$posts = $post_handler->getPostsByLimit($criteria_post, $post_perpage, $start/*, $join*/); +$postCount = $post_handler->getPostCount($criteria_count, $join);// irmtfan add join for read_mode = 2 +$posts = $post_handler->getPostsByLimit($criteria_post, $post_perpage, $start, $join);// irmtfan add join for read_mode = 2 $poster_array = array(); if (count($posts)>0) foreach (array_keys($posts) as $id) { |
From: <ir...@us...> - 2012-10-10 11:01:42
|
Revision: 10211 http://sourceforge.net/p/xoops/svn/10211 Author: irmtfan Date: 2012-10-10 11:01:37 +0000 (Wed, 10 Oct 2012) Log Message: ----------- bug fix: search.php, list.topic.php - feature add: topic search, highlight keywords, show post text in search Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php XoopsModules/newbb/branches/irmtfan/newbb/class/post.php XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php XoopsModules/newbb/branches/irmtfan/newbb/include/search.inc.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/search.php XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_search.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_searchresults.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/include/functions.text.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-10-10 11:01:37 UTC (rev 10211) @@ -1,3 +1,52 @@ +date 2012-10-10 +=================================== +1- bug fix: in list.topic.php: remove empty arrays in getStatus function +in newbb/class/topic.renderer.php + +2- bug fix: add template smarty variables to search.php to save the user inputs in submit. move select boxes from template to php file +in newbb/templates/newbb_search.html, newbb/search.php + +3- bug fix: in search.php (previously in newbb_search.html): wrongly the andor value="all" (it should be value="AND"), change default andor="OR" to andor="AND" to be like XOOPS CORE setting +in newbb/search.php + +4- bug fix: wrongly p.post_time = since (should be >= since) +in newbb/class/topic.renderer.php + +5- bug fix: $hidvar should be <{$hidvar}> smarty. Improve $hidvar and $hidval in template +in newbb/templates/newbb_viewall.html + +6- bug fix: we need old vars for selection boxes. +in newbb/class/topic.renderer.php, newbb/templates/newbb_viewall.html + +7- bug fix: remove name attribute from submit buttons when method=get +in newbb/templates/newbb_index.html, newbb/templates/newbb_viewall.html, newbb/templates/newbb_viewforum.html, newbb/templates/newbb_search.html + +8- bug fix: wrongly dont parse negative values (categories) when newbb_forumSelectBox is multiple. add a new getIdsByValues function to class/forum.php +in newbb/class/forum.php, newbb/include/search.inc.php, newbb/include/topic.renderer.php, + +9- bug fix: id="xo-pagenav" is hardcoded in the XOOPS Core 2.5.5 and 2.6 (mrphilong/irmtfan) +in newbb/templates/newbb_viewall.html, newbb/templates/newbb_viewforum.html, +newbb/templates/newbb_viewpost.html, newbb/templates/newbb_viewtopic.html + +10- feature add: add newbb_forumSelectBox multiple to list.topic.php +in newbb/class/topic.renderer.php, newbb/templates/newbb_viewall.html + +11- feature add: show search results: 1- post title 2- post text +in newbb/search.php, newbb/templates/newbb_search.html, newbb/templates/newbb_searchresults.html, newbb/language/LANG/main.php, newbb/docs/lang_diff.txt + +12- feature add: add "select text" and "highlighter" to search keywords. add a new file include/functions.text.php to handle text +in newbb/include/functions.text.php, newbb/include/plugin.php, newbb/class/post.php, newbb/include/search.inc.php, newbb/search.php +newbb/templates/css/language/LANG/style.css + +13- bug fix: remove hardcode database access, solve order issues, reduce queries, permissions issues. file include/search.inc.php is completely rewritten (important) +in newbb/include/search.inc.php + +14- feature add: add topic search to viewtopic and viewpost +in newbb/templates/newbb_viewtopic.html, newbb/search.php, newbb/language/LANG/main.php, newbb/docs/lang_diff.txt + +15- bug fix: in list.topic.php the topic_link is hardcoded. add topic_excerpt +in newbb/class/topic.renderer.php + date 2012-10-02 =================================== 1- feature add: jump to last post read in the topic when the post_id is not in the URL(kwaltman/irmtfan) Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -917,5 +917,44 @@ unset($parents, $parents_list); return $ret; } + + // START irmtfan - get forum Ids by values. parse positive values to forum IDs and negative values to category IDs. value=0 => all valid forums + /** + * function for get forum Ids by positive and negative values + * + * @param text $values: positive values = forums | negative values = cats | $values=0 = all valid forums, $permission , true/false $parse_cats + * @return $valid_forums + */ + function getIdsByValues($values = 0, $permission = "access", $parse_cats = true) { + // Get all valid forums with this permission + $valid_forums = $this->getIdsByPermission($permission); + // if no value or value=0 return all valid forums + if ( empty($values) ) { + return $valid_forums; + } + $values = is_numeric($values) ? array($values) : $values; + //parse negative values to category IDs + $forums = array(); + $cats = array(); + foreach ($values as $val) { + if ($val == 0) { + // value=0 => all valid forums + return $valid_forums; + } elseif ($val > 0) { + $forums[] = $val; + } else { + $cats[] = abs($val); + } + } + // if dont want to parse categories OR no cats return all forums + if ( empty($parse_cats) || empty($cats) ) { + return array_intersect($valid_forums, $forums); + } + // Get all forums by category IDs + $forumObjs = $this->getForumsByCategory($cats, $permission, true); + $forums = array_merge( $forums, array_keys($forumObjs) ); + return array_intersect($valid_forums, $forums); + } + // END irmtfan - get forum Ids by values. parse positive values to forum IDs and negative values to category IDs. value=0 => all valid forums } ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -348,6 +348,7 @@ mod_loadFunctions("time", "newbb"); mod_loadFunctions("render", "newbb"); + mod_loadFunctions("text", "newbb"); // irmtfan add text functions $post_id = $this->getVar('post_id'); $topic_id = $this->getVar('topic_id'); @@ -388,6 +389,15 @@ $post_text = $this->getVar('post_text'); $post_attachment = $this->displayAttachment(); } + // START irmtfan add highlight feature + // Hightlighting searched words + $post_title = $this->getVar('subject'); + if (isset($_GET['keywords']) && !empty($_GET['keywords'])) { + $keywords = $myts->htmlSpecialChars(trim(urldecode($_GET['keywords']))); + $post_text = newbb_highlightText($post_text, $keywords); + $post_title = newbb_highlightText($post_title, $keywords); + } + // END irmtfan add highlight feature if ( isset($viewtopic_users[$this->getVar('uid')]) ) { $poster = $viewtopic_users[$this->getVar('uid')]; } else { @@ -547,7 +557,7 @@ 'post_parent_id' => $this->getVar('pid'), 'post_date' => newbb_formatTimestamp($this->getVar('post_time')), 'post_image' => $post_image, - 'post_title' => $this->getVar('subject'), + 'post_title' => $post_title, // irmtfan $post_title to add highlight keywords 'post_text' => $post_text, 'post_attachment' => $post_attachment, 'post_edit' => $this->displayPostEdit(), Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -101,9 +101,13 @@ case "forum": if (is_numeric($val)) { $val = intval($val); - } elseif (!empty($val)) { - $val = implode("|", array_map("intval", explode(", ", $val))); + // START irmtfan - if the forum is array + } elseif (is_array($val)) { + $val = implode("|", $val); + //} elseif (!empty($val)) { + // $val = implode("|", array_map("intval", explode(", ", $val))); } + // END irmtfan - if the forum is array break; case "uid": @@ -199,12 +203,16 @@ switch($var) { case "forum": $forum_handler = xoops_getmodulehandler('forum', 'newbb'); + // START irmtfan - get forum Ids by values. parse positive values to forum IDs and negative values to category IDs. value=0 => all valid forums // Get accessible forums - $access_forums = $forum_handler->getIdsByPermission(); + $access_forums = $forum_handler->getIdsByValues(array_map("intval", @explode("|", $val))); // Filter specified forums if any - if (!empty($val) && $_forums = @explode("|", $val)) { - $access_forums = array_intersect($access_forums, array_map("intval", $_forums)); - } + //if (!empty($val) && $_forums = @explode("|", $val)) { + //$access_forums = array_intersect($access_forums, array_map("intval", $_forums)); + //} + $this->vars["forum"] = $this->setVar("forum", $access_forums); + // END irmtfan - get forum Ids by values. parse positive values to forum IDs and negative values to category IDs. value=0 => all valid forums + if (empty($access_forums)) { $this->noperm = true; // irmtfan - it just return return the forum_id only when the forum_id is the first allowed forum - no need for this code implode is enough removed. @@ -223,7 +231,8 @@ case "since": if (!empty($val)) { - $this->query["where"][] = "p.post_time = ". (time() - newbb_getSinceTime($val)); + // irmtfan - should be >= instead of = + $this->query["where"][] = "p.post_time >= ". (time() - newbb_getSinceTime($val)); } break; @@ -320,14 +329,14 @@ function getStatus($type = null, $status = null) { $links = array( - "" => "", + //"" => "", /* irmtfan remove empty array */ "all" => _ALL, "digest" => _MD_DIGEST, "unreplied" => _MD_UNREPLIED, "unread" => _MD_UNREAD, ); $links_admin = array( - " " => "", + //" " => "", /* irmtfan remove empty array */ "active" => _MD_TYPE_ADMIN, "pending" => _MD_TYPE_PENDING, "deleted" => _MD_TYPE_DELETED, @@ -356,8 +365,17 @@ { $selection = array("action" => $this->page); $selection["vars"] = $this->vars; - $selection["vars"]["order"] = $selection["vars"]["since"] = null; - + // irmtfan need vars for other selections + //$selection["vars"]["order"] = $selection["vars"]["since"] = null; + // START irmtfan add forum selection box + mod_loadFunctions("forum", "newbb"); + $forum_selected = empty($this->vars["forum"]) ? null : explode("|", @$this->vars["forum"]); + $selection["forum"] = '<select name="forum[]" multiple="multiple">'; + $selection["forum"] .= '<option value="0">'._MD_ALL.'</option>'; + $selection["forum"] .= newbb_forumSelectBox($forum_selected); + $selection["forum"] .= '</select>'; + // END irmtfan add forum selection box + $sort_selected = empty($this->vars["sort"]) ? "lastpost" : $this->vars["sort"]; $sorts = $this->getSort("", "title"); $selection["sort"] = "<select name='sort'>"; @@ -677,7 +695,8 @@ 'topic_icon' => $topic_icon, 'type_id' => $myrow['type_id'], 'topic_title' => $topic_title, - 'topic_link' => XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'], // . '&forum=' . $myrow['forum_id'], + //'topic_link' => XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'], // . '&forum=' . $myrow['forum_id'], // irmtfan comment + 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'], // irmtfan remove hardcode link 'rating_img' => $rating_img, 'topic_page_jump' => $topic_page_jump, 'topic_page_jump_icon' => $topic_page_jump_icon, Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-10-10 11:01:37 UTC (rev 10211) @@ -58,6 +58,11 @@ define("_MI_SINCE_DEFAULT","'Since' default value in selection box"); define("_MI_SINCE_DEFAULT_DESC","Default value in the selection box if not specified by users. Positive value for days and negative value for hours. (0=From the beginning) (365=From the last year)"); +add: +define('_MD_SEARCHTOPIC','Search Topic'); +define('_MD_SHOWSEARCH','Show results:'); +define('_MD_SEARCHPOSTTEXT','posts text'); + admin.php --------- define('_AM_NEWBB_REPORTSAVE','Selected Reports have been processed successfully'); Added: XoopsModules/newbb/branches/irmtfan/newbb/include/functions.text.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/functions.text.php (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/functions.text.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -0,0 +1,102 @@ +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...>, irmtfan <ir...@us...> + * @since 4.3 + * @version $Id $ + * @package module::newbb + */ + +if (!defined('XOOPS_ROOT_PATH')) { exit(); } + +define("NEWBB_FUNCTIONS_TEXT_LOADED", TRUE); + +IF (!defined("NEWBB_FUNCTIONS_TEXT")): +define("NEWBB_FUNCTIONS_TEXT", 1); +/** +* function for select from a text where it have some keywords +* +* @param text $text, array text $queryarray, int $selectlength = 200, int $selectstartlag = 100, int $highlight = true +* @return text $select_text +*/ + +function newbb_selectText($text, $queryarray, $selectstartlag = 100, $selectlength = 200, $striptags = true, $excludetags = '<br>') { + $sanitized_text = $striptags ? strip_tags($text, $excludetags) : $text; + $queryarray = newbb_str2array($queryarray); + $text_i = strtolower($sanitized_text); + $queryarray = array_map('strtolower', $queryarray); + $lengtharray = array_map('strlen', $queryarray); + $maxlengthquery = max($lengtharray); + $select_text = ""; + $startpos = 0; + $endpos = strlen($sanitized_text); + while ($startpos < $endpos) { + $pos = $endpos; + foreach ($queryarray as $query) { + if ( ($thispos = strpos($text_i, $query, $startpos)) !== false) { + $pos = min($thispos, $pos); + } + } + if ($pos == $endpos) break; + $start = max(($pos - $selectstartlag), ($startpos - $maxlengthquery), 0); // $startpos is the last position in the previous select text + $length = $maxlengthquery + $selectlength; //xoops_local("strlen", $query) + 200; + $select_text .= "<p>[...] " . xoops_substr($sanitized_text, $start, $length, " [...]") . "</p>"; + $startpos = $start + $length + 1; // start searching from next position. + } + return '<span class="newbb_select_text">' . $select_text . '</span>'; + +} +/** +* function for highlight a text when it have some keywords +* +* @param text $text, array text $queryarray +* @return text $highlight_text +*/ + +function newbb_highlightText($text, $queryarray) { + global $xoopsModuleConfig; + if (empty($xoopsModuleConfig['highlight_search_enable'])) return $text; + $queryarray = newbb_str2array($queryarray); + // if $queryarray is string + $highlight_text = $text; + foreach ($queryarray as $key => $query) { + // use preg_replace instead of str_replace to exclude all $queries inside html span tag + $highlight_text = preg_replace("/(?!(?:[^<]+>|[^>]+<\/a>))(". preg_quote($query) .")/si", newbb_highlighter($query, $key), $highlight_text); + } + return $highlight_text; +} +/** +* function for highlighting search results +* +* @param text $query, int $i +* @return unknown +*/ +function newbb_highlighter($query, $i) { + return '<span class="newbb_highlight term' . $i . '">' . $query . '</span>'; +} +/** +* function for convert string to array +* +* @param text/array $str +* @return unknown +*/ + +function newbb_str2array($str) { + if (!is_array($str)) { + // split the phrase by any number of commas or space characters, + // which include " ", \r, \t, \n and \f + $temp_str = preg_split('/[\s,]+/', $str); + $strarray = array(); + foreach ($temp_str as $s) { + $strarray[] = addSlashes($s); + } + return $strarray; + } else { + return $str; + } +} +ENDIF; +?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -96,6 +96,8 @@ $customConfig["display_text_each_link"] = include XOOPS_ROOT_PATH."/modules/newbb/include/display.php"; // jump to last post read in the topic $customConfig["jump_to_topic_last_post_read_enabled"] = true; +// highlight keywords in search +$customConfig["highlight_search_enable"] = true; // END hacked by irmtfan return $customConfig; Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/search.inc.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/search.inc.php 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/search.inc.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -1,160 +1,116 @@ <?php -// $Id: search.inc.php 62 2012-08-17 10:15:26Z alfred $ -// ------------------------------------------------------------------------ // -// XOOPS - PHP Content Management System // -// Copyright (c) 2000 XOOPS.org // -// <http://www.xoops.org/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// 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. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: phppp (D.J., in...@gm...) // -// URL: http://xoopsforge.com, http://xoops.org.cn // -// Project: Article Project // -// ------------------------------------------------------------------------ // +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...>, irmtfan <ir...@us...> + * @since 4.3 + * @version $Id $ + * @package module::newbb + */ +// completely rewrite by irmtfan - remove hardcode database access, solve order issues, add post_text & topic_id, add highlight and reduce queries if (!defined('XOOPS_ROOT_PATH')) { exit(); } -require_once(XOOPS_ROOT_PATH.'/modules/newbb/include/functions.php'); -function newbb_search($queryarray, $andor, $limit, $offset, $userid, $forums = 0, $sortby = 0, $searchin = "both", $subquery = "") +function newbb_search($queryarray, $andor, $limit, $offset, $userid, $forums = 0, $sortby = 0, $searchin = "both", $criteriaExtra = "") { - global $xoopsDB, $xoopsConfig, $myts, $xoopsUser; + global $myts; - $uid = ( is_object($xoopsUser) && $xoopsUser->isactive() ) ? $xoopsUser->getVar('uid') : 0; - $forum_handler = xoops_getmodulehandler('forum', 'newbb'); - $valid_forums = $forum_handler->getIdsByPermission(); + $valid_forums = $forum_handler->getIdsByValues($forums); // can we use view permission? $forum_handler->getIdsByValues($forums, "view") + + $criteriaPost = new CriteriaCompo(); + $criteriaPost->add(new Criteria('p.approved', 1), 'AND'); // only active posts - if (is_array($forums) && count($forums) > 0) { - $valid_forums = array_intersect($valid_forums, $forums); - } elseif (is_numeric($forums) && $forums > 0) { - $valid_forums = array_intersect($valid_forums, array($forums)); + $forum_list = array();// get forum lists just for forum names + if (count($valid_forums) > 0) { + $criteriaPermissions = new CriteriaCompo(); + $criteriaPermissions->add(new Criteria("p.forum_id", "(".implode(",",$valid_forums).")", "IN"), 'AND'); + $forum_list = $forum_handler->getAll(new Criteria("forum_id", "(".implode(", ", $valid_forums).")", "IN"), "forum_name" , false); } - - $sql = 'SELECT p.uid,f.forum_id, p.topic_id, p.poster_name, p.post_time,'; - $sql .= ' f.forum_name, p.post_id, p.subject - FROM '.$xoopsDB->prefix('bb_posts').' p, - '.$xoopsDB->prefix('bb_posts_text').' pt, - '.$xoopsDB->prefix('bb_forums').' f'; - $sql .= ' WHERE p.post_id = pt.post_id'; - $sql .= ' AND p.approved = 1'; - $sql .= ' AND p.forum_id = f.forum_id'; -// AND p.uid = u.uid'; // In case exists a userid with which the associated user is removed, this line will block search results. Can do nothing unless xoops changes its way dealing with user removal - if (!empty($valid_forums)) { - $sql .= ' AND f.forum_id IN ('.implode(',', $valid_forums).')'; - } - - $isUser=false; + if ( is_numeric($userid) && $userid != 0 ) { - $sql .= " AND p.uid=".$userid." "; - $isUser=true; - } else - // TODO - if (is_array($userid) && count($userid) > 0) { + $criteriaUser = new CriteriaCompo(); + $criteriaUser->add(new Criteria('p.uid', $userid), 'OR'); + } elseif (is_array($userid) && count($userid) > 0) { $userid = array_map('intval', $userid); - $sql .= " AND p.uid IN (".implode(',', $userid).") "; - $isUser=true; + $criteriaUser = new CriteriaCompo(); + $criteriaUser->add(new Criteria('p.uid', '(' . implode(',', $userid) . ')', 'IN'), 'OR'); } - + $count = count($queryarray); + $hightlight_key = ""; if ( is_array($queryarray) && $count > 0) { - switch ($searchin) { - case 'title': - $sql .= " AND ((p.subject LIKE '%$queryarray[0]%')"; - for ($i = 1; $i < $count; $i++) { - $sql .= " $andor "; - $sql .= "(p.subject LIKE '%$queryarray[$i]%')"; - } - $sql .= ") "; - break; - - case 'text': - $sql .= " AND ((pt.post_text LIKE '%$queryarray[0]%')"; - for ($i = 1; $i < $count; $i++) { - $sql .= " $andor "; - $sql .= "(pt.post_text LIKE '%$queryarray[$i]%')"; - } - $sql .= ") "; - break; - case 'both' : - default; - $sql .= " AND ((p.subject LIKE '%$queryarray[0]%' OR pt.post_text LIKE '%$queryarray[0]%')"; - for ($i = 1; $i < $count; $i++) { - $sql .= " $andor "; - $sql .= "(p.subject LIKE '%$queryarray[$i]%' OR pt.post_text LIKE '%$queryarray[$i]%')"; - } - $sql .= ") "; - break; - } + $criteriaKeywords = new CriteriaCompo(); + for ($i = 0; $i < $count; $i++) { + $criteriaKeyword = new CriteriaCompo(); + switch ($searchin) { + case 'title': + $criteriaKeyword->add(new Criteria('p.subject', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR'); + break; + case 'text': + $criteriaKeyword->add(new Criteria('t.post_text', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR'); + break; + case 'both' : + default : + $criteriaKeyword->add(new Criteria('p.subject', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR'); + $criteriaKeyword->add(new Criteria('t.post_text', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR'); + break; + } + $criteriaKeywords->add($criteriaKeyword, $andor); + unset($criteriaKeyword); + } + // add highlight keywords to post links + $hightlight_key = "&keywords=" . implode('+', $queryarray); } + $criteria = new CriteriaCompo(); + $criteria->add($criteriaPost, 'AND'); + if (!empty($criteriaPermissions)) { + $criteria->add($criteriaPermissions, 'AND'); + } + if (!empty($criteriaUser)) { + $criteria->add($criteriaUser, 'AND'); + } + if (!empty($criteriaKeywords)) { + $criteria->add($criteriaKeywords, 'AND'); + } + if (!empty($criteriaExtra)) { + $criteria->add($criteriaExtra, 'AND'); + } + //$criteria->setLimit($limit); // no need for this + //$criteria->setStart($offset); // no need for this + + if (empty($sortby)) { + $sortby = "p.post_time"; + } + $criteria->setSort($sortby); + $order = 'ASC'; + if ($sortby == "p.post_time") { + $order = 'DESC'; + } + $criteria->setOrder($order); + + $post_handler =& xoops_getmodulehandler('post', 'newbb'); + $posts = $post_handler->getPostsByLimit($criteria, $limit, $offset); - if (!$sortby) { - $sortby = "p.post_time DESC"; - } - $sql .= $subquery." ORDER BY ".$sortby; - $result = $xoopsDB->query($sql,$limit,$offset); - $ret = array(); - $users = array(); + $ret = array(); $i = 0; - while($myrow = $xoopsDB->fetchArray($result)) { - $ret[$i]['link'] = XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=".$myrow['post_id']; - $ret[$i]['title'] = $myrow['subject']; - $ret[$i]['time'] = $myrow['post_time']; - $ret[$i]['uid'] = $myrow['uid']; - $ret[$i]['forum_name'] = $myts->htmlSpecialChars($myrow['forum_name']); - $ret[$i]['forum_link'] = XOOPS_URL . "/modules/newbb/viewforum.php?forum=".$myrow['forum_id']; - $users[$myrow['uid']] = 1; - $ret[$i]['poster_name'] = $myrow['poster_name']; + foreach (array_keys($posts) as $id) { + $post =& $posts[$id]; + $post_data = $post->getPostBody(); + $ret[$i]['topic_id'] = $post->getVar('topic_id'); + $ret[$i]['link'] = XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $post->getVar('post_id') . $hightlight_key; // add highlight key + $ret[$i]['title'] = $post_data['subject']; + $ret[$i]['time'] = $post_data['date']; + $ret[$i]['forum_name'] = $myts->htmlSpecialChars($forum_list[$post->getVar('forum_id')]["forum_name"]); + $ret[$i]['forum_link'] = XOOPS_URL . "/modules/newbb/viewforum.php?forum=" .$post->getVar('forum_id'); + $ret[$i]['post_text'] = $post_data['text']; + $ret[$i]['uid'] = $post->getVar('uid'); + $ret[$i]['poster'] = $post->getVar('uid') ? '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$ret[$i]['uid'].'">' . $post_data['author'] . '</a>' : $post_data['author']; $i++; } - - if (count($users)>0) { - $member_handler = xoops_gethandler('member'); - $userid_array = array_keys($users); - $user_criteria = "(".implode(",",$userid_array).")"; - $users = $member_handler->getUsers( new Criteria('uid', $user_criteria, 'IN'), true); - } else { - $users = null; - } - - $newbbConfig = newbb_load_config(); - - $count = count($ret); - for($i =0; $i < $count; $i ++ ) { - if ($ret[$i]['uid'] >0) { - if ( isset($users[$ret[$i]['uid']]) && (is_object($users[$ret[$i]['uid']])) && ($users[$ret[$i]['uid']]->isActive()) ) { - $poster = ($newbbConfig['show_realname'] && $users[$ret[$i]['uid']]->getVar('name'))? $users[$ret[$i]['uid']]->getVar('name') : $users[$ret[$i]['uid']]->getVar('uname'); - $poster = $myts->htmlSpecialChars($poster); - $ret[$i]['poster'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$ret[$i]['uid'].'">'.$poster.'</a>'; - $title = $myts->htmlSpecialChars($ret[$i]['title']); - } else { - $ret[$i]['poster'] = $xoopsConfig['anonymous']; - $ret[$i]['uid'] = 0; // Have to force this to fit xoops search.php - } - } else { - $ret[$i]['poster'] = (empty($ret[$i]['poster_name']))?$xoopsConfig['anonymous']:$myts->htmlSpecialChars($ret[$i]['poster_name']); - $ret[$i]['uid'] = 0; - } - } - unset($users); - return $ret; } ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -497,4 +497,7 @@ define('_MD_NEWBB_SEE','See'); // votepolls.php - irmtfan define('_MD_POLL_NOOPTION','You must choose an option !!'); +define('_MD_SEARCHTOPIC','Search Topic'); +define('_MD_SHOWSEARCH','Show results:'); +define('_MD_SEARCHPOSTTEXT','Posts text'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -495,4 +495,7 @@ define('_MD_NEWBB_SEE','نمایش'); // votepolls.php - irmtfan define('_MD_POLL_NOOPTION','شما باید یکی از گزینه ها را انتخاب کنید!!'); +define('_MD_SEARCHTOPIC','جستجو تاپیک'); +define('_MD_SHOWSEARCH','نمایش نتایج:'); +define('_MD_SEARCHPOSTTEXT','متن پست'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/search.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/search.php 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/search.php 2012-10-10 11:01:37 UTC (rev 10211) @@ -45,6 +45,7 @@ mod_loadFunctions("render", "newbb"); mod_loadFunctions("forum", "newbb"); mod_loadFunctions("time", "newbb"); +mod_loadFunctions("text", "newbb"); // irmtfan add text functions include_once XOOPS_ROOT_PATH.'/modules/newbb/include/search.inc.php'; $limit = $xoopsModuleConfig['topics_per_page']; @@ -54,8 +55,8 @@ $start = 0; $uid = 0; $forum = 0; -$sortby = 'p.post_time DESC'; -$subquery = ""; +$sortby = 'p.post_time'; // irmtfan remove DESC +$criteriaExtra = "";// irmtfan change to criteria $searchin = "both"; $sort = ""; $since = isset($_POST['since']) ? $_POST['since'] : (isset($_GET['since']) ? $_GET['since'] : null); @@ -80,18 +81,26 @@ $forum = array_map("intval",explode("|", $forum)); } $next_search['forum'] = implode("|", $forum); + // START irmtfan topic search + $topic = isset($_POST['topic']) ? $_POST['topic'] : (isset($_GET['topic']) ? $_GET['topic'] : null); + $next_search['topic'] = $topic; + // END irmtfan topic search + // START irmtfan add show search + $show_search = isset($_POST['show_search']) ? $_POST['show_search'] : (isset($_GET['show_search']) ? $_GET['show_search'] : 'post_text'); + $next_search['show_search'] = $show_search; + // START irmtfan add show search $addterms = isset($_POST['andor']) ? $_POST['andor'] : (isset($_GET['andor']) ? $_GET['andor'] : ""); $next_search['andor'] = $addterms; if ( !in_array(strtolower($addterms), array("or", "and", "exact"))) { - $andor = "OR"; + // irmtfan change default to AND + $andor = "AND"; } else { $andor = strtoupper($addterms); } $uname_required = false; - $search_username = $uname; - $search_username = trim($search_username); + $search_username = trim($uname);// irmtfan one line is enough $next_search['uname'] = $search_username; if ( !empty($search_username) ) { $uname_required = true; @@ -136,77 +145,154 @@ } // entries must be lowercase - //$allowed = array('t.topic_last_post_id desc', 'p.post_time desc', 't.topic_title', 't.topic_views', 't.topic_replies', 'f.forum_name', 'u.uname'); - $allowed = array('p.post_time desc', 't.topic_title', 't.topic_views', 't.topic_replies', 'f.forum_name', 'u.uname'); + $allowed = array('p.post_time', 'p.subject'); // irmtfan just post time and subject $sortby = isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null); $next_search['sortby'] = $sortby; - //$sortby = (in_array(strtolower($sortby), $allowed)) ? $sortby : 't.topic_last_post_id desc'; - $sortby = (in_array(strtolower($sortby), $allowed)) ? $sortby : 'p.post_time desc'; + //$sortby = (in_array(strtolower($sortby), $allowed)) ? $sortby : 't.topic_last_post_id'; + $sortby = (in_array(strtolower($sortby), $allowed)) ? $sortby : 'p.post_time'; $searchin = isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? $_GET['searchin'] : 'both'); $next_search['searchin'] = $searchin; + // START irmtfan use criteria - add topic search if (!empty($since)) { - $subquery = ' AND p.post_time >= ' . (time() - newbb_getSinceTime($since)); - } - - if ($uname_required&&(!$uid||count($uid)<1)) $result = false; - else $results = newbb_search($queries, $andor, $limit, $start, $uid, $forum, $sortby, $searchin, $subquery); - - if ( count($results) < 1 ) { + $criteriaExtra = new CriteriaCompo(); + $criteriaExtra->add(new Criteria('p.post_time', (time() - newbb_getSinceTime($since)), '>='), 'OR'); + } elseif (is_numeric($topic) && !empty($topic)) { + $criteriaExtra = new CriteriaCompo(); + $criteriaExtra->add(new Criteria('p.topic_id', $topic), 'OR'); + } + // END irmtfan use criteria - add topic search + + if ($uname_required&&(!$uid||count($uid)<1)) $results = array(); // irmtfan bug fix array() + else $results = newbb_search($queries, $andor, $limit, $start, $uid, $forum, $sortby, $searchin, $criteriaExtra); // irmtfan $criteriaExtra + + // add newbb_highlightText function to keywords + $search_info_keywords=newbb_highlightText($myts->htmlSpecialChars($term), $queries); + // add number of results + $num_results = count($results); + if ( $num_results < 1 ) { $xoopsTpl->assign("lang_nomatch", _SR_NOMATCH); } else { + // START irmtfan add show search post_text foreach ($results as $row) { - $xoopsTpl->append('results', array('forum_name' => $myts->htmlSpecialChars($row['forum_name']), 'forum_link' => $row['forum_link'], 'link' => $row['link'], 'title' => $row['title'], 'poster' => $row['poster'], 'post_time' => formatTimestamp($row['time'], "m"))); + $post_text = ""; + if ($show_search == 'post_text') { + $post_text = newbb_selectText($row['post_text'], $queries, 100, 200, false); // strip html tags = false + $post_text = newbb_highlightText($post_text, $queries); + } + // add newbb_highlightText function to subject - add post_text + $xoopsTpl->append('results', array('forum_name' => $row['forum_name'], 'forum_link' => $row['forum_link'], 'link' => $row['link'], 'title' => newbb_highlightText($row['title'],$queries), 'poster' => $row['poster'], 'post_time' => formatTimestamp($row['time'], "m"), 'post_text' => $post_text)); } + // END irmtfan add show search post_text unset($results); if (count($next_search)>0) { $items = array(); foreach ($next_search as $para => $val) { - if (!empty($val)) $items[] = "$para=$val"; + if (!empty($val)) $items[] = "{$para}={$val}";// irmtfan add { and } } if (count($items)>0) $paras = implode("&",$items); unset($next_search); unset($items); } $search_url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/search.php?".$paras; - - $next_results = newbb_search($queries, $andor, 1, $start + $limit, $uid, $forum, $sortby, $searchin, $subquery); - $next_count = count($next_results); - $has_next = false; - if (is_array($next_results) && $next_count >0) { - $has_next = true; - } - if (false != $has_next) { + // irmtfan remove to have just one query and appropriate next and prev links + //$next_results = newbb_search($queries, $andor, 1, $start + $limit, $uid, $forum, $sortby, $searchin, $subquery); + //$next_count = count($next_results); + //$has_next = false; + //if (is_array($next_results) && $next_count >0) { + //$has_next = true; + //} + // irmtfan if $results < $limit => it is impossible to have next + if ($num_results == $limit) { $next = $start + $limit; $queries = implode(',',$queries); - $search_url_next = $search_url."&start=$next"; + $search_url_next = $search_url."&start={$next}"; // irmtfan add { and } $search_next = '<a href="'.htmlspecialchars($search_url_next).'">'._SR_NEXT.'</a>'; $xoopsTpl->assign("search_next", $search_next); } if ( $start > 0 ) { $prev = $start - $limit; - $search_url_prev = $search_url."&start=$prev"; + $search_url_prev = $search_url."&start={$prev}"; // irmtfan add { and } $search_prev = '<a href="'.htmlspecialchars($search_url_prev).'">'._SR_PREVIOUS.'</a>'; $xoopsTpl->assign("search_prev", $search_prev); } } - - $search_info = _SR_KEYWORDS.": ".$myts->htmlSpecialChars($term); + // irmtfan add newbb_highlightText function + $search_info = _SR_KEYWORDS.": ".$search_info_keywords; if ($uname_required) { if ($search_info) $search_info .= "<br />"; $search_info .= _MD_USERNAME.": ".$myts->htmlSpecialChars($search_username); } + // add num_results + $search_info .= "<br />" . sprintf(_SR_SHOWING, $start + 1, $start + $num_results); $xoopsTpl->assign("search_info", $search_info); } +// START irmtfan - assign template vars for search +/* term */ +$xoopsTpl->assign("search_term", $term); +/* andor */ +$andor_select = "<select name=\"andor\">"; +$andor_select .= "<option value=\"OR\""; +if ("OR" == $andor) $andor_select .= " selected=\"selected\""; +$andor_select .= ">" . _SR_ANY . "</option>"; +$andor_select .= "<option value=\"AND\""; +if ("AND" == $andor || empty($andor)) $andor_select .= " selected=\"selected\""; +$andor_select .= ">" . _SR_ALL . "</option>"; +$andor_select .= "<option value=\"EXACT\""; +if ("EXACT" == $andor) $andor_select .= " selected=\"selected\""; +$andor_select .= ">" . _SR_EXACT . "</option>"; +$andor_select .= "</select>"; +$xoopsTpl->assign("andor_selection_box", $andor_select); + +/* forum */ $select_forum = '<select name="forum[]" size="5" multiple="multiple">'; $select_forum .= '<option value="all">'._MD_SEARCHALLFORUMS.'</option>'; -$select_forum .= newbb_forumSelectBox(); +$select_forum .= newbb_forumSelectBox($forum); $select_forum .= '</select>'; $xoopsTpl->assign_by_ref("forum_selection_box", $select_forum); + +/* searchin */ +$searchin_select = ""; +$searchin_select .= "<input type=\"radio\" name=\"searchin\" value=\"title\""; +if ("title" == $searchin) $searchin_select .= " checked"; +$searchin_select .= " />" . _MD_SUBJECT . " "; +$searchin_select .= "<input type=\"radio\" name=\"searchin\" value=\"text\""; +if ("text" == $searchin) $searchin_select .= " checked"; +$searchin_select .= " />" . _MD_BODY . " "; +$searchin_select .= "<input type=\"radio\" name=\"searchin\" value=\"both\""; +if ("both" == $searchin || empty($searchin)) $searchin_select .= " checked"; +$searchin_select .= " />" . _MD_SUBJECT . " & " . _MD_BODY. " "; +$xoopsTpl->assign("searchin_radio", $searchin_select); + +/* show_search */ +$show_search_select = ""; +$show_search_select .= "<input type=\"radio\" name=\"show_search\" value=\"post\""; +if ("post" == $show_search) $show_search_select .= " checked"; +$show_search_select .= " />" . _MD_POSTS . " "; +$show_search_select .= "<input type=\"radio\" name=\"show_search\" value=\"post_text\""; +if ("post_text" == $show_search || empty($show_search)) $show_search_select .= " checked"; +$show_search_select .= " />" . _MD_SEARCHPOSTTEXT. " "; +$xoopsTpl->assign("show_search_radio", $show_search_select); + +/* author */ +$xoopsTpl->assign("author_select", $search_username); + +/* sortby */ +$sortby_select = "<select name=\"sortby\">"; +$sortby_select .= "<option value=\"p.post_time\""; +if ("p.post_time" == $sortby || empty($sortby)) $sortby_select .= " selected=\"selected\""; +$sortby_select .= ">" . _MD_DATE . "</option>"; +$sortby_select .= "<option value=\"p.subject\""; +if ("p.subject" == $sortby) $sortby_select .= " selected=\"selected\""; +$sortby_select .= ">" . _MD_TOPIC . "</option>"; +$sortby_select .= "</select>"; +$xoopsTpl->assign("sortby_selection_box", $sortby_select); +// END irmtfan - assign template vars for search + // irmtfan get since from the user for selction box $since = isset($_GET['since']) ? intval($_GET['since']) : $xoopsModuleConfig["since_default"]; $select_since = newbb_sinceSelectBox($since); Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/style.css 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/style.css 2012-10-10 11:01:37 UTC (rev 10211) @@ -355,4 +355,19 @@ border-color: white #a1c1e6 black #a1c1e6; font-weight: normal; } + +span.newbb_highlight { +background-color: #FFFF80 !important; +font-weight: bold !important; +} +span.term0 { +background-color: #00FF00 !important; +} +span.term1 { +background-color: #FF0000 !important; +} +span.term2 { +background-color: #0000FF !important; +} + /* color - end */ \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/style.css 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/style.css 2012-10-10 11:01:37 UTC (rev 10211) @@ -358,4 +358,18 @@ border-color: white #a1c1e6 black #a1c1e6; font-weight: normal; } +span.newbb_highlight { +background-color: #FFFF80 !important; +font-weight: bold !important; +} +span.term0 { +background-color: #00FF00 !important; +} +span.term1 { +background-color: #FF0000 !important; +} +span.term2 { +background-color: #0000FF !important; +} + /* color - end */ \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-10-10 11:01:37 UTC (rev 10211) @@ -307,7 +307,8 @@ <input type="hidden" name="forum" id="forum" value="all" /> <input type="hidden" name="sortby" id="sortby" value="p.post_time desc" /> <input type="hidden" name="searchin" id="searchin" value="both" /> - <input type="submit" name="submit" id="submit" value="<{$smarty.const._MD_SEARCH}>" /> + <!-- irmtfan remove name="submit" --> + <input type="submit" id="submit" value="<{$smarty.const._MD_SEARCH}>" /> <br /> [ <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php"><{$smarty.const._MD_ADVSEARCH}></a> ] </form> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_search.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_search.html 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_search.html 2012-10-10 11:01:37 UTC (rev 10211) @@ -14,18 +14,13 @@ <tr> <!-- irmtfan hardcode removed align="right" --> <td class="head" width="10%" id="align_right"><strong><{$smarty.const._SR_KEYWORDS}></strong> </td> - <td class="even"><input type="text" name="term" /></td> +<!-- irmtfan add value="$search_term" --> + <td class="even"><input type="text" name="term" value="<{$search_term}>" /></td> </tr> <tr> -<!-- irmtfan hardcode removed align="right" --> +<!-- irmtfan hardcode removed align="right" add $andor_selection_box --> <td class="head" id="align_right"><strong><{$smarty.const._SR_TYPE}></strong> </td> - <td class="even"> - <select name="andor"> - <option value="or" selected="selected"><{$smarty.const._SR_ANY}></option> - <option value="all"><{$smarty.const._SR_ALL}></option> - <option value="exact"><{$smarty.const._SR_EXACT}></option> - </select> - </td> + <td class="even"><{$andor_selection_box}></td> </tr> <tr> <!-- irmtfan hardcode removed align="right" --> @@ -33,34 +28,31 @@ <td class="even"><{$forum_selection_box}></td> </tr> <tr> -<!-- irmtfan hardcode removed align="right" --> +<!-- irmtfan hardcode removed align="right" add $searchin_radio --> <td class="head" id="align_right"><strong><{$smarty.const._SR_SEARCHIN}></strong> </td> - <td class="even"><input type="radio" name="searchin" value="title" /><{$smarty.const._MD_SUBJECT}> - <input type="radio" name="searchin" value="text" /><{$smarty.const._MD_BODY}> - <input type="radio" name="searchin" value="both" checked="checked" /><{$smarty.const._MD_SUBJECT}> & <{$smarty.const._MD_BODY}> </td> + <td class="even"><{$searchin_radio}></td> </tr> <tr> -<!-- irmtfan hardcode removed align="right" --> +<!-- irmtfan hardcode removed align="right" add value="$author_select"--> <td class="head" id="align_right"><strong><{$smarty.const._MD_AUTHOR}></strong> </td> - <td class="even"><input type="text" name="uname" value="" /></td> + <td class="even"><input type="text" name="uname" value="<{$author_select}>" /></td> </tr> <tr> -<!-- irmtfan hardcode removed align="right" --> +<!-- irmtfan hardcode removed align="right" add $sortby_selection_box --> <td class="head" id="align_right"><strong><{$smarty.const._MD_SORTBY}></strong> </td> - <td class="even"> - <select name=="sortby"> - <option value="p.post_time desc" selected="selected"><{$smarty.const._MD_DATE}></option> - <option value="t.topic_title"><{$smarty.const._MD_TOPIC}></option> - <option value="f.forum_name"><{$smarty.const._MD_FORUM}></option> - <option value="u.uname"><{$smarty.const._MD_USERNAME}></option> - </select> - </td> + <td class="even"><{$sortby_selection_box}></td> </tr> <tr> <!-- irmtfan hardcode removed align="right" --> <td class="head" id="align_right"><strong><{$smarty.const._MD_SINCE}></strong> </td> <td class="even"><{$since_selection_box}></td> </tr> +<!-- START irmtfan add show search --> + <tr> + <td class="head" id="align_right"><strong><{$smarty.const._MD_SHOWSEARCH}></strong> </td> + <td class="even"><{$show_search_radio}></td> + </tr> +<!-- START irmtfan add show search --> <{if $search_rule}> <tr> <!-- irmtfan hardcode removed align="right" --> @@ -71,7 +63,8 @@ <tr> <!-- irmtfan hardcode removed align="right" --> <td class="head" id="align_right"> </td> - <td class="even"><input type="submit" name="submit" value="<{$smarty.const._MD_SEARCH}>" /></td> + <!-- irmtfan remove name="submit" --> + <td class="even"><input type="submit" value="<{$smarty.const._MD_SEARCH}>" /></td> </table></td> </tr> </table> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_searchresults.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_searchresults.html 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_searchresults.html 2012-10-10 11:01:37 UTC (rev 10211) @@ -20,6 +20,18 @@ <td class="even"><{$results[i].poster}></a></td> <td class="odd"><{$results[i].post_time}></td> </tr> +<!-- START irmtfan add show search --> + <{if $results[i].post_text }> + <tr align="center"> + <td class="even"></td> + <td class="odd"> + <{$results[i].post_text}> + </td> + <td class="even"></td> + <td class="odd"></td> + </tr> + <{/if}> +<!-- END irmtfan add show search --> <!-- end each result --> <{/section}> <!-- end search results --> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html 2012-10-10 11:01:37 UTC (rev 10211) @@ -75,6 +75,8 @@ <option value=""><{$smarty.const._MD_TOPICOPTION}></option> <option value="<{$post_link}>"><{$smarty.const._MD_VIEW}> <{$smarty.const._MD_ALLPOSTS}></option> <option value="<{$newpost_link}>"><{$smarty.const._MD_VIEW}> <{$smarty.const._MD_NEWPOSTS}></option> + <!-- irmtfan add a separator --> + <option value="">--------</option> <{foreach item=filter from=$filters}> <option value="<{$filter.link}>"><{$filter.title}></option> <{/foreach}> @@ -123,7 +125,7 @@ </div> <!-- irmtfan hardcode removed style="padding: 5px;float: right; text-align:right;" --> <div class="pagenav"> -<{$pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> +<{$pagenav|replace:'form':'div'|replace:'id="xo-pagenav"':''}> <!-- irmtfan to solve nested forms and id="xo-pagenav" issue --> </div> </div> <div class="clear"></div> @@ -159,7 +161,8 @@ <{/if}> </td> <td width="4%" align="center"><{$topic.topic_icon}></td> - <td> <a href="<{$topic.topic_link}>"> +<!-- irmtfan remove topic_link hardcode and add topic_excerpt --> + <td> <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/<{$topic.topic_link}>" title="<{$topic.topic_excerpt}>"> <{if $topic.allow_prefix AND $topic.topic_subject}> <{$topic.topic_subject}> <{/if}> @@ -191,9 +194,13 @@ <{$selection.order}> <{$selection.since}> <{foreach item=hidval key=hidvar from=$selection.vars}> - <input type="hidden" name="$hidvar" value="<{$hidval}>" /> + <{if $hidval && $hidvar neq "sort" && $hidvar neq "order" && $hidvar neq "since"}> + <!-- irmtfan correct name="$hidvar" --> + <input type="hidden" name="<{$hidvar}>" value="<{$hidval}>" /> + <{/if}> <{/foreach}> - <input type="submit" name="refresh" value="<{$smarty.const._SUBMIT}>" /> + <!-- irmtfan remove name="refresh" --> + <input type="submit" value="<{$smarty.const._SUBMIT}>" /> </form> <{/strip}> </td> @@ -203,7 +210,7 @@ <{if $pagenav}> <!-- irmtfan hardcode removed style="padding: 5px;float: right; text-align:right;" --> -<div class="pagenav"><{$pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --></div> +<div class="pagenav"><{$pagenav|replace:'form':'div'|replace:'id="xo-pagenav"':''}> <!-- irmtfan to solve nested forms and id="xo-pagenav" issue --></div> <br /> <{/if}> <div class="clear"></div> @@ -222,12 +229,28 @@ <form action="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php" method="get"> <input name="term" id="term" type="text" size="15" /> <{foreach item=hidval key=hidvar from=$search}> - <input type="hidden" name="$hidvar" value="<{$hidval}>" /> + <{if $hidval }> + <!-- irmtfan correct name="$hidvar" --> + <input type="hidden" name="<{$hidvar}>" value="<{$hidval}>" /> + <{/if}> <{/foreach}> <input type="submit" class="formButton" value="<{$smarty.const._MD_SEARCH}>" /><br /> [<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php"><{$smarty.const._MD_ADVSEARCH}></a>] </form><br /> - <{$forum_jumpbox}> + <!-- START irmtfan add forum selection box --> + <{if $forum_jumpbox }> + <form method="get" action="<{$selection.action}>"> + <{$selection.forum}> + <{foreach item=hidval key=hidvar from=$selection.vars}> + <{if $hidval && $hidvar neq "forum"}> + <input type="hidden" name="<{$hidvar}>" value="<{$hidval}>" /> + <{/if}> + <{/foreach}> + <input type="submit" value="<{$smarty.const._SUBMIT}>" /> + </form><br /> + <{$forum_jumpbox}> + <{/if}> + <!-- END irmtfan add forum selection box --> </div> </div> <div class="clear"></div> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html 2012-10-10 11:01:37 UTC (rev 10211) @@ -76,7 +76,7 @@ </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;" --> <div class="icon_right"> - <{$forum_pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> + <{$forum_pagenav|replace:'form':'div'|replace:'id="xo-pagenav"':''}> <!-- irmtfan to solve nested forms and id="xo-pagenav" issue --> </div> </div> <div class="clear"></div> @@ -172,7 +172,8 @@ <strong><{$smarty.const._MD_SORTEDBY}></strong> <{$forum_selection_sort}> <{$forum_selection_order}> <{$forum_selection_since}> <input type="hidden" name="forum" id="forum" value="<{$forum_id}>" /> <input type="hidden" name="status" value="<{$status}>" /> - <input type="submit" name="refresh" value="<{$smarty.const._SUBMIT}>" /> + <!-- irmtfan remove name="submit" --> + <input type="submit" value="<{$smarty.const._SUBMIT}>" /> </form> <{/strip}> </td> @@ -187,7 +188,7 @@ <{$forum_addpoll}> <{$forum_post_or_register}> </div> <div class="right"> - <{$forum_pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> + <{$forum_pagenav|replace:'form':'div'|replace:'id="xo-pagenav"':''}> <!-- irmtfan to solve nested forms and id="xo-pagenav" issue --> </div> </div> <div class="clear"></div> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-10-10 11:01:37 UTC (rev 10211) @@ -82,7 +82,7 @@ </div> <!-- irmtfan hardcode removed style="padding: 5px;float: right; text-align:right;" --> <div class="pagenav"> - <{$pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> + <{$pagenav|replace:'form':'div'|replace:'id="xo-pagenav"':''}> <!-- irmtfan to solve nested forms and id="xo-pagenav" issue --> </div> </div> <div class="clear"></div> @@ -116,7 +116,7 @@ </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;" --> <div class="icon_right"> - <{$pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> + <{$pagenav|replace:'form':'div'|replace:'id="xo-pagenav"':''}> <!-- irmtfan to solve nested forms and id="xo-pagenav" issue --> </div> </div> <div class="clear"></div> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-10-09 22:03:21 UTC (rev 10210) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-10-10 11:01:37 UTC (rev 10211) @@ -148,10 +148,26 @@ <option value="<{$act.link}>"><{$act.title}></option> <{/foreach}> </select> + <!-- START irmtfan add topic search --> + <{if $mode lte 1}> + <form id="search-topic" action="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php" method="get"> + <fieldset> + <input name="term" id="term" type="text" size="15" value="<{$smarty.const._MD_SEARCHTOPIC}>..." onBlur="if(this.value=='') this.value='<{$smarty.const._MD_SEARCHTOPIC}>...'" onFocus="if(this.v... [truncated message content] |
From: <wis...@us...> - 2012-10-09 22:03:27
|
Revision: 10210 http://sourceforge.net/p/xoops/svn/10210 Author: wishcraft Date: 2012-10-09 22:03:21 +0000 (Tue, 09 Oct 2012) Log Message: ----------- XFriendica Class and Database Design (RC) Added Paths: ----------- XoopsModules/xfriendica/ XoopsModules/xfriendica/trunk/ XoopsModules/xfriendica/trunk/modules/ XoopsModules/xfriendica/trunk/modules/xfriendica/ XoopsModules/xfriendica/trunk/modules/xfriendica/admin/ XoopsModules/xfriendica/trunk/modules/xfriendica/api/ XoopsModules/xfriendica/trunk/modules/xfriendica/blocks/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_functions.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_modules.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_protocols.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_resources.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/avartas.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/clients.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/discussions.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/discussions_recipients.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/event.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/event_persons.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/event_types.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/files.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/files_destruct.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/friends.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/friends_finder.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/friends_intro.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/friends_suggestion.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/group.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/group_keywords.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/group_persons.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/guid.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/hash.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/index.html XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/md5/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/md5/index.html XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/md5/md5.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/password/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/password/index.html XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/password/password.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/sha1/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/sha1/index.html XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/sha1/sha1.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/xoopscrc/ XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/xoopscrc/index.html XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/xoopscrc/xoops.crc.base.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/xoopscrc/xoops.crc.class.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/xoopscrc/xoops.crc.enumerator.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/xoopscrc/xoops.crc.leaver.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/hash/xoopscrc/xoopscrc.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/item.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/item_chars.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/item_files.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/item_keywords.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/item_signed.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/item_templates.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/item_texts.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/keys.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/keywords.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/keywords_links.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/keywords_same.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/languages.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/locations.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/locations_cities.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/locations_countries.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/locations_postcodes.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/locations_regions.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/locations_streets.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/mail.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/mail_chars.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/mail_contacts.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/mail_files.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/mail_persons.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/mail_texts.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_apis.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_apis_files.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_apis_functions.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_apis_packages.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_apis_variables.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_challenges.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_friends.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_keywords.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_languages.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_paths.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_routes.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_servers.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/networks_servers_ips.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/persons.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/persons_keywords.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/persons_search.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/persons_servers_mail.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/persons_spam.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/persons_tokens.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/persons_user.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/photo.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/photo_albums.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/photo_albums_groups.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/photo_albums_keywords.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/photo_data.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/photo_keywords.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/plugins.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/plugins_functions.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/plugins_modules.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/plugins_protocols.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/plugins_resources.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/profile.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/profile_category.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/profile_check.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/profile_data.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/profile_field.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/profile_visibility.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/protocols.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/protocols_functions.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/protocols_resources.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/queue.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/queue_batches.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/queue_tasks.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/statistics.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/statistics_forecasting.php XoopsModules/xfriendica/trunk/modules/xfriendica/class/statistics_history.php XoopsModules/xfriendica/trunk/modules/xfriendica/css/ XoopsModules/xfriendica/trunk/modules/xfriendica/images/ XoopsModules/xfriendica/trunk/modules/xfriendica/images/logo.png XoopsModules/xfriendica/trunk/modules/xfriendica/include/ XoopsModules/xfriendica/trunk/modules/xfriendica/include/discovery.php XoopsModules/xfriendica/trunk/modules/xfriendica/include/function.php XoopsModules/xfriendica/trunk/modules/xfriendica/include/headers.php XoopsModules/xfriendica/trunk/modules/xfriendica/js/ XoopsModules/xfriendica/trunk/modules/xfriendica/language/ XoopsModules/xfriendica/trunk/modules/xfriendica/language/english/ XoopsModules/xfriendica/trunk/modules/xfriendica/plugins/ XoopsModules/xfriendica/trunk/modules/xfriendica/plugins/adaptors/ XoopsModules/xfriendica/trunk/modules/xfriendica/plugins/addons/ XoopsModules/xfriendica/trunk/modules/xfriendica/plugins/connectors/ XoopsModules/xfriendica/trunk/modules/xfriendica/plugins/plugins/ XoopsModules/xfriendica/trunk/modules/xfriendica/protocols/ XoopsModules/xfriendica/trunk/modules/xfriendica/sql/ XoopsModules/xfriendica/trunk/modules/xfriendica/sql/mysql.htm XoopsModules/xfriendica/trunk/modules/xfriendica/sql/mysql.sql XoopsModules/xfriendica/trunk/modules/xfriendica/templates/ XoopsModules/xfriendica/trunk/modules/xfriendica/templates/blocks/ Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,103 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: addons.php + * Description: Addons Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('salt', XOBJ_DTYPE_TXTBOX, hash(__CLASS__.__FUNCTION__.__LINE__.microtime(true)._MI_XFRND_SALT.XOOPS_DB_HOST.XOOPS_DB_PASS.XOOPS_DB_USER.XOOPS_DB_NAME.XOOPS_ROOT_PATH, 128), false, 128); + $this->initVar('guid', XOBJ_DTYPE_TXTBOX, '', false, 64); + $this->initVar('name', XOBJ_DTYPE_TXTBOX, '', false, 255); + $this->initVar('version', XOBJ_DTYPE_TXTBOX, '', false, 255); + $this->initVar('version-php', XOBJ_DTYPE_TXTBOX, '', false, 16); + $this->initVar('version-xoops', XOBJ_DTYPE_TXTBOX, '', false, 16); + $this->initVar('version-friendica', XOBJ_DTYPE_TXTBOX, '', false, 16); + $this->initVar('dirname', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('filename', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('protocol-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('function', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('class', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('prefix', XOBJ_DTYPE_TXTBOX, '', false, 8); + $this->initVar('network-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('path-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('api-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('upgraded', XOBJ_DTYPE_INT, 0, false); + $this->initVar('installed', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('hidden', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('system', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('admin', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('resources', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('modules', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('protocols', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('optionals', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddonsHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaAddonsHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_addons", "XFriendicaAddons", "id", 'name'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_functions.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_functions.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_functions.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,83 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: addons_functions.php + * Description: Addons_functions Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons_functions extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('addon-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('filename', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('function', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('class', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('command', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons_functionsHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaAddons_functionsHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_addons_functions", "XFriendicaAddons_functions", "id", 'command'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_modules.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_modules.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_modules.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,82 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: addons_modules.php + * Description: Addons_modules Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons_modules extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('addon-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('dirname', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('version', XOBJ_DTYPE_DECIMAL, 0, false); + $this->initVar('required', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('optional', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons_modulesHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaAddons_modulesHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_addons_modules", "XFriendicaAddons_modules", "id", 'dirname'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_protocols.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_protocols.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_protocols.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,82 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: addons_protocols.php + * Description: Addons_protocols Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons_protocols extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('addon-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('protocol-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('global-guid', XOBJ_DTYPE_TXTBOX, '', false, 64); + $this->initVar('required', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('optional', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons_protocolsHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaAddons_protocolsHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_addons_protocols", "XFriendicaAddons_protocols", "id", 'global-guid'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_resources.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_resources.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/addons_resources.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,86 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: addons_resources.php + * Description: Addons_resources Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons_resources extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('addon-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('type', XOBJ_DTYPE_ENUM, 'extension', false, false, false, array('function','extension','class','module','core')); + $this->initVar('name', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('dirname', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('version', XOBJ_DTYPE_DECIMAL, 1.0, false); + $this->initVar('class', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('command', XOBJ_DTYPE_TXTBOX, '', false, 128); + $this->initVar('required', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('optional', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAddons_resourcesHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaAddons_resourcesHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_addons_resources", "XFriendicaAddons_resources", "id", 'name'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/avartas.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/avartas.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/avartas.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,83 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: avartas.php + * Description: Avartas Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAvartas extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('guid', XOBJ_DTYPE_TXTBOX, null, false, 64); + $this->initVar('state', XOBJ_DTYPE_ENUM, 'local', false, false, false, array('network','server','local','remote','client')); + $this->initVar('state-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('file-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('retrieved', XOBJ_DTYPE_INT, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaAvartasHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaAvartasHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_avartas", "XFriendicaAvartas", "id", 'name'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/clients.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/clients.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/clients.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,84 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: clients.php + * Description: Clients Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaClients extends XoopsObject +{ + function __construct() + { + + $this->initVar('client-id', XOBJ_DTYPE_TXTBOX, null, true, 20); + $this->initVar('guid', XOBJ_DTYPE_TXTBOX, '', false, 64); + $this->initVar('name', XOBJ_DTYPE_TXTBOX, '', false, 255); + $this->initVar('keys-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('avarta-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('go-url-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('website-url-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaClientsHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaClientsHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_clients", "XFriendicaClients", "id", 'name'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/discussions.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/discussions.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/discussions.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,82 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: discussions.php + * Description: Discussions Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaDiscussions extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true, 40); + $this->initVar('guid', XOBJ_DTYPE_TXTBOX, '', false, 64); + $this->initVar('person-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('recipients', XOBJ_DTYPE_INT, 0, false); + $this->initVar('blocked', XOBJ_DTYPE_INT, 0, false); + $this->initVar('spam', XOBJ_DTYPE_INT, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaDiscussionsHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaDiscussionsHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_discussions", "XFriendicaDiscussions", "id", 'guid'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/discussions_recipients.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/discussions_recipients.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/discussions_recipients.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,79 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: discussions_recipients.php + * Description: Discussions_recipients Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaDiscussions_recipients extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('discussions-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('person-id', XOBJ_DTYPE_IN, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaDiscussions_recipientsHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaDiscussions_recipientsHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_discussions_recipients", "XFriendicaDiscussions_recipients", "id", 'value'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/event.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/event.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/event.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,94 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: conv.php + * Description: Event Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaEvent extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('guid', XOBJ_DTYPE_TXTBOX, '', false, 64); + $this->initVar('type-id', XOBJ_DTYPE_INT, null, true); + $this->initVar('person-id', XOBJ_DTYPE_INT, null, true); + $this->initVar('location-id', XOBJ_DTYPE_INT, null, true); + $this->initVar('invitees', XOBJ_DTYPE_INT, null, true); + $this->initVar('attending', XOBJ_DTYPE_INT, null, true); + $this->initVar('missing', XOBJ_DTYPE_INT, null, true); + $this->initVar('maybe', XOBJ_DTYPE_INT, null, true); + $this->initVar('url-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('start', XOBJ_DTYPE_INT, 0, false); + $this->initVar('finish', XOBJ_DTYPE_INT, 0, false); + $this->initVar('passion', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('nofinish', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('adjust', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('ignore', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes', 'No')); + $this->initVar('activity', XOBJ_DTYPE_DECIMAL, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaEventHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaEventHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_event", "XFriendicaEvent", "id", 'cmd'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/event_persons.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/event_persons.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/event_persons.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,83 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: conv.php + * Description: Event_persons Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaEvent_persons extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true, 40); + $this->initVar('state', XOBJ_DTYPE_ENUM, null, false, false, false, array('attenting','missing','maybe','invitee')); + $this->initVar('event-id', XOBJ_DTYPE_INT, null, false, 40); + $this->initVar('to-person-id', XOBJ_DTYPE_INT, null, false); + $this->initVar('from-person-id', XOBJ_DTYPE_INT, null, false); + $this->initVar('notified', XOBJ_DTYPE_INT, null, false); + $this->initVar('syndicated', XOBJ_DTYPE_INT, null, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaEvent_personsHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaEvent_personsHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_event_persons", "XFriendicaEvent_persons", "id", 'contact-id'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/event_types.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/event_types.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/event_types.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,69 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: conv.php + * Description: Event_types Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaEvent_types extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true, 40); + $this->initVar('type', XOBJ_DTYPE_TXTBOX, null, false, 128); + $this->initVar('language', XOBJ_DTYPE_TXTBOX, null, false, 5); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaEvent_typesHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaEvent_typesHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_event_types", "XFriendicaEvent_types", "id", 'type'); + } + +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/files.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/files.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/files.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,98 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: conv.php + * Description: Files Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaFiles extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('guid', XOBJ_DTYPE_TXTBOX, '', false, 64); + $this->initVar('person-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('source', XOBJ_DTYPE_ENUM, 'server', false, false, false, array('server','remote','unknown')); + $this->initVar('state', XOBJ_DTYPE_ENUM, 'image', false, false, false, array('image','binary')); + $this->initVar('mode', XOBJ_DTYPE_ENUM, 'photo', false, false, false, array('photo','icon','avarta','binary')); + $this->initVar('relative', XOBJ_DTYPE_ENUM, 'XOOPS_UPLOAD_PATH', false, false, false, array('XOOPS_ROOT_PATH','XOOPS_UPLOAD_PATH','XOOPS_VAR_PATH','XOOPS_TRUST_PATH','URL','REMOTE')); + $this->initVar('availability', XOBJ_DTYPE_ENUM, 'network', false, false, false, array('global','network','private','tribe','friends','individual','tokenised','password')); + $this->initVar('auth-method', XOBJ_DTYPE_ENUM, 'handshake', false, false, false, array('handshake','identity','trust','header','path','get','post','none')); + $this->initVar('md5', XOBJ_DTYPE_TXTBOX, 0, false, 32); + $this->initVar('path', XOBJ_DTYPE_TXTBOX, 0, false, 255); + $this->initVar('storedas', XOBJ_DTYPE_TXTBOX, 0, false, 128); + $this->initVar('filename', XOBJ_DTYPE_TXTBOX, 0, false, 128); + $this->initVar('size', XOBJ_DTYPE_INT, 0, false, 32); + $this->initVar('type', XOBJ_DTYPE_TXTBOX, 0, false, 128); + $this->initVar('activity', XOBJ_DTYPE_DECIMAL, 0, false); + $this->initVar('network-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('server-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('path-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('api-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('scheduled', XOBJ_DTYPE_INT, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaFilesHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaFilesHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_files", "XFriendicaFiles", "id", 'cmd'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/files_destruct.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/files_destruct.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/files_destruct.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,85 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: conv.php + * Description: Files_destruct Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaFiles_destruct extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT, null, true); + $this->initVar('file-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('person-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('retrieved', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes','No')); + $this->initVar('downloaded', XOBJ_DTYPE_ENUM, 'No', false, false, false, array('Yes','No')); + $this->initVar('destroyed', XOBJ_DTYPE_INT, 0, false); + $this->initVar('expires', XOBJ_DTYPE_INT, 0, false); + $this->initVar('scheduled', XOBJ_DTYPE_INT, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaFiles_destructHandler extends XoopsPersistableObjectHandler +{ + function XFriendicaFiles_destructHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "xfriendica_files_destruct", "XFriendicaFiles_destruct", "id", 'destroyed'); + } + + function insert($object, $force = true) { + if ($object->isNew()) + $object->setVar('created', time()); + else + $object->setVar('updated', time()); + + return parent::insert($object, $force); + } +} +?> \ No newline at end of file Added: XoopsModules/xfriendica/trunk/modules/xfriendica/class/friends.php =================================================================== --- XoopsModules/xfriendica/trunk/modules/xfriendica/class/friends.php (rev 0) +++ XoopsModules/xfriendica/trunk/modules/xfriendica/class/friends.php 2012-10-09 22:03:21 UTC (rev 10210) @@ -0,0 +1,86 @@ +<?php +/* + * Logs Guest and users IP Addresses for a period of time and provides + * basic statistic of them in XOOPS Copyright (C) 2012 Simon Roberts + * Contact: wishcraft - si...@ch... + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * See /docs/license.pdf for full license. + * + * Shouts:- Mike Macgirvin [mi...@ma...] original author of + * Friendica + * + * Version: 1.01 Alpha + * Published: Chronolabs + * Download: http://code.google.com/p/chronolabs + * This File: conv.php + * Description: Friends Handler and Object Class for Module + * Date: 04/10/2012 10:45AM AEST + * License: GNU3 + * + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class XFriendicaFriends extends XoopsObject +{ + function __construct() + { + + $this->initVar('id', XOBJ_DTYPE_INT... [truncated message content] |
From: <be...@us...> - 2012-10-09 17:34:04
|
Revision: 10209 http://sourceforge.net/p/xoops/svn/10209 Author: beckmi Date: 2012-10-09 17:33:55 +0000 (Tue, 09 Oct 2012) Log Message: ----------- Adding 4.4 Beta 1 (converted to XOOPS 2.5.5 Admin GUI) Added Paths: ----------- XoopsModules/jobs/branches/mamba/jobs/ XoopsModules/jobs/branches/mamba/jobs/READ_ME XoopsModules/jobs/branches/mamba/jobs/add_photo.php XoopsModules/jobs/branches/mamba/jobs/addcompany.php XoopsModules/jobs/branches/mamba/jobs/addlisting.php XoopsModules/jobs/branches/mamba/jobs/addresume.php XoopsModules/jobs/branches/mamba/jobs/admin/ XoopsModules/jobs/branches/mamba/jobs/admin/about.php XoopsModules/jobs/branches/mamba/jobs/admin/addcomp.php XoopsModules/jobs/branches/mamba/jobs/admin/addregion.php XoopsModules/jobs/branches/mamba/jobs/admin/addresume.php XoopsModules/jobs/branches/mamba/jobs/admin/admin_footer.php XoopsModules/jobs/branches/mamba/jobs/admin/admin_header.php XoopsModules/jobs/branches/mamba/jobs/admin/category.php XoopsModules/jobs/branches/mamba/jobs/admin/company.php XoopsModules/jobs/branches/mamba/jobs/admin/delcomp.php XoopsModules/jobs/branches/mamba/jobs/admin/docs.php XoopsModules/jobs/branches/mamba/jobs/admin/error_log XoopsModules/jobs/branches/mamba/jobs/admin/groupperms.php XoopsModules/jobs/branches/mamba/jobs/admin/header.php XoopsModules/jobs/branches/mamba/jobs/admin/include/ XoopsModules/jobs/branches/mamba/jobs/admin/include/canada.php XoopsModules/jobs/branches/mamba/jobs/admin/include/england.php XoopsModules/jobs/branches/mamba/jobs/admin/include/france.php XoopsModules/jobs/branches/mamba/jobs/admin/include/index.html XoopsModules/jobs/branches/mamba/jobs/admin/include/italy.php XoopsModules/jobs/branches/mamba/jobs/admin/include/usstates.php XoopsModules/jobs/branches/mamba/jobs/admin/index.php XoopsModules/jobs/branches/mamba/jobs/admin/job_categories.php XoopsModules/jobs/branches/mamba/jobs/admin/jobs.php XoopsModules/jobs/branches/mamba/jobs/admin/jobs_doc_1.php XoopsModules/jobs/branches/mamba/jobs/admin/lists.php XoopsModules/jobs/branches/mamba/jobs/admin/main.php XoopsModules/jobs/branches/mamba/jobs/admin/map - Copy.php XoopsModules/jobs/branches/mamba/jobs/admin/map.php XoopsModules/jobs/branches/mamba/jobs/admin/menu.php XoopsModules/jobs/branches/mamba/jobs/admin/modcomp.php XoopsModules/jobs/branches/mamba/jobs/admin/modresume.php XoopsModules/jobs/branches/mamba/jobs/admin/mygroupperm.php XoopsModules/jobs/branches/mamba/jobs/admin/region.php XoopsModules/jobs/branches/mamba/jobs/admin/resume_categories.php XoopsModules/jobs/branches/mamba/jobs/admin/resumes.php XoopsModules/jobs/branches/mamba/jobs/admin/submitlisting.php XoopsModules/jobs/branches/mamba/jobs/admin/upgrade.php XoopsModules/jobs/branches/mamba/jobs/blocks/ XoopsModules/jobs/branches/mamba/jobs/blocks/index.html XoopsModules/jobs/branches/mamba/jobs/blocks/jobs.php XoopsModules/jobs/branches/mamba/jobs/blocks/jobs2.php XoopsModules/jobs/branches/mamba/jobs/blocks/jobs_b_premium.php XoopsModules/jobs/branches/mamba/jobs/blocks/resumes.php XoopsModules/jobs/branches/mamba/jobs/class/ XoopsModules/jobs/branches/mamba/jobs/class/grouppermform.php XoopsModules/jobs/branches/mamba/jobs/class/index.html XoopsModules/jobs/branches/mamba/jobs/class/jobs_categories.php XoopsModules/jobs/branches/mamba/jobs/class/jobs_res_categories.php XoopsModules/jobs/branches/mamba/jobs/class/jobtree.php XoopsModules/jobs/branches/mamba/jobs/class/mygrouppermform.php XoopsModules/jobs/branches/mamba/jobs/class/pagenav.php XoopsModules/jobs/branches/mamba/jobs/class/pictures.php XoopsModules/jobs/branches/mamba/jobs/class/restree.php XoopsModules/jobs/branches/mamba/jobs/contact.php XoopsModules/jobs/branches/mamba/jobs/contactresume.php XoopsModules/jobs/branches/mamba/jobs/createresume.php XoopsModules/jobs/branches/mamba/jobs/delcompany.php XoopsModules/jobs/branches/mamba/jobs/delcreated.php XoopsModules/jobs/branches/mamba/jobs/deljob.php XoopsModules/jobs/branches/mamba/jobs/delpicture.php XoopsModules/jobs/branches/mamba/jobs/delreply.php XoopsModules/jobs/branches/mamba/jobs/delresume.php XoopsModules/jobs/branches/mamba/jobs/display-logo.php XoopsModules/jobs/branches/mamba/jobs/docs/ XoopsModules/jobs/branches/mamba/jobs/docs/changelog.txt XoopsModules/jobs/branches/mamba/jobs/docs/credits.txt XoopsModules/jobs/branches/mamba/jobs/docs/index.html XoopsModules/jobs/branches/mamba/jobs/docs/install.txt XoopsModules/jobs/branches/mamba/jobs/docs/lang_diff.txt XoopsModules/jobs/branches/mamba/jobs/docs/license.txt XoopsModules/jobs/branches/mamba/jobs/docs/readme.txt XoopsModules/jobs/branches/mamba/jobs/editdesc.php XoopsModules/jobs/branches/mamba/jobs/error_log XoopsModules/jobs/branches/mamba/jobs/header.php XoopsModules/jobs/branches/mamba/jobs/images/ XoopsModules/jobs/branches/mamba/jobs/images/16/ XoopsModules/jobs/branches/mamba/jobs/images/32/ XoopsModules/jobs/branches/mamba/jobs/images/arrow.gif XoopsModules/jobs/branches/mamba/jobs/images/backarrow.gif XoopsModules/jobs/branches/mamba/jobs/images/blank.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/ XoopsModules/jobs/branches/mamba/jobs/images/cat/Computer.jpg XoopsModules/jobs/branches/mamba/jobs/images/cat/cat2.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/cat3.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/cat4.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/default.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/fleche.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/fleche2.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/fleche3.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/index.html XoopsModules/jobs/branches/mamba/jobs/images/cat/point1.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/point2.gif XoopsModules/jobs/branches/mamba/jobs/images/cat/star1.gif XoopsModules/jobs/branches/mamba/jobs/images/close.gif XoopsModules/jobs/branches/mamba/jobs/images/closelabel.gif XoopsModules/jobs/branches/mamba/jobs/images/del.gif XoopsModules/jobs/branches/mamba/jobs/images/dele.gif XoopsModules/jobs/branches/mamba/jobs/images/down.gif XoopsModules/jobs/branches/mamba/jobs/images/down_active.gif XoopsModules/jobs/branches/mamba/jobs/images/edit.gif XoopsModules/jobs/branches/mamba/jobs/images/friend.gif XoopsModules/jobs/branches/mamba/jobs/images/green.gif XoopsModules/jobs/branches/mamba/jobs/images/green.jpg XoopsModules/jobs/branches/mamba/jobs/images/index.html XoopsModules/jobs/branches/mamba/jobs/images/jobs_logo.gif XoopsModules/jobs/branches/mamba/jobs/images/jobs_slogo.gif XoopsModules/jobs/branches/mamba/jobs/images/jobs_slogo.png XoopsModules/jobs/branches/mamba/jobs/images/left_both.gif XoopsModules/jobs/branches/mamba/jobs/images/loading.gif XoopsModules/jobs/branches/mamba/jobs/images/mlogo.png XoopsModules/jobs/branches/mamba/jobs/images/modadminbg.gif XoopsModules/jobs/branches/mamba/jobs/images/modif.gif XoopsModules/jobs/branches/mamba/jobs/images/newred.gif XoopsModules/jobs/branches/mamba/jobs/images/next.gif XoopsModules/jobs/branches/mamba/jobs/images/nextlabel.gif XoopsModules/jobs/branches/mamba/jobs/images/nophoto.jpg XoopsModules/jobs/branches/mamba/jobs/images/photo.gif XoopsModules/jobs/branches/mamba/jobs/images/plus.gif XoopsModules/jobs/branches/mamba/jobs/images/prev.gif XoopsModules/jobs/branches/mamba/jobs/images/prevlabel.gif XoopsModules/jobs/branches/mamba/jobs/images/print.gif XoopsModules/jobs/branches/mamba/jobs/images/red.gif XoopsModules/jobs/branches/mamba/jobs/images/right_both.gif XoopsModules/jobs/branches/mamba/jobs/images/search.png XoopsModules/jobs/branches/mamba/jobs/images/site.gif XoopsModules/jobs/branches/mamba/jobs/images/up.gif XoopsModules/jobs/branches/mamba/jobs/images/up_active.gif XoopsModules/jobs/branches/mamba/jobs/include/ XoopsModules/jobs/branches/mamba/jobs/include/functions.php XoopsModules/jobs/branches/mamba/jobs/include/gd.class.php XoopsModules/jobs/branches/mamba/jobs/include/gtickets.php XoopsModules/jobs/branches/mamba/jobs/include/index.html XoopsModules/jobs/branches/mamba/jobs/include/notification.inc.php XoopsModules/jobs/branches/mamba/jobs/include/onupdate.inc.php XoopsModules/jobs/branches/mamba/jobs/include/resume_functions.php XoopsModules/jobs/branches/mamba/jobs/include/search.inc.php XoopsModules/jobs/branches/mamba/jobs/include/searchform.php XoopsModules/jobs/branches/mamba/jobs/include/updateblock.inc.php XoopsModules/jobs/branches/mamba/jobs/include/waiting.plugin.php XoopsModules/jobs/branches/mamba/jobs/include/yogurt.css XoopsModules/jobs/branches/mamba/jobs/index.php XoopsModules/jobs/branches/mamba/jobs/ip_image.php XoopsModules/jobs/branches/mamba/jobs/jobscat.php XoopsModules/jobs/branches/mamba/jobs/language/ XoopsModules/jobs/branches/mamba/jobs/language/english/ XoopsModules/jobs/branches/mamba/jobs/language/english/admin.php XoopsModules/jobs/branches/mamba/jobs/language/english/blocks.php XoopsModules/jobs/branches/mamba/jobs/language/english/docs.php XoopsModules/jobs/branches/mamba/jobs/language/english/help/ XoopsModules/jobs/branches/mamba/jobs/language/english/help/help.html XoopsModules/jobs/branches/mamba/jobs/language/english/help/index.html XoopsModules/jobs/branches/mamba/jobs/language/english/index.html XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/ XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/index.html XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_company_newpost_notify.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_listing_approve.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_listing_contact.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_listing_expired.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_listing_expires.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_listing_newpost_notify.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_listing_res_newpost_notify.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_send_friend.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/mail_template/jobs_send_resume.tpl XoopsModules/jobs/branches/mamba/jobs/language/english/main.php XoopsModules/jobs/branches/mamba/jobs/language/english/modinfo.php XoopsModules/jobs/branches/mamba/jobs/language/english/waiting.php XoopsModules/jobs/branches/mamba/jobs/language/index.html XoopsModules/jobs/branches/mamba/jobs/lightbox/ XoopsModules/jobs/branches/mamba/jobs/lightbox/css/ XoopsModules/jobs/branches/mamba/jobs/lightbox/css/index.html XoopsModules/jobs/branches/mamba/jobs/lightbox/css/lightbox.css XoopsModules/jobs/branches/mamba/jobs/lightbox/images/ XoopsModules/jobs/branches/mamba/jobs/lightbox/images/Thumbs.db XoopsModules/jobs/branches/mamba/jobs/lightbox/images/blank.gif XoopsModules/jobs/branches/mamba/jobs/lightbox/images/close.gif XoopsModules/jobs/branches/mamba/jobs/lightbox/images/closelabel.gif XoopsModules/jobs/branches/mamba/jobs/lightbox/images/index.html XoopsModules/jobs/branches/mamba/jobs/lightbox/images/loading.gif XoopsModules/jobs/branches/mamba/jobs/lightbox/images/next.gif XoopsModules/jobs/branches/mamba/jobs/lightbox/images/nextlabel.gif XoopsModules/jobs/branches/mamba/jobs/lightbox/images/prev.gif XoopsModules/jobs/branches/mamba/jobs/lightbox/images/prevlabel.gif XoopsModules/jobs/branches/mamba/jobs/lightbox/index.html XoopsModules/jobs/branches/mamba/jobs/lightbox/js/ XoopsModules/jobs/branches/mamba/jobs/lightbox/js/effects.js XoopsModules/jobs/branches/mamba/jobs/lightbox/js/index.html XoopsModules/jobs/branches/mamba/jobs/lightbox/js/lightbox.js XoopsModules/jobs/branches/mamba/jobs/lightbox/js/prototype.js XoopsModules/jobs/branches/mamba/jobs/lightbox/js/scriptaculous.js XoopsModules/jobs/branches/mamba/jobs/logo_images/ XoopsModules/jobs/branches/mamba/jobs/logo_images/index.html XoopsModules/jobs/branches/mamba/jobs/members.php XoopsModules/jobs/branches/mamba/jobs/modcompany.php XoopsModules/jobs/branches/mamba/jobs/modcreated.php XoopsModules/jobs/branches/mamba/jobs/modjob.php XoopsModules/jobs/branches/mamba/jobs/modresume.php XoopsModules/jobs/branches/mamba/jobs/myresume.php XoopsModules/jobs/branches/mamba/jobs/notification_update.php XoopsModules/jobs/branches/mamba/jobs/photo/ XoopsModules/jobs/branches/mamba/jobs/photo/index.html XoopsModules/jobs/branches/mamba/jobs/photo/midsize/ XoopsModules/jobs/branches/mamba/jobs/photo/midsize/index.html XoopsModules/jobs/branches/mamba/jobs/photo/thumbs/ XoopsModules/jobs/branches/mamba/jobs/photo/thumbs/index.html XoopsModules/jobs/branches/mamba/jobs/print.php XoopsModules/jobs/branches/mamba/jobs/replies.php XoopsModules/jobs/branches/mamba/jobs/resumecat.php XoopsModules/jobs/branches/mamba/jobs/resumes/ XoopsModules/jobs/branches/mamba/jobs/resumes/index.html XoopsModules/jobs/branches/mamba/jobs/resumes.php XoopsModules/jobs/branches/mamba/jobs/rphoto/ XoopsModules/jobs/branches/mamba/jobs/rphoto/index.html XoopsModules/jobs/branches/mamba/jobs/search.php XoopsModules/jobs/branches/mamba/jobs/sendfriend.php XoopsModules/jobs/branches/mamba/jobs/sql/ XoopsModules/jobs/branches/mamba/jobs/sql/index.html XoopsModules/jobs/branches/mamba/jobs/sql/mysql.sql XoopsModules/jobs/branches/mamba/jobs/templates/ XoopsModules/jobs/branches/mamba/jobs/templates/blocks/ XoopsModules/jobs/branches/mamba/jobs/templates/blocks/index.html XoopsModules/jobs/branches/mamba/jobs/templates/blocks/jobs_b2.html XoopsModules/jobs/branches/mamba/jobs/templates/blocks/jobs_block_new.html XoopsModules/jobs/branches/mamba/jobs/templates/blocks/jobs_block_premium.html XoopsModules/jobs/branches/mamba/jobs/templates/blocks/resume_block_new.html XoopsModules/jobs/branches/mamba/jobs/templates/index.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_add_company.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_addlisting.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_addresume.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_adlist.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_category.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_choose_company.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_create_resume.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_editcomp.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_index.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_index2.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_item.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_members.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_modcompany.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_modify.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_modresume.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_premium.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_replies.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_res_adlist.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_res_category.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_resume.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_view_created.html XoopsModules/jobs/branches/mamba/jobs/templates/jobs_view_photos.html XoopsModules/jobs/branches/mamba/jobs/view_photos.php XoopsModules/jobs/branches/mamba/jobs/viewjobs.php XoopsModules/jobs/branches/mamba/jobs/viewresume.php XoopsModules/jobs/branches/mamba/jobs/whatcompany.php XoopsModules/jobs/branches/mamba/jobs/xoops_version.php Added: XoopsModules/jobs/branches/mamba/jobs/READ_ME =================================================================== --- XoopsModules/jobs/branches/mamba/jobs/READ_ME (rev 0) +++ XoopsModules/jobs/branches/mamba/jobs/READ_ME 2012-10-09 17:33:55 UTC (rev 10209) @@ -0,0 +1,37 @@ +INSTALL DIRECTIONS + +BACKUP YOUR DATABASE BEFORE ANY MAJOR UPGRADE. DON'T SAY YOU WEREN'T WARNED. + +the folders logo_images, resumes and photo need to be chmod 777, +the module will check those folders and if not right you will be notified in the admin area. + +1) NEW INSTALL + + 1. Upload the jobs folder inside the Xoops modules folder, go to modules administration and install. + 2. Replace the class/xoopsform/formselect.php file with the one provided for your Xoops version. + 3. For Xoops version 2.3.3b Replace the class/xoopsform/formselect.php file and include/cp_header.php file with the ones provided. + +2) UPGRADING FROM ANY PREVIOUS VERSION + + BACKUP YOUR DATABASE BEFORE THIS UPGRADE. DON'T SAY YOU WEREN'T WARNED. + + 1. Overwrite the jobs folder with the new files. + 2. Replace the class/xoopsform/formselect.php file with the one provided for your Xoops version. + 3. For Xoops version 2.3.3b Replace the class/xoopsform/formselect.php file and include/cp_header.php file with the ones provided. + 4. Run the upgrade script as admin. point browser to "http://yoursite/modules/jobs/admin/upgrade.php" + 5. Update module, in module admin and you are done + + + +IMPORTANT!!! You must create a category in resumes before trying to set permissions. +IMPORTANT!!! You must create states or regions unless you don't use states in the preferences. +IMPORTANT!!! You must replace class/xoopsform/formselect.php and for 2.3.3b include/cp_header.php + + +Donations will allow this software to continue, without them probably not. + +Report any problems at www.jlmzone.com + +Thanks and enjoy. + +John \ No newline at end of file Added: XoopsModules/jobs/branches/mamba/jobs/add_photo.php =================================================================== --- XoopsModules/jobs/branches/mamba/jobs/add_photo.php (rev 0) +++ XoopsModules/jobs/branches/mamba/jobs/add_photo.php 2012-10-09 17:33:55 UTC (rev 10209) @@ -0,0 +1,115 @@ +<?php +// $Id: submit.php,v 1.3 2007/08/26 14:43:50 marcellobrandao Exp $ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2000 XOOPS.org // +// <http://www.xoops.org/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// 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. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +$mydirname = basename(dirname(dirname(__FILE__))); +$main_lang = '_' . strtoupper($mydirname); +$lid = !isset($_REQUEST['lid']) ? NULL : $_REQUEST['lid']; + +/** + * Xoops header ... + */ +include_once("../../mainfile.php"); +$xoopsOption['template_main'] = "jobs_view_photos.html"; +include_once("../../header.php"); + +/** + * Modules class includes + */ +include("class/pictures.php"); + +/** + * Factory of pictures created + */ +$album_factory = new Xoopsjlm_picturesHandler($xoopsDB); + +/** + * Getting the title + */ +$title = $_POST['caption']; + +/** + * Getting parameters defined in admin side + */ + +$path_upload = $xoopsModuleConfig["jobs_path_upload"]; +$pictwidth = $xoopsModuleConfig["jobs_resized_width"]; +$pictheight = $xoopsModuleConfig["jobs_resized_height"]; +$thumbwidth = $xoopsModuleConfig["jobs_thumb_width"]; +$thumbheight = $xoopsModuleConfig["jobs_thumb_height"]; +$maxfilebytes = $xoopsModuleConfig["jobs_maxfilesize"]; +$maxfileheight = $xoopsModuleConfig["jobs_max_original_height"]; +$maxfilewidth = $xoopsModuleConfig["jobs_max_original_width"]; + +/** + * If we are receiving a file + */ +if ($_POST['xoops_upload_file'][0] == 'sel_photo') { + + /** + * Check if using Xoops or XoopsCube (by jlm69) + */ + + $xCube = FALSE; + if (preg_match("/^XOOPS Cube/", XOOPS_VERSION)) // XOOPS Cube 2.1x + { + $xCube = TRUE; + } + if ($xCube) { + if (!$xoopsGTicket->check(TRUE, 'token')) { + redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); + } + } else { + if (!($GLOBALS['xoopsSecurity']->check())) { + redirect_header($_SERVER['HTTP_REFERER'], 3, constant($main_lang . "_TOKENEXPIRED")); + } + } + /** + * Try to upload picture resize it insert in database and then redirect to index + */ + if ($album_factory->receivePicture($title, $path_upload, $thumbwidth, $thumbheight, $pictwidth, $pictheight, $maxfilebytes, $maxfilewidth, $maxfileheight)) { + header( + "Location: " . XOOPS_URL . "/modules/$mydirname/view_photos.php?lid=$lid&uid=" . $xoopsUser->getVar('uid') + ); + + $xoopsDB->queryF( + "UPDATE " . $xoopsDB->prefix("jobs_resume") . " SET rphoto=rphoto+1 WHERE lid = " + . mysql_real_escape_string($lid) . "" + ); + + } else { + redirect_header( + XOOPS_URL . "/modules/$mydirname/view_photos.php?uid=" . $xoopsUser->getVar('uid'), 3, constant( + $main_lang . "_NOCACHACA" + ) + ); + } +} + +/** + * Close page + */ +include("../../footer.php"); +?> \ No newline at end of file Added: XoopsModules/jobs/branches/mamba/jobs/addcompany.php =================================================================== --- XoopsModules/jobs/branches/mamba/jobs/addcompany.php (rev 0) +++ XoopsModules/jobs/branches/mamba/jobs/addcompany.php 2012-10-09 17:33:55 UTC (rev 10209) @@ -0,0 +1,367 @@ +<?php +// $Id: addcompany.php,v 4.1 2010/02/6 08:11:07 jlm69 Exp $ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2000 XOOPS.org // +// <http://www.xoops.org/> // +// ------------------------------------------------------------------------- // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// 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. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +include "header.php"; +$mydirname = basename(dirname(__FILE__)); +$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object +include_once XOOPS_ROOT_PATH . "/class/module.errorhandler.php"; +include XOOPS_ROOT_PATH . "/modules/$mydirname/include/functions.php"; +include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; +$erh = new ErrorHandler; //ErrorHandler object + +if (empty($xoopsUser)) { + redirect_header(XOOPS_URL . "/modules/profile/", 3, _JOBS_MUSTREGFIRST); + exit(); +} + +$module_id = $xoopsModule->getVar('mid'); +if (is_object($xoopsUser)) { + $groups = $xoopsUser->getGroups(); +} else { + $groups = XOOPS_GROUP_ANONYMOUS; +} +$gperm_handler =& xoops_gethandler('groupperm'); +if (isset($_POST['item_id'])) { + $perm_itemid = intval($_POST['item_id']); +} else { + $perm_itemid = 0; +} +if (!$gperm_handler->checkRight("jobs_submit", $perm_itemid, $groups, $module_id)) { + redirect_header(XOOPS_URL . "/index.php", 3, _NOPERM); + exit(); +} +if (!$gperm_handler->checkRight("jobs_premium", $perm_itemid, $groups, $module_id)) { + $premium = 0; +} else { + $premium = 1; +} + +$member_usid = $xoopsUser->getVar("uid", "E"); +$member_comp = jobs_getCompany($member_usid); +if ($member_comp) { + redirect_header(XOOPS_URL . "/modules/$mydirname/index.php", 3, _JOBS_COMPANY_EXISTS); +} + +if (!empty($_POST['submit'])) { + + if (!$GLOBALS['xoopsSecurity']->check(TRUE, $_REQUEST['token'])) { + redirect_header( + XOOPS_URL . "/modules/$mydirname/index.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) + ); + } + + $destination = XOOPS_ROOT_PATH . "/modules/$mydirname/logo_images"; + $photomax = $xoopsModuleConfig['jobs_maxfilesize']; + $maxwide = $xoopsModuleConfig['jobs_resized_width']; + $maxhigh = $xoopsModuleConfig['jobs_resized_height']; + $date = time(); + + $comp_usid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0; + + $_SESSION['comp_name'] = $_POST['comp_name']; + $_SESSION['comp_address'] = $_POST['comp_address']; + $_SESSION['comp_address2'] = $_POST['comp_address2']; + $_SESSION['comp_city'] = $_POST['comp_city']; + $_SESSION['comp_state'] = $_POST['comp_state']; + $_SESSION['comp_zip'] = $_POST['comp_zip']; + $_SESSION['comp_phone'] = $_POST['comp_phone']; + $_SESSION['comp_fax'] = $_POST['comp_fax']; + $_SESSION['comp_url'] = $_POST['comp_url']; + $_SESSION['comp_usid'] = $_POST['comp_usid']; + $_SESSION['comp_user1'] = $_POST['comp_user1']; + $_SESSION['comp_user2'] = $_POST['comp_user2']; + $_SESSION['comp_contact'] = $_POST['comp_contact']; + $_SESSION['comp_user1_contact'] = $_POST['comp_user1_contact']; + $_SESSION['comp_user2_contact'] = $_POST['comp_user2_contact']; + + $comp_name = $myts->addSlashes($_POST["comp_name"]); + $comp_address = $myts->addSlashes($_POST["comp_address"]); + $comp_address2 = $myts->addSlashes($_POST["comp_address2"]); + $comp_city = $myts->addSlashes($_POST["comp_city"]); + $comp_state = $myts->addSlashes($_POST["comp_state"]); + $comp_zip = $myts->addSlashes($_POST["comp_zip"]); + $comp_phone = $myts->addSlashes($_POST["comp_phone"]); + $comp_fax = $myts->addSlashes($_POST["comp_fax"]); + $comp_url = $myts->addSlashes($_POST["comp_url"]); + $comp_usid = $myts->addSlashes($_POST["comp_usid"]); + $comp_user1 = $myts->addSlashes($_POST["comp_user1"]); + $comp_user2 = $myts->addSlashes($_POST["comp_user2"]); + $comp_contact = $myts->addSlashes($_POST["comp_contact"]); + + if ($premium == "1") { + +// START - check new entries for company users are OK - GreenFlatDog + + $comp_users = array(); +// get user id for the name entered for company user 1 + if (empty($_POST["comp_user1"])) { + $comp_userid1 = ""; + } else { + $comp_userid1 = jobs_getIdFromUname($_POST["comp_user1"]); + // put name, id, what's entered and problem into an array + $comp_users[$comp_user1]['name'] = $_POST["comp_user1"]; + $comp_users[$comp_user1]['id'] = $comp_userid1; + $comp_users[$comp_user1]['entry'] = "?cuser1="; + $comp_users[$comp_user1]['prob'] = "&prob1="; + } +// get user id for the name entered for company user 2 + if (empty($_POST["comp_user2"])) { + $comp_userid2 = ""; + } else { + $comp_userid2 = jobs_getIdFromUname($_POST["comp_user2"]); + // put name, id, what's entered and problem into an array + $comp_users[$comp_user2]['name'] = $_POST["comp_user2"]; + $comp_users[$comp_user2]['id'] = $comp_userid2; + $comp_users[$comp_user2]['entry'] = "?cuser2="; + $comp_users[$comp_user2]['prob'] = "&prob2="; + } + if (!empty($comp_users)) { + // we have checks to make + $gperm_handler =& xoops_gethandler('groupperm'); + $errs = ""; + foreach ($comp_users as $u) { + if ($u['id']) { + // we have user id for name entered + $xu = new XoopsUser($u['id']); + $grps = $xu->getGroups(); + if (!$gperm_handler->checkRight("jobs_submit", 0, $grps, $module_id)) { + // no submit permission + $errs .= $u['entry'] . $u['name'] . $u['prob'] . "p"; + } + } else { + // no user id for name entered + $errs .= $u['entry'] . $u['name'] . $u['prob'] . "n"; + + } + } + if ($errs) { + // we are going to re-open the form and request corrections + // add to the query string the comp user(s) with their usernames and what problems they have e.g. + // name1=xyz and prob1=p (no submit permission) or prob1=n (not there) + redirect_header("addcompany.php$errs", 5, "Correction required"); + exit(); + } + } +// END - check new entries for company users are OK - GreenFlatDog + + $comp_user1_contact = $myts->addSlashes($_POST["comp_user1_contact"]); + $comp_user2_contact = $myts->addSlashes($_POST["comp_user2_contact"]); + } else { + + $comp_userid1 = ""; + $comp_userid2 = ""; + $comp_user1_contact = ""; + $comp_user2_contact = ""; + + } + + $filename = ""; + if (!empty($_FILES['comp_img']['name'])) { + include_once XOOPS_ROOT_PATH . "/class/uploader.php"; + $updir = 'logo_images/'; + $allowed_mimetypes = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png'); + $uploader = new XoopsMediaUploader($updir, $allowed_mimetypes, $photomax, $maxwide, $maxhigh); + $uploader->setTargetFileName($date . '_' . $_FILES['comp_img']['name']); + $uploader->fetchMedia('comp_img'); + if (!$uploader->upload()) { + $errors = $uploader->getErrors(); + redirect_header("addcompany.php", 3, $errors); + return FALSE; + exit(); + } else { + $filename = $uploader->getSavedFileName(); + } + } + + $newid = $xoopsDB->genId($xoopsDB->prefix("jobs_companies") . "_comp_id_seq"); + + $sql = sprintf("INSERT INTO %s (comp_id, comp_name, comp_address, comp_address2, comp_city, comp_state, comp_zip, comp_phone, comp_fax, comp_url, comp_img, comp_usid, comp_user1, comp_user2, comp_contact, comp_user1_contact, comp_user2_contact, comp_date_added) VALUES (%u, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%u', '%s', '%s', '%s', '%s', '%s', '%s')", $xoopsDB->prefix("jobs_companies"), $newid, $comp_name, $comp_address, $comp_address2, $comp_city, $comp_state, $comp_zip, $comp_phone, $comp_fax, $comp_url, $filename, $comp_usid, $comp_userid1, $comp_userid2, $comp_contact, $comp_user1_contact, $comp_user2_contact, $date); + $xoopsDB->query($sql) or $erh->show("0013"); + + unset ($_SESSION['comp_name']); + unset ($_SESSION['comp_address']); + unset ($_SESSION['comp_address2']); + unset ($_SESSION['comp_city']); + unset ($_SESSION['comp_state']); + unset ($_SESSION['comp_zip']); + unset ($_SESSION['comp_phone']); + unset ($_SESSION['comp_fax']); + unset ($_SESSION['comp_url']); + unset ($_SESSION['comp_usid']); + unset ($_SESSION['comp_user1']); + unset ($_SESSION['comp_user2']); + unset ($_SESSION['comp_contact']); + unset ($_SESSION['comp_user1_contact']); + unset ($_SESSION['comp_user2_contact']); + + redirect_header("addlisting.php", 3, _JOBS_RECEIVED); + exit(); +} else { + $xoopsOption['template_main'] = 'jobs_add_company.html'; + include XOOPS_ROOT_PATH . "/header.php"; + include_once XOOPS_ROOT_PATH . "/modules/jobs/class/jobtree.php"; + + $token = $GLOBALS['xoopsSecurity']->createToken(); + + if (isset($_GET['cuser1']) && $_GET['cuser1'] != "") { + $cuser1 = $_GET['cuser1']; + $prob1 = $_GET['prob1']; + $alert_message = _JOBS_PLS_CORRECT; + } + if (isset($_GET['cuser2']) && $_GET['cuser2'] != "") { + $cuser2 = $_GET['cuser2']; + $prob2 = $_GET['prob2']; + $alert_message = _JOBS_PLS_CORRECT; + } + + $alert1 = ""; + $alert2 = ""; + + $_SESSION['comp_name'] = !empty($_SESSION['comp_name']) ? $_SESSION['comp_name'] : ""; + $_SESSION['comp_address'] = !empty($_SESSION['comp_address']) ? $_SESSION['comp_address'] : ""; + $_SESSION['comp_address2'] = !empty($_SESSION['comp_address2']) ? $_SESSION['comp_address2'] : ""; + $_SESSION['comp_city'] = !empty($_SESSION['comp_city']) ? $_SESSION['comp_city'] : ""; + $_SESSION['comp_state'] = !empty($_SESSION['comp_state']) ? $_SESSION['comp_state'] : ""; + $_SESSION['comp_zip'] = !empty($_SESSION['comp_zip']) ? $_SESSION['comp_zip'] : ""; + $_SESSION['comp_phone'] = !empty($_SESSION['comp_phone']) ? $_SESSION['comp_phone'] : ""; + $_SESSION['comp_fax'] = !empty($_SESSION['comp_fax']) ? $_SESSION['comp_fax'] : ""; + $_SESSION['comp_url'] = !empty($_SESSION['comp_url']) ? $_SESSION['comp_url'] : ""; + $_SESSION['comp_usid'] = !empty($_SESSION['comp_usid']) ? $_SESSION['comp_usid'] : ""; + $_SESSION['comp_user1'] = !empty($_SESSION['comp_user1']) ? $_SESSION['comp_user1'] : ""; + $_SESSION['comp_user2'] = !empty($_SESSION['comp_user2']) ? $_SESSION['comp_user2'] : ""; + $_SESSION['comp_contact'] = !empty($_SESSION['comp_contact']) ? $_SESSION['comp_contact'] : ""; + $_SESSION['comp_user1_contact'] = !empty($_SESSION['comp_user1_contact']) ? $_SESSION['comp_user1_contact'] : ""; + $_SESSION['comp_user2_contact'] = !empty($_SESSION['comp_user2_contact']) ? $_SESSION['comp_user2_contact'] : ""; + + $result = $xoopsDB->query("select rid,name from " . $xoopsDB->prefix("jobs_region") . " order by rid ASC"); + + ob_start(); + $form = new XoopsThemeForm(_JOBS_ADD_COMPANY, 'companyform', 'addcompany.php'); + $form->setExtra('enctype="multipart/form-data"'); + $GLOBALS['xoopsGTicket']->addTicketXoopsFormElement($form, __LINE__, 1800, 'token'); + + $form->addElement( + new XoopsFormText(_JOBS_COMPANY_NAME, "comp_name", 20, 50, "" . $_SESSION['comp_name'] . ""), TRUE + ); + $form->addElement( + new XoopsFormText(_JOBS_COMPANY_ADDRESS, "comp_address", 50, 50, "" . $_SESSION['comp_address'] . ""), TRUE + ); + $form->addElement( + new XoopsFormText(_JOBS_COMPANY_ADDRESS2, "comp_address2", 50, 50, "" . $_SESSION['comp_address2'] . ""), FALSE + ); + $form->addElement( + new XoopsFormText(_JOBS_COMPANY_CITY, "comp_city", 50, 50, "" . $_SESSION['comp_city'] . ""), TRUE + ); + + $state_form = new XoopsFormSelect(_JOBS_STATE, "comp_state", "" . $_SESSION['comp_state'] . "", "0", FALSE); + while (list($rid, $name) = $xoopsDB->fetchRow($result)) { + $state_form->addOption('', _JOBS_SELECT_STATE); + $state_form->addOption($rid, $name); + } + $form->addElement($state_form, TRUE); + + $form->addElement(new XoopsFormText(_JOBS_COMPANY_ZIP, "comp_zip", 50, 50, "" . $_SESSION['comp_zip'] . ""), TRUE); + $form->addElement( + new XoopsFormText(_JOBS_COMPANY_PHONE, "comp_phone", 30, 30, "" . $_SESSION['comp_phone'] . ""), TRUE + ); + $form->addElement(new XoopsFormText(_JOBS_COMPANY_FAX, "comp_fax", 30, 30, "" . $_SESSION['comp_fax'] . ""), FALSE); + $form->addElement( + new XoopsFormText(_JOBS_COMPANY_SITEURL, "comp_url", 50, 50, "" . $_SESSION['comp_url'] . ""), FALSE + ); + $form->addElement(new XoopsFormFile(_JOBS_COMPANY_LOGO, 'comp_img', 0), FALSE); + $form->addElement( + new XoopsFormTextArea(_JOBS_COMPANY_CONTACT, 'comp_contact', "" . $_SESSION['comp_contact'] . "", 6, 40), FALSE + ); + $form->insertBreak(); + if ($premium == "1") { + $form->insertBreak(_JOBS_COMPANY_OTHERS, "head"); + $form->insertBreak(); + +// START - check new entries for company users are OK - contributed by GreenFlatDog + $alert = "<br /><span style='color:#f00'>%s%s</span>"; + + if (isset($_GET['cuser1']) && $_GET['cuser1'] != "") { + if ($cuser1) { + $prob = ($prob1 == "n") ? _JOBS_COMP_USER_NOTTHERE : _JOBS_COMP_USER_NOPERM; + $alert1 = sprintf($alert, $cuser1, $prob); + unset($prob); + } + } + + if ($alert1) { + $form->addElement( + new XoopsFormText( + _JOBS_COMPANY_USER1 . $alert1, "comp_user1", 50, 50, "" . $_SESSION['comp_user1'] . ""), FALSE + ); + } else { + $form->addElement( + new XoopsFormText(_JOBS_COMPANY_USER1, "comp_user1", 50, 50, "" . $_SESSION['comp_user1'] . ""), FALSE + ); + } + + $form->addElement( + new XoopsFormTextArea(_JOBS_USER1_CONTACT, 'comp_user1_contact', + "" . $_SESSION['comp_user1_contact'] . "", 6, 40), FALSE + ); + + if (isset($_GET['cuser2']) && $_GET['cuser2'] != "") { + if ($cuser2) { + $prob = ($prob2 == "n") ? _JOBS_COMP_USER_NOTTHERE : _JOBS_COMP_USER_NOPERM; + $alert2 = sprintf($alert, $cuser2, $prob); + unset($prob); + } + } + if ($alert2) { + $form->addElement( + new XoopsFormText( + _JOBS_COMPANY_USER2 . $alert2, "comp_user2", 50, 50, "" . $_SESSION['comp_user2'] . ""), FALSE + ); + } else { + $form->addElement( + new XoopsFormText(_JOBS_COMPANY_USER2, "comp_user2", 50, 50, "" . $_SESSION['comp_user2'] . ""), FALSE + ); + } + $form->addElement( + new XoopsFormTextArea(_JOBS_USER2_CONTACT, 'comp_user2_contact', + "" . $_SESSION['comp_user2_contact'] . "", 6, 40), FALSE + ); + } else { + + $form->addElement(new XoopsFormHidden('comp_user1', "")); + $form->addElement(new XoopsFormHidden('comp_user2', "")); + $form->addElement(new XoopsFormHidden('comp_user1_contact', "")); + $form->addElement(new XoopsFormHidden('comp_user2_contact', "")); + } + $form->addElement(new XoopsFormHidden('token', $token)); + $form->addElement(new XoopsFormButton('', 'submit', _JOBS_SUBMIT, 'submit')); + $form->addElement(new XoopsFormHidden('comp_usid', $xoopsUser->getVar('uid'))); + $form->display(); + $xoopsTpl->assign('submit_form', ob_get_contents()); + ob_end_clean(); + + include XOOPS_ROOT_PATH . '/footer.php'; +} +?> \ No newline at end of file Added: XoopsModules/jobs/branches/mamba/jobs/addlisting.php =================================================================== --- XoopsModules/jobs/branches/mamba/jobs/addlisting.php (rev 0) +++ XoopsModules/jobs/branches/mamba/jobs/addlisting.php 2012-10-09 17:33:55 UTC (rev 10209) @@ -0,0 +1,351 @@ +<?php +// $Id: addcompany.php,v 1.12 2010/02/06 08:11:07 jlm69 Exp $ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2000 XOOPS.org // +// <http://www.xoops.org/> // +// ------------------------------------------------------------------------- // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// 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. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +include "header.php"; +$mydirname = basename(dirname(__FILE__)); +$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object +require_once(XOOPS_ROOT_PATH . "/modules/$mydirname/include/gtickets.php"); +include_once XOOPS_ROOT_PATH . "/modules/$mydirname/class/jobtree.php"; +include_once (XOOPS_ROOT_PATH . "/modules/$mydirname/include/functions.php"); + +$module_id = $xoopsModule->getVar('mid'); +if (is_object($xoopsUser)) { + $groups = $xoopsUser->getGroups(); +} else { + $groups = XOOPS_GROUP_ANONYMOUS; +} +$gperm_handler =& xoops_gethandler('groupperm'); +if (isset($_POST['item_id'])) { + $perm_itemid = intval($_POST['item_id']); +} else { + $perm_itemid = 0; +} +if (!$gperm_handler->checkRight("jobs_submit", $perm_itemid, $groups, $module_id)) { + redirect_header(XOOPS_URL . "/index.php", 3, _NOPERM); + exit(); +} +if (!$gperm_handler->checkRight("jobs_premium", $perm_itemid, $groups, $module_id)) { + $premium = 0; +} else { + $premium = 1; +} + +$mytree = new JobTree($xoopsDB->prefix("jobs_categories"), "cid", "pid"); + +if (isset($_POST["cid"])) { + $cid = intval($_POST["cid"]); +} else { + if (isset($_GET["cid"])) { + $cid = intval($_GET["cid"]); + } +} +if (isset($_POST["comp_id"])) { + $comp_id = intval($_POST["comp_id"]); +} else { + if (isset($_GET["comp_id"])) { + $comp_id = intval($_GET["comp_id"]); + } +} + +if (empty($xoopsUser)) { + redirect_header(XOOPS_URL . "modules/profile/", 3, _JOBS_MUSTREGFIRST); + exit(); +} + +$member_usid = $xoopsUser->getVar("uid", "E"); + +$all_comp = jobs_getCompany($member_usid); +if (!$all_comp) { + redirect_header(XOOPS_URL . "/modules/$mydirname/addcompany.php", 2, _JOBS_MUSTADD_COMPANY); +} + +if (empty($comp_id)) { + $count = jobs_getCompCount($member_usid); + if ($count > 1) { + redirect_header(XOOPS_URL . "/modules/$mydirname/whatcompany.php", 1, _JOBS_WHAT_COMPANY); + } +} + +if (!empty($_POST['submit'])) { + + $jobsdays = $xoopsModuleConfig['jobs_days']; + + if (!$xoopsGTicket->check(TRUE, 'token')) { + redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); + } + +// if ($xoopsModuleConfig["jobs_use_captcha"] == '1') { +// $x24plus = jobs_isX24plus(); +// if ($x24plus) { +// xoops_load("xoopscaptcha"); +// $xoopsCaptcha = XoopsCaptcha::getInstance(); +// if( !$xoopsCaptcha->verify() ) { +// redirect_header( XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/index.php", 3, $xoopsCaptcha->getMessage() ); +// } +// } else { +// xoops_load("captcha"); +// $xoopsCaptcha = XoopsCaptcha::getInstance(); +// if( !$xoopsCaptcha->verify() ) { +// redirect_header( XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/index.php", 3, $xoopsCaptcha->getMessage() ); +// } +// } +// } + + $title = $myts->addSlashes($_POST["title"]); + $status = $myts->addSlashes($_POST["status"]); + $expire = $myts->addSlashes($_POST["expire"]); + $type = $myts->addSlashes($_POST["type"]); + $company = $myts->addSlashes($_POST["company"]); + if ($xoopsModuleConfig['jobs_form_options'] == 'dhtmltextarea' || $xoopsModuleConfig['jobs_form_options'] == 'dhtml' + ) { + $desctext = $myts->displayTarea($_POST["desctext"], 0, 0, 0, 0, 0); + } else { + $desctext = $myts->displayTarea($_POST["desctext"], 1, 1, 1, 1, 1); + } + if ($xoopsModuleConfig['jobs_form_options'] == 'dhtmltextarea' || $xoopsModuleConfig['jobs_form_options'] == 'dhtml' + ) { + $requirements = $myts->displayTarea($_POST["requirements"], 0, 0, 1, 0, 0); + } else { + $requirements = $myts->displayTarea($_POST["requirements"], 1, 1, 1, 1, 1); + } + + $tel = $myts->addSlashes($_POST["tel"]); + $price = $myts->addSlashes($_POST["price"]); + $typeprice = $myts->addSlashes($_POST["typeprice"]); + $contactinfo = $myts->displayTarea($_POST["contactinfo"], 0, 0, 0, 0, 0); + $contactinfo1 = $myts->displayTarea($_POST["contactinfo1"], 0, 0, 0, 0, 0); + $contactinfo2 = $myts->displayTarea($_POST["contactinfo2"], 0, 0, 0, 0, 0); + $submitter = $myts->addSlashes($_POST["submitter"]); + $usid = $myts->addSlashes($member_usid); + $town = $myts->addSlashes($_POST["town"]); + $state = $myts->addSlashes($_POST["state"]); + $valid = $myts->addSlashes($_POST["valid"]); + $email = $myts->addSlashes($_POST["email"]); + $view = 0; + $photo = ''; + $date = time(); + + $newid = $xoopsDB->genId($xoopsDB->prefix("jobs_listing") . "_lid_seq"); + + $sql = sprintf( + "INSERT INTO " . $xoopsDB->prefix("jobs_listing") + . " (lid, cid, title, status, expire, type, company, desctext, requirements, tel, price, typeprice, contactinfo, contactinfo1, contactinfo2, date, email, submitter, usid, town, state, valid, photo, view) VALUES ('$newid', '$cid', '$title', '$status', '$expire', '$type', '$company', '$desctext', '$requirements', '$tel', '$price', '$typeprice', '$contactinfo', '$contactinfo1', '$contactinfo2', '$date', '$email', '$submitter', '$usid', '$town', '$state', '$valid', '$photo', '$view')" + ); + $xoopsDB->query($sql); + + if ($valid == 'Yes') { + + $notification_handler =& xoops_gethandler('notification'); + $lid = $xoopsDB->getInsertId(); + $tags = array(); + $tags['LID'] = $lid; + $tags['TITLE'] = $title; + $tags['TYPE'] = $type; + $tags['DESCTEXT'] = $desctext; + $tags['COMPANY_TITLE'] = stripslashes($company); + $tags['HELLO'] = _JOBS_HELLO; + $tags['ADDED_TO_CAT'] = _JOBS_ADDED_TO_CAT; + $tags['ADDED_BY_COMPANY'] = _JOBS_ADDED_BY_COMPANY; + $tags['FOLLOW_LINK'] = _JOBS_FOLLOW_LINK; + $tags['RECIEVING_NOTIF'] = _JOBS_RECIEVING_NOTIF; + $tags['ERROR_NOTIF'] = _JOBS_ERROR_NOTIF; + $tags['WEBMASTER'] = _JOBS_WEBMASTER; + $tags['LINK_URL'] = XOOPS_URL . '/modules/' . $mydirname . '/viewjobs.php' . '?lid=' . addslashes($lid); + $sql + = + "SELECT title FROM " . $xoopsDB->prefix("jobs_categories") . " WHERE cid=" . addslashes($cid); + $result = $xoopsDB->query($sql); + $row = $xoopsDB->fetchArray($result); + $tags['CATEGORY_TITLE'] = $row['title']; + $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $mydirname . '/jobscat.php?cid="' . addslashes($cid); + $notification_handler =& xoops_gethandler('notification'); + $notification_handler->triggerEvent('global', 0, 'new_job', $tags); + $notification_handler->triggerEvent('category', $cid, 'new_jobs_cat', $tags); + $notification_handler->triggerEvent('company_listing', $comp_id, 'new_jobs_comp', $tags); + $notification_handler->triggerEvent('job_listing', $lid, 'new_job', $tags); + } + redirect_header("index.php", 3, _JOBS_JOBADDED); + exit(); + +} else { + + $xoopsOption['template_main'] = 'jobs_addlisting.html'; + include XOOPS_ROOT_PATH . "/header.php"; + + include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; + + if (isset($_POST["cid"])) { + $cid = intval($_POST["cid"]); + } else { + if (isset($_GET["cid"])) { + $cid = intval($_GET["cid"]); + } else { + $cid = 0; + } + } + + $member_usid = $xoopsUser->uid(); + $member_email = $xoopsUser->getVar("email", "E"); + $member_uname = $xoopsUser->getVar("uname", "E"); + $email = $member_email; + $temp_premium = "0"; + + if (empty($comp_id)) { + $thiscompany = jobs_getCompany($member_usid); + } else { + $extra_user = jobs_getXtraUsers($comp_id, $member_usid); + if (!empty($extra_user)) { + $temp_premium = "1"; + } + + $thiscompany = jobs_getThisCompany($comp_id, $member_usid); + } + + $result = $xoopsDB->query("select nom_type from " . $xoopsDB->prefix("jobs_type") . " order by nom_type"); + $result1 = $xoopsDB->query("select nom_price from " . $xoopsDB->prefix("jobs_price") . " order by id_price"); + $result2 = $xoopsDB->query("select rid,name from " . $xoopsDB->prefix("jobs_region") . " order by rid"); + + ob_start(); + $form = new XoopsThemeForm(_JOBS_ADD_LISTING, 'submit_form', 'addlisting.php'); + $form->setExtra('enctype="multipart/form-data"'); + $GLOBALS['xoopsGTicket']->addTicketXoopsFormElement($form, __LINE__, 1800, 'token'); + + if (($premium == "1") || ($temp_premium == "1")) { + echo "" . _JOBS_PREMIUM_MEMBER . " " . $xoopsModuleConfig['jobs_days'] . " " . _JOBS_PREMIUM2 . ""; + } else { + echo ""; + } + + $form->addElement(new XoopsFormLabel(_JOBS_SUBMITTER, $member_uname)); + $form->addElement(new XoopsFormHidden('submitter', $member_uname)); + + if ($xoopsModuleConfig['jobs_show_company'] == '1') { + $form->addElement(new XoopsFormLabel(_JOBS_COMPANY, $thiscompany["comp_name"])); + $form->addElement(new XoopsFormHidden('company', $thiscompany["comp_name"])); + } + $form->addElement(new XoopsFormText(_JOBS_EMAIL, 'email', 50, 100, $email), TRUE); + $form->addElement(new XoopsFormText(_JOBS_TOWN, 'town', 50, 50, $thiscompany["comp_city"]), FALSE); + + if ($xoopsModuleConfig['jobs_show_state'] == '1') { + $state_form = new XoopsFormSelect(_JOBS_STATE, "state", $thiscompany["comp_state"], "0", FALSE); + while (list($rid, $name) = $xoopsDB->fetchRow($result2)) { + $state_form->addOption('', _JOBS_SELECT_STATE); + $state_form->addOption($rid, $name); + } + $form->addElement($state_form, TRUE); + } + + $form->addElement(new XoopsFormText(_JOBS_TEL, "tel", 30, 30, $thiscompany["comp_phone"]), FALSE); + + $cat_form = (new XoopsFormSelect(_JOBS_CAT, 'cid', '')); + $cattree = $mytree->getChildTreeArray(0, "title ASC"); + $cat_form->addOption('', _JOBS_SELECTCAT); + foreach ($cattree as $branch) { + $branch['prefix'] = substr($branch['prefix'], 0, -1); + $branch['prefix'] = str_replace(".", "--", $branch['prefix']); + $cat_form->addOption($branch['cid'], $branch['prefix'] . $branch['title']); + } + $form->addElement($cat_form, TRUE); + + if (($premium == "1") || ($temp_premium == "1")) { + + $form->addElement(new XoopsFormText(_JOBS_HOW_LONG, "expire", 3, 3, $xoopsModuleConfig['jobs_days']), TRUE); + + } else { + $form->addElement(new XoopsFormLabel(_JOBS_NON_HOW_LONG, $xoopsModuleConfig['jobs_days'])); + $form->addElement(new XoopsFormHidden('expire', $xoopsModuleConfig['jobs_days'])); + } + + $type_form = new XoopsFormSelect(_JOBS_JOB_TYPE, "type", "", "0", FALSE); + while (list($nom_type) = $xoopsDB->fetchRow($result)) { + $type_form->addOption($nom_type, $nom_type); + } + $form->addElement($type_form); + + if (($premium == "1") || ($temp_premium == "1")) { + $radio = new XoopsFormRadio(_JOBS_STATUS, 'status', ""); + $options["1"] = _JOBS_ACTIVE; + $options["0"] = _JOBS_INACTIVE; + $radio->addOptionArray($options); + $form->addElement($radio, TRUE); + } else { + $form->addElement(new XoopsFormHidden('status', "0")); + } + $form->addElement(new XoopsFormText(_JOBS_TITLE, "title", 40, 50, ""), TRUE); + $form->addElement(jobs_getEditor(_JOBS_DESC, "desctext", "", "100%", "300px", ""), TRUE); + $form->addElement(jobs_getEditor(_JOBS_REQUIRE, "requirements", "", "100%", "300px", ""), TRUE); + $form->addElement(new XoopsFormText(_JOBS_PRICE2, "price", 40, 50, ""), FALSE); + $sel_form = new XoopsFormSelect(_JOBS_SALARYTYPE, "typeprice", "", "1", FALSE); + while (list($nom_price) = $xoopsDB->fetchRow($result1)) { + $sel_form->addOption($nom_price, $nom_price); + } + $form->addElement($sel_form); + + $form->addElement( + new XoopsFormTextArea(_JOBS_CONTACTINFO, "contactinfo", + "" . $myts->undoHtmlSpecialChars($myts->displayTarea($thiscompany["comp_contact"], 0, 0, 0, 0, 0)) + . "", 6, 40), TRUE + ); + + if (($premium == "1") || ($temp_premium == "1")) { + if ($thiscompany["comp_user1_contact"]) { + $form->addElement( + new XoopsFormTextArea(_JOBS_CONTACTINFO1, "contactinfo1", + "" . $thiscompany["comp_user1_contact"] . "", 6, 40), FALSE + ); + } else { + $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO1, "contactinfo1", "", 6, 40), FALSE); + } + if ($thiscompany["comp_user2_contact"]) { + $form->addElement( + new XoopsFormTextArea(_JOBS_CONTACTINFO2, "contactinfo2", + "" . $thiscompany["comp_user2_contact"] . "", 6, 40), FALSE + ); + } else { + $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO2, "contactinfo2", "", 6, 40), FALSE); + } + } else { + $form->addElement(new XoopsFormHidden('contactinfo1', "")); + $form->addElement(new XoopsFormHidden('contactinfo2', "")); + } +// if ($xoopsModuleConfig['jobs_use_captcha'] == '1') { +// $form->addElement(new XoopsFormCaptcha(_JOBS_CAPTCHA, "xoopscaptcha", false), true); +// } + if ($xoopsModuleConfig['jobs_moderated'] == 0) { + $form->addElement(new XoopsFormHidden("valid", "Yes"), FALSE); + } else { + $form->addElement(new XoopsFormHidden("valid", "No"), FALSE); + } + $form->addElement(new XoopsFormHidden("comp_id", $thiscompany["comp_id"]), FALSE); + $form->addElement(new XoopsFormButton('', 'submit', _JOBS_SUBMIT, 'submit')); + $form->display(); + $xoopsTpl->assign('submit_form', ob_get_contents()); + ob_end_clean(); + $xoopsTpl->assign('lang_comp_city', _JOBS_COMPANY_CITY); +} +include XOOPS_ROOT_PATH . '/footer.php'; + +?> \ No newline at end of file Added: XoopsModules/jobs/branches/mamba/jobs/addresume.php =================================================================== --- XoopsModules/jobs/branches/mamba/jobs/addresume.php (rev 0) +++ XoopsModules/jobs/branches/mamba/jobs/addresume.php 2012-10-09 17:33:55 UTC (rev 10209) @@ -0,0 +1,329 @@ +<?php +// ----------------------------------------------------------------------- // +// Jobs Module for Xoops // +// John Mordo - jlm69 at Xoops // +// Licence Type : GPL // +// ------------------------------------------------------------------------- // + +include("header.php"); +$mydirname = basename(dirname(__FILE__)); +require_once(XOOPS_ROOT_PATH . "/modules/$mydirname/include/gtickets.php"); +include_once (XOOPS_ROOT_PATH . "/modules/$mydirname/include/resume_functions.php"); +include_once XOOPS_ROOT_PATH . "/modules/$mydirname/class/restree.php"; + +$myts =& MyTextSanitizer::getInstance(); + +$module_id = $xoopsModule->getVar('mid'); +if (is_object($xoopsUser)) { + $groups = $xoopsUser->getGroups(); +} else { + $groups = XOOPS_GROUP_ANONYMOUS; +} +$gperm_handler =& xoops_gethandler('groupperm'); +if (isset($_POST['item_id'])) { + $perm_itemid = intval($_POST['item_id']); +} else { + $perm_itemid = 0; +} +//If no access +if (!$gperm_handler->checkRight("resume_submit", $perm_itemid, $groups, $module_id)) { + redirect_header(XOOPS_URL . "/modules/$mydirname/resumes.php", 3, _NOPERM); + exit(); +} + +if (isset($_POST["cid"])) { + $cid = intval($_POST["cid"]); +} else { + if (isset($_GET["cid"])) { + $cid = intval($_GET["cid"]); + } +} + +$member_usid = $xoopsUser->getVar("uid", "E"); + +if (!empty($_POST['submit'])) { + + if (!$xoopsGTicket->check(TRUE, 'token')) { + redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); + } + +// if ($xoopsModuleConfig["jobs_use_captcha"] == '1') { +// $x24plus = resume_isX24plus(); +//... [truncated message content] |
From: <du...@us...> - 2012-10-08 21:24:52
|
Revision: 10208 http://sourceforge.net/p/xoops/svn/10208 Author: dugris Date: 2012-10-08 21:24:50 +0000 (Mon, 08 Oct 2012) Log Message: ----------- update forms class Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradio.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php 2012-10-08 20:39:33 UTC (rev 10207) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php 2012-10-08 21:24:50 UTC (rev 10208) @@ -26,34 +26,9 @@ /** * A simple text field */ -class XoopsFormMail extends XoopsFormElement +class XoopsFormMail extends XoopsFormText { /** - * Size - * - * @var int - * @access private - */ - private $_size; - - /** - * Maximum length of the text - * - * @var int - * @access private - */ - - private $_maxlength; - - /** - * placeholder for this element - * - * @var string - * @access private - */ - private $_placeholder; - - /** * Constructor * * @param string $caption Caption @@ -64,50 +39,12 @@ * @param string $placeholder placeholder for this element. */ public function __construct($caption, $name, $size, $maxlength, $value = '', $placeholder = '') - { - $this->setCaption($caption); - $this->setName($name); - $this->_size = intval($size); - $this->_maxlength = intval($maxlength); - $this->setValue($value); - $this->_placeholder = $placeholder; + { + parent::__construct($caption, $name, $size, $maxlength, $value, $placeholder); $this->setPattern('[^@]+@[^@]+\.[a-zA-Z]{2,6}', _FORM_VALID_MAIL); } /** - * Get size - * - * @return int - */ - public function getSize() - { - return $this->_size; - } - - /** - * Get maximum text length - * - * @return int - */ - public function getMaxlength() - { - return $this->_maxlength; - } - - /** - * Get placeholder for this element - * - * @return string - */ - public function getPlaceholder() - { - if (empty($this->_placeholder)) { - return ''; - } - return $this->_placeholder; - } - - /** * Prepare HTML for output * * @return string HTML Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradio.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradio.php 2012-10-08 20:39:33 UTC (rev 10207) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradio.php 2012-10-08 21:24:50 UTC (rev 10208) @@ -154,6 +154,7 @@ $ele_inline = $this->getInline(); $class = ($this->getClass() != '' ? " class='" . $this->getClass() . "'" : ''); $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); + $required = ($this->isRequired() ? ' required' : ''); $ret = ""; $id_ele = 0; foreach ($ele_options as $value => $name) { @@ -164,7 +165,7 @@ } $id_ele++; $ret .= "<label class='radio" . $ele_inline . "'>" . NWLINE; - $ret .= "<input type='radio' name='" . $ele_name . "' title='" . $ele_title . "' id='" . $ele_name . $id_ele . "' value='" . $value . "'" . $class . $extra . $ele_checked . ">" . NWLINE; + $ret .= "<input type='radio' name='" . $ele_name . "' title='" . $ele_title . "' id='" . $ele_name . $id_ele . "' value='" . $value . "'" . $class . $extra . $ele_checked . $required . ">" . NWLINE; $ret .= $name . NWLINE; $ret .= "</label>" . NWLINE; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php 2012-10-08 20:39:33 UTC (rev 10207) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php 2012-10-08 21:24:50 UTC (rev 10208) @@ -26,34 +26,9 @@ /** * A simple text field */ -class XoopsFormUrl extends XoopsFormElement +class XoopsFormUrl extends XoopsFormText { /** - * Size - * - * @var int - * @access private - */ - private $_size; - - /** - * Maximum length of the text - * - * @var int - * @access private - */ - - private $_maxlength; - - /** - * placeholder for this element - * - * @var string - * @access private - */ - private $_placeholder; - - /** * Constructor * * @param string $caption Caption @@ -65,53 +40,10 @@ */ public function __construct($caption, $name, $size, $maxlength, $value = '', $placeholder = '') { - $this->setCaption($caption); - $this->setName($name); - $this->_size = intval($size); - $this->_maxlength = intval($maxlength); - $this->setValue($value); - $this->_placeholder = $placeholder; + parent::__construct($caption, $name, $size, $maxlength, $value, $placeholder); $this->setPattern('https?://.+', _FORM_VALID_URL); } - /** - * Get size - * - * @return int - */ - public function getSize() - { - return $this->_size; - } - - /** - * Get maximum text length - * - * @return int - */ - public function getMaxlength() - { - return $this->_maxlength; - } - - /** - * Get placeholder for this element - * - * @return string - */ - public function getPlaceholder() - { - if (empty($this->_placeholder)) { - return ''; - } - return $this->_placeholder; - } - - /** - * Prepare HTML for output - * - * @return string HTML - */ public function render() { $name = $this->getName(); |
From: <du...@us...> - 2012-10-08 20:39:36
|
Revision: 10207 http://sourceforge.net/p/xoops/svn/10207 Author: dugris Date: 2012-10-08 20:39:33 +0000 (Mon, 08 Oct 2012) Log Message: ----------- Add two form type : <input type='mail' .....> <input type='url' .....> Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/global.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php 2012-10-08 20:39:33 UTC (rev 10207) @@ -0,0 +1,131 @@ +<?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. +*/ + +/** + * XOOPS form element of text + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package class + * @subpackage xoopsform + * @since 2.0.0 + * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * A simple text field + */ +class XoopsFormMail extends XoopsFormElement +{ + /** + * Size + * + * @var int + * @access private + */ + private $_size; + + /** + * Maximum length of the text + * + * @var int + * @access private + */ + + private $_maxlength; + + /** + * placeholder for this element + * + * @var string + * @access private + */ + private $_placeholder; + + /** + * Constructor + * + * @param string $caption Caption + * @param string $name "name" attribute + * @param int $size Size + * @param int $maxlength Maximum length of text + * @param string $value Initial text + * @param string $placeholder placeholder for this element. + */ + public function __construct($caption, $name, $size, $maxlength, $value = '', $placeholder = '') + { + $this->setCaption($caption); + $this->setName($name); + $this->_size = intval($size); + $this->_maxlength = intval($maxlength); + $this->setValue($value); + $this->_placeholder = $placeholder; + $this->setPattern('[^@]+@[^@]+\.[a-zA-Z]{2,6}', _FORM_VALID_MAIL); + } + + /** + * Get size + * + * @return int + */ + public function getSize() + { + return $this->_size; + } + + /** + * Get maximum text length + * + * @return int + */ + public function getMaxlength() + { + return $this->_maxlength; + } + + /** + * Get placeholder for this element + * + * @return string + */ + public function getPlaceholder() + { + if (empty($this->_placeholder)) { + return ''; + } + return $this->_placeholder; + } + + /** + * Prepare HTML for output + * + * @return string HTML + */ + public function render() + { + $name = $this->getName(); + if ($this->getSize() > $this->getMaxcols()) { + $maxcols = 5; + } else { + $maxcols = $this->getSize(); + } + $class = ($this->getClass() != '' ? " class='span" . $maxcols . " " . $this->getClass() . "'" : " class='span" . $maxcols . "'"); + $list = ($this->isDatalist() != '' ? " list='list_" . $name . "'" : ''); + $pattern = ($this->getPattern() != '' ? " pattern='" . $this->getPattern() . "'" : ''); + $placeholder = ($this->getPlaceholder() != '' ? " placeholder='" . $this->getPlaceholder() . "'" : ''); + $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); + $required = ($this->isRequired() ? ' required' : ''); + return "<input type='email' name='" . $name . "' title='" . $this->getTitle() . "' id='" . $name . "'" . $class ." maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $list . $pattern . $placeholder . $extra . $required . ">"; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formmail.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php 2012-10-08 20:39:33 UTC (rev 10207) @@ -0,0 +1,131 @@ +<?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. +*/ + +/** + * XOOPS form element of text + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package class + * @subpackage xoopsform + * @since 2.0.0 + * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * A simple text field + */ +class XoopsFormUrl extends XoopsFormElement +{ + /** + * Size + * + * @var int + * @access private + */ + private $_size; + + /** + * Maximum length of the text + * + * @var int + * @access private + */ + + private $_maxlength; + + /** + * placeholder for this element + * + * @var string + * @access private + */ + private $_placeholder; + + /** + * Constructor + * + * @param string $caption Caption + * @param string $name "name" attribute + * @param int $size Size + * @param int $maxlength Maximum length of text + * @param string $value Initial text + * @param string $placeholder placeholder for this element. + */ + public function __construct($caption, $name, $size, $maxlength, $value = '', $placeholder = '') + { + $this->setCaption($caption); + $this->setName($name); + $this->_size = intval($size); + $this->_maxlength = intval($maxlength); + $this->setValue($value); + $this->_placeholder = $placeholder; + $this->setPattern('https?://.+', _FORM_VALID_URL); + } + + /** + * Get size + * + * @return int + */ + public function getSize() + { + return $this->_size; + } + + /** + * Get maximum text length + * + * @return int + */ + public function getMaxlength() + { + return $this->_maxlength; + } + + /** + * Get placeholder for this element + * + * @return string + */ + public function getPlaceholder() + { + if (empty($this->_placeholder)) { + return ''; + } + return $this->_placeholder; + } + + /** + * Prepare HTML for output + * + * @return string HTML + */ + public function render() + { + $name = $this->getName(); + if ($this->getSize() > $this->getMaxcols()) { + $maxcols = 5; + } else { + $maxcols = $this->getSize(); + } + $class = ($this->getClass() != '' ? " class='span" . $maxcols . " " . $this->getClass() . "'" : " class='span" . $maxcols . "'"); + $list = ($this->isDatalist() != '' ? " list='list_" . $name . "'" : ''); + $pattern = ($this->getPattern() != '' ? " pattern='" . $this->getPattern() . "'" : ''); + $placeholder = ($this->getPlaceholder() != '' ? " placeholder='" . $this->getPlaceholder() . "'" : ''); + $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); + $required = ($this->isRequired() ? ' required' : ''); + return "<input type='url' name='" . $name . "' title='" . $this->getTitle() . "' id='" . $name . "'" . $class ." maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $list . $pattern . $placeholder . $extra . $required . ">"; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formurl.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-10-08 20:18:31 UTC (rev 10206) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-10-08 20:39:33 UTC (rev 10207) @@ -302,6 +302,8 @@ 'xoopsformtextarea' => XOOPS_ROOT_PATH . '/class/xoopsform/formtextarea.php', 'xoopsformtextdateselect' => XOOPS_ROOT_PATH . '/class/xoopsform/formtextdateselect.php', 'xoopsgroupformcheckbox' => XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php', + 'xoopsformmail' => XOOPS_ROOT_PATH . '/class/xoopsform/formmail.php', + 'xoopsformurl' => XOOPS_ROOT_PATH . '/class/xoopsform/formurl.php', 'xoopsgrouppermform' => XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php', 'xoopsguestuser' => XOOPS_ROOT_PATH . '/kernel/user.php', 'xoopsmailer' => XOOPS_ROOT_PATH . '/class/xoopsmailer.php', Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/global.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/global.php 2012-10-08 20:18:31 UTC (rev 10206) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/language/english/global.php 2012-10-08 20:39:33 UTC (rev 10207) @@ -108,7 +108,7 @@ define("_MD_STRTYOPENG","This can not be changed afterwards!"); define("_MD_ASFILE","Store as files (in uploads directory)"); define("_MD_INDB","Store in the database (as binary \"blob\" data)"); -define("_MD_IMGMAIN","Category"); +define("_MD_IMGMAIN","Category"); define("_MD_EDITIMGCAT","Images Settings"); define('_IMGMANAGER','Image Manager'); define('_NUMIMAGES','%s images'); @@ -213,4 +213,10 @@ **/ define('_RESET','Reset'); define('_RE','Re:'); + +/** +* Additions to 2.6.0 +**/ +define('_FORM_VALID_URL','Starting with http or https'); +define('_FORM_VALID_MAIL','Enter a valid email address'); ?> \ No newline at end of file |
From: <du...@us...> - 2012-10-08 20:18:35
|
Revision: 10206 http://sourceforge.net/p/xoops/svn/10206 Author: dugris Date: 2012-10-08 20:18:31 +0000 (Mon, 08 Oct 2012) Log Message: ----------- fix register form Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2012-10-08 17:04:43 UTC (rev 10205) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2012-10-08 20:18:31 UTC (rev 10206) @@ -82,7 +82,7 @@ } else { echo "<span class='red'>$stop</span>"; include $xoops->path('include/registerform.php'); - $reg_form->display(); + $reg_form->render(false); } $xoops->footer(); break; @@ -188,7 +188,7 @@ } else { echo "<span class='red bold'>{$stop}</span>"; include $xoops->path('include/registerform.php'); - $reg_form->display(); + $reg_form->render(false); } $xoops->footer(); break; @@ -250,7 +250,7 @@ $xoops->theme->addMeta('meta', 'keywords', _US_USERREG . ", " . _US_NICKNAME); // FIXME! $xoops->theme->addMeta('meta', 'description', strip_tags($xoopsConfigUser['reg_disclaimer'])); include $xoops->path('include/registerform.php'); - $reg_form->display(); + $reg_form->render(false); $xoops->footer(); break; } \ No newline at end of file |
From: <be...@us...> - 2012-10-08 17:04:45
|
Revision: 10205 http://sourceforge.net/p/xoops/svn/10205 Author: beckmi Date: 2012-10-08 17:04:43 +0000 (Mon, 08 Oct 2012) Log Message: ----------- Placing 4.3RC2 into releases Added Paths: ----------- XoopsModules/jobs/releases/4.3 RC2/must_include/ |
From: <be...@us...> - 2012-10-08 17:04:14
|
Revision: 10204 http://sourceforge.net/p/xoops/svn/10204 Author: beckmi Date: 2012-10-08 17:04:11 +0000 (Mon, 08 Oct 2012) Log Message: ----------- Placing 4.3RC2 into releases Added Paths: ----------- XoopsModules/jobs/releases/4.3 RC2/jobs/ |
From: <be...@us...> - 2012-10-08 17:01:46
|
Revision: 10203 http://sourceforge.net/p/xoops/svn/10203 Author: beckmi Date: 2012-10-08 17:01:42 +0000 (Mon, 08 Oct 2012) Log Message: ----------- Adding 4.3RC2 Modified Paths: -------------- XoopsModules/jobs/trunk/jobs/READ_ME XoopsModules/jobs/trunk/jobs/add_photo.php XoopsModules/jobs/trunk/jobs/addcompany.php XoopsModules/jobs/trunk/jobs/addlisting.php XoopsModules/jobs/trunk/jobs/addresume.php XoopsModules/jobs/trunk/jobs/admin/admin_header.php XoopsModules/jobs/trunk/jobs/admin/category.php XoopsModules/jobs/trunk/jobs/admin/groupperms.php XoopsModules/jobs/trunk/jobs/admin/index.php XoopsModules/jobs/trunk/jobs/admin/map.php XoopsModules/jobs/trunk/jobs/admin/menu.php XoopsModules/jobs/trunk/jobs/admin/mygroupperm.php XoopsModules/jobs/trunk/jobs/admin/upgrade.php XoopsModules/jobs/trunk/jobs/blocks/jobs.php XoopsModules/jobs/trunk/jobs/class/mygrouppermform.php XoopsModules/jobs/trunk/jobs/contact.php XoopsModules/jobs/trunk/jobs/contactresume.php XoopsModules/jobs/trunk/jobs/createresume.php XoopsModules/jobs/trunk/jobs/delpicture.php XoopsModules/jobs/trunk/jobs/delreply.php XoopsModules/jobs/trunk/jobs/display-logo.php XoopsModules/jobs/trunk/jobs/editdesc.php XoopsModules/jobs/trunk/jobs/header.php XoopsModules/jobs/trunk/jobs/include/functions.php XoopsModules/jobs/trunk/jobs/include/gtickets.php XoopsModules/jobs/trunk/jobs/include/notification.inc.php XoopsModules/jobs/trunk/jobs/include/resume_functions.php XoopsModules/jobs/trunk/jobs/include/search.inc.php XoopsModules/jobs/trunk/jobs/include/searchform.php XoopsModules/jobs/trunk/jobs/index.php XoopsModules/jobs/trunk/jobs/language/english/admin.php XoopsModules/jobs/trunk/jobs/language/english/blocks.php XoopsModules/jobs/trunk/jobs/language/english/mail_template/jobs_listing_approve.tpl XoopsModules/jobs/trunk/jobs/language/english/mail_template/jobs_listing_contact.tpl XoopsModules/jobs/trunk/jobs/language/english/mail_template/jobs_listing_expired.tpl XoopsModules/jobs/trunk/jobs/language/english/mail_template/jobs_listing_newpost_notify.tpl XoopsModules/jobs/trunk/jobs/language/english/mail_template/jobs_listing_res_newpost_notify.tpl XoopsModules/jobs/trunk/jobs/language/english/main.php XoopsModules/jobs/trunk/jobs/language/english/modinfo.php XoopsModules/jobs/trunk/jobs/members.php XoopsModules/jobs/trunk/jobs/modjob.php XoopsModules/jobs/trunk/jobs/modresume.php XoopsModules/jobs/trunk/jobs/print.php XoopsModules/jobs/trunk/jobs/replies.php XoopsModules/jobs/trunk/jobs/search.php XoopsModules/jobs/trunk/jobs/sendfriend.php XoopsModules/jobs/trunk/jobs/sql/mysql.sql XoopsModules/jobs/trunk/jobs/templates/blocks/jobs_block_new.html XoopsModules/jobs/trunk/jobs/templates/jobs_addresume.html XoopsModules/jobs/trunk/jobs/templates/jobs_adlist.html XoopsModules/jobs/trunk/jobs/templates/jobs_category.html XoopsModules/jobs/trunk/jobs/templates/jobs_index.html XoopsModules/jobs/trunk/jobs/templates/jobs_index2.html XoopsModules/jobs/trunk/jobs/templates/jobs_item.html XoopsModules/jobs/trunk/jobs/templates/jobs_members.html XoopsModules/jobs/trunk/jobs/templates/jobs_replies.html XoopsModules/jobs/trunk/jobs/templates/jobs_res_adlist.html XoopsModules/jobs/trunk/jobs/templates/jobs_res_category.html XoopsModules/jobs/trunk/jobs/templates/jobs_resume.html XoopsModules/jobs/trunk/jobs/view_photos.php XoopsModules/jobs/trunk/jobs/viewresume.php XoopsModules/jobs/trunk/jobs/xoops_version.php Added Paths: ----------- XoopsModules/jobs/trunk/jobs/admin/addcomp.php XoopsModules/jobs/trunk/jobs/admin/addregion.php XoopsModules/jobs/trunk/jobs/admin/addresume.php XoopsModules/jobs/trunk/jobs/admin/company.php XoopsModules/jobs/trunk/jobs/admin/delcomp.php XoopsModules/jobs/trunk/jobs/admin/docs.php XoopsModules/jobs/trunk/jobs/admin/error_log XoopsModules/jobs/trunk/jobs/admin/header.php XoopsModules/jobs/trunk/jobs/admin/include/ XoopsModules/jobs/trunk/jobs/admin/include/canada.php XoopsModules/jobs/trunk/jobs/admin/include/england.php XoopsModules/jobs/trunk/jobs/admin/include/france.php XoopsModules/jobs/trunk/jobs/admin/include/index.html XoopsModules/jobs/trunk/jobs/admin/include/italy.php XoopsModules/jobs/trunk/jobs/admin/include/usstates.php XoopsModules/jobs/trunk/jobs/admin/jobs_doc_1.php XoopsModules/jobs/trunk/jobs/admin/lists.php XoopsModules/jobs/trunk/jobs/admin/modcomp.php XoopsModules/jobs/trunk/jobs/admin/modresume.php XoopsModules/jobs/trunk/jobs/admin/region.php XoopsModules/jobs/trunk/jobs/admin/submitlisting.php XoopsModules/jobs/trunk/jobs/blocks/jobs2.php XoopsModules/jobs/trunk/jobs/blocks/jobs_b_premium.php XoopsModules/jobs/trunk/jobs/blocks/resumes.php XoopsModules/jobs/trunk/jobs/class/grouppermform.php XoopsModules/jobs/trunk/jobs/class/jobtree.php XoopsModules/jobs/trunk/jobs/class/restree.php XoopsModules/jobs/trunk/jobs/delcompany.php XoopsModules/jobs/trunk/jobs/delcreated.php XoopsModules/jobs/trunk/jobs/deljob.php XoopsModules/jobs/trunk/jobs/delresume.php XoopsModules/jobs/trunk/jobs/error_log XoopsModules/jobs/trunk/jobs/images/arrow.gif XoopsModules/jobs/trunk/jobs/images/backarrow.gif XoopsModules/jobs/trunk/jobs/images/down_active.gif XoopsModules/jobs/trunk/jobs/images/left_both.gif XoopsModules/jobs/trunk/jobs/images/modadminbg.gif XoopsModules/jobs/trunk/jobs/images/right_both.gif XoopsModules/jobs/trunk/jobs/images/up_active.gif XoopsModules/jobs/trunk/jobs/jobscat.php XoopsModules/jobs/trunk/jobs/language/english/docs.php XoopsModules/jobs/trunk/jobs/language/english/mail_template/jobs_company_newpost_notify.tpl XoopsModules/jobs/trunk/jobs/modcompany.php XoopsModules/jobs/trunk/jobs/modcreated.php XoopsModules/jobs/trunk/jobs/myresume.php XoopsModules/jobs/trunk/jobs/resumecat.php XoopsModules/jobs/trunk/jobs/resumes.php XoopsModules/jobs/trunk/jobs/templates/blocks/jobs_b2.html XoopsModules/jobs/trunk/jobs/templates/blocks/jobs_block_premium.html XoopsModules/jobs/trunk/jobs/templates/blocks/resume_block_new.html XoopsModules/jobs/trunk/jobs/templates/jobs_choose_company.html XoopsModules/jobs/trunk/jobs/templates/jobs_modcompany.html XoopsModules/jobs/trunk/jobs/templates/jobs_modify.html XoopsModules/jobs/trunk/jobs/templates/jobs_modresume.html XoopsModules/jobs/trunk/jobs/templates/jobs_premium.html XoopsModules/jobs/trunk/jobs/viewjobs.php XoopsModules/jobs/trunk/jobs/whatcompany.php XoopsModules/jobs/trunk/must_include/ XoopsModules/jobs/trunk/must_include/2.4/ XoopsModules/jobs/trunk/must_include/2.4/class/ XoopsModules/jobs/trunk/must_include/2.4/class/xoopsform/ XoopsModules/jobs/trunk/must_include/2.4/class/xoopsform/formselect.php XoopsModules/jobs/trunk/must_include/2.5/ XoopsModules/jobs/trunk/must_include/2.5/class/ XoopsModules/jobs/trunk/must_include/2.5/class/xoopsform/ XoopsModules/jobs/trunk/must_include/2.5/class/xoopsform/formselect.php XoopsModules/jobs/trunk/must_include/233b/ XoopsModules/jobs/trunk/must_include/233b/class/ XoopsModules/jobs/trunk/must_include/233b/class/xoopsform/ XoopsModules/jobs/trunk/must_include/233b/class/xoopsform/formselect.php XoopsModules/jobs/trunk/must_include/233b/include/ XoopsModules/jobs/trunk/must_include/233b/include/cp_header.php Removed Paths: ------------- XoopsModules/jobs/trunk/htdocs/ XoopsModules/jobs/trunk/jobs/admin/admin.php XoopsModules/jobs/trunk/jobs/admin/mymenu.php XoopsModules/jobs/trunk/jobs/class/xoopstree.php XoopsModules/jobs/trunk/jobs/editcomp.php XoopsModules/jobs/trunk/jobs/editresume.php XoopsModules/jobs/trunk/jobs/images/Thumbs.db XoopsModules/jobs/trunk/jobs/include/basic_mailtags.php XoopsModules/jobs/trunk/jobs/include/preferences.inc.php XoopsModules/jobs/trunk/jobs/index2.php XoopsModules/jobs/trunk/jobs/listing-p-f.php XoopsModules/jobs/trunk/jobs/photo/midsize/php.ini XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_11_4790083d6ce1f.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_11_4790916bd292e.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_13_480d3127adcf2.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_13_480d31a0d66c6.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_13_480d31f3e5fed.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_2_477ae03313947.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_2_477ae1cef1687.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_2_477ae796bbfde.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_2_477ae7de24e28.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_2_477aeb6b4966c.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_2_4780d5fbbaf93.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_2_4780ea75cb136.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_2_47a055e888735.jpg XoopsModules/jobs/trunk/jobs/photo/midsize/resized_pic_4_47b376989bd81.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/php.ini XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_11_4790083d6ce1f.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_11_4790916bd292e.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_13_480d3127adcf2.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_13_480d31a0d66c6.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_13_480d31f3e5fed.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_2_477ae03313947.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_2_477ae1cef1687.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_2_477ae796bbfde.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_2_477ae7de24e28.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_2_477aeb6b4966c.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_2_4780d5fbbaf93.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_2_4780ea75cb136.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_2_47a055e888735.jpg XoopsModules/jobs/trunk/jobs/photo/thumbs/thumb_pic_4_47b376989bd81.jpg Modified: XoopsModules/jobs/trunk/jobs/READ_ME =================================================================== --- XoopsModules/jobs/trunk/jobs/READ_ME 2012-10-08 16:57:16 UTC (rev 10202) +++ XoopsModules/jobs/trunk/jobs/READ_ME 2012-10-08 17:01:42 UTC (rev 10203) @@ -7,22 +7,27 @@ 1) NEW INSTALL - Upload the jobs folder inside the Xoops modules folder, go to modules administration and install. + 1. Upload the jobs folder inside the Xoops modules folder, go to modules administration and install. + 2. Replace the class/xoopsform/formselect.php file with the one provided for your Xoops version. + 3. For Xoops version 2.3.3b Replace the class/xoopsform/formselect.php file and include/cp_header.php file with the ones provided. - 2) UPGRADING FROM ANY PREVIOUS VERSION BACKUP YOUR DATABASE BEFORE THIS UPGRADE. DON'T SAY YOU WEREN'T WARNED. 1. Overwrite the jobs folder with the new files. - 2. Update module, in module admin and you are done + 2. Replace the class/xoopsform/formselect.php file with the one provided for your Xoops version. + 3. For Xoops version 2.3.3b Replace the class/xoopsform/formselect.php file and include/cp_header.php file with the ones provided. + 4. Run the upgrade script as admin. point browser to "http://yoursite/modules/jobs/admin/upgrade.php" + 5. Update module, in module admin and you are done IMPORTANT!!! You must create a category in resumes before trying to set permissions. +IMPORTANT!!! You must create states or regions unless you don't use states in the preferences. +IMPORTANT!!! You must replace class/xoopsform/formselect.php and for 2.3.3b include/cp_header.php - Donations will allow this software to continue, without them probably not. Report any problems at www.jlmzone.com Modified: XoopsModules/jobs/trunk/jobs/add_photo.php =================================================================== --- XoopsModules/jobs/trunk/jobs/add_photo.php 2012-10-08 16:57:16 UTC (rev 10202) +++ XoopsModules/jobs/trunk/jobs/add_photo.php 2012-10-08 17:01:42 UTC (rev 10203) @@ -95,7 +95,7 @@ $xoopsDB->queryF("UPDATE ".$xoopsDB->prefix("jobs_resume")." SET rphoto=rphoto+1 WHERE lid = ".mysql_real_escape_string($lid).""); } else { - redirect_header(XOOPS_URL."/modules/$mydirname/view_photos.php?uid=".$xoopsUser->getVar('uid'),10,constant($main_lang."_NOCACHACA")); + redirect_header(XOOPS_URL."/modules/$mydirname/view_photos.php?uid=".$xoopsUser->getVar('uid'),3,constant($main_lang."_NOCACHACA")); } } Modified: XoopsModules/jobs/trunk/jobs/addcompany.php =================================================================== --- XoopsModules/jobs/trunk/jobs/addcompany.php 2012-10-08 16:57:16 UTC (rev 10202) +++ XoopsModules/jobs/trunk/jobs/addcompany.php 2012-10-08 17:01:42 UTC (rev 10203) @@ -1,5 +1,5 @@ <?php -// $Id: addcompany.php,v 1.12 2007/03/27 17:11:07 jlm69 Exp $ +// $Id: addcompany.php,v 4.1 2010/02/6 08:11:07 jlm69 Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -24,90 +24,163 @@ // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // - include "header.php"; +$mydirname = basename( dirname( __FILE__ ) ) ; $myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object -include_once XOOPS_ROOT_PATH."/class/xoopstree.php"; include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php"; -include("include/functions.php"); - +include XOOPS_ROOT_PATH."/modules/$mydirname/include/functions.php"; +include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; $erh = new ErrorHandler; //ErrorHandler object -$mytree = new XoopsTree($xoopsDB->prefix("jobs_categories"),"cid","pid"); if (empty($xoopsUser)) { - redirect_header(XOOPS_URL."/user.php",2,_JOBS_MUSTREGFIRST); + redirect_header(XOOPS_URL."/modules/profile/",3,_JOBS_MUSTREGFIRST); exit(); } +$module_id = $xoopsModule->getVar('mid'); +if (is_object($xoopsUser)) { + $groups = $xoopsUser->getGroups(); +} else { + $groups = XOOPS_GROUP_ANONYMOUS; +} +$gperm_handler =& xoops_gethandler('groupperm'); +if (isset($_POST['item_id'])) { + $perm_itemid = intval($_POST['item_id']); +} else { + $perm_itemid = 0; +} +if (!$gperm_handler->checkRight("jobs_submit", $perm_itemid, $groups, $module_id)) { + redirect_header(XOOPS_URL."/index.php", 3, _NOPERM); + exit(); +} +if (!$gperm_handler->checkRight("jobs_premium", $perm_itemid, $groups, $module_id)) { + $premium = 0; +} else { + $premium = 1; +} + $member_usid = $xoopsUser->getVar("uid", "E"); -$member_comp = getCompany($member_usid); +$member_comp = jobs_getCompany($member_usid); if ($member_comp) { - redirect_header(XOOPS_URL."/modules/$mydirname/index.php",2,_JOBS_COMPANY_EXISTS); + redirect_header(XOOPS_URL."/modules/$mydirname/index.php",3,_JOBS_COMPANY_EXISTS); } - if (!empty($_POST['submit'])) { - $comp_usid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0; + if (!$GLOBALS['xoopsSecurity']->check(true, $_REQUEST['token'])) { + redirect_header(XOOPS_URL."/modules/$mydirname/index.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); + } - // Check if Title exist - if ($_POST["comp_name"]=="") { - $erh->show("1001"); - } + $destination = XOOPS_ROOT_PATH."/modules/$mydirname/logo_images"; + $photomax = $xoopsModuleConfig['jobs_maxfilesize']; + $maxwide = $xoopsModuleConfig['jobs_resized_width']; + $maxhigh = $xoopsModuleConfig['jobs_resized_height']; + $date = time(); - //$notify = !empty($_POST['notify']) ? 1 : 0; + $comp_usid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0; - //if ( !empty($_POST['cid']) ) { - // $cid = intval($_POST['cid']); - //} else { - // $cid = 0; - //} + $_SESSION['comp_name'] = $_POST['comp_name']; + $_SESSION['comp_address'] = $_POST['comp_address']; + $_SESSION['comp_address2'] = $_POST['comp_address2']; + $_SESSION['comp_city'] = $_POST['comp_city']; + $_SESSION['comp_state'] = $_POST['comp_state']; + $_SESSION['comp_zip'] = $_POST['comp_zip']; + $_SESSION['comp_phone'] = $_POST['comp_phone']; + $_SESSION['comp_fax'] = $_POST['comp_fax']; + $_SESSION['comp_url'] = $_POST['comp_url']; + $_SESSION['comp_usid'] = $_POST['comp_usid']; + $_SESSION['comp_user1'] = $_POST['comp_user1']; + $_SESSION['comp_user2'] = $_POST['comp_user2']; + $_SESSION['comp_contact'] = $_POST['comp_contact']; + $_SESSION['comp_user1_contact'] = $_POST['comp_user1_contact']; + $_SESSION['comp_user2_contact'] = $_POST['comp_user2_contact']; - // $url = urlencode($url); - + $comp_name = $myts->addSlashes($_POST["comp_name"]); + $comp_address = $myts->addSlashes($_POST["comp_address"]); + $comp_address2 = $myts->addSlashes($_POST["comp_address2"]); + $comp_city = $myts->addSlashes($_POST["comp_city"]); + $comp_state = $myts->addSlashes($_POST["comp_state"]); + $comp_zip = $myts->addSlashes($_POST["comp_zip"]); + $comp_phone = $myts->addSlashes($_POST["comp_phone"]); + $comp_fax = $myts->addSlashes($_POST["comp_fax"]); + $comp_url = $myts->addSlashes($_POST["comp_url"]); + $comp_usid = $myts->addSlashes($_POST["comp_usid"]); + $comp_user1 = $myts->addSlashes($_POST["comp_user1"]); + $comp_user2 = $myts->addSlashes($_POST["comp_user2"]); + $comp_contact = $myts->addSlashes($_POST["comp_contact"]); - $comp_name = $myts->makeTboxData4Save($_POST["comp_name"]); - $comp_address = $myts->makeTboxData4Save($_POST["comp_address"]); - $comp_address2 = $myts->makeTboxData4Save($_POST["comp_address2"]); - $comp_city = $myts->makeTboxData4Save($_POST["comp_city"]); - $comp_state = $myts->makeTboxData4Save($_POST["comp_state"]); - $comp_zip = $myts->makeTboxData4Save($_POST["comp_zip"]); - $comp_phone = $myts->makeTboxData4Save($_POST["comp_phone"]); - $comp_fax = $myts->makeTboxData4Save($_POST["comp_fax"]); - $comp_url = $myts->makeTboxData4Save($_POST["comp_url"]); - $comp_usid = $myts->makeTboxData4Save($_POST["comp_usid"]); + if ($premium == "1") { -// $comp_user1 = $myts->makeTboxData4Save($_POST["comp_user1"]); -// $comp_user2 = $myts->makeTboxData4Save($_POST["comp_user2"]); +// START - check new entries for company users are OK - GreenFlatDog +$comp_users = array(); +// get user id for the name entered for company user 1 +if (empty($_POST["comp_user1"])) { + $comp_userid1 = ""; +} else { + $comp_userid1 = jobs_getIdFromUname($_POST["comp_user1"]); + // put name, id, what's entered and problem into an array + $comp_users[$comp_user1]['name'] = $_POST["comp_user1"]; + $comp_users[$comp_user1]['id'] = $comp_userid1; + $comp_users[$comp_user1]['entry'] = "?cuser1="; + $comp_users[$comp_user1]['prob'] = "&prob1="; +} +// get user id for the name entered for company user 2 +if (empty($_POST["comp_user2"])) { + $comp_userid2 = ""; +} else { + $comp_userid2 = jobs_getIdFromUname($_POST["comp_user2"]); + // put name, id, what's entered and problem into an array + $comp_users[$comp_user2]['name'] = $_POST["comp_user2"]; + $comp_users[$comp_user2]['id'] = $comp_userid2; + $comp_users[$comp_user2]['entry'] = "?cuser2="; + $comp_users[$comp_user2]['prob'] = "&prob2="; +} +if (!empty($comp_users)) { + // we have checks to make + $gperm_handler =& xoops_gethandler('groupperm'); + $errs = ""; + foreach ($comp_users as $u) { + if ($u['id']) { + // we have user id for name entered + $xu = new XoopsUser($u['id']); + $grps = $xu->getGroups(); + if (!$gperm_handler->checkRight("jobs_submit", 0, $grps, $module_id)) { + // no submit permission + $errs .= $u['entry'] . $u['name'] . $u['prob'] . "p"; + } + } else { + // no user id for name entered + $errs .= $u['entry'] . $u['name'] . $u['prob'] . "n"; - $comp_user1 = getIdFromUname($_POST["comp_user1"]); - $comp_user2 = getIdFromUname($_POST["comp_user2"]); + } + } + if ($errs) { + // we are going to re-open the form and request corrections + // add to the query string the comp user(s) with their usernames and what problems they have e.g. + // name1=xyz and prob1=p (no submit permission) or prob1=n (not there) + redirect_header("addcompany.php$errs", 5, "Correction required"); + exit(); + } +} +// END - check new entries for company users are OK - GreenFlatDog + $comp_user1_contact = $myts->addSlashes($_POST["comp_user1_contact"]); + $comp_user2_contact = $myts->addSlashes($_POST["comp_user2_contact"]); + } else { + $comp_userid1 = ""; + $comp_userid2 = ""; + $comp_user1_contact = ""; + $comp_user2_contact = ""; - - - - - - - - $comp_contact = $myts->makeTboxData4Save($_POST["comp_contact"]); - $comp_user1_contact = $myts->makeTboxData4Save($_POST["comp_user1_contact"]); - $comp_user2_contact = $myts->makeTboxData4Save($_POST["comp_user2_contact"]); - $date = time(); - - - $photomax=$xoopsModuleConfig['jobs_maxfilesize']; - $maxwide=$xoopsModuleConfig['jobs_resized_width']; - $maxhigh=$xoopsModuleConfig['jobs_resized_height']; - - + } + + $filename = ""; if ( !empty($_FILES['comp_img']['name']) ) { include_once XOOPS_ROOT_PATH."/class/uploader.php"; $updir = 'logo_images/'; - $allowed_mimetypes = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/x-png'); + $allowed_mimetypes = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png'); $uploader = new XoopsMediaUploader($updir, $allowed_mimetypes, $photomax, $maxwide, $maxhigh); $uploader->setTargetFileName($date.'_'.$_FILES['comp_img']['name']); $uploader->fetchMedia('comp_img'); @@ -121,91 +194,142 @@ } } + $newid = $xoopsDB->genId($xoopsDB->prefix("jobs_companies")."_comp_id_seq"); + $sql = sprintf("INSERT INTO %s (comp_id, comp_name, comp_address, comp_address2, comp_city, comp_state, comp_zip, comp_phone, comp_fax, comp_url, comp_img, comp_usid, comp_user1, comp_user2, comp_contact, comp_user1_contact, comp_user2_contact, comp_date_added) VALUES (%u, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%u', '%s', '%s', '%s', '%s', '%s', '%s')", $xoopsDB->prefix("jobs_companies"), $newid, $comp_name, $comp_address, $comp_address2, $comp_city, $comp_state, $comp_zip, $comp_phone, $comp_fax, $comp_url, $filename, $comp_usid, $comp_userid1, $comp_userid2, $comp_contact, $comp_user1_contact, $comp_user2_contact, $date); + $xoopsDB->query($sql) or $erh->show("0013"); + unset ($_SESSION['comp_name']); + unset ($_SESSION['comp_address']); + unset ($_SESSION['comp_address2']); + unset ($_SESSION['comp_city']); + unset ($_SESSION['comp_state']); + unset ($_SESSION['comp_zip']); + unset ($_SESSION['comp_phone']); + unset ($_SESSION['comp_fax']); + unset ($_SESSION['comp_url']); + unset ($_SESSION['comp_usid']); + unset ($_SESSION['comp_user1']); + unset ($_SESSION['comp_user2']); + unset ($_SESSION['comp_contact']); + unset ($_SESSION['comp_user1_contact']); + unset ($_SESSION['comp_user2_contact']); - - - - $newid = $xoopsDB->genId($xoopsDB->prefix("jobs_companies")."_comp_id_seq"); - - $sql = sprintf("INSERT INTO %s (comp_id, comp_name, comp_address, comp_address2, comp_city, comp_state, comp_zip, comp_phone, comp_fax, comp_url, comp_img, comp_usid, comp_user1, comp_user2, comp_contact, comp_user1_contact, comp_user2_contact, comp_date_added) VALUES (%u, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%u', '%s', '%s', '%s', '%s', '%s', '%s')", $xoopsDB->prefix("jobs_companies"), $newid, $comp_name, $comp_address, $comp_address2, $comp_city, $comp_state, $comp_zip, $comp_phone, $comp_fax, $comp_url, $filename, $comp_usid, $comp_user1, $comp_user2, $comp_contact, $comp_user1_contact, $comp_user2_contact, $date); - $xoopsDB->query($sql) or $erh->show("0013"); - - redirect_header("addlisting.php",2,_JOBS_RECEIVED); - + redirect_header("addlisting.php",3,_JOBS_RECEIVED); exit(); - } else { - - - //$xoopsOption['template_main'] = 'jobs_add_company.html'; $xoopsOption['template_main'] = 'jobs_add_company.html'; include XOOPS_ROOT_PATH."/header.php"; - include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; + include_once XOOPS_ROOT_PATH."/modules/jobs/class/jobtree.php"; - - //$xoopsTpl->assign('xoops_module_header', $xoops_module_header); - //Query datatypes that match the categories selected. If not category selected. + $token = $GLOBALS['xoopsSecurity']->createToken(); + +if (isset($_GET['cuser1']) && $_GET['cuser1'] != "") { + $cuser1 = $_GET['cuser1']; + $prob1 = $_GET['prob1']; + $alert_message = _JOBS_PLS_CORRECT; +} +if (isset($_GET['cuser2']) && $_GET['cuser2'] != "") { + $cuser2 = $_GET['cuser2']; + $prob2 = $_GET['prob2']; + $alert_message = _JOBS_PLS_CORRECT; +} + + $alert1 = ""; + $alert2 = ""; + +$_SESSION['comp_name'] = !empty($_SESSION['comp_name']) ? $_SESSION['comp_name'] : ""; +$_SESSION['comp_address'] = !empty($_SESSION['comp_address']) ? $_SESSION['comp_address'] : ""; +$_SESSION['comp_address2'] = !empty($_SESSION['comp_address2']) ? $_SESSION['comp_address2'] : ""; +$_SESSION['comp_city'] = !empty($_SESSION['comp_city']) ? $_SESSION['comp_city'] : ""; +$_SESSION['comp_state'] = !empty($_SESSION['comp_state']) ? $_SESSION['comp_state'] : ""; +$_SESSION['comp_zip'] = !empty($_SESSION['comp_zip']) ? $_SESSION['comp_zip'] : ""; +$_SESSION['comp_phone'] = !empty($_SESSION['comp_phone']) ? $_SESSION['comp_phone'] : ""; +$_SESSION['comp_fax'] = !empty($_SESSION['comp_fax']) ? $_SESSION['comp_fax'] : ""; +$_SESSION['comp_url'] = !empty($_SESSION['comp_url']) ? $_SESSION['comp_url'] : ""; +$_SESSION['comp_usid'] = !empty($_SESSION['comp_usid']) ? $_SESSION['comp_usid'] : ""; +$_SESSION['comp_user1'] = !empty($_SESSION['comp_user1']) ? $_SESSION['comp_user1'] : ""; +$_SESSION['comp_user2'] = !empty($_SESSION['comp_user2']) ? $_SESSION['comp_user2'] : ""; +$_SESSION['comp_contact'] = !empty($_SESSION['comp_contact']) ? $_SESSION['comp_contact'] : ""; +$_SESSION['comp_user1_contact'] = !empty($_SESSION['comp_user1_contact']) ? $_SESSION['comp_user1_contact'] : ""; +$_SESSION['comp_user2_contact'] = !empty($_SESSION['comp_user2_contact']) ? $_SESSION['comp_user2_contact'] : ""; + + $result = $xoopsDB->query("select rid,name from ".$xoopsDB->prefix("jobs_region")." order by rid ASC"); + ob_start(); $form = new XoopsThemeForm(_JOBS_ADD_COMPANY, 'companyform', 'addcompany.php'); $form->setExtra('enctype="multipart/form-data"'); + $GLOBALS['xoopsGTicket']->addTicketXoopsFormElement( $form , __LINE__ , 1800 , 'token' ) ; - $form->addElement(new XoopsFormText(_JOBS_COMPANY_NAME, "comp_name", 20, 50, ""), true); - $form->addElement(new XoopsFormText(_JOBS_COMPANY_ADDRESS, "comp_address", 50, 50, ""), true); - $form->addElement(new XoopsFormText(_JOBS_COMPANY_ADDRESS2, "comp_address2", 50, 50, ""), false); - $form->addElement(new XoopsFormText(_JOBS_COMPANY_CITY, "comp_city", 50, 50, ""), true); - $form->addElement(new XoopsFormText(_JOBS_COMPANY_STATE, "comp_state", 50, 50, ""), true); - $form->addElement(new XoopsFormText(_JOBS_COMPANY_ZIP, "comp_zip", 50, 50, ""), true); - $form->addElement(new XoopsFormText(_JOBS_COMPANY_PHONE, "comp_phone", 30, 30, ""), true); - $form->addElement(new XoopsFormText(_JOBS_COMPANY_FAX, "comp_fax", 30, 30, ""), false); - $form->addElement(new XoopsFormText(_JOBS_COMPANY_SITEURL, "comp_url", 50, 50, "http://"), false); + $form->addElement(new XoopsFormText(_JOBS_COMPANY_NAME, "comp_name", 20, 50, "".$_SESSION['comp_name'].""), true); + $form->addElement(new XoopsFormText(_JOBS_COMPANY_ADDRESS, "comp_address", 50, 50,"".$_SESSION['comp_address'].""), true); + $form->addElement(new XoopsFormText(_JOBS_COMPANY_ADDRESS2, "comp_address2", 50, 50, "".$_SESSION['comp_address2'].""), false); + $form->addElement(new XoopsFormText(_JOBS_COMPANY_CITY, "comp_city", 50, 50, "".$_SESSION['comp_city'].""), true); + + $state_form= new XoopsFormSelect(_JOBS_STATE, "comp_state", "".$_SESSION['comp_state']."", "0", false); + while (list($rid,$name) = $xoopsDB->fetchRow($result) ) { + $state_form->addOption('',_JOBS_SELECT_STATE); + $state_form->addOption($rid, $name); + } + $form->addElement($state_form,true); + + $form->addElement(new XoopsFormText(_JOBS_COMPANY_ZIP, "comp_zip", 50, 50, "".$_SESSION['comp_zip'].""), true); + $form->addElement(new XoopsFormText(_JOBS_COMPANY_PHONE, "comp_phone", 30, 30, "".$_SESSION['comp_phone'].""), true); + $form->addElement(new XoopsFormText(_JOBS_COMPANY_FAX, "comp_fax", 30, 30, "".$_SESSION['comp_fax'].""), false); + $form->addElement(new XoopsFormText(_JOBS_COMPANY_SITEURL, "comp_url", 50, 50, "".$_SESSION['comp_url'].""), false); $form->addElement(new XoopsFormFile(_JOBS_COMPANY_LOGO, 'comp_img', 0), false); - $form->addElement(new XoopsFormTextArea(_JOBS_COMPANY_CONTACT, 'comp_contact', '', 6, 40), false); - + $form->addElement(new XoopsFormTextArea(_JOBS_COMPANY_CONTACT, 'comp_contact', "".$_SESSION['comp_contact']."", 6, 40), false); $form->insertBreak(); + if ($premium == "1") { $form->insertBreak(_JOBS_COMPANY_OTHERS, "head"); $form->insertBreak(); - - $form->addElement(new XoopsFormText(_JOBS_COMPANY_USER1, "comp_user1", 50, 50, ""), false); - $form->addElement(new XoopsFormTextArea(_JOBS_USER1_CONTACT, 'comp_user1_contact', '', 6, 40), false); +// START - check new entries for company users are OK - contributed by GreenFlatDog + $alert = "<br /><span style='color:#f00'>%s%s</span>"; - $form->addElement(new XoopsFormText(_JOBS_COMPANY_USER2, "comp_user2", 50, 50, ""), false); - $form->addElement(new XoopsFormTextArea(_JOBS_USER2_CONTACT, 'comp_user2_contact', '', 6, 40), false); + if (isset($_GET['cuser1']) && $_GET['cuser1'] != "") { + if ($cuser1) { + $prob = ($prob1 == "n") ? _JOBS_COMP_USER_NOTTHERE : _JOBS_COMP_USER_NOPERM; + $alert1 = sprintf($alert, $cuser1, $prob); + unset($prob); + } + } + if ($alert1) { + $form->addElement(new XoopsFormText(_JOBS_COMPANY_USER1.$alert1, "comp_user1", 50, 50, "".$_SESSION['comp_user1'].""), false); + } else { + $form->addElement(new XoopsFormText(_JOBS_COMPANY_USER1, "comp_user1", 50, 50, "".$_SESSION['comp_user1'].""), false); + } + $form->addElement(new XoopsFormTextArea(_JOBS_USER1_CONTACT, 'comp_user1_contact', "".$_SESSION['comp_user1_contact']."", 6, 40), false); + + if (isset($_GET['cuser2']) && $_GET['cuser2'] != "") { + if ($cuser2) { + $prob = ($prob2 == "n") ? _JOBS_COMP_USER_NOTTHERE : _JOBS_COMP_USER_NOPERM; + $alert2 = sprintf($alert, $cuser2, $prob); + unset($prob); + } + } + if ($alert2) { + $form->addElement(new XoopsFormText(_JOBS_COMPANY_USER2.$alert2, "comp_user2", 50, 50, "".$_SESSION['comp_user2'].""), false); + } else { + $form->addElement(new XoopsFormText(_JOBS_COMPANY_USER2, "comp_user2", 50, 50, "".$_SESSION['comp_user2'].""), false); + } + $form->addElement(new XoopsFormTextArea(_JOBS_USER2_CONTACT, 'comp_user2_contact', "".$_SESSION['comp_user2_contact']."", 6, 40), false); + } else { + + $form->addElement(new XoopsFormHidden('comp_user1', "")); + $form->addElement(new XoopsFormHidden('comp_user2', "")); + $form->addElement(new XoopsFormHidden('comp_user1_contact', "")); + $form->addElement(new XoopsFormHidden('comp_user2_contact', "")); + } + $form->addElement(new XoopsFormHidden('token', $token)); $form->addElement(new XoopsFormButton('', 'submit', _JOBS_SUBMIT, 'submit')); $form->addElement(new XoopsFormHidden('comp_usid', $xoopsUser->getVar('uid'))); $form->display(); $xoopsTpl->assign('submit_form', ob_get_contents()); ob_end_clean(); - //$comp_usid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0; - $xoopsTpl->assign('lang_add_company', _JOBS_ADD_COMPANY); - $xoopsTpl->assign('lang_submitcomp', _JOBS_COMPANY_ADD); - $xoopsTpl->assign('lang_sitetitle', $xoopsConfig['sitename']); - $xoopsTpl->assign('lang_comp_name', _JOBS_COMPANY_NAME); - $xoopsTpl->assign('lang_comp_address', _JOBS_COMPANY_ADDRESS); - $xoopsTpl->assign('lang_comp_address2', _JOBS_COMPANY_ADDRESS2); - $xoopsTpl->assign('lang_comp_location', _JOBS_COMPANY_LOCATION); - $xoopsTpl->assign('lang_comp_city', _JOBS_COMPANY_CITY); - $xoopsTpl->assign('lang_comp_state', _JOBS_COMPANY_STATE); - $xoopsTpl->assign('lang_comp_zip', _JOBS_COMPANY_ZIP); - $xoopsTpl->assign('lang_comp_phone', _JOBS_COMPANY_PHONE); - $xoopsTpl->assign('lang_comp_fax', _JOBS_COMPANY_FAX); - $xoopsTpl->assign('lang_comp_siteurl', _JOBS_COMPANY_SITEURL); - $xoopsTpl->assign('lang_comp_submit', _JOBS_SUBMIT); - $xoopsTpl->assign('lang_comp_cancel', _JOBS_COMPANY_CANCEL); - $xoopsTpl->assign('lang_comp_others', _JOBS_COMPANY_OTHERS); - $xoopsTpl->assign('lang_comp_user1', _JOBS_COMPANY_USER1); - $xoopsTpl->assign('lang_comp_user2', _JOBS_COMPANY_USER2); - $xoopsTpl->assign('lang_user1_contact', _JOBS_USER1_CONTACT); - $xoopsTpl->assign('lang_user2_contact', _JOBS_USER2_CONTACT); - $xoopsTpl->assign('lang_comp_contact', _JOBS_COMPANY_CONTACT); - - - include XOOPS_ROOT_PATH.'/footer.php'; -} + } ?> \ No newline at end of file Modified: XoopsModules/jobs/trunk/jobs/addlisting.php =================================================================== --- XoopsModules/jobs/trunk/jobs/addlisting.php 2012-10-08 16:57:16 UTC (rev 10202) +++ XoopsModules/jobs/trunk/jobs/addlisting.php 2012-10-08 17:01:42 UTC (rev 10203) @@ -1,5 +1,5 @@ <?php -// $Id: addcompany.php,v 1.12 2007/03/27 17:11:07 jlm69 Exp $ +// $Id: addcompany.php,v 1.12 2010/02/06 08:11:07 jlm69 Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -24,16 +24,13 @@ // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // - include "header.php"; $mydirname = basename( dirname( __FILE__ ) ) ; $myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ; -include_once XOOPS_ROOT_PATH."/class/xoopstree.php"; -include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php"; -include("include/functions.php"); +include_once XOOPS_ROOT_PATH."/modules/$mydirname/class/jobtree.php"; +include_once (XOOPS_ROOT_PATH."/modules/$mydirname/include/functions.php"); -$erh = new ErrorHandler; //ErrorHandler object $module_id = $xoopsModule->getVar('mid'); if (is_object($xoopsUser)) { $groups = $xoopsUser->getGroups(); @@ -47,7 +44,7 @@ $perm_itemid = 0; } if (!$gperm_handler->checkRight("jobs_submit", $perm_itemid, $groups, $module_id)) { - redirect_header(XOOPS_URL."/user.php", 3, _NOPERM); + redirect_header(XOOPS_URL."/index.php", 3, _NOPERM); exit(); } if (!$gperm_handler->checkRight("jobs_premium", $perm_itemid, $groups, $module_id)) { @@ -56,98 +53,100 @@ $premium = 1; } - //$token = $GLOBALS['xoopsSecurity']->createToken(); - include_once (XOOPS_ROOT_PATH."/modules/$mydirname/include/functions.php"); - require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ; - include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; - include_once (XOOPS_ROOT_PATH."/class/xoopstree.php"); - $mytree = new XoopsTree($xoopsDB->prefix("jobs_categories"),"cid","pid"); +$mytree = new JobTree($xoopsDB->prefix("jobs_categories"),"cid","pid"); -if (isset($_POST["cid"])) { - $cid = intval($_POST["cid"]); -} else if (isset($_GET["cid"])) { - $cid = intval($_GET["cid"]); -} -if (isset($_POST["comp_id"])) { - $comp_id = intval($_POST["comp_id"]); -} else if (isset($_GET["comp_id"])) { - $comp_id = intval($_GET["comp_id"]); -} + if (isset($_POST["cid"])) { + $cid = intval($_POST["cid"]); + } else if (isset($_GET["cid"])) { + $cid = intval($_GET["cid"]); + } + if (isset($_POST["comp_id"])) { + $comp_id = intval($_POST["comp_id"]); + } else if (isset($_GET["comp_id"])) { + $comp_id = intval($_GET["comp_id"]); + } -if (empty($xoopsUser)) { - redirect_header(XOOPS_URL."/user.php",2,_JOBS_MUSTREGFIRST); + if (empty($xoopsUser)) { + redirect_header(XOOPS_URL."modules/profile/",3,_JOBS_MUSTREGFIRST); exit(); -} + } -$member_usid = $xoopsUser->getVar("uid", "E"); -$all_comp = getCompany($member_usid); -if (!$all_comp) { + $member_usid = $xoopsUser->getVar("uid", "E"); + + $all_comp = jobs_getCompany($member_usid); + if (!$all_comp) { redirect_header(XOOPS_URL."/modules/$mydirname/addcompany.php",2,_JOBS_MUSTADD_COMPANY); -} + } -if (!empty($_POST['submit']) ) { + if (empty($comp_id)) { + $count = jobs_getCompCount($member_usid); + if ($count > 1) { + redirect_header(XOOPS_URL."/modules/$mydirname/whatcompany.php",1,_JOBS_WHAT_COMPANY); + } + } + if (!empty($_POST['submit']) ) { + $jobsdays=$xoopsModuleConfig['jobs_days']; if ( ! $xoopsGTicket->check( true , 'token' ) ) { redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors()); } +// if ($xoopsModuleConfig["jobs_use_captcha"] == '1') { +// $x24plus = jobs_isX24plus(); +// if ($x24plus) { +// xoops_load("xoopscaptcha"); +// $xoopsCaptcha = XoopsCaptcha::getInstance(); +// if( !$xoopsCaptcha->verify() ) { +// redirect_header( XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/index.php", 3, $xoopsCaptcha->getMessage() ); +// } +// } else { +// xoops_load("captcha"); +// $xoopsCaptcha = XoopsCaptcha::getInstance(); +// if( !$xoopsCaptcha->verify() ) { +// redirect_header( XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/index.php", 3, $xoopsCaptcha->getMessage() ); +// } +// } +// } - // Check if Title exist - if ($_POST["title"]=="") { - $erh->show("1001"); - } + $title = $myts->addSlashes($_POST["title"]); + $status = $myts->addSlashes($_POST["status"]); + $expire = $myts->addSlashes($_POST["expire"]); + $type = $myts->addSlashes($_POST["type"]); + $company = $myts->addSlashes($_POST["company"]); + if ($xoopsModuleConfig['jobs_form_options'] == 'dhtmltextarea' || $xoopsModuleConfig['jobs_form_options'] == 'dhtml') { + $desctext = $myts->displayTarea($_POST["desctext"],0,0,0,0,0); + } else { + $desctext = $myts->displayTarea($_POST["desctext"],1,1,1,1,1); + } + if ($xoopsModuleConfig['jobs_form_options'] == 'dhtmltextarea' || $xoopsModuleConfig['jobs_form_options'] == 'dhtml') { + $requirements = $myts->displayTarea($_POST["requirements"],0,0,1,0,0); + } else { + $requirements = $myts->displayTarea($_POST["requirements"], 1,1,1,1,1); + } - $title = $myts->makeTboxData4Save($_POST["title"]); - $status = $myts->makeTboxData4Save($_POST["status"]); - $expire = $myts->makeTboxData4Save($_POST["expire"]); - $type = $myts->makeTboxData4Save($_POST["type"]); - $company = $myts->makeTboxData4Save($_POST["company"]); - $desctext = $myts->makeTboxData4Save($_POST["desctext"]); - $requirements = $myts->makeTboxData4Save($_POST["requirements"]); - $tel = $myts->makeTboxData4Save($_POST["tel"]); - $price = $myts->makeTboxData4Save($_POST["price"]); - $typeprice = $myts->makeTboxData4Save($_POST["typeprice"]); - $contactinfo = $myts->makeTboxData4Save($_POST["contactinfo"]); - $submitter = $myts->makeTboxData4Save($_POST["submitter"]); - $usid = $myts->makeTboxData4Save($member_usid); - $town = $myts->makeTboxData4Save($_POST["town"]); - $state = $myts->makeTboxData4Save($_POST["state"]); - $valid = $myts->makeTboxData4Save($_POST["valid"]); - $email = $myts->makeTboxData4Save($_POST["email"]); + $tel = $myts->addSlashes($_POST["tel"]); + $price = $myts->addSlashes($_POST["price"]); + $typeprice = $myts->addSlashes($_POST["typeprice"]); + $contactinfo = $myts->displayTarea($_POST["contactinfo"],0,0,0,0,0); + $contactinfo1 = $myts->displayTarea($_POST["contactinfo1"],0,0,0,0,0); + $contactinfo2 = $myts->displayTarea($_POST["contactinfo2"],0,0,0,0,0); + $submitter = $myts->addSlashes($_POST["submitter"]); + $usid = $myts->addSlashes($member_usid); + $town = $myts->addSlashes($_POST["town"]); + $state = $myts->addSlashes($_POST["state"]); + $valid = $myts->addSlashes($_POST["valid"]); + $email = $myts->addSlashes($_POST["email"]); $view = 0; $photo = ''; $date = time(); - $photomax=$xoopsModuleConfig['jobs_maxfilesize']; - $maxwide=$xoopsModuleConfig['jobs_resized_width']; - $maxhigh=$xoopsModuleConfig['jobs_resized_height']; - - - if ( !empty($_FILES['comp_img']['name']) ) { - include_once XOOPS_ROOT_PATH."/class/uploader.php"; - $updir = 'logo_images/'; - $allowed_mimetypes = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/x-png'); - $uploader = new XoopsMediaUploader($updir, $allowed_mimetypes, $photomax, $maxwide, $maxhigh); - $uploader->setTargetFileName($date.'_'.$_FILES['comp_img']['name']); - $uploader->fetchMedia('comp_img'); - if (!$uploader->upload()) { - $errors = $uploader->getErrors(); - redirect_header("addcompany.php", 3, $errors); - return False; - exit(); - } else { - $filename = $uploader->getSavedFileName(); - } - } - $newid = $xoopsDB->genId($xoopsDB->prefix("jobs_listing")."_lid_seq"); - $sql = sprintf("INSERT INTO %s (lid, cid, title, status, expire, type, company, desctext, requirements, tel, price, typeprice, contactinfo, date, email, submitter, usid, town, state, valid, photo, view) VALUES (%u, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $xoopsDB->prefix("jobs_listing"), $newid, $cid, $title, $status, $expire, $type, $company, $desctext, $requirements, $tel, $price, $typeprice, $contactinfo, $date, $email, $submitter, $usid, $town, $state, $valid, $photo, $view); - $xoopsDB->query($sql) or $erh->show("0013"); + $sql = sprintf("INSERT INTO ".$xoopsDB->prefix("jobs_listing")." (lid, cid, title, status, expire, type, company, desctext, requirements, tel, price, typeprice, contactinfo, contactinfo1, contactinfo2, date, email, submitter, usid, town, state, valid, photo, view) VALUES ('$newid', '$cid', '$title', '$status', '$expire', '$type', '$company', '$desctext', '$requirements', '$tel', '$price', '$typeprice', '$contactinfo', '$contactinfo1', '$contactinfo2', '$date', '$email', '$submitter', '$usid', '$town', '$state', '$valid', '$photo', '$view')"); + $xoopsDB->query($sql); - if($valid == 'Yes'){ $notification_handler =& xoops_gethandler('notification'); @@ -157,139 +156,173 @@ $tags['TITLE'] = $title; $tags['TYPE'] = $type; $tags['DESCTEXT'] = $desctext; + $tags['COMPANY_TITLE'] = stripslashes($company); $tags['HELLO'] = _JOBS_HELLO; $tags['ADDED_TO_CAT'] = _JOBS_ADDED_TO_CAT; + $tags['ADDED_BY_COMPANY'] = _JOBS_ADDED_BY_COMPANY; $tags['FOLLOW_LINK'] = _JOBS_FOLLOW_LINK; $tags['RECIEVING_NOTIF'] = _JOBS_RECIEVING_NOTIF; $tags['ERROR_NOTIF'] = _JOBS_ERROR_NOTIF; - $tags['LINK_URL'] = XOOPS_URL . '/modules/'.$mydirname.'/index.php?pa=viewlistings'. '&lid=' . addslashes($lid); + $tags['WEBMASTER'] = _JOBS_WEBMASTER; + $tags['LINK_URL'] = XOOPS_URL . '/modules/'.$mydirname.'/viewjobs.php'. '?lid=' . addslashes($lid); $sql = "SELECT title FROM " . $xoopsDB->prefix("jobs_categories") . " WHERE cid=" . addslashes($cid); $result = $xoopsDB->query($sql); $row = $xoopsDB->fetchArray($result); $tags['CATEGORY_TITLE'] = $row['title']; - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/'.$mydirname.'/index.php?pa=jobsview&cid="' . addslashes($cid); + $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/'.$mydirname.'/jobscat.php?cid="' . addslashes($cid); $notification_handler =& xoops_gethandler('notification'); $notification_handler->triggerEvent('global', 0, 'new_job', $tags); - $notification_handler->triggerEvent('category', $cid, 'new_job_cat', $tags); - $notification_handler->triggerEvent ('listing', $lid, 'new_job', $tags ); + $notification_handler->triggerEvent('category', $cid, 'new_jobs_cat', $tags); + $notification_handler->triggerEvent('company_listing', $comp_id, 'new_jobs_comp', $tags); + $notification_handler->triggerEvent ('job_listing', $lid, 'new_job', $tags ); } - - redirect_header("index.php",3,_JOBS_JOBADDED); - exit(); -} else { + } else { + $xoopsOption['template_main'] = 'jobs_addlisting.html'; include XOOPS_ROOT_PATH."/header.php"; + include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; - include_once (XOOPS_ROOT_PATH."/class/xoopstree.php"); - $mytree = new XoopsTree($xoopsDB->prefix("jobs_categories"),"cid","pid"); - $member_usid = $xoopsUser->getVar("uid", "E"); + if (isset($_POST["cid"])) { + $cid = intval($_POST["cid"]); + } else if (isset($_GET["cid"])) { + $cid = intval($_GET["cid"]); + } else { + $cid = 0; + } + + $member_usid = $xoopsUser->uid(); $member_email =$xoopsUser->getVar("email", "E"); $member_uname =$xoopsUser->getVar("uname", "E"); - $count = getCompCount($member_usid); - $thiscompany = getCompany($member_usid); $email = $member_email; + $temp_premium = "0"; + if (empty($comp_id)) { + $thiscompany = jobs_getCompany($member_usid); + } else { + $extra_user = jobs_getXtraUsers($comp_id, $member_usid); + if (!empty($extra_user)) { + $temp_premium = "1"; + } + + $thiscompany = jobs_getThisCompany($comp_id, $member_usid); + } + $result = $xoopsDB->query("select nom_type from ".$xoopsDB->prefix("jobs_type")." order by nom_type"); $result1 = $xoopsDB->query("select nom_price from ".$xoopsDB->prefix("jobs_price")." order by id_price"); + $result2 = $xoopsDB->query("select rid,name from ".$xoopsDB->prefix("jobs_region")." order by rid"); ob_start(); - $form = new XoopsThemeForm(_JOBS_ADD_LISTING, 'submitform', 'addlisting.php'); + $form = new XoopsThemeForm(_JOBS_ADD_LISTING, 'submit_form', 'addlisting.php'); $form->setExtra('enctype="multipart/form-data"'); - $GLOBALS['xoopsGTicket']->addTicketXoopsFormElement( $form , __LINE__ , 1800 , 'token' ) ; - if ($premium == 1) { + if (($premium == "1") || ($temp_premium == "1")) { echo ""._JOBS_PREMIUM_MEMBER." ". $xoopsModuleConfig['jobs_days']." "._JOBS_PREMIUM2.""; } else { echo ""; } - $form->addElement(new XoopsFormText(_JOBS_SUBMITTER, 'submitter', 50,50, $member_uname), true); - if ($xoopsModuleConfig['jobs_show_company'] == '1') { - if ($count = 0) { - $form->addElement(new XoopsFormText(_JOBS_COMPANY, "company", 40, 50, ""), true); - } - if ($count = 1) { - $form->addElement(new XoopsFormText(_JOBS_COMPANY, "company", 40, 50, $thiscompany["comp_name"]), true); - } - if ($count > 1) { - $form->addElement(new XoopsFormText(_JOBS_COMPANY, "company", 40, 50, ""), true); - } - + + $form->addElement(new XoopsFormLabel(_JOBS_SUBMITTER, $member_uname)); + $form->addElement(new XoopsFormHidden('submitter', $member_uname)); + + if ($xoopsModuleConfig['jobs_show_company'] == '1') { + $form->addElement(new XoopsFormLabel(_JOBS_COMPANY, $thiscompany["comp_name"])); + $form->addElement(new XoopsFormHidden('company', $thiscompany["comp_name"])); } + $form->addElement(new XoopsFormText(_JOBS_EMAIL, 'email', 50,100, $email), true); + $form->addElement(new XoopsFormText(_JOBS_TOWN, 'town', 50,50, $thiscompany["comp_city"]), false); - $form->addElement(new XoopsFormText(_JOBS_TOWN, 'town', 50,50, $thiscompany["comp_city"]), false); - $form->addElement(new XoopsFormText(_JOBS_STATE, 'state', 50,50, $thiscompany["comp_state"]), false); + if ($xoopsModuleConfig['jobs_show_state'] == '1') { + $state_form= new XoopsFormSelect(_JOBS_STATE, "state", $thiscompany["comp_state"], "0", false); + while (list($rid,$name) = $xoopsDB->fetchRow($result2) ) { + $state_form->addOption('',_JOBS_SELECT_STATE); + $state_form->addOption($rid, $name); + } + $form->addElement($state_form,true); + } + $form->addElement(new XoopsFormText(_JOBS_TEL, "tel", 30, 30, $thiscompany["comp_phone"]), false); - ob_start(); - $mytree->makeMySelBox("title", "title",$cid,"cid"); - $form->addElement(new XoopsFormLabel(_JOBS_CAT, ob_get_contents())); - ob_end_clean(); + $cat_form = (new XoopsFormSelect(_JOBS_CAT , 'cid','')); + $cattree = $mytree->getChildTreeArray(0,"title ASC"); + $cat_form->addOption('',_JOBS_SELECTCAT); + foreach ($cattree as $branch ) { + $branch['prefix'] = substr($branch['prefix'], 0, -1); + $branch['prefix'] = str_replace(".","--",$branch['prefix']); + $cat_form->addOption($branch['cid'],$branch['prefix'].$branch['title']); + } + $form->addElement($cat_form,true); -if ($premium == 1) { + if (($premium == "1") || ($temp_premium == "1")) { - $form->addElement(new XoopsFormText(_JOBS_HOW_LONG, "expire", 3, 3, $xoopsModuleConfig['jobs_days']), true); + $form->addElement(new XoopsFormText(_JOBS_HOW_LONG, "expire", 3, 3, $xoopsModuleConfig['jobs_days']), true); - } else { - $form->addElement(new XoopsFormLabel(_JOBS_NON_HOW_LONG, $xoopsModuleConfig['jobs_days'])); - $form->addElement(new XoopsFormHidden('expire', $xoopsModuleConfig['jobs_days'])); - } + } else { + $form->addElement(new XoopsFormLabel(_JOBS_NON_HOW_LONG, $xoopsModuleConfig['jobs_days'])); + $form->addElement(new XoopsFormHidden('expire', $xoopsModuleConfig['jobs_days'])); + } - $type_form= new XoopsFormSelect(_JOBS_JOB_TYPE, "type", "", "1", false); - while (list($nom_type) = $xoopsDB->fetchRow($result) ) { - $type_form->addOption($nom_type, $nom_type); - } - $form->addElement($type_form); + $type_form= new XoopsFormSelect(_JOBS_JOB_TYPE, "type", "", "0", false); + while (list($nom_type) = $xoopsDB->fetchRow($result) ) { + $type_form->addOption($nom_type, $nom_type); + } + $form->addElement($type_form); -if ($premium == "1") { + if (($premium == "1") || ($temp_premium == "1")) { $radio = new XoopsFormRadio(_JOBS_STATUS, 'status', ""); $options["0"]=_JOBS_ACTIVE; $options["1"]=_JOBS_INACTIVE; $radio->addOptionArray($options); $form->addElement($radio,true); + } else { + $form->addElement(new XoopsFormHidden('status', "0")); } + $form->addElement(new XoopsFormText(_JOBS_TITLE, "title", 40, 50, ""), true); + $form->addElement(jobs_getEditor(_JOBS_DESC, "desctext", "", "100%", "300px",""), true); + $form->addElement(jobs_getEditor(_JOBS_REQUIRE, "requirements", "", "100%", "300px",""), true); + $form->addElement(new XoopsFormText(_JOBS_PRICE2, "price", 40, 50, ""), false); + $sel_form= new XoopsFormSelect(_JOBS_SALARYTYPE, "typeprice", "", "1", false); + while (list($nom_price) = $xoopsDB->fetchRow($result1)) { + $sel_form->addOption($nom_price, $nom_price); + } + $form->addElement($sel_form); - $form->addElement(new XoopsFormText(_JOBS_TITLE, "title", 40, 50, ""), true); + $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO, "contactinfo", "".$myts->undoHtmlSpecialChars($myts->displayTarea($thiscompany["comp_contact"],0,0,0,0,0))."", 6, 40), true); - $form->addElement(getEditor(_JOBS_DESC, "desctext", "", 5, 40), true); - $form->addElement(new XoopsFormTextArea(_JOBS_REQUIRE, "requirements", "", 6, 40), false); - - $form->addElement(new XoopsFormText(_JOBS_PRICE2, "price", 40, 50, ""), false); - - $sel_form= new XoopsFormSelect(_JOBS_SALARYTYPE, "typeprice", "", "1", false); - while (list($nom_price) = $xoopsDB->fetchRow($result1)) { - $sel_form->addOption($nom_price, $nom_price); - } - $form->addElement($sel_form); - - $form->addElement(new XoopsFormText(_JOBS_EMAIL, 'email', 50,100, $email), true); - - $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO, 'contactinfo', "".$thiscompany["comp_contact"]."", 6, 40), false); - + if (($premium == "1") || ($temp_premium == "1")) { if ($thiscompany["comp_user1_contact"]) { - $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO, 'contactinfo', "".$thiscompany["comp_user1_contact"]."", 6, 40), false); + $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO1, "contactinfo1", "".$thiscompany["comp_user1_contact"]."", 6, 40), false); + } else { + $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO1, "contactinfo1", "", 6, 40), false); } if ($thiscompany["comp_user2_contact"]) { - $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO, 'contactinfo', "".$thiscompany["comp_user2_contact"]."", 6, 40), false); + $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO2, "contactinfo2", "".$thiscompany["comp_user2_contact"]."", 6, 40), false); + } else { + $form->addElement(new XoopsFormTextArea(_JOBS_CONTACTINFO2, "contactinfo2", "", 6, 40), false); } - + } else { + $form->addElement(new XoopsFormHidden('contactinfo1', "")); + $form->addElement(new XoopsFormHidden('contactinfo2', "")); + } +// if ($xoopsModuleConfig['jobs_use_captcha'] == '1') { +// $form->addElement(new XoopsFormCaptcha(_JOBS_CAPTCHA, "xoopscaptcha", false), true); +// } if ($xoopsModuleConfig['jobs_moderated'] == 0) { - $form->addElement(new XoopsFormHidden("valid", "Yes"), false); + $form->addElement(new XoopsFormHidden("valid", "Yes"), false); } else { - $form->addElement(new XoopsFormHidden("valid", "No"), false); + $form->addElement(new XoopsFormHidden("valid", "No"), false); } + $form->addElement(new XoopsFormHidden("comp_id", $thiscompany["comp_id"]), false); + $form->addElement(new XoopsFormButton('', 'submit', _JOBS_SUBMIT, 'submit')); + $form->display(); + $xoopsTpl->assign('submit_form', ob_get_contents()); + ob_end_clean(); + $xoopsTpl->assign('lang_comp_city', _JOBS_COMPANY_CITY); + } + include XOOPS_ROOT_PATH.'/footer.php'; - $form->addElement(new XoopsFormButton('', 'submit', _JOBS_SUBMIT, 'submit')); - $form->display(); - $xoopsTpl->assign('submit_form', ob_get_contents()); - ob_end_clean(); - - $xoopsTpl->assign('lang_comp_city', _JOBS_COMPANY_CITY); - - include XOOPS_ROOT_PATH.'/footer.php'; -} ?> \ No newline at end of file Modified: XoopsModules/jobs/trunk/jobs/addresume.php =================================================================== --- XoopsModules/jobs/trunk/jobs/addresume.php 2012-10-08 16:57:16 UTC (rev 10202) +++ XoopsModules/jobs/trunk/jobs/addresume.php 2012-10-08 17:01:42 UTC (rev 10203) @@ -1,24 +1,18 @@ <?php // ----------------------------------------------------------------------- // -// Jobs for Xoops 2.0x // -// By John Mordo from the myAds 2.04 Module // -// All Original credits left below this // -// // -// // -// // - // +// Jobs Module for Xoops // +// John Mordo - jlm69 at Xoops // +// Licence Type : GPL // // ------------------------------------------------------------------------- // -// E-Xoops: Content Management for the Masses // -// < http://www.e-xoops.com > // -// ------------------------------------------------------------------------- // -// Original Author: Pascal Le Boustouller -// Author Website : pas...@pe... -// Licence Type : GPL -// ------------------------------------------------------------------------- // + include("header.php"); $mydirname = basename( dirname( __FILE__ ) ) ; require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ; +include_once (XOOPS_ROOT_PATH."/modules/$mydirname/include/resume_functions.php"); +include_once XOOPS_ROOT_PATH."/modules/$mydirname/class/restree.php"; + $myts =& MyTextSanitizer::getInstance(); + $module_id = $xoopsModule->getVar('mid'); if (is_object($xoopsUser)) { $groups = $xoopsUser->getGroups(); @@ -33,208 +27,77 @@ } //If no access if (!$gperm_handler->checkRight("resume_submit", $perm_itemid, $groups, $module_id)) { - redirect_header(XOOPS_URL."/user.php", 3, _NOPERM); + redirect_header(XOOPS_URL."/modules/$mydirname/resumes.php", 3, _NOPERM); exit(); } -//Check if user already has a resume submitted // -function resumeexists($usid) -{ - global $xoopsDB, $xoopsConfig, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $mydirname; + if (isset($_POST["cid"])) { + $cid = intval($_POST["cid"]); + } else if (isset($_GET["cid"])) { + $cid = intval($_GET["cid"]); + } - $member_id =$xoopsUser->getVar("uid", "E"); + $member_usid = $xoopsUser->getVar("uid", "E"); - $result=$xoopsDB->query("select lid, cid, usid FROM ".$xoopsDB->prefix("jobs_resume")." WHERE usid = ".mysql_real_escape_string($member_id).""); - $recordexist = $xoopsDB->getRowsNum($result); + if (!empty($_POST['submit']) ) { - if ($recordexist) { - list($lid, $cid, $usid)=$xoopsDB->fetchRow($result); - redirect_header("index2.php?pa=viewResume&lid=".addslashes($lid)."", 5, _JOBS_RES_EXISTS); - exit(); - }else{ -addresume($cid); -} -} - -function addresume($cid) -{ - global $xoopsDB, $xoopsConfig, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsModuleConfig, $mydirname; - -$member_id =$xoopsUser->getVar("uid", "E"); -//$token = $GLOBALS['xoopsSecurity']->createToken(); -include_once (XOOPS_ROOT_PATH."/modules/$mydirname/include/functions.php"); -include_once (XOOPS_ROOT_PATH."/class/xoopstree.php"); -$mytree = new XoopsTree($xoopsDB->prefix("jobs_res_categories"),"cid","pid"); - - $resdays=$xoopsModuleConfig['jobs_res_days']; - $resumesize=$xoopsModuleConfig['jobs_resumesize']; - $resumesize1=$xoopsModuleConfig['jobs_resumesize']/1024; - $photomax=$xoopsModuleConfig['jobs_maxfilesize']; - $photomax1=$xoopsModuleConfig['jobs_maxfilesize']/1024; - - echo "<script type=\"text/javascript\"> - function verify() { - var msg = \""._JOBS_VALIDERORMSG."\\n__________________________________________________\\n\\n\"; - var errors = \"FALSE\"; - - if (document.add.type.value == \"0\") { - errors = \"TRUE\"; - msg += \""._JOBS_VALIDTYPE."\\n\"; - } - if (document.add.cid.value == \"\") { - errors = \"TRUE\"; - msg += \""._JOBS_VALIDCAT."\\n\"; - } - - if (document.add.title.value == \"\") { - errors = \"TRUE\"; - msg += \""._JOBS_VALIDTITLE."\\n\"; - } - if (document.add.submitter.value == \"\") { - errors = \"TRUE\"; - msg += \""._JOBS_VALIDSUBMITTER."\\n\"; - } - - if (document.add.email.value == \"\") { - errors = \"TRUE\"; - msg += \""._JOBS_VALIDEMAIL."\\n\"; - } - if (errors == \"TRUE\") { - msg += \"__________________________________________________\\n\\n"._JOBS_VALIDMSG."\\n\"; - alert(msg); - return false; - } - } - </script>"; - - list($numrows) = $xoopsDB->fetchRow($xoopsDB->query("select cid, title, affprice from ".$xoopsDB->prefix("jobs_res_categories")."")); - - if ($numrows>0) { - //OpenTable(); - echo "<table width='100%' border='0' cellspacing='1' cellpadding='8'><tr class='bg4'><td valign='top'>\n"; - if ($xoopsModuleConfig['jobs_moderate_resume'] == '1') { - echo "<b>"._JOBS_RES_ADDLISTING3."</b><br /><br /><center>"._JOBS_RES_JOBMODERATE." $resdays <br />"._JOBS_RES_MODERATE2."</center><br /><br />"; - } else { - echo "<b>"._JOBS_RES_ADDL... [truncated message content] |
From: <be...@us...> - 2012-10-08 16:57:17
|
Revision: 10202 http://sourceforge.net/p/xoops/svn/10202 Author: beckmi Date: 2012-10-08 16:57:16 +0000 (Mon, 08 Oct 2012) Log Message: ----------- Placing 3.0RC3 into releases Added Paths: ----------- XoopsModules/jobs/releases/3.0RC3/jobs/ |
From: <be...@us...> - 2012-10-08 16:53:40
|
Revision: 10201 http://sourceforge.net/p/xoops/svn/10201 Author: beckmi Date: 2012-10-08 16:53:38 +0000 (Mon, 08 Oct 2012) Log Message: ----------- Adding folders Added Paths: ----------- XoopsModules/jobs/branches/mamba/ XoopsModules/jobs/releases/3.0RC3/ XoopsModules/jobs/releases/4.3 RC2/ XoopsModules/jobs/trunk/htdocs/ |