Example #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);
 }
Example #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;
 }
Example #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;
 }
Example #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;
 }
Example #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;
 }
Example #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;
}
Example #7
0
    // warning, dev only!!!!!
    $fks->startSession('gustav-2009-001');
}
$u = $fks->userSession();
if (!$u instanceof folksoUser) {
    print "Error not a logged user";
    //  header('Location: ' . $loc->loginPage());
    exit;
}
$cl = new folksoClient('localhost', $loc->server_web_path . 'user.php', 'GET');
print $cl->method;
$cl->set_getfields(array('folksouid' => $u->userid, 'folksogetmytags' => 1));
$cl->set_datastyle('json');
print_r($cl->build_req());
$result = $cl->execute();
if ($cl->query_resultcode() == 200) {
    $message = 'w00t ' . $result;
} elseif ($cl->query_resultcode() == 204) {
    $message = "L'utilisateur n'a pas encore de tags";
} else {
    $message = "Erreur rescode" . $cl->query_resultcode() . ':: ' . $result . 'how bout that';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Language" content="fr-FR"/>
  <title>Mon (ma) Fabula</title>

    <script type="text/javascript" src="js/jquery.js">
Example #8
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">
<form action="resourceview.php" method="get">
Example #9
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;
 }