prefix . 'aphorismus'); aphorismus_options(); if (isset($_GET['type'])){ if ($_GET['type'] == 'js'){ header('Content-Type: application/javascript; charset=' . get_option('blog_charset'), true); ?> /* JavaScript */ var text = ''; document.write(text); prefix . 'aphorismus'); aphorismus_options(); } if (isset($_GET['action'])){ if ($_GET['action'] == 'export'){ require_once(dirname(__FILE__).'/includes/export.php'); aphorismus_export(); die(); } } register_activation_hook(__FILE__, 'aphorismus_setup' ); add_action('admin_menu', 'aphorismus_add_admin'); add_action('admin_head', 'aphorismus_admin_head'); if (aphorismus_get_options('aphorismus_admin_show') == 'true'){ add_action('admin_footer', 'aphorismus_admin_footer'); } add_action('init', 'do_filter'); add_action('plugins_loaded', 'aphorismus_init'); /** * Add, load, update options * * @param bool $return * @return array */ function aphorismus_options($return = false, $options = array()){ $new_options = array(); $new_options['aphorismus_template'] = '
%%text%%!
%%author%%!
\n";
echo "
\n";
echo "
\n";
echo "
\n";
echo "" . __('You can use HTML–tags. Constants:%%title%% — Deduces plug-in heading%%text%% — Deduces the aphorism text%%author%% — Deduces the author', PLUGIN_NAME_APHORISMUS) . "\n";
echo "\n";
echo "
" . __('Aphorism added', PLUGIN_NAME_APHORISMUS) . "
" . __('Aphorism deleted', PLUGIN_NAME_APHORISMUS) . "
" . __('Aphorisms deleted', PLUGIN_NAME_APHORISMUS) . "
" . __('All aphorisms deleted', PLUGIN_NAME_APHORISMUS) . "
" . __('Settings saved', PLUGIN_NAME_APHORISMUS) . "
" . __('Aphorism saved', PLUGIN_NAME_APHORISMUS) . "
" . sprintf( __('Imported aphorisms: %d', PLUGIN_NAME_APHORISMUS), $aphorismus_importer->aphorismus_importer_count()) . "
" . sprintf( __('Imported aphorisms: %d', PLUGIN_NAME_APHORISMUS), $aphorismus_importer->aphorismus_importer_count()) . "
". __('The link allowing other Aphorismus to import your aphorisms', PLUGIN_NAME_APHORISMUS) . ":
".get_option('siteurl')."/wp-content/plugins/".PLUGIN_NAME_APHORISMUS."/aphorismus.php?type=xml
You can use %s for XML-file creation. Open «aphorismus.xls» in MS Excel 2003 SP3 (or higher), fill the table, press «Save as» and will choose XML-data (not a table XML).
', PLUGIN_NAME_APHORISMUS), '«aphorismus.xls»') . "\n"; echo __('Attention! Try to avoid a symbol «&»! :)
', PLUGIN_NAME_APHORISMUS) . "\n"; echo "The Aphorismus shows aphorisms on pages, in posts or on the sidebar. You can use
', PLUGIN_NAME_APHORISMUS) . "\n"; echo "%%aphorismus%%
\n"; echo __('for display in posts or on pages, or to use
', PLUGIN_NAME_APHORISMUS) . "\n"; echo "<?php if (function_exists('aphorismus')) aphorismus(); ?>
\n"; echo __('in templates.
At plugin activation, he automatically adds new widget. If in a template of your blog there is a sidebar, you can place on it widget. To make it it is possible in the management widget menu.
', PLUGIN_NAME_APHORISMUS) . "\n"; echo __('You can deduce aphorisms on other sites:
', PLUGIN_NAME_APHORISMUS) . "\n"; echo "<script type=\"text/javascript\" src=\"" . get_option('siteurl') . "/wp-content/plugins/" . PLUGIN_NAME_APHORISMUS . "/aphorismus.php?type=js\"></script>
\n"; echo "" . __('The link allowing other Aphorismus to import your aphorisms', PLUGIN_NAME_APHORISMUS) . ":
\n"; echo "".get_option('siteurl')."/wp-content/plugins/".PLUGIN_NAME_APHORISMUS."/aphorismus.php?type=xml
\n"; echo "aphorismus ( [ string \$arg ] [, int \$max_length ] [, bool \$tags ] )
\n"; echo __('aphorismus() echo string.
', PLUGIN_NAME_APHORISMUS) . "\n"; echo "get_aphorismus ( [ string \$arg ] [, int \$max_length ] [, bool \$tags ] )
\n"; echo __('get_aphorismus() return string.
', PLUGIN_NAME_APHORISMUS) . "\n"; echo __('arg values:
If the arg is empty or not set, function will deduce string with a output template.
', PLUGIN_NAME_APHORISMUS) . "\n"; echo __('max_length defines the maximum length of a deduced aphorism. By default is 0, thus the maximum length is not limited.
', PLUGIN_NAME_APHORISMUS) . "\n"; echo __('tags resolve or forbid a conclusion of the text of an aphorism with tags. Default value is true. Value false forbids.
', PLUGIN_NAME_APHORISMUS) . "\n"; echo "" . get_aphorismus('notemplate', aphorismus_get_options('aphorismus_admin_show_length')) . "