loveless
Forum Replies Created
-
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.
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)
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”):
- I added a shortcode line:
add_shortcode( 'single', array(&$this, 'show_singlepic' ) );
after all of the other add_shortcode lines. - In the
convert_shortcode
function I added$content = str_replace( "[singlepic", "[single", $content);
directly after$ngg_options = nggGallery::get_option('ngg_options');
- 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?
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:
- I added a shortcode line:
add_shortcode( 'test', array(&$this, 'show_singlepic' ) );
- I then duplicated the entire if structure in
function convert_shortcode
that does the regex replacement stuff. - Edited one of my posts, and changed the shortcode tag from “single_pic” to “test”
- everything is working.
Input?
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.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.
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!
Forum: Fixing WordPress
In reply to: Get content before and after <!– more –> tag seperately?After searching around on the net and finding nothing, I opted to make my own solution.
https://www.wallofscribbles.com/2008/10/02/getting-more-with-the-more-tag/
Basically I made a couple functions that I put into my functions.php file. I use it on my site and it seems to work in pretty much every instance.
Hope this helps!
- I added a shortcode line: