@ -42,6 +42,15 @@ $response = (object)
'message' => false,
'message' => false,
]
]
],
],
'description' => (object)
[
'value' => false,
'valid' => (object)
[
'success' => true,
'message' => false,
]
],
'dn' => (object)
'dn' => (object)
[
[
'value' => false,
'value' => false,
@ -211,17 +220,27 @@ else {
else
else
{
{
$response->form->metaTitle->valid->success = false;
$response->form->metaTitle->valid->success = false;
$response->form->metaTitle->valid->message = sprintf(_('* required, minimum %s-%s chars'), MAGNET_META_TITLE_MIN_LENGTH, MAGNET_META_TITLE_MAX_LENGTH);
$response->form->metaTitle->valid->message = sprintf(_('* required, %s-%s chars'), MAGNET_META_TITLE_MIN_LENGTH, MAGNET_META_TITLE_MAX_LENGTH);
}
}
if (MAGNET_META_DESCRIPTION_MIN_LENGTH < = mb_strlen($_POST['metaDescription']) & & MAGNET_META_DESCRIPTION_MAX_LENGTH >= mb_strlen($_POST['metaDescription']))
if (mb_strlen($_POST['metaDescription']) < MAGNET_META_DESCRIPTION_MIN_LENGTH | | mb_strlen ( $ _POST [ ' metaDescription ' ] ) > MAGNET_META_DESCRIPTION_MAX_LENGTH)
{
$response->form->metaDescription->valid->success = false;
$response->form->metaDescription->valid->message = sprintf(_('* required, %s-%s chars, %s provided'), MAGNET_META_DESCRIPTION_MIN_LENGTH, MAGNET_META_DESCRIPTION_MAX_LENGTH, mb_strlen($_POST['metaDescription']));
}
else
{
{
$db->updateMagnetMetaDescription($magnet->magnetId, trim(strip_tags(html_entity_decode($_POST['metaDescription']))), time());
$db->updateMagnetMetaDescription($magnet->magnetId, trim(strip_tags(html_entity_decode($_POST['metaDescription']))), time());
}
}
if (mb_strlen($_POST['description']) < MAGNET_DESCRIPTION_MIN_LENGTH | | mb_strlen ( $ _POST [ ' description ' ] ) > MAGNET_DESCRIPTION_MAX_LENGTH)
{
$response->form->description->valid->success = false;
$response->form->description->valid->message = sprintf(_('* required, %s-%s chars, %s provided'), MAGNET_DESCRIPTION_MIN_LENGTH, MAGNET_DESCRIPTION_MAX_LENGTH, mb_strlen($_POST['description']));
}
else
else
{
{
$response->form->metaDescription->valid->success = false;
$db->updateMagnetDescription($magnet->magnetId, trim(strip_tags(html_entity_decode($_POST['description']))), time());
$response->form->metaDescription->valid->message = sprintf(_('* required, minimum %s-%s chars'), MAGNET_META_DESCRIPTION_MIN_LENGTH, MAGNET_META_DESCRIPTION_MAX_LENGTH);
}
}
// Social
// Social
@ -364,6 +383,7 @@ else {
if ($response->success & &
if ($response->success & &
$response->form->metaTitle->valid->success & &
$response->form->metaTitle->valid->success & &
$response->form->metaDescription->valid->success & &
$response->form->metaDescription->valid->success & &
$response->form->description->valid->success & &
$response->form->tr->valid->success & &
$response->form->tr->valid->success & &
$response->form->as->valid->success & &
$response->form->as->valid->success & &
$response->form->xs->valid->success)
$response->form->xs->valid->success)
@ -389,6 +409,9 @@ else {
// Meta Description
// Meta Description
$response->form->metaDescription->value = $magnet->metaDescription;
$response->form->metaDescription->value = $magnet->metaDescription;
// Description
$response->form->description->value = $magnet->description;
// Magnet settings
// Magnet settings
$response->form->public->value = (bool) $magnet->public;
$response->form->public->value = (bool) $magnet->public;
$response->form->comments->value = (bool) $magnet->comments;
$response->form->comments->value = (bool) $magnet->comments;
@ -517,11 +540,16 @@ else {
< div class = "margin-b-8" > <?php echo $response -> form -> metaTitle -> valid -> message ?> </ div >
< div class = "margin-b-8" > <?php echo $response -> form -> metaTitle -> valid -> message ?> </ div >
<?php } ?>
<?php } ?>
< input class = "width-100 <?php echo ( $response -> form -> metaTitle -> valid -> success ? false : 'background-color-red' ) ?> " type = "text" name = "metaTitle" value = " <?php echo $response -> form -> metaTitle -> value ?> " placeholder = " <?php echo _ ( 'Main title' ) ?> " maxlength = "255" />
< input class = "width-100 <?php echo ( $response -> form -> metaTitle -> valid -> success ? false : 'background-color-red' ) ?> " type = "text" name = "metaTitle" value = " <?php echo $response -> form -> metaTitle -> value ?> " placeholder = " <?php echo _ ( 'Main title' ) ?> " maxlength = "255" />
< label class = "display-block margin-y-8" > <?php echo _ ( 'D escription' ) ?> </ label >
< label class = "display-block margin-y-8" > <?php echo _ ( 'Short d escription' ) ?> </ label >
<?php if ( $response -> form -> metaDescription -> valid -> message ) { ?>
<?php if ( $response -> form -> metaDescription -> valid -> message ) { ?>
< div class = "margin-b-8" > <?php echo $response -> form -> metaDescription -> valid -> message ?> </ div >
< div class = "margin-b-8" > <?php echo $response -> form -> metaDescription -> valid -> message ?> </ div >
<?php } ?>
<?php } ?>
< textarea class = "width-100 <?php echo ( $response -> form -> metaDescription -> valid -> success ? false : 'background-color-red' ) ?> " name = "metaDescription" placeholder = " <?php echo _ ( 'Describe your magnet for others' ) ?> " > <?php echo $response -> form -> metaDescription -> value ?> </ textarea >
< textarea class = "width-100 <?php echo ( $response -> form -> metaDescription -> valid -> success ? false : 'background-color-red' ) ?> " name = "metaDescription" placeholder = " <?php echo _ ( 'Shows in listing and meta tags' ) ?> " > <?php echo $response -> form -> metaDescription -> value ?> </ textarea >
< label class = "display-block margin-y-8" > <?php echo _ ( 'Long description' ) ?> </ label >
<?php if ( $response -> form -> description -> valid -> message ) { ?>
< div class = "margin-b-8" > <?php echo $response -> form -> description -> valid -> message ?> </ div >
<?php } ?>
< textarea class = "width-100 <?php echo ( $response -> form -> description -> valid -> success ? false : 'background-color-red' ) ?> " name = "description" placeholder = " <?php echo _ ( 'Shows on magnet page' ) ?> " > <?php echo $response -> form -> description -> value ?> </ textarea >
< / fieldset >
< / fieldset >
< fieldset class = "display-block margin-b-16" >
< fieldset class = "display-block margin-b-16" >
< legend class = "text-right width-100 padding-y-8 margin-b-8 border-bottom-default" > <?php echo _ ( 'BitTorrent' ) ?> </ legend >
< legend class = "text-right width-100 padding-y-8 margin-b-8 border-bottom-default" > <?php echo _ ( 'BitTorrent' ) ?> </ legend >