aboutsummaryrefslogtreecommitdiff
path: root/index.php
blob: 2ba68800dc8567e04bb0c73a3b38514c61e7e9b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php

	/**
	 * Elgg index page for web-based applications
	 * 
	 * @package Elgg
	 * @subpackage Core
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Curverider Ltd
	 * @copyright Curverider Ltd 2008
	 * @link http://elgg.org/
	 */

	/**
	 * Start the Elgg engine
	 */
		require_once(dirname(__FILE__) . "/engine/start.php");

	/**
	 * Load the front page
	 */
		echo page_draw(null, elgg_view("homepage"));

		get_objects(3,"blog","mammals","are lovely", 7, 2, 1);
		
		$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 " . print_r($site, true));		
		
		if (!$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");

		


		// 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));
		
		
?>