Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter k1000o

    (@k1000o)

    First, thanks for the prompt reply.

    1) Already tried and still the problem
    2) It is very difficult to prove. But before works and not now.

    The method I use to install the buttons is:
    shortcode and pasting the snipet

    Something I forgot to mention is that locally works well and does not work online.

    Examples:
    online version
    https://drive.google.com/file/d/0B8NJxS6VgfioQ04xX2MtaW9mcVk/view?pli=1

    Local version
    https://drive.google.com/file/d/0B8NJxS6VgfioaDlhaFBEXzlNZUU/view?usp=sharing

    I can also show modifications made to apply the plugin to content

    function thumbs_rating_getlink($post_ID = '', $type_of_vote = '')
    	{
    
    		// Sanatize params
    
    		$post_ID = intval( sanitize_text_field( $post_ID ) );
    		$type_of_vote = intval ( sanitize_text_field( $type_of_vote ) );
    
    		$thumbs_rating_link = "";
    
    		if( $post_ID == '' ) $post_ID = get_the_ID();
    
    		$thumbs_rating_up_count = get_post_meta($post_ID, '_thumbs_rating_up', true) != '' ? get_post_meta($post_ID, '_thumbs_rating_up', true) : '0';
    		$thumbs_rating_down_count = get_post_meta($post_ID, '_thumbs_rating_down', true) != '' ? get_post_meta($post_ID, '_thumbs_rating_down', true) : '0';
    
    		//changes from here:
    		$thumbs_rating_total_count = $thumbs_rating_up_count - $thumbs_rating_down_count;
    
    		$link_up = '<div class="btn-group"><button  class="btn btn-default thumbs-rating-up'.  ( (isset($thumbs_rating_up_count) && intval($thumbs_rating_up_count) > 0 ) ? ' thumbs-rating-voted' : '' ) .'" type="button" onclick="thumbs_rating_vote(' . $post_ID . ', 1);" data-text="' . __('Vote Up','thumbs-rating') . '" data-toggle="tooltip" data-placement="top" title="+'.$thumbs_rating_up_count.'">';
    		$link_up .= '<span class="icon-thumbs-up"></span>';
    		$link_up .= '</button></div>';
    
    		$link_down = '<div class="btn-group"><button class="btn btn-default thumbs-rating-down'. ( (isset($thumbs_rating_down_count) && intval($thumbs_rating_down_count) > 0 ) ? ' thumbs-rating-voted' : '' ) .'" type="button" onclick="thumbs_rating_vote(' . $post_ID . ', 2);" data-text="' . __('Vote Down','thumbs-rating') . '" data-toggle="tooltip" data-placement="top" title="- '.$thumbs_rating_down_count.'">';
    		$link_down .= '<span class="icon-thumbs-down"></span>';
    		$link_down .= '</button></div>';
    
    		$thumbs_rating_link = '<div id="votacion">';
    		$thumbs_rating_link .= '<div class="panel panel-default thumbs-rating-container" id="thumbs-rating-'.$post_ID.'" data-content-id="'.$post_ID.'">';
    
    		//panel panel-default 
    
    		if($thumbs_rating_total_count > 0):
    			$thumbs_rating_total_count = '<span class="numVot positivo"> +' . $thumbs_rating_total_count .'</span>';
    		elseif($thumbs_rating_total_count < 0):
    			$thumbs_rating_total_count = '<span class="numVot negativo">' . $thumbs_rating_total_count .'</span>';
    		else:
    			$thumbs_rating_total_count = '<span class="numVot">' . $thumbs_rating_total_count .'</span>';
    		endif;
    
    		$thumbs_rating_link .= '<div class="panel-heading">';
    		$thumbs_rating_link .= $thumbs_rating_total_count;
    		$thumbs_rating_link .= '<span class="thumbs-rating-already-voted" data-text="' . __('You already voted!', 'thumbs-rating') . '"></span>';
    		$thumbs_rating_link .= '</div>';
    		$thumbs_rating_link .= '<div class="btn-group btn-group-justified">';
    		$thumbs_rating_link .= $link_down;
    		$thumbs_rating_link .= $link_up;
    		$thumbs_rating_link .= '</div>';
    
    		$thumbs_rating_link .= '</div>';
    		$thumbs_rating_link .= '</div>';
    
    		return $thumbs_rating_link;
    	}

    Styles (stylus):

    div#votacion
    	text-align center
    	margin 0 auto
    	max-width 110px
    	padding 0
    
    	div.panel.panel-default.thumbs-rating-container
    		margin-bottom 0
    
    		div.panel-heading
    			color #d7dbdc
    			font-size 2em
    			position relative
    			span.negativo
    				color #f00
    			span.positivo
    				color #98b963
    			span.thumbs-rating-already-voted
    				background rgba(84, 170, 189, .7)
    				color #fff
    				display none
    				font-size .4em
    				font-weight bold
    				height 100%
    				margin 0px
    				padding 25% 5% 0 5%
    				position absolute
    				top 0
    				left 0
    				-webkit-transition (all 0.3s)
    				transition (all 0.3s)
    				width 100%
    
    			span.thumbs-rating-already-voted:before
    				content attr(data-text)
    
    		button
    			color #8e9293
    			font-size .9em
    
    		button.thumbs-rating-up:hover
    			color #a4c346
    		button.thumbs-rating-down:hover
    			color #f00

Viewing 1 replies (of 1 total)