Ejemplo n.º 1
0
 /**
  * Ok, so $meta_only doesn't mean anything in this class. So sue
  * me. You can use it, but nothing will happen.
  */
 public function getData($max_tags = 0, $meta_only = false)
 {
     $fc = new folksoClient($this->loc->web_url, $this->loc->server_web_path . 'tag.php', 'GET');
     $fc->set_getfields(array('folksotag' => $this->url, 'folksofancy' => 1, 'folksodatatype' => 'xml'));
     $result = $fc->execute();
     $status = $fc->query_resultcode();
     $this->store_new_xml($result, $status);
 }
Ejemplo n.º 2
0
 /**
  * Retrieves an xml list of  tags and sets the $this->ptags object.
  * 
  * @param A resource, either an id or a URL. Default is to use $this->url.
  * @returns folksoPagetags with only the xml part ($rm->xml).
  */
 public function getData($url = '', $max = 0)
 {
     $fc = new folksoClient($this->loc->db_server, $this->loc->get_path . 'resource.php', 'GET');
     $fc->set_getfields(array('folksores' => $url ? $url : $this->url, 'folksodatatype' => 'xml'));
     if (is_numeric($max) && $max > 0) {
         $fc->add_getfield('limit', $max);
     }
     $result = $fc->execute();
     $status = $fc->query_resultcode();
     $this->store_new_xml($result, $status);
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * Note: $this->tag must be set for getData to work.
  *
  * @param $max_tags
  * @param $meta_only Here just to preserve the interface. Does nothing.
  * @param $cloud_type Unused, though maybe could be used some day for something.
  */
 public function getData($max_tags = 0, $meta_only = false, $cloud_type = '')
 {
     $fc = new folksoClient($this->loc->web_url, $this->loc->server_web_path . 'tag.php', 'GET');
     $fc->set_getfields(array('folksorelated' => 1, 'folksotag' => $this->tag));
     /** will eventually need a datatype here **/
     $result = $fc->execute();
     $status = $fc->query_resultcode();
     if (!$status) {
         trigger_error('Internal request failed.', E_USER_ERROR);
     }
     $this->store_new_xml($result, $status);
     return $this;
 }
Ejemplo n.º 4
0
 /**
  * None of the parameters are used. Everything is based on the
  * current url instead.
  */
 public function getData($max_tags = 0, $meta_only = false, $cloudtype = '')
 {
     $fc = new folksoClient($this->loc->web_url, $this->loc->server_web_path . 'resource.php', 'GET');
     /** we do not set the datatype because right now this request
         automatically returns an XML doc **/
     $fc->set_getfields(array('folksores' => $this->url, 'folksoean13list' => 1));
     $result = $fc->execute();
     $status = $fc->query_resultcode();
     if (!$status) {
         trigger_error('no valid status here.', E_USER_ERROR);
     }
     $this->store_new_xml($result, $status);
     return $this;
 }
Ejemplo n.º 5
0
 /**
  * Get the raw cloud information from the server. This data is
  * stored in $this->pdata->cloud.
  *
  * @returns folksoCloud object.
  */
 public function getData($max_tags = 0, $meta_only = false, $cloudtype = '')
 {
     $fc = new folksoClient($this->loc->web_url, $this->loc->server_web_path . 'resource.php', 'GET');
     $fc->set_getfields(array('folksoclouduri' => 1, 'folksores' => $this->url, 'folksodatatype' => 'xml', 'folksolimit' => $max_tags));
     if ($cloudtype == 'bypop') {
         $fc->add_getfield('bypop', 1);
     } elseif ($cloudtype == 'bydate') {
         $fc->add_getfield('bydate', 1);
     }
     $result = $fc->execute();
     $status = $fc->query_resultcode();
     if (!$status) {
         trigger_error('no valid status here.', E_USER_ERROR);
     }
     $this->store_new_xml($result, $status);
     return $this;
 }
Ejemplo n.º 6
0
<?php

require_once 'folksoClient.php';
$cl = new folksoClient('localhost', '/commun3/folksonomie/resource.php', 'GET');
$cl->set_getfields(array('folksores' => curPageURL()));
$result = $cl->execute();
print $cl->query_resultcode();
function curPageURL()
{
    $pageURL = 'http';
    if ($_SERVER["HTTPS"] == "on") {
        $pageURL .= "s";
    }
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    } else {
        $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
    }
    return $pageURL;
}
Ejemplo n.º 7
0
</head>
<body>
  <div id="superscreen"> <!-- screen that appears with dialogue boxes -->
  <div id="superinfobox">
     <a id="closess" href="#">Fermer</a>
  </div>
  </div> <!-- end of superscreen -->

<div id="container">
<?php 
if ($_GET['tag']) {
    $tagthing = strip_tags(substr($_GET['tag'], 0, 255));
    $fc = new folksoClient('localhost', $loc->server_web_path . 'tag.php', 'get');
    $fc->set_getfields(array('folksotag' => $tagthing, 'folksofancy' => '1'));
    $reslist = $fc->execute();
    if ($fc->query_resultcode() == 200) {
        $resources = new DOMDocument();
        $resources->loadXML($reslist);
        $xsl = new DOMDocument();
        $xsl->load($loc->xsl_dir . "resourcelist.xsl");
        $proc = new XsltProcessor();
        $xsl = $proc->importStylesheet($xsl);
        $form = $proc->transformToDoc($resources);
        print $form->saveXML();
    } else {
        print $fc->query_resultcode();
    }
}
?>
<div id="pagebottom">
Ejemplo n.º 8
0
 /**
  * Backend to public_tag_resource_list()
  */
 private function resource_list($tag)
 {
     $fc = new folksoClient($this->loc->web_url, $this->loc->server_web_path . 'tag.php', 'GET');
     $fc->set_getfields(array('folksotag' => $tag, 'folksofancy' => 1, 'folksodatatype' => 'xml'));
     $result = $fc->execute();
     $r = new folksoPageData($fc->query_resultcode());
     $r->xml = $result;
     return $r;
 }