• 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

Upload images and get link subdomain

Ceseispe

Chevereto Member
Hello Mates,

For example:

How upload image and get link in subdomain, and not in the main domain:

Upoad image in the main domain image.tld

And get link in the subdomain:

img.images.tld

Waiting for reply.

a Greeting.
 
You have to trick the class upload response and the class db to use that domain.
 
pass me the code for change this.

i need my image hosting uplos.net upload the images in subdomain.

img.uplos.net for example.

how fix this?
open file includes\classes\class.db.php line 380 there should be this $populate array\
Change from http://i.imgr.ro to whatever suits for you

Code:
$populate = array(
                    'image_filename'    => $imageDB['image_name'].'.'.$imageDB['image_type'],
                    'image_id_public'    => $id_public,
                    'image_path'        => $image_target['image_path'],
                    'image_url'            => "http://i.imgr.ro/".$imageDB['image_name'].'.'.$imageDB['image_type'],
                    'image_attr'        => 'width="'.$imageDB['image_width'].'" height="'.$imageDB['image_height'].'"',
                    'image_bytes'        => intval($imageDB['image_size']),
                    'image_size'        => format_bytes($imageDB['image_size']),
                    'image_thumb_url'    => "http://i.imgr.ro/".$imageDB['image_name'].'.th.'.$imageDB['image_type'],
                    'image_thumb_path'    => $image_target['image_thumb_path'],
                    'image_thumb_width'    => chevereto_config('thumb_width'),
                    'image_thumb_height'=> chevereto_config('thumb_height'),
                    'image_viewer'        => __CHV_BASE_URL__.__CHV_VIRTUALFOLDER_IMAGE__.'/'.$id_public,
                    'image_shorturl'    => __CHV_BASE_URL__.$id_public,
                    'image_delete_url'    => __CHV_BASE_URL__.'delete/image/'.$id_public.'/'.$imageDB['image_delete_hash'],
                    'image_delete_confirm_url' => __CHV_BASE_URL__.'delete-confirm/image/'.$id_public.'/'.$imageDB['image_delete_hash']
                );


open file includes\classes\class.filelist.php line 136
Code:
                    $filename = $file_array['image_name'].'.'.$file_array['image_type'];
                    $file_array['image_viewer'] = __CHV_BASE_URL__.__CHV_VIRTUALFOLDER_IMAGE__.'/'.encodeID($file_array['image_id']);
                    $file_array['image_size'] = format_bytes($result['image_size'], 0);
                    $file_array['image_url'] = "http://i.imgr.ro/". $filename;
                    $file_array['image_thumb_url'] = "http://i.imgr.ro/". $file_array['image_name'].'.th.'.$file_array['image_type'];
                    $file_array['image_shorturl'] = __CHV_BASE_URL__.encodeID($file_array['image_id']);
                    $file_array['timestamp'] = strtotime($file_array['image_date']);
                    $file_array['image_date'] = date('Y-m-d', $file_array['timestamp'])


open file includes\classes\class.upload.php line 242
Code:
                    $this->image_info = array(
                        'image_name'            => $name,
                        'image_filename'        => $name.".".$this->extension,
                        'image_type'            => $this->extension,
                        'image_path'            => $file_path,
                        'image_url'                => "http://i.imgr.ro/".$name.".".$this->extension,
                        'image_width'            => $info['width'],
                        'image_height'            => $info['height'],
                        'image_attr'            => 'width="'.$info['width'].'" height="'.$info['height'].'"',
                        'image_bytes'            => $info['bytes'],
                        'image_size'            => $info['size'],
                        'image_thumb_url'        => "http://i.imgr.ro/".$name.".th.".$this->extension,
                        'image_thumb_path'        => $thumb_path,
                        'image_thumb_width'        => $this->thumb_width,
                        'image_thumb_height'    => $this->thumb_height
                    );

open file content/themes/Peafowl/view.php or whatever your theme name is its not Peafowl and look for <div class="image-tools-section show_directly">
Code:
                    <h3><?php show_lang_txt('txt_show_directly'); ?> <span><?php show_lang_txt('txt_show_directly_desc'); ?></span></h3>
                    <div class="input-item">
                        <label for="direct-link-<?php show_image_id(); ?>"><a href="http://i.imgr.ro/<?php show_image_filename(); ?>"><?php show_lang_txt('txt_show_directly_link'); ?></a>:</label>
                        <input type="text" id="direct-link-<?php show_image_id(); ?>" value="http://i.imgr.ro/<?php show_image_filename(); ?>" />
                    </div>

open file content/themes/Peafowl/shorturl.php

Code:
    <div id="header">
        <h1><a href="<?php show_base_url(); ?>"><?php show_domain(); ?></a></h1>
        <h2><?php show_image_filename(); ?></h2>
        <div id="shortURL-links">
            <a id="viewer-link" href="<?php show_image_viewer(); ?>"><?php show_lang_txt('txt_show_viewer_link'); ?></a>
            <a id="direct-link" href="http://i.imgr.ro/<?php show_image_filename(); ?>"><?php show_lang_txt('txt_show_directly_link'); ?></a>
        </div>
    </div>
    <div id="shortURL-content">
        <a href="http://i.imgr.ro/<?php show_image_filename(); ?>">
            <img src="http://i.imgr.ro/<?php show_image_filename(); ?>" alt="<?php show_image_filename(); ?>" width="<?php show_image_width(); ?>" height="<?php show_image_height(); ?>" />
        </a>
    </div>


If you can't do it or you just want me to take care of it just send me 10$ via paypal and I'll take care of it for you.
 
Back
Top