New version released in plugin pack from snow.
This plugin is nearly stable,but I still suggest to test it in a local site before use in a public site.
改进到现在已经比较稳定了,不过还是建议先在测试站点上试一下没问题在用在运营中的网站上
What's this?
A modify to the riverdashboard.
Installation
Extract the two folder,riverdashboard and pack_of_roaming_cat into your elgg's mod folder.
What's new in 0.53
What'new in 0.50
TO show image thumb for tidypic,edit tidypic/actions/upload.php,about line 120~130
add
add_to_river('river/object/image/create', 'create', $_SESSION['guid'], $file->guid);
before
} else { //file exceeds file size limit, so delete it
$file->delete();
array_push($not_uploaded, $name);
and make sure riverdashboard is below tidypics in the tool admin panel
==========================
Extra view useage:
echo elgg_view('river/item/extra',
array('performed_by' => $performed_by,
'object' => $object,
'body' => $body,
'show_comment' => TRUE,)
);
in some river item's view.
Examples:
blog/views/default/river/object/blog/create.php
<?php
/**
* Show full content of blog in river
*
* @package ImprovedRiverDashboard
*/
/**
* @author Snow.Hellsing <snow.hellsing@firebloom.cc>
* @copyright FireBloom Studio
* @link http://firebloom.cc
*/
$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
$object = get_entity($vars['item']->object_guid);
$url = $object->getURL();
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
$summary .= elgg_echo("blog:river:create") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
$toggle = "<div><a onclick=\"$('#blog_details-{$object->guid}').toggle();return false;\" class=\"river_item_toggle_details\" href=\"\">".elgg_echo('toggle_details').'</a></div>';
$details = "<div id=\"blog_details-{$object->guid}\" class=\"blog_post\" style=\"display:none\">";
$details .= "<h2>$object->title</h2>";
$details .= elgg_view('output/longtext',array('value'=>$object->description));
$details .= '</div>';
echo elgg_view('river/item/extra',
array('performed_by'=>$performed_by,
'object'=>$object,
'body'=>$summary.$toggle.$details,
'show_comment'=>TRUE));
?>
=======================================================
这是什么?
riverdashboard的修改版
安装
把riverdashboard和pack_of_roaming_cat这俩文件夹解压到elgg的mod目录下
说明
Here comes the screenshot:
View Snow.Hellsing's plugins
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
about the %s problem, i did the fix suggested here, edited the english file (en.php) and edit the line to:
'image:river:created' => " uploaded",
but that just gets rid of the '%s' text, how to display the username in text next to the user's avatar? thanks
I have made some modifications to this plugin to make it look more like facebook.
Some changes I made:
1) if there are no comments, comment box does not show, otherwise show box
2) if there are more than 3 comments, show first and last and a "show more comments" option in the middle
3) change the display to a tabular format , name is displayed on top (like facebook), etc
4) Changed the "show / hide comment" link to just "Comment"
see the screens below. i can post my change code if anybody is interested
oops sorry screens shots got messed up, can't edit my previous post
Yeah magic, post that code man :-)
hmmm ok here are the changes I made to:
mod\riverdashboard\views\default\river\item\extra.php
<?php
/**
* extra view of river item
* replaces the default wrappers inner div
* performer and time,maybe comment of a river item
*
* @package ImprovedRiverDashboard
*/
/**
* @author Snow.Hellsing <snow.hellsing@firebloom.cc>
* @copyright FireBloom Studio
* @link http://firebloom.cc
*/
$performed_by = $vars['performed_by'];
$object = $vars['object'];
$body = $vars['body'];
$show_comment = $vars['show_comment'];
//echo '</div>';//break from basic_river_item_view
?>
<script type="text/javascript">
function addComment(entityId)
{
var cText = "itemCommentForm"+entityId;
document.getElementById(cText).style.display = '';
}
function displayMoreComments(cId,numRows) {
var idName = 'showMore'+cId;
document.getElementById(idName).style.display = 'none';
var i=1;
var rows = parseInt(numRows);
rows = rows - 1;
for (i=1;i<=rows;i++){
cName = 'comment';
cName = cName+cId;
cName = cName+i;
document.getElementById(cName).style.display = '';
}
}
</script>
<table >
<tr>
<td valign="top" align="left">
<?php echo elgg_view("profile/icon",
array(
'entity' => $performed_by,
'size' => 'small'));
?>
</td>
<td>
<table valign="top" align="left">
<tr valign="top">
<b><a href="<?php echo $performed_by->getURL(); ?>"><?php echo $performed_by->name; ?></a></b>
<?php echo $body; ?>
</tr>
<tr>
<div align="left">
<span class="riverTime" color="#808080"><?php echo friendly_time($object->time_created); ?> •</span>
<span class="riverComment"> <a href="nojava.html" onclick="document.getElementById('itemCommentForm<?php echo $object->guid; ?>').style.display = '';return false"> Comment </span>
<br />
</div>
</tr>
<?php
//$entityItem = $object->getContainerEntity();
$count = $object->countAnnotations('generic_comment');
$commentArray = $object->getAnnotations('generic_comment',100,0,"asc");
//$count = sizeof($commentArray);
if ($count == 0) {
;//do nothing
}
else if ($count <= 3) { //show all comments
print("<tr bgcolor=\"#FFEAFF\" align=\"left\"><td>");
echo list_annotations($object->guid,'generic_comment',100);
print("</td></tr>");
}
else { //display first and last comment, with an "show # more comments" option in the middle
$annotation = $commentArray[0];
print("<tr bgcolor=\"#FFEAFF\" align=\"left\"><td>");
echo elgg_view_annotation($annotation, "", false);
print("</td></tr>");
$moreCommentNum = $count - 2;
print("<tr bgcolor=\"#FFEAFF\" align=\"left\"><td id=\"showMore".$object->guid."\" class=\"generic_commentText\">");
print(" <a href=\"#\" onclick=\"javascript:displayMoreComments(".$object->guid.",".$count.");return false\">Show $moreCommentNum more comments...</a>");
print("</td></tr>");
$i = 1;
for ($i = 1; $i < ($count - 1); $i++) {
$annotation = $commentArray[$i];
print("<tr bgcolor=\"#FFEAFF\" align=\"left\"><td style=\"display: none\" id=\"comment".$object->guid.$i."\" >");
echo elgg_view_annotation($annotation,"",false);
print("</td></tr>");
}
$annotation = $commentArray[$count - 1];
print("<tr bgcolor=\"#FFEAFF\" align=\"left\"><td>");
echo elgg_view_annotation($annotation, "", false);
print("</td></tr>");
}
?>
<tr align="left">
<?php
if ($count > 0) {
print("<td align=\"left\" id=\"itemCommentForm".$object->guid."\"");
}
else {
print("<td align=\"left\" id=\"itemCommentForm".$object->guid."\" style=\"display: none;\">");
}
?>
<?php echo elgg_view('river/forms/comment',array('entity' => $object));?>
</td>
</tr>
</table>
</td>
</tr>
</table>
=========
in mod\riverdashboard\views\default\river\item\wrapper.php,
I removed the friendly time code as it already displayed elsewhere
=========
my mod\riverdashboard\views\default\river\forms\comment.php
<?php
/**
* Elgg comments add form
* Customized for river dashboard use by Snow.Hellsing
*
* @package Elgg
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd <info@elgg.com>
* @copyright Curverider Ltd 2008-2009
* @link http://elgg.com/
*
* @uses $vars['entity']
*/
/**
* @author Snow.Hellsing <snow.hellsing@firebloom.cc>
* @copyright FireBloom Studio
* @link http://firebloom.cc
*/
if (isset($vars['entity']) && isloggedin()) {
$form_body = elgg_view('input/text',array('internalname' => 'generic_comment'));
$form_body .= elgg_view('input/hidden', array('internalname' => 'entity_guid', 'value' => $vars['entity']->getGUID()));
$form_body .= elgg_view('input/submit', array('value' => elgg_echo("river:comment:post")));
?>
<div class="generic_comment"><!-- start of generic_comment div -->
<div class="generic_comment_details">
<?php echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/riverdashboard/comment"));?>
</div><!-- end of generic_comment_details -->
</div><!-- end of generic_comment div -->
<?php
}//if (isset($vars['entity']) && isloggedin())
?>
========
views/default/annotation/generic_comment.php
<?php
/**
* Elgg generic comment
*
* @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-2009
* @link http://elgg.org/
*
*/
$owner = get_user($vars['annotation']->owner_guid);
?>
<div class="generic_comment"><!-- start of generic_comment div -->
<div class="generic_comment_icon">
<?php
echo elgg_view("profile/icon",
array(
'entity' => $owner,
'size' => 'small'));
?>
</div>
<div class="generic_comment_details">
<p class="generic_comment_owner">
<a href="<?php echo $owner->getURL(); ?>"><?php echo $owner->name; ?></a> <?php echo friendly_time($vars['annotation']->time_created); ?>
</p>
<!-- output the actual comment -->
<?php echo elgg_view("output/longtext",array("value" => $vars['annotation']->value)); ?>
<?php
// if the user looking at the comment can edit, show the delete link
if ($vars['annotation']->canEdit()) {
?>
<p>
<?php
echo elgg_view("output/confirmlink",array(
'href' => $vars['url'] . "action/comments/delete?annotation_id=" . $vars['annotation']->id,
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
));
?>
</p>
<?php
} //end of can edit if statement
?>
</div><!-- end of generic_comment_details -->
</div><!-- end of generic_comment div -->
and my related css changes:
/* ***************************************
GENERIC COMMENTS
*************************************** */
.generic_comment_owner {
font-size: 90%;
color:#666666;
}
.generic_commentText {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding:5px;
margin:0 5px 5px 5px;
border-bottom:1px solid #999999;
}
.generic_comment {
background:#FFEAFF;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding:5px;
margin:0 5px 5px 5px;
border-bottom:1px solid #999999;
}
.generic_comment_icon {
float:left;
}
.generic_comment_details {
margin-left: 30px;
width: 350px;
}
.generic_comment_details p {
margin: 0 0 5px 0;
}
.generic_comment_owner {
color:#666666;
margin: 0px;
font-size:90%;
}
.riverTime {
color: #808080;
font-size: 10px;
}
.riverComment {
color: blue;
font-size: 10px;
}
Has anyone got the code (or a link to the code) to make a riverpost with a new comment move the whole post to the top of the river. This was described in this post....
i found it!
some of us have been getting a empty white page on the riverdashboard
it was a <? tag in riverdashboard/views/default/river/item/extra.php
if your server is not configed to accept short php tags (<? vs <?php) you get the blank page
riverdashboard/views/default/river/item/extra.php, line 48
change to:
<?php
if ($show_comment) {
?>
cheers
tmo
@tdnguyen16
To make the river display code for both friends and yourself in the one river stream...
in engine/lib/river2.php replace the get_river_items function with the following:
This will allow $subject_relationship to be passed as an array.
Then in mod/riverdashboard/index.php
search for "switch($orient) {" and then change the "case 'friends':" to
This will cause both your own AND your friends posts to display when you click on the "friends" tab.
thanks chrisg, i will try out the solution you provided, much appreciated
@timomeara Thanks so much.New release will include this fix.And sorry for all guys troubled by this mistake.
@jededitor I can't repeat the icon overlaping problem,may this caused by your site's theme?
@Andrew this problem solved.New release won't be long.
@tdnguyen16 Thanks so much for your work^^ May I include your work in the next release?
@imcobarn riverdashboard/index.php,line 41-51,append contents to $area1.
@snow I suspect you are right as the plugin uses the site defaults to display those lines. Which plugin handles those BTW as I think I will remove the icons?
@jededitor I'm sure.Disable all plugins than enable one by one may be a way to catch the bayguy.^^
snow.hellsing sure no problem you can use any part of the code as you see fits.
@snow
Hah! Typical - its something in my theme....
@Snow
Got it! Thanks for the plugin pointer Snow!
Has anyone looked into letting useres and admins delete comments. I thought this would be a simple thing that other people already have done so I dont have to spend time on it. If not Ill work on it and post the results.
gh
a quick poor man fix to "%s added the image %s to album %s"
I changed
$summary .= elgg_echo("image:river:created");
in
elgg/mod/riverdashboard/views/default/river/object/image/create.php
to
$summary .= sprintf(elgg_echo("image:river:created"),$performed_by->name, $image_link, $album_link);
but
the message is: Michal added the image to album
so missing image link and album name;)
but as I said, it was quick fix;)
Michal
Hi!
I have the same problem that jededitor
the icon is overlapped by the text!
where is the problem? thanks
Small Edit to my patch to make the river display entries for both yourself and friends in one stream.
8 lines below "ADDED BY CHRISG" should read:
@dagrfics: To remove the small icons set:
in the river view for the entry: (eg: mod/groups/views/default/river/group/create.php)
Hi, Im a new bie at elgg...can anyone help me with
-How do i remove all feeds from the river dash, i want the friends and mine tab to appear 1st and prefereably together...
Thanks
Antonio
Found the secret to the icon text overlap...
add spaces.. 4 of them do it... in the create.php for the different mods
ie... for The Wire
go to mod/thewire/views/default/river/object/thewire/create.php
then change
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
to
$url = " <a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
this does it nicely
By the way... this is a brilliant mod... brilliant!
here is a fix for the tidypics issue with %s displaying:
in views/default/river/object/image/create.php
replace the contents between the php tags with this:
/**
* @author Snow.Hellsing <snow.hellsing@firebloom.cc>
* @copyright FireBloom Studio
* @link http://firebloom.cc
*/
$performed_by = get_entity($vars['item']->subject_guid);
//$image = get_entity($vars['item']->object_guid);
$object = get_entity($vars['item']->object_guid);
if($object->title) {
$title = $object->title;
} else {
$title = "untitled";
}
$url = $vars['url'];
$album = get_entity($object->container_guid);
$mime = $object->mimetype;
$person_link = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
$image_link = "<a href=\"" . $object->getURL() . "\">" . $title . "</a>";
$album_link = "<a href='". $album->getURL() . "'>" . $album->title . "</a>";
$summary .= sprintf(elgg_echo("image:river:created"),$person_link, $image_link, $album_link);
$goto_full = "<a href=\"{$object->getURL()}\" target=\"_blank\" class=\"goto_full\" id=\"image_toggle-{$object->guid}\">".elgg_echo('river:image:goto_full')."</a>";
$thumb = "<img src=\"{$url}mod/tidypics/thumbnail.php?file_guid={$object->guid}&size=small\" border=\"0\" alt=\"thumbnail\"/>";
echo elgg_view('river/item/extra',
array('performed_by'=>$performed_by,
'object'=>$object,
'body'=>$summary.' - '.$goto_full.'<br />'.$thumb,
'show_comment'=>TRUE)
);
@ David Connolly and anyone with the icon overlap problem. I tried David Connolly solution but it did nothing for me. I then removed the riverdashboard and pack_of_roaming_cat, and I also moved my original riverdashboard that I named to riverdashboar_org outside of the mod folder. I then moved the two folders(riverdashboard and pack_of_roaming_cat) back to the mod folder. I then made sure the riverdashboard is below tidypics in the tool admin panel and it works ... for the most part...