Icy Phoenix

     
 


Post new topic  This topic is locked: you cannot edit posts or make replies. 
Page 1 of 2
Goto page 1, 2  Next
 
Reply with quote Download Post 
Post Need help to parse bbcode at xs 
 
I'm installing a new bbcode for my xs and i need help    
I don't know how to parse this like xs bbcode.php

OPEN

Code: [Download] [Hide] [Select]
[code linenumbers=false]templates/subSilver/bbcode.tpl[/code]


FIND

Code: [Download] [Hide] [Select]
<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->


AFTER, ADD

Code: [Download] [Hide] [Select]
<!-- BEGIN imgreflect --><img src="{URL}" class="reflect rheight33" /><!-- END imgreflect -->


OPEN

Code: [Download] [Hide] [Select]
includes/bbcode.php


FIND

Code: [Download] [Hide] [Select]
   $bbcode_tpl['img'] = str_replace('{URL}', '1', $bbcode_tpl['img']);



AFTER, ADD

Code: [Download] [Hide] [Select]
   $bbcode_tpl['imgreflect'] = str_replace('{URL}', '1', $bbcode_tpl['imgreflect']);


FIND

Code: [Download] [Hide] [Select]
   // [img]image_url_here[/img] code..
   // This one gets first-passed..
   $patterns[] = "#[img:$uid]([^?](?:[^[]+|[(?!url))*?)[/img:$uid]#i";
   $replacements[] = $bbcode_tpl['img'];



AFTER, ADD

  
Code: [Download] [Hide] [Select]
   $patterns[] = "#[imgreflect:$uid]([^?](?:[^[]+|[(?!url))*?)[/imgreflect:$uid]#i";
   $replacements[] = $bbcode_tpl['imgreflect'];  



FIND

Code: [Download] [Hide] [Select]
   // [img]image_url_here[/img] code..
   $text = preg_replace("#[img]((http|ftp|https|ftps)://)([^ ?&=#"nrt<]*?(.(jpg|jpeg|gif|png)))[/img]#sie", "'[img:$uid]1' . str_replace(' ', '%20', '3') . '[/img:$uid]'", $text);



AFTER, ADD

Code: [Download] [Hide] [Select]
   $text = preg_replace("#[imgreflect]((http|ftp|https|ftps)://)([^ ?&=#"nrt<]*?(.(jpg|jpeg|gif|png)))[/imgreflect]#sie", "'[imgreflect:$uid]1' . str_replace(' ', '%20', '3') . '[/imgreflect:$uid]'", $text);

 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Need Help To Parse Bbcode At Xs 
 
in bbcode.php

find:
// LIST

before add:
if($tag === 'imgreflect')
{
                if($this->is_sig)
                {
                    return $error;
                }
                // generate html
                    $html = '<div id="reflect rheight33"><img src="' . $content . '" width="' . $width . '" height="' . $height . '" class="reflect rheight33" /></div>';
                return array(
                    'valid' => true,
                    'html' => $html
                );
}

Use this tag when post:
Code: [Download] [Hide]
  1. [imgreflect]link img[/imgreflect]  
  2.  

 



 
LeonSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need help to parse bbcode at xs 
 
with that only change doesn't work
 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need Help To Parse Bbcode At Xs 
 
Zuker wrote: [View Post]
with that only change doesn't work


you will need additional JS upload to your root server , and in overall_header.tpl add this line:

<script type="text/javascript" src="reflection.js"></script>
 



 
LeonSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need help to parse bbcode at xs 
 
It is for vanilla bbcode  
 




____________
*VOLVO CLUB*
 
difusSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need Help To Parse Bbcode At Xs 
 
I did this and it works => check the demo link : http://www.tinhoi.exofire.net/forum/viewtopic.php?t=5


Here is my version, not sure if i did it right way but at least it works :

first upload reflection.js to forum root

open includes/bbcode.php

Code: [Download] [Hide] [Select]
find:
'img' => array(
                    'nested' => false,
                    'inurl' => true,
                    ),
after add:
'imgreflect' => array(
                    'nested' => false,
                    'inurl' => true,
                    ),

find:
// ALBUMIMG

before add:
// IMG REFLECT
                if($tag === 'imgreflect')
                {
                    if($this->is_sig)
                    {
                        return $error;
                    }
                    // main parameters
                    $params = array(
                        'src' => false,
                        'alt' => false,
                        'slide' => false,
                    );

                    // additional allowed parameters
                    $extras = $this->allow_styling ? array('width', 'height', 'border', 'style', 'class', 'title', 'align') : array('width', 'height', 'border', 'title', 'align');

                    // [img=blah]blah2[/img]
                    if(isset($item['params']['param']))
                    {
                        $params['src'] = $item['params']['param'];
                        if ( $config_mg['thumbnail_posts'] == 1 )
                        {
                            $params['src'] = "image_thumbnail.php?pic_id=" . $params['src'];
                        }
                        $params['alt'] = $content;
                        $params['slide'] = isset($item['params']['slide']) ? $item['params']['slide'] : '';
                        $slideshow = ($params['slide']) ? 'lightbox[' . $item['params']['slide'] . ']' : 'lightbox';
                    }
                    // [img src=blah alt=blah width=123][/img ]
                    elseif(isset($item['params']['src']))
                    {
                        $params['src'] = $item['params']['src'];
                        if ( $config_mg['thumbnail_posts'] == 1 )
                        {
                            $params['src'] = "image_thumbnail.php?pic_id=" . $params['src'];
                        }
                        $params['alt'] = isset($item['params']['alt']) ? $item['params']['alt'] : $content;
                        $params['slide'] = isset($item['params']['slide']) ? $item['params']['slide'] : '';
                        $slideshow = ($params['slide']) ? 'lightbox[' . $item['params']['slide'] . ']': 'lightbox';
                        for($i=0; $i<count($extras); $i++)
                        {
                            if(!empty($item['params'][$extras[$i]]))
                            {
                                if($extras[$i] === 'style')
                                {
                                    $style = $this->valid_style($item['params']['style']);
                                    if($style !== false)
                                    {
                                        $params['style'] = $style;
                                    }
                                }
                                else
                                {
                                    $params[$extras[$i]] = $item['params'][$extras[$i]];
                                }
                            }
                        }
                    }
                    // [img]blah[/img], [img width=blah]blah[/img ]
                    elseif(!empty($content))
                    {
                        $link_url = $content;
                        $params['src'] = $content;
                        // LIW - BEGIN
                        if ( ($board_config['liw_enabled'] == 1) && ($max_image_width > 0) && ($config_mg['thumbnail_posts'] == 0) )
                        {
                            if ( isset($item['params']['width']) )
                            {
                                $item['params']['width'] = ( $item['params']['width'] > $max_image_width ) ? $max_image_width : $item['params']['width'];
                            }
                            else
                            {
                                $image_size = @getimagesize($content);
                                $item['params']['width'] = ( $image_size[0] > $max_image_width ) ? $max_image_width : $image_size[0];
                            }
                        }
                        elseif ( $config_mg['thumbnail_posts'] == 1 )
                        {
                            /*
                            $image_size = @getimagesize($content);
                            if ($image_size[0] > $config_mg['thumbnail_size'])
                            {
                                $params['src'] = "image_thumbnail.php?pic_id=" . $params['src'];
                            }
                            */
                            $params['src'] = "image_thumbnail.php?pic_id=" . $params['src'];
                        }
                        // LIW - END
                        $params['alt'] = isset($item['params']['alt']) ? $item['params']['alt'] : (isset($params['title']) ? $params['title'] : 'Image');
                        $params['slide'] = isset($item['params']['slide']) ? $item['params']['slide'] : '';
                        $slideshow = ($params['slide']) ? 'lightbox[' . $item['params']['slide'] . ']': 'lightbox';
                        for($i=0; $i<count($extras); $i++)
                        {
                            if(!empty($item['params'][$extras[$i]]))
                            {
                                if($extras[$i] === 'style')
                                {
                                    $style = $this->valid_style($item['params']['style']);
                                    if($style !== false)
                                    {
                                        $params['style'] = $style;
                                    }
                                }
                                else
                                {
                                    $params[$extras[$i]] = $item['params'][$extras[$i]];
                                }
                            }
                        }
                    }

                    // generate html
                                $html = '<img';
                                foreach($params as $var => $value)
                                {
                                    $html .= ' ' . $var . '="' . $this->process_text($value) . '"';
                                }
                                if(!isset($params['title']))
                                {
                                    $html .= ' title="' . $this->process_text($params['alt']) . '"';
                                }
                    $html .= ' class="reflect rheight33" />';

                    // add url
                    if(empty($item['inurl']))
                    {
                        if ( $config_mg['thumbnail_posts'] == 1 && $config_mg['thumbnail_lightbox'] == 1 )
                        {
                            $html = '<a href="' . $link_url . '" rel="' . $slideshow . '" title="' . $params['alt'] . '">' . $html . '</a>';
                        }
                        else
                        {
                            $html = '<a href="' . $params['src'] . '" target="_blank" title="' . $lang['OpenNewWindow'] . '">' . $html . '</a>';
                        }
                    }
                    return array(
                        'valid' => true,
                        'html' => $html,
                        'allow_nested' => false,
                    );
        }



Open templates/ca_adphrodite/viewtopic_body.tpl
find:
<div class="forumline nav-div">

before add:
<script type="text/javascript" src="reflection.js"></script>

that's it

Download reflection.js here :
http://www.tinhoi.exofire.net/forum/reflection.js   <=== Right click on link and Save Target As
 



 
Edited by Zuker, Sun 07 Jan, 2007 01:51: added code tag's
LeonSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need help to parse bbcode at xs 
 
i can't make it run

take a look plz at my bbcode.php

www.superzuker.com.ar/shared/bbcode.rar
 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need Help To Parse Bbcode At Xs 
 
I looked on your bbcode file, looks like you did everything right though, make sure you add JS in viewtopic_body.tpl too

here is the post on my main forum you can look at, the above demo link is on my test forum

http://tinhthienthu.ath.cx/viewtopic.php?p=490#490

or here:
http://tinhthienthu.ath.cx/viewtopic.php?p=486#486
 



 
LeonSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need help to parse bbcode at xs 
 


it was working, but the bbcode doens't got a preview, that's because i said it didnt work
 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need Help To Parse Bbcode At Xs 
 
Zuker wrote: [View Post]


it was working, but the bbcode doens't got a preview, that's because i said it didnt work



it should work if you add this line
<script type="text/javascript" src="reflection.js"></script>

to  posting_topic_review.tpl
 



 
LeonSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need help to parse bbcode at xs 
 
adding to overall header it isn't enought?

why don't u add the efecto to the "js's" folder??
Later, you must got this
<script type="text/javascript" src="templates/ca_aphrodite/js/reflection.js"></script>
 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need Help To Parse Bbcode At Xs 
 
i dont know but when i add it to overall_header.tpl it doesnt work ...so i dont mind to add it in vewtopic_body.tpl instead

and i think if you put the effect in root folder it will respond faster
 



 
LeonSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need help to parse bbcode at xs 
 
Nice effect... can you try to attach here premodified files so I can have a look?

Thank you!
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need help to parse bbcode at xs 
 
yes mighty

i'm working on a bottom also, but i'll attach here premodified files in a moment
 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Need help to parse bbcode at xs 
 
files working for old a69

reflection.rar
Description: Based in a69_20061208_1044 files 
Download
Filename: reflection.rar
Filesize: 27.44 KB
Downloaded: 154 Time(s)

 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Post new topic  This topic is locked: you cannot edit posts or make replies.  Page 1 of 2
Goto page 1, 2  Next


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events