!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/includes/   drwxr-xr-x
Free 290.59 GB of 429.69 GB (67.63%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     class-kkart-embed.php (4.18 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Kkart product embed
 *
 * @version  2.4.11
 * @package  Kkart\Classes\Embed
 */

if ( ! defined'ABSPATH' ) ) {
    exit;
}

/**
 * Embed Class which handles any Kkart Products that are embedded on this site or another site.
 */
class KKART_Embed {

    
/**
     * Init embed class.
     *
     * @since 2.4.11
     */
    
public static function init() {

        
// Filter all of the content that's going to be embedded.
        
add_filter'the_excerpt_embed', array( __CLASS__'the_excerpt' ), 10 );

        
// Make sure no comments display. Doesn't make sense for products.
        
add_action'embed_content_meta', array( __CLASS__'remove_comments_button' ), );

        
// In the comments place let's display the product rating.
        
add_action'embed_content_meta', array( __CLASS__'get_ratings' ), );

        
// Add some basic styles.
        
add_action'embed_head', array( __CLASS__'print_embed_styles' ) );
    }

    
/**
     * Remove comments button on product embeds.
     *
     * @since 2.6.0
     */
    
public static function remove_comments_button() {
        if ( 
self::is_embedded_product() ) {
            
remove_action'embed_content_meta''print_embed_comments_button' );
        }
    }

    
/**
     * Check if this is an embedded product - to make sure we don't mess up regular posts.
     *
     * @since 2.4.11
     * @return bool
     */
    
public static function is_embedded_product() {
        if ( 
function_exists'is_embed' ) && is_embed() && is_product() ) {
            return 
true;
        }
        return 
false;
    }

    
/**
     * Create the excerpt for embedded products - we want to add the buy button to it.
     *
     * @since 2.4.11
     * @param string $excerpt Embed short description.
     * @return string
     */
    
public static function the_excerpt$excerpt ) {
        global 
$post;

        
// Get product.
        
$_product kkart_get_productget_the_ID() );

        
// Make sure we're only affecting embedded products.
        
if ( self::is_embedded_product() ) {
            echo 
'<p><span class="kkart-embed-price">' $_product->get_price_html() . '</span></p>'// WPCS: XSS ok.

            
if ( ! empty( $post->post_excerpt ) ) {
                
ob_start();
                
kkart_template_single_excerpt();
                
$excerpt ob_get_clean();
            }

            
// Add the button.
            
$excerpt .= self::product_buttons();
        }
        return 
$excerpt;
    }

    
/**
     * Create the button to go to the product page for embedded products.
     *
     * @since 2.4.11
     * @return string
     */
    
public static function product_buttons() {
        
$_product kkart_get_productget_the_ID() );
        
$buttons  = array();
        
$button   '<a href="%s" class="wp-embed-more kkart-embed-button">%s</a>';

        if ( 
$_product->is_type'simple' ) && $_product->is_purchasable() && $_product->is_in_stock() ) {
            
$buttons[] = sprintf$buttonesc_urladd_query_arg'add-to-cart'get_the_ID(), kkart_get_cart_url() ) ), esc_html__'Buy now''kkart' ) );
        }

        
$buttons[] = sprintf$buttonget_the_permalink(), esc_html__'Read more''kkart' ) );

        return 
'<p>' implode' '$buttons ) . '</p>';
    }

    
/**
     * Prints the markup for the rating stars.
     *
     * @since 2.4.11
     */
    
public static function get_ratings() {
        
// Make sure we're only affecting embedded products.
        
if ( ! self::is_embedded_product() ) {
            return;
        }

        
$_product kkart_get_productget_the_ID() );

        if ( 
$_product && $_product->get_average_rating() > ) {
            
?>
            <div class="kkart-embed-rating">
                <?php
                    printf
(
                        
/* translators: %s: average rating */
                        
esc_html__'Rated %s out of 5''kkart' ),
                        
esc_html$_product->get_average_rating() )
                    );
                
?>
            </div>
            <?php
        
}
    }

    
/**
     * Basic styling.
     */
    
public static function print_embed_styles() {
        if ( ! 
self::is_embedded_product() ) {
            return;
        }
        
?>
        <style type="text/css">
            a.kkart-embed-button {
                border-radius: 4px;
                border: 1px solid #ddd;
                box-shadow: 0px 1px 0 0px rgba(0, 0, 0, 0.05);
                display:inline-block;
                padding: .5em;
            }
            a.kkart-embed-button:hover, a.kkart-embed-button:focus {
                border: 1px solid #ccc;
                box-shadow: 0px 1px 0 0px rgba(0, 0, 0, 0.1);
                color: #999;
                text-decoration: none;
            }
            .wp-embed-excerpt p {
                margin: 0 0 1em;
            }
            .kkart-embed-price {
                display: block;
                opacity: .75;
                font-weight: 700;
                margin-top: -.75em;
            }
            .kkart-embed-rating {
                display: inline-block;
            }
        </style>
        <?php
    
}
}

KKART_Embed::init();

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0955 ]--