Forum Replies Created

Viewing 15 replies - 61 through 75 (of 80 total)
  • Thread Starter randyhoyt

    (@randyhoyt)

    ProjectManager 2.2 takes care of this. Thanks!

    Thread Starter randyhoyt

    (@randyhoyt)

    The quick edit has trouble with single quotes (‘) and double quotes (“), as I mentioned in another thread.

    https://www.ads-software.com/support/topic/248947?#post-1003475

    Thread Starter randyhoyt

    (@randyhoyt)

    I took a stab at fixing this myself. It seems to work fine but — since I’m not a PHP programmer or anything — it may break something else.

    —-

    In dataset-form.php, I changed two lines to use HTML encoding for single and double quote marks. (The issue here seems to be that a quote mark in the field gets treated like the end of the attribute in HTML.)

    5. ... $name ...

    5. ... str_replace("\"", """, str_replace("\'", "'", $name)) ...

    and

    26. [blank]

    26. <?php $meta_data[$form_field->id] = str_replace("\"", "&quot;", str_replace("\'", "'", $meta_data[$form_field->id])); ?>

    —-

    I changed quite a few lines in admin.php, wrapping attributes in the stripslashes function to remove the unwanted backslashes.

    510. ... name ...

    510. ... stripslashes($name) ...

    and

    525. $meta_value

    525. stripslashes($meta_value)

    and

    584. [same as 525]

    and

    586. [same as 525]

    —-

    (@koelle, I will email my modified files to you directly. I started from ProjectManager 2.1.)

    I am also experience the same problem.

    I am having the same problem on a site right now. I do not have podPress installed. What’s the issue? Is the uploader running out of memory or something?

    Thread Starter randyhoyt

    (@randyhoyt)

    It happens when I add a new dataset and when I edit an existing dataset using the normal editor.

    I just tried it using the AJAX editor, and it actually has a different problem. It adds the backslash but then cuts off everything after that. So this …

    This plugin's awesome!

    … becomes …

    This plugin

    Yes, it most definitely is. After you specify values for the first two and save them, the page should reload with empty fields for a third template. Does that make sense? Have you tried that and it’s not working?

    I just found a plugin that does a LOT more than this, but it looks like it has found a way to remove those profile options.

    I haven’t dug through the code to find the hooks, but I imagine it is in there.

    Thread Starter randyhoyt

    (@randyhoyt)

    This feature has been added in more recent versions. Thank you!

    I would love to know this also!

    Thread Starter randyhoyt

    (@randyhoyt)

    Wow! Thanks for the prompt response! That works perfectly.

    Thread Starter randyhoyt

    (@randyhoyt)

    I have also been thinking that it would be useful to have some fields that appear on all page templates. The way I’m using the plugin, I need a certain set of fields that apply to all pages; then I have some other sets of fields that depend on what kind of a page it is (an issue of a publication, a conference, an award year, etc.). Right now, I’m duplicating all the shared fields across all the templates, but that’s a little difficult to maintain.

    Thread Starter randyhoyt

    (@randyhoyt)

    Page Templates: I think you are right about page-template-specific fields; they are not necessary. What I think would be helpful, though, is if you could set up some templates to be used only on “Pages” and some templates to be used only on “Posts”. I think that would eliminate the confusion.

    Category: I think the way you have hooked templates to categories works very nicely! Here are a few of the things that are not working the way I would expect, though I should reiterate that I think this works very nicely!

    • Set up a new template for a category and then immediately go edit a post with that category. I would expect it to pick the template automatically. Instead, I have to uncheck and then recheck the box.
    • Select one category with a template; the correct template loads. Next, uncheck the category and the template fields are all gone. I would have expected it to go back to the default template fields.
    • Check two categories, both with templates; the template fields are those belonging to the second category, as expected, but the dropdown still says “Default template”; I would have expected it to have the new template name. There isn’t any way to switch to the other template to edit the fields for that one; it would be nice if the new templates were added to the dropdown so you could switch back and forth between them. Then uncheck the second category and the template fields all go away; I would have expected them to change to the fields for the template associated with the first category.

    Overall, really great work! This is such a cool plugin.

    @laddaye, That link requires you to change the core WordPress code. I recently had to do this for a client, and I needed to make sure they could upgrade without any trouble. I added my solution to a different thread, which can be found here: [https://www.ads-software.com/support/topic/169520].

    I recently had to do this for a client. I added the following code to my theme’s custom functions file, and it works pretty well. (Your theme may not have this file; it should be called functions.php and should be located in the same folder as your style.css file.)

    —-

    <?php
    
        function display_protected_excerpts($excerpt)
        {
            global $post;
            if (!empty($post->post_password)) {
                $output = $post->post_excerpt;
                $output = apply_filters('get_the_excerpt', $output);
                return $output;
            }
            return $excerpt;
        }
        add_filter('the_excerpt','display_protected_excerpts', 0);
    
        function display_excerpt_on_protected_posts($content)
        {
            global $post;
            $replacement_text = $post->post_excerpt;
            $replacement_text = apply_filters('get_the_excerpt', $replacement_text);
            return str_replace('This post is password protected. To view it please enter your password below:',$replacement_text, $content);
        }
        add_filter('the_content','display_excerpt_on_protected_posts', 10);
    
    ?>

    —-

    This adds a filter that replaces the default protected messaging on the post page with the post’s excerpt. This assumes the text is the English version; does anyone know a way to internationalize this?

Viewing 15 replies - 61 through 75 (of 80 total)