BBCode images with showed Lightbox

644
.
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
Прикрепленные файлы:
.
CyberGhostNet Group
If images removed
Прикрепленные файлы:
.
CyberGhostNet Group
List of images
Прикрепленные файлы:
.
CyberGhostNet Group
Sowed box
Прикрепленные файлы:
.
Very good idea!
.
CyberGhostNet Group
# TubeKinder (24.03.2017 / 13:35)
Very good idea!
Thanks
.
¯\_(ツ)_/¯
Вот что я пытался сделать но не вышло.
.
╭∩╮ (`-`) ╭∩╮
Very useful refinement.
But unfortunately could not make it work with the new version of JohnCMS 7.1.0

Try the following:

1) Visit our repository, develop branch

2) Clone repositiry, or download as ZIP

3) With Composer, install all dependencies, You get the same code that is currently installed on THIS site

4) Install the resulting distributive

5) Make sure that everything works without errors

Then you can try to introduce your code.
But note that the BBcode class has changed a lot compared to JohnCMS 7.0.0
It is not necessary to add the upload class, it is already in the system. Simply call it as here: https://github.com/john-cms/jo ... p#L44

If everything works out, send the finished code, we will test. If it is convenient and reliable, we will insert it into the distribution kit.
.
CyberGhostNet Group
# AlkatraZ (25.03.2017 / 21:16)
Very useful refinement.
But unfortunately could not make it work with the new version of JohnCMS 7.1.0

Try the following:

1) Visit our repository, [url=https://github.com/john-cms/johncms-next]
Ok I will try it .. Hemm thank you @Alkatraz
.
CyberGhostNet Group
O ya I not know class upload wass already .. Thank you i will remove my class upload
Всего: 15