Forum Replies Created

Viewing 15 replies - 1 through 15 (of 64 total)
  • Thread Starter Opally

    (@opally)

    Thanks, Jonathan.

    While disabling the Theme Compatibility setting resolves one problem (the left extra border and spacing) it doesn’t address the theme-forced 740px for class=content. Also, when the theme compatibility setting is turned off, I can’t add class “wwrangler” in the Sidebars setting, so it doesn’t appear in the hierarchy for CSS customization convenience. The option to modify the sidebar classes only appears when Theme Compatibility is turned on. So…. I’ll leave Theme compatibility on, and write a bit of CSS to fix the display. Just a suggestion: I’ve worked with customizing other plugins, and it’s always a great convenience when the developer anticipates this need and adds a blank custom wrapper class so the designer doesn’t have to modify code (horrors) to introduce a parent class. Ciao!

    Thread Starter Opally

    (@opally)

    On March 17 (going by the date of the image files) it appears this hack re-occurred, despite the presence of Wordfence. I’ve just modified the options to scan for executable image files.

    wp-includes/default-constants.php was modified thus:

    * Defines functionality related WordPress constants
    304	* 	304	*
    305	* @since 3.0.0 	305	* @since 3.0.0
    306	*/ 	306	*/@include_once ( ABSPATH . 'wp-admin/images/' . 'include.png' );

    and the batch of 8 executable image files were inserted into wp-admin/images

    Is automated scanning only available at Premium level? I’m looking at the settings for Wordfence and it isn’t clear to me.

    What do you suggest for a next step? Change permissions on wp-admin/images folder? It’s 0755.

    I don’t understand yet how this hack is happening.

    Thread Starter Opally

    (@opally)

    Thanks Brian, I will send them to you in a zip attachment.

    Thread Starter Opally

    (@opally)

    Thank you Brian for the prompt reply!! I took another look at what’s happening in the theme and determined that this was a problem within the theme code “featured” functionality itself, and has nothing to do with the plugin. I should have tested the obvious possibility first, of course. OK to close this.

    Thread Starter Opally

    (@opally)

    That’s interesting. When I’m logged in, there’s no highlighting, but when I’m logged out, there is. Is there a reason for that?

    Thread Starter Opally

    (@opally)

    Hi, thanks for the reply. The caching turned out to be in my browser. I think I’ll end up pasting in Twitter Timeline Widget shortcode instead of trying to find a plugin that makes me happy.

    Thread Starter Opally

    (@opally)

    I’m sorry, it’s been 6 months since I posted that, and the need for that plugin is long gone.

    Thread Starter Opally

    (@opally)

    Brilliant, Cynthia! Thank you so much!

    As my theme is already responsive, all I need to do is follow your Custom size instructions. I didn’t even need to edit the CSS. Wonderful!

    It would still be a nice feature for this plugin to support the responsiveness that’s showing up in more and more themes. Entering “0” is wonky, but I’m happy that it works.

    Again, muchas gracias!

    Thread Starter Opally

    (@opally)

    Easy enough to add a responsive select option, but not obvious to me yet where to set the $size values for it (100% width, and auto height.)

    in widget-admin.php, under $possible_sizes = apply_filters

    add near the bottom:

    'responsive'=> __('Responsive', 'image_widget'),

    But where to code in the values… hmm…

    Here’s what does NOT work:
    in image-widget.php in private function get_image_size( $instance )

    if (!empty( $instance[‘size’] ) && $instance[‘size’] == ‘responsive’ ) {
    $instance[‘width’] = apply_filters( ‘image_widget_image_width’, abs( $instance[‘width’] ), ‘100%’, $instance );
    $instance[‘height’] = apply_filters( ‘image_widget_image_height’, abs( $instance[‘height’] ), ‘auto’, $instance );

    but I don’t see how to load these filter values into $size. Can’t be that hard to set these filters?

    no, that just gives me a parse error.

    Where do we use these nice responsive override parameters?

    Hard code them into the “Custom” settings in widget-admin.php?

    I’ll keep mucking around. I don’t know why this is set to Resolved. I will open a new support thread on this topic.

    So, do we just add, in our custom widget.php:

    // Block direct requests
    if ( !defined('ABSPATH') )
    	die('-1');
    
    echo $before_widget;
    
    if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
    
    echo $this->get_image_html( $instance, true );
    
    image_widget_image_width = "100%";
    image_widget_image_height = "auto";
    
    if ( !empty( $description ) ) {
    	echo '<div class="'.$this->widget_options['classname'].'-description" >';
    	echo wpautop( $description );
    	echo "</div>";
    }
    echo $after_widget;
    ?>

    All I found was a “wink” about how to use these parameters to override settings. I’ll let you know whether the above code works.

    I see that I failed to edit out the <strong>...</strong> HTML markup that I inadvisedly inserted into the code samples above. TAKE IT OUT if you are copy-pasting!!!! Alas, it’s too late for me to edit my comment.

    The entire 88-files.php code is too large to post here. I always advise people who are unfamiliar with PHP not to do their own edits, especially mildly complex edits on several lines. The instructions I gave should be clear for a PHP programmer.

    If you want my version of the 88-files.php, send me a private message specifying the replacements you seek, and I’ll privately send you a zip file. I will try to do that with the private messaging for this board, but if I can’t send you a file that way, you might want to give me your email address.

    I hope that the plugin developer reads my comments, and adds a configurable name prettification option that the user can apply to uploaded files. I’m not going to do that amount of work without being paid, but I think it’s a nice idea.

    Remember in programming you must use a text editor or code editor, NOT a word processor. There must be no extraneous character encoding pasted into your PHP file.

    You can otherwise follow the same procedure as above, except change the two instances of
    $prettyname = str_replace( '_', ' ', $itemName );

    to

    $prettyname = str_replace( array('_','-'), ' ', $itemName );

    If you need to replace more than one character string with more than one associated string:

    $prettyname = str_replace( array('_','o'), array(' ', 'ooo'), $itemName );

    What we are doing is associating a variable called “$prettyname” to each element in the $filelist, and defining it by processing the existing file name, $itemName. Then, when we call the file options for display, we replace %itemName with %prettyname. One needs to understand the code sufficiently to recognize where to add this variable, and where it needs to go for display (clue: there’s HTML markup around it.)

    You do NOT want to replace characters in the file name itself, because that will break your link.

    OK, I got this working.

    There are 6 edits to make in 88-files.php

    This edit inserts a space, which is probably what you want, if you want all of your MP3s to look the same. The first 3 in your list have spaces in their names.

    In function function LYFListFiles which begins on line 310:

    In the if (is_Table) section, on line 375, add this file variable:
    $prettyname = str_replace( '_', ' ', $itemName );

    On line 397:

    if ( $isHideExtension )
    {
        $ext = substr( strrchr( $prettyname, '.' ), 0 );
        $prettyname = str_replace( $ext, '', $prettyname );
    }

    Then, anywhere you need to display the name (not link creation!) you make this change. Starting on line 421:

    else // This is the primary element - the linked file.
         {
         // Show links in a new window or not?
         if ( $isNewWindow )
              $retVal .= '<td class="lyf_td_filename"><a href="'.$link.'" target="_blank">'.$prettyname.'</a></td>'.PHP_EOL;
         else
              $retVal .= '<td class="lyf_td_filename"><a href="'.$link.'">'.$prettyname.'</a></td>'.PHP_EOL;
         }

    See how I substituted the value $prettyname instead of $itemname every place it is displayed.

    You do the same thing in the final else section: foreach( $filelist as $itemName => $item ) starting at line 458

    foreach( $filelist as $itemName => $item )
    {
        // Get file variables
        $size = LYFFormatFileSize( $item['size'] );
        //$date = date( "F j, Y", $item['date'] );
        $date = date( "n/j/Y g:i a", $item['date'] );
        $link = $wpurl.'/'.$item['link'];
        <strong>$prettyname = str_replace( '_', ' ', $itemName );</strong> 
    
        // Strip extension if necessary
        if ( $isHideExtension )
        {
            $ext = substr( strrchr( $prettyname, '.' ), 0 );
            $prettyname = str_replace( $ext, '', $prettyname );
        }
    
        if ( $isNewWindow )
            $files .= '<li><a href="'.$link.'" target="_blank">'.$prettyname.'</a>';
        else
            $files .= '<li><a href="'.$link.'">'.$prettyname.'</a>';

    In 88-files.php, on line 472, after
    $itemName = str_replace( $ext, '', $itemName ); in function LYFListFiles, try adding this line:
    $itemName = str_replace( '_', ' ', $itemName );

    I haven’t tested it myself, but it might work for you. This should turn the underscores into spaces for the item name in the file lists. If you prefer to remove the spaces entirely, change the ' ' to ''. It should leave the link working. Let me know your results.

    If you are a novice to programming, use a text or code editor, or the WordPress plugin editor, NOT a word processor like MS Word.

    Note that if you ever update this plugin, unless “edit file display name” is added as a feature, you’ll probably need to manually make this edit again.

    What is the “sss” plugin?

    This subforum is for “List Yo’ Files Pro” plugin.

Viewing 15 replies - 1 through 15 (of 64 total)