101
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!!




102
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;
    }
}



103
wishcraft
Using Lorea Ipsum in Workable Demos

I just want to share something with you, I have finished setting up my module demonstration again at http://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 
"implode("

"json_decode(file_get_contents("http://lipsum.labs.coop/v1/paragraphs/any/1/".$rows."/json.api"), true)) . "

"
;
} 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;'>
  • implode("
  • "$list) . "
  • $liststyle>";
        }
    }


    Thanks Enjoye !~ wishcraft



    104
    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!!



    105
    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 the http://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..



    106
    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!!



    107
    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

    /**
     * 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}



    108
    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



    109
    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!!



    110
    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..




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



    Login

    Who's Online

    165 user(s) are online (111 user(s) are browsing Support Forums)


    Members: 0


    Guests: 165


    more...

    Donat-O-Meter

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

    Latest GitHub Commits