@ -132,7 +132,7 @@ if (api_is_allowed_to_edit(null, true)) {
if (is_numeric($_GET['glossary_id'])) {
// initiate the object
$form = new FormValidator('glossary','post', api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&glossary_id='.Security::remove_XSS($_GET['glossary_id']));
return '<tr><td></td><tdbgcolor="#FFFFFF">'. $value . '</td></tr>' . "\n" ; //juan carlos muestra solo color (no tambi<EFBFBD>n la l<EFBFBD>nea). Adem<EFBFBD>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<EFBFBD> definido en la hoja de estilos como background-color, aceptando s<EFBFBD>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<EFBFBD>s los cambios de otros objetos que no sean texto no se indican por ej. a<EFBFBD>adir una imagen, por esta raz<EFBFBD>n doy el color de fondo al td directamente.
return '<tr><td></td><tdbgcolor="#FFFFFF">' . $value . '</td></tr>' . "\n"; //juan carlos muestra solo color (no tambi<EFBFBD>n la l<EFBFBD>nea). Adem<EFBFBD>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<EFBFBD> definido en la hoja de estilos como background-color, aceptando s<EFBFBD>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<EFBFBD>s los cambios de otros objetos que no sean texto no se indican por ej. a<EFBFBD>adir una imagen, por esta raz<EFBFBD>n doy el color de fondo al td directamente.
return '<tr><td></td><tdbgcolor="#FFFFAA">'. $value . '</td></tr>' . "\n" ; //juan carlos muestra solo color (no tambi<EFBFBD>n la l<EFBFBD>nea). Adem<EFBFBD>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<EFBFBD> definido en la hoja de estilos como background-color, aceptando s<EFBFBD>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<EFBFBD>s los cambios de otros objetos que no sean texto no se indican por ej. a<EFBFBD>adir una imagen, por esta raz<EFBFBD>n doy el color de fondo al td directamente.
return '<tr><td></td><tdbgcolor="#FFFFAA">' . $value . '</td></tr>' . "\n"; //juan carlos muestra solo color (no tambi<EFBFBD>n la l<EFBFBD>nea). Adem<EFBFBD>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<EFBFBD> definido en la hoja de estilos como background-color, aceptando s<EFBFBD>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<EFBFBD>s los cambios de otros objetos que no sean texto no se indican por ej. a<EFBFBD>adir una imagen, por esta raz<EFBFBD>n doy el color de fondo al td directamente.
return '<tr><td></td><tdbgcolor="#CCFFCC">'. $value . '</td></tr>' . "\n" ; //juan carlos muestra solo color (no tambi<EFBFBD>n la l<EFBFBD>nea). Adem<EFBFBD>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<EFBFBD> definido en la hoja de estilos como background-color, aceptando s<EFBFBD>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<EFBFBD>s los cambios de otros objetos que no sean texto no se indican por ej. a<EFBFBD>adir una imagen, por esta raz<EFBFBD>n doy el color de fondo al td directamente.
return '<tr><td></td><tdbgcolor="#CCFFCC">' . $value . '</td></tr>' . "\n"; //juan carlos muestra solo color (no tambi<EFBFBD>n la l<EFBFBD>nea). Adem<EFBFBD>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<EFBFBD> definido en la hoja de estilos como background-color, aceptando s<EFBFBD>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<EFBFBD>s los cambios de otros objetos que no sean texto no se indican por ej. a<EFBFBD>adir una imagen, por esta raz<EFBFBD>n doy el color de fondo al td directamente.
return '<tr><td></td><tdbgcolor="#FFAAAA">'. $value . '</td></tr>' . "\n" ; //juan carlos muestra solo color (no tambi<EFBFBD>n la l<EFBFBD>nea). Adem<EFBFBD>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<EFBFBD> definido en la hoja de estilos como background-color, aceptando s<EFBFBD>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<EFBFBD>s los cambios de otros objetos que no sean texto no se indican por ej. a<EFBFBD>adir una imagen, por esta raz<EFBFBD>n doy el color de fondo al td directamente.
}
return '<tr><td></td><tdbgcolor="#FFAAAA">' . $value . '</td></tr>' . "\n"; //juan carlos muestra solo color (no tambi<EFBFBD>n la l<EFBFBD>nea). Adem<EFBFBD>s EN IEXPLORER VA BIEN PERO EN FIREFOX 3 la etiqueta span no muestra el color de fondo que est<EFBFBD> definido en la hoja de estilos como background-color, aceptando s<EFBFBD>lo la propiedad color pero esta solo da color al texto con lo cual los cambios quedan poco resaltados, adem<EFBFBD>s los cambios de otros objetos que no sean texto no se indican por ej. a<EFBFBD>adir una imagen, por esta raz<EFBFBD>n doy el color de fondo al td directamente.
$sql='SELECT * FROM '.$tbl_wiki.' s1 WHERE s1.c_id = '.$course_id.' AND id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';
$sql = 'SELECT * FROM '.$tbl_wiki.' s1
WHERE s1.c_id = '.$course_id.' AND id=(
SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2
WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.'
$sql='SELECT *, COUNT(*) AS TOTAL_EDITING_NOW FROM '.$tbl_wiki.' s1
//Total pages edited at this time
$total_editing_now=0;
$sql = 'SELECT *, COUNT(*) AS TOTAL_EDITING_NOW
FROM '.$tbl_wiki.' s1
WHERE is_editing!=0 AND s1.c_id = '.$course_id.' AND
id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';//Can not use group by because the mark is set in the latest version
id=(
SELECT MAX(s2.id)
FROM '.$tbl_wiki.' s2
WHERE
s2.c_id = '.$course_id.' AND
s1.reflink = s2.reflink AND
'.$groupfilter.' AND
session_id='.$session_id.'
)';
//Can not use group by because the mark is set in the latest version
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
while ($row=Database::fetch_array($allpages)) {
$total_editing_now = $row['TOTAL_EDITING_NOW'];
}
//Total hidden pages
$total_hidden=0;
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND visibility=0 AND '.$groupfilter.$condition_session.' GROUP BY reflink';// or group by page_id. As the mark of hidden places it in all versions of the page, I can use group by to see the first
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
//Total hidden pages
$total_hidden=0;
$sql = 'SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND visibility=0 AND '.$groupfilter.$condition_session.' GROUP BY reflink';
// or group by page_id. As the mark of hidden places it in all versions of the page, I can use group by to see the first
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_hidden = $total_hidden+1;
}
}
//Total protect pages
$total_protected=0;
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND editlock=1 AND '.$groupfilter.$condition_session.' GROUP BY reflink';// or group by page_id. As the mark of protected page is the first version of the page, I can use group by
//Total protect pages
$total_protected=0;
$sql='SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND editlock=1 AND '.$groupfilter.$condition_session.' GROUP BY reflink';
// or group by page_id. As the mark of protected page is the first version of the page, I can use group by
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_protected = $total_protected+1;
}
//Total empty versions
}
$total_empty_content=0;
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND content="" AND '.$groupfilter.$condition_session.'';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
// Total empty versions.
$total_empty_content=0;
$sql = 'SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND content="" AND '.$groupfilter.$condition_session.'';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_empty_content = $total_empty_content+1;
}
}
//Total empty pages (last version)
//Total empty pages (last version)
$total_empty_content_lv=0;
$sql = 'SELECT * FROM '.$tbl_wiki.' s1
$total_empty_content_lv=0;
$sql = 'SELECT * FROM '.$tbl_wiki.' s1
WHERE s1.c_id = '.$course_id.' AND content="" AND id=(
SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s1.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2
WHERE s1.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND addlock_disc=0 AND '.$groupfilter.$condition_session.' GROUP BY reflink';//group by because mark lock in all vers, then always is ok
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_lock_disc=0;
$sql = 'SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND addlock_disc=0 AND '.$groupfilter.$condition_session.'
GROUP BY reflink';//group by because mark lock in all vers, then always is ok
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_lock_disc = $total_lock_disc+1;
}
}
//Total hidden discuss pages
//Total hidden discuss pages
$total_hidden_disc=0;
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND visibility_disc=0 AND '.$groupfilter.$condition_session.' GROUP BY reflink';//group by because mark lock in all vers, then always is ok
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_hidden_disc=0;
$sql = 'SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND visibility_disc=0 AND '.$groupfilter.$condition_session.'
GROUP BY reflink';//group by because mark lock in all vers, then always is ok
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_hidden_disc = $total_hidden_disc+1;
}
}
//Total versions with any short comment by user or system
//Total versions with any short comment by user or system
$total_comment_version=0;
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND comment!="" AND '.$groupfilter.$condition_session.'';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_comment_version=0;
$sql = 'SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND comment!="" AND '.$groupfilter.$condition_session.'';
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND ratinglock_disc=0 AND '.$groupfilter.$condition_session.' GROUP BY reflink';//group by because mark lock in all vers, then always is ok
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_only_teachers_rating=0;
$sql = 'SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND ratinglock_disc=0 AND '.$groupfilter.$condition_session.'
GROUP BY reflink';//group by because mark lock in all vers, then always is ok
$total_rating_by_peers=$total_pages-$total_only_teachers_rating;//put always this line alfter check num all pages and num pages rated by teachers
//Total pages scored by peers
$total_rating_by_peers=0;
$total_rating_by_peers=$total_pages-$total_only_teachers_rating;//put always this line alfter check num all pages and num pages rated by teachers
//Total pages identified as standard task
//Total pages identified as standard task
$total_task=0;
$sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.c_id = '.$course_id.' AND '.$tbl_wiki_conf.'.task!="" AND '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.'.$groupfilter.$condition_session;
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_task=0;
$sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.'
WHERE '.$tbl_wiki_conf.'.c_id = '.$course_id.' AND '.$tbl_wiki_conf.'.task!="" AND '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.'.$groupfilter.$condition_session;
$sql='SELECT * FROM '.$tbl_wiki.' s1 WHERE s1.c_id = '.$course_id.' AND assignment=1 AND id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';//mark all versions, but do not use group by reflink because y want the pages not versions
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_teacher_assignment=0;
$sql = 'SELECT * FROM '.$tbl_wiki.' s1
WHERE s1.c_id = '.$course_id.' AND assignment=1 AND id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';//mark all versions, but do not use group by reflink because y want the pages not versions
WHERE s1.c_id = '.$course_id.' AND assignment=2 AND
id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';//mark all versions, but do not use group by reflink because y want the pages not versions
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' GROUP BY addlock';//group by because mark 0 in all vers, then always is ok
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
//Current Wiki status add new pages
$sql = 'SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' GROUP BY addlock';//group by because mark 0 in all vers, then always is ok
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$wiki_add_lock=$row['addlock'];
}
}
if ($wiki_add_lock==1) {
if ($wiki_add_lock==1) {
$status_add_new_pag=get_lang('Yes');
} else {
} else {
$status_add_new_pag=get_lang('No');
}
}
//Creation date of the oldest wiki page and version
//Creation date of the oldest wiki page and version
$first_wiki_date='0000-00-00 00:00:00';
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' ORDER BY dtime ASC LIMIT 1';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$first_wiki_date='0000-00-00 00:00:00';
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' ORDER BY dtime ASC LIMIT 1';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$first_wiki_date=$row['dtime'];
}
}
//Date of publication of the latest wiki version
//Date of publication of the latest wiki version
$last_wiki_date='0000-00-00 00:00:00';
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' ORDER BY dtime DESC LIMIT 1';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$last_wiki_date='0000-00-00 00:00:00';
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' ORDER BY dtime DESC LIMIT 1';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$last_wiki_date=$row['dtime'];
}
}
//Average score of all wiki pages. (If a page has not scored zero rated)
//Average score of all wiki pages. (If a page has not scored zero rated)
$media_score =0;
$sql="SELECT *, SUM(score) AS TOTAL_SCORE FROM ".$tbl_wiki." WHERE c_id = $course_id AND ".$groupfilter.$condition_session." GROUP BY reflink ";//group by because mark in all versions, then always is ok. Do not use "count" because using "group by", would give a wrong value
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$media_score =0;
$sql="SELECT *, SUM(score) AS TOTAL_SCORE FROM ".$tbl_wiki."
WHERE c_id = $course_id AND ".$groupfilter.$condition_session." GROUP BY reflink ";//group by because mark in all versions, then always is ok. Do not use "count" because using "group by", would give a wrong value
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_score=$total_score+$row['TOTAL_SCORE'];
}
}
if (!empty($total_pages)) {
if (!empty($total_pages)) {
$media_score = $total_score/$total_pages;//put always this line alfter check num all pages
}
}
//Average user progress in his pages
//Average user progress in his pages
$media_progress=0;
$sql='SELECT *, SUM(progress) AS TOTAL_PROGRESS FROM '.$tbl_wiki.' s1 WHERE s1.c_id = '.$course_id.' AND id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';//As the value is only the latest version I can not use group by
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$media_progress=0;
$sql='SELECT *, SUM(progress) AS TOTAL_PROGRESS FROM '.$tbl_wiki.' s1
WHERE s1.c_id = '.$course_id.' AND id=(SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')';//As the value is only the latest version I can not use group by
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_progress = $row['TOTAL_PROGRESS'];
}
}
if (!empty($total_pages)) {
if (!empty($total_pages)) {
$media_progress=$total_progress/$total_pages;//put always this line alfter check num all pages
}
}
//Total users that have participated in the Wiki
//Total users that have participated in the Wiki
$total_users=0;
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' GROUP BY user_id';//as the mark of user it in all versions of the page, I can use group by to see the first
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_users=0;
$sql='SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' GROUP BY user_id';//as the mark of user it in all versions of the page, I can use group by to see the first
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
$total_users = $total_users+1;
}
}
//Total of different IP addresses that have participated in the wiki
$total_ip=0;
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' GROUP BY user_ip';
$allpages=Database::query($sql);
while ($row=Database::fetch_array($allpages)) {
// Total of different IP addresses that have participated in the wiki
$total_ip=0;
$sql='SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND '.$groupfilter.$condition_session.' GROUP BY user_ip';
$wanted=array_unique($wanted);//make a unique list
$wanted=array_unique($wanted);//make a unique list
//show table
foreach ($wanted as $wanted_show) {
@ -1191,7 +1237,6 @@ if ($action =='wanted') {
$row = array ();
$wanted_show=Security::remove_XSS($wanted_show);
$row[] = '<ahref="'.api_get_path(WEB_PATH).'main/wiki/index.php?cidReq=&action=addnew&title='.str_replace('_',' ',$wanted_show).'&session_id='.api_htmlentities($_GET['session_id']).'&group_id='.api_htmlentities($_GET['group_id']).'"class="new_wiki_link">'.str_replace('_',' ',$wanted_show).'</a>';//meter un remove xss en lugar de htmlentities
$rows[] = $row;
}
@ -1405,9 +1450,12 @@ if ($action =='searchpages') {
} else {
// initiate the object
$form = new FormValidator('wiki_search','post', api_get_self().'?cidReq='.api_htmlentities($_GET['cidReq']).'&action='.api_htmlentities($action ).'&session_id='.api_htmlentities($_GET['session_id']).'&group_id='.api_htmlentities($_GET['group_id']).'&mode_table=yes1&search_term='.api_htmlentities($_GET['search_term']).'&search_content='.api_htmlentities($_GET['search_content']).'&all_vers='.api_htmlentities($_GET['all_vers']));
$sql='SELECT * FROM '.$tbl_wiki.' WHERE c_id = '.$course_id.' AND reflink="'.Database::escape_string($page).'" AND '.$groupfilter.$condition_session.'';
$result=Database::query($sql);
$row=Database::fetch_array($result);
@ -1569,7 +1615,7 @@ if ($action =='showpage' AND !isset($_POST['SaveWikiNew'])) {
// Edit current page
if (isset($action) && $action =='edit') {
if (isset($action) && $action =='edit') {
if (api_get_session_id()!=0 && api_is_allowed_to_session_edit(false,true)==false) {
echo '<inputtype="hidden"name="wpost_id"value="'.md5(uniqid(rand(), true)).'">';//prevent double post
echo '<buttonclass="save"type="submit"name="SaveWikiChange">'.get_lang('Save').'</button>';//for save button Don't change name (see fckeditor/editor/plugins/customizations/fckplugin_compressed.js and fckplugin.js
//for save button Don't change name (see fckeditor/editor/plugins/customizations/fckplugin_compressed.js and fckplugin.js
@ -1950,7 +1996,9 @@ if ($action =='history' or isset($_POST['HistoryDifferences'])) {
//First, see the property visibility that is at the last register and therefore we should select descending order. But to give ownership to each record, this is no longer necessary except for the title. TODO: check this
$sql='SELECT * FROM '.$tbl_wiki.'WHERE c_id = '.$course_id.' AND reflink="'.Database::escape_string($page).'" AND '.$groupfilter.$condition_session.' ORDER BY id DESC';
$sql = 'SELECT * FROM '.$tbl_wiki.'
WHERE c_id = '.$course_id.' AND reflink="'.Database::escape_string($page).'" AND '.$groupfilter.$condition_session.'
ORDER BY id DESC';
$result=Database::query($sql);
while ($row=Database::fetch_array($result)) {
@ -1966,10 +2014,10 @@ if ($action =='history' or isset($_POST['HistoryDifferences'])) {
if (!$_POST['HistoryDifferences'] && !$_POST['HistoryDifferences2']) {
@ -2202,7 +2250,8 @@ if ($action == 'allpages') {
} else {
$sql = 'SELECT * FROM '.$tbl_wiki.' s1
WHERE visibility=1 AND s1.c_id = '.$course_id.' AND id=(
SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2 WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')'; // warning don't use group by reflink because does not return the last version
SELECT MAX(s2.id) FROM '.$tbl_wiki.' s2
WHERE s2.c_id = '.$course_id.' AND s1.reflink = s2.reflink AND '.$groupfilter.' AND session_id='.$session_id.')'; // warning don't use group by reflink because does not return the last version
$all_links[]= Database::escape_string(str_replace(' ','_',$link)).' '; //replace blank spaces by _ within the links. But to remove links at the end add a blank space
//replace blank spaces by _ within the links. But to remove links at the end add a blank space