• Resolved carryoncoding

    (@carryoncoding)


    Hi, I wound back the clock on my settings by setting the time zone to the server time (UTC+0) (as part of dealing with the “Scheduled” error) and my Top Downloads table is showing empty!

    I have put the time back to local (Auckland) and no improvement.
    How can I get my Download figures back??

    I notice on my DEV environment the list is fully populated.

    Thanks.
    Phil

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter carryoncoding

    (@carryoncoding)

    It looks like the widget on live is not storing the value for number of entries.
    Phil.

    Plugin Author bhaldie

    (@bhaldie)

    This is a timezone issue again. Please take a look closely at your server settings and make sure you have setting your WordPress Timezone as well as your servers timezone correctly.

    Thread Starter carryoncoding

    (@carryoncoding)

    Thanks for that.
    When you say “correctly”…..
    I have set the WordPress time zone to UTC + 0 which is the same as the server.
    Is there a time setting in mDocs that I missed?

    The widget is still declining to store the value so it is outputting “zero” top downloads.
    Thanks,
    Phil.

    • This reply was modified 8 years, 3 months ago by carryoncoding. Reason: sp
    Thread Starter carryoncoding

    (@carryoncoding)

    Just for clarity, I have now updated to mDocs 3.8 and the problem remains.
    Cheers,
    Phil.

    Plugin Author bhaldie

    (@bhaldie)

    There is a small bug with the top downloads widget. Ill update it soon, but if you want to fix the issue open the php file mdocs-widget.php and edit the line 137:

    
    echo '<td class="text-center" style="width: 1px">'.$the_list[$i]['downloads'].'32433'.'</td>';
    

    to this:

    
    echo '<td class="text-center" style="width: 1px">'.$the_list[$i]['downloads'].'</td>';
    

    this may fix your problem.

    Thread Starter carryoncoding

    (@carryoncoding)

    Thanks for your thought on this fault, but my copy of the file already looks like your second line.

    Is there something else I can change?
    Thanks,
    Phil.

    Plugin Author bhaldie

    (@bhaldie)

    can you tell me if you see any javascript errors on you page.

    Thread Starter carryoncoding

    (@carryoncoding)

    Hi, thanks. The widget loses it’s setting (“20”) when I click the “Update” button for the page.

    The error console shows the following js:

    TypeError: this.sink is null[Learn More] network-monitor.js:527:5
    TypeError: this.sink is null[Learn More] network-monitor.js:527:5
    TypeError: this.sink is null[Learn More] network-monitor.js:527:5

    I tried using the Memphis Top Downloads widget in a sidebar and it works fine.
    Kind regards,
    Phil.

    Plugin Author bhaldie

    (@bhaldie)

    I’ll have to take a look at my widget code again and see what could be causing this issue. Ill get back to you.

    Thread Starter carryoncoding

    (@carryoncoding)

    Very many thanks for looking into this.
    I’ve explained the issue to the client and he’s not jumping up and down any more!
    All the best,
    Phil.

    Plugin Author bhaldie

    (@bhaldie)

    can you try adding this to the file mdocs-widgets.php after line 121:

    
    if(get_option('mdocs-hide-widget-titles') == false) _e('Top Downloads', 'memphis-documents-library');
    

    so it looks like this:

    
    if(get_option('mdocs-hide-widget-titles') == false) _e('Top Downloads', 'memphis-documents-library');
    echo $after_title;
    

    see if that has any results.

    Thread Starter carryoncoding

    (@carryoncoding)

    Hi, I made that mod and went back to edit the page. It still won’t store the value.

    Just to confirm, I have tried disabling all other plugins and editing the page but it wouldn’t store the value then either.

    Kind regards,
    Phil.

    Thread Starter carryoncoding

    (@carryoncoding)

    Hi,
    I installed the latest update (v 3.82) and it is still not storing the figure for number of entries.
    Kind regards,
    Phil.

    Plugin Author bhaldie

    (@bhaldie)

    kk ill keep digging into the issue.

    Plugin Author bhaldie

    (@bhaldie)

    can you try this overwrite the file mdocs-widgets.php with this code. But also remove the widget and then place it back and then saying “Number of Items in List:” again.

    
    <?php
    function mdocs_widgets() {
    	register_widget( 'mdocs_top_downloads' );
    	register_widget( 'mdocs_top_rated' );
    	register_widget( 'mdocs_last_updated' );
    }
    class mdocs_last_updated extends WP_Widget {
    	function __construct() {
    		// Instantiate the parent object
    		parent::__construct( 'mdocs_last_updated', 'Memphis Last Updated' );
    	}
    	function widget( $args, $instance ) {
    		$mdocs = get_option('mdocs-list');
    		$the_list  = mdocs_array_sort($mdocs,'modified', SORT_DESC, true);
    		extract($args, EXTR_SKIP);
    		echo $before_widget;
    		echo $before_title;
    		//Display title as stored in this instance of the widget
    		if(get_option('mdocs-hide-widget-titles') == false) _e('Last Updated', 'memphis-documents-library');
    		echo $after_title;
    		?>
    		<table class="table table-condensed">
    			<tr>
    				<th></th>
    				<th>File</th>
    				<th>Date</th>
    			</tr>
    		<?php
    		for($i=0; $i< $instance['lu-count']; $i++) {
    			if(!isset($the_list[$i])) break;
    			$permalink = mdocs_get_permalink($the_list[$i]['parent']);
    			echo '<tr>';
    			echo '<td style="width: 1px">'.($i+1).'.</td>';
    			echo '<td><a href="'.$permalink.'null" >'.$the_list[$i]['name'].'</a></td>';
    			echo '<td class="mdocs-widget-date" style="width: 1px"><small>'.date(get_option('mdocs-date-format'), $the_list[$i]['modified']).'</small></td>';
    			echo '</tr>';
    		}
    		?>
    		</table>
    		<?php
    		echo $after_widget;
    	}
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		$instance['lu-count'] = strip_tags( $new_instance['lu-count'] );
    		return $instance;
    	}
    	function form( $instance ) {
    		?>
    		<p>
    			<label>Number of Items in List:</label>
    			<input style="width: 100%;" type="text" name="<?php echo $this->get_field_name('lu-count'); ?>" value="<?php echo esc_attr($instance['lu-count']); ?>" />
    		</p>
    		<?php
    	}
    }
    class mdocs_top_rated extends WP_Widget {
    	function __construct() {
    		// Instantiate the parent object
    		parent::__construct( 'mdocs_top_rated', 'Memphis Top Rated' );
    	}
    	function widget( $args, $instance ) {
    		$mdocs = get_option('mdocs-list');
    		$the_list  = mdocs_array_sort($mdocs,'rating', SORT_DESC, true);
    		extract($args, EXTR_SKIP);
    		echo $before_widget;
    		echo $before_title;
    		if(get_option('mdocs-hide-widget-titles') == false)  _e('Top Rated', 'memphis-documents-library'); 
    		echo $after_title;
    		?>
    		<table class="table table-condensed">
    			<tr>
    				<th></th>
    				<th>File</th>
    				<th>Rating</th>
    			</tr>
    		<?php
    		for($i=0; $i< $instance['tr-count']; $i++) {
    			if(!isset($the_list[$i])) break;
    			$permalink = mdocs_get_permalink($the_list[$i]['parent']);
    			echo '<tr>';
    			echo '<td style="width: 1px">'.($i+1).'.</td>';
    			echo '<td><a href="'.$permalink.'null" >'.$the_list[$i]['name'].'</a></td>';
    			echo '<td class="mdocs-widget-rating" style="width: 1px"><small>';
    			for($j=1;$j<=5;$j++) {
    				if($the_list[$i]['rating'] >= $j) echo '<i class="fa fa-star mdocs-gold" id="'.$j.'" aria-hidden="true"></i>';
    				elseif(ceil($the_list[$i]['rating']) == $j ) echo '<i class="fa fa-star-half-full mdocs-gold" id="'.$j.'" aria-hidden="true"></i>';
    				else echo '<i class="fa fa-star-o" id="'.$j.'" aria-hidden="true"></i>';
    			}
    			echo '</small></td>';
    			echo '</tr>';
    		}
    		?>
    		</table>
    		<?php
    		echo $after_widget;
    	}
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		$instance['tr-count'] = strip_tags( $new_instance['tr-count'] );
    		return $instance;
    	}
    	function form( $instance ) {
    		?>
    		<p>
    			<label>Number of Items in List:</label>
    			<input style="width: 100%;" type="text" name="<?php echo $this->get_field_name('tr-count'); ?>" value="<?php echo esc_attr($instance['tr-count']); ?>" />
    		</p>
    		<?php
    	}
    }
    class mdocs_top_downloads extends WP_Widget {
    	function __construct() {
    		// Instantiate the parent object
    		parent::__construct( 'mdocs_top_downloads', 'Memphis Top Downloads' );
    	}
    	function widget( $args, $instance ) {
    		$mdocs = get_option('mdocs-list');
    		$the_list  = mdocs_array_sort($mdocs,'downloads', SORT_DESC, true);
    		extract($args, EXTR_SKIP);
    		echo $before_widget;
    		echo $before_title;
    		if(get_option('mdocs-hide-widget-titles') == false) _e('Top Downloads', 'memphis-documents-library');
    		echo $after_title;
    		?>
    		<table class="table table-condensed">
    			<tr>
    				<th></th>
    				<th>File</th>
    				<th>DLs</th>
    			</tr>
    		<?php
    		for($i=0; $i< $instance['td-count']; $i++) {
    			if(!isset($the_list[$i])) break;
    			$permalink = mdocs_get_permalink( $the_list[$i]['parent']);
    			echo '<tr>';
    			echo '<td style="width: 1px">'.($i+1).'.</td>';
    			echo '<td><a href="'.$permalink.'null" >'.$the_list[$i]['name'].'</a></td>';
    			echo '<td class="text-center" style="width: 1px">'.$the_list[$i]['downloads'].'</td>';
    			echo '</tr>';
    		}
    		?>
    		</table>
    		<?php
    		echo $after_widget;
    	}
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		$instance['td-count'] = strip_tags( $new_instance['td-count'] );
    		return $instance;
    	}
    	function form( $instance ) {
    		?>
    		<p>
    			<label>Number of Items in List:</label>
    			<input style="width: 100%;" type="text" name="<?php echo $this->get_field_name('td-count'); ?>" value="<?php echo esc_attr($instance['td-count']); ?>" />
    		</p>
    		<?php
    	}
    }
    ?>
    
Viewing 15 replies - 1 through 15 (of 17 total)

The topic ‘Top Downloads table empty’ is closed to new replies.