• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

NSFW - do not make changeable if set / nicht mehr änderbar machen wenn gesetzt

DeCysos

Phoenix Foto Service
[DE] Ich bin gerade dabei einige Dateien (3 Stück) soweit umzuschreiben das folgendes passiert:
  • Der Benutzer kann nach dem Hochladen ja die Einstellung für NSFW sehen und auch aktivieren
  • nach der Aktivierung soll dem Mitgeteilt werden das das Bild gesperrt oder im NSFW Modus ist und er dies nicht mehr ändern kann und sich an den Administrator wenden soll.
[EN] I'm just going to rewrite some files (3 pieces) as far as the following happens:
  • After uploading, the user can see and enable the setting for NSFW
  • after the activation should be notified that the image is locked or in NSFW mode and he can not change this and should contact the administrator.

Mein Problem / My problem:
[DE]
Die Variable get_image()['nsfw'] gibt keinen Wert zurück. Weder 0 noch 1.
[EN] The variable get_image()['nsfw'] returns no value. Neither 0 nor 1.
[DE] Dies folgende Datei:
[EN] The following file:
[CODE lang="php" title="/app/themes/Peafowl/snippets/form_image.php" highlight="28"]<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>

<div class="input-label">
<label for="form-image-title"><?php _se('Title'); ?> <span class="optional"><?php _se('optional'); ?></span></label>
<input type="text" id="form-image-title" name="form-image-title" class="text-input" value="<?php echo function_exists('get_image_safe_html') ? get_image_safe_html()["title"] : NULL; ?>" placeholder="<?php _se('Untitled image'); ?>" maxlength="<?php echo CHV\getSetting('image_title_max_length'); ?>">
</div>
<?php
if(!function_exists('get_image') or (function_exists('get_image') && get_image()['user'])) {
?>
<div id="move-existing-album" data-view="switchable" class="c7 input-label">
<?php G\Render\include_theme_file("snippets/form_move_existing_album"); ?>
</div>
<div id="move-new-album" data-content="form-new-album" data-view="switchable" class="soft-hidden">
<?php G\Render\include_theme_file("snippets/form_album"); ?>
</div>
<?php
}
?>
<?php
if(get_categories()) {
?>
<div class="input-label c7">
<?php G\Render\include_theme_file('snippets/form_category'); ?>
</div>
<?php
}
?>
<div class="checkbox-label"><span rel="template-tooltip" data-tiptip="right" data-title="<?php _se('Mark this if the image is not family safe'); ?>"><label for="form-nsfw"><input class="float-left" type="checkbox" name="form-nsfw" id="form-nsfw"<?php if(function_exists('get_image') and get_image()['nsfw']) { echo ' checked'; } ?>><?php _se('Flag as unsafe'); ?></label></span></div>

<div class="input-label">
<label for="form-image-description"><?php _se('Description'); ?> <span class="optional"><?php _se('optional'); ?></span></label>
<textarea id="form-image-description" name="form-image-description" class="text-input no-resize" placeholder="<?php _se('Brief description of this image'); ?>"><?php echo function_exists('get_image_safe_html') ? get_image_safe_html()["description"] : NULL; ?></textarea>
</div>[/CODE]
[DE] In der markierten Zeile 28 befindet sich folgender Form Input:
[EN] In the marked line 28 is the following form input:
<input class="float-left" type="checkbox" name="form-nsfw" id="form-nsfw"<?php if(function_exists('get_image') and get_image()['nsfw']) { echo ' checked'; } ?>>
[DE] Da diese if Anweisung jedoch nicht funktioniert (über diese Datei) ist es auch völlig sinnlos diese dort zu setzen.
Anscheinend wird das Formular über JS geprüft und die Checkbox aktiviert und deaktiviert.​
[EN] However, since this if statement does not work (via this file) it is completely useless to put it there.
Apparently the form will be checked via JS and the checkbox will be activated and deactivated.​

Meine Aktuelle Lösung ist folgende / My current solution is the following:
[CODE lang="php" title="/app/themes/Peafowl/overrides/snippets/form_image.php" highlight="28-40"]<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>

<div class="input-label">
<label for="form-image-title"><?php _se('Title'); ?> <span class="optional"><?php _se('optional'); ?></span></label>
<input type="text" id="form-image-title" name="form-image-title" class="text-input" value="<?php echo function_exists('get_image_safe_html') ? get_image_safe_html()["title"] : NULL; ?>" placeholder="<?php _se('Untitled image'); ?>" maxlength="<?php echo CHV\getSetting('image_title_max_length'); ?>">
</div>
<?php
if(!function_exists('get_image') or (function_exists('get_image') && get_image()['user'])) {
?>
<div id="move-existing-album" data-view="switchable" class="c7 input-label">
<?php G\Render\include_theme_file("snippets/form_move_existing_album"); ?>
</div>
<div id="move-new-album" data-content="form-new-album" data-view="switchable" class="soft-hidden">
<?php G\Render\include_theme_file("snippets/form_album"); ?>
</div>
<?php
}
?>
<?php
if(get_categories()) {
?>
<div class="input-label c7">
<?php G\Render\include_theme_file('snippets/form_category'); ?>
</div>
<?php
}
?>
<?php
//Wenn NSFW gesetzt ist, dann ist es nur noch änderbar durch Moderatoren und Administratoren is_content_manager()
if(!is_content_manager()) {
?>
<div class="checkbox-label"><span class="icon icon-lock"></span><span style="background-color:#E84C3D;padding:2px;">Bild wurde als anstößig markiert und steht nicht mehr der Öffentlichkeit zur verfügung.</span></div>
<div class="checkbox-label"><span class="icon icon-arrow-right2"></span><span style="padding:0 10px 0 10px;">Möchten Sie das Bild wieder frei geben, so benutzen Sie bitte das <a href="/page/kontakt">Kontaktformular</a>.</span></div>
<?php
}else{
?>
<div class="checkbox-label"><span rel="template-tooltip" data-tiptip="right" data-title="<?php _se('Mark this if the image is not family safe'); ?>"><label for="form-nsfw"><input class="float-left" type="checkbox" name="form-nsfw" id="form-nsfw"<?php if(function_exists('get_image') and get_image()['nsfw']) { echo ' checked'; } ?>><?php _se('Flag as unsafe'); ?></label></span></div>
<?php
}
?>

<div class="input-label">
<label for="form-image-description"><?php _se('Description'); ?> <span class="optional"><?php _se('optional'); ?></span></label>
<textarea id="form-image-description" name="form-image-description" class="text-input no-resize" placeholder="<?php _se('Brief description of this image'); ?>"><?php echo function_exists('get_image_safe_html') ? get_image_safe_html()["description"] : NULL; ?></textarea>
</div>[/CODE]
[DE] Das Problem dabei ist jetzt nun aktuell das die Listenansicht (Fortlaufend) nicht mehr funktioniert und ich umstellen musste auf Seitenweise
[EN] The problem is now now that the list view (Continuous) is no longer working and I had to switch to page by page

Meine Frage / My question:
[DE] Welche andere Möglichkeit habe ich um für das betreffende Bild zu Überprüfen ob NSFW gesetzt ist oder nicht?
[EN] What other option do I have to check for the picture in question whether NSFW is set or not?
 
Back
Top