Ejemplo n.º 1
0
<?php

/**
 * Display latest comments on objects
 **/
if ($vars['comments']) {
    global $CONFIG;
    echo "<h3>" . elgg_echo('generic_comments:latest') . "</h3>";
    foreach ($vars['comments'] as $comment) {
        //grab the entity the comment is on
        $entity = get_entity($comment->entity_guid);
        //comment owner
        $comment_owner = get_user($comment->owner_guid);
        $friendlytime = friendly_time($comment->time_created);
        // get timestamp for comment
        //set the title
        if ($entity->title) {
            $objecttitle = $entity->title;
        } else {
            $objecttitle = elgg_echo('file:untitled');
        }
        //if the entity has been deleted, don't link to it
        if ($entity) {
            $url = $entity->getURL();
            // get url to file for comment link
            $url_display = "<a href=\"{$url}\">{$objecttitle}</a>";
        } else {
            $url_display = $objecttitle;
        }
        echo "<div class='generic_comment latest clearfloat'><span class='generic_comment_icon'>" . elgg_view("profile/icon", array('entity' => $comment_owner, 'size' => 'tiny')) . "</span>";
        echo "<div class='generic_comment_details'><span class='entity_subtext'><a href=\"{$vars['url']}pg/profile/{$comment_owner->username}\">{$comment_owner->name}</a> " . elgg_echo('on') . " <span class='entity_title'>{$url_display}</span> ({$friendlytime})</span></div>";
Ejemplo n.º 2
0
	<?php 
//get the num of shares the user want to display
$num = $vars['entity']->num_display;
//if no number has been set, default to 4
if (!$num) {
    $num = 4;
}
//grab the users tasked items
$shares = get_entities('object', 'tasks', 0, "", $num, 0, false);
if ($shares) {
    foreach ($shares as $s) {
        //get the owner
        $owner = $s->getOwnerEntity();
        //get the time
        $friendlytime = friendly_time($s->time_created);
        //get the user icon
        $icon = elgg_view("profile/icon", array('entity' => $owner, 'size' => 'tiny'));
        //get the task title
        $info = "<p class=\"shares_title\"><a href=\"{$s->getURL()}\">{$s->title}</a></p>";
        //get the user details
        $info .= "<p class=\"shares_timestamp\"><small><a href=\"{$owner->getURL()}\">{$owner->name}</a> {$friendlytime}</small></p>";
        //get the task description
        if ($s->description) {
            $info .= "<a href=\"javascript:void(0);\" class=\"share_more_info\">" . elgg_echo('tasks:more') . "</a><br /><div class=\"share_desc\"><p>{$s->description}</p></div>";
        }
        //display
        echo "<div class=\"shares_widget_wrapper\">";
        echo "<div class=\"shares_widget_icon\">" . $icon . "</div>";
        echo "<div class=\"shares_widget_content\">" . $info . "</div>";
        echo "</div>";
	<div class="river_<?php 
echo $subtype;
?>
">
		<div class="river_<?php 
echo $event;
?>
">
			<p class="river_<?php 
echo $subtype;
?>
_<?php 
echo $event;
?>
">
				<?php 
echo $vars['entry'];
?>
				<span class="river_item_time">
					(<?php 
echo friendly_time($time);
?>
)
				</span>
			</p>
		</div>
	</div>

</div>
Ejemplo n.º 4
0
    $info = "<p class=\"latest_discussion_info\">" . sprintf(elgg_echo('dgroup:created'), $forum_created, $counter) . "<br /><span class=\"timestamp\">";
    if ($last_time) {
        $info .= sprintf(elgg_echo('dgroups:lastupdated'), friendly_time($last_time), " <a href=\"" . $u->getURL() . "\">" . $u->name . "</a>");
    }
    $info .= '</span></p>';
    //get the dgroup avatar
    $icon = elgg_view("profile/icon", array('entity' => $dgroup, 'size' => 'small'));
    //get the dgroup and topic title
    if ($dgroup instanceof ElggGroup) {
        $info .= "<p>" . elgg_echo('dgroup') . ": <a href=\"{$dgroup->getURL()}\">{$dgroup->name}</a></p>";
    }
    $info .= "<p>" . elgg_echo('topic') . ": <a href=\"{$vars['url']}mod/dgroups/topicposts.php?topic={$vars['entity']->guid}&dgroup_guid={$dgroup->guid}\">{$title}</a></p>";
    //get the forum description
    //$info .= $description;
} else {
    $info = "<span class=\"latest_discussion_info\"><span class=\"timestamp\">" . sprintf(elgg_echo('dgroup:created'), $forum_created, $counter) . "</span>";
    if ($last_time) {
        $info .= "<br /><span class='timestamp'>" . elgg_echo('dgroups:updated') . " " . friendly_time($last_time) . " by <a href=\"" . $u->getURL() . "\">" . $u->name . "</a></span>";
    }
    if (dgroups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
        // display the delete link to those allowed to delete
        $info .= "<br /><span class=\"delete_discussion\">" . elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/dgroups/deletetopic?topic=" . $vars['entity']->guid . "&dgroup=" . $vars['entity']->container_guid, 'text' => " ", 'confirm' => elgg_echo('deleteconfirm'))) . "</span>";
    }
    $info .= "</span>";
    //get the user avatar
    $icon = elgg_view("profile/icon", array('entity' => $topic_owner, 'size' => 'small'));
    $info .= "<p>" . elgg_echo('dgroups:started') . " " . $topic_owner->name . ": <a href=\"{$vars['url']}mod/dgroups/topicposts.php?topic={$vars['entity']->guid}&dgroup_guid={$dgroup->guid}\">{$title}</a></p>";
    $info .= "<div class='clearfloat'></div>";
}
//display
echo elgg_view_listing($icon, $info);
Ejemplo n.º 5
0
            if ($counter == 1 && $comment_count >= 4 || $counter == 0 && $comment_count == 2 || $counter == 1 && $comment_count == 3) {
                $alt = 'penultimate';
            }
        }
        //display comment
        echo "<div class='river_comment {$alt} clearfloat'>";
        echo "<span class='river_comment_owner_icon'>";
        echo elgg_view("profile/icon", array('entity' => $comment_owner, 'size' => 'tiny'));
        echo "</span>";
        //truncate comment to 150 characters
        if (strlen($gc->value) > 150) {
            $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "...";
        }
        $contents = strip_tags($gc->value);
        echo "<div class='river_comment_contents'>";
        echo "<a href=\"{$comment_owner_url}\">" . $comment_owner->name . "</a> " . parse_urls($contents);
        echo "<span class='entity_subtext'>" . friendly_time($gc->time_created) . "</span>";
        echo "</div></div>";
        $counter++;
    }
    echo "</div>";
}
//display the comment link
if ($vars['item']->type != 'user') {
    //for now don't display the comment link on bookmarks and wire messages
    if ($vars['item']->subtype != 'thewire' && $vars['item']->subtype != 'conversations' && $vars['item']->subtype != 'bookmarks' && $vars['item']->subtype != '') {
        echo "<a class='comment_link' href=\"{$object_url}\">Comment</a>";
    }
}
?>
</div>
     }
     //end of for each loop
 }
 //end of inbox if statement
 // get the correct display for the sentbox view
 if ($vars['page_view'] == "sent") {
     $counter = 0;
     foreach ($vars['entity'] as $message) {
         //make sure to only display the messages that have not been 'deleted' (1 = deleted)
         if ($message->hiddenTo != 1) {
             //get the correct user entity
             $user = get_entity($message->toId);
             echo "<div class=\"message_sent\" />";
             echo "<table width=\"100%\" cellspacing='0'><tr>";
             //get the icon for the user the message was sent to
             echo "<tr><td width='200px'>" . elgg_view("profile/icon", array('entity' => $user, 'size' => 'tiny')) . "<div class='msgsender'><b>" . $user->name . "</b><br /><small>" . friendly_time($message->time_created) . "</small></div></td>";
             //display the message title
             echo "<td><div class='msgsubject'>";
             echo "<input type=\"checkbox\" name=\"message_id[]\" value=\"{$message->guid}\" /> ";
             echo "<a href=\"{$message->getURL()}?type=sent\">" . $message->title . "</a></div></td>";
             //display the link to 'delete'
             echo "<td width='70px'>";
             echo "<div class='delete_msg'>" . elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/messages/delete?message_id=" . $message->getGUID() . "&type=sent&submit=" . urlencode(elgg_echo('delete')), 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'))) . "</div>";
             echo "</td></tr></table></div>";
         }
         //close hiddeTo if statement
         $counter++;
         if ($counter == $limit) {
             break;
         }
     }
Ejemplo n.º 7
0
<?php

/**
 * New wire post view for the activity stream
 */
$owner = $vars['entity']->guid;
$url_to_wire = $vars['url'] . "pg/thewire/" . $vars['entity']->username;
//grab the users latest from the wire
$latest_wire = get_entities("object", "thewire", $owner, "", 1, 0, false, 0, null);
if ($latest_wire) {
    foreach ($latest_wire as $lw) {
        $content = $lw->description;
        $time = "<span> (" . friendly_time($lw->time_created) . ")</span>";
    }
}
if ($latest_wire) {
    echo "<div class=\"profile_status\">";
    echo $content;
    if ($owner == $_SESSION['user']->guid) {
        echo " <a class=\"status_update\" href=\"{$url_to_wire}\">update</a>";
    }
    echo $time;
    echo "</div>";
}
 */
?>

<div class="messageboard"><!-- start of messageboard div -->
	
    <!-- display the user icon of the user that posted the message -->
    <div class="message_sender">	        
        <?php 
echo elgg_view("profile/icon", array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny'));
?>
    </div>
    
    <!-- display the user's name who posted and the date/time -->
    <p class="message_item_timestamp">
        <?php 
echo get_entity($vars['annotation']->owner_guid)->name . " " . friendly_time($vars['annotation']->time_created);
?>
    </p>
    		
	<!-- output the actual comment -->
	<div class="message"><?php 
echo elgg_view("output/longtext", array("value" => parse_urls($vars['annotation']->value)));
?>
</div>
	<div class="message_buttons">
		    
	<?php 
// if the user looking at the comment can edit, show the delete link
if (issuperadminloggedin() || $vars['user']->guid == $vars['annotation']->owner_guid) {
    echo "<div class='delete_message'>" . elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/messageboard/delete?annotation_id=" . $vars['annotation']->id, 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'))) . "</div>";
}
Ejemplo n.º 9
0
     }
     //end of for each loop
 }
 //end of inbox if statement
 // get the correct display for the sentbox view
 if ($vars['page_view'] == "sent") {
     $counter = 0;
     foreach ($vars['entity'] as $message) {
         //make sure to only display the messages that have not been 'deleted' (1 = deleted)
         if ($message->hiddenTo != 1) {
             //get the correct user entity
             $user = get_entity($message->toId);
             echo "<div class='message sent clearfloat'>";
             //get the icon for the user the message was sent to
             echo "<div class='entity_listing_icon'>" . elgg_view("profile/icon", array('entity' => $user, 'size' => 'tiny')) . "</div>";
             echo "<div class='entity_listing_info'><div class='message_sender'>" . $_SESSION['user']->name . "<p class='entity_subtext'>" . friendly_time($message->time_created) . "</p></div>";
             // display message subject
             echo "<div class='message_subject'>";
             //display the link to 'delete'
             echo "<div class='delete_button'>" . elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/messages/delete?message_id=" . $message->getGUID() . "&type=sent&submit=" . urlencode(elgg_echo('delete')), 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'))) . "</div>";
             echo "<p class='entity_title'><input type='checkbox' name=\"message_id[]\" value=\"{$message->guid}\" /> ";
             echo "<a href=\"{$message->getURL()}?type=sent\">" . $message->title . "</a></p>";
             echo "</div></div></div>";
             // close the message container
         }
         //close hiddeTo if statement
         $counter++;
         if ($counter == $limit) {
             break;
         }
     }
<?php

require_once dirname(dirname(__FILE__)) . "/engine/start.php";
require_once '../../jpgraph-3.0.7/src/jpgraph.php';
require_once '../../jpgraph-3.0.7/src/jpgraph_bar.php';
$guid = $page_owner->guid;
$myid = get_loggedin_user()->getGUID();
$message_count = get_entities_from_metadata("toId", get_loggedin_user()->getGUID(), "object", "messages", $guid, 1000);
//print_r($message_count);
$cnt = count($message_count);
//print $cnt;
$i = 0;
$day = "";
foreach ($message_count as $value) {
    //print $messages->title;
    $time_created = friendly_time($value->time_created);
    $time_created = explode(" ", $time_created);
    $day = substr($time_created[1], 7) . '-' . $time_created[2] . '-' . $time_created[3];
    if ($count_msgs[$day]) {
        $count_msgs[$day]->day = $day;
        $count_msgs[$day]->count++;
    } else {
        $count_msgs[$day]->day = $day;
        $count_msgs[$day]->count = 1;
    }
}
$days = array();
$counts = array();
foreach ($count_msgs as $rows) {
    array_push($days, $rows->day);
    array_push($counts, $rows->count);
    if ($vars['entity']->canEdit()) {
        echo "<div class='delete_note'>" . elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/thewire/delete?thewirepost=" . $vars['entity']->getGUID(), 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'))) . "</div>";
    }
    //end of can edit if statement
    ?>
	    </div>
	    
		
		<?php 
    echo "<b>{$user_name}: </b>";
    $desc = $vars['entity']->description;
    $desc = preg_replace('/\\@([A-Za-z0-9\\_\\.\\-]*)/i', '@<a href="' . $vars['url'] . 'pg/thewire/$1">$1</a>', $desc);
    echo parse_urls($desc);
    ?>
		
		
		<div class="clearfloat"></div>
		</div>
		<div class="note_date">
		
		<?php 
    echo elgg_echo("thewire:wired") . " " . sprintf(elgg_echo("thewire:strapline"), friendly_time($vars['entity']->time_created));
    echo " via " . elgg_echo($vars['entity']->method) . ".";
    ?>
		</div>
		
		
	</div>
</div>
<?php 
}
Ejemplo n.º 12
0
<?php

/**
 * Elgg bookmark river entry view
 * 
 * @package ElggBookmarks
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider <*****@*****.**>
 * @copyright Curverider Ltd 2008-2010
 * @link http://elgg.org/
 */
$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>";
$string = sprintf(elgg_echo("bookmarks:river:created"), $url) . " ";
$string .= "<a href=\"" . $object->address . "\">" . $object->title . "</a> <span class='entity_subtext'>" . friendly_time($object->time_updated) . "</span>";
echo $string;
Ejemplo n.º 13
0
<?php

$performed_by = get_entity($vars['item']->subject_guid);
// $statement->getSubject();
$object = get_entity($vars['item']->object_guid);
$url = $object->getURL();
$string = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}:</a> ";
$desc .= $object->description;
$desc = preg_replace('/\\@([A-Za-z0-9\\_\\.\\-]*)/i', '@<a href="' . $vars['url'] . 'pg/thewire/$1">$1</a>', $desc);
$string .= parse_urls($desc);
$string .= " <span class='entity_subtext'>" . friendly_time($object->time_created) . "</span> <a href=\"{$vars['url']}mod/thewire/add.php?wire_username={$object->getOwnerEntity()->username}\" class='reply_link'>" . elgg_echo('thewire:reply') . "</a>";
?>

<?php 
echo $string;
Ejemplo n.º 14
0
 * @link http://elgg.org/
 */
$full = isset($vars['full']) ? $vars['full'] : FALSE;
$blog = isset($vars['entity']) ? $vars['entity'] : FALSE;
if (!$blog) {
    return '';
}
$owner = get_entity($blog->owner_guid);
$container = get_entity($blog->container_guid);
$linked_title = "<a href=\"{$blog->getURL()}\" title=\"" . htmlentities($blog->title) . "\">{$blog->title}</a>";
$categories = elgg_view('categories/view', $vars);
$excerpt = $blog->excerpt;
$body = $blog->description;
$owner_icon = elgg_view("profile/icon", array('entity' => $owner, 'size' => 'tiny'));
$tags = elgg_view('output/tags', array('tags' => $blog->tags));
$date = friendly_time($blog->publish_date);
// The "on" status changes for comments, so best to check for !Off
if ($blog->comments_on != 'Off') {
    $comments_count = elgg_count_comments($blog);
    $comments_link = "<a href=\"{$blog->getURL()}#annotations\">" . sprintf(elgg_echo("comments"), $comments_count) . '</a>';
} else {
    $comments_link = '';
}
// links to delete or edit.
$edit = '';
if ($blog->canEdit()) {
    $edit_url = "{$vars['url']}pg/blog/{$owner->username}/edit/{$blog->getGUID()}/";
    $edit_link = "<a href=\"{$edit_url}\">" . elgg_echo('edit') . '</a>';
    $delete_url = "{$vars['url']}action/blog/delete?guid={$blog->getGUID()}";
    $delete_link = "<span class='delete_button'>" . elgg_view('output/confirmlink', array('href' => $delete_url, 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'))) . "</span>";
    $status = '';
		<div class="generic_comment_details">
    		
		    <!-- output the actual comment -->
		    <?php 
echo elgg_view("output/longtext", array("value" => $vars['annotation']->value));
?>
		    
		    <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>
		    
		    <?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 
}
Ejemplo n.º 16
0
                	<a name="<?php 
echo $vars['entity']->id;
?>
"></a>
                    <?php 
//get infomation about the owner of the comment
if ($post_owner = get_user($vars['entity']->owner_guid)) {
    //display the user icon
    echo "<div class=\"post_icon\">" . elgg_view("profile/icon", array('entity' => $post_owner, 'size' => 'small')) . "</div>";
    //display the user name
    echo "<p><b>" . $post_owner->name . "</b><br />";
} else {
    echo "<p>";
}
//display the date of the comment
echo "<small>" . friendly_time($vars['entity']->time_created) . "</small></p>";
?>
                </td>
                <td width="70%">       
                    <?php 
//display the actual message posted
echo parse_urls(elgg_view("output/longtext", array("value" => $vars['entity']->value)));
?>
                </td>
            </tr>
        </table>
		<?php 
//if the comment owner is looking at it, or admin, or group owner they can edit
if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
    ?>
		        <p class="topic-post-menu">
/**
 * Elgg thewire view page
 * 
 * @package ElggTheWire
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider <*****@*****.**>
 * @copyright Curverider Ltd 2008-2010
 * @link http://elgg.com/
 * 
 */
//grab the current site message
$site_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'sitemessage', 'limit' => 1));
if ($site_message) {
    $mes = $site_message[0];
    $message = $mes->description;
    $dateStamp = friendly_time($mes->time_created);
    $delete = elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/riverdashboard/delete?message=" . $mes->guid, 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm')));
}
?>

	<div class="sidebarBox">
	
<?php 
//if there is a site message
if ($site_message) {
    ?>

	<?php 
    echo "<h3>" . elgg_echo("sitemessages:announcements") . "</h3>";
    echo "<p><small>" . elgg_echo("sitemessages:posted") . ": " . $dateStamp;
    //if admin display the delete link
$entity = $vars['entity'];
// display the entity's owner by default if available.
// @todo allow an option to switch to displaying the entity's icon instead.
$type = $entity->getType();
if ($type == 'user' || $type == 'group') {
    $icon = elgg_view('profile/icon', array('entity' => $entity, 'size' => 'small'));
} elseif ($owner = $entity->getOwnerEntity()) {
    $icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'small'));
} else {
    // display a generic icon if no owner, though there will probably be
    // other problems if the owner can't be found.
    $icon = elgg_view('graphics/icon', array('entity' => $entity, 'size' => 'small'));
}
$title = $entity->getVolatileData('search_matched_title');
$description = $entity->getVolatileData('search_matched_description');
$extra_info = $entity->getVolatileData('search_matched_extra');
$url = $entity->getURL();
$title = "<a href=\"{$url}\">{$title}</a>";
$tc = $entity->time_created;
$tu = $entity->time_updated;
$time = friendly_time($tu > $tc ? $tu : $tc);
echo <<<___END
\t<div class="search_listing">
\t\t<div class="search_listing_icon">{$icon}</div>
\t\t<div class="search_listing_info">
\t\t\t<p class="ItemTitle">{$title}</p>{$description}
\t\t\t<p class="ItemTimestamp">{$time} {$extra_info}</p>
\t\t</div>
\t</div>
___END;
// php bug. must have close tag after heredocs
Ejemplo n.º 19
0
            echo $vars['url'];
            ?>
',<?php 
            echo $vars['entity']->getGUID();
            ?>
,<?php 
            echo $video->getGUID();
            ?>
)">
              <?php 
            echo izapWordWrap_izap_videos($video->title, 30, TRUE);
            ?>
      </a>
    </p>
    <p class="izap_shares_timestamp" align="right">
            <?php 
            echo friendly_time($video->time_created);
            ?>
    </p>
  </div>

  <div class="clearfloat"></div>
</div>
      <?php 
        }
    }
    $userVideos = $vars['url'] . 'pg/videos/list/' . $vars['entity']->getOwnerEntity()->username;
    echo '<div class="contentWrapper" align="right"><a href="' . $userVideos . '">' . elgg_echo('izap_videos:everyone') . '</a></div>';
} else {
    echo '<div class="contentWrapper">' . elgg_echo('izap_videos:notfound') . '</div>';
}
Ejemplo n.º 20
0
$full_view = elgg_extract('full_view', $vars, false);
if ($full_view) {
    echo elgg_view('object/image/full', $vars);
} else {
    echo elgg_view('object/image/summary', $vars);
}
return true;
global $CONFIG;
include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/lib/exif.php";
$image = $vars['entity'];
$image_guid = $image->getGUID();
$tags = $image->tags;
$title = $image->getTitle();
$desc = $image->description;
$owner = $image->getOwnerEntity();
$friendlytime = friendly_time($image->time_created);
/********************************************************************
 *
 * search view of an image
 *
 ********************************************************************/
if (get_context() == "search") {
    // gallery view is a matrix view showing just the image - size: small
    if (get_input('search_viewtype') == "gallery") {
        ?>
<div class="tidypics_album_images">
	<a href="<?php 
        echo $image->getURL();
        ?>
"><img src="<?php 
        echo $vars['url'];
Ejemplo n.º 21
0
    // display the user name
    echo "<div class='entity_listing_info'>";
    // if comment owner, group owner, or site admin - display edit and delete options
    if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
        echo "<div class='entity_metadata'>";
        echo "<span class='delete_button'>" . elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/groups/deletepost?post=" . $vars['entity']->id . "&topic=" . get_input('topic') . "&group=" . get_input('group_guid'), 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'))) . "</span>";
        echo "<a class='link' onclick=\"elgg_slide_toggle(this,'.topic','.edit_comment');\">" . elgg_echo('edit') . "</a>";
        echo "</div>";
    }
    echo "<p class='entity_title'>" . $post_owner->name . "</p>";
} else {
    echo "<div class='entity_listing_icon'><img src=\"" . elgg_view('icon/user/default/tiny') . "\" /></div>";
    echo "<div class='entity_listing_info'><p class='entity_title'>" . elgg_echo('profile:deleteduser') . "</p>";
}
//display the date of the comment
echo "<p class='entity_subtext'>" . friendly_time($vars['entity']->time_created) . "</p>";
//display the actual message posted
echo parse_urls(elgg_view("output/longtext", array("value" => $vars['entity']->value)));
// if comment owner, group owner, or site admin - display edit-form
if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
    //get the edit form and details
    $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
    $text_textarea = elgg_view('input/longtext', array('internalname' => 'postComment' . $vars['entity']->id, 'value' => $vars['entity']->value));
    $post = elgg_view('input/hidden', array('internalname' => 'post', 'value' => $vars['entity']->id));
    $field = elgg_view('input/hidden', array('internalname' => 'field_num', 'value' => $vars['entity']->id));
    $topic = elgg_view('input/hidden', array('internalname' => 'topic', 'value' => get_input('topic')));
    $group = elgg_view('input/hidden', array('internalname' => 'group', 'value' => get_input('group_guid')));
    $form_body = <<<EOT
\t\t
\t\t<p class='longtext_editarea'>{$text_textarea}</p>
\t\t{$post}
Ejemplo n.º 22
0
<?php

/**
	* Elgg Mediawiki integration plugin
	*
	* @package Mediawiki
	* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	* @author Kevin Jardine <*****@*****.**>
	* @copyright Surevine Limited 2009
	* @link http://www.surevine.com/
*/
$mediawiki_url = $vars['mediawiki_url'];
$item = $vars['item'];
$body = '';
$body .= '<div class="river_item">';
$body .= '<div class="river_object">';
$body .= '<div class="river_object_mediawiki">';
$body .= '<div class="river_update">';
$body .= '<div class="river_object_mediawiki_update">';
$user = get_entity($item->user_guid);
$body .= '<p><a href="' . $user->getUrl() . '">' . $user->name . '</a> ';
$body .= elgg_echo('mediawiki:has_made_change');
$body .= ' <a href="' . $mediawiki_url . 'index.php/' . $item->page . '"> ';
$body .= $item->page . '</a> ';
$body .= '<span class="river_item_time">(' . friendly_time($item->update_time) . ')</span></p>';
$body .= '</div>';
$body .= '</div>';
$body .= '</div>';
$body .= '</div>';
$body .= '</div>';
echo $body;
<?php 
echo "<div class=\"contentWrapper\">";
if ($vars['entity']) {
    foreach ($vars['entity'] as $report) {
        //get the user making the report
        $user = get_user($report->owner_guid)->name;
        $user_url = get_user($report->owner_guid)->getURL();
        //find out if the report is current or archive
        if ($report->state == 'archived') {
            $reportedcontent_background = "archived_report";
        } else {
            $reportedcontent_background = "active_report";
        }
        echo "<div class=\"reportedcontent_content {$reportedcontent_background}\">";
        echo "<p class=\"reportedcontent_detail\">";
        if ($report->state != 'archived') {
            $url = elgg_add_action_tokens_to_url($vars['url'] . "action/reportedcontent/archive?item=" . $report->guid);
            echo "<a class=\"archive_report_button\" href=\"{$url}\">" . elgg_echo('reportedcontent:archive') . "</a>";
        }
        $url = elgg_add_action_tokens_to_url($vars['url'] . "action/reportedcontent/delete?item=" . $report->guid);
        echo "<a class=\"delete_report_button\" href=\"{$url}\" onclick=\"return confirm('" . elgg_echo('reportedcontent:areyousure') . "')\">" . elgg_echo('reportedcontent:delete') . "</a></p>";
        echo "<p class=\"reportedcontent_detail\"><b>" . elgg_echo('reportedcontent:by') . ": </b><a href=\"{$user_url}\">" . $user . "</a>, " . friendly_time($report->time_created) . "</p>";
        echo "<p class=\"reportedcontent_detail\"><b>" . elgg_echo('reportedcontent:objecttitle') . ": </b>" . $report->title . "</p>";
        echo "<p class=\"reportedcontent_detail\"><b>" . elgg_echo('reportedcontent:objecturl') . ": </b><a href=\"{$report->address}\">" . elgg_echo('reportedcontent:visit') . "</a></p>";
        echo "<p><a class=\"collapsibleboxlink\">" . elgg_echo('reportedcontent:moreinfo') . "</a></p>";
        echo "<div class=\"collapsible_box\">";
        echo "<p class=\"reportedcontent_detail\"><b>" . elgg_echo('reportedcontent:reason') . ": </b>" . $report->description . "</p>";
        echo "</div></div>";
    }
}
echo "</div>";
			<?php 
echo elgg_echo('access');
?>
<br />
			<span class="pluginHint">The access level of the project. Note that individual releases can have their own access settings.</span>
			<?php 
echo elgg_view('input/access', array('internalname' => 'project_access_id', 'value' => $access_id));
?>
		</label>
	</p>
	<?php 
if ($project && ($entities = elgg_get_entities(array('container_guid' => $project->getGUID()))) && is_array($entities) && count($entities) > 0) {
    $releases = array(0 => 'No recommended release');
    $recommended = $project->recommended_release_guid ? $project->recommended_release_guid : 0;
    foreach ($entities as $entity) {
        $time = friendly_time($entity->time_created);
        $releases[$entity->guid] = "{$entity->version} ({$time})";
    }
}
?>
	<p>
	<label>Project Images<br />
		<span class="pluginHint">Show off your project by uploading images!</span><br /><br />
	</label>
	<?php 
for ($i = 1; $i <= 4; $i++) {
    // show existing images if any
    if ($project) {
        $options = array('relationship_guid' => $project->getGUID(), 'relationship' => 'image', 'metadata_name_value_pair' => array('name' => 'project_image', 'value' => "{$i}"));
        if (($image = elgg_get_entities_from_relationship($options)) && $image[0] instanceof ElggFile && ($thumb = get_entity($image[0]->thumbnail_guid)) && $thumb instanceof ElggFile) {
            $title = $image[0]->title;
    $number = (int) $vars['entity']->num_display;
    if (!$number) {
        $number = 10;
    }
    //get the group's files
    $files = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'container_guid' => $vars['entity']->guid, 'limit' => $number));
    //if there are some files, go get them
    if ($files) {
        //display in list mode
        foreach ($files as $f) {
            $mime = $f->mimetype;
            echo "<div class=\"filerepo_widget_singleitem\">";
            echo "<div class=\"filerepo_listview_icon\"><a href=\"{$f->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . "</a></div>";
            echo "<div class=\"filerepo_widget_content\">";
            echo "<div class=\"filerepo_listview_title\"><p class=\"filerepo_title\">" . $f->title . "</p></div>";
            echo "<div class=\"filerepo_listview_date\"><p class=\"filerepo_timestamp\"><small>" . friendly_time($f->time_created) . "</small></p></div>";
            $description = $f->description;
            if (!empty($description)) {
                echo "<a href=\"javascript:void(0);\" class=\"show_file_desc\">" . elgg_echo('more') . "</a><br /><div class=\"filerepo_listview_desc\">" . $description . "</div>";
            }
            echo "</div><div class=\"clearfloat\"></div></div>";
        }
        //get a link to the users files
        $users_file_url = $vars['url'] . "pg/file/" . page_owner_entity()->username;
        echo "<div class=\"forum_latest\"><a href=\"{$users_file_url}\">" . elgg_echo('file:more') . "</a></div>";
    } else {
        echo "<div class=\"forum_latest\">" . elgg_echo("file:none") . "</div>";
    }
    ?>
<div class="clearfloat" /></div>
</div>
if ($vars['full']) {
    echo elgg_view('export/entity', $vars);
} else {
    $icon = elgg_view('graphics/icon', array('entity' => $vars['entity'], 'size' => 'small'));
    $title = $vars['entity']->title;
    if (!$title) {
        $title = $vars['entity']->name;
    }
    if (!$title) {
        $title = get_class($vars['entity']);
    }
    $controls = "";
    if ($vars['entity']->canEdit()) {
        $delete = elgg_view('output/confirm_link', array('href' => "{$vars['url']}action/entities/delete?guid={$vars['entity']->guid}", 'text' => elgg_echo('delete')));
        $controls .= " ({$delete})";
    }
    $info = "<div><p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $title . "</a></b> {$controls} </p></div>";
    if (get_input('search_viewtype') == "gallery") {
        $icon = "";
    }
    $owner = $vars['entity']->getOwnerEntity();
    $ownertxt = elgg_echo('unknown');
    if ($owner) {
        $ownertxt = "<a href=\"" . $owner->getURL() . "\">" . $owner->name . "</a>";
    }
    $info .= "<div>" . sprintf(elgg_echo("entity:default:strapline"), friendly_time($vars['entity']->time_created), $ownertxt);
    $info .= "</div>";
    $info = "<span title=\"" . elgg_echo('entity:default:missingsupport:popup') . "\">{$info}</span>";
    $icon = "<span title=\"" . elgg_echo('entity:default:missingsupport:popup') . "\">{$icon}</span>";
    echo elgg_view_listing($icon, $info);
}
Ejemplo n.º 27
0
        echo elgg_view('output/tags', array('tags' => $tags));
        ?>
		</p>
		
<?php 
    }
    $cats = elgg_view('categories/view', $vars);
    if (!empty($cats)) {
        ?>
		<p class="categories">
			<?php 
        echo $cats;
        ?>
		</p>
<?php 
    }
}
// last edit & by whome
?>

	<p class="strapline">
		<?php 
$time_updated = $latest->time_created;
$owner_guid = $latest->owner_guid;
$owner = get_entity($owner_guid);
echo sprintf(elgg_echo("pages:strapline"), friendly_time($time_updated), "<a href=\"" . $owner->getURL() . "\">" . $owner->name . "</a>");
?>
	</p>
</div>

</div>
Ejemplo n.º 28
0
					</p>
					</div>
				</div>				
			</div>
		</div>
	</div>
	
<?php 
} else {
    ?>
	<div class="river_item">
		<span class="river_item_useravatar"> 
			<?php 
    echo elgg_view("profile/icon", array('entity' => get_entity($vars['item']->subject_guid), 'size' => 'tiny'));
    ?>
		</span>
		<p class="river_item_body">
			<?php 
    echo $vars['body'];
    ?>
			<span class="river_item_time">
				(<?php 
    echo friendly_time($vars['item']->posted);
    ?>
)
			</span>
		</p>
		<div class="clearfloat"></div>
	</div>
<?php 
}
<?php

/**
 * Elgg blog listing
 * 
 * @package ElggBlog
 * @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.com/
 */
$owner = $vars['entity']->getOwnerEntity();
$friendlytime = friendly_time($vars['entity']->time_created);
$icon = elgg_view("profile/icon", array('entity' => $owner, 'size' => 'small'));
$info = "<p>" . elgg_echo('blog') . ": <a href=\"{$vars['entity']->getURL()}\">{$vars['entity']->title}</a></p>";
$info .= "<p><a href=\"{$owner->getURL()}\">{$owner->name}</a> {$friendlytime}</p>";
//display
echo "<div class=\"blog_gallery\">";
echo "<div class=\"blog_gallery_icon\">" . $icon . "</div>";
echo "<div class=\"blog_gallery_content\">" . $info . "</div>";
echo "</div>";
Ejemplo n.º 30
0
<?php

$performed_by = get_entity($vars['item']->subject_guid);
$object = get_entity($vars['item']->object_guid);
$url = $object->getURL();
$title = $object->title;
if (!$title) {
    $title = elgg_echo('file:untitled');
}
$subtype = get_subtype_from_id($object->subtype);
//grab the annotation, if one exists
if ($vars['item']->annotation_id != 0) {
    $comment = get_annotation($vars['item']->annotation_id)->value;
}
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
$string = sprintf(elgg_echo("river:posted:generic"), $url) . " ";
$string .= elgg_echo("{$subtype}:river:annotate") . "  <a href=\"{$object->getURL()}\">" . $title . "</a> " . friendly_time($object->time_created);
if (get_context() != 'riverdashboard') {
    $string .= "<div class='river_content_display'>";
    if ($comment) {
        $contents = strip_tags($comment);
        //this is so we don't get large images etc in the activity river
        if (strlen($contents) > 200) {
            $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
        } else {
            $string .= $contents;
        }
    }
    $string .= "</div>";
}
echo $string;