Ordercss/liveblog.css 0000644 00000011064 14760037716 0007666 0 ustar 00 .pcliveblog-wrapper {
margin: 20px 0 30px;
clear: both;
}
.pcliveblog-wrapper-status {
clear: both;
}
.pcliveblog-wrapper .pcliveblog-wrapper-status {
padding: 10px 20px;
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-between;
background: var(--pcaccent-cl);
color: var(--pcbg-cl);
margin: 0 0 30px;
}
.pcliveblog-content.post-entry {
margin-bottom: 0;
}
.post-entry .pcliveblog-wrapper .pcliveblog-wrapper-status a,
.pcliveblog-wrapper .pcliveblog-wrapper-status a {
color: var(--pcbg-cl);
}
.post-entry .pcliveblog-wrapper .pcliveblog-wrapper-status a:hover,
.pcliveblog-wrapper .pcliveblog-wrapper-status a:hover {
text-decoration: none;
}
.pcliveblog-wrapper .pcliveblog-listing-item {
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 1px solid var(--pcborder-cl);
}
.pcliveblog-listing-item .pcliveblog-date {
color: var(--pcmeta-cl);
}
.pcliveblog-listing-item .pcliveblog-title {
font-family: var(--pchead-font);
color: var(--pcheading-cl);
font-size: 18px;
font-weight: var(--pchead-wei);
margin-bottom: 10px;
line-height: 1.3;
}
.pcliveblog-content > p:last-child {
margin-bottom: 0;
}
.pcliveblog-item-share {
margin-top: 20px;
line-height: 1;
}
.pcliveblog-item-share .pclb-sitem,
.post-entry .pcliveblog-item-share .pclb-sitem {
display: inline-block;
color: var(--pcmeta-cl);
vertical-align: middle;
font-size: 13px;
}
.pcliveblog-item-share a:hover,
.post-entry .pcliveblog-item-share a:hover {
text-decoration: none;
color: var(--pcaccent-cl);
}
.pcliveblog-item-share .pclb-sitem:not(:last-child),
.post-entry .pcliveblog-item-share .pclb-sitem:not(:last-child) {
margin-right: 10px;
}
body.rtl .pcliveblog-item-share .pclb-sitem:not(:last-child),
body.rtl .post-entry .pcliveblog-item-share .pclb-sitem:not(:last-child) {
margin: 0 0 0 10px;
}
.pcliveblog-item-share a i,
.post-entry .pcliveblog-item-share a i {
vertical-align: middle;
margin-right: 5px;
}
.pcliveblog-item-share a .penci-faicon.penciicon-x-twitter,
.post-entry .pcliveblog-item-share a .penci-faicon.penciicon-x-twitter {
transform: translateY(-1px);
}
body.rtl .pcliveblog-item-share a i,
body.rtl .post-entry .pcliveblog-item-share a i {
margin: 0 0 0 5px;
}
.pcliveblog-wrapper-buttons {
margin-bottom: 30px;
display: flex;
flex-wrap: wrap;
}
.pcliveblog-wrapper-buttons a,
.post-entry .pcliveblog-wrapper-buttons a {
font-family: var(--pchead-font);
display: inline-block;
padding: 10px 15px;
border: 1px solid var(--pcborder-cl);
color: var(--pcheading-cl);
font-weight: var(--pchead-wei);
line-height: 1;
min-width: 150px;
text-align: center;
}
.pcliveblog-wrapper-buttons a.active {
background: var(--pcborder-cl);
}
.pcliveblog-wrapper-buttons a:hover,
.post-entry .pcliveblog-wrapper-buttons a:hover {
text-decoration: none;
border-color: var(--pcaccent-cl);
background-color: var(--pcaccent-cl);
color: var(--pcbg-cl);
}
.pcliveblog-notice-wrapper{
clear: both;
}
.pcliveblog-notice-wrapper h4{
font-size: 20px;
}
.pcliveblog-notice-wrapper h4:before {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--pcborder-cl);
content: '';
display: inline-block;
margin-right: 5px;
}
body.rtl .pcliveblog-notice-wrapper h4:before {
margin: 0 0 0 5px;
}
.pcliveblog-notice-wrapper.enable h4:before {
background: #e80000 !important;
animation-name: pcliveblog-notice;
animation-iteration-count: infinite;
animation-duration: 1s;
}
@keyframes pcliveblog-notice {
0% {
opacity: 0.2
}
100% {
opacity: 1
}
}
.pclive-btn {
padding: 2px 6px 2px 15px;
color: #fff !important;
display: inline-block;
line-height: 12px !important;
vertical-align: baseline;
margin-right: 8px;
position: relative;
background: #e80000 !important;
border-radius: 2px;
}
body.rtl .pclive-btn,
.pclive-btn.livelbaf {
margin: 0 0 0 8px;
}
body.rtl .pclive-btn.livelbaf {
margin: 0 8px 0 0;
}
.pclive-btn:after {
content: attr(data-title);
display: inline-block;
font-size: 10px !important;
line-height: inherit;
vertical-align: top;
color: #fff !important;
text-transform: uppercase;
}
.pclive-btn:before {
content: '';
width: 6px;
height: 6px;
border-radius: 50%;
display: inline-block;
background: #fff !important;
position: absolute;
top: 50%;
left: 6px;
margin-top: -3px;
animation-name: pcliveblog-notice;
animation-iteration-count: infinite;
animation-duration: 1s;
} css/admin-css.css 0000644 00000002535 14760037716 0007744 0 ustar 00 .pcliveblog-events-wrapper {
padding: 20px;
border: 2px solid #f1f1f1;
border-radius: 2px;
}
.pcliveblog-events-wrapper .pcliveblog-event-field:last-child {
margin-top: 30px;
}
.button.pcliveblog-addnew {
color: #fff;
background: #000;
border-color: #000;
}
.live-events-listing {
max-height: 352px;
overflow: auto;
}
.live-events-listing-item {
padding: 0 0 15px;
margin: 0 0 15px;
border-bottom: 1px solid #ccc;
position: relative;
}
.live-events-listing-item .post-entry p:last-child {
margin: 0;
}
.live-events-listing-action {
position: absolute;
top: 0;
right: 0;
opacity: 0;
}
.live-events-listing-item:hover .live-events-listing-action {
opacity: 1;
}
.live-events-listing-action a:last-child {
margin-left: 10px;
}
.live-events-listing-item:last-child {
border: 0;
}
.pcliveblog-event-field .items:not(:last-child) {
margin-bottom: 20px;
}
.pcliveblog-event-field label {
display: block;
font-weight: bold;
margin: 0 0 10px;
}
.pcliveblog-event-field input[type="text"] {
width: 100%;
padding: 5px 10px;
max-width: 770px;
}
.pcliveblog-event-field p {
margin: 0 0 20px;
}
.live-events-new {
padding: 30px;
background: #f1f1f1;
border-radius: 5px;
}
.live-events-listing-ct.post-title span {
font-size: 18px;
font-weight: bold;
} customizer/panel.php 0000644 00000001643 14760037716 0010577 0 ustar 00 set_panel();
$this->set_section();
}
public function set_panel() {
$this->customizer->add_panel( [
'id' => $this->panelID,
'title' => esc_html__( 'Live Blog', 'penci-liveblog' ),
'priority' => $this->id,
] );
}
public function set_section() {
$this->add_lazy_section( 'penci_liveblog_general_section', esc_html__( 'General', 'penci-liveblog' ), $this->panelID );
$this->add_lazy_section( 'penci_liveblog_styles_section', esc_html__( 'Font Size & Colors', 'penci-liveblog' ), $this->panelID );
$this->add_lazy_section( 'penci_liveblog_translations_section', esc_html__( 'Text Translations', 'penci-liveblog' ), $this->panelID );
}
} customizer/settings.php 0000644 00000003044 14760037716 0011335 0 ustar 00 customizer = \SoledadFW\Customizer\Customizer::get_instance();
}
if ( is_customize_preview() || ! is_admin() ) {
add_filter( 'soledad_fw_register_lazy_section', array( $this, 'register_lazy_section' ) );
add_action( 'soledad_fw_register_customizer_option', array( $this, 'load_customizer' ), 95 );
}
}
/**
* @return Customizer
*/
public static function getInstance() {
if ( null === static::$instance ) {
static::$instance = new static();
}
return static::$instance;
}
public function register_lazy_section( $result ) {
$array = $this->list_section;
$path = dirname( __DIR__ ) . '/customizer/';
foreach ( $array as $id ) {
$result[ $id ][] = "{$path}{$id}.php";
}
return $result;
}
public function load_customizer() {
$this->customizer = Customizer\Customizer::get_instance();
new Customizer\PenciLiveBlog_Option( $this->customizer, 207 );
}
}
customizer/penci_liveblog_general_section.php 0000644 00000007234 14760037716 0015704 0 ustar 00 'penci_liveblog_header_1',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'General Option', 'penci-liveblog' ),
);
$options[] = array(
'id' => 'penci_liveblog_timeout',
'transport' => 'postMessage',
'default' => '60',
'type' => 'soledad-fw-number',
'label' => esc_html__( 'Auto Get New Content After:', 'penci-liveblog' ),
'description' => esc_html__( 'Enter the timeout in the seconds.', 'penci-liveblog' ),
);
$options[] = array(
'id' => 'penci_liveblog_time_format',
'transport' => 'postMessage',
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Custom Data/Time Format', 'penci-liveblog' ),
'description' => __( 'Please fill in the datetime format string for this field - you can find more information here ', 'penci-liveblog' ),
);
$options[] = array(
'id' => 'penci_liveblog_share',
'transport' => 'postMessage',
'default' => false,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Disable Event Social Share', 'penci-liveblog' ),
);
$options[] = array(
'id' => 'penci_liveblog_notice',
'transport' => 'postMessage',
'default' => false,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Hide Event Message Notice', 'penci-liveblog' ),
);
$options[] = array(
'id' => 'penci_liveblog_change_page_title',
'transport' => 'postMessage',
'default' => false,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Changing Browser Tab Title after Receiving a New Update?', 'penci-liveblog' ),
);
$options[] = array(
'id' => 'penci_liveblog_post_prefix',
'transport' => 'postMessage',
'default' => true,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Add "Live" Label Highlight to Post Title', 'penci-liveblog' ),
);
$options[] = array(
'id' => 'penci_liveblog_post_prefix_position',
'transport' => 'postMessage',
'default' => 'before',
'type' => 'soledad-fw-select',
'choices' => [
'before' => __('Before Post Title','penci-liveblog'),
'after' => __('After Post Title','penci-liveblog'),
],
'label' => esc_html__( 'Live Label Position', 'penci-liveblog' ),
);
$options[] = array(
'id' => 'penci_liveblog_hide_btn',
'transport' => 'postMessage',
'default' => false,
'type' => 'soledad-fw-toggle',
'label' => esc_html__( 'Hide Update Now Section', 'penci-liveblog' ),
);
$options[] = array(
'label' => esc_html__( 'In-Feed Ads', 'soledad' ),
'id' => 'penci_liveblog_header_2',
'type' => 'soledad-fw-header',
'sanitize' => 'sanitize_text_field'
);
$options[] = array(
'label' => __( 'Insert In-feed Ads Code After Every How Many Events?', 'soledad' ),
'id' => 'penci_liveblog_infeedads_num',
'type' => 'soledad-fw-size',
'default' => '3',
'sanitize' => 'absint',
'ids' => array(
'desktop' => 'penci_liveblog_infeedads_num',
),
'choices' => array(
'desktop' => array(
'min' => 1,
'max' => 100,
'step' => 1,
'edit' => true,
'unit' => '',
'default' => '3',
),
),
);
$options[] = array(
'label' => __( 'In-feed Ads Code/HTML', 'soledad' ),
'description' => __( 'Please use normal responsive ads here to get the best results. In-feed ads cannot work with auto-ads because auto-ads will randomly place your ads in random places on the pages.', 'soledad' ),
'id' => 'penci_liveblog_infeedads_code',
'type' => 'soledad-fw-textarea',
'default' => '',
'sanitize' => 'penci_sanitize_textarea_field'
);
return $options; customizer/penci_liveblog_translations_section.php 0000644 00000000512 14760037716 0017000 0 ustar 00 $text ) {
$options[] = array(
'id' => 'pclb_trans_' . $ops,
'default' => esc_html( $text ),
'type' => 'soledad-fw-text',
'label' => esc_html__( 'Text: ', 'penci-liveblog' ) . '"' . esc_html( $text ) . '"',
);
}
return $options; customizer/penci_liveblog_styles_section.php 0000644 00000012434 14760037716 0015610 0 ustar 00 'pencilb_style_header_01',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Colors', 'penci-paywall' ),
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Date/Time Color', 'penci-liveblog' ),
'id' => 'pencilb_date_color',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Title Color', 'penci-liveblog' ),
'id' => 'pencilb_title_color',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Content Color', 'penci-liveblog' ),
'id' => 'pencilb_content_color',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Content Link Color', 'penci-liveblog' ),
'id' => 'pencilb_content_link_color',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Content Link Hover Color', 'penci-liveblog' ),
'id' => 'pencilb_content_link_hcolor',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Social Share Color', 'penci-liveblog' ),
'id' => 'pencilb_share_color',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Social Share Hover Color', 'penci-liveblog' ),
'id' => 'pencilb_share_hcolor',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Event Border Color', 'penci-liveblog' ),
'id' => 'pencilb_event_bcolor',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Top Status Background Color', 'penci-liveblog' ),
'id' => 'pencilb_top_status_bgcolor',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_hex_color',
'type' => 'soledad-fw-color',
'label' => __( 'Top Status Text Color', 'penci-liveblog' ),
'id' => 'pencilb_top_status_txtcolor',
);
$options[] = array(
'id' => 'pencilb_style_header_02',
'type' => 'soledad-fw-header',
'label' => esc_html__( 'Font Sizes', 'penci-paywall' ),
);
$options[] = array(
'sanitize' => 'absint',
'label' => '',
'id' => 'penci_liveblog_date_mfsize',
'type' => 'soledad-fw-hidden',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_text_field',
'label' => 'Font Size for Date/Time',
'id' => 'penci_liveblog_date_fsize',
'type' => 'soledad-fw-size',
'ids' => [
'desktop' => 'penci_liveblog_date_fsize',
'mobile' => 'penci_liveblog_date_mfsize',
],
'choices' => array(
'desktop' => array(
'min' => 1,
'max' => 500,
'step' => 1,
'edit' => true,
'unit' => 'px',
),
'mobile' => array(
'min' => 1,
'max' => 500,
'step' => 1,
'edit' => true,
'unit' => 'px',
),
),
);
$options[] = array(
'sanitize' => 'absint',
'label' => '',
'id' => 'penci_liveblog_title_mfsize',
'type' => 'soledad-fw-hidden',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_text_field',
'label' => 'Font Size for Title',
'id' => 'penci_liveblog_title_fsize',
'type' => 'soledad-fw-size',
'ids' => [
'desktop' => 'penci_liveblog_title_fsize',
'mobile' => 'penci_liveblog_title_mfsize',
],
'choices' => array(
'desktop' => array(
'min' => 1,
'max' => 500,
'step' => 1,
'edit' => true,
'unit' => 'px',
),
'mobile' => array(
'min' => 1,
'max' => 500,
'step' => 1,
'edit' => true,
'unit' => 'px',
),
),
);
$options[] = array(
'sanitize' => 'absint',
'label' => '',
'id' => 'penci_liveblog_content_mfsize',
'type' => 'soledad-fw-hidden',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_text_field',
'label' => 'Font Size for Content',
'id' => 'penci_liveblog_content_fsize',
'type' => 'soledad-fw-size',
'ids' => [
'desktop' => 'penci_liveblog_content_fsize',
'mobile' => 'penci_liveblog_content_mfsize',
],
'choices' => array(
'desktop' => array(
'min' => 1,
'max' => 500,
'step' => 1,
'edit' => true,
'unit' => 'px',
),
'mobile' => array(
'min' => 1,
'max' => 500,
'step' => 1,
'edit' => true,
'unit' => 'px',
),
),
);
$options[] = array(
'sanitize' => 'absint',
'label' => '',
'id' => 'penci_liveblog_share_mfsize',
'type' => 'soledad-fw-hidden',
);
$options[] = array(
'default' => '',
'sanitize' => 'sanitize_text_field',
'label' => 'Font Size for Social Share',
'id' => 'penci_liveblog_share_fsize',
'type' => 'soledad-fw-size',
'ids' => [
'desktop' => 'penci_liveblog_share_fsize',
'mobile' => 'penci_liveblog_share_mfsize',
],
'choices' => array(
'desktop' => array(
'min' => 1,
'max' => 500,
'step' => 1,
'edit' => true,
'unit' => 'px',
),
'mobile' => array(
'min' => 1,
'max' => 500,
'step' => 1,
'edit' => true,
'unit' => 'px',
),
),
);
return $options; inc/metabox.php 0000644 00000014736 14760037716 0007513 0 ustar 00 ID, PENCI_LB_STATUS_KEY, true );
?>
To display the live event update on this post, please use the following shortcode: [penci_liveblog] If you do not need this feature, please go
to Plugins > Installed Plugins > and deactivate the "Penci Live Blog" plugin
>
>
>
ID, PENCI_LB_META_KEY, true );
if ( ! empty( $all_live_events ) ) {
foreach ( $all_live_events as $number => $event ) {
if ( ! empty( $event ) && isset( $event['time'] ) && isset( $event['title'] ) && isset( $event['content'] ) ) {
?>
' +
time +
' ' +
title.val() +
'
' +
content +
'
';
if ( classic_content ){
$('#pcliveblog_update').val('');
} else {
tinymce.get( 'pcliveblog_update' ).setContent( '' );
}
utime.val( '' );
title.val( '' );
$.post( penciliveblog.url, data_event, function( response ) {
var res_id = response.data.time,
timeformat = response.data.time_format;
if ( !itemid ) {
livwrapper.append(
'' + html + '
' );
livwrapper.find( '.item-' + res_id + ' .date span' ).
html( timeformat.replace(/\\/gi, '' ) );
} else {
livwrapper.find( '.live-events-listing-item.item-' + itemid ).
html( html );
}
} );
$( 'body' ).trigger('pcliveblog_reset');
}
} );
$( document ).on( 'click', '.pcliveblog-event-delete', function( e ) {
e.preventDefault();
var t = $( this ),
id = t.closest( '.live-events-listing-item' ).attr( 'data-item' ),
pid = t.closest( '.live-events-listing' ).attr( 'data-event-id' );
$.ajax( {
type: 'get',
url: penciliveblog.url,
data: {
action: 'penci_liveblog_delete_content',
itemid: id,
id: pid,
nonce: penciliveblog.nonce,
time: Date.now(),
},
success: function( data ) {
t.closest( '.live-events-listing-item' ).remove();
},
} );
} );
$( document ).on( 'click', '.pcliveblog-event-edit', function( e ) {
e.preventDefault();
var t = $( this ),
wrapper = t.closest( '.live-events-listing-item' ),
item_id = wrapper.attr( 'data-item' ),
editor = $( '.live-events-new' ),
date = wrapper.find( '.date span' ).text(),
title = wrapper.find( '.post-title span' ).text(),
content = wrapper.find( '.post-entry' ).html();
editor.find( 'a.pcliveblog-addnew' ).
attr( 'data-item-id', item_id ).
html( penciliveblog.update );
editor.find( '.pcliveblog-reset' ).css( 'display', 'inline-block' );
editor.find( '.pcliveblog_update_time' ).val( date );
editor.find( '.pcliveblog_update_title' ).val( title );
tinymce.get( 'pcliveblog_update' ).setContent( content );
} );
$( document ).on( 'click', '.pcliveblog-reset', function( e ) {
e.preventDefault();
$( 'body' ).trigger('pcliveblog_reset');
} );
$( 'body' ).on( 'pcliveblog_reset', function( e ) {
var editor = $( '.live-events-new' );
editor.find( '.pcliveblog_update_time' ).val( '' );
editor.find( '.pcliveblog_update_title' ).val( '' );
if ( $('#pcliveblog_update').val() ) {
$('#pcliveblog_update').val('');
} else {
tinymce.get( 'pcliveblog_update' ).setContent( '' );
}
editor.find( 'a.pcliveblog-addnew' ).
attr( 'data-item-id', '' ).
html( 'Add new Update' );
editor.find( '.pcliveblog-reset' ).css( 'display', 'none' );
} );
$( document ).on( 'change', '#pcliveblog_enable', function( e ) {
e.preventDefault();
var t = $( this ),
v = t.val();
$.ajax( {
type: 'get',
url: penciliveblog.url,
data: {
action: 'penci_liveblog_update_status',
id: t.attr( 'data-event-id' ),
value: v,
nonce: penciliveblog.nonce,
},
success: function( data ) {
t.after(
'Updated ' );
setInterval( function() {
$( '.pcliveblog-notice' ).remove();
}, 3000 );
},
} );
} );
} ); js/liveblog-front.js 0000644 00000013536 14760037716 0010472 0 ustar 00 ;;;jQuery( document ).ready( function( $ ) {
$( '.pcliveblog-wrapper' ).each( function() {
var t = $( this ),
wrapper = t.find( '.pcliveblog-wrapper-listing' ),
id = t.attr( 'data-id' ),
timeout = penciliveblog.timeout,
check = t.find( '#_wpnonce' ).val(),
html = '',
timeleft = timeout / 1000;
btn = t.find( '.pcliveblog-wrapper-button-action' );
var count = timeleft;
var counter = null;
// reset count and timer
function reset_timer() {
clearInterval( counter );
count = timeleft;
counter = setInterval( timer, 1000 ); //1000 will run it every 1 second
}
// init timer for first time
reset_timer();
function timer() {
count --;
if ( count <= 0 ) {
clearInterval( counter );
setTimeout( reset_timer, 0 );
return;
}
$( '.pcliveblog-count' ).html( count );
}
var pgetedit = function( $time ) {
t.attr( 'data-update-time', $time );
$.ajax( {
type: 'get',
url: ajax_var_more.url,
data: {
action: 'penci_liveblog_get_update_content',
id: id,
get: $time,
nonce: check,
},
success: function( data ) {
if ( data.data.action == 'edited' && data.data.time &&
data.data.content && data.data.title && data.data.id ) {
html = '\n' + ' ' +
data.data.time + ' \n' + '
\n' +
' ' +
data.data.title + '
\n' +
' ' +
data.data.content + '
';
wrapper.find( '#pc-live-item-' + data.data.id ).html( html );
if ( !penciliveblog.disable_share ) {
wrapper.find( '#pc-live-item-' + data.data.id ).
append( data.data.share );
}
} else if ( data.data.action == 'delete' && data.data.id ) {
wrapper.find( '#pc-live-item-' + data.data.id ).remove();
}
},
} );
};
var pupdate = function() {
$.ajax( {
type: 'get',
url: penciliveblog.url,
data: {
action: 'penci_liveblog_get_content',
current: parseInt( t.attr( 'data-current-live' ) ),
id: id,
nonce: check,
time: Date.now(),
},
success: function( data ) {
if ( data.data.time && data.data.content && data.data.title &&
data.data.id ) {
var ori_title = document.title,
ptime = data.data.time;
html = '\n' +
'
\n' + ' ' +
ptime + ' \n' + '
\n' +
'
' +
data.data.title + '
\n' +
'
' +
data.data.content + '
\n' + '
';
wrapper.prepend( html );
if ( !penciliveblog.disable_share ) {
wrapper.find( '#pc-live-item-' + data.data.id ).
append( data.data.share );
}
t.attr( 'data-current-live', data.data.item );
if ( penciliveblog.tab ) {
document.title = penciliveblog.update + ' - ' + ori_title;
setInterval( function() {
document.title = ori_title;
}, timeout );
}
}
if ( data.data.update && (
parseInt( data.data.update ) >
parseInt( t.attr( 'data-update-time' ) )
) ) {
pgetedit( data.data.update );
}
$( 'body' ).trigger( 'pclive_apply_ads' );
},
} );
setInterval( function() {
btn.removeClass( 'loading' );
}, 300 );
};
setInterval( pupdate, timeout );
$( document ).
on( 'click', '.pcliveblog-wrapper-button-action', function( e ) {
e.preventDefault();
$( this ).addClass( 'loading' );
pupdate();
reset_timer();
} );
$( 'body' ).on( 'pclive_apply_ads', function( e ) {
var ads_num = parseInt( penciliveblog.ads_num ),
ads_code = penciliveblog.ads_code,
wrapper = $( '.pcliveblog-wrapper-listing' ),
total = parseInt( wrapper.find( '.pcliveblog-listing-item' ).length );
if ( total % ads_num === 1 ) {
wrapper.find( '.pcliveblog-listing-item:first-child' ).after(
'' + ads_code + '
' );
}
} );
$( document ).on( 'click', '.penci-copy-link', function( e ) {
e.preventDefault();
var link = $( this ).attr( 'href' );
navigator.clipboard.writeText( link );
$( this ).
after( '' +
penciliveblog.event_copies + ' ' );
setInterval( function() {
$( '.penci-copy-link-notice' ).remove();
}, 1000 );
} );
if ( window.location.hash ) {
var path = window.location.hash;
if ( path.startsWith( '#pc-live-item' ) ) {
var offset = - 120,
hash = window.location.hash.substring( 1 );
if ( !hash ) {
return;
}
var sel = '[id="' + hash + '"]';
var currentOffset = $( sel ).offset().top;
// smooth scroll to the anchor id
$( 'html, body' ).animate( {
scrollTop: (
currentOffset + offset
) + 'px',
}, 1000, 'swing' );
}
}
} );
} ); languages/en.po 0000644 00000013022 14760037716 0007465 0 ustar 00 msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2023-09-07 21:07+0700\n"
"PO-Revision-Date: 2023-09-07 21:07+0700\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.2.2\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-KeywordsList: _e;__;esc_html__;esc__\n"
"X-Poedit-SearchPath-0: .\n"
#: customizer/panel.php:23 penci-liveblog.php:43
msgid "Live Blog"
msgstr ""
#: customizer/panel.php:29 penci-liveblog.php:46
msgid "General"
msgstr ""
#: customizer/panel.php:30 penci-liveblog.php:47
msgid "Font Size & Colors"
msgstr ""
#: customizer/panel.php:31 penci-liveblog.php:48
msgid "Text Translations"
msgstr ""
#: customizer/penci_liveblog_general_section.php:7
msgid "General Option"
msgstr ""
#: customizer/penci_liveblog_general_section.php:15
msgid "Auto Get New Content After:"
msgstr ""
#: customizer/penci_liveblog_general_section.php:16
msgid "Enter the timeout in the seconds."
msgstr ""
#: customizer/penci_liveblog_general_section.php:23
msgid "Custom Data/Time Format"
msgstr ""
#: customizer/penci_liveblog_general_section.php:24
msgid ""
"Please fill in the datetime format string for this field - you can find more "
"information here "
msgstr ""
#: customizer/penci_liveblog_general_section.php:32
msgid "Disable Event Social Share"
msgstr ""
#: customizer/penci_liveblog_general_section.php:40
msgid "Hide Event Message Notice"
msgstr ""
#: customizer/penci_liveblog_general_section.php:48
msgid "Changing Browser Tab Title after Receiving a New Update?"
msgstr ""
#: customizer/penci_liveblog_general_section.php:56
msgid "Add \"Live\" Label Highlight to Post Title"
msgstr ""
#: customizer/penci_liveblog_general_section.php:65
msgid "Before Post Title"
msgstr ""
#: customizer/penci_liveblog_general_section.php:66
msgid "After Post Title"
msgstr ""
#: customizer/penci_liveblog_general_section.php:68
msgid "Live Label Position"
msgstr ""
#: customizer/penci_liveblog_general_section.php:76
msgid "Hide Update Now Section"
msgstr ""
#: customizer/penci_liveblog_general_section.php:80
msgid "In-Feed Ads"
msgstr ""
#: customizer/penci_liveblog_general_section.php:86
msgid "Insert In-feed Ads Code After Every How Many Events?"
msgstr ""
#: customizer/penci_liveblog_general_section.php:106
msgid "In-feed Ads Code/HTML"
msgstr ""
#: customizer/penci_liveblog_general_section.php:107
msgid ""
"Please use normal responsive ads here to get the best results. In-feed ads "
"cannot work with auto-ads because auto-ads will randomly place your ads in "
"random places on the pages."
msgstr ""
#: customizer/penci_liveblog_styles_section.php:6
msgid "Colors"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:13
msgid "Date/Time Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:21
msgid "Title Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:29
msgid "Content Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:37
msgid "Content Link Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:45
msgid "Content Link Hover Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:53
msgid "Social Share Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:61
msgid "Social Share Hover Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:69
msgid "Event Border Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:77
msgid "Top Status Background Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:85
msgid "Top Status Text Color"
msgstr ""
#: customizer/penci_liveblog_styles_section.php:92
msgid "Font Sizes"
msgstr ""
#: customizer/penci_liveblog_translations_section.php:9
msgid "Text: "
msgstr ""
#: inc/metabox.php:23
msgid "Live Blog Events"
msgstr ""
#: inc/metabox.php:48
msgid "Event Status"
msgstr ""
#: inc/metabox.php:55
msgid ""
"Please remember to select the \"the event has ended\" option when the live "
"event ends."
msgstr ""
#: inc/metabox.php:85
msgid "Edit"
msgstr ""
#: inc/metabox.php:87
msgid "Delete"
msgstr ""
#: inc/metabox.php:98
msgid "Custom Update Time"
msgstr ""
#: inc/metabox.php:99
msgid "If you leave it empty it will be showing the real time"
msgstr ""
#: inc/metabox.php:104
msgid "Title of Update"
msgstr ""
#: inc/metabox.php:110
msgid "Content of Update"
msgstr ""
#: inc/metabox.php:119
msgid "Add new Update"
msgstr ""
#: penci-liveblog.php:233 penci-liveblog.php:281
msgid "No update"
msgstr ""
#: penci-liveblog.php:427
msgid "Facebook"
msgstr ""
#: penci-liveblog.php:428
msgid "Twitter"
msgstr ""
#: penci-liveblog.php:460
msgid "Live"
msgstr ""
#: penci-liveblog.php:461
msgid "Live Updates"
msgstr ""
#: penci-liveblog.php:462
msgid "This event has ended."
msgstr ""
#: penci-liveblog.php:463
msgid "Update Now"
msgstr ""
#: penci-liveblog.php:464
msgid "The content will auto-update after {{value}} seconds"
msgstr ""
#: penci-liveblog.php:465
msgid "Copy Link"
msgstr ""
#: penci-liveblog.php:466
msgid "Copied!"
msgstr ""
#: penci-liveblog.php:467
msgid "New Update"
msgstr ""
#: penci-liveblog.php:468
msgid "Newest"
msgstr ""
#: penci-liveblog.php:469
msgid "Oldest"
msgstr ""
#: penci-liveblog.php:470
msgid "Update"
msgstr ""
#: penci-liveblog.php:471
msgid "Cancel"
msgstr ""
#: penci-liveblog.php:472
msgid "Share on Facebook"
msgstr ""
#: penci-liveblog.php:473
msgid "Share on Twitter"
msgstr ""
languages/en.mo 0000644 00000000641 14760037716 0007465 0 ustar 00 Þ• $ , 8 g 9 Project-Id-Version:
PO-Revision-Date: 2023-09-07 21:07+0700
Last-Translator:
Language-Team:
Language: en
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n != 1);
X-Generator: Poedit 3.2.2
X-Poedit-Basepath: .
X-Poedit-KeywordsList: _e;__;esc_html__;esc__
X-Poedit-SearchPath-0: .
penci-liveblog.php 0000644 00000052657 14760037716 0010206 0 ustar 00 30,
'path' => plugin_dir_path( __FILE__ ) . '/customizer/',
'panel' => array(
'title' => esc_html__( 'Live Blog', 'soledad' ),
'icon' => 'fas fa-record-vinyl',
),
'penci_liveblog_general_section' => array( 'title' => esc_html__( 'General', 'penci-liveblog' ) ),
'penci_liveblog_styles_section' => array( 'title' => esc_html__( 'Font Size & Colors', 'penci-liveblog' ) ),
'penci_liveblog_translations_section' => array( 'title' => esc_html__( 'Text Translations', 'penci-liveblog' ) ),
);
return $options;
}
);
require 'inc/metabox.php';
if ( ! function_exists( 'penci_load_admin_metabox_liveblog_style' ) ) {
function penci_load_admin_metabox_liveblog_style() {
$screen = get_current_screen();
if ( $screen->id == 'post' ) {
$localize_script = array(
'url' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'penci_liveblog_update_content' ),
'timeout' => (int) get_theme_mod( 'penci_liveblog_timeout', 60 ) * 1000,
'update' => penci_livesub_text( 'event_update' ),
'cancel' => penci_livesub_text( 'event_cancel' ),
);
wp_enqueue_style( 'penciliveblog_box_review_styles', plugin_dir_url( __FILE__ ) . 'css/admin-css.css', '', PENCI_LB_VERSION );
wp_enqueue_script(
'penciliveblog_js',
plugin_dir_url( __FILE__ ) . 'js/liveblog.js',
array(
'jquery',
'jquery-ui-datepicker',
),
PENCI_LB_VERSION,
true
);
wp_localize_script( 'penciliveblog_js', 'penciliveblog', $localize_script );
}
}
add_action( 'admin_enqueue_scripts', 'penci_load_admin_metabox_liveblog_style' );
}
if ( ! function_exists( 'penci_liveblog_register_assets' ) ) {
function penci_liveblog_register_assets() {
$localize_script = array(
'url' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'penci_liveblog_update_content' ),
'tab' => (bool) get_theme_mod( 'penci_liveblog_change_page_title' ),
'timeout' => (int) get_theme_mod( 'penci_liveblog_timeout', 60 ) * 1000,
'ads_num' => (int) get_theme_mod( 'penci_liveblog_infeedads_num', 3 ),
'ads_code' => get_theme_mod( 'penci_liveblog_infeedads_code' ),
'event_copies' => penci_livesub_text( 'event_copies' ),
'disable_share' => (bool) get_theme_mod( 'penci_liveblog_share' ),
);
wp_enqueue_style( 'penci-liveblog', plugin_dir_url( __FILE__ ) . 'css/liveblog.css', '', PENCI_LB_VERSION );
wp_enqueue_script( 'penci-liveblog', plugin_dir_url( __FILE__ ) . 'js/liveblog-front.js', array( 'jquery' ), PENCI_LB_VERSION, true );
wp_localize_script( 'penci-liveblog', 'penciliveblog', $localize_script );
}
add_action( 'wp_enqueue_scripts', 'penci_liveblog_register_assets' );
}
/* Add new item */
add_action( 'wp_ajax_penci_liveblog_update_content', 'penci_liveblog_update_content' );
if ( ! function_exists( 'penci_liveblog_update_content' ) ) {
function penci_liveblog_update_content() {
wp_verify_nonce( $_REQUEST['nonce'], 'penci_liveblog_update_content' );
$post_id = $_REQUEST['id'];
$item_id = isset( $_REQUEST['iid'] ) && $_REQUEST['iid'] ? $_REQUEST['iid'] : '';
$meta_time = isset( $_REQUEST['update'] ) && $_REQUEST['update'] ? $_REQUEST['update'] : current_time( 'timestamp' );
$meta_content = $_REQUEST['content'];
$meta_title = $_REQUEST['title'];
$utime = current_time( 'timestamp' );
$all_live_events = get_post_meta( $post_id, PENCI_LB_META_KEY, true );
$all_live_events = ! empty( $all_live_events ) ? $all_live_events : array();
$update_content = array(
'time' => $meta_time,
'title' => $meta_title,
'content' => $meta_content,
);
if ( $item_id ) {
$all_live_events[ $item_id ] = $update_content;
$all_live_events['update'] = $utime;
$all_live_events['update_log'][ $utime ] = array( 'edited' => $item_id );
} else {
$all_live_events[ $utime ] = $update_content;
}
if ( update_post_meta( $post_id, PENCI_LB_META_KEY, $all_live_events ) ) {
wp_cache_delete( $post_id, 'post_meta' );
wp_send_json_success(
array(
'time' => $utime,
'time_format' => pclive_blog_time_format( $meta_time ),
)
);
} else {
wp_send_json_error( 'error' );
}
}
}
/* Delete item */
add_action( 'wp_ajax_penci_liveblog_delete_content', 'penci_liveblog_delete_content' );
if ( ! function_exists( 'penci_liveblog_delete_content' ) ) {
function penci_liveblog_delete_content() {
wp_verify_nonce( $_REQUEST['nonce'], 'penci_liveblog_update_content' );
$post_id = $_REQUEST['id'];
$item_id = $_REQUEST['itemid'];
$utime = $_REQUEST['time'];
$all_live_events = get_post_meta( $post_id, PENCI_LB_META_KEY, true );
$all_live_events[ $item_id ] = array();
$all_live_events['update'] = $utime;
$all_live_events['update_log'][ $utime ] = array( 'delete' => $item_id );
if ( update_post_meta( $post_id, PENCI_LB_META_KEY, $all_live_events ) ) {
wp_cache_delete( $post_id, 'post_meta' );
wp_send_json_success(
array(
'time' => $utime,
'time_format' => pclive_blog_time_format( $utime ),
)
);
} else {
wp_send_json_error( 'error' );
}
}
}
// update status
add_action( 'wp_ajax_penci_liveblog_update_status', 'penci_liveblog_update_status' );
if ( ! function_exists( 'penci_liveblog_update_status' ) ) {
function penci_liveblog_update_status() {
wp_verify_nonce( $_REQUEST['nonce'], 'penci_liveblog_update_content' );
$post_id = $_REQUEST['id'];
$value = $_REQUEST['value'];
if ( update_post_meta( $post_id, PENCI_LB_STATUS_KEY, $value ) ) {
wp_send_json_success( 'done' );
} else {
wp_send_json_error( 'error' );
}
}
}
add_action( 'wp_ajax_penci_liveblog_get_content', 'penci_liveblog_get_content' );
add_action( 'wp_ajax_nopriv_penci_liveblog_get_content', 'penci_liveblog_get_content' );
if ( ! function_exists( 'penci_liveblog_get_content' ) ) {
function penci_liveblog_get_content() {
wp_verify_nonce( $_REQUEST['nonce'], 'penci_liveblog_get_content' );
$post_id = $_REQUEST['id'];
$current = isset( $_REQUEST['current'] ) && $_REQUEST['current'] ? (int) $_REQUEST['current'] : 1;
$all_live_events = pclive_blog_get_meta( $post_id, PENCI_LB_META_KEY );
$total_current_live = count( $all_live_events );
if ( ! empty( $all_live_events ) && $total_current_live > $current ) {
$new_live_item = end( $all_live_events );
$item_id = array_key_last( $all_live_events );
wp_send_json_success(
array(
'time' => pclive_blog_time_format( $new_live_item['time'] ),
'title' => $new_live_item['title'],
'content' => $new_live_item['content'],
'item' => $current + 1,
'id' => $item_id,
'update' => isset( $all_live_events['update'] ) ? $all_live_events['update'] : '',
'share' => pclive_share_url( $item_id, $post_id, $new_live_item['title'], $new_live_item['content'] ),
)
);
} else {
wp_send_json_success(
array(
'message' => __( 'No update', 'penci-liveblog' ),
'update' => isset( $all_live_events['update'] ) ? $all_live_events['update'] : '',
),
);
}
}
}
// Get edited/deleted item
add_action( 'wp_ajax_penci_liveblog_get_update_content', 'penci_liveblog_get_update_content' );
add_action( 'wp_ajax_nopriv_penci_liveblog_get_update_content', 'penci_liveblog_get_update_content' );
if ( ! function_exists( 'penci_liveblog_get_update_content' ) ) {
function penci_liveblog_get_update_content() {
wp_verify_nonce( $_REQUEST['nonce'], 'penci_liveblog_get_content' );
$post_id = $_REQUEST['id'];
$time = isset( $_REQUEST['get'] ) && $_REQUEST['get'] ? (int) $_REQUEST['get'] : '';
$all_live_events = pclive_blog_get_meta( $post_id, PENCI_LB_META_KEY );
$update_time = isset( $all_live_events['update'] ) ? $all_live_events['update'] : '';
if ( $time && isset( $all_live_events['update_log'][ $time ] ) && $all_live_events['update_log'][ $time ] ) {
foreach ( $all_live_events['update_log'][ $time ] as $type => $id ) {
if ( 'edited' == $type ) {
wp_send_json_success(
array(
'action' => 'edited',
'time' => pclive_blog_time_format( $all_live_events[ $id ]['time'] ),
'title' => $all_live_events[ $id ]['title'],
'content' => $all_live_events[ $id ]['content'],
'id' => $id,
'update' => $update_time,
'share' => pclive_share_url( $id, $post_id, $all_live_events[ $id ]['title'], $all_live_events[ $id ]['content'] ),
)
);
} else {
wp_send_json_success(
array(
'action' => 'delete',
'id' => $id,
'update' => $update_time,
)
);
}
}
} else {
wp_send_json_success(
array(
'message' => __( 'No update', 'penci-liveblog' ),
'update' => $update_time,
),
);
}
}
}
if ( ! function_exists( 'penci_liveblog_shortcode_content' ) ) {
add_shortcode( 'penci_liveblog', 'penci_liveblog_shortcode_content' );
function penci_liveblog_shortcode_content( $atts, $content = null ) {
extract(
shortcode_atts(
array(
'id' => '',
),
$atts
)
);
$post_id = get_the_ID();
if ( ! empty( $id ) && is_numeric( $id ) ) {
$post_id = $id;
}
$status = get_post_meta( $post_id, PENCI_LB_STATUS_KEY, true );
if ( ! $status ) {
return;
}
ob_start();
if ( ! get_theme_mod( 'penci_liveblog_notice' ) ) {
?>
%s', penci_livesub_text( 'event_update_notice' ) );
printf( $translate_text, '60' );
?>
$event ) {
if ( ! empty( $event ) && isset( $event['time'] ) && isset( $event['title'] ) && isset( $event['content'] ) ) {
if ( $ads_code && ( $items_number % $ads_loop == 1 ) ) {
echo '
' . $ads_code . '
';
}
?>
';
$out .= '' . penci_icon_by_ver( 'fab fa-facebook-f', '', true ) . ' ' . __( 'Facebook', 'penci-liveblog' ) . ' ';
$out .= '' . penci_icon_by_ver( 'penciicon-x-twitter', '', true ) . ' ' . __( 'Twitter', 'penci-liveblog' ) . ' ';
$out .= '' . penci_livesub_text( 'event_copy_link' ) . ' ';
$out .= '';
return $out;
}
}
if ( ! function_exists( 'pclive_blog_get_meta' ) ) {
function pclive_blog_get_meta( $object_id, $meta_key ) {
global $wpdb;
$table = _get_meta_table( 'post' );
$meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM $table WHERE meta_key = %s AND post_id = %d", $meta_key, $object_id ) );
return isset( $meta_ids[0] ) && $meta_ids[0] ? maybe_unserialize( $meta_ids[0] ) : '';
}
}
if ( ! function_exists( 'pclive_blog_time_format' ) ) {
function pclive_blog_time_format( $time ) {
$time_format = get_theme_mod( 'penci_liveblog_time_format' ) ? get_theme_mod( 'penci_liveblog_time_format' ) : get_option( 'date_format' );
if ( is_numeric( $time ) ) {
$time = date_i18n( $time_format, $time );
}
return $time;
}
}
if ( ! function_exists( 'penci_livesub_text' ) ) {
function penci_livesub_text( $text = '' ) {
$texts = array(
'event_live' => __( 'Live', 'penci-liveblog' ),
'event_live_notice' => __( 'Live Updates', 'penci-liveblog' ),
'event_end_notice' => __( 'This event has ended.', 'penci-liveblog' ),
'event_update_now' => __( 'Update Now', 'penci-liveblog' ),
'event_update_notice' => __( 'The content will auto-update after {{value}} seconds', 'penci-liveblog' ),
'event_copy_link' => __( 'Copy Link', 'penci-liveblog' ),
'event_copies' => __( 'Copied!', 'penci-liveblog' ),
'event_title_new' => __( 'New Update', 'penci-liveblog' ),
'event_newest' => __( 'Newest', 'penci-liveblog' ),
'event_oldest' => __( 'Oldest', 'penci-liveblog' ),
'event_update' => __( 'Update', 'penci-liveblog' ),
'event_cancel' => __( 'Cancel', 'penci-liveblog' ),
'event_share_fb' => __( 'Share on Facebook', 'penci-liveblog' ),
'event_share_tw' => __( 'Share on Twitter', 'penci-liveblog' ),
);
if ( $text ) {
return do_shortcode( get_theme_mod( 'pclb_trans_' . $text ) ? get_theme_mod( 'pclb_trans_' . $text ) : $texts[ $text ] );
} else {
return $texts;
}
}
}
add_filter(
'the_title',
function ( $post_title, $post_id ) {
if ( get_theme_mod( 'penci_liveblog_post_prefix', true ) && get_post_meta( $post_id, PENCI_LB_STATUS_KEY, true ) == 'enable' && ! is_admin() ) {
if ( 'before' == get_theme_mod( 'penci_liveblog_post_prefix_position', 'before' ) ) {
$post_title = ' ' . $post_title;
} else {
$post_title = $post_title . ' ';
}
}
return $post_title;
},
10,
2
);
add_filter(
'wp_trim_words',
function ( $text, $num_words, $more, $original_text ) {
$post_id = get_the_ID();
$post_title = wp_strip_all_tags( get_the_title() );
$original_text = wp_strip_all_tags( $original_text );
if ( $post_title == $original_text ) {
if ( get_theme_mod( 'penci_liveblog_post_prefix', true ) && get_post_meta( $post_id, PENCI_LB_STATUS_KEY, true ) == 'enable' && ! is_admin() ) {
if ( 'before' == get_theme_mod( 'penci_liveblog_post_prefix_position', 'before' ) ) {
$text = ' ' . $text;
} else {
$text = $text . ' ';
}
}
}
return $text;
},
10,
4
);
add_action(
'soledad_theme/custom_css',
function () {
$mods = array(
'pencilb_date_color' => '.pcliveblog-listing-item .pcliveblog-date{color:{{VALUE}}}',
'pencilb_title_color' => '.pcliveblog-listing-item .pcliveblog-title{color:{{VALUE}}}',
'pencilb_content_color' => '.pcliveblog-listing-item .pcliveblog-content,.pcliveblog-listing-item .pcliveblog-content p{color:{{VALUE}}}',
'pencilb_content_link_color' => '.pcliveblog-listing-item .pcliveblog-content a{color:{{VALUE}}}',
'pencilb_content_link_hcolor' => '.pcliveblog-listing-item .pcliveblog-content a:hover{color:{{VALUE}}}',
'pencilb_share_color' => '.pcliveblog-item-share .pclb-sitem, .post-entry .pcliveblog-item-share .pclb-sitem{color:{{VALUE}}}',
'pencilb_share_hcolor' => '.pcliveblog-item-share .pclb-sitem:hover, .post-entry .pcliveblog-item-share .pclb-sitem:hover{color:{{VALUE}}}',
'pencilb_event_bcolor' => '.pcliveblog-wrapper .pcliveblog-listing-item{border-color:{{VALUE}}}',
'pencilb_top_status_bgcolor' => '.pcliveblog-wrapper .pcliveblog-wrapper-status{background-color:{{VALUE}}}',
'pencilb_top_status_txtcolor' => '.pcliveblog-wrapper .pcliveblog-wrapper-status,.post-entry .pcliveblog-wrapper .pcliveblog-wrapper-status a, .pcliveblog-wrapper .pcliveblog-wrapper-status a{color:{{VALUE}}}',
'penci_liveblog_date_fsize' => '.pcliveblog-listing-item .pcliveblog-date{font-size:{{VALUE}}px}',
'penci_liveblog_title_fsize' => '.pcliveblog-listing-item .pcliveblog-title{font-size:{{VALUE}}px}',
'penci_liveblog_content_fsize' => '.pcliveblog-listing-item .pcliveblog-content,.pcliveblog-listing-item .pcliveblog-content p{font-size:{{VALUE}}px}',
'penci_liveblog_share_fsize' => '.pcliveblog-listing-item .pcliveblog-item-share .pclb-sitem{font-size:{{VALUE}}px}',
);
$out = '';
foreach ( $mods as $mod => $prop ) {
$value = get_theme_mod( $mod );
$mobile_value = '';
if ( strpos( $mod, 'fsize' ) !== false ) {
$mobile_value = get_theme_mod( str_replace( 'fsize', 'mfsize', $mod ) );
}
if ( $value ) {
$out .= str_replace( '{{VALUE}}', $value, $prop );
}
if ( $mobile_value ) {
$out .= '@media only screen and (max-width: 767px){' . str_replace( '{{VALUE}}', $mobile_value, $prop ) . '}';
}
}
echo $out;
}
);
add_action(
'plugins_loaded',
function () {
load_plugin_textdomain( 'penci-liveblog', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
);