We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20644
    • 37 Posts
    Hi everyone! I’m very busy... :’(
    and sorry for my english. I’m Japanese speaker..みなさんよろしく!
    >vega2000
    your G2 path is right?
    G2 path need full absolute path. If you use webhosting, cause to this maybe....

    >Xsss4hell

    As I know it is the by far slowest and most ressource wasting gallery out there.
    Even high-end server are getting into troubles if you have massive site visits.
    Certainly slow when I use G2. G2 have many function , so peformance is slow maybe.

    >kumazatheef
    >ronaldlokers
    thanks for develop! grin

    >FueledMedia
    your g2 administrator is "admin"?
    If it is "admin", can you try import and export with checked overwrite box?
      • 20644
      • 37 Posts
      >FueledMedia

      Sorry, I modified g2cms.admin.
      Please download it.
      it solve this problem.

        • 21341
        • 26 Posts
        I posted already in another thread, but that problem is solved, i used the false form to define the parameters.

        And thank you for your last post, the modified g2cms.admin.class.inc.php works fine for me, the connection seems to be working, but i get layout problems when entering Gallery Admin in MODx.
        The SMF-Bridge has not this layout problems, is it a problem that effects running?
          • 32942
          • 141 Posts
          thx muramoto
            • 20644
            • 37 Posts
            Hi Newton
            You posted in 1.1.1 support forum, wasn’t it?
            &g2uri="/mg2";
            I think it is...
            &g2uri="/mg2/";
              • 25483
              • 741 Posts
              I’ve redone my modification of the ImageBlock!

              It will use the standard thumbnailsize if you don’t set $maxSize.

              <?php
              /**
               *	ImageBlock
               *	Gallery2 Image Block for MODx
               *	
               *	Shows randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem.
               *
               *	Depend on the gallery module
               *	Version: 1.1
               *  
               *  You have to call it uncached : [!ImageBlock!] 
               *  or for example , add option [!ImageBlock? &pageid=`5`&blocks=`recentImage`&show=`title|date|views`!]
               *  default parameter is set to $pageid="-1" , $blocks="randomImage",$show="title|date"
               *  pageid is default set to "-1". it means link to gallery2 directly. 
               * 
               *  Parameter (for the getImageBlock line 42): 
               *  'blocks': List composed with the following items : randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem ; Separate items with pipes (|) (except specificItem); default value is randomImage
               *  'show':	List composed with the following items : title, date, views, owner, heading, fullSize ; Separate items with pipes (|) ; the value can be : none (in this case you'll just have the image showing)
               * 'itemId': Limit the selection to a specific item ;
               * 'maxSize': Max siez of the image (by default it shows thumbnails)
              **/
              
              # build mod path
              $modpath = $modx->config["base_path"].($mpth ? $mpth:"assets/modules/gallery/");
              # include main class
              include_once $modpath."g2cms.base.class.inc.php";
              $gb = new G2CMS_Base();
              require_once($gb->g2Path.'embed.php'); 
              
              //Parameter
              
              //Gallery2 Embeded page id  ( snipet)
              $pageid = isset($pageid)? $pageid : '-1';  // if you want to link to gallery2 directly , must be set "-1".
              //blocks
              $blocks = isset($blocks)? $blocks : 'recentImage';
              //show
              $show = isset($show)? $show : 'title|date';
              //itemId
              $itemId = isset($itemId)? $itemId : null;
              
              
              
              if ( $pageid ==  "-1"){
                 $uri=$gb->g2Uri;   // link to gallery2 directly
              }
              else{
                 $uri=$modx->makeUrl($pageid); // link to embeded page
              }
              
              $ret = GalleryEmbed::init(array(
              	   'embedUri' => $uri,
                         'g2Uri' => $gb->g2Uri,
                         'fullInit' => true,
              ));
              
              if ($ret) { 
              	 echo $ret->getAsHtml();
              } 
              if ($blocks == "specificItem" && isset($maxSize)){
                 list ($ret, $bodyHtml, $headHtml) = GalleryEmbed::getImageBlock(array('blocks' => "$blocks", 'show' => "$show",'itemId' => "$itemId", 'maxSize' => "$maxSize"));
              }
              elseif ($blocks == "specificItem"){
                 list ($ret, $bodyHtml, $headHtml) = GalleryEmbed::getImageBlock(array('blocks' => "$blocks", 'show' => "$show",'itemId' => "$itemId"));
              }
              elseif (isset($maxSize)) {
                 list ($ret, $bodyHtml, $headHtml) = GalleryEmbed::getImageBlock(array('blocks' => "$blocks", 'show' => "$show", 'maxSize' => "$maxSize"));
              }
              else {
                list ($ret, $bodyHtml, $headHtml) = GalleryEmbed::getImageBlock(array('blocks' => "$blocks", 'show' => "$show"));
              }
              
              if ($ret) { 
              	 echo $ret->getAsHtml();
              } 
              list($title, $css, $javascript) = GalleryEmbed::parseHead($headHtml); 
              
              foreach($css as $c) $modx->regClientCSS($c);
              foreach($javascript as $j) $modx->regClientStartupScript($j);
              $ret = GalleryEmbed::done();
              if ($ret) { 
              	 echo $ret->getAsHtml();
              } 
              $bodyHtml=str_replace('<a href',$header.'<a target="_parent" href',$bodyHtml);
              /* Shows the image block. */
              print $bodyHtml;
              ?>
              


              Can you replace your code with above when you post a new update of the script?
                with regards,

                Ronald Lokers
                'Front-end developer' @ h2o Media

                • 21341
                • 26 Posts
                Hi Muramoto,
                i posted in Gallerly 2 Integration: http://modxcms.com/forums/index.php/topic,13139.0.html
                and i changed the settings, i tought it was the relative path, but it wasnt - now it works.

                But i have another problem:
                i created an album, its called over itemID=17 and i set up a modx site with the imageblock syntax:
                [!ImageBlock? &pageid=`17`&blocks=`recentImage`&show=`title|date|views`!]

                and got this
                Parse error: parse error, unexpected ’?’ in /xxxxxx/manager/includes/document.parser.class.inc.php(748) : eval()’d code on line 1

                And where do i find instructions on how to use the integration in order to create a full integrated album in modx?
                  • 32942
                  • 141 Posts
                  I know a host who doesn’t allow G2 due to performance problems with G2.
                  Do you know which file is causing the problems, so I can find the ressourcekiller, and maybe code an alternative or remove it? huh
                    • 20644
                    • 37 Posts
                    Hi Newton

                    i created an album, its called over itemID=17 and i set up a modx site with the imageblock syntax:
                    Code:

                    [!ImageBlock? &pageid=`17`&blocks=`recentImage`&show=`title|date|views`!]

                    and got this
                    Quote
                    Parse error: parse error, unexpected ’?’ in /xxxxxx/manager/includes/document.parser.class.inc.php(748) : eval()’d code on line 1

                    And where do i find instructions on how to use the integration in order to create a full integrated album in modx?
                    Currently documents is not enough yet. I want to make it, but my english is bad.... :’(
                    If you want full integrated all albums in modx , you have to call Gallery Snipet .

                    [!Gallery!]


                    The ImageBlock’s &pageid is the page Gallery Snipet is called.
                    If &pageid is specified, ImageBlock’s links jump to Gallery Snipet’s page.
                    If you want to call specific item on ImageBlock, you have to set "&itemId".

                    > ronaldlokers
                    Hi ronaldlokers!
                    Wao! Thanks!
                    I’ll post it next update.


                    >Xsss4hell
                    I don’t know well how codes are used in G2..
                    Umm .... but I think maybe the thumbnail function consume a lot of memory...

                    I found in G2 forum..about performance
                    Massive performance problems with Gallery 2.2
                    http://gallery.menalto.com/node/63164
                    Any suggestions for performance tweaks?
                    http://gallery.menalto.com/node/61770
                      • 21341
                      • 26 Posts
                      Thank you!

                      The ImageBlock dont works for me, and after testing the code above i got messages like this:
                      Error (ERROR_CONFIGURATION_REQUIRED)
                      * in modules/core/classes/GalleryEmbed.class at line 827 (gallerycoreapi::error)
                      [...]

                      The Gallery Snippet works, but only the whole gallery, not specific albums, what i want. I tried with itemId, g2itemId, g2_itemId etc., but non of them worked.

                      It seems to be simple, but i cant find the solution on how to show specific albums from G2 in modx.
                      Btw i use modx 0.9.5 and G 2.2.1

                      EDIT:
                      I am tired of trying the right syntax or to get ImageBlock to work, i link with the url now. And it works perfect: one site has the [[Gallery]] and then i add the id of the album to the url and thats it.

                      Now i have a question about this method: g2 works within modx, the module does its work. Thats the reason my method works without short URL/modRewrite.
                      Is that module method a feature of g2 or could it be to improve the SMF bridge like this? I want a forum that doesnt kill my layout while surfing through.