Просмотр поста

.
Gabriel
CyberGhostNet Group

BBCode Image With Lightbox v 1 For Johncms 7.0.0
My Mod Gabriel Gymkhana

Follow this intruction
First open your bbcode.php

Find:

public function tags($var)


add this:
$var = $this->Images($var);


and add this:
private function Images($var)
    {
        $homeurl = $this->homeUrl;
        return preg_replace_callback(
            '#\[img=([0-9]+)_([0-9]{3})\]#s',
            function ($matches) {
             $name = $matches[1] . '_' . $matches[2];
             $file = $homeurl . '/files/images/' . $name . '_preview.jpg';
            if (file_exists(ROOT_PATH . 'files/images/' . $name . '_preview.jpg')) {
                 return '<a href="' . $homeurl . '/files/images/'.$name.'.jpg" class="lightbox" title="Gymkhana"><img itemprop="image" src="'.$file.'" border="0" style="max-width:90%; height: auto;" target="_blank" alt="+"></a>';
               } else {
                 return '<b>[<span style="color:red">image removed</span>]</b>';
                  }
                 },
                $var
               );
              }


and code:
<a href="javascript:tag(\'[img=\', \']\');"><img style="border: 0;" src="' . $this->homeUrl . '/images/bb/im.gif" alt="images" title="BBCode image" /></a>


Open your head add this:
require('lightbox.php');


Download this and extract
Прикрепленные файлы: