aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-06 14:17:47 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-06 14:17:47 +0000
commit674205a2651af6f7e611dc001f6efc349580df55 (patch)
tree30a08037a08c04e2e12b5319f2089269db04e252 /index.php
parentf933424c18201eb0daa38b1c554228bd7dbfd835 (diff)
downloadelgg-674205a2651af6f7e611dc001f6efc349580df55.tar.gz
elgg-674205a2651af6f7e611dc001f6efc349580df55.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Initial annotations and metadata get/sets functional, combined with site test git-svn-id: https://code.elgg.org/elgg/trunk@98 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'index.php')
-rw-r--r--index.php27
1 files changed, 21 insertions, 6 deletions
diff --git a/index.php b/index.php
index ae8dc5e51..2ba68800d 100644
--- a/index.php
+++ b/index.php
@@ -30,9 +30,12 @@
// Testing ///////
+ if ($_SESSION['id']==-1) $_SESSION['id'] = 1;
// Create / load a site
$site = get_site(1);
+error_log("GETTIGN SITE " . print_r($site, true));
+
if (!$site)
{
$site = new ElggSite();
@@ -43,31 +46,43 @@
$site->owner_id = 1;
$site->access_id = 0;
- error_log("LOADED NEW SITE: Saving");
+ error_log("LOADED NEW SITE: Saving" . print_r($site,true));
$site->save();
}
else
+ {
$site = new ElggSite($site);
+
+ $site->title = "Test title " . time();
+ $site->save();
+ error_log("UPDATING SITE " . print_r($site, true));
+ }
// annotate site
-
-
+ $site->annotate("Test","TestValue");
+
// add meta data
+ $site->setMetadata("Metaname", "Value");
+
- // get site
- // get site metadata
// change site metadata
+ $site->setMetadata("Metaname", "Value2");
- // get site metadata
+
// get site annotations
+ error_log("SITE Annotations : " . print_r($site->getAnnotations("Test"), true));
+
+
+ // get site metadata
+ error_log("SITE Metadata : " . print_r($site->getMetadata("Metaname"), true));
?> \ No newline at end of file