X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/8adcdf2e61aa2746235d99202ad07b59d0198b04..bd23d65292b6eda5c00e85ddce27235b5529a565:/script.php diff --git a/script.php b/script.php index 45ca635..a6b9457 100755 --- a/script.php +++ b/script.php @@ -199,6 +199,15 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0) echo '

' . t('This will return brut text content.') . ' ' . t('First line is a block id the second line the edit/delete code.') . '

'; + echo '

' . t('Get block size') . ':

'; + echo '

'; + echo t('Send a GET query to') . ': ' . $web_root . 'script.php?get_block_size
'; + echo '
'; + echo t('Parameters') . ':
'; + echo "id=block_id (" . t('Required') . ")
"; + echo '

'; + echo '

' . t('This will return asked data or "Error" string.') . '

'; + echo '

' . t('Read data in a block') . ':

'; echo '

'; echo t('Send a GET query to') . ': ' . $web_root . 'script.php?read_block
'; @@ -241,6 +250,13 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0) /* Lets use interface now. */ header('Content-Type: text; charset=utf-8'); +check_errors (); +if (has_error ()) +{ + echo "Error"; + exit; +} + /* Upload file */ if (isset ($_FILES['file']) && is_writable (VAR_FILES) && is_writable (VAR_LINKS)) @@ -574,6 +590,14 @@ elseif (isset ($_GET['init_block']) && $cfg['enable_blocks']) else echo jirafeau_block_init ($_POST['size']); } +/* Get block size. */ +elseif (isset ($_GET['get_block_size']) && $cfg['enable_blocks']) +{ + if (!isset ($_POST['id'])) + echo "Error"; + else + echo jirafeau_block_get_size ($_POST['id']); +} /* Read data in block. */ elseif (isset ($_GET['read_block']) && $cfg['enable_blocks']) {