Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What about an update for Elgg 4.3.x #8

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 1 addition & 126 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,129 +8,4 @@ PLUGIN DESCRIPTION
=============================

adds an area for all major elgg entity types that renders a list of related items from the installation, matched by tags.
the greater the number of matching tags between the presently viewed item and the others in the site, the more 'related' they are identified to be.

=============================
CHANGELOG
=============================

todo:
links to create a related item (with same tags as present item).
sidebar widget view.

2.0: added compatibility for elgg 2.0

1.0: removed javascript and added CSS flexgrid
added: icons for tidypics albums and bookmarks (if suitable plugin is installed to provide bookmark icons).
changed: icon size from medium to small for various object types
fixed: full list of items was not maintaining consistent ordering

0.9.2: fixed php warning about array

0.7.9
fixed: pagination missing on 'view all related items' page
added: count of related items to 'view all related items' link
changed: 'view all related items' link is only rendered when more are available than shown on the current item's page
0.7.8
fixed: items being shown when no tags are present for current item
0.7.7
fixed: related item subtype lable pluralisation
fixed: admin option for subtype selection was being ignored
fixed: set css size of thumbnail images
0.7.6
fixed: related item list now fits horizontally if item count is less than columns chosen in admin
added: option to place related items before or after comments
0.7.5
fixed: jquery error on resize window event
changed: icon grabbing php
added: option to enable / disable image icons
added: user icon shows if no item icon is available.
0.7.4
fixed: breadcrumb trail for 'view all related items' list is now complete for main subtypes
added: image icon support for blog_tools and au_sets (pinboards)
added: item subtype label at bottom of each related item box
fixed: css issues with chromium
0.7.3
changed: centered related items in their list
changed: padding of list items now fits better with percentages used for box widths
0.7.2
fixed: no boxes are now rendered if no related items are available
changed: missing parameters for get_related_entities functions (+ removed strict input rules for function)
---
0.7.1
changed: optimised algorithm by moving php code to sql
removed: limit on amount of tags to search for (not needed now code is more efficient)
---
0.7
added: view all related items page
---
0.6.9
fixed: checkbox labels in admin panel (1.8 deprecated warnings)
changed: further refined php logic for efficiency
fixed: php logic errors with maximum tag variable
---
0.6.8
added: further simplified code for efficiency
---
0.6.7
fixed: returned the elggobject check that filters out non objects
---
0.6.6
changed: improved performance of sql / php
added: icon for title text (you need to use a custom css value to populate this image)
---
0.6.5
fixed: added excerpt limit for related item titles
---
0.6.4
fixed: show dates option was not functional in admin panel
changed: language file strings in admin
---
0.6.3
added: thumbnail images for videos and files
added: css codes to identify thumbnail images that are stored by elgg
---
0.6.2
added: css theming for default elgg theme
fixed: logic error causing fatal break/continue message in logs.
---
0.6.1
added: options for jquery heights and number of grid columns.
---
0.6
added: admin panel for configuration of search and diplay
fixed: logic errors in certain circumstances
---
0.5.2
fixed: check for zero tags
---
0.5.1
fixed: image thumbnail path is now correctly formed for tidypics
---
0.5
added: image icons for image items
fixed: php warning for array
changed: optimised code for performance
---
0.4.2
fixed: issue with 0.4.1 where single tagged items were listed incorrectly
---
0.4.1
fixed: php warning for array
---
0.4
added: matched keywords are now displayed for each related item
added: changed css for icon element (you will need to play with this on your own site - icon images are not included).
changed: made css for name and date/time smaller
---
0.3
added: now shows related items of most elgg entity types (defined in the start.php file), not just entities of the same type as the one being viewed.
fixed: added jquery to make all list boxes the same height.
added: the box for each type of entity now has its own css class to allow customisation of appearance (see screenshot)
---
0.2
fixed: removed limit from search query: the related items list now correclty contains items from the entiree database rather than just comparing simlarity for the first 10 found.
changed: css - hover over colour changes for hyperlinks.
---
0.1
initial release
the greater the number of matching tags between the presently viewed item and the others in the site, the more 'related' they are identified to be.
35 changes: 35 additions & 0 deletions classes/RelatedItems.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
use Elgg\DefaultPluginBootstrap;

class RelatedItems extends DefaultPluginBootstrap {

public function init() {
$comment_position = elgg_get_plugin_setting('comment_position', 'related-items');
$comment_position = ($comment_position == 'bottom') ? 501 : 0;

elgg_extend_view('page/elements/comments', 'related-items/related-items', $comment_position);
elgg_extend_view('discussion/replies', 'related-items/related-items', $comment_position);
elgg_extend_view('admin.css', 'related-items/admin', 1);
elgg_extend_view('elgg.css', 'related-items/css');

elgg_register_event_handler("action:validate", "plugins/settings/save", function(\Elgg\Event $event){
$params = $event->getParams();
$return = $event->getValue();

$request = $params["request"];
if($request->getParam('plugin_id') == "related-items") {
$data = $request->getParam('params');
if(is_array($data['selectfrom_subtypes'])) {
$data['selectfrom_subtypes'] = implode(",", $data['selectfrom_subtypes']);
}
if(is_array($data['renderto_subtypes'])) {
$data['renderto_subtypes'] = implode(",", $data['renderto_subtypes']);
}
$request->setParam('params', $data);
}

return $return;

});
}
}
15 changes: 15 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "related-items",
"description": "Displays related items for present entity - selected by tags.",
"homepage": "http://www.campuskarma.in/",
"type": "elgg-plugin",
"keywords": ["elgg", "plugin"],
"license": "Private Use",
"support": {
"source": "https://github.com/rohit1290/related-items",
"issues": "https://github.com/rohit1290/related-items/issues"
},
"conflict": {
"elgg/elgg": "<6.0"
}
}
17 changes: 17 additions & 0 deletions elgg-plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
require_once __DIR__ . '/lib/related-items-lib.php';

return [
'plugin' => [
'name' => 'Related Items',
'version' => '6.0',
'dependencies' => [],
],
'bootstrap' => RelatedItems::class,
'routes' => [
'collection:object:related' => [
'path' => '/related/{guid}',
'resource' => 'related/default',
],
]
];
4 changes: 2 additions & 2 deletions languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'related-items:title' => 'Related items',
'related-items:display-options' => 'Display options',
'related-items:select-related' => 'Show only items that are related to the current item? or ignore similarity and show <i>More items</i> instead of <i>Related items</i>: ',
'related-items:more-items' => 'More items',
'related-items:more-items' => 'More items',
'related-items:item-select-options' => 'Options for selection of related items',
'related-items:limit-date' => 'Show only items created between now and a specific timing period?<br/>(timing format is: <i>negative number</i> followed by <i>time interval</i> e.g. day/week/month/year): ',
'related-items:current-owner' => 'Owner of current item',
Expand All @@ -19,7 +19,7 @@
'related-items:max_tags_to_match' => 'Set a maximum limit to the number of tags to match?: ',
'related-items:show_names' => 'Display the uploader name for each related item?: ',
'related-items:show_dates' => 'Display the creation date for each related item?: ',
'related-items:show_timestamps' => 'Display the creation date as a timestamp? (choosing <i>no</i> here will result in friendly times being used.): ',
'related-items:show_timestamps' => 'Display the creation date as a timestamp? (choosing <i>no</i> here will result in friendly times being used.): ',
'related-items:show_tags' => 'Display the list of tags that match for each related item?: ',
'related-items:show_types' => 'Display the subtype of each related item?: ',
'related-items:show_icons' => 'Display the image icon of each related item? (creator icon will be used if no item icon exists): ',
Expand Down
Loading