Forum Replies Created

Viewing 15 replies - 31 through 45 (of 49 total)
  • Thread Starter Sirion89

    (@sirion89)

    Hello,

    i tried to send you a bug report but it looks like that i received no answer. Beside this im trying to dig into your code to understand what cause nextgen to fail when it comes to generate link for the imagebrowser thing.

    Actually i don’t know how our customization to the html output could interfer with the link generation, if it could be any setting please let me know which one to look at and i’ll give you a report.

    From what i can see in the code everything starts with a

    $storage->get_image_url($image, 'full', TRUE))

    and then i get kinda lost in the core due to all those magic method (__call) you used there.

    If you could give me some instruction or advanced documentation im ready to explore the code and in case i find something i’ll report so that you can fix it.

    Cheers,

    Diego

    Thread Starter Sirion89

    (@sirion89)

    Ok, in case my company will give the green light on this i’ll fork your github project and modify it.

    We can mark this as closed i guess, it wont be anytime soon ??

    Thread Starter Sirion89

    (@sirion89)

    Well i never edited directly my post views, the count of each one is just the sum of the real visit so it woudn’t be a problem at all.

    Anyways you could just let an option in the config page to choose if to use the hidden _views or the normal views, and if the _views is chosen but some ‘views’ exist in the postmeta table update them to the new choice.

    Woudn’t that be the best option?

    Thread Starter Sirion89

    (@sirion89)

    mmm…coudn’t you just release an update that execute an update query on the post_meta table searching for ‘views’ and change it to ‘_views’ ? or you have known compatibility issue with other similar plugins that use ‘views’ as custom field?

    Thread Starter Sirion89

    (@sirion89)

    @photocrati – Ofc i already have that setting, on both of the test site and production site.

    My current settings are : Album Extended -> basic gallery thumbnails -> imagebrowser

    Waiting for more instruction, if u need i could try to ask and open u an account there so that u can test directly but i would provide credential via email only.

    Cheers.

    Diego.

    Thread Starter Sirion89

    (@sirion89)

    Ok,it took my company a bit but i have now a test site, link here: Link to test site

    as you can see (a part from css style thing) now i set album to extended display,gallery to image thumb and activated the imagebrowser effect,now as you can see from the gallery page all the images link to their .jpg or whatever file which obviouslly bypass the imagebrowser setting.

    What i would like, which is working on the old version,is to have all the images open in a new page.

    Tell me what do you need for further test.

    Thread Starter Sirion89

    (@sirion89)

    The site above is our production server and i can’t use the “blank” one there or it will screw up the intended behaviour. The test i’ve made is on a test site which has the same configuration as the prod one and what I see is the grid w/o the extra html stuff but all the images link to their .jpg file which isn’t what i want.

    Could it be related to some option change between the 2 version? i don’t really know where to look.

    If i can grab some debug stuff somewhere that can help you just say, i have full access on that site.

    Thread Starter Sirion89

    (@sirion89)

    Hello,

    sorry but i was out for a week. Just tested with the original files and the behaviour is the same. Is there some particular option i should check? I tried to compare online settings with the locals one and they are the same if i didn’t miss anything.

    Thread Starter Sirion89

    (@sirion89)

    It worked before the update so i dont think the code we added is a problem at all. It looks like more about the generated link for the pic inside the gallery and none of our customization touch that, we kept your default code for that part.

    <?php for ($i=0; $i<count($images); $i++):
               $image = $images[$i];
               $thumb_size = $storage->get_image_dimensions($image, $thumbnail_size_name);
               $style = isset($image->style) ? $image->style : null;
    
               if (isset($image->hidden) && $image->hidden) {
                  $style = 'style="display: none;"';
               }
               else {
                    $style = null;
               }
    
                     $this->start_element('nextgen_gallery.image_panel', 'item', $image);
    
                    ?>
                    <div id="<?php echo_h('ngg-image-' . $i) ?>" class="ngg-gallery-thumbnail-box" <?php if ($style) echo $style; ?>>
                        <?php
    
                        $this->start_element('nextgen_gallery.image', 'item', $image);
                        ?>
                        <div class="ngg-gallery-thumbnail">
                            <a href="<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE))?>"
                               title="<?php echo esc_attr($image->alttext)?>"
                               data-src="<?php echo esc_attr($storage->get_image_url($image)); ?>"
                               data-thumbnail="<?php echo esc_attr($storage->get_image_url($image, 'thumb')); ?>"
                               data-image-id="<?php echo esc_attr($image->{$image->id_field}); ?>"
                               data-title="<?php echo esc_attr($image->alttext); ?>"
                               data-description="<?php echo esc_attr(stripslashes($image->description)); ?>"
                               <?php echo $effect_code ?>>
                                <img
                                    title="<?php echo esc_attr($image->alttext)?>"
                                    alt="<?php echo esc_attr($image->alttext)?>"
                                    src="<?php echo esc_attr($storage->get_image_url($image, $thumbnail_size_name, TRUE))?>"
                                    width="<?php echo esc_attr($thumb_size['width'])?>"
                                    height="<?php echo esc_attr($thumb_size['height'])?>"
                                    style="max-width:none;"
                                />
                            </a>
                        </div>
                        <?php
    
                        $this->end_element();
    
                        ?>
                    </div>
                    <?php
    
                    $this->end_element();
    
                    ?>
    
                <?php if ($number_of_columns > 0): ?>
                    <?php if ((($i + 1) % $number_of_columns) == 0 ): ?>
                        <br style="clear: both" />
                    <?php endif; ?>
                <?php endif; ?>
    
            <?php endfor ?>
    Sirion89

    (@sirion89)

    Hello,

    i can talk just about my personal experience,i have been strugglying with that a lot,was used to have a custom template back in 1.9 but after the 2.0 update the only praticable solution i’ve managed to find was to edit 3 file:

    • \wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\nextgen_basic_album\templates\extended.php
    • \wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\nextgen_basic_gallery\templates\thumbnails\index.php
    • \wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\nextgen_basic_imagebrowser\templates\nextgen_basic_imagebrowser.php

    Then if u set your displaying setting accordling you are going to obtain your result, sadly everytime they release an update you are forced to remake the replace again, and let me say it: its a pain. Until it wont be an easier way to do this ill just stick with this solution. That’s very sad anyways since i worked hard to integrate my custom template with all the plugins im using w/o touching their code, this is the ONLY exception

    Thread Starter Sirion89

    (@sirion89)

    Did u have time to reproduce this bug and think about a solution? are there any news about this?

    Thread Starter Sirion89

    (@sirion89)

    I think i managed to reproduce the issue (or at least part of it). The problem is all around ‘post_name’ inside db

    I’m using version 16 on production, running some tests before upgrading to 17.1.

    I’m currently using the “use existing attachment on child blog” option,that’s why i wrote it here afterall.

    My last thought is the following.
    Lets take

    • b1,b2,b3 as blog1,blog2,blog3
    • p1,p2,3 as post1,post2,post3
    • myimg[x] as the featured image im trying to broadcast
    • ‘mytitle’ as the post_title for the attachment images (this happens in our case when our online newspaper is talking about the same things,think about names such ‘police’,’fire department’ …

    Now the procedure:

    1. On b1 i create a brand new post (P1) uploading for the first time ever [myimg] as the featured image using as img title “mytitle”
    2. On b1 again i create another brand new post (P2) uploading another img which has the same file name as the above one,so [myimg] as the featured image and using again the title “mytitle”
    3. Since wordpress puts in wp_x_posts ‘post_name’ the slug of the [image filename] and since two equal ‘post_name’ can’t exist, wordpress is going to suffix _[x] to the newly created which is now going to be,for example “myimg_1”
    4. On b2 we do the same thing as step 1 always using [myimg]. On b2 that image is now going to have the post_name (slug) set to ‘myimg’.
    5. We now broadcast from b1 to b2,b3 our second post P2. The result in b2 is that we have a duplicated media image since it checks for post_name = ‘myimg_1’ which obviously doesn’t exist,too bad that ‘myimg’ exist instead and its the same image we wanted to broadcast

    Another thing to reproduce the bug is to attach an image which filename and ‘post_title’ are different. When broadcasted the row inside the db of the child post has post_title = post_name which is different to his parent image. For example if the original file name is ‘myimg03032015’ and post title is ‘myimg’ the row inside db has ‘post_title’ = ‘myimg’ and ‘post_name’ (slug) = ‘myimg03032015’. When broadcasted on child it will become ‘post_title’ = ‘post_name’ = ‘myimg’ which create a bad condition.

    Thread Starter Sirion89

    (@sirion89)

    Hello,

    after some debugging around i noticed that in \threewp-broadcast\src\traits\broadcasting.php:

    – Line 620 ~ 630

    On line 628 you are setting $o->attachment_data->post->post_parent = 0; before actually copying the attachment (which is just few lines later) and even then you are not assigning the post parent to the newley created attachment post.

    Adding something like:

    wp_update_post(array(
    							'ID'			=>	$o->attachment_id,
    							'post_parent'	=>	$bcd->new_post[ 'ID' ]
    						));

    Makes the newly created attachment post (on child blog) having a correct post_parent, dunno if its the best way to work with your plugin but at least this fix one problem.

    About the replication issue i still didn’t manage to reproduce the bug but i would suggest about adding some sort of more strict control when you are about to create a new line inside wp_x_posts.

    Another nice thing would be to avoid copying images if they already exist. Let me explain: if you have an image lets say in [upload_dir]/sites/x/2015/1 and you use it again in March then you are going to have that image replicated again inside the same blog. Ofc this is even more true across blogs.

    What do you think about this?

    Thread Starter Sirion89

    (@sirion89)

    Thank you for the fast reply,im trying to investigate using the production database and the log i got from test env.

    Atm there are a few things that gave me an hint, i tried to write you by mail,i can write it all here or wait for your reply.

    Cheers (my email address start with cavalletti@) ??

    Thread Starter Sirion89

    (@sirion89)

    Just in case some1 will ever end here in the future atm im typing this it is solved with v4

    p.s = i wont mark as solved since there’s a new question here

Viewing 15 replies - 31 through 45 (of 49 total)