Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • frame25

    (@frame25)

    Thank you!!!!! You absolutely made our day. 🙂

    frame25

    (@frame25)

    Thank you for the good explanation, Devin. We do have SSL, so that is not a problem.
    One serious issue still remains: the one question I started this whole thread to get answered is still unanswered.

    I cannot turn on IPN inside Paypal without entering a notification URL!
    I understand now that Give is passing along a URL via the API; thank you for explaining that. However, IPN is still turned off on the Paypal side because I have no URL to enter in the settings of the Paypal website.

    As I said originally, when I go into the Paypal settings for IPN (Selling Tools > Instant payment notifications > Choose IPN settings) the radio button is checked for “Do not receive IPN messages (Disabled).” I want to ENABLE them so that Give can actually use it. But I can’t, because I don’t know what URL to enter and for whatever baffling reason, after two months and a bunch of messages in this thread, nobody will tell me!!!

    It’s kind of frustrating. I keep hearing back “hey no need for that; the plugin handles the URL via the API” but I can’t turn IPN on inside Paypal in the first place, unless someone finally tells me what to enter there. See what I mean?

    frame25

    (@frame25)

    Matt, any chance I could get a resolution on this issue? Thank you!

    Just a nudge; you’ve been extremely helpful with your support. Just wondering about my prior post; we do not have PayPal Pro and want to know the IPN URL for just normal Paypal. Thank you!

    But yes, if they close the tab at PayPal after donating then it won’t notify Give of the success and after 7 days Give will automatically mark the donation as “Abandoned”.

    Thank you, Matt, However, this is precisely what I want to avoid. I want this to happen zero times, never, zilch. If it happens ONCE on a single donation, that is once too many. I want IPN every time. Even for non-recurring, one-time donations.

    Your documentation was helpful for PayPal Pro, but we use PayPal Standard. We are a very small nonprofit, do not have the PayPal Pro add-on and can’t afford it. What URL do we enter in the Paypal IPN URL for PayPal Standard?

    Thank you, Matt. It’s not that there’s a “specific advantage to enabling it” for this case, it’s just that I don’t know how on earth these transactions are otherwise being reported back to Give on my site! IPN is simply how it’s done in every single other such solution–except homebrew methods using Payment Data Transfer, which is not robust because it requires people know to hit the Return to Site button, which simply doesn’t happen a certain percentage of the time.

    So yes, transactions seem to be going through, but how on earth is that being accomplished? Is it just being sent back via Payment Data Transfer when they click the “Return to Site” button after donating?

    In which case, what happens when they don’t hit that button? Am I missing something?

    I appreciate all the responses, by the way. Understanding how the information is being passed back to my site helps me to troubleshoot any possible issues.

    Of course it isn’t for normal websites. You actually gave it a really nice and helpful description in your review, so it seems strange you’d give it a low rating just because you ended up not needing it. Your review is like giving a Ferarri 1 star because it messes up the engine when you drive it underwater.

    frame25

    (@frame25)

    I put together a plugin to automate this fix. I applied for an account to post the plugin officially but haven’t heard back yet, so for now, find the plugin and instructions and screenshots here:
    http://www.filmtraveler.com/2008/11/18/wordpress-plugin-shorten-link-text/

    Thanks for your help, Otto, in recommending the filter!

    frame25

    (@frame25)

    Okay, I found out that the filter DOES exist, it’s just not on the Plugin API page. It’s here:
    http://adambrown.info/p/wp_hooks/hook/%7B$adjacent%7D_post_link

    So, thank you Otto! Now here is my solution:

    function filter_shorten_linktext($linkstring,$link) {
    	$characters = 33;
    	preg_match('/<a.*?>(.*?)<\/a>/is',$linkstring,$matches);
    	$displayedTitle = $matches[1];
    	$newTitle = shorten_with_ellipsis($displayedTitle,$characters);
    	return str_replace('>'.$displayedTitle.'<','>'.$newTitle.'<',$linkstring);
    }
    
    function shorten_with_ellipsis($inputstring,$characters) {
      return (strlen($inputstring) >= $characters) ? substr($inputstring,0,($characters-3)) . '...' : $inputstring;
    }
    
    // This adds filters to the next and previous links, using the above functions
    // to shorten the text displayed in the post-navigation bar. The last 2 arguments
    // are necessary; the last one is the crucial one. Saying "2" means the function
    // "filter_shorten_linktext()" takes 2 arguments. If you don't say so here, the
    // hook won't pass them when it's called and you'll get a PHP error.
    add_filter('previous_post_link','filter_shorten_linktext',10,2);
    add_filter('next_post_link','filter_shorten_linktext',10,2);

    You simply place this in your theme folder’s “functions.php” file and it will start working. Change $characters = 33; to the number of characters you want it to cut off at. I may write a plugin to do this, too; we’ll see.

    frame25

    (@frame25)

    I was just about to post my regex solution to this, but that’s a brilliant find. I had no idea such a filter existed.

    One problem though: there doesn’t seem to be an actual ‘previous_post_link’ filter in the API (http://codex.wordpress.org/Plugin_API/Filter_Reference), just one for ‘post_link’ — which the documentation seems to suggest would apply to all permalinks, which is not what I want. Am I wrong here? The filter documentation is:

    post_link
    applied to the calculated post permalink by the get_permalink function, which is also called by the the_permalink, post_permalink, previous_post_link, and next_post_link functions. Filter function arguments: permalink URL, post data list.

    frame25

    (@frame25)

    Darnit, the comment system converted some of what I typed above to code, so let me try again starting with the paragraph “But there still remains a problem:”

    *snip*

    But there still remains a problem. If you use the above code, the content of the $next_post_link variable is HTML and wrapped in an A tag. So you’ll have succesfully captured, for example:
    &laquo; <a href="http://www.example.com/prevpost">Previous Post Title</a>
    Now if you try to run substr on that and add ellipses, you’ll be butchering the HTML and breaking the page. It’ll create something like:
    &laquo; <a href="http://www.example.com/prevpost">Previous Post Title<...

    */snip*

    frame25

    (@frame25)

    I’ve been trying to solve the problem of too-long-titles myself.

    The problem you’re having is that the previous_post_link function echoes its output directly. It doesn’t return a string for substr to then chop up and echo manually. The moment previous_post_link gets called in your code, BOOM, it gets echoed. So it’s not being processed. A lot of WordPress functions are like this. If you want to capture the output to shorten it, you have to use output buffering, like this:

    ob_start();
        next_post_link('%link');
        $next_post_link = ob_get_contents();
        ob_clean();
        previous_post_link('&laquo; %link');
        $previous_post_link = ob_get_clean();

    Now you have the links output as variables you can process, and nothing has been echoed to the screen yet.

    But there still remains a problem. If you use the above code, the content of the $next_post_link variable is HTML and wrapped in an A tag. So you’ll have succesfully captured, for example:
    « Previous Post Title
    Now if you try to run substr on that and add ellipses, you’ll be butchering the HTML and breaking the page. It’ll create something like:
    « Previous Post Title<...
    So you can see, it breaks the closing A tag and doesn’t actually shorten the title. So if you did this you’d have to use a regular expression (like preg_replace) to find and shorten the title inside the tag. (WordPress should really add an argument to the functions to allow you to shorten it.)

    The output buffer + regular-expression approach is the only one I’ve found so far, and I haven’t implemented it yet because regular expressions are a colossal pain in the ass.

    Everyone who installs and uses this plugin should read and implement this fix.

    Many people are having a problem where after updating the Options for this plugin, it breaks and they get weird “a” characters instead of the proper footnotes.

    I found the problem and fixed it. When using a special HTML character like the default one (the one suggested right there on the options page, [ampersand]#8617;) it is RENDERED as the special character the next time the options page loads, and when you RE-SAVE THE OPTIONS, THAT IS WHEN IT BREAKS.

    Developers can test this:

    1) Go to the options page in a default installation
    2) If the Backlink character is displayed as “[ampersand]#8617;” then click Update Options and proceed to step 3; otherwise:
    3) Notice that the Backlink character is RENDERED as the little back arrow instead of being the HTML code for it!

    (Note that I had to use “[ampersand]” instead of the actual symbol in this post here; WordPress.org forums converts it to the arrow character too, making it harder to illustrate the problem! Ironic.)

    Now the next time you click “Update Options” it BREAKS the settings and leads to everything being a jumble of “a” and so on. Apparently trying to save the ACTUAL character in the database, instead of the code for it, causes it to choke.

    SOLUTION:

    On line 71 of admin_panel.php in the wp-content/plugins/wp-footnotes directory of your site, change the code currently as:

    <?php echo $wp_footnotes_current_settings['backlink']; ?>

    to:

    <?php echo htmlspecialchars($wp_footnotes_current_settings['backlink']); ?>

    Fixed!

Viewing 13 replies - 1 through 13 (of 13 total)