Konuyu Oyla:
  • Toplam: 0 Oy - Ortalama: 0
  • 1
  • 2
  • 3
  • 4
  • 5
phpbb - Resim Boyutunu Ayarlama
#1
MOD Ismi TR: Resim Boyutunu Ayarlama
MOD Ismi EN: Post Image Size
MOD Sürümü: v1.2.7
MOD Yazari: Swizec < <!-- e --><a href="mailtoConfusedwizec@swizec.com">swizec@swizec.com</a><!-- e --> > (N/A) <!-- m --><a class="postlink" href="http://www.swizec.com">http://www.swizec.com</a><!-- m -->

MOD Açiklamasi: Yönetim Panelinden girdiginiz boyutlara göre, forumunuza eklediginiz resimleri ayarlar.

MOD Çeviri: türkphpbb < <!-- e --><a href="mailto:admin@turkphpbb.org">admin@turkphpbb.org</a><!-- e --> > <!-- m --><a class="postlink" href="http://www.turkphpbb.org">http://www.turkphpbb.org</a><!-- m -->

Kurulum Seviyesi: Kolay
Kurulum Süresi: ~3 Dakika

Degisecek Dosyalar: 6
Kod:
        includes/bbcode.php
              admin/admin_board.php
              templates/senin_tema/bbcode.tpl
              templates/senin_tema/admin/board_config_body.tpl
              language/lang_turkish/lang_main.php
              language/lang_turkish/lang_admin.php

Eklenecek Dosyalar: Yok

Lisans: <!-- m --><a class="postlink" href="http://opensource.org/licenses/gpl-license.php">http://opensource.org/licenses/gpl-license.php</a><!-- m --> GNU General Public License v2

Notlar:

demo board: <!-- m --><a class="postlink" href="http://www.swizec.com/forum">http://www.swizec.com/forum</a><!-- m -->


Lütfen güvenlik açisindan ve MOD'un son sürümüne sahip olmak için, devamli
<!-- m --><a class="postlink" href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a><!-- m --> adresini takip edin. Bu MOD'u baska sitelerden indirdiginizde
çok dikkatli olun, içerisinde phpBB forumunuza zarar verebilecek kodlar bulunabilir.
<!-- m --><a class="postlink" href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a><!-- m --> arsivinde bulunmayan MOD'lar phpBB tarafindan desteklenmez.


Bu MOD'u kurmadan önce, degisecek tüm dosyalarin yedegini almanizi tavsiye ederiz.



-----[ SQL KODU ]------------------------------------------
Asagidaki kodlari phpmyadminden sorgulatin.

Kod:
INSERT INTO phpbb_config( config_name, config_value ) VALUES ( 'postimg_width', '800' );
INSERT INTO phpbb_config( config_name, config_value ) VALUES ( 'postimg_height', '600' );


-----[ AÇ ]------------------------------------------


Kod:
includes/bbcode.php


-----[ BUL ]------------------------------------------


Kod:
$bbcode_tpl = null;


-----[ SONRASINA EKLE ]------------------------------------------

Kod:
// mod img size add
function makeimgsize ( $width, $height )
{
    global $board_config;
    
    $size = '';
    
    // check for smallness
    if ( $width < $board_config['postimg_width'] && $height < $board_config['postimg_height'] )
    {
        return 'SMALL';
    }
    elseif ( $width > $height )
    {
        if ( $board_config['postimg_width'] < $width )
        {
            $size = 'width="' . $board_config['postimg_width'] . '"';
        }
    }else
    {
        if ( $board_config['postimg_height'] < $height )
        {
            $size = 'height="' . $board_config['postimg_height'] . '"';
        }
    }
    
    return $size;
}

function image_parse ( $post, $uid )
{
    global $board_config, $lang, $bbcode_tpl;

    preg_match_all( "/\[img(.*?):$uid\](.*?)\[\/img:$uid\]/i", $post, $matches);
    foreach ( $matches[0] as $i => $img )
    {
        $stuff = $matches[1][$i];
        $stuff = explode( ':', $stuff );
        if ( count( $stuff ) != 4 )
        { // old image or something
            $post = preg_replace( "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i", $bbcode_tpl['img'], $post );
        }
        switch($stuff[0])
        {
            case '=right':
                $align = $lang['RIGHT'];
                break;
            case '=center':
                $align = 'center';
                break;
            case '=left':
                default:
                $align = $lang['LEFT'];
            break;
        }
        $width = $stuff[1];
        $height = $stuff[2];
        $size = makeimgsize( $width, $height );
        
        if ( $size != 'SMALL' )
        {
            $replace = $bbcode_tpl['thmbimg'];
            $seek = array( '{IMAGE}', '{WIDTH}', '{HEIGHT}', '{SIZE}', '{NOTICE}', '{ALIGN}' );
            $with = ( !empty( $size ) ) ? array( $matches[2][$i] , $width, $height, $size, $lang['postimg_clickme'], $align ) : array( $matches[2][$i] , $width, $height, $size, '', $align );
            $replace = str_replace( $seek, $with, $replace );
        }
        else
        {
            $replace = str_replace( '\1', $matches[2][$i], $bbcode_tpl['img'] );
        }
        $post = str_replace( $img, $replace, $post );
    }
        
    return $post;
}
// mod img size end


-----[ BUL ]------------------------------------------

Kod:
    // [img]image_url_here[/img] code..
    // This one gets first-passed..
    $patterns[] = "#\[img:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#i";


-----[ ÖNCESINE EKLE ]------------------------------------------

Kod:
    // mod img size replace with call to image parsing function
    $text = image_parse ( $text, $uid );



-----[ BUL ]------------------------------------------


Kod:
$text = preg_replace("#\[img\]


-----[ ÖNCESINE EKLE ]------------------------------------------

Kod:
    // mod max img size changed the first pass thingo
    preg_match_all( "#\[(img.*?)\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", $text, $matches );
    // now we go through these matches and do what's needed
    foreach ( $matches[0] as $i => $m )
    {
        // easier use
        $tag = $matches[1][$i];
        $url1 = $matches[2][$i];
        $url2 = $matches[4][$i];
        
        // if we already tagged this one then we leave it be ;)
        preg_match( '#img.*?:(\d+):(\d+)#i', $tag, $match );
        if ( empty( $match ) )
        {
            // get the size so we can store it
            if ( !$size = @getimagesize( $url1 . $url2 ) )
            { // image will not get resized
                $width = '';
                $height = '';
            }
            else
            {
                $width = $size[0];
                $height = $size[1];
            }
        }
        else
        { // we already have the size
            $width = $match[1];
            $height = $match[2];
        }
        $tag = explode( ':', $tag ); // remove any possible left over : stuff
        $tag = $tag[0];
        // lastly we replace it within the text
        $text = str_replace( $m, '[' . $tag . ':' . $width . ':' . $height . ':' . $uid . ']' . $url1 . $url2 . '[/img:' . $uid . ']', $text );
    }


-----[ SATIRIN IÇERISINDE BUL ]------------------------------------------

Kod:
    $text


-----[ SATIRIN IÇERISINDE ÖNCESINE EKLE ]------------------------------------------


Kod:
//


-----[ SONRASINA EKLE ]------------------------------------------


Kod:
    // end mod img size changes


-----[ AÇ ]------------------------------------------


Kod:
admin/admin_board.php


-----[ BUL ]------------------------------------------

Kod:
$namechange_no = ( !$new['allow_namechange'] ) ? "checked=\"checked\"" : "";


-----[ SONRASINA EKLE ]------------------------------------------

Kod:
// mod img size add
$postimg_width = $new['postimg_width'];
$postimg_height = $new['postimg_height'];
// mod img size end


-----[ BUL ]------------------------------------------


Kod:
"L_RESET" => $lang['Reset'],


-----[ SONRASINA EKLE ]------------------------------------------
Kod:
// mod img size add
"L_POSTIMG_SIZE" => $lang['postimg_size'],
"POSTIMG_WIDTH" => $postimg_width,
"POSTIMG_HEIGHT" => $postimg_height,
// mod img size end


-----[ AÇ ]------------------------------------------


Kod:
templates/senin_tema/bbcode.tpl


-----[ BUL ]------------------------------------------


Kod:
<!-- END email -->


-----[ SONRASINA EKLE ]------------------------------------------
Kod:
<!-- BEGIN thmbimg -->
<div align="{ALIGN}">
<table border="0">
  <tr>
   <td><img src="{IMAGE}" align="center" border="0" {SIZE}  onclick="window.open( '{IMAGE}', 'imgpop',  'width={WIDTH},height={HEIGHT},status=no,toolbar=no,menubar=no' );return false" /></td>
  </tr>
  <tr>
   <td align="center" class="gensmall"><i>{NOTICE}</i></td>
  </tr>
</table>
</div>
<!-- END thmbimg -->


-----[ AÇ ]------------------------------------------


Kod:
templates/senin_tema/admin/board_config_body.tpl


-----[ BUL ]------------------------------------------

Kod:
    <tr>
        <td class="row1">{L_ENABLE_PRUNE}</td>
        <td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
    </tr>


-----[ SONRASINA EKLE ]------------------------------------------

Kod:
    <tr>
        <td class="row1">{L_POSTIMG_SIZE}</td>
        <td class="row2"><input type="text" size="5" maxlength="5" name="postimg_width" value="{POSTIMG_WIDTH}" /> X <input type="text" size="5" maxlength="5" name="postimg_height" value="{POSTIMG_HEIGHT}" /></td>
    </tr>


-----[ AÇ ]------------------------------------------


Kod:
language/lang_turkish/lang_main.php


-----[ BUL ]------------------------------------------
Kod:
//
// That's all Folks!
// -------------------------------------------------

?>


-----[ ÖNCESINE EKLE ]------------------------------------------
Kod:
// mod img size add
$lang['postimg_clickme'] = 'Resmi büyütmek için üzerine tıklayın.';


-----[ AÇ ]------------------------------------------

Kod:
language/lang_turkish/lang_admin.php


-----[ BUL ]------------------------------------------
Kod:
//
// That's all Folks!
// -------------------------------------------------

?>


-----[ ÖNCESINE EKLE ]------------------------------------------
Kod:
// mod img size add
$lang['postimg_size'] = 'Mesajlardaki resimlerin maksimum boyutu';


-----[ TüM DOSYALARI KAPAT/KAYDET ]------------------------------------------

SoN
Ara
Cevapla


Hızlı Menü:


Şu anda bu konuyu okuyanlar: 1 Ziyaretçi


10tl.net Destek Forumu -

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping