Inspirational Quote Widget';
$divContent = '
' . $aQuotic . '
';
$favIdParam = '';
if ($favId != '') $favIdParam = '?favid=' . $favId;
$url = 'http://localhost/website/DisplayQuote.aspx' . $favIdParam;
$js = '';
echo $divContent . $js;
}
class aQuotic {
var $bgColor = "CCFF00";
var $color = "303030";
var $fontSize = "medium";
var $textAlign = "left";
var $width = "";
var $padding = "5";
var $favId = "";
function retrieve_option()
{
if (get_option('aquotic_bgColor')) $bgColor = stripslashes(get_option('aquotic_bgColor'));
if (get_option('aquotic_color')) $color = stripslashes(get_option('aquotic_color'));
if (get_option('aquotic_fontSize')) $fontSize = stripslashes(get_option('aquotic_fontSize'));
if (get_option('aquotic_width')) $width = stripslashes(get_option('aquotic_width'));
if (get_option('aquotic_padding')) $padding = stripslashes(get_option('aquotic_padding'));
if (get_option('aquotic_favId')) $favId = stripslashes(get_option('aquotic_favId'));
}
function update()
{
update_option('aquotic_bgColor', $_POST['aquotic_bgColor']);
update_option('aquotic_color', $_POST['aquotic_color']);
update_option('aquotic_fontSize', $_POST['aquotic_fontSize']);
update_option('aquotic_textAlign', $_POST['aquotic_textAlign']);
update_option('aquotic_width', $_POST['aquotic_width']);
update_option('aquotic_padding', $_POST['aquotic_padding']);
update_option('aquotic_favId', $_POST['aquotic_favId']);
}
function addAdminMenu() {
add_submenu_page('options-general.php', __('aQuotic Random Quote'), __('aQuotic Random Quote'), 5, __FILE__, array($this, 'plugin_menu'));
}
function buildDivContent()
{
if (get_option('aquotic_bgColor')) $bgColor = stripslashes(get_option('aquotic_bgColor'));
if (get_option('aquotic_color')) $color = stripslashes(get_option('aquotic_color'));
if (get_option('aquotic_fontSize')) $fontSize = stripslashes(get_option('aquotic_fontSize'));
if (get_option('aquotic_width')) $width = stripslashes(get_option('aquotic_width'));
if (get_option('aquotic_padding')) $padding = stripslashes(get_option('aquotic_padding'));
if (get_option('aquotic_favId')) $favId = stripslashes(get_option('aquotic_favId'));
$style = "";
if ($bgColor != '') $style .= 'Background-Color:#' . $bgColor . ';';
if ($color != '') $style .= 'Color:#' . $color . ';';
if ($fontSize != '') $style .= 'Font-Size:' . $fontSize . ';';
if ($textAlign != '') $style .= 'Text-Align:' . $textAlign . ';';
if ($width != '') $style .= 'Width:' . $width . 'px' . ';';
if ($padding != '') $style .= 'Padding:' . $padding . 'px' . ';';
if ($color != '') $style .= 'Color:' . $color . ';';
if ($style != '') $style = 'style="' . $style . '"';
$aQuotic = 'aQuotic.com - Inspirational Quote Widget';
$divContent = '' . $aQuotic . '
';
return $divContent;
}
function buildJavaScript()
{
$favIdParam = '';
if ($favId != '') $favIdParam = '?favid=' . $favId;
$url = 'http://localhost/website/DisplayQuote.aspx' . $favIdParam;
$js = '';
return $js;
}
function aQuoticScript()
{
return $this->buildDivContent(). $this->buildJavaScript();
}
function filter_aquotic($content)
{
$content=str_replace('',$this->aQuoticScript(),$content);
return $content;
}
function get_quote()
{
if (get_option('aquotic_bgColor')) $bgColor = stripslashes(get_option('aquotic_bgColor'));
if (get_option('aquotic_color')) $color = stripslashes(get_option('aquotic_color'));
if (get_option('aquotic_fontSize')) $fontSize = stripslashes(get_option('aquotic_fontSize'));
if (get_option('aquotic_width')) $width = stripslashes(get_option('aquotic_width'));
if (get_option('aquotic_padding')) $padding = stripslashes(get_option('aquotic_padding'));
if (get_option('aquotic_favId')) $favId = stripslashes(get_option('aquotic_favId'));
}
function output_select($list,$selected)
{
foreach($list as $key=>$value)
{
?> 'xx-small',
'x-small' => 'x-small',
'small' => 'small',
'medium' => 'medium',
'large' => 'large',
'x-large' => 'x-large',
'xx-large' => 'xx-large');
$textAlignArr=array('left' => 'left',
'center' => 'center',
'right' => 'right');
$message = null;
$message_updated = __("aQuotic updated.");
// update options
if ($_POST['action'] && $_POST['action'] == 'update_success') {
$message = $message_updated;
$this->update();
wp_cache_flush();
}
if (get_option('aquotic_bgColor')) $bgColor = stripslashes(get_option('aquotic_bgColor'));
if (get_option('aquotic_color')) $color = stripslashes(get_option('aquotic_color'));
if (get_option('aquotic_fontSize')) $fontSize = stripslashes(get_option('aquotic_fontSize'));
if (get_option('aquotic_width')) $width = stripslashes(get_option('aquotic_width'));
if (get_option('aquotic_padding')) $padding = stripslashes(get_option('aquotic_padding'));
if (get_option('aquotic_favId')) $favId = stripslashes(get_option('aquotic_favId'));
?>