hanscz
Forum Replies Created
-
That sounds sufficient for our needs. I consider this solved. Thank you.
Forum: Plugins
In reply to: [SVG Support] Manipulating SVG with JS after inlining does not workI ‘solved’ it.
At the very bottom of the inlining JS code in this plugin, I found the line:
$(document).trigger('svg.loaded', [imgID]);
If I’m not mistaken, this means, that any code that needs to run after an SVG has finished being inlined should be wrapped in an event callback, like so:
$(document).on('svg.loaded', function(event, image_id) { console.log("Finished inlining an SVG with the ID ", image_id); }
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Unlimited license renewal price?Question re-submitted at your support website. Please excuse the inconvenience, and my ignorance ??
Forum: Plugins
In reply to: [Redirection] URL and custom filter match – no regex capturedYou’re welcome ?? I’ll send you the pull request.
- This reply was modified 7 years ago by hanscz.
Forum: Plugins
In reply to: [Redirection] URL and custom filter match – no regex capturedWell, I couldn’t keep my fingers out of the Redirection plugin code.
In the class
Custom_Match
, I rewrote the functionget_target()
as follows:function get_target( $url, $matched_url, $regex ) { $target = false; $matched = apply_filters( $this->filter, false, $url ); // Check if referrer matches if ( $matched && $this->url_from !== '' ) { $target = $this->url_from; if ( $regex ) { $target = $this->get_target_regex_url( $matched_url, $this->url_from, $url ); } } elseif ( ! $matched && $this->url_notfrom !== '' ) { $target = $this->url_notfrom; if ( $regex ) { $target = $this->get_target_regex_url( $matched_url, $this->url_notfrom, $url ); } } return $target; }
I simply added the
if ( $regex ) {...}
conditionals.Based on cursory testing, it seems to work. Let me know if this is usable.
if so, I’ll see to it that you get a pull request on GitHub
Incidentally, I checked up on limits to length of class names in PHP. It seems the only limit is the amount of available memory, so nothing really to help out there.
It might be prudent to up the allowed length to, say, 255 and insert a check. If the class name is longer than the 255, maybe do an error_log()?
You’re welcome ??
Since the issue has been resolved and described without recourse to my code, I have deleted the https://github.com/HansCz/tr-project-status-updater repository.
Finally solved it!
Here’s where I went wrong:
Your custom logger class name is written to the [prefix]_simple_history table in the ‘logger’ column when you save a message.This column is defined as
varchar(30)
, so your custom logger class name can be a maximum of 30 characters long, or your log message will fail to be written to the database.I had a class name longer than that, so
$result = $wpdb->insert($db_table, $data);
(line 1144 in loggers/SimpleLogger.php)failed silently.
Maybe there is a way to check for that?
I should mention that I am using Simple History version 2.13
The page using my code example can be seen here.
please disregard This post – don’t know how it got duplicated…sorry ??
There seems to be no way to delete it.
Create a new directory in the plugin directory for featured video plus. The path to the new directory is
[featured video plus root directory]
/img
This is where you should put your play button image
Add the following css to featured_video_plus/css/frontend.css:
.fvp_overlay { position: relative;; } .fvp_overlay .fvp_play_button { position: absolute; display: block; height: 42px; width: 59px; top: -52px; left: 10px; }
Change line 95 in featured_video_plus/php/frontend.php:
from
return '<a href="#fvp_'.$post_id.'" class="fvp_overlay" onclick="return false;">'.$html.'</a><div id="fvp_'.$post_id.'" style="display: none;"></div>';
to
return '<a href="#fvp_'.$post_id.'" class="fvp_overlay" onclick="return false;">'.$html.'<img class="fvp_play_button" src="' . FVP_URL . 'img/playbutton.png"></img></a><div id="fvp_'.$post_id.'" style="display: none;"></div>';
Note that this change references an image in featured_video_plus/img/playbutton.png
Change code as needed.
Create a new directory in the plugin directory for featured video plus. The path to the new directory is
featured_video_plus/img
This is where you should put your play button image
Add the following css to featured_video_plus/css/frontend.css:
.fvp_overlay { position: relative; } .fvp_overlay .yt-button { position: absolute; display: block; height: 42px; width: 59px; top: -52px; left: 10px; }
Change line 95 in featured_video_plus/php/frontend.php:
from
return '<a href="#fvp_'.$post_id.'" class="fvp_overlay" onclick="return false;">'.$html.'</a><div id="fvp_'.$post_id.'" style="display: none;"></div>';
to
return '<a href="#fvp_'.$post_id.'" class="fvp_overlay" onclick="return false;">'.$html.'<img class="yt-button" src="' . FVP_URL . 'img/playbutton.png"></img></a><div id="fvp_'.$post_id.'" style="display: none;"></div>';
Note that this change references an image in featured_video_plus/img/playbutton.png
Change code as needed.
Am currently researching how to do this. To my mind, there would be two ways to go about this:
1. As you said, generate an image with a play button in it
2. Overlay a play button image using CSS. Here’s a suggestion of how to do it: https://stackoverflow.com/a/5123612/173679Either way it will require tweaking the plugin.
Will report my findings. Stay tuned