Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/flow-flo.../includes/tabs
File: FFStreamsTab.php
<?php namespace flow\tabs;
[0] Fix | Delete
[1] Fix | Delete
use la\core\tabs\LATab;
[2] Fix | Delete
[3] Fix | Delete
if ( ! defined( 'WPINC' ) ) die;
[4] Fix | Delete
/**
[5] Fix | Delete
* FlowFlow.
[6] Fix | Delete
*
[7] Fix | Delete
* @package FlowFlow
[8] Fix | Delete
* @author Looks Awesome <email@looks-awesome.com>
[9] Fix | Delete
*
[10] Fix | Delete
* @link http://looks-awesome.com
[11] Fix | Delete
* @copyright Looks Awesome
[12] Fix | Delete
*/
[13] Fix | Delete
[14] Fix | Delete
class FFStreamsTab implements LATab{
[15] Fix | Delete
public function __construct() {
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
public function id() {
[19] Fix | Delete
return 'streams-tab';
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
public function flaticon() {
[23] Fix | Delete
return 'flaticon-ctrl-left';
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
public function title() {
[27] Fix | Delete
return 'Streams';
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
public function includeOnce( $context ) {
[31] Fix | Delete
$arr = $context['streams'];
[32] Fix | Delete
[33] Fix | Delete
$plugins_url = plugins_url() . '/' . 'flow-flow';
[34] Fix | Delete
[35] Fix | Delete
$export = [];
[36] Fix | Delete
foreach ($arr as $stream) {
[37] Fix | Delete
[38] Fix | Delete
$item = [];
[39] Fix | Delete
[40] Fix | Delete
foreach ($stream as $key => $value) {
[41] Fix | Delete
if ($key !== 'value') {
[42] Fix | Delete
if ($key === 'error') {
[43] Fix | Delete
$item['error'] = true;
[44] Fix | Delete
} else {
[45] Fix | Delete
if ($key === 'css') {
[46] Fix | Delete
$value = str_replace('"', "'", $value);
[47] Fix | Delete
}
[48] Fix | Delete
$item[$key] = $value;
[49] Fix | Delete
}
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
$export[] = $item;
[54] Fix | Delete
}
[55] Fix | Delete
// debug
[56] Fix | Delete
// $export[0]['css'] = '';
[57] Fix | Delete
// $export[0]['heading'] = '';
[58] Fix | Delete
?>
[59] Fix | Delete
<script>
[60] Fix | Delete
var streams = <?php echo json_encode($export, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); ?>;
[61] Fix | Delete
</script>
[62] Fix | Delete
<div class="section-content" id="streams-cont" data-tab="streams-tab">
[63] Fix | Delete
<div class="section-stream" id="streams-list" data-view-mode="streams-list">
[64] Fix | Delete
<div class="section" id="streams-list-section">
[65] Fix | Delete
<h1 class="desc-following contains-button"><span>List of your streams</span> <span class="admin-button green-button button-add">create stream</span></h1>
[66] Fix | Delete
<div id="how-it-works"><a href="#" class="ff-pseudo-link">Quick guide</a></div>
[67] Fix | Delete
<p class="desc">Streams are containers for <a class="ff-pseudo-link" href="#sources-tab">feeds</a> you created. You decide which social feeds you add to or remove from container and how it looks on site pages. Stream status (green or red) shows if any of connected feeds have error. <a href="#" class="ff-pseudo-link tutorial-link">Show me quick tutorial</a></p>
[68] Fix | Delete
<table>
[69] Fix | Delete
<thead>
[70] Fix | Delete
<tr>
[71] Fix | Delete
<th></th>
[72] Fix | Delete
<th></th>
[73] Fix | Delete
<th>Stream</th>
[74] Fix | Delete
<th class="th-hint">Host Type <span class="desc hint-block">
[75] Fix | Delete
<span class="hint-link"><img src="<?php echo $plugins_url ?>/assets/info_icon.svg"></span>
[76] Fix | Delete
<span class="hint hint-pro">
[77] Fix | Delete
<h3>Self-Hosted</h3>
[78] Fix | Delete
<p class="shortcode-pages">Regular stream that's hosted on your site server. Feeds data is updated and stored also on your server.</p>
[79] Fix | Delete
<br/>
[80] Fix | Delete
<h3>Cloud</h3>
[81] Fix | Delete
<p class="shortcode-pages">Stream that contains <a target="_blank" href="https://social-streams.com/boosts/">boosted feeds</a>. All feeds data and updating routine will be hosted in cloud, and directly embedded on your site pages. It means zero load on your site server.</p>
[82] Fix | Delete
</span>
[83] Fix | Delete
</span></th>
[84] Fix | Delete
<th>Feeds</th>
[85] Fix | Delete
<?php
[86] Fix | Delete
if (FF_USE_WP) echo '<th>Shortcode</th>';
[87] Fix | Delete
else echo '<th>ID</th>';
[88] Fix | Delete
?>
[89] Fix | Delete
</tr>
[90] Fix | Delete
</thead>
[91] Fix | Delete
<tbody>
[92] Fix | Delete
<?php
[93] Fix | Delete
[94] Fix | Delete
foreach ($arr as $stream) {
[95] Fix | Delete
if (!isset($stream['id'])) continue;
[96] Fix | Delete
$id = $stream['id'];
[97] Fix | Delete
[98] Fix | Delete
$status = $stream['status'] == 1 ? 'ok' : 'error';
[99] Fix | Delete
$additionalInfo = FF_USE_WP ?
[100] Fix | Delete
'<td><span class="shortcode">[ff id="' . $id . '"]</span><span class="desc hint-block">
[101] Fix | Delete
<span class="hint-link"><img src="' . $plugins_url . '/assets/info_icon.svg"></span>
[102] Fix | Delete
<span class="hint hint-pro">
[103] Fix | Delete
<h3>Shortcode detected on pages:</h3>
[104] Fix | Delete
<p class="shortcode-pages"></p>
[105] Fix | Delete
</span>
[106] Fix | Delete
</span></td>' :
[107] Fix | Delete
'<td>' . $id . '</td>';
[108] Fix | Delete
[109] Fix | Delete
if (isset($_REQUEST['debug']) && isset($stream['error'])) {
[110] Fix | Delete
$additionalInfo .= $stream['error'];
[111] Fix | Delete
}
[112] Fix | Delete
$info = '';
[113] Fix | Delete
[114] Fix | Delete
if ( isset( $stream[ 'cloud' ] ) && $stream[ 'cloud' ] == 'yep' ) {
[115] Fix | Delete
$type = '<span class="stream-cloud-info"><span class="highlight hilite-boost"><i class="flaticon-cloud"></i></span> <span class="highlight">Cloud</span></span>';
[116] Fix | Delete
} else {
[117] Fix | Delete
$type = '<span class="highlight">Self-Hosted</span>'; // default
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
$boosted = 0;
[121] Fix | Delete
[122] Fix | Delete
if (isset($stream['feeds']) && !empty($stream['feeds'])) {
[123] Fix | Delete
$feeds = $stream['feeds'];
[124] Fix | Delete
if (is_array($feeds) || is_object($feeds)){
[125] Fix | Delete
foreach ( $feeds as $feed ) {
[126] Fix | Delete
$info = $info . '<i class="flaticon-' . $feed['type'] . '"></i>';
[127] Fix | Delete
if ( $feed['boosted'] === 'yep' ) $boosted++;
[128] Fix | Delete
}
[129] Fix | Delete
/*
[130] Fix | Delete
if ( $boosted === count( $feeds ) ) {
[131] Fix | Delete
$type = '<span class="stream-cloud-info"><span class="highlight hilite-boost"><i class="flaticon-cloud"></i></span> <span class="highlight">Cloud</span></span>';
[132] Fix | Delete
}
[133] Fix | Delete
*/
[134] Fix | Delete
}
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
echo
[138] Fix | Delete
'<tr data-stream-id="' . $id . '">
[139] Fix | Delete
<td class="controls"><div class="loader-wrapper"><div class="throbber-loader"></div></div><i class="flaticon-tool_edit"></i> <i class="flaticon-tool_clone"></i> <i class="flaticon-tool_delete"></i></td>
[140] Fix | Delete
<td><span class="cache-status-'. $status .'"></span></td>
[141] Fix | Delete
<td class="td-name">' . (!empty($stream['name']) ? stripslashes($stream['name']) : 'Unnamed') . '</td>
[142] Fix | Delete
<td class="td-type">' . ($type) . '</td>
[143] Fix | Delete
<td class="td-feed">' . (empty($info) ? '<span class="highlight-grey">No Feeds</span>' : $info) . '</td>'
[144] Fix | Delete
. $additionalInfo .
[145] Fix | Delete
'</tr>';
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
if (empty($arr)) {
[149] Fix | Delete
echo '<tr class="empty-row"><td class="empty-cell" colspan="6">Please add at least one stream</td></tr>';
[150] Fix | Delete
}
[151] Fix | Delete
[152] Fix | Delete
?>
[153] Fix | Delete
</tbody>
[154] Fix | Delete
</table>
[155] Fix | Delete
</div>
[156] Fix | Delete
<div class="popup streams-popup">
[157] Fix | Delete
<div class="section">
[158] Fix | Delete
<h1><span>Pick stream type</span></h1>
[159] Fix | Delete
[160] Fix | Delete
<div class="stream-type-picker">
[161] Fix | Delete
<div data-stream-type="self">
[162] Fix | Delete
<h3>Self-Hosted</h3>
[163] Fix | Delete
<p>Default type. Can contain only regular feeds. Your WordPress server requests and caches posts. App retrieves data from the site database to display feeds on pages. This is completely autonomous solution but depends on your server resources.</p>
[164] Fix | Delete
<span class="stream-btn-cta"><i class="flaticon-arrow-back-2"></i></span>
[165] Fix | Delete
</div>
[166] Fix | Delete
<div data-stream-type="cloud">
[167] Fix | Delete
<h3>Cloud</h3>
[168] Fix | Delete
<p>For feeds hosted in our cloud network. Can contain only <a href="#addons-tab" class="ff-pseudo-link" target="_blank">boosted feeds</a>. Posts data is cached and updated in cloud and stream is delivered directly from cloud to site pages thus offloads your WordPress website server completely. Exclusive features are upcoming for cloud streams soon.</p>
[169] Fix | Delete
<span class="stream-btn-cta"><i class="flaticon-arrow-back-2"></i></span>
[170] Fix | Delete
</div>
[171] Fix | Delete
</div>
[172] Fix | Delete
[173] Fix | Delete
</div>
[174] Fix | Delete
</div>
[175] Fix | Delete
[176] Fix | Delete
<div class="popup tutorial-popup">
[177] Fix | Delete
[178] Fix | Delete
<div class="section">
[179] Fix | Delete
<h1><span>How it works</span></h1>
[180] Fix | Delete
[181] Fix | Delete
<div class="popup-content-wrapper">
[182] Fix | Delete
<i class="popupclose flaticon-close-4"></i>
[183] Fix | Delete
<div class="timeline-element"></div>
[184] Fix | Delete
<div class="steps-box">
[185] Fix | Delete
<div class="steps-item steps-image steps-image-step-1"><img src="<?php echo $plugins_url ?>/assets/step1.png"></div>
[186] Fix | Delete
<div class="steps-item">
[187] Fix | Delete
<h3>01</h3>
[188] Fix | Delete
<h2>Create feed</h2>
[189] Fix | Delete
<p><strong>Feeds</strong> are data. Create feed of desired source on <a class="ff-pseudo-link" href="#sources-tab">Feeds tab</a>. Now you have posts data from this source loaded and cached in database. <a class="ff-pseudo-link" href="#addons-tab">Boost</a> the feed if you want to host it in the cloud and offload your server.</p>
[190] Fix | Delete
</div>
[191] Fix | Delete
<div class="steps-item">
[192] Fix | Delete
<h3>02</h3>
[193] Fix | Delete
<h2>Create stream</h2>
[194] Fix | Delete
<p><strong>Streams</strong> define how your feeds look. Create container (stream) for your feeds on <a class="ff-pseudo-link" href="#streams-tab">Streams tab</a>. Use plenty of settings to customize layout and look of the stream. Streams are two type: self-hosted and cloud. First for regular feeds, second for boosted.</p>
[195] Fix | Delete
</div>
[196] Fix | Delete
<div class="steps-item steps-image steps-image-step-2 steps-image-overflow"><img src="<?php echo $plugins_url ?>/assets/step2.png"></div>
[197] Fix | Delete
<div class="steps-item steps-image steps-image-step-3"><img src="<?php echo $plugins_url ?>/assets/step3.png"></div>
[198] Fix | Delete
<div class="steps-item">
[199] Fix | Delete
<h3>03</h3>
[200] Fix | Delete
<h2>Place on page</h2>
[201] Fix | Delete
<p>Time to display feeds on page. Copy stream code from <a class="ff-pseudo-link" href="#streams-tab">Streams tab</a>. Add it on page using page editor. Self-hosted streams will query feed data from your site database. Cloud streams will get data from the cloud directly.</p>
[202] Fix | Delete
</div>
[203] Fix | Delete
<div class="steps-item steps-item-last"><h2>That's it!</h2>
[204] Fix | Delete
<p><span class="tutorial-first-time">This message appears automatically only first time you visit admin page.<br></span>Tutorial can be found on Streams tab later.<br><br>
[205] Fix | Delete
<a class="ff-pseudo-link" href="#streams-tab">OK, close it</a></p></div>
[206] Fix | Delete
</div>
[207] Fix | Delete
</div>
[208] Fix | Delete
</div>
[209] Fix | Delete
</div>
[210] Fix | Delete
[211] Fix | Delete
<div class="section rating-promo">
[212] Fix | Delete
<div class="fb-wrapper"><div class="fb-page" data-href="https://www.facebook.com/SocialStreamApps/" data-small-header="true" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="false"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/SocialStreamApps/"><a href="https://www.facebook.com/SocialStreamApps/">Looks Awesome</a></blockquote></div></div></div>
[213] Fix | Delete
<h1 class="desc-following"><span>Help plugin to grow</span></h1>
[214] Fix | Delete
<p class="">A lot of users only think to review Flow-Flow when something goes wrong while many more people use it satisfactory. Don't let this go unnoticed. If you find Flow-Flow useful please leave your honest rating and review on plugins <a href="http://codecanyon.net/downloads" target="_blank">Downloads page</a> to help Flow-Flow grow and endorse its further development!</p>
[215] Fix | Delete
</div>
[216] Fix | Delete
</div>
[217] Fix | Delete
</div>
[218] Fix | Delete
<?php
[219] Fix | Delete
}
[220] Fix | Delete
}
[221] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function