91
wishcraft
@required::- Complete support of xoops_version.php module info in about dialogue!

While putting together the planning set for please I went back through all the modules on the shelf to see what where the commonality headers and array elements that needed to be supported in the help "about module" system menu which is way limited at the moment.

If you turn your attention to:https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/please/trunk/xoops_version.php ~~ you will find the following need to be included and formatted into the dialogue system menu..

$modversion['dirname']                     = _MI_PLEASE_MODULE_DIRNAME;
$modversion['name']                     = _MI_PLEASE_MODULE_NAME;
$modversion['version']                     = _MI_PLEASE_MODULE_VERSION;
$modversion['releasedate']                 = _MI_PLEASE_MODULE_RELEASEDATE;
$modversion['status']                      = _MI_PLEASE_MODULE_STATUS;
$modversion['description']                 = _MI_PLEASE_MODULE_DESCRIPTION;
$modversion['credits']                     = _MI_PLEASE_MODULE_CREDITS;
$modversion['author']                      = _MI_PLEASE_MODULE_AUTHORALIAS;
$modversion['help']                        = _MI_PLEASE_MODULE_HELP;
$modversion['license']                     = _MI_PLEASE_MODULE_LICENCE;
$modversion['official']                    = _MI_PLEASE_MODULE_OFFICAL;
$modversion['image']                       = _MI_PLEASE_MODULE_ICON;
$modversion['module_status']             = _MI_PLEASE_MODULE_STATUS;
$modversion['website']                     = _MI_PLEASE_MODULE_WEBSITE;
$modversion['dirmoduleadmin']             = _MI_PLEASE_MODULE_ADMINMODDIR;
$modversion['icons16']                     = _MI_PLEASE_MODULE_ADMINICON16;
$modversion['icons32']                     = _MI_PLEASE_MODULE_ADMINICON32;
$modversion['release_info']             = _MI_PLEASE_MODULE_RELEASEINFO;
$modversion['release_file']             = _MI_PLEASE_MODULE_RELEASEFILE;
$modversion['release_date']             = _MI_PLEASE_MODULE_RELEASEDATE;
$modversion['author_realname']             = _MI_PLEASE_MODULE_AUTHORREALNAME;
$modversion['author_website_url']         = _MI_PLEASE_MODULE_AUTHORWEBSITE;
$modversion['author_website_name']         = _MI_PLEASE_MODULE_AUTHORSITENAME;
$modversion['author_email']             = _MI_PLEASE_MODULE_AUTHOREMAIL;
$modversion['author_word']                 = _MI_PLEASE_MODULE_AUTHORWORD;
$modversion['status_version']             = _MI_PLEASE_MODULE_VERSION;
$modversion['warning']                     = _MI_PLEASE_MODULE_WARNINGS;
$modversion['demo_site_url']             = _MI_PLEASE_MODULE_DEMO_SITEURL;
$modversion['demo_site_name']             = _MI_PLEASE_MODULE_DEMO_SITENAME;
$modversion['support_site_url']         = _MI_PLEASE_MODULE_SUPPORT_SITEURL;
$modversion['support_site_name']         = _MI_PLEASE_MODULE_SUPPORT_SITENAME;
$modversion['submit_feature']             = _MI_PLEASE_MODULE_SUPPORT_FEATUREREQUEST;
$modversion['submit_bug']                 = _MI_PLEASE_MODULE_SUPPORT_BUGREPORTING;
$modversion['people']['developers']     = explode("|"_MI_PLEASE_MODULE_DEVELOPERS);
$modversion['people']['testers']        = explode("|"_MI_PLEASE_MODULE_TESTERS);
$modversion['people']['translaters']    = explode("|"_MI_PLEASE_MODULE_TRANSLATERS);
$modversion['people']['documenters']    = explode("|"_MI_PLEASE_MODULE_DOCUMENTERS);

// Requirements
$modversion['min_php']                    = '5.3.7';
$modversion['min_xoops']                  = '2.5.7';
$modversion['min_db']                     = array('mysql' => '5.0.7''mysqli' => '5.0.7');
$modversion['min_admin']                  = '1.1';


*geekwrite == you know that should be geekscribe -- you scribe code not write, anyway in XOOPS and ++sf you can have in the bridge between alpha too beta a total of ten releases like for example 7 alpha and 3 beta or 6 alpha and four beta's and so on, we are in no hurry i suggest you put these in so I can not have to in 2.7 -- offering future versioning write-back!

btw... there is over 5000 documenting errors for the industry standard phpDocumentor -- when your done in the alpha let me know and add me to the git and I will with you go through and fix them all so there 0 errors in the function documentations -- they need to be extensive!!



92
wishcraft
Xoops Module ~ Please ~ Email Ticket's with Keyword(s) Grouping Supportives

Hi how are you all? I thought I would talk about the new module I am working on called: please (SVN). It is going to be an email ticketer a bit like Request Tracker but supporting attachments as well as HTML content etc.

It going to work by polling via eith a class lib or extensions, IMAP or POP3, as well as having other options I am yet to decide if they will be in the first version..

It is also going to have support for MantisBT.org so your departmental staff can raise to a support level two through mantis off the XOOPS portal..

The database concept looks like:-

CREATE TABLE `please_addresses` (
  `
idint(14NOT NULL,
  `
addressvarchar(198) DEFAULT '',
  `
uidint(11) DEFAULT '0',
  `
recievedint(12) DEFAULT '0',
  `
sentint(12) DEFAULT '0',
  `
ticketsint(12) DEFAULT '0',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  `
actionint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`address`(18),`uid`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_bcc` (
  `
idmediumint(30NOT NULL,
  `
ticket-idmediumint(30) DEFAULT '0',
  `
address-idint(14) DEFAULT '0',
  `
name-idint(14) DEFAULT '0',
  `
email-idmediumint(30) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`address-id`,`name-id`,`email-id`,`ticket-id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_cc` (
  `
idmediumint(30NOT NULL,
  `
ticket-idmediumint(30) DEFAULT '0',
  `
address-idint(14) DEFAULT '0',
  `
name-idint(14) DEFAULT '0',
  `
email-idmediumint(30) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`address-id`,`name-id`,`email-id`,`ticket-id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_contents` (
  `
idmediumint(30NOT NULL,
  `
keyvarchar(44) DEFAULT '',
  `
textlongtext,
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`key`(20))
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_correspondences` (
  `
idmediumint(38NOT NULL,
  `
methodenum('email','pm','staff','mantis','unknown') DEFAULT 'unknown',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
department-idmediumint(6) DEFAULT '0',
  `
staff-idmediumint(18) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  `
sentint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_correspondences_bcc` (
  `
idmediumint(38NOT NULL,
  `
bcc-idmediumint(30) DEFAULT '0',
  `
department-idmediumint(6) DEFAULT '0',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
staff-idmediumint(18) DEFAULT '0',
  `
sentint(12) DEFAULT '0',
  `
viewedint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_correspondences_cc` (
  `
idmediumint(38NOT NULL,
  `
cc-idmediumint(30) DEFAULT '0',
  `
department-idmediumint(6) DEFAULT '0',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
staff-idmediumint(18) DEFAULT '0',
  `
sentint(12) DEFAULT '0',
  `
viewedint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_correspondences_contents` (
  `
idmediumint(38NOT NULL,
  `
correspondence-idmediumint(38) DEFAULT '0',
  `
ticket-contents-idmediumint(30) DEFAULT '0',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
staff-idmediumint(18) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  `
sentint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_correspondences_relayed` (
  `
idmediumint(38NOT NULL,
  `
relayed-idmediumint(30) DEFAULT '0',
  `
department-idmediumint(6) DEFAULT '0',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
staff-idmediumint(18) DEFAULT '0',
  `
sentint(12) DEFAULT '0',
  `
viewedint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_correspondences_to` (
  `
idmediumint(38NOT NULL,
  `
to-idmediumint(30) DEFAULT '0',
  `
department-idmediumint(6) DEFAULT '0',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
staff-idmediumint(18) DEFAULT '0',
  `
sentint(12) DEFAULT '0',
  `
viewedint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_departments` (
  `
idint(6NOT NULL,
  `
codevarchar(3) DEFAULT 'ABC',
  `
namevarchar(128) DEFAULT '',
  `
descriptiontinytext,
  `
mantis-usernamevarchar(45) DEFAULT '',
  `
mantis-passwordvarchar(198) DEFAULT '',
  `
mantis-project-idint(11) DEFAULT '0',
  `
manager-uidint(11) DEFAULT '0',
  `
manager-bccenum('all-email','closed-email','all-pm','closed-pm','none') DEFAULT 'none',
  `
manager-mantis-usernamevarchar(45) DEFAULT '',
  `
manager-mantis-passwordvarchar(198) DEFAULT '',
  `
mantisenum('yes','no') DEFAULT 'no',
  `
gidint(8) DEFAULT '0',
  `
ticketsint(12) DEFAULT '0',
  `
staffint(12) DEFAULT '0',
  `
clientsint(12) DEFAULT '0',
  `
raisedint(12) DEFAULT '0',
  `
latest-idmediumint(30) DEFAULT '0',
  `
closed-idmediumint(30) DEFAULT '0',
  `
signaturevarchar(300) DEFAULT '',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_departments_keywords` (
  `
idint(18NOT NULL,
  `
department-idint(6) DEFAULT '0',
  `
keyword-idint(20NOT NULL,
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`keyword-id`,`department-id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_departments_mantis_projects` (
  `
idint(6NOT NULL,
  `
project-idint(12) DEFAULT '0',
  `
project-namevarchar(128) DEFAULT '',
  `
project-descriptiontinytext,
  `
ticketsint(12) DEFAULT '0',
  `
clientsint(12) DEFAULT '0',
  `
raisedint(12) DEFAULT '0',
  `
latest-mantis-idmediumint(30) DEFAULT '0',
  `
closed-mantis-idmediumint(30) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_departments_staff` (
  `
idint(18NOT NULL,
  `
department-idint(6) DEFAULT '0',
  `
stateenum('active','inactive','holidays') DEFAULT 'active',
  `
messagingenum('email','pm','none') DEFAULT 'email',
  `
uidint(12) DEFAULT '0',
  `
openint(12) DEFAULT '0',
  `
ticketsint(12) DEFAULT '0',
  `
closedint(12) DEFAULT '0',
  `
clientsint(12) DEFAULT '0',
  `
raisedint(12) DEFAULT '0',
  `
votesint(12) DEFAULT '0',
  `
ratingint(12) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  `
mantis-usernamevarchar(45) DEFAULT '',
  `
mantis-passwordvarchar(198) DEFAULT '',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`department-id`,`state`,`uid`,`open`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_departments_staff_keywords` (
  `
idint(18NOT NULL,
  `
department-idint(6) DEFAULT '0',
  `
staff-idint(18NOT NULL,
  `
keyword-idint(20NOT NULL,
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`keyword-id`,`staff-id`,`department-id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_departments_staff_mantis_tickets` (
  `
idint(6NOT NULL,
  `
ticket-idint(12) DEFAULT '0',
  `
ticket-subject-idmediumint(30) DEFAULT '0',
  `
follow-upint(12) DEFAULT '0',
  `
closedint(12) DEFAULT '0',
  `
raisedint(12) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_emails` (
  `
idmediumint(30NOT NULL,
  `
from-idint(14) DEFAULT '0',
  `
subject-idmediumint(30) DEFAULT '0',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
content-keyvarchar(44) DEFAULT '',
  `
attachmentsint(6) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`content-key`(20),`from-id`,`subject-id`,`ticket-id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_keywords` (
  `
idmediumint(20NOT NULL,
  `
stateenum('actionable','historical') DEFAULT 'actionable',
  `
keywordvarchar(64) DEFAULT '',
  `
occurencesmediumint(30) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`keyword`(43),`state`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_messages` (
  `
idmediumint(30NOT NULL,
  `
email-idmediumint(30) DEFAULT '0',
  `
subject-idmediumint(30) DEFAULT '0',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
message-idvarchar(64) DEFAULT '',
  `
from-idmediumint(30) DEFAULT '0',
  `
whenint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`email-id`,`subject-id`,`ticket-id`,`message-id`(32))
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_names` (
  `
idint(14NOT NULL,
  `
namevarchar(198) DEFAULT '',
  `
uidint(11) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`name`(18),`uid`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_relayed` (
  `
idmediumint(30NOT NULL,
  `
ticket-idmediumint(30) DEFAULT '0',
  `
staff-idint(18) DEFAULT '0',
  `
department-idint(6) DEFAULT '0',
  `
mantis-node-keyvarchar(44) DEFAULT '',
  `
mantis-ticket-idint(14) DEFAULT '0',
  `
mantis-project-idint(14) DEFAULT '0',
  `
mantis-assigned-tovarchar(64) DEFAULT '',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`ticket-id`,`staff-id`,`department-id`,`mantis-node-key`(16),`mantis-ticket-id`,`mantis-project-id`,`mantis-assigned-to`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_subjects` (
  `
idmediumint(30NOT NULL,
  `
subjectvarchar(300) DEFAULT '',
  `
email-idint(30) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`subject`(30),`email-id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_tickets` (
  `
idmediumint(30NOT NULL,
  `
stateenum('new','waiting','resonded','mantis','ignored','spam','allocated','claimed') DEFAULT 'new',
  `
ticket-keyvarchar(20) DEFAULT 'XXX-00000001AA',
  `
subject-idmediumint(30) DEFAULT '0',
  `
from-idint(14) DEFAULT '0',
  `
from-uidint(11) DEFAULT '0',
  `
belong-uidint(11) DEFAULT '0',
  `
belong-gidint(11) DEFAULT '0',
  `
tagsvarchar(255) DEFAULT NULL,
  `
createdint(12) DEFAULT '0',
  `
respondedint(12) DEFAULT '0',
  `
sentint(12) DEFAULT '0',
  `
closedint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`ticket-key`(15),`state`,`subject-id`,`belong-uid`,`belong-gid`,`from-id`,`from-uid`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_tickets_attachments` (
  `
idmediumint(30NOT NULL,
  `
stateenum('from','sent','mantis') DEFAULT 'from',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
ticket-contents-idmediumint(30) DEFAULT '0',
  `
file-keyvarchar(44) DEFAULT '',
  `
file-namevarchar(255) DEFAULT '',
  `
file-pathvarchar(255) DEFAULT '',
  `
bytesint(11) DEFAULT '0',
  `
whenint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`ticket-id`,`ticket-contents-id`,`file-key`(19),`state`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_tickets_contents` (
  `
idmediumint(30NOT NULL,
  `
stateenum('from','sent','mantis') DEFAULT 'from',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
content-keyvarchar(44) DEFAULT '',
  `
by-idint(11) DEFAULT '0',
  `
by-uidint(11) DEFAULT '0',
  `
whenint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`ticket-id`,`content-key`(24),`state`,`by-id`,`by-uid`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_tickets_ownership` (
  `
idmediumint(30NOT NULL,
  `
stateenum('new','waiting','resonded','mantis','ignored','spam','allocated','claimed') DEFAULT 'new',
  `
ticket-idmediumint(30) DEFAULT '0',
  `
staff-idint(18) DEFAULT '0',
  `
department-idint(6) DEFAULT '0',
  `
whenint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`ticket-id`,`state`,`staff-id`,`department-id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `please_to` (
  `
idmediumint(30NOT NULL,
  `
ticket-idmediumint(30) DEFAULT '0',
  `
address-idint(14) DEFAULT '0',
  `
name-idint(14) DEFAULT '0',
  `
email-idmediumint(30) DEFAULT '0',
  `
createdint(12) DEFAULT '0',
  
PRIMARY KEY (`id`),
  
KEY `SEARCH` (`address-id`,`name-id`,`email-id`,`ticket-id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8;


Which will change before the final first release.. I am looking for volunteers for the translation of the language files as well if your around bleekk (who did all the mail templated in XPayment) or someone to write some mail templates and give a hand with the other templates, you will be dually noted in the code stamp...

Just get in contact with me through the email address on here or my listed skype account, you can see here when logged in!



93
wishcraft
@request -- User Signup Basic Sentry -- Avatar, Rego Date & Posts

The following is the basic outline for a sentry on signup to drop maligant signup bots form threading:-

The first file is the sentry preloader in system

<?php
/**
 * System Preloads
 *
 * 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)
 * @author      Simon Roberts (AKA +61252661492)
 * @version     $Id: sentry.php 
 */

defined('XOOPS_ROOT_PATH') or die('Restricted access');

class 
SystemSentryPreload extends XoopsPreloadItem
{
    function 
eventCoreIncludeCommonEnd($args)
    {
                if (!
$GLOBALS['xoopsUserConfig']['sentry_enabled'])
                          return 
false;
        
$criteriaAvarta = new Criteria('user_avatar''%blank.gif%''LIKE');
        
$criteriaNewReg = new CriteriaCompo(new Criteria('user_regdate'time() - (24 3600 $GLOBALS['xoopsUserConfig']['sentry_regodays']), '<'));
        
$criteriaNewReg->add(new Criteria('last_login'time() - (24 3600 $GLOBALS['xoopsUserConfig']['sentry_loindays']), "<"), 'AND');
        
$criteriaNewReg->add(new Criteria('posts'$GLOBALS['xoopsUserConfig']['sentry_posts'], "<"), 'AND');
        
$criteria = new CriteriaCompo($criteriaAvarta);
        
$criteria->add($criteriaNewReg"AND");
        
$member_handler xoops_gethandler('member');
        
$tokill = array();
        foreach(
$member_handler->getUsers($criteriatrue) as $key => $user)
        {
            if (!
$user->isAdmin())
                
$tokill[$user->getVar("uid")] = $user;
        }
        if (
count($tokill))
        {
            
xoops_loadLanguage('user');
            
$xoopsMailer =& xoops_getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('sentrydropped.tpl');
            
$xoopsMailer->setSubject(sprintf("Your account on '%s' has been deleted by the sentry!"$GLOBALS['xoopsConfig']['sitename']));
            
$xoopsMailer->setToUsers($tokill);
            @
$xoopsMailer->send();
            
$sql = array();
            
$GLOBALS["xoopsDB"]->queryF($sql[] = "DELETE FROM `" $GLOBALS["xoopsDB"]->prefix('users') . "` WHERE `uid` IN(" implode(", "array_keys($tokill)) . ")");
            
$GLOBALS["xoopsDB"]->queryF($sql[] = "DELETE FROM `" $GLOBALS["xoopsDB"]->prefix('groups_users_link') . "` WHERE `uid` IN(" implode(", "array_keys($tokill)) . ")");

        }
      }
}
?>


You will have to create the following variable I suggest they are made as a single item drop down options list, variable from 2 weeks down to 3 days for the first avriable, then something that is from 24 month down to 1 month an then 2 - 20 items for the number of posts, you will see these variables that will have to be created specified in the function above with the $GLOBALS['xoopsUserConfig'] variable, these go in the User Preferences in the system module, default is this option is turned off.

You will also have to add a template to language/english/mail_template/sentrydropped.tpl, an example of this would be:-
To {X_UNAME},

Your account on "{SITENAME}" has been removed due to the User Sentry finding that you have
either not changed your avatar
, or you where in active without enough posts and also not
changing your avatar
!

- as 
you didn't change your 'avatar' from the blank default image; 
  with 7 - 14 days in consecutive selection, your account has been removed 
  off the systems' 
and terminated!!

Many thanks,

{
SITE_COMPANY}
{
SITE_URL}


You will probably also want to have a register_sentry.tpl like so which you will have to alter the class/??.php too enable this if the sentry is turn on, it will need the number of days passed to the emailer so it can be populated as ie. {X_SENTRYDAYS}.

Hello {X_UNAME},

Thank you for registering as a member of {SITENAME}. As a registered member your can:
Send private messages among members
Participate in discussion boards
Get the latest news
Submit content
Muchmuch more....

The email address ({X_UEMAIL}) has been used to create a user profile for you.

NOTICE:-

 - 
You will have to change your avatar within {X_SENTRYDAYSdays cause if you haven't somewhere 
   between these times you will be deleted if your avatar remains on the default blank
   as well as remain inactive for a period of 24 Months!

To become a member of {SITENAME}, please confirm your
request by clicking on the link below:

{X_UACTLINK}

-----------
Best Regards
{SITENAME}
({SITEURL}) 
{ADMINMAIL}



94
wishcraft
@request - cache files need to be reduces for cpanel machines

The Cache Files need to be reduced for the xoops_data folder, this is quite easy to do some example basic work around routines are included here to be worked into XoopsCache::read(), XoopsCache::write() & XoopsCache::delete().

XoopsCache::read() in class/cache/file.php
/**
     * Read a key from the cache
     *
     * @param  string $key Identifier for the data
     * @return mixed  The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
     * @access public
     */
    
function read($key)
    {
        
$fingerprint md5(implode('',array_reverse(explode("_",$key)));
        if (
$this->setKey(sha1(substr($fingerprint,0,2))) === false || ! $this->init) {
            return 
false;
        }
        if (
$this->settings['lock']) {
            
$this->file->lock true;
        }
        
$data $this->file->read(true);
        if (!empty(
$data) && !empty($this->settings['serialize'])) {
            
$data stripslashes($data);
            
$data preg_replace('!s:(d+):"(.*?)";!se'"'s:'.strlen('$2').':"$2";'"$data);
            
$data unserialize($data);
            if (
is_array($data)) {
                
XoopsLoad::load('XoopsUtility');
                
$data XoopsUtility::recursive('stripslashes'$data);
            }
        } else if (
$data && empty($this->settings['serialize'])) {
            
$data = eval($data);
        }
        
$unset false;
        foreach(
$data['keys'] as $kiy => $cachetime)
        {
            if (
$cachetime !== false && intval($cachetime) < time()) {
                unset(
$data['values'][$kiy]);
                unset(
$data['keys'][$kiy]);
                
$unset true;
            }
        }
        
$this->file->close();
        return !empty(
$data['values'][$key])?$data['values'][$key]:false;
    }


XoopsCache::write() in class/cache/file.php
/**
     * Write data for key into cache
     *
     * @param  string  $key      Identifier for the data
     * @param  mixed   $data     Data to be cached
     * @param  mixed   $duration How long to cache the data, in seconds
     * @return boolean True if the data was successfully cached, false on failure
     * @access public
     */
    
function write($key$values null$duration null)
    {
        if (!isset(
$data) || ! $this->init) {
            return 
false;
        }

        
$fingerprint md5(implode('',array_reverse(explode("_",$key)));
        if (
$this->setKey(sha1(substr($fingerprint,0,2))) === false || ! $this->init) {
            return 
false;
        }

        if (
$duration == null) {
            
$duration $this->settings['duration'];
        }
        
$data $this->file->read(true);
        if (!empty(
$data) && !empty($this->settings['serialize'])) {
            
$data stripslashes($data);
            
$data preg_replace('!s:(d+):"(.*?)";!se'"'s:'.strlen('$2').':"$2";'"$data);
            
$data unserialize($data);
            if (
is_array($data)) {
                
XoopsLoad::load('XoopsUtility');
                
$data XoopsUtility::recursive('stripslashes'$data);
            }
        } else if (
$data && empty($this->settings['serialize'])) {
            
$data = eval($data);
        }
        foreach(
$data['keys'] as $kiy => $cachetime)
        {
            if (
$cachetime !== false && intval($cachetime) < time()) {
                unset(
$data['values'][$kiy]);
                unset(
$data['keys'][$kiy]);
            }
        }
        
$data['keys'][$key] = $expires time() + $duration;
        
$data['values'][$key] = $values;
        
        
$windows false;
        
$lineBreak "n";

        if (
substr(PHP_OS03) == "WIN") {
            
$lineBreak "rn";
            
$windows true;
        }
        ;
        if (!empty(
$this->settings['serialize'])) {
            if (
$windows) {
                
$data str_replace('\''\\\\'serialize($data));
            } else {
                
$data serialize($data);
            }
            
$contents $data $lineBreak;
        } else {
            
$contents "return " var_export($datatrue) . ";" $lineBreak;
        }

        if (
$this->settings['lock']) {
            
$this->file->lock true;
        }
        
$success $this->file->write($contents);
        
$this->file->close();

        return 
$success;
    }


XoopsCache::delete() in class/cache/file.php
/**
     * Delete a key from the cache
     *
     * @param  string  $key Identifier for the data
     * @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed
     * @access public
     */
    
function delete($key)
    {
        
$fingerprint md5(implode('',array_reverse(explode("_",$key)));
        if (
$this->setKey(sha1(substr($fingerprint,0,2))) === false || ! $this->init) {
            return 
false;
        }
        if (
$this->settings['lock']) {
            
$this->file->lock true;
        }
        
$data $this->file->read(true);
        if (!empty(
$data) && !empty($this->settings['serialize'])) {
            
$data stripslashes($data);
            
$data preg_replace('!s:(d+):"(.*?)";!se'"'s:'.strlen('$2').':"$2";'"$data);
            
$data unserialize($data);
            if (
is_array($data)) {
                
XoopsLoad::load('XoopsUtility');
                
$data XoopsUtility::recursive('stripslashes'$data);
            }
        } else if (
$data && empty($this->settings['serialize'])) {
            
$data = eval($data);
        }
        
$unset false;
        foreach(
$data['keys'] as $kiy => $cachetime)
        {
            if (
$cachetime !== false && intval($cachetime) < time()) {
                unset(
$data['values'][$kiy]);
                unset(
$data['keys'][$kiy]);
                
$unset true;
            }
        }
        unset(
$data['values'][$key]);
        unset(
$data['keys'][$key]);
        
        
$windows false;
        
$lineBreak "n";

        if (
substr(PHP_OS03) == "WIN") {
            
$lineBreak "rn";
            
$windows true;
        }
        ;
        if (!empty(
$this->settings['serialize'])) {
            if (
$windows) {
                
$data str_replace('\''\\\\'serialize($data));
            } else {
                
$data serialize($data);
            }
            
$contents $data $lineBreak;
        } else {
            
$contents "return " var_export($datatrue) . ";" $lineBreak;
        }

        if (
$this->settings['lock']) {
            
$this->file->lock true;
        }
        
$success $this->file->write($contents);
        
$this->file->close();

        return 
true;
    }



95
wishcraft
Re: @required ::- Open all access pathways with NPN and HTML Headers (Additional Headers)

You can also us .htaccess lijje so:-

# Opens Access Origin Via networking Route NPN 
<IfModule mod_headers.c>
  
Header set Origin *
  
Header set Access-Control-Allow-Origin *
</
IfModule>



96
wishcraft
@upgrade::- Hooking Stratum Preloaders by Trabis and Myself need to be exploited!!

The hooking strata need's too be exploited further; this is similar to an event handler, exactly that what it is -- it is made with a cursor style entry.

Example in this call this is how you would change it in class/model/read.php.
/**
     * retrieve objects from the database
     *
     * For performance consideration, getAll() is recommended
     *
     * @param CriteriaElement|null $criteria {@link CriteriaElement} conditions to be met
     * @param bool $id_as_key use the ID as key for the array
     * @param bool $as_object return an array of objects?
     * @return array
     */
    
public function getObjects(CriteriaElement $criteria null$id_as_key false$as_object true)
    {
        
$objects $this->getAll($criterianull$as_object$id_as_key);
        
$xoopsPreload XoopsPreload::getInstance();
        return 
$xoopsPreload->triggerFunction('core.'.basename(dirname(__DIR__)).'.'.__CLASS__.'.'.__FUNCTION__$objects, array('criteria'=>$criteria));;
    }


Example in this call this is how you would change it in class/model/read.php.
/**
     * get all objects matching a condition
     *
     * @param CriteriaElement|null $criteria {@link CriteriaElement} to match
     * @param array $fields variables to fetch
     * @param bool $asObject flag indicating as object, otherwise as array
     * @param bool $id_as_key use the ID as key for the array
     * @return array of objects/array {@link XoopsObject}
     */
    
public function getAll(CriteriaElement $criteria null$fields null$asObject true$id_as_key true)
    {
        if (
is_array($fields) && count($fields) > 0) {
            if (!
in_array($this->handler->keyName$fields)) {
                
$fields[] = $this->handler->keyName;
            }
            
$select "`" implode("`, `"$fields) . "`";
        } else {
            
$select "*";
        }
        
$limit null;
        
$start null;
        
$sql "SELECT {$select} FROM `{$this->handler->table}`";
        if (isset(
$criteria)) {
            
$sql .= " " $criteria->renderWhere();
            if (
$groupby $criteria->getGroupby()) {
                
$sql .= ' GROUP BY (' $groupby ')';
            }
            if (
$sort $criteria->getSort()) {
                
$sql .= " ORDER BY {$sort} " $criteria->getOrder();
                
$orderSet true;
            } else if (
$order $criteria->getOrder()) {
                
$sql .= " ORDER BY {$this->handler->keyName} " $order;
                
$orderSet true;
            }
            
$limit $criteria->getLimit();
            
$start $criteria->getStart();
        }
        if (empty(
$orderSet)) {
            
//$sql .= " ORDER BY `{$this->handler->keyName}` DESC";
        
}
        
$result $this->handler->db->query($sql$limit$start);
        
$ret = array();
        if (
$asObject) {
            while (
$myrow $this->handler->db->fetchArray($result)) {
                
$object $this->handler->create(false);
                
$object->assignVars($myrow);
                if (
$id_as_key) {
                    
$ret[$myrow[$this->handler->keyName]] = $object;
                } else {
                    
$ret[] = $object;
                }
                unset(
$object);
            }
        } else {
            
$object $this->handler->create(false);
            while (
$myrow $this->handler->db->fetchArray($result)) {
                
$object->assignVars($myrow);
                if (
$id_as_key) {
                    
$ret[$myrow[$this->handler->keyName]] = $object->getValues();
                } else {
                    
$ret[] = $object->getValues();
                }
            }
            unset(
$object);
        }
        
$xoopsPreload XoopsPreload::getInstance();
        return 
$xoopsPreload->triggerFunction('core.'.basename(dirname(__DIR__)).'.'.__CLASS__.'.'.__FUNCTION__.'.'.$this->handler->table$objects, array('criteria'=>$criteria));
    }


The line that changed in this example between the two functions is, the part that has been added to include the child objects table name so it session more lower layer:-

// Added to the line in second example call :[.'.'.$this->handler->table]:
$xoopsPreload->triggerFunction('core.'.basename(dirname(__DIR__)).'.'.__CLASS__.'.'.__FUNCTION__.'.'.$this->handler->table$objects, array('criteria'=>$criteria));


The function triggerFunction will need to be created as well I am sure they might be some other type of preloaded apart from event... maybe you could make something as a handler class that set class sessioning.




97
wishcraft
@required ::- Open all access pathways with NPN and HTML Headers (Additional Headers)

I would like to bring your attention to the following code that need to be sent when buffering the output on XOOPS CMS:

/**
 * Opens Access Origin Via networking Route NPN
 */
header('Access-Control-Allow-Origin: *');
header('Origin: *');


This sent with the packet headers means it will route all predominant routes and session the route any way when needed. It is part of NPN - Plugin & Play Networks, and words on reverse direction with simaltype as this would be MAC Networks but in IP Routes!

An example of this in use would be found at: salty/apiconfig.php


You can also set it for example for access controlling:-
/**
 * Opens Access Origin Via networking Route NPN
 */
header('Access-Control-Allow-Origin: fonts.labs.coop, fonts.syd.labs.coop, fonts.api.hempembassy.net,fonts.ringwould.com.au');
header('Access-Control-Disallow-Origin: localhost,127.0.0.1');
header('Origin: *');


These three net to be set in General preferences as a textarea with default *, except for Access-Control-Disallow-Origin needs to be localhost,127.0.0.1

*geekw::- It would be really good in 2.6 if the functions and class calls; all had preloader external so on return in them it runs that value threw:- $GLOBALS['xoopsPreloads']->etc...

This would make all facits of the portal accessible for minor changes and forcing as well as adding stuff!!




98
wishcraft
Re: @fixed::- xoops_getBaseDomain() -- required for multitiered cookies!

This is the finite improved version for this function the following are required:-

data/stratas.diz
http://strata.api.hempembassy.net
https://strata.ringwould.com.au
http://strata.labs.coop


The following constant is required:
define("API_FILE_IO_STRATA"__DIR__ DIRECTORY_SEPARATOR 'data' DIRECTORY_SEPARATOR 'stratas.diz');


The following is the functions for XOOPS
if (!function_exists("getURIData")) {

    
/* function getURIData()
     *
    *     Get a supporting domain system for the API
    * @author         Simon Roberts (Chronolabs) simon@labs.coop
    *
    * @return         float()
    */
    
function getURIData($uri ''$timeout 25$connectout 25)
    {
        if (!
function_exists("curl_init"))
        {
            return 
file_get_contents($uri);
        }
        if (!
$btt curl_init($uri)) {
            return 
false;
        }
        
curl_setopt($bttCURLOPT_HEADER0);
        
curl_setopt($bttCURLOPT_POST0);
        
curl_setopt($bttCURLOPT_CONNECTTIMEOUT$connectout);
        
curl_setopt($bttCURLOPT_TIMEOUT$timeout);
        
curl_setopt($bttCURLOPT_RETURNTRANSFERtrue);
        
curl_setopt($bttCURLOPT_VERBOSEfalse);
        
curl_setopt($bttCURLOPT_SSL_VERIFYHOSTfalse);
        
curl_setopt($bttCURLOPT_SSL_VERIFYPEERfalse);
        
$data curl_exec($btt);
        
curl_close($btt);
        return 
$data;
    }
}

if (!
function_exists("getBaseDomain")) {
    
/**
     * getBaseDomain
     * 
     * @param string $url
     * @return string|unknown
     */
    
function getBaseDomain($url)
    {
        
        static 
$strata$fallout$stratas;

        
xoops_load('XoopsCache');

        if (empty(
$strata))
        {
            if (!
$strata XoopsCache::read('internets_stratas'))
            {
                if (empty(
$stratas))
                    
$stratas file(API_FILE_IO_STRATA);
                
shuffle($stratas);
                
$attempts 0;
                while(empty(
$strata) || $attempts < (count($strata) * 1.65))
                {
                    
$attempts++;
                    
$strata array_keys(unserialize(getURIData($stratas[mt_rand(0count($stratas)-1)] ."/v1/strata/serial.api"1519)));
                }
                if (!empty(
$strata))
                    
XoopsCache::write('internets_stratas'$strata3600*24*mt(3.75,11));
            }
        }
        if (empty(
$fallout))
        {
            if (!
$fallout XoopsCache::read('internets_fallouts'))
            {
                if (empty(
$stratas))
                    
$stratas file(API_FILE_IO_STRATA);
                
shuffle($stratas);
                
$attempts 0;
                while(empty(
$fallout) || $attempts < (count($strata) * 1.65))
                {
                    
$attempts++;
                    
$fallout array_keys(unserialize(getURIData($stratas[mt_rand(0count($stratas)-1)] ."/v1/fallout/serial.api"1519)));
                }
                if (!empty(
$fallout))
                    
XoopsCache::write('internets_fallouts'$fallout3600*24*mt(3.75,11));
            }
        }
        
        
// Get Full Hostname
        
$url strtolower($url);
        
$hostname parse_url($urlPHP_URL_HOST);
        if (!
filter_var($hostnameFILTER_VALIDATE_IP) === true
            return 
$hostname;
    
        
// break up domain, reverse
        
$elements explode('.'$hostname);
        
$elements array_reverse($elements);
        
        
// Returns Base Domain
        
if (in_array($elements[0], $fallout) && in_array($elements[1], $strata))
            return 
$elements[2] . '.' $elements[1] . '.' $elements[0];
        elseif (
in_array($elements[0], $fallout) || in_array($elements[0], $strata))
            return 
$elements[1] . '.' $elements[0];
        
        
// Nothing Found
        
return $hostname;
    }
}



99
wishcraft
Using Lorea Ipsum in Workable Demos

I just want to share something with you, I have finished setting up my module demonstration again athttp://2.5.xoops.demo.labs.coop -- but to finish it off I added just a block below the menu that people can turn of for the demo; that constantly changes the Lorea Ipsum each refresh; this not only help with the score of the page or way visiblely to the search engines changing, it will also provide some control on the physical environment.

The code for that block is:-
for($y=1;$y<=2;$y++)
if (
mt_rand(-1,4)>=1)
{
    
$rows 1;
    echo 
"<p style='margin: 9px; padding: 3px; font-size: 0.89em; text-align: justify; text-shadow: 2px 1px -2px #e0033a;'>" implode("</p><p>"json_decode(file_get_contents("http://lipsum.labs.coop/v1/paragraphs/any/1/".$rows."/json.api"), true)) . "</p>";
} else {
    
$rows 1;
    foreach(
json_decode(file_get_contents("http://lipsum.labs.coop/v1/lists/any/".($items mt_rand(1,4))."/".$rows."/json.api"), true) as $list) {
        
$liststyle mt_rand(01)!=1?"ol":"ul";
        echo 
"<$liststyle style='margin: 9px; padding: 3px; font-size:  0.89em; text-align: justify; text-shadow: 2px 1px -2px #e0033a;'><li>" implode("</li><li>"$list) . "</li></$liststyle>";
    }
}


Thanks Enjoye !~ wishcraft



100
wishcraft
Re: @fixed::- xoops_getBaseDomain() =--= *.peers.xoops.org - 301 Hop to an API

Richard:-

Yeah that is right for example fonts.peers.xoops.org or time.peers.xoops.org etc; will hop with a 301 - Permanently Moved with a .htaccess and header("Location: ") with the post and get passed in the header as well to hop to randomly on of the peers to delegate the data..

Just make some means of looking around on the peers api for checksum (md5); like accessing a font and passing it on with a callback!!




TopTop
« 1 ... 7 8 9 (10) 11 12 13 ... 135 »



Login

Who's Online

179 user(s) are online (133 user(s) are browsing Support Forums)


Members: 0


Guests: 179


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits