We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1416
    • 75 Posts
    Can’t figure this out... huh

    I’m using mg_backend with MaxiGallery 0.52 and 0.9.6.3.
    I have 19 identical sites, whereof 18 is subdomains to 1 of them.

    I made one site and duplicated it, files and database
    Then I changed some prefix values for the tables, uploaded all files, imported the sql-file and voilá, it works for all the subdomains.

    The only thing that doesn’t work in the my base-domain (or whatever it’s called) is mg_backend.
    What happens is that when I try to access the Tab for Edit Gallery, all I see is the preview window and it displays the root of the site, eg www.dummyroot.not

    I have tried the process of duplication 3 times now, same result. (The 18 sudomains works flawlessly to duplicate)
    I even tried deleting everything that had anything to do with ManagerManager and it’s widgets and started all over with a fresh install with MM first, then mg_backend. No luck.

    Then I got annoyed and deleted everything, installed a clean 0.9.6.3, installed MG 0.52, installed MM 0.3.2.1 and then installed mg_backend.
    Ofcourse it didn’t work. Not on this domain. It DOES work on EVERY other site I have tried.

    I went back, deleted a subdomain, redid the whole duplication-process, and voilá, ofcourse it works too...

    This is starting to become the center of my Universe.

    Anyone has any ideas? (And yes, I am somewhat crazy. It usually works for me, but not this time)

    __________________________________________________________________________________________
    A still mind is still a mind...
    Awareness - Trip or Trap ?!?
      • 10957
      • 32 Posts
      Hello !
      Did anyone solve the sorting problem ? (sorting is not working when including maxigallery in the manager)
      Which js files should we include to get the sorting to work ?
        • 10957
        • 32 Posts
        I finally solved the sorting feature problem. You just have to add this at the top of your custom template galleryoutertpl :

        <html>
        <head>
        	<script type="text/javascript" src="/assets/snippets/maxigallery/js/draggableReorder.js"></script>
        	<script type="text/javascript" src="/assets/snippets/maxigallery/js/mooSortables.js"></script>
        </head>
        <body>
        


        and the sorting works.

        Also : a problem can appear with tinymce due to the iframe resizing code of mg_backend_manager (tinymce iframe height is set to 0 and the editor appear all greyed). To solve it I just comment the corresponding code in mg_backend_manager.php (line 15) :
        $output = "//  -------------- mg_backend_manager widget include ------------- \n";
        
        /*$output .= <<<HTML
        	var iFrames = document.getElementsByTagName('iframe');
        	function iResize()
        	{
        		iFrames[0].style.height = iFrames[0].contentWindow.document.body.scrollHeight + 'px';
        	}
        	$('iframe').load(function()
        	{
        		setTimeout(iResize, 0);
        	}
        	);
        HTML;*/
        
        mm_createTab($title, 'mgmanager', '', '', 'If the tab is empty, please, click here to <a onclick="saveRefreshPreview();" href="#"> Save and Refresh</a><iframe id="mgmanager" src="'.$modx->config['site_url'].'index.php?id='.$docid.'&mmgal_id='.$_GET['id'].'" height="500" width="100%" scrolling="yes" frameborder="0"></iframe>');
        
          • 7455
          • 2,204 Posts
          Nice work thaks for the fixes gl_sub

          I have a nother problem

          when creating a new document the photo tab is there but a gallery that you see is the last gallery created not the one for that document
          because the document is new it has no id so no gallery could be made. but whebn you see the gallery that is filled then you could get confused and delete the images by that deleting the gallery of another page.

          would be better if the tab would not apear at all on creating a new document or that it needs to be saved first and then return to tha tab.

          try it and you will understand

          Dimmy
            follow me on twitter: @dimmy01
            • 7455
            • 2,204 Posts
            ok I made a fix for the above problem

            replace the code of the widget for this code
            <?php
            
            //---------------------------------------------------------------------------------
            // mm_widget_mg_backend_manager 
            //--------------------------------------------------------------------------------- 
            
            function mm_widget_mg_backend_manager($docid='', $title = '', $roles='', $templates='') {
            	
            	global $modx, $id, $content, $manager_theme;
            	$e = &$modx->Event;
            	
            	echo $iid;
            	if (useThisRule($roles, $templates)){
            		
            		$title = empty($title) ? "Edit gallery" : $title;
            
            	if($id != 0){
                   mm_createTab($title, 'mgmanager', '', '', '<iframe id="mgmanager" src="'.$modx->config['site_url'].'/?id='.$docid.'&mmgal_id='.$id.'" height="500" width="100%" scrolling="yes" frameborder="0"></iframe>');
            	}
            	else
            	{
                   mm_createTab($title, 'mgmanager', '', '', 'To use this Tab you need to save and re-open this document');}	
            	}
            	$e->output($output . "\n");
            }
            
            ?>
            


            this wil disable the maxigallery page when its a new document and will display another text instead, telling to save the document first.
              follow me on twitter: @dimmy01
              • 19002
              • 32 Posts
              Hey,

              sweet plugin. I know next to nothing about php (but I’m not afraid to dig through code), anyways I can’t really figure out what I should be writing to force the plugin to only show in a "blank" template.

              can anyone send me an example? Like I said, not very strong in the php.

              thanks.

              C
                • 7455
                • 2,204 Posts
                Quote from: mediassassin at Apr 24, 2009, 09:42 AM

                Hey,

                sweet plugin. I know next to nothing about php (but I’m not afraid to dig through code), anyways I can’t really figure out what I should be writing to force the plugin to only show in a "blank" template.

                can anyone send me an example? Like I said, not very strong in the php.

                thanks.

                C

                blank has id 0 you could try that but javascript stuff wants to load into head but blank does not have a head or body section
                  follow me on twitter: @dimmy01
                  • 19002
                  • 32 Posts
                  blank has id 0 you could try that but javascript stuff wants to load into head but blank does not have a head or body section

                  I used the initial tutorial at the beginning of the thread (which says to use (blank) as the template), whenever I try to create a new template (with a higher integer than 0) I lose the tab altogether.
                  I just don’t want to confuse my clients by having a gallery tab on every document they are editing.
                    • 19002
                    • 32 Posts
                    Got it sorted, I was defining ’$template’ wrong:

                    what I had:

                    function mm_widget_mg_backend_manager($docid='', $title = 'Upload pictures to gallery', $roles='1,2', $templates='!8,!3,!4,!5,!6,!7') {


                    and what I should have had:

                    function mm_widget_mg_backend_manager($docid='', $title = 'Upload pictures to gallery', $roles='1,2', $templates='0,!8,!3,!4,!5,!6,!7') {


                    I was telling the system what templates NOT to use but wasn’t telling it what it SHOULD use instead.

                    well thats solves 6 hrs of headaches.
                      • 13137
                      • 204 Posts
                      I have a few sites that use a "index.htm" instead of the ModX "index.php" as the site start.

                      I have found that if I try to use the gallery backend on these sites, it doesnt work, because it is trying to load the site index instead of the ModX index.

                      Is there a way that I can change this?

                      Solved:

                      in mg_backend_manager.php, changed:
                      <iframe id="mgmanager" src="'.$modx->config['site_url'].

                      to
                      <iframe id="mgmanager" src="'.$modx->config['<iframe id="mgmanager" src="'.'http://mydomain.com/index.php'.'].