[svn r18868] Adding the social/profile.php page see FS#3751

skala
Julio Montoya 16 years ago
parent b87b30ff84
commit f489f0f4de
  1. 29
      main/announcements/announcements.inc.php
  2. 6
      main/announcements/announcements.php
  3. 74
      main/calendar/myagenda.inc.php
  4. 47
      main/css/academica/default.css
  5. 47
      main/css/baby_orange/default.css
  6. 49
      main/css/corporate/default.css
  7. 47
      main/css/cosmic_campus/default.css
  8. 48
      main/css/dokeos_classic/default.css
  9. 47
      main/css/dokeos_classic_2D/default.css
  10. 49
      main/css/medical/default.css
  11. 56
      main/css/public_admin/default.css
  12. 49
      main/css/silver_line/default.css
  13. 49
      main/css/sober_brown/default.css
  14. 97
      main/forum/forumfunction.inc.php
  15. 4
      main/forum/viewpost.inc.php

@ -1,4 +1,4 @@
<?php //$Id: announcements.inc.php 18080 2009-01-29 20:33:19Z cfasanando $
<?php //$Id: announcements.inc.php 18868 2009-03-09 15:10:42Z juliomontoya $
/*
==============================================================================
Dokeos - elearning and course management software
@ -664,7 +664,7 @@ function sent_to($tool, $id)
* using the visibility field in 'item_property'
* values: 0 = invisibility for
*/
function change_visibility($tool,$id)
function change_visibility_announcement($tool,$id)
{
global $_course;
global $tbl_item_property;
@ -883,4 +883,29 @@ function update_mail_sent($insert_id)
// store the modifications in the table tbl_annoucement
$sql = "UPDATE $tbl_announcement SET email_sent='1' WHERE id='$insert_id'";
api_sql_query($sql,__FILE__,__LINE__);
}
function get_all_annoucement_by_user_course($course_db, $user_id)
{
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT, $course_db);
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY, $course_db);
$sql="SELECT announcement.*, toolitemproperties.*
FROM $tbl_announcement announcement, $tbl_item_property toolitemproperties
WHERE announcement.id = toolitemproperties.ref
AND toolitemproperties.tool='announcement'
AND (toolitemproperties.to_user_id='".$user_id."' OR toolitemproperties.to_group_id='0')
AND toolitemproperties.visibility='1'
AND announcement.session_id = 0
ORDER BY display_order DESC";
$result = api_sql_query($sql,__FILE__,__LINE__);
$num_rows = Database::num_rows($result);
if (Database::num_rows($result)>0) {
while ($myrow = Database::fetch_array($result)) {
echo $title = '<strong>'.$myrow['title'].'</strong><br /><br />';
echo $content = $myrow['content'];
}
} else {
return false;
}
}

@ -1,4 +1,4 @@
<?php //$Id: announcements.php 18447 2009-02-11 20:49:45Z herodoto $
<?php //$Id: announcements.php 18868 2009-03-09 15:10:42Z juliomontoya $
/*
==============================================================================
Dokeos - elearning and course management software
@ -344,7 +344,7 @@ if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_ed
$id=intval(addslashes($_GET['id']));
if(!api_is_course_coach() || api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $id))
{
change_visibility(TOOL_ANNOUNCEMENT,$id);
change_visibility_announcement(TOOL_ANNOUNCEMENT,$id);
$message = get_lang("VisibilityChanged");
}
}
@ -1312,7 +1312,7 @@ if(!empty($error_message))
{
if ($_user['user_id'])
{
$sql="SELECT
$sql="SELECT
announcement.*, toolitemproperties.*
FROM $tbl_announcement announcement, $tbl_item_property toolitemproperties
WHERE announcement.id = toolitemproperties.ref

@ -745,6 +745,80 @@ function show_personal_agenda()
}
echo "</table>\n";
}
/**
* This function retrieves all the personal agenda items of the given user_id and shows
* these items in one list (ordered by date and grouped by month (the month_bar)
* @param int user id
*/
function show_simple_personal_agenda($user_id)
{
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
global $MonthsLong, $charset;
// The SQL statement that retrieves all the personal agenda items of this user
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' ORDER BY date DESC";
$result = api_sql_query($sql, __FILE__, __LINE__);
// variable initialisation
$month_bar = "";
// setting the default day, month and year
if (!$_GET['day'] AND !$_GET['month'] AND !$_GET['year']) {
$today = getdate();
$year = $today['year'];
$month = $today['mon'];
$day = $today['mday'];
}
$export_icon = 'export.png';
$export_icon_low = 'export_low_fade.png';
$export_icon_high = 'export_high_fade.png';
// starting the table output
if (Database::num_rows($result) > 0) {
while ($myrow = Database::fetch_array($result)) {
/*--------------------------------------------------
display: the month bar
--------------------------------------------------*/
if ($month_bar != date("m", strtotime($myrow["date"])).date("Y", strtotime($myrow["date"]))) {
$month_bar = date("m", strtotime($myrow["date"])).date("Y", strtotime($myrow["date"]));
echo $MonthsLong[date("n", strtotime($myrow["date"])) - 1]." ".date("Y", strtotime($myrow["date"]));
}
// highlight: if a date in the small calendar is clicked we highlight the relevant items
$db_date = (int) date("d", strtotime($myrow["date"])).date("n", strtotime($myrow["date"])).date("Y", strtotime($myrow["date"]));
if ($_GET["day"].$_GET["month"].$_GET["year"] <> $db_date) {
$style = "data";
$text_style = "text";
} else {
$style = "datanow";
$text_style = "text";
}
/*--------------------------------------------------
display: date and time
--------------------------------------------------*/
// adding an internal anchor
echo date("d", strtotime($myrow["date"]))." ".$MonthsLong[date("n", strtotime($myrow["date"])) - 1]." ".date("Y", strtotime($myrow["date"]))."&nbsp;";
echo ucfirst(strftime(get_lang("timeNoSecFormat"), strtotime($myrow["date"])));
/*--------------------------------------------------
display: the title
--------------------------------------------------*/
echo '<br />';
echo $myrow['title'];
echo '<br />';
/*--------------------------------------------------
display: the content
--------------------------------------------------*/
$content = $myrow['text'];
$content = make_clickable($content);
$content = text_filter($content);
echo $content;
}
} else {
echo get_lang('NoAgendaItems');
}
}
/**
* This function deletes a personal agenda item
* There is an additional check to make sure that one cannot delete an item that

@ -1650,6 +1650,53 @@ span.radio {
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *

@ -1653,6 +1653,53 @@ span.radio {
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *

@ -1658,6 +1658,55 @@ span.radio {
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *
*****************************************************/

@ -1683,6 +1683,53 @@ span.radio {
margin:0;
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *

@ -2106,6 +2106,54 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *
*****************************************************/

@ -2756,6 +2756,53 @@ span.radio {
margin:0;
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *

@ -2160,6 +2160,55 @@ span.radio {
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *
*****************************************************/

@ -2199,6 +2199,62 @@ float:left;
}
#social-profile-wrapper {
width: 990px;
text-align:left;
margin:0 auto;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *
*****************************************************/

@ -2262,6 +2262,55 @@ span.radio {
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *
*****************************************************/

@ -2228,6 +2228,55 @@ span.radio {
padding-left:10px;
}
#social-profile-container {
width: 700px;
}
#social-profile-left {
float:left;
width:220px;
}
.left-side {
min-width: 198px;
margin: 0px;
}
#social-profile-content {
float:right;
width:480px;
}
#social-profile-right {
float:right; width:280px
}
.social-profile-post {
width: 450px;
background : #EFEFEF;
}
.maincourse {
width: 100%; margin-left:0px;
}
.social-profile-rounded {
background : #eee;
}
#social-profile-forum {
padding-left:0px;
}
#social-profile-thread {
padding-left:20px;
}
#social-post{
padding-left:30px;
}
/*****************************************************
* BUTTONS *
*****************************************************/

@ -71,9 +71,11 @@
* -- Patrick Cool <patrick.cool@UGent.be>
**************************************************************************
*/
require_once(api_get_path(INCLUDE_PATH).'/lib/mail.lib.inc.php');
require_once(api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
require_once(api_get_path(LIBRARY_PATH).'text.lib.php');
require_once(api_get_path(INCLUDE_PATH).'/conf/mail.conf.php');
require_once(api_get_path(INCLUDE_PATH).'/lib/usermanager.lib.php');
require_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php');
require_once(api_get_path(LIBRARY_PATH).'text.lib.php');
get_notifications_of_user();
/**
* This function handles all the forum and forumcategories actions. This is a wrapper for the
@ -1143,7 +1145,7 @@ function get_forums_in_category($cat_id)
* @version february 2006, dokeos 1.8
*/
function get_forums($id='') {
global $table_forums;
global $table_forums;
global $table_threads;
global $table_posts;
global $table_item_property;
@ -1363,7 +1365,7 @@ function get_threads($forum_id) {
INNER JOIN $table_item_property item_properties
ON thread.thread_id=item_properties.ref
AND item_properties.visibility='1'
AND item_properties.tool='".TOOL_FORUM_THREAD."'
AND item_properties.tool='".TABLE_FORUM_THREAD."'
LEFT JOIN $table_users users
ON thread.thread_poster_id=users.user_id
LEFT JOIN $table_posts post
@ -1383,7 +1385,7 @@ function get_threads($forum_id) {
INNER JOIN $table_item_property item_properties
ON thread.thread_id=item_properties.ref
AND item_properties.visibility<>2
AND item_properties.tool='".TOOL_FORUM_THREAD."'
AND item_properties.tool='".TABLE_FORUM_THREAD."'
LEFT JOIN $table_users users
ON thread.thread_poster_id=users.user_id
LEFT JOIN $table_posts post
@ -1392,7 +1394,7 @@ function get_threads($forum_id) {
ON post.poster_id= last_poster_users.user_id
WHERE thread.forum_id='".Database::escape_string($forum_id)."'
ORDER BY thread.thread_sticky DESC, thread.thread_date DESC";
}
}
$result=api_sql_query($sql, __FILE__, __LINE__);
while ( $row=Database::fetch_array($result,'ASSOC') ) {
$thread_list[]=$row;
@ -3714,15 +3716,17 @@ function get_statistical_information($thread_id, $user_id, $course_id) {
}
/**
* This function counts the number of post inside a thread
* This function return the posts inside a thread from a given user
* @param course code
* @param int Thread ID
* @param int User ID
* @return int the number of post inside a thread
* @author Jhon Hinojosa <jhon.hinojosa@dokeos.com>,
* @version octubre 2008, dokeos 1.8
*/
function get_thread_user_post($thread_id, $user_id ) {
global $table_posts;
function get_thread_user_post($course_db, $thread_id, $user_id )
{
$table_posts = Database::get_course_table(TABLE_FORUM_POST, $course_db);
global $table_users;
$sql = "SELECT * FROM $table_posts posts
@ -3733,7 +3737,7 @@ function get_thread_user_post($thread_id, $user_id ) {
ORDER BY posts.post_id ASC";
$result=api_sql_query($sql, __FILE__, __LINE__);
while ($row=Database::fetch_array($result)) {
$row['status'] = '1';
$post_list[]=$row;
@ -3741,7 +3745,7 @@ function get_thread_user_post($thread_id, $user_id ) {
LEFT JOIN $table_users users
ON posts.poster_id=users.user_id
WHERE posts.thread_id='".Database::escape_string($thread_id)."'
AND posts.post_parent_id='".$row['post_id']."'
AND posts.post_parent_id='".$row['post_id']."'
ORDER BY posts.post_id ASC";
$result2=api_sql_query($sql, __FILE__, __LINE__);
while ($row2=Database::fetch_array($result2))
@ -3766,15 +3770,76 @@ function get_thread_user_post($thread_id, $user_id ) {
return $row[0];
}
/* This function get the name of an thread by id
* @param thread_id int
* return String
/** This function get the name of an thread by id
* @param int thread_id
* @return String
* @author Christian Fasanando
*/
**/
function get_name_thread_by_id($thread_id) {
$t_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD,'');
$sql ="SELECT thread_title FROM ".$t_forum_thread." WHERE thread_id = '".$thread_id."' ";
$result = api_sql_query($sql, __FILE__, __LINE__);
$row = Database::fetch_array($result);
return $row[0];
}
}
/** This function gets all the post written by an user
* @param int user id
* @param string db course name
* @return string
* @author Christian Fasanando
**/
function get_all_post_from_user($user_id, $course_db)
{
$forums = get_forums();
foreach($forums as $forum) {
$threads = get_threads($forum['forum_id']);
echo '<div id="social-forum">';
echo Display::return_icon('forum.gif');
echo $forum['forum_title'];
echo '<br / >'; echo '<br / >';
foreach($threads as $thread) {
echo '<div id="social-thread">';
echo Display::return_icon('forumthread.gif');
echo $thread['thread_title'].' ';
/* echo '<br / >'; echo '<br / >';
echo '<strong>'.$thread['post_title'].'</strong>'; echo '<br / >';
echo cut($thread['post_text'], 150);
echo '<br / >';
*/
$post_list = get_thread_user_post_limit($course_db, $thread['thread_id'], $user_id, 1);
foreach($post_list as $posts) {
echo '<div id="social-post">';
echo '<strong>'.$posts['post_title'].'</strong>'; echo '<br / >';
echo cut($posts['post_text'], 150);
echo '</div>';
echo '<br / >';
}
echo '</div>';
}
echo '</div>';
}
//$list = get_thread_user_post($course['dbName'],$thread_id, $user_id);
}
function get_thread_user_post_limit($course_db, $thread_id, $user_id, $limit=10)
{
$table_posts = Database::get_course_table(TABLE_FORUM_POST, $course_db);
global $table_users;
$sql = "SELECT * FROM $table_posts posts
LEFT JOIN $table_users users
ON posts.poster_id=users.user_id
WHERE posts.thread_id='".Database::escape_string($thread_id)."'
AND posts.poster_id='".Database::escape_string($user_id)."'
ORDER BY posts.post_id DESC LIMIT $limit ";
$result=api_sql_query($sql, __FILE__, __LINE__);
while ($row=Database::fetch_array($result)) {
$row['status'] = '1';
$post_list[]=$row;
}
return $post_list;
}

@ -22,7 +22,9 @@
/**
* @package dokeos.forum
*/
$rows = get_thread_user_post($current_thread['thread_id'], $_GET['user']);
$course = api_get_course_info();
$rows = get_thread_user_post($course['dbName'], $current_thread['thread_id'], $_GET['user']);
$sw = true;
if(isset($rows)){

Loading…
Cancel
Save