1
bjuti
Please add .rs recognition in new Xoops versions
  • 2010/3/6 1:02

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Hi

My country have .rs domain for two years now, please add .rs top level domain in include/functions.php. It's top domain of Serbia, former Yugoslavia, .yu.

Tnx

2
wishcraft
Re: Please add .rs recognition in new Xoops versions

hi bjuti, How are you I wish trabis never refactorised this function it was written orginally to encompass domains changing like this for anything unindex.. He said it wasn't needed obviously this is an oversight.. the code for xoops_getBaseDomain($url, $debug) should be
/**
 * 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
 */
function xoops_getBaseDomain($url$debug 0)
{
    
$base_domain '';
    
$url strtolower($url);

    
// generic tlds (source: http://en.wikipedia.org/wiki/Generic_top-level_domain)
    
$G_TLD = array(
    
'biz','com','edu','gov','info','int','mil','name','net','org','aero','asia','cat','coop','jobs','mobi','museum','pro','tel','travel',
    
'arpa','root','berlin','bzh','cym','gal','geo','kid','kids','lat','mail','nyc','post','sco','web','xxx',
    
'nato''example','invalid','localhost','test','bitnet','csnet','ip','local','onion','uucp','co');

    
// country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain)
    
$C_TLD = array(
    
// active
    
'ac','ad','ae','af','ag','ai','al','am','an','ao','aq','ar','as','at','au','aw','ax','az',
    
'ba','bb','bd','be','bf','bg','bh','bi','bj','bm','bn','bo','br','bs','bt','bw','by','bz',
    
'ca','cc','cd','cf','cg','ch','ci','ck','cl','cm','cn','co','cr','cu','cv','cx','cy','cz',
    
'de','dj','dk','dm','do','dz','ec','ee','eg','er','es','et','eu','fi','fj','fk','fm','fo',
    
'fr','ga','gd','ge','gf','gg','gh','gi','gl','gm','gn','gp','gq','gr','gs','gt','gu','gw',
    
'gy','hk','hm','hn','hr','ht','hu','id','ie','il','im','in','io','iq','ir','is','it','je',
    
'jm','jo','jp','ke','kg','kh','ki','km','kn','kr','kw','ky','kz','la','lb','lc','li','lk',
    
'lr','ls','lt','lu','lv','ly','ma','mc','md','mg','mh','mk','ml','mm','mn','mo','mp','mq',
    
'mr','ms','mt','mu','mv','mw','mx','my','mz','na','nc','ne','nf','ng','ni','nl','no','np',
    
'nr','nu','nz','om','pa','pe','pf','pg','ph','pk','pl','pn','pr','ps','pt','pw','py','qa',
    
're','ro','rs','ru','rw','sa','sb','sc','sd','se','sg','sh','si','sk','sl','sm','sn','sr','st',
    
'sv','sy','sz','tc','td','tf','tg','th','tj','tk','tl','tm','tn','to','tr','tt','tv','tw',
    
'tz','ua','ug','uk','us','uy','uz','va','vc','ve','vg','vi','vn','vu','wf','ws','ye','yu',
    
'za','zm','zw',
    
// inactive
    
'eh','kp','me','rs','um','bv','gb','pm','sj','so','yt','su','tp','bu','cs','dd','zr');

    
// get domain
    
if (!$full_domain xoops_getUrlDomain($url)) {
        return 
$base_domain;
    }

    
// break up domain, reverse
    
$DOMAIN explode('.'$full_domain);
    if (
$debug) {
        
print_r($DOMAIN);
    }
    
$DOMAIN array_reverse($DOMAIN);
    if (
$debug) {
        
print_r($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 part
s: 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;
}

3
bjuti
Re: Please add .rs recognition in new Xoops versions
  • 2010/3/6 10:32

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


hi

the top 'yu' is active I thing till march 30th, so it's place is in inactive :)

Tnx

4
Mamba
Re: Please add .rs recognition in new Xoops versions
  • 2010/3/6 12:43

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Will do! Thanks for the info

5
bjuti
Re: Please add .rs recognition in new Xoops versions
  • 2010/4/1 8:59

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


On the march the 30rd, .yu TLD officialy doesn't exists anymore, so it should be removed.


Quote:

YU domain becomes history
Belgrade, 30th March, 2010- .YU domain stopped functioning at noon today, in accordance with the decision of ICANN (Internet Corporation for Assigned Names and Numbers). Saying goodbye to the .YU domain, which became history, like other aspects of ex Yugoslavia, has been announced since March 2008.
Just to remind you-The official registration of the .RS domain started on 10th March, 2008. During the following six months, until 10th September 2008, the owners of the .YU domain were given priority to register the aforementioned domain with the .RS ending. This right was used by 19,372 companies in total.
Upon finishing the transition from .YU to .RS domain, approximately 4000 users of the .YU domain prolonged the lifespan of their .YU domains until 30th March, 2010. As of today noon, the remaining 4000 YU domains are no longer visible online.
Today at 6pm, Museum of Yugoslav History will be hosting the “farewell party” to the .YU domain. Effective today, the .YU domain becomes a part of the museum.


BTW. Where is this function in XOOPS 2.3.3?

Tnx.

Login

Who's Online

168 user(s) are online (113 user(s) are browsing Support Forums)


Members: 0


Guests: 168


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