• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

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