blob: d75ad84135e30820016517217070fe229a188b59 (
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");
/**
* 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"));
}
// 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 (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");
// 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));
?>
|