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

Some questions please

Flybee

Chevereto Member
Chevereto is really amazing and very nicely coded, runs very nice. I just would like some help on these issues:

Is there a firefox addon? I saw while back a thread but it was closed gave an error.

How can I make the thumbnail codes people copy after uploading a picture and bellow viewer to make the links open on new tabs. I read: chevereto.com/docs#!template-tags-arguments but I don't know which files to edit?

Does the latest post u made on this thread:
chevereto.com/community/threads/anyway-to-block-hotlinking-unless-its-a-thumbnail.1642/
work for latest version of Chevereto? What other method would you recommend for chevereto to block hot linking? I want to allow only thumbnails and not all the images/ folder and especially directly linking to the images.

One more thing how can I block the direct links when someone uploads an image? To remove some of the linkcode outputs shown like Direct Link , Html image. Which file should I find these at to edit? Any code line number?:)

Is there a desktop version or mobile version available?
(if not I plan to make mobile version for start)
 
Hi Flybee

1. Since Chevereto 2.0 the official Firefox extension was dropped. There have been user submitted contributions and you should forward the questions there.

2. You need to pay attention to the $target template tag, in this case the valye of the $target tag should be "_blank" and it will only work for HTML code since there is not target blank for BBCode.

3. Sure thing, it can work in Chevereto or in any website that handles .htaccess rules. It will work to block direct image hotlinking but it will allow thumbs.

4. You need to work in the files view.php and uploaded.php both of them located in content/themes/<yourtheme>/ and then remove what you don't need. Is just that ;)

5. No mobile version and is not planned so far.

Cheers.
 
2. Which file should I change the $target to "_blank" so when they copy the html code, to be opening in a new tab?

3. I tried this code in the main directory of .htaccess:

Code:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://demo.chevereto.com [NC]
RewriteCond %{REQUEST_URI} !^(.+)\.th\.(jpg|jpeg|png|gif) [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://demo.chevereto.com/hotlink.gif [NC,R,L]

But I don't know if it is affected by Cloudflare or its something else I need to do. It doesn't show any images and makes the website background also disappear.
Should I change anything in the code or add it also in any other place other than main directory .htacess file?
 
2. Which file should I change the $target to "_blank" so when they copy the html code, to be opening in a new tab?

The $target argument

The $target argument is a optional value that you can use to tell the template tag what target use in the HTML <a> target attribute. This argument is commonly used on the template tags that returns a link.
This $target argument will be replaced with the selected <a> target value. This is the list of targets that you can use:
  • "blank" opens in a new window
  • "self" opens in same window
  • "parent" opens in parent frameset
  • "top" open in topmost frame
For example, if you want to get target="_self" on the generated link of the template tag show_image_linked_html() you should do something like this:
  1. show_image_linked_html('','self');
Which will output:
  1. <ahref="http://demo.chevereto.com/id"target="_self"><imgsrc="http://demo.chevereto.com/images/image.jpg"alt="image.jpg"border="0"/></a>

FIles: view.php and uploaded.php
3. I tried this code in the main directory of .htaccess:

Code:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://demo.chevereto.com [NC]
RewriteCond %{REQUEST_URI} !^(.+)\.th\.(jpg|jpeg|png|gif) [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://demo.chevereto.com/hotlink.gif [NC,R,L]

But I don't know if it is affected by Cloudflare or its something else I need to do. It doesn't show any images and makes the website background also disappear.
Should I change anything in the code or add it also in any other place other than main directory .htacess file?

You have to use your own domain, not demo.chevereto.com
 
I saw in the file uploaded.php that it is already 'blank'
Code:
            <textarea id="html-thumb-codes" readonly="readonly"><?php show_images_thumbs_linked_html('shorturl', 'blank', '<img src="%IMAGE_THUMB_URL%" alt="%IMAGE_FILENAME%" border="0" />', ' '); ?></textarea>

But when someone goes to copy the html thumb code for that image, it doesnt have in the url _blank :( I have read the tutorial/guide many times but I cant understand it what to change :((


I changed the demo.chevereto to my domain example.com but it works only for example.com when I go to www.example.com it doesnt load images is there a way to make the default domain be www.example.com and for example.com to also redirect to www.example.com? So its easier for people to remember it without the site splitting in 2 sections.
 
In the demo is just like this:
Code:
<textarea id="html-thumb-codes" readonly="readonly"><?php show_images_thumbs_linked_html('viewer', 'blank', '<img src="%IMAGE_THUMB_URL%" alt="%IMAGE_FILENAME%" border="0" />', ' '); ?></textarea>

And it works. Perhaps you need to re-upload the file, or re-cache your website.
 
You need an .htaccess rule to force the www or no-www properly setup. Like this:

(forces all to www, put it at the top of your htaccess)
Code:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
 
Hotlinking was blocked successfully, I will make more tests on it later! Thank you! Do I have to add the hotlinking .htaccess code in /images/.htaccess also?

One more thing how can I have the default code on the dropdown, after someone uploads many pictures at a time to be thumb HTML codes instead of shorturls?
 
Hotlinking was blocked successfully, I will make more tests on it later! Thank you! Do I have to add the hotlinking .htaccess code in /images/.htaccess also?

Not needed, just the root .htacces

One more thing how can I have the default code on the dropdown, after someone uploads many pictures at a time to be thumb HTML codes instead of shorturls?

You can add selected to the <option> tag. http://www.w3schools.com/tags/att_option_selected.asp
 
Awesome! Thank you!!

I just added :
Code:
<option value="html-thumb-codes" selected="selected"><?php show_lang_txt("txt_multicodes_thumbs_html"); ?></option>
BUT it doesnt also show the first code to be html thumb code. On the selection its set to html thumb codes but it shows short url. How to also show the code also? It shows from the option but in order to get to the code I have to go to another option and back to html thumb code.
 
Hm you can change the order instead or trigger a javascript.
 
I tried to change the order of the select options in uploaded.php and to change the order of the text area codes under the select, but it didnt work. Anything else I should try any specific files to edit/change? Thanks for your support Rodolfo!
 
Changing the order should work. Can you paste the code?
 
Sure, I tried it about 3times cleared cache and purged cache from cf.

Code:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php include_theme_header(); ?>
    <div id="content">
 
        <?php if(is_multiupload_result()) : ?>
        <h2><?php show_lang_txt("txt_just_uploaded"); ?> <?php show_images_count(); ?> <?php show_lang_txt("txt_images"); ?></h2>
       
        <div id="multi-codes">
            <select>
                <option value="html-thumb-codes" selected="selected"><?php show_lang_txt("txt_multicodes_thumbs_html"); ?></option>
                <option value="short-urls-internal"><?php show_lang_txt("txt_show_directly_shorturl"); ?></option>
                <option value="direct-links"><?php show_lang_txt("txt_multicodes_directlink"); ?></option>
                <?php if(has_images_shorturls_service()) : ?><option value="short-urls-service"><?php show_tinyurl_service(); ?></option><?php endif; ?>
                <option value="html-codes"><?php show_lang_txt("txt_multicodes_html"); ?></option>
                <option value="bb-codes"><?php show_lang_txt("txt_multicodes_bbcode"); ?></option>
 
                <option value="thumb-bb-codes"><?php show_lang_txt("txt_multicodes_thumbs_bbcode"); ?></option>
            </select>
                        <textarea id="html-thumb-codes" readonly="readonly"><?php show_images_thumbs_linked_html('shorturl', 'blank', '<img src="%IMAGE_THUMB_URL%" alt="%IMAGE_FILENAME%" border="0" />', ' '); ?></textarea>
            <textarea id="short-urls-internal" readonly="readonly" style="display: block;"><?php show_images_shorturls('\n'); ?></textarea>
            <textarea id="direct-links" readonly="readonly"><?php show_images_urls('\n'); ?></textarea>
            <?php if(has_images_shorturls_service()) : ?><textarea id="short-urls-service" readonly="readonly"><?php show_images_shorturls_service('\n'); ?></textarea><?php endif; ?>
            <textarea id="html-codes" readonly="readonly"><?php show_images_html('<img src="%IMAGE_URL%" alt="%IMAGE_FILENAME%" border="0" />', ' '); ?></textarea>
            <textarea id="bb-codes" readonly="readonly"><?php show_images_bbcode('[img]%IMAGE_URL%[/img]', ' '); ?></textarea>
 
            <textarea id="thumb-bb-codes" readonly="readonly"><?php show_images_thumbs_linked_bbcode('shorturl', 'blank', '[img]%IMAGE_THUMB_URL%[/img]', ' '); ?></textarea>
        </div>
       
        <div id="uploaded">
            <div id="uploaded_list" visible-rows="2">
                <?php show_images_thumbs_raw_html('<a rel="%IMAGE_ID%" href="%IMAGE_VIEWER%"><img src="%IMAGE_THUMB_URL%" /></a>'); ?>
            </div>
        </div>
         
        <?php endif; ?>
       
        <?php while(have_images()) : the_image(); ?>
        <div id="uploaded_image-<?php show_image_id(); ?>" class="uploaded_image" <?php if(!is_first_loop()) : ?> style="display: none;"<?php endif; ?>>
       
            <h2 class="viewing"><?php show_lang_txt(is_singleupload_result() ? 'txt_just_uploaded' : 'txt_viewing'); ?> <a href="<?php show_image_shorturl(); ?>" target="_blank"><?php show_image_filename(); ?></a> (<?php show_image_size(); ?> - <?php show_image_dimentions(); ?>)<span class="loading-image"></span></h2>
           
            <div class="view-full-image"><a href="<?php show_image_shorturl(); ?>" target="_blank"><img src="<?php show_image_url(); ?>" alt="<?php show_image_filename(); ?>" width="<?php show_image_width(); ?>" height="<?php show_image_height(); ?>" class="full_image" /></a></div>
           
            <div class="image_tools">
           
                <div class="image-tools-section socialize">
                    <h3><?php show_lang_txt('txt_socialize'); ?> <span><?php show_lang_txt('txt_socialize_desc'); ?></span></h3>
                    <div class="input-item">
                        <label><?php show_lang_txt('txt_socialize_label'); ?>:</label>
                        <ul class="input-element">
                            <?php show_social_links('<li>', get_image_viewer(), get_image_url()); ?>             
                        </ul>
                    </div>
                </div>
               
                                <div class="image-tools-section thumb_plus_link">
                    <h3><?php show_lang_txt('txt_thumb_plus_link'); ?> <span><?php show_lang_txt('txt_thumb_plus_link_desc'); ?></span></h3>
                    <div class="input-item"><label for="html-code-<?php show_image_id(); ?>"><?php show_lang_txt('txt_thumb_plus_link_html'); ?>:</label> <input type="text" id="html-code-<?php show_image_id(); ?>" value="<?php show_image_thumb_linked_html(); ?>" /></div>
                    <div class="input-item"><label for="bb-code-thumb-<?php show_image_id(); ?>"><?php show_lang_txt('txt_thumb_plus_link_bbcode'); ?>:</label> <input type="text" id="bb-code-thumb-<?php show_image_id(); ?>" value="<?php show_image_thumb_linked_bbcode(); ?>" /></div>
                    <div class="input-item"><label for="thumb-url-<?php show_image_id(); ?>"><?php show_lang_txt('txt_thumb_url'); ?>:</label> <input type="text" id="thumb-url-<?php show_image_id(); ?>" value="<?php show_image_thumb_url(); ?>" /></div>
                </div>
   
                <div class="image-tools-section show_directly">
                    <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="short-url-internal-<?php show_image_id(); ?>"><a href="<?php show_image_shorturl(); ?>"><?php show_lang_txt('txt_show_directly_shorturl'); ?></a>:</label> <input type="text" id="short-url-internal-<?php show_image_id(); ?>" value="<?php show_image_shorturl(); ?>" /></div>
 
                </div>
               
 
               
                <div class="image-tools-section delete_link">
                    <h3>Delete link <span>save it for later</span></h3>
                    <div class="input-item"><label for="delete-link-input-<?php show_image_id(); ?>"><a id="delete-link" href="<?php show_image_delete_url(); ?>">Delete link</a></label>  <input type="text" id="delete-link-input-<?php show_image_id(); ?>" value="<?php show_image_delete_url(); ?>" /></div>
                </div>
               
            </div>
           
        </div>
        <?php endwhile; ?>
       
    </div>
<?php include_theme_footer(); ?>
 
Mmm add this JS to the uploaded.php file:
Code:
<script type="text/javascript">
$(function() {$("option[value='direct-links']").attr("selected", "selected").closest("select").trigger("change");});
</script>
 
Sorry, I was testing.. This is your code:

Code:
<script type="text/javascript">
$(function() {$("option[value='html-thumb-codes']").attr("selected", "selected").closest("select").trigger("change");});
</script>
 
Sorry to open this thread again but im experience two more problems now.

1. When someone uploads a picture (only one) it shows him this code without the _blank what do I need to change?
Code:
<a href="http://www.example.com/6"><img src="http://www.example.com/images/2013/06/12/2013-03-1234-51-12345.th.jpg" alt="2013-03-1234-51-12345.jpg" border="0" /></a>

2. When someone uploads multiple pictures the option is set to thumb html code the links point to
"http://www.example.com/image/x" instead of "http://www.example.com/x" How can I fix this?
*Note when someone uploads multiple pictures the _blank is set to all the thumb_html_codes.

thanks
 
The theme has a lot of tags to customize the output have you checked the documentation?
 
Yes but I cant understand it sorry :( I tried to do some modifications but I didnt know if I was editing the write files plus at the end the site went all blank so I had to reinstall Chevereto. Could you please guide/help me do those two things so the site will run perfectly?
 
Back
Top