예제 #1
0
파일: channel.php 프로젝트: philum/cms
function channel($p, $t, $d = '')
{
    $ra = explode(' ', $p);
    foreach ($ra as $ka => $va) {
        list($kab, $vab) = split(':', $va);
        $sc[$vab] = $kab;
    }
    if ($sc['site']) {
        require_once 'plug/microxml.php';
        $site = 'http://' . $sc['site'];
        $t = lka($site, $sc['site'] . '/' . $sc['hub']);
        $load = clkt($sc['site'] . '/msql/users/' . $sc['hub'] . '_cache');
    } else {
        $load = msql_read('users', $sc['hub'] . '_cache', '', 1);
    }
    if ($load) {
        if ($sc['cat']) {
            $load = channel_tri($load, $sc['cat'], 1);
        }
        if ($sc['parent']) {
            $load = channel_tri($load, $sc['art'], 10);
        }
        if ($sc['art']) {
            $load = channel_tri($load, $sc['art'], '');
        }
        if ($sc['tag']) {
            $load = channel_tri($load, $sc['tag'], 5);
        }
        if ($sc['last']) {
            $load = splice($load, $sc['last']);
        }
        $t = build_titl($load, !$t ? $sc['hub'] : $t, 1, $sc['hub']);
        if ($d == 'articles') {
            if ($site) {
                $ret .= output_pages_from_cache($site, $load);
            } else {
                $ret .= output_pages($load, 2, '');
            }
        } elseif ($load) {
            foreach ($load as $k => $v) {
                $re[] = llk('', $site . '/' . $k, html_entity_decode($v[2]));
            }
            $ret = implode('', $re);
            $ret = balc('ul', 'panel pubart', $ret);
        }
    }
    return $t . $ret;
}
예제 #2
0
    // kijk of peer al gedaan is, zo ja -> niet opslaan in list
    // sla nieuwe peers op onderaan $list
    if ($peerkeys == 0) {
        //als geen peers gevonden zijn, skip vooruit
        array_shift($list);
        continue;
    }
    array_shift($peerkeys);
    foreach ($peerkeys as $peer) {
        $test = explode(".", $peer);
        $destination = $test[1] . "." . $test[2] . "." . $test[3] . "." . $test[4];
        if (!isset($nodes[$test[5] . ".k"])) {
            $newpath = splice($destination, $path);
            if ($newpath == "ffff.ffff.ffff.ffff") {
                $path = getnewpath($key);
                $newpath = splice($destination, $path);
            }
            //print_r($newpath."\n");
            $list[] = $test[0] . "." . $newpath . "." . $test[5] . ".k";
        }
    }
    //remove duplicates
    //        $list = array_unique($list);
    // array_shift $list
    array_shift($list);
}
//print_r($nodes);
print_r("Total nodes: " . count($nodes) . "\n");
$fp = fopen('nodes.json', 'w');
fwrite($fp, json_encode($nodes));
fclose($fp);
function deleteEntry($arrayname, $entry)
{
    $n = $arrayname . length;
    for ($i = 0; $i < $n + 1; $i++) {
        if ($arrayname[$i] == $entry) {
            $arrayname . splice($i, 1);
        }
    }
    return $arrayname;
}
예제 #4
0
function _savePpsSetPnt1(&$aThis, &$raList, $rhInfo) {
#1. make Array as Children-Relations
#1.1 if No Children
  if (!is_array($aThis) || sizeof($aThis)==0) {
      return 0xFFFFFFFF;
  } elseif (sizeof($aThis)==1) {
#1.2 Just Only one
      array_push($raList, $aThis[0]);
      $aThis[0]->No = sizeof($raList)-1;
      $aThis[0]->PrevPps = 0xFFFFFFFF;
      $aThis[0]->NextPps = 0xFFFFFFFF;
      $aThis[0]->DirPps = $this->_savePpsSetPnt($aThis[0]->Child, $raList, $rhInfo);
      return $aThis[0]->No;
  } else {
#1.3 Array
      $iCnt = sizeof($aThis);
#1.3.1 Define Center
      $iPos = floor($iCnt / 2);     #$iCnt 
      array_push($raList, $aThis[$iPos]);
      $aThis[$iPos]->No = sizeof($raList)-1;
      $aWk = $aThis;
#1.3.2 Devide a array into Previous,Next
      $aPrev = splice($aWk, 0, $iPos);
      $aNext = splice($aWk, 1, $iCnt - $iPos - 1);
      $aThis[$iPos]->PrevPps = $this->_savePpsSetPnt($aPrev, $raList, $rhInfo);
      $aThis[$iPos]->NextPps = $this->_savePpsSetPnt($aNext, $raList, $rhInfo);
      $aThis[$iPos]->DirPps = $this->_savePpsSetPnt($aThis[$iPos]->Child, $raList, $rhInfo);
      return $aThis[$iPos]->No;
  }
}
예제 #5
0
 public static function unRegister($_class, $id)
 {
     //---------------------------------------------------------
     //init var
     //---------------------------------------------------------
     $i;
     $obj;
     //---------------------------------------------------------
     for ($i = 0; i < sizeof(Trace::$registeredClasses); $i++) {
         $obj = Trace::$registeredClasses[i];
         if ($obj['id'] == id) {
             $obj['_class']->traceID = NULL;
             Trace::$registeredClasses . splice($i, 0);
             break;
         }
     }
 }