$sql='UPDATE '.$tbl_wiki.' SET visibility="'.Database::escape_string($status_visibility).'" WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter;
@ -1195,21 +1187,14 @@ function check_visibility_page()
}
//show status
if ($row['visibility']=="1" || ($row['content']=='' AND $row['title']=='' AND $page=='index'))
{
return false;
}
else
{
return true;
}
return $row['visibility'];
}
/**
* Visibility discussion
* @author Juan Carlos Raña <herodoto@telefonica.net>
* return current database status of discuss visibility and change it if get action page
*/
function check_visibility_discuss()
{
@ -1225,18 +1210,17 @@ function check_visibility_discuss()
$row=Database::fetch_array($result);
$status_visibility_disc=$row['visibility_disc'];
$id=$row['id']; //need ? check. TODO
//change status
if ($_GET['actionpage']=='visibility_disc' && (api_is_allowed_to_edit(false,true) || api_is_platform_admin()))
if (api_is_allowed_to_edit(false,true) || api_is_platform_admin())
{
if ($row['visibility_disc']==1)
{
$status_visibility_disc=0;
}
else
if ($_GET['actionpage']=='showdisc' && $status_visibility_disc==0)
{
$status_visibility_disc=1;
$status_visibility_disc=1;
}
if ($_GET['actionpage']=='hidedisc' && $status_visibility_disc==1)
{
$status_visibility_disc=0;
}
$sql='UPDATE '.$tbl_wiki.' SET visibility_disc="'.Database::escape_string($status_visibility_disc).'" WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter;
@ -1250,22 +1234,14 @@ function check_visibility_discuss()
}
//show status
if ($row['visibility_disc']==1 || ($row['content']=='' AND $row['title']=='' AND $page=='index'))
{
return false;
}
else
{
return true;
}
return $row['visibility_disc'];
}
/**
* Lock add discussion
* @author Juan Carlos Raña <herodoto@telefonica.net>
* return current database status of lock dicuss and change if get action
*/
function check_addlock_discuss()
{
@ -1280,18 +1256,18 @@ function check_addlock_discuss()
$row=Database::fetch_array($result);
$status_addlock_disc=$row['addlock_disc'];
$id=$row['id']; //need ? check. TODO
//change status
if ($_GET['actionpage']=='addlock_disc' && (api_is_allowed_to_edit(null,true) || api_is_platform_admin()))
if (api_is_allowed_to_edit() || api_is_platform_admin())
{
if ($row['addlock_disc']==1)
{
$status_addlock_disc=0;
}
else
if ($_GET['actionpage']=='lockdisc' && $status_addlock_disc==0)
{
$status_addlock_disc=1;
}
if ($_GET['actionpage']=='unlockdisc' && $status_addlock_disc==1)
{
$status_addlock_disc=1;
$status_addlock_disc=0;
}
$sql='UPDATE '.$tbl_wiki.' SET addlock_disc="'.Database::escape_string($status_addlock_disc).'" WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter;
@ -1305,22 +1281,14 @@ function check_addlock_discuss()
}
//show status
if ($row['addlock_disc']==1 || ($row['content']=='' AND $row['title']=='' AND $page=='index'))
{
return false;
}
else
{
return true;
}
return $row['addlock_disc'];
}
/**
* Lock rating discussion
* @author Juan Carlos Raña <herodoto@telefonica.net>
* Return current database status of rating discuss and change it if get action
*/
function check_ratinglock_discuss()
{
@ -1336,19 +1304,19 @@ function check_ratinglock_discuss()
$row=Database::fetch_array($result);
$status_ratinglock_disc=$row['ratinglock_disc'];
$id=$row['id']; //need ? check. TODO
//change status
if ($_GET['actionpage']=='ratinglock_disc' && (api_is_allowed_to_edit(false,true) || api_is_platform_admin()))
if (api_is_allowed_to_edit(false,true) || api_is_platform_admin())
{
if ($row['ratinglock_disc']==1)
{
$status_ratinglock_disc=0;
}
else
if ($_GET['actionpage']=='lockrating' && $status_ratinglock_disc==0)
{
$status_ratinglock_disc=1;
$status_ratinglock_disc=1;
}
if ($_GET['actionpage']=='unlockrating' && $status_ratinglock_disc==1)
{
$status_ratinglock_disc=0;
}
$sql='UPDATE '.$tbl_wiki.' SET ratinglock_disc="'.Database::escape_string($status_ratinglock_disc).'" WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter; //Visibility. Value to all,not only for the first
Database::query($sql,__FILE__,__LINE__);
@ -1361,21 +1329,15 @@ function check_ratinglock_discuss()
}
//show status
if ($row['ratinglock_disc']==1 || ($row['content']=='' AND $row['title']=='' AND $page=='index'))
{
return false;
}
else
{
return true;
}
return $row['ratinglock_disc'];
}
/**
* Notify page changes
* @author Juan Carlos Raña <herodoto@telefonica.net>