• 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.

Category required

Usernet

Chevereto Fan
Hello,

What should I change to force the user to choose a category?

I will end up with thousands of photos not categorized by my users.

I would like to prevent this behavior.

Thank you in advance
 
I think the file to edit :

app\themes\Peafowl\snippets\anywhere_upload.php

From line 132...

My skills do not allow me to do it. I ask for your support

Thank you
 
Yes in the file it would be possible.

So I just think of the following:
You create a category in the dashboard: "not arranged"
You write down the ID (number) of it.
[CODE lang="php" title="app\themes\Peafowl\snippets\anywhere_upload.php" highlight="7"] <?php
if (get_categories()) {
?>
<div class="input-label upload-input-col center-box text-align-left">
<label for="upload-category-id"><?php _se('Category'); ?></label>
<select name="upload-category-id" id="upload-category-id" class="text-input">
<option value><?php _se('Select category'); ?></option>
<?php
foreach (get_categories() as $category) {
?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
<?php
} //for
?>
</select>
</div>
<?php
} // categories?
?>[/CODE]

Replace the line <option value><?php _se('Select category'); ?></option> with <option value="YOURCATID"><?php _se('Select category'); ?></option>

Thus, you do not force the user to choose a category, but you have it later easier even assign the categories.
Everything else would be too complex now.
 
Thank you so much !

Category ID is the ID of category in the SQL table, not the ID configured in the control panel of Chevereto.

You are top on Chevereto 👍
 
Update ....

When in the
Dashboard -> Website -> Explore (Guests) == Disabled
is, then no category is assigned to guests.

To change this one would have to do the following.

Post #3 has a code
The line 18 } //categories? would be replaced with the following content ....
[CODE lang="php" highlight="2"] }else{ // categories?
echo '<input name="upload-category-id" id="upload-category-id" value="YOUR_CAT_ID" type="hidden">';
}[/CODE]
 
Back
Top