diff options
author | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-12 12:39:55 +0000 |
---|---|---|
committer | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-12 12:39:55 +0000 |
commit | 49e74d749168f844f82494169f0b6987da0e4234 (patch) | |
tree | 1a75ada90ae3e1c72fc27ba503c3608d0834f107 /index.php | |
parent | bddeb141b3bca07b25c3d23e207adbaed7e94e4e (diff) | |
download | elgg-49e74d749168f844f82494169f0b6987da0e4234.tar.gz elgg-49e74d749168f844f82494169f0b6987da0e4234.tar.bz2 |
Marcus Povey <marcus@dushka.co.uk>
* Subtyping on annotations and metadata
git-svn-id: https://code.elgg.org/elgg/trunk@187 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 112 |
1 files changed, 103 insertions, 9 deletions
@@ -15,15 +15,109 @@ * Start the Elgg engine
*/
require_once(dirname(__FILE__) . "/engine/start.php");
+ + /**
+ * Check to see if user is logged in, if not display login form
+ **/
+ if ($_SESSION['id'] != -1){
+ //Load the sample welcome page
+ echo page_draw(null, elgg_view("welcome"));
+ } else {
+ //Load the front page
+ echo page_draw(null, elgg_view("login"));
+ }
+
+
+ + $obj = new stdClass;
+ $obj->id = 3; + + + + + // Testing /////// + if ($_SESSION['id']==-1) $_SESSION['id'] = 1; + + // Create / load a site +/* $site = get_site(1); +error_log("GETTIGN SITE ".$_SESSION['id']. " " . print_r($site, true)); + + if (empty($site)) + { + $site = new ElggSite(); + + $site->title = "Test title"; + $site->description = "Test description"; + $site->url = "http://dushka/~icewing/Workingdirectory/elggnew/"; + $site->owner_id = 1; + $site->access_id = 0; + + 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"); + + + + // change site metadata + $site->setMetadata("Metaname", "Value2"); + + error_log("SITE RETRIEVE : " . print_r(get_objects_from_metadatas(0, "", "", "Value2"), true)); +
- // Display page
- if ($_SESSION['id'] == -1) {
- //Load the front page
- echo page_draw(null, elgg_view("login"));
- } else {
- global $CONFIG;
- header("Location: {$CONFIG->url}mod/dashboard/");
- exit;
- }
+ // 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)); +*/ + +// get site annotations +$site = get_site(1); +error_log("GETTIGN SITE ".$_SESSION['id']. " " . print_r($site, true)); + + if (empty($site)) + { + $site = new ElggSite(); + + $site->title = "Test title"; + $site->description = "Test description"; + $site->url = "http://dushka/~icewing/Workingdirectory/elggnew/"; + $site->owner_id = 1; + $site->access_id = 0; + + 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)); + } + error_log("SITE Annotations : " . print_r($site->getAnnotations("Test"), true)); + ?>
\ No newline at end of file |