Hart
Forum Replies Created
-
Forum: Plugins
In reply to: [Google Doc Embedder] Trouble viewing PDFI realized there was an update to the plugin (version 2.5.15, posted yesterday on 11/11/14). After the update, the PDFs are correctly appearing on the page.
Not sure about the other users here, but the update solved my issue with my particular setup.
Thanks.
Forum: Plugins
In reply to: [Google Doc Embedder] Trouble viewing PDFI’m also receiving this error.
Any support would be appreciated. Thanks.
Forum: Reviews
In reply to: [Smallerik File Browser] An excellent plug-in, one problem though.Wooohoo, new version! ??
Thanks Enrico, I’ll take down the Github now that it is no longer needed.
Whoops, I can’t edit my post anymore so I’ll write a followup. I found that “$slide[‘url’]” is the correct way to get at the slide link, so I used that in place of “$slide[‘src’]”! Here’s the final code:
add_filter('metaslider_flex_slider_anchor_attributes', 'link_slide_ref_and_a_ref', 10, 3); function link_slide_ref_and_a_ref($anchor_attributes, $slide, $slider_id) { if ($slide['url'] == 'insert/some/link/here') { $anchor_attributes['rel'] = 'wp-video-lightbox'; $anchor_attributes['href'] = 'insert/some/link/here'; } return $anchor_attributes; }
Thanks again! ??
Whoa, thank you so much for the code!!
I tried it out but all of the slides ended up with the same url ?? I tweaked a bit and settled on this:
add_filter('metaslider_flex_slider_anchor_attributes', 'link_slide_ref_and_a_ref', 10, 3); function link_slide_ref_and_a_ref($anchor_attributes, $slide, $slider_id) { if ($slide['src'] == 'some/link/to/slide/image.png') { $anchor_attributes['rel'] = 'wp-video-lightbox'; $anchor_attributes['href'] = 'insert/some/link/here'; } return $anchor_attributes; }
Only slight differences are:
- Changed “=” to “==” in if statement. I think this was why all the slides were being set to the same URL.
- Moved “return $anchor_attributes;” outside of the if statement. Otherwise, the slides other than the one specified in the if statement will have no href.
- Changed “$slide[‘href’]” to “$slide[‘src’]”. For some reason, the href attribute for $slide wasn’t being picked up so nothing was being changed.
-
Seriously, I can’t thank you enough! This solution works much more elegantly and simply than the one I had! ??
Forum: Reviews
In reply to: [Smallerik File Browser] An excellent plug-in, one problem though.Hi Christian!
I took the files that we have been using from our servers and posted them on GitHub (never used GitHub before, but thought this would be a good time to give it a shot). There’s a “Download ZIP” button on the right column.
https://github.com/hartguy/Smallerik-Fix-for-PHP-5.4
Hopefully this helps! ??
Hi,
I thought I’d share some information relevant to this topic with the hope that it would help someone out. I am using the wp-video-lightbox plugin with metaslider (flexslider).
Everything discussed so far has been to add the rel attribute to all slides. I needed only a specific slide to contain the rel attribute. To remedy this, I added the following to functions.php:
Add rel attribute to the slide that has a particular image
add_filter ('metaslider_image_slide_attributes', 'metaslider_lightbox', 10, 3); function metaslider_lightbox($slide, $slider_id, $settings) { if ($slide['src'] == "link/to/slide/image.png") { $slide['rel'] = "wp-video-lightbox"; } return $slide; }
Copy the rel attribute from slide image to slide anchor
add_filter('metaslider_flex_slider_anchor_attributes', 'link_slide_ref_and_a_ref', 10, 3); function link_slide_ref_and_a_ref($anchor_attributes, $slide, $slider_id) { $anchor_attributes['rel'] = $slide['rel']; return $anchor_attributes; }
Structure-wise, in Flexslider (and possibly the others), the slide image is nested under the slide link/anchor. As shown, I selected the slide image with the correct image url and added the rel attribute. Of course, this doesn’t do anything with the wp-lightbox-plugin, because the plugin requires the link/anchor to have this attribute for the lightbox effect to work. Therefore, in the second code block, I copied the rel attribute from the slide to the anchor.
I’m not too familiar with PHP so if there is a better way, feel free to share here. Thanks!
Forum: Reviews
In reply to: [Smallerik File Browser] An excellent plug-in, one problem though.Hi Jim!
I know you posted this quite a while back, but I just recently had the server upgrade to a newer version of PHP and I received the same issues.
Just like you, I saw this post where Josh made a few recommendations for a solution that involved some PHP. Now, I’m no PHP expert, but I did my best to follow his instructions and it seems like things are working now. I thought I’d pass along the knowledge with the hope that it would help someone else.
Here’s what I did:
- Backup wpfib.php, options.php, and /includes/options.php
- Open wpfib.php with an editing tool (like Notepad++)
- Search for an instance of “&$”
- If it is included in a function call, delete the “&” from there, find the function declaration, and place the “&” in the declaration.
- Repeat. Then open options.php and /includes/options.php and do the same.
For instance, in wpfib.php, you’ll see
wpfib_init_options(&$atts)
in line 144 andfunction wpfib_init_options($atts){
in line 225. The first calls the function, the second defines what the function does. This is because the second one has the word “function” immediately before it. So, you simply delete that “&” from the first and place it in the second. The result iswpfib_init_options($atts)
andfunction wpfib_init_options(&$atts){
.So really, all you’re doing is moving the “&”. Pretty easy right?
Now, there were functions where there were several attributes and different combinations of ampersands. For instance, I saw
if (!wpfib_get_current_location(&$curdir_relpath, $repo_abspath, &$error_text))
in line 193. So I remembered that only the first and third attributes had the ampersand and went to the function call in line 829function wpfib_get_current_location($curdir_relpath, $repo_abspath, $error_text)
and changed the ampersands. So the result was that line 193 becameif (!wpfib_get_current_location($curdir_relpath, $repo_abspath, $error_text))
and line 829 becamefunction wpfib_get_current_location(&$curdir_relpath, $repo_abspath, &$error_text)
I wasn’t sure of your coding ability so I tried to be as detailed as possible. All credit goes to Josh for his initial post that helped me solve this issue on my site. Hopefully this makes sense and will help you update your Smallerik plugin to be compatible with newer versions of PHP! ??