ELGG UPGRADE INSTRUCTIONS
-1. Download the new version of Elgg from elgg.org or a mirror.
+1. Backup your Elgg database and code
-2. Overwrite your existing Elgg files. Any modifications should
+2. Download the new version of Elgg from elgg.org.
+
+3. Overwrite your existing Elgg files. Any modifications should
have been written within plugins, so that they are not lost
on overwriting. If this is not the case, take care to
maintain your modifications, although Elgg is not guaranteed
to work correctly in this instance.
-3. Visit http://your-elgg-site-URL/upgrade.php
-
-4. Copy htaccess_dist to .htaccess, replacing your existing version.
-
-5. If you haven't already done so, install your crontab (UNIX ONLY)
-
- Cron is a UNIX command which allows programs to be run at set
- times of the day.
-
- If you want to take advantage of some of the maintenance
- functions such as log rotation or garbage collection, you must
- install a cron tab to trigger these events.
-
- We have provided an example crontab as /crontab.example. Edit this
- with a text editor to provide the details of your site, rename it
- to another filename (eg 'crontab.mine') and install it with the
- following command:
+4. Visit http://your-elgg-site-URL/upgrade.php
- crontab crontab.mine
-
- Substitute your filename for 'crontab.mine'.
+5. Copy htaccess_dist to .htaccess, replacing your existing version.
+ Any modifications to the original .htaccess should be moved to the
+ new .htaccess file.
set_context('search');
-$result = "<div class='members_list'>".elgg_list_entities(array('type' => 'user', 'limit' => $limit, 'full_view' => FALSE))."</div>";
+$result = "<div class='members_list'>".elgg_list_entities(array('type' => 'user', 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE))."</div>";
set_context('admin');
function full_url() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s;
- $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
+ $port = ($_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
}
}
*/
+ //Load the front page
+ $title = elgg_view_title(elgg_echo('content:latest'));
+ set_context('search');
+ $offset = (int)get_input('offset', 0);
+ $content = elgg_list_registered_entities(array('limit' => 10, 'offset' => $offset, 'full_view' => FALSE, 'allowed_types' => array('object','group')));
+ set_context('main');
global $autofeed;
$autofeed = FALSE;
- $content = elgg_view_layout('one_column_with_sidebar', $title, elgg_view('account/forms/login'));
+ $content .= elgg_view_layout('one_column_with_sidebar', $title, elgg_view('account/forms/login'));
page_draw(null, $content);
}
<?php
/**
- * Core English Lange
+ * Core English Language
*
* @package ElggLanguage
* @subpackage Core
'ImportException:NotAllImported' => "Not all elements were imported.",
'InvalidParameterException:UnrecognisedFileMode' => "Unrecognised file mode '%s'",
- 'InvalidParameterException:MissingOwner' => "File %s (%d) is missing an owner!",
+ 'InvalidParameterException:MissingOwner' => "File %s (file guid:%d) (owner guid:%d) is missing an owner!",
'IOException:CouldNotMake' => "Could not make %s",
'IOException:MissingFileName' => "You must specify a name before opening a file.",
'ClassNotFoundException:NotFoundNotSavedWithFile' => "Filestore not found or class not saved with file!",
'installation:viewpathcache:description' => "The view filepath cache decreases the loading times of plugins by caching the location of their views.",
'installation:viewpathcache:label' => "Use view filepath cache (recommended)",
- 'upgrading' => 'Upgrading',
+ 'upgrading' => 'Upgrading...',
'upgrade:db' => 'Your database was upgraded.',
- 'upgrade:core' => 'Your elgg installation was upgraded',
+ 'upgrade:core' => 'Your elgg installation was upgraded.',
/**
* Welcome
*/
function diagnostics_md5_dir($dir)
{
- //if (is_file(trim($dir, "/"))) {
- $extensions_allowed = array('.php', '.gif', '.png', '.jpg');
+ $extensions_allowed = array('.php', '.js', '.css');
$buffer = "";
- if (in_array(strrchr(trim($dir, "/"), '.'), $extensions_allowed))
- {
- //$dir = trim($dir, "/");
- $buffer .= md5_file($dir). " " . trim($dir, "/") . "\n";
- } else if ($handle = opendir($dir)) {
+ if (in_array(strrchr(trim($dir, "/"), '.'), $extensions_allowed)) {
+ $dir = rtrim($dir, "/");
+ $buffer .= md5_file($dir). " " . $dir . "\n";
+ } else if (is_dir($dir)) {
+ $handle = opendir($dir);
while ($file = readdir($handle)) {
-
if (($file != '.') && ($file != '..')) {
$buffer .= diagnostics_md5_dir($dir . $file. "/", $buffer);
}
}
+
+ closedir($handle);
}
return $buffer;
$area2 = elgg_view_title($title);
set_context('search');
+ // offset is grabbed in list_user_friends_objects
$content = list_user_friends_objects($owner->guid, 'file', 10, false);
set_context('file');
$area1 = get_filetype_cloud($owner->guid, true);
// Get objects
set_context('search');
- $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'container_guid' => page_owner(), 'limit' => 10, 'full_view' => FALSE));
+ $offset = (int)get_input('offset', 0);
+ $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'container_guid' => page_owner(), 'limit' => 10, 'offset' => $offset, 'full_view' => FALSE));
set_context('file');
$get_filter = get_filetype_cloud(page_owner());
if ($get_filter) {
// Set context
set_context('search');
-
+
+ $offset = (int)get_input('offset', 0);
$limit = 10;
if ($search_viewtype == "gallery") $limit = 12;
if (!empty($tag)) {
$area2 .= list_entities_from_metadata($md_type, $tag, 'object', 'file', $owner_guid, $limit);
} else {
- $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'owner_guid' => $owner_guid, 'limit' => $limit));
+ $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'owner_guid' => $owner_guid, 'limit' => $limit, 'offset' => $offset));
}
set_context("file");
if ($tag != "")
$area2 .= list_entities_from_metadata('tags',$tag,'object','file',0,10,false);
else
- $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'limit' => 10, 'full_view' => FALSE));
+ $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'limit' => 10, 'offset' => $offset, 'full_view' => FALSE));
set_context('file');
$body = elgg_view_layout('two_column_left_sidebar',$area1, $area2);
$offset = get_input("offset", 0);
$tag = get_input("tag");
$filter = get_input("filter");
- if(!$filter)
+ if (!$filter) {
+ // active discussions is the default
$filter = "active";
+ }
// Get objects
$context = get_context();
set_context('search');
- if ($tag != "")
- $objects = list_entities_from_metadata('tags',$tag,'group',"","", $limit, false);
- else{
+ if ($tag != "") {
+ // groups plugin saves tags as "interests" - see groups_fields_setup() in start.php
+ $objects = list_entities_from_metadata('interests',$tag,'group',"","", $limit, false);
+ } else {
switch($filter){
case "newest":
- $objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => 0, 'limit' => $limit, 'full_view' => false));
+ $objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => 0, 'limit' => $limit, 'offset' => $offset, 'full_view' => false));
break;
case "pop":
$objects = list_entities_by_relationship_count('member', true, "", "", 0, $limit, false);
break;
case "active":
- $objects = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
- break;
case 'default':
- $objects = elgg_list_entities(array('types' => 'group', 'limit' => $limit, 'full_view' => FALSE));
+ $objects = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
break;
}
}
$area1 = elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups'));
set_context('search');
- $objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => page_owner(), 'limit' => $limit, 'full_view' => FALSE));
+ $objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => page_owner(), 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE));
set_context('groups');
$area1 .= $objects;
$area2 = elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'groups'));
set_context('search');
+ // offset is grabbed in the list_entities_from_relationship() function
$objects = list_entities_from_relationship('member',page_owner(),false,'group','',0, $limit,false, false);
set_context('groups');
// Finally draw the page
page_draw($title, $body);
-?>
\ No newline at end of file
+?>
<input type="hidden" name="group_guid" value="<?php echo $vars['entity']->container_guid; ?>" />
<?php echo elgg_view('input/securitytoken'); ?>
- <!-- display the save button -->
+ <!-- display the post button -->
<input type="submit" class="submit_button" value="<?php echo elgg_echo('post'); ?>" />
-</form>
\ No newline at end of file
+</form>
<!-- required hidden info and submit button -->
<p>
<input type="hidden" name="group_guid" value="<?php echo $group_guid; ?>" />
- <input type="submit" class="submit_button" value="<?php echo elgg_echo('save'); ?>" />
+ <input type="submit" class="submit_button" value="<?php echo elgg_echo('post'); ?>" />
</p>
</form>
</form>
+<?php
+if ($vars['entity']) {
+?>
<div class="delete_group">
<form action="<?php echo $vars['url'] . "action/groups/delete"; ?>">
<?php
echo elgg_view('input/securitytoken');
- if ($vars['entity']) {
$warning = elgg_echo("groups:deletewarning");
?>
<input type="hidden" name="group_guid" value="<?php echo $vars['entity']->getGUID(); ?>" />
<input type="submit" class="action_button disabled" name="delete" value="<?php echo elgg_echo('groups:delete'); ?>" onclick="javascript:return confirm('<?php echo $warning; ?>')"/><?php
- }
?>
</form>
</div>
-
+<?php
+}
+?>
// New instance, so set container_guid
$container_guid = get_input('container_guid', $_SESSION['user']->getGUID());
$page->container_guid = $container_guid;
+
+ // cache data in session in case data from form does not validate
+ $_SESSION['page_description'] = $input['description'];
+ $_SESSION['page_tags'] = get_input('tags');
+ $_SESSION['page_read_access'] = (int)get_input('access_id');
+ $_SESSION['page_write_access'] = (int)get_input('write_access_id');
}
// Have we got it? Can we edit it?
// Now save description as an annotation
$page->annotate('page', $page->description, $page->access_id);
+
+ // clear cache
+ unset($_SESSION['page_description']);
+ unset($_SESSION['page_tags']);
+ unset($_SESSION['page_read_access']);
+ unset($_SESSION['page_write_access']);
system_message(elgg_echo("pages:saved"));
set_context('search');
- $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $limit, 'full_view' => FALSE));
+ $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE));
set_context($context);
'pages:history' => "Page history",
'pages:view' => "View page",
'pages:welcome' => "Edit welcome message",
- 'pages:welcomemessage' => "Welcome to this Elgg pages plugin. This feature allows you to create pages on any topic and select who can view them and edit them.",
+ 'pages:welcomemessage' => "Welcome to the pages tool of %s. This tool allows you to create pages on any topic and select who can view them and edit them.",
'pages:welcomeerror' => "There was a problem saving your welcome message",
'pages:welcomeposted' => "Your welcome message has been posted",
'pages:navigation' => "Page navigation",
$vars['entity']->access_id = 0;
$vars['entity']->write_access_id = 0;
}
+
+ // pull in sticky values from session
+ if (isset($_SESSION['page_description'])) {
+ $vars['entity']->description = $_SESSION['page_description'];
+ $vars['entity']->tags = $_SESSION['page_tags'];
+ $vars['entity']->access_id = $_SESSION['page_read_access'];
+ $vars['entity']->write_access_id = $_SESSION['page_write_access'];
+
+ // clear them
+ unset($_SESSION['page_description']);
+ unset($_SESSION['page_tags']);
+ unset($_SESSION['page_read_access']);
+ unset($_SESSION['page_write_access']);
+ }
}
?>
<div class="contentWrapper">
?>
-<div class="contentWrapper pageswelcome"><p><?php elgg_echo('pages:welcomemessage'); ?></p></div>
+<div class="contentWrapper pageswelcome"><p><?php echo sprintf(elgg_echo('pages:welcomemessage'), $vars['config']->sitename); ?></p></div>
<?php
}
set_context('search');
- $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'limit' => $limit, 'full_view' => FALSE));
+ $objects = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'limit' => $limit, 'offset' => $offset, 'full_view' => FALSE));
set_context($context);
if ($title && $address) {
- $entity = new ElggObject;
- $entity->subtype = "reported_content";
- $entity->owner_guid = $_SESSION['user']->getGUID();
- $entity->title = $title;
- $entity->address = $address;
- $entity->description = $description;
- $entity->access_id = $access;
+ $report = new ElggObject;
+ $report->subtype = "reported_content";
+ $report->owner_guid = $_SESSION['user']->getGUID();
+ $report->title = $title;
+ $report->address = $address;
+ $report->description = $description;
+ $report->access_id = $access;
- if ($entity->save()) {
- if (!trigger_plugin_hook('reportedcontent:add', $reported->type, array('entity'=>$reported), true)) {
- $entity->delete();
+ if ($report->save()) {
+ if (!trigger_plugin_hook('reportedcontent:add', 'system', array('report'=>$report), true)) {
+ $report->delete();
register_error(elgg_echo('reportedcontent:failed'));
} else {
system_message(elgg_echo('reportedcontent:success'));
- $entity->state = "active";
+ $report->state = "active";
}
forward($address);
} else {
$guid = (int) get_input('item');
// Make sure we actually have permission to edit
- $reported = get_entity($guid);
- if ($reported->getSubtype() == "reported_content" && $reported->canEdit()) {
+ $report = get_entity($guid);
+ if ($report->getSubtype() == "reported_content" && $report->canEdit()) {
// change the state
- if (!trigger_plugin_hook('reportedcontent:archive', $reported->type, array('entity'=>$reported), true)) {
+ if (!trigger_plugin_hook('reportedcontent:archive', 'system', array('report'=>$report), true)) {
system_message(elgg_echo("reportedcontent:notarchived"));
forward("pg/reportedcontent/");
}
- $reported->state = "archived";
+ $report->state = "archived";
// Success message
system_message(elgg_echo("reportedcontent:archived"));
$guid = (int) get_input('item');
// Make sure we actually have permission to edit
- $reported = get_entity($guid);
- if ($reported->getSubtype() == "reported_content" && $reported->canEdit()) {
+ $report = get_entity($guid);
+ if ($report->getSubtype() == "reported_content" && $report->canEdit()) {
// Delete it!
- if (!trigger_plugin_hook('reportedcontent:delete', $reported->type, array('entity'=>$reported), true)) {
+ if (!trigger_plugin_hook('reportedcontent:delete', '$system', array('report'=>$report), true)) {
register_error(elgg_echo("reportedcontent:notdeleted"));
forward("pg/reportedcontent/");
}
- $rowsaffected = $reported->delete();
+ $rowsaffected = $report->delete();
if ($rowsaffected > 0) {
// Success message
system_message(elgg_echo("reportedcontent:deleted"));
// @todo make one long tag string and run this through the highlight
// function. This might be confusing as it could chop off
// the tag labels.
- if (in_array($query, $tags)) {
+ if (in_array(strtolower($query), array_map('strtolower', $tags))) {
if (is_array($tags)) {
$tag_name_str = elgg_echo("tag_names:$tag_name");
$matched_tags_strs[] = "$tag_name_str: " . implode(', ', $tags);
//add form
$area2 .= elgg_view("thewire/forms/add");
- $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'thewire'));
+ $offset = (int)get_input('offset', 0);
+ $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'thewire', 'offset' => $offset));
- $body = elgg_view_layout("one_column_with_sidebar", $area2);
+ $body = elgg_view_layout("two_column_left_sidebar", '', $area2);
// Display page
page_draw(elgg_echo('thewire:everyone'),$body);
-?>
\ No newline at end of file
+?>
* @return unknown_type
*/
function uservalidationbyemail_page_handler($page) {
+ global $CONFIG;
+
if (isset($page[0]) && $page[0] == 'confirm') {
$code = sanitise_string(get_input('c', FALSE));
$user_guid = get_input('u', FALSE);