'label' => 'Toolbox Files Table',
'type' => 'text'
),
+ array(
+ 'name' => 'toolbox_files_url',
+ 'label' => 'Toolbox Files URL',
+ 'type' => 'text'
+ ),
array(
'name' => 'ckeditor_schema',
'label' => 'CKEditor Schema',
if (!$this->_options['toolbox_files_table']) {
$errors[] = 'Toolbox Files Table';
}
+ if (!$this->_options['toolbox_files_url']) {
+ $errors[] = 'Toolbox Files URL';
+ }
return $errors;
}
//return false;
//}
//$fileUrl = wp_get_attachment_url($file_id);
- $fileUrl =$this->_options['toolbox_image_url'] . '/original/' . $data['filename'];
+ $fileUrl =$this->_options['toolbox_files_url'] . '/' . $data['filename'];
$fileName = ($data['urltext']) ? $data['urltext'] : $data['filename'];
return "\n".'<a href="'.$fileUrl.'">'.$fileName.'</a>';
}
$sql = "
SELECT *
FROM {$wpdb->prefix}posts
- WHERE post_content LIKE '%http://is0.gaslightmedia.com%'
+ WHERE post_content LIKE '%{$this->_options['toolbox_files_url']}%'
AND post_type = 'page'";
$sql .= " AND ID IN (" . implode(',', $currentPostArray) . ")";
$results = $wpdb->get_results($sql, OBJECT);
foreach ($results as $post) {
$content = $post->post_content;
echo '<div style="border: 1px solid green; padding: 9px; margin: 10px;">';
- $urlPattern = '%<a href="(' . $this->_options['toolbox_image_url'] . '/[^">]*)" ?[^>]*>([^>]+)</a>%s';
+ $urlPattern = '%<a href="(' . $this->_options['toolbox_files_url'] . '/[^">]*)" ?[^>]*>([^>]+)</a>%s';
if (preg_match_all($urlPattern, $content, $isMatch)) {
$isMatchCount = count($isMatch[0]);
echo '<p>Matches is0 ' . $isMatchCount . '</p>';
$fileTitle,
'',
$post->ID,
- $this->_options['site_url'] . '/uploads/'
+ $this->_options['toolbox_files_url'] . '/'
);
}
if ($key !== false) {