[DEV] Real Remote [img] Resize v.0.0.2 (en)

DEV-Area for phpBB 3.0.x

[DEV] Real Remote [img] Resize v.0.0.2 (en)

Postby 4seven » Mon 1. Feb 2010, 15:44 | Userzeit: +1.00 / Mo 1. Feb 2010, 15:44

Real Remote [img] Resize

   80%

MOD-Title: Real Remote [img] Resize
MOD-Version: 0.0.2
MOD-Author: 4seven

MOD-Description: This Mod replaces [img] remote pics with true resized thumbs of given size

MOD-Demo: http://4seven.bplaced.net/forum/media/v ... f=13&t=219
UN: tester
PW:tester


phpBB-Version: phpBB 3.0.x
phpBB-Languages: multilingual
phpBB-Styles: all Styles

Image (follows)

Download: http://4seven.bplaced.net/forum/6test/v ... f=3&t=372&

Instruction: viewtopic.php?p=1532&f=8#p1532

Features:
- thumbing of posted external site [img]
- true resize, no javascript client resize, that makes [img]'s only optically smaller
- thumbs storing on your own server
- screen-mode (published) and base-mode (unpublished)
- don't effects allready local stored [img]'s
- thumb output width is adjustable, to have perfect forum fit
- so [img]'s works in harmony with given [attachment]'s max width
- also no minuted remote linking and stolen bandwidth
- optional highslide in screen-mode with link-zoom to original-pic

Requirements: fopen()

Explanations

Screen-Mode:
- remote-pics are copied to given folder, resized and displayed with local-link
- local filenames are converted to mixed md5
- optional highslide-mode with link-zoom to origin-pic
- by edit u see the origin remote-link
- by review-reply ore quote u see the transformed local-link
- works in all areas: search, viewtopic, posting
- no update to database

Description:
- remote pics have the perfect size, so the forum have the exact fit
- pics are truly physical resized, not only client-sided (eg. with java)
- pics are stored on your own server (which makes the forum faster)
- no more worry about dead-links



The Working Mode:
- even if a topic-site turn to the next site or "it is full" a button appears, that is normally 'admin-only':
[Convert [img] on this page] http://4seven.bplaced.net/forum/media/v ... f=13&t=219
- wait a little, then all remote-img will be converted
- after that the [Delete converted [img]] button appears so u can delete all pics on this topic-site to eg. update edited pics
- when u edit your img-post (or from others, with given rights) u see the origin remote-link
- when u review-reply or quote the img-post, it transforms automatically the (hidden) remote-link to the local-link and filename
- from now on the script ignore this quoted img-post, bcs. it have allready local-links
- local img-links will be strictly ignored




Planned:
- ACP??

Notes:
- No display of protected remote pics
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Mon 1. Feb 2010, 15:44 +1.00
Userzeit: Mo 1. Feb 2010, 15:44

Re: [DEV] Real Remote [img] Resize v.0.0.1 (en) (beta-test)

Postby 4seven » Mon 26. Apr 2010, 23:28 | Userzeit: +1.00 / Mo 1. Feb 2010, 15:44

Instruction

Real Remote [img] Resize v.0.0.2



download package



make shure u enter all settings in includes/real_remote_img_resize_config.php before u ask anything

Code: Select all
//------------SETTINGS--------------
//----------------------------------
// turn the mod on/off
$real_img_on_off_scr = 'on';
// enter as given: 'on' or 'off'
//----------------------------------
// make the setting, if you desired width or height here
$width_or_height_rem_scr = 'width';
// width makes absolute more sense ;)
//----------------------------------
// make the setting of thumb-size in px here (counts for width or height)
$convert_max_size_rem_scr = 400;
// fit it to your forum design ;)
//----------------------------------
// if this feature is set to 'yes', the origin pic is open with highslide
$real_convert_highslide_scr = 'no';
// enter as given: 'yes' or 'no'
//----------------------------------
// enter here the forum id's to thumbing  
$affected_real_img_scr    = array(7,8,9); 
// enter as given: (7,8,9) 
//------------------------------------
//-------------SETTINGS---------------                       




copy all files from root/*.* to /*.*



make folder images/post_thumbs and give chmod 777 to it



open

search.php

Code: Select all
        'U_SEARCH_WORDS'    => $u_search,
    ));


after add

Code: Select all
        // Real Remote [img] Resize / Screen Version / 4seven / 2010 
        include($phpbb_root_path . 'includes/real_remote_img_resize_config.' . $phpEx);
        // Real Remote [img] Resize / Screen Version / 4seven / 2010           


find

Code: Select all
                $row['post_text'] = censor_text($row['post_text']);


after add

Code: Select all
                // Real Remote [img] Resize / Screen Version / 4seven / 2010    
                include($phpbb_root_path . 'includes/real_remote_img_resize_screen_search.' . $phpEx);
                // Real Remote [img] Resize / Screen Version / 4seven / 2010                            




open

posting.php

find

Code: Select all
$post_data['post_text'] = $message_parser->message;


after add

Code: Select all
// Real Remote [img] Resize / Screen Version / 4seven / 2010    
 if ($mode !== 'edit'){
 include($phpbb_root_path . 'includes/real_remote_img_resize_config.' . $phpEx);
 include($phpbb_root_path . 'includes/real_remote_img_resize_screen_posting.' . $phpEx);}
// Real Remote [img] Resize / Screen Version / 4seven / 2010                            




open

viewtopic.php

find

Code: Select all
// Output the posts
$first_unread = $post_unread = false;


before add

Code: Select all
// Real Remote [img] Resize / Screen Version / 4seven / 2010    
include($phpbb_root_path . 'includes/real_remote_img_resize_config.' . $phpEx);
// Real Remote [img] Resize / Screen Version / 4seven / 2010                              


find

Code: Select all
    $message = censor_text($row['post_text']);


after add

Code: Select all
    // Real Remote [img] Resize / Screen Version / 4seven / 2010    
    include($phpbb_root_path . 'includes/real_remote_img_resize_screen_view.' . $phpEx);
    // Real Remote [img] Resize / Screen Version / 4seven / 2010                             




open

includes/functions_posting.php

find

Code: Select all
    for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)


before add

Code: Select all
    // Real Remote [img] Resize / Screen Version / 4seven / 2010    
    include($phpbb_root_path . 'includes/real_remote_img_resize_config.' . $phpEx);
    // Real Remote [img] Resize / Screen Version / 4seven / 2010                        


find

Code: Select all
            $decoded_message = bbcode_nl2br($decoded_message);


after add

Code: Select all
            // Real Remote [img] Resize / Screen Version / 4seven / 2010    
            include($phpbb_root_path . 'includes/real_remote_img_resize_screen_posting_review.' . $phpEx);
            // Real Remote [img] Resize / Screen Version / 4seven / 2010                            


find

Code: Select all
        $template->assign_block_vars($mode . '_row', array(


before add

Code: Select all
            // Real Remote [img] Resize / Screen Version / 4seven / 2010    
            include($phpbb_root_path . 'includes/real_remote_img_resize_screen_post_review.' . $phpEx);
            // Real Remote [img] Resize / Screen Version / 4seven / 2010                        




open

styles/prosilver/template/viewtopic_body.html

find

Code: Select all
    <!-- IF PAGINATION or TOTAL_POSTS -->
      <div class="pagination">


after add

Code: Select all
    <!-- IF U_ACP -->            
        
<!-- IF S_CONVERT_FALSE -->
        <br />
        <form action="convert">
        <fieldset>
        <!-- IF S_CONVERT_TRUE -->
        <input class="button2" type="button" value="Delete converted [img]" onclick="location='{DELETE_LINK}'" />
        <!-- ELSE -->
        <input class="button2" type="button" value="Convert [img] on this page" onclick="location='{CONVERT_LINK}'" />
        <!-- ENDIF -->
        </fieldset>
        </form>
        <br />
        <!-- ENDIF -->
    <!-- ENDIF -->




open

styles/subsilver2/template/viewtopic_body.html

find (the first find)

Code: Select all
            <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
        <!-- ENDIF -->


after add

Code: Select all
            <td class="gensmall" nowrap="nowrap">
        <!-- IF U_ACP -->                
            
<!-- IF S_CONVERT_FALSE -->
            <form action="convert">
            <fieldset>
            <!-- IF S_CONVERT_TRUE -->
            <input class="btnbbcode" type="button" value="Delete converted [img]" onclick="location='{DELETE_LINK}'" />
            <!-- ELSE -->
            <input class="btnbbcode" type="button" value="Convert [img] on this page" onclick="location='{CONVERT_LINK}'" />
            <!-- ENDIF -->
            </fieldset>
            </form>
            <!-- ENDIF -->
        <!-- ENDIF -->
            </td>
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Mon 26. Apr 2010, 23:28 +1.00
Userzeit: Mo 1. Feb 2010, 15:44

Re: [DEV] Real Remote [img] Resize v.0.0.1 (en) (release)

Postby 4seven » Tue 27. Apr 2010, 01:08 | Userzeit: +1.00 / Mo 1. Feb 2010, 15:44

Higshlide Support

upload from package

root/highslide/*.* to highslide/*.*

open

styles/xxxxx/template/overall_header.html

find

Code: Select all
<head


before add

Code: Select all
<script type="text/javascript" src="highslide/highslide.js"></script>
<link rel="stylesheet" type="text/css" href="highslide/highslide.css" />
<script type="text/javascript">
    // override Highslide settings here
    // instead of editing the highslide.js file
    hs.graphicsDir = 'highslide/graphics/';
</script>
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Tue 27. Apr 2010, 01:08 +1.00
Userzeit: Mo 1. Feb 2010, 15:44

Re: [DEV] Real Remote [img] Resize v.0.0.1 (en) (release)

Postby 4seven » Tue 27. Apr 2010, 03:20 | Userzeit: +1.00 / Mo 1. Feb 2010, 15:44

Tip

If u get a memory_limit error bcs. of too big remote-pics (limits by server) try the following

open

.htaccess

enter at the begin

Code: Select all
php_value memory_limit 128M


This will work for pics ~ 3000 x 3000 px

or

Code: Select all
php_value memory_limit 144M


This will work for pics ~ 4200 x 4200 px


Reduce or increase slowly in 4M Steps.

-----------

To check out how high u can go make a file memory.php

Code: Select all
<?php
$y
=ini_get('memory_limit');
echo $y;
?>


and call the file in browser.

> increase the .htaccess higher as this file displays make no sense
> in this case reduce slowly till the summery change
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Tue 27. Apr 2010, 03:20 +1.00
Userzeit: Mo 1. Feb 2010, 15:44

Re: [DEV] Real Remote [img] Resize v.0.0.1 (en)

Postby 4seven » Wed 26. Aug 2015, 01:02 | Userzeit: +1.00 / Mo 1. Feb 2010, 15:44

reminder:
fixing download links
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Wed 26. Aug 2015, 01:02 +1.00
Userzeit: Mo 1. Feb 2010, 15:44

Re: [DEV] Real Remote [img] Resize v.0.0.2 (en)

Postby 4seven » Wed 25. May 2016, 22:06 | Userzeit: +1.00 / Mo 1. Feb 2010, 15:44

NOTE

For some reasons

Code: Select all
phpbb_chmod() 

don't work

so open

real_remote_img_resize_screen_view.php

and find

Code: Select all
phpbb_chmod($rem_clr_path2, CHMOD_READ | CHMOD_WRITE); 

and replace with

Code: Select all
//phpbb_chmod($rem_clr_path2, CHMOD_READ | CHMOD_WRITE); 
chmod($rem_clr_path2,0755); 
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Wed 25. May 2016, 22:06 +1.00
Userzeit: Mo 1. Feb 2010, 15:44


Return to [DEV] Mods for 3.0.x



Who is online

Users browsing this forum: No registered users and 0 guests

cron