• Resolved roman75

    (@roman75)


    Hello,

    we’re using the plugin and in “debug” mode we got the error

    Notice: Undefined variable: mpr_version_number in /[…]/plugins/multisite-post-reader/multisite-post-reader.php on line 197

    To fix this I added the following line bofore the line 197
    $mpr_version_number = "2.2.0";
    so the error was fixed.

    best regards,
    Roman

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Rick Hellewell

    (@rhellewellgmailcom)

    Whoops! You are right, of course!

    The more correct fix is to put this in the beginning of thempr_shortcodes_init() function (about line 193)

    global $mpr_version ;

    That way, the proper value of the variable is only defined once (at the beginning of the file).

    I just posted version 2.21, which includes that fix (and gave you credit in the readme). Thanks!

    Thread Starter roman75

    (@roman75)

    Thank you for the credits.

    Because we needed some customizations i made some changes to your plugin.

    Feel free to integrate the following code:

    1) Added Shortcode for hiding the post date and show the post thumbnail image

    // hide post date with [ ... showdate=no]
    // line ~ 459
    	if ( isset ($atts['showdate']))
    	{
    		$showdate = false ;
    	}
    	else
    	{
    		$showdate = true ;
    	}
    
    // show thumbnail
    	if ( isset ($atts['showthumbnail']))
    	{
    		$showthumbnail = true ;
    	}
    	else
    	{
    		$showthumbnail = false ;
    	} 
    [...]
    // line ~522 after title:
    </a></strong>
    	<?php
    	if($showdate)
           {
    	  echo "&nbsp;&nbsp;&nbsp;(" .  $x->post_date  . ")";
    	}
    [...]
    if ($atts['showall'])
    			{
    				echo "<em>(status = " . $x->post_status . ")</em>" ;
    			}
    			echo "<br>" ;
    			
    // show thumbnail with class "globalImageStyle"
    			if($showthumbnail)
    			{
    				echo get_the_post_thumbnail( $page->ID, 'thumbnail', array( 'class' => 'globalImageStyle' ) );
    				
    			}
    
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Undefined variable: mpr_version_number’ is closed to new replies.