• Using wordpress 2.7 and 1.0.1 of nextgen.

    I had been using the single pic code in the excerpts to display images and now they have stopped working! please i need a quick fix for this or someway to roll back to the old version!!!!

    the singlepic code still works on single post pages just not in the excerpts ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • Please contact the Plugin author directly for help with this issue. They may have or be working on a fix and update and your input could help them resolve the issue. Thank you.

    Thread Starter chrisbkiwi

    (@chrisbkiwi)

    This seems to be the method that he wants us to contact him by…

    Alex some help here please!!

    it’s must be an easy fix but I don’t know how!

    everything else is fine but singlepic no longer works in excerpts!

    I said the same thing here. It seems since the upgrade the singlepic tag has just … stopped functioning. I don’t have it working anywhere!

    That’s strange, I used at my blog as well old and new shortcodes. Can you disable any other plugin for a test

    I could disable most of them, but I cannot disable all of them without my site becoming broken.

    What seems to be weird is that prior to the update, it worked fine… .even in 2.7. It’s when I upgraded to the 1.0.1 version of NextGen that things broke.

    Fixed it here by editing the shortcodes.php file under Nextgen-Gallery\lib.

    Change the ‘convert the old shortcode’ section near the top of the file to show the three lines below instead of just the the_content filter:

    // convert the old shortcode
    add_filter(‘the_excerpt’, ‘do_shortcode’, 11);
    add_filter(‘the_content’, array(&$this, ‘convert_shortcode’));
    add_filter(‘the_excerpt’, array(&$this, ‘convert_shortcode’));

    sadly, that hasn’t fixed my version. I am going to play around with that though, since you’ve pointed it out to me.

    edit: Things to note: Slideshows still work, as to Galleries. It’s only the singlepic tag that is dying on me at the moment.

    edit (again): Alright I’ve started tracking it down, and it seems to be failing in the shortcodes.php file: `$search = “@\[singlepic=(\d+)(|,\d+|,)(|,\d+|,)(|,watermark|,web20|,)(|,right|,center|,left|,)\]@i”;
    if (preg_match_all($search, $content, $matches, PREG_SET_ORDER))` is returning false, so it never jumps into the if statement, and so there’s no render. Sadly I’m really REALLY bad with regex.

    Alright, further investigation shows me that function show_singlepic isn’t being called at all. I don’t think the regex has anything to do with it now that I look at it more.

    As to why it’s not calling the shortcode, I have no idea.

    EDIT:

    I have it working, but I have no idea what the difference is.

    Steps:

    1. I added a shortcode line: add_shortcode( 'test', array(&$this, 'show_singlepic' ) );
    2. I then duplicated the entire if structure in function convert_shortcode that does the regex replacement stuff.
    3. Edited one of my posts, and changed the shortcode tag from “single_pic” to “test”
    4. everything is working.

    Input?

    Alright, I know I’ve pretty much spammed this thread to hell with my research, but what I’ve figured out is that for some reason the shortcode “singlepic” isn’t being recognized.

    I’ve made a work-around for now, but a proper solution would be great.

    Workaround (all changes occur within “nextgen-gallery/lib/shortcodes.php”):

    1. I added a shortcode line: add_shortcode( 'single', array(&$this, 'show_singlepic' ) ); after all of the other add_shortcode lines.
    2. In the convert_shortcode function I added $content = str_replace( "[singlepic", "[single", $content); directly after $ngg_options = nggGallery::get_option('ngg_options');
    3. I then changed the if structure for “[singlepic” to “[single”. This includes the $search and $replace variable declarations. In all three instances “[singlepic” was replaced with “[single”

    The good thing about this is that since it’s part of the re-write, the posts can still be written with the “proper” tags, and they are rewritten on the fly. When a fix for this comes out, the solution will be removed gracefully.

    Anyone have an understanding as to why this would happen in the first place though?

    @ghoyle
    Are you using the_excerpt to show a gallery ?

    @loveless
    I used the regex since a very long time, I’m not sure why your old shortcodes are not recognized… need to have a look for that in detail

    I have not tested any of the other shortcodes, so I don’t know if it’s just that one or not. All I managed to figure out was that “singlepic” for whatever reason, wasn’t working.

    As for the regex thing, you’re right. After further investigation I realized I was looking at the wrong thing (hence my finding the shortcode issue)

    Alex,

    No, I just have an image at the beginning of the content that I like to be shown at the beginning of the excerpt as well.

    Gallery and slideshow are kept at the bottom of each post (if applicable) so never make it in to the first 50 words of the content.

    Did this ever get resolved?

    None of my old shortcodes have been updated one one of my blogs (worked fine on another).

    Tried the fixes suggested here, but no joy.

    At the moment I’m painstakingly updating the 300 or so shortcodes on my site by hand, so if anyone got to the bottom of this, it’d be great to hear about it!

    I haven’t seen a resolution, but my make-shift fix seemed to work for me. It allows me to use the “correct” shortcodes, but the code changes it so they work until this is resolved.

    The idea was that when it was fixed, I could update my plugin and my code would be removed, but the site would work as it should.

    First of all, simply amazing plugin!!! I’m new to WordPress but this thing is so wonderful I just love it. Only problem is that I’m having the same problem these gents here were talking about 9 months ago. I’m using manual excerpts and the single image I want to showcase in the excerpt isn’t working. It simply outputs the command I put in for the image: [singlepic id=46 w=300 h=169]

    I tried to use the code changes loveless did but those didn’t work for me for some reason. If anyone has any more suggestions for this I would be MOST grateful! I am trying to run an art site and need to be able to include images in my “recent posts” excerpts on my home page.

    Thank you in advance! I LOVE THIS CMS and the community surrounding it!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: NextGEN Gallery] singlepic tags not working on home & cat pages!’ is closed to new replies.