• 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

[NB 1.9] Images Categories

Danny.Domb

👽 Chevereto Freak
Uploads the images in the following path : images/CATEGORIE_NAME
It also automaticly create the sub directories


9d3m1.png


Modifications :

open index.php

find
Code:
    <div id="redimensionar">
        <div id="redimensionar_cajatitulo">
            <div id="redimensionar_titulo">
                <div id="boton_redimensionar"<?php if (isset($lang)) { echo ' class="'.$lang.'"'; } ?>><span><a id="rclosed"></a><a id="ropen" style="display: none;"></a></span></div>
                <div id="red_mensaje"><span id="red1"><?php echo RESIZE_DSC;?></span><span id="red2" style="display: none;"></span></div>
            </div>
        </div>        
        <div id="redimensionar-borde" style="display: none;">
            <div id="cajonred">
                <div id="ancho_deseado"><?php echo RESIZE_WIDTH;?> <span><?php echo RESIZE_PIXELS;?></span></div>
                <input name="resize" id="resize"/>
                <div id="kepp"><?php echo RESIZE_KEEP;?></div>
            </div>
        </div>
    </div>

add after
Code:
        <div style="text-align: center;">
            <h5> Categories </h5>
        
            <select name="categories">
            <?php
                foreach ($categories as $key=>$value)
                {
                    print('<option value="'.$key.'" />'.$value);
                }
            ?>
            </select>
        </div>


open config.php

find :
Code:
$allow_over_resize = false; // true: Allows over resize images - false: Don't allow over resize.

** 'FOLDER_NAME' => 'Name that appears on the dropdown',

add after
Code:
// ALL NAMES MUST ONLY CONTAINS ALPHA NUMERICS CARACTERS OR SPACES
$categories = array (
                        '' => 'No Categories',
                        'Diablo III' => 'Diablo III',
                        'WoW' => 'World of Warcraft',
                        'FF13' => 'Final Fantasty 13',
                        'COD6' => 'Call of Duty: Black Ops'
                    );

open engine.php

find
Code:
require('config.php');

add after
Code:
foreach($categories as $name=>$dir)
{
    if (!file_exists(DIR_IM.$name))
    {
        mkdir(DIR_IM.$name, 0777);
    }
    
    if (!file_exists(DIR_TH.$name))
    {
        mkdir(DIR_TH.$name, 0777);
    }
}


find
Code:
            if (empty($resize)) {
                // Haga como si nada...
                copy($handlework, DIR_IM.$name);
                $titulo = UPLOAD_OK.ESP_TITULO;
            }

add before
Code:
            if (isset($_POST['categories']) && !empty($_POST['categories']))
            {
                $name = $_POST['categories'].'/'.$name;
            }
 
Back
Top