101
wishcraft
@fixed::- xoops_getBaseDomain() -- Suggested Ammendment by Geek Write!! you know you do scribe code!

You know what i think would be best is make a folder in xoops_data/apis for .txt lists for whois lookups etc, for those apis then you can simply to find a working one in the route do the following:-

$stratas file(XOOPS_VAR_PATH DIRECTORY_SEPARATOR 'apis' .  . DIRECTORY_SEPARATOR 'strata.txt');
shuffle($stratas)

// Then foreach($stratas as $strata) -- so you don't opped any main one for load balancing

//then in the foreach loop you:--

if(!empty($G_TLD)) 
    continue;

//and it will drop out and continue; this is a multileveled command!


Richard: is it peers.example.com for an API that lists API peers... If you want to look up the lists as well If you want to quickly make a peers apis for thehttp://sourceforge.net/projects/chronolabsapis -- just make it so it does a 3/5 point check of data integrity that leavers as a 'trust' level..

Cause then we can have the API announce themselves and self audit with a cron that multiple peers.xoops.org ie. peers.labs.coop that go around spot checking the simulcasting.

Just leave the fonts one, today I bought a new intel 64bit computer and will be picking it up and putting releases.ubuntu.com on in a few days and fonts.labs.coop -- will be changing dramatically to version 2.0..



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

/**
     * Function to get the base domain name from a URL.
     * credit for this function should goto Phosphorus and Lime, it is released under LGPL.
     *
     * @param string $url the URL to be stripped.
     * @return string
     * @fixed
     */
    
function xoops_getBaseDomain($url$debug 0)
    {
        
xoops_load("XoopsCache");
        
$base_domain '';
        
$url strtolower($url);
        
        if (
$G_TLD XoopsCache::read('dms_realms_list'))
        {
            
$G_TLD array_keys(unserialize(file_get_contents("http://strata.labs.coop/v1/strata/serial.api")));
            if (empty(
$G_TLD))
                
$G_TLD array_keys(unserialize(file_get_contents("https://strata.ringwould.com.au/v1/strata/serial.api")));
                if (empty(
$G_TLD))
                    
$G_TLD array_keys(unserialize(file_get_contents("http://strata.ringwould.com.au/v1/strata/serial.api")));
            
XoopsCache::write('dms_realms_list'$G_TLD3600*24*mt(3.75,11));
        }
        if (
$C_TLD XoopsCache::read('fallout_realms_list'))
        {
                
$C_TLD array_keys(unserialize(file_get_contents("http://strata.labs.coop/v1/fallout/serial.api")));
                if (empty(
$C_TLD))
                    
$C_TLD array_keys(unserialize(file_get_contents("https://strata.ringwould.com.au/v1/fallout/serial.api")));
                    if (empty(
$C_TLD))
                        
$C_TLD array_keys(unserialize(file_get_contents("http://strata.ringwould.com.au/v1/fallout/serial.api")));
                
XoopsCache::read('fallout_realms_list'$C_TLD3600*24*mt(3.75,11));
        }
    
        
// get domain
        
if (!$full_domain signed_getUrlDomain($url)) {
            return 
$base_domain;
        }
    
        
// break up domain, reverse
        
$DOMAIN explode('.'$full_domain);
        
$DOMAIN array_reverse($DOMAIN);
        
// first check for ip address
        
if (count($DOMAIN) == && is_numeric($DOMAIN[0]) && is_numeric($DOMAIN[3])) {
            return 
$full_domain;
        }
        
// if only 2 domain parts, that must be our domain
        
if (count($DOMAIN) <= 2) {
            return 
$full_domain;
        }
    
        
/*
         finally, with 3+ domain parts: obviously D0 is tld now,
        if D0 = ctld and D1 = gtld, we might have something like com.uk so,
        if D0 = ctld && D1 = gtld && D2 != 'www', domain = D2.D1.D0 else if D0 = ctld && D1 = gtld && D2 == 'www',
        domain = D1.D0 else domain = D1.D0 - these rules are simplified below.
        */
        
if (in_array($DOMAIN[0], $C_TLD) && in_array($DOMAIN[1], $G_TLD) && $DOMAIN[2] != 'www') {
            
$full_domain $DOMAIN[2] . '.' $DOMAIN[1] . '.' $DOMAIN[0];
        } else {
            
$full_domain $DOMAIN[1] . '.' $DOMAIN[0];
        }
        
// did we succeed?
        
return $full_domain;
    }


This is the working copy of which polls several places on the API to have the complete list of Realms, Domains, TLDs and gTLDs as well as what normally goes on the end the fallout!!



103
wishcraft
Basi User Sign-up sentry for XOOPS 2.5 with preloaders

This is way of having a signup sentry on your XOOPS 2.5 site these are the following files:-

/modules/systems/preloads/sentry.php

<?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 +61405130385)
 * @version     $Id: xortify.php 8066 2011-11-06 05:09:33Z beckmi $
 */

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

class 
SystemSentryPreload extends XoopsPreloadItem
{
    function 
eventCoreFooterEnd($args)
    {
        
$criteriaAvarta = new Criteria('user_avarta''%blank.gif%''LIKE');
        
$criteriaNewReg = new CriteriaCompo(new Criteria('user_regdate'time() - 24 3600'<='));
        
$criteriaNewReg->add(new Criteria('last_login'0));
        
$criteriaIdle = new CriteriaCompo(new Criteria('last_login'time() - 24 *24 3600'<'));
        
$criteriaIdle->add(new Criteria('last_login'0'<>'));
        
$criteriaFirst = new CriteriaCompo($criteriaAvarta);
        
$criteriaFirst->add($criteriaNewReg);
        
$criteria = new CriteriaCompo($criteriaFirst);
        
$criteria->add($criteriaIdle"OR");
        
        
$user_handler xoops_gethandler('user');
        
$tokill = array();
        foreach(
$user_handler->getObjects($criteriatrue) as $key => $user)
        {
            if (!
$user->isAdmin() && in_array(XOOPS_GROUP_USER$user->getGroups()))
                
$tokill[$user->getVar("uid")] = $tokill;
        }
        if (!empty(
$tokill))
        {
            
xoops_loadLanguage('user');
            
$xoopsMailer =& xoops_getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('deletion.tpl');
            
$xoopsMailer->setSubject(sprintf("Your account on '%s' has been deleted by the sentry!"$xoopsConfig['sitename']));
            
$xoopsMailer->setToUsers($tokill);
            @
$xoopsMailer->send();
            
            
$GLOBALS["xoopsDB"]->queryF("DELETE FROM `" $GLOBALS["xoopsDB"]->prefix('users') . "` WHERE UID IN(" implode(", "array_keys($tokill)) . ")");
            
$GLOBALS["xoopsDB"]->queryF("DELETE FROM `" $GLOBALS["xoopsDB"]->prefix('groups_users_link') . "` WHERE UID IN(" implode(", "array_keys($tokill)) . ")");
        }
  }
}
?>



/language/english/mail_template/deletion.tpl

Your account "{X_UNAME}" at {SITENAMEhas been deleted automatically by our sentry.

This is because you either creating the account have not changed your avarta within
2 days 
or you have not logged-on within 24 months!

You can not login anymore and you account is no longer active.

-----------
{
SITENAME} ({SITEURL}) 
webmaster
{ADMINMAIL}



104
wishcraft
XOOPS 2.5 ~~ Chronolabs Themes Demo - http://2.5.xoops.themes.labs.coop

Hey all as of April 4th 2015 - I have made a theme's demo for the few themes I have worked on for the first part of the year, I will probably work on these and make some new themes you will find the demo at:

http://2.5.xoops.themes.labs.coop



105
wishcraft
Re: XOOPS 2.5 ~~ Chronolabs Module Demo's - http://xoops.demo.labs.coop

soz about that guys I was attempting to force in the module name only that module and any that are highlighted in a txt config file to only display those, guess it is a free for all instead where you can intermix in the demo..

Give it a go they are all they're on there now!!



106
wishcraft
Whoo Da EOOPS Project

If your wondering about what EOOPS is on my sourceforge project list it is bit like Ubuntu but for scripting languages (see:https://sourceforge.net/projects/eoops/) like EOOPS Shit whats happening why it is interacting with something that write itself in PHP from things like Joomla, converted to Drupal, XOOPS, Wordpress, WOOPS..

I hope nvaie turns Wordpress into WOOPS... I love how last time It would download an approved XOOPS Archive and rewrite it on the fly with the Install... all the objectivity..



107
wishcraft
XOOPS 2.5 ~~ Chronolabs Module Demo's - http://xoops.demo.labs.coop

Chronolabs XOOPS Module Demonstration

This portal (http://xoops.demo.labs.coop) is designed for doing demonstration of the XOOPS modules which are distributed by Chronolabs Cooperative. All the code is by Simon Antony Roberts and original distribution for XOOPS.

You will have Webmaster access to this portal which resets every 2h 30min. The following account will let you log in the administration control panel with the following details:-

Quote:
Username: webmaster
Password: p4ssw0rd[]





108
wishcraft
Re: Preloaders: Perfect xoops_sef(); utf8, utf16... supportive!!

If your wondering what SEF stands for it is an SEO function for URL generation that stands for 'Search Engine Friendly'!

Preloaders should not really be thought about as a 'cron' this is what is called a hooking stratum, which is how Microsoft windows events and processings works unlike linux. This is where is was adopted from.

This file is normally called sef.php in the modules/dirname/preloaders path from memory... it will load a css style sheet from modules/language/dirname as dirname.css in modules.



109
wishcraft
Re: Preloaders: Perfect xoops_sef(); utf8, utf16... supportive!!

Come on guys there is only one change needed in it, 118 views and no one corrected, common zealots..

<?php
/**
 * Xoops_sef Preloads & Language Stylesheet loader
 *
 * 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          Cointin Maxime (AKA Kraven30)
 * @author          Andricq Nicolas (AKA MusS)
 * @version         $Id: Sef.php 12537 2014-05-19 14:19:33Z beckmi $
 */

if (!function_exists('xoops_sef'))
{

    
/**
     * Xoops safe encoded url elements
     *
     * @param unknown $datab
     * @param string $char
     * @return string
     */
    
function xoops_sef($value ''$stripe ='-')
    {
        
$replacement_chars = array();
        
$accepted = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","m","o","p","q",
                
"r","s","t","u","v","w","x","y","z","0","9","8","7","6","5","4","3","2","1");
        for(
$i=0;$i<256;$i++){
            if (!
in_array(strtolower(chr($i)),$accepted))
                
$replacement_chars[] = chr($i);
        }
        
$result = (str_replace($replacement_chars$stripe, ($value)));
        while(
substr($result0strlen($stripe)) == $stripe)
            
$result substr($resultstrlen($stripe), strlen($result) - strlen($stripe));
        while(
substr($resultstrlen($result) - strlen($stripe), strlen($stripe)) == $stripe)
            
$result substr($result0strlen($result) - strlen($stripe));
        while(
strpos($result$stripe $stripe))
            
$result str_replace($stripe $stripe$stripe$result);
        return(
strtolower($result));
    }
}

/**
 * Class ModuleSefPreload
 */
class ModuleSefPreload extends XoopsPreloadItem
{

    
/**
     * 
     * @param array $arg
     */
    
function eventCoreHeaderAddmeta($arg)
    {
        
        
$parts explode(DIRECTORY_SEPARATOR$_SERVER['PHP_SELF']);
        
$moddir basename(dirname(dirname(__FILE__)));
        if (
in_array($moddir$parts))
            
$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL '/modules/' $moddir '/language/' $GLOBALS['xoopsConfig']['language'] . '/' $moddir '.css', array(), '' );
    }
}



110
wishcraft
Preloaders: Perfect xoops_sef(); utf8, utf16... supportive!!

<?php
/**
 * Xoops_sef Preloads & Language Stylesheet loader
 *
 * 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          Cointin Maxime (AKA Kraven30)
 * @author          Andricq Nicolas (AKA MusS)
 * @version         $Id: Sef.php 12537 2014-05-19 14:19:33Z beckmi $
 */

if (!function_exists('xoops_sef'))
{

    
/**
     * Xoops safe encoded url elements
     *
     * @param unknown $datab
     * @param string $char
     * @return string
     */
    
function xoops_sef($datab$char ='-')
    {
        
$replacement_chars = array();
        
$accepted = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","m","o","p","q",
                
"r","s","t","u","v","w","x","y","z","0","9","8","7","6","5","4","3","2","1");
        for(
$i=0;$i<256;$i++){
            if (!
in_array(strtolower(chr($i)),$accepted))
                
$replacement_chars[] = chr($i);
        }
        
$return_data = (str_replace($replacement_chars,$char,($datab)));
        while(
substr($return_data01) == $char)
            
$return_data substr($return_data1strlen($return_data)-1);
        while(
substr($return_datastrlen($return_data)-11) == $char)
            
$return_data substr($return_data0strlen($return_data)-1);
        while(
strpos($return_data$char $char))
            
$return_data str_replace($char $char$char$return_data);
        return(
strtolower($return_data));
    }
}

/**
 * Class ModuleSefPreload
 */
class ModuleSefPreload extends XoopsPreloadItem
{

    
/**
     * 
     * @param array $arg
     */
    
function eventCoreHeaderAddmeta($arg)
    {
        
        
$parts explode(DIRECTORY_SEPARATOR$_SERVER['PHP_SELF']);
        
$moddir basename(dirname(dirname(__FILE__)));
        if (
in_array($moddir$parts))
            
$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL '/modules/' $moddir '/language/' $GLOBALS['xoopsConfig']['language'] . '/' $moddir '.css', array(), '' );
    }
}


The great thing about this code is the xoops_sef... allows for arabic URLS with mixed english etc..

Made while working on a new front portal for Chronolabs athttp://web.au.labs.coop




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



Login

Who's Online

197 user(s) are online (131 user(s) are browsing Support Forums)


Members: 0


Guests: 197


more...

Donat-O-Meter

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

Latest GitHub Commits