longname, $this->shortname, $this->accesslvl, $this->hook, array(&$this,'config_page')); } function plugin_options_url() { return admin_url( 'options-general.php?page='.$this->hook ); } function admin_heading($title) { echo '

'.$title.'

'; //
'; // wp_nonce_field($this->hook); /* outputs hidden field */ // ; } function admin_subheading($title) { echo '

'.$title.'

'; } function config_page() { $this->admin_heading($this->longname); $this->where_shortcode(); echo '

Help:

'; echo '

More detailed instructions at the wordpress plugin installation and faq pages.

'; echo '
    '; echo '
  1. '; _e('Test your widget in a normal sidebar first.', 'amr-shortcode-any-widget'); echo ' '; _e('Go to widgets', 'amr-shortcode-any-widget'); echo ''; echo '
  2. '; _e('Drag the widgets you want to use to the shortcodes sidebar.', 'amr-shortcode-any-widget'); echo '
  3. '; echo '
  4. '; _e('Add a do_widget or do_widget_area shortcode to a page.', 'amr-shortcode-any-widget'); echo ' '; _e('Create a page with example do_widget shortcode', 'amr-shortcode-any-widget'); echo ''; echo '
  5. '; echo '
'; echo '

'; _e('To add a single widget to a page', 'amr-shortcode-any-widget'); echo '

'; echo ''; echo '
'; echo '

'; _e('More advanced options:','amr-shortcode-any-widget'); echo '

'; echo ''; echo '

'; _e('To change the style, change the html:','amr-shortcode-any-widget'); echo '

'; echo ''; echo '

'; echo "Valid title html tags are :

'; echo "

Valid html wrap tags are :

'; echo '

'; _e('To add multiple instances of the same widget:', 'amr-shortcode-any-widget'); echo '

'; echo ''; echo '

'; _e('To add a widget area - all widgets in the widget area:', 'amr-shortcode-any-widget'); echo '

'; echo ''; echo '
'; } function plugin_support() { $content = '

'.__('If you have any problems with this plugin or good ideas for improvements or new features, please talk about them in the','amr-shortcode-any-widget').' '.__("Support forums",'amr-shortcode-any-widget').'.

'; $this->postbox($this->hook.'support', 'Need support?', $content); } function text_limit( $text, $limit, $finish = ' […]') { if( strlen( $text ) > $limit ) { $text = substr( $text, 0, $limit ); $text = substr( $text, 0, - ( strlen( strrchr( $text,' ') ) ) ); $text .= $finish; } return $text; } function where_shortcode() { global $wpdb; //$pattern = get_shortcode_regex(array('do_widget')); echo '

'.__('This site is using do_widget shortcodes in the following:','amr-shortcode-any-widget').'

'; $results = array(); $query = "SELECT * FROM $wpdb->posts WHERE post_status IN ( 'publish', 'future') and post_content LIKE '%[do_widget%]%' ORDER BY post_date DESC;" ; //$query = "SELECT * FROM $wpdb->posts WHERE post_status IN ( 'publish', 'future') and post_content REGEXP '".$pattern."' ORDER BY post_date DESC;" ; $results = $wpdb->get_results($query); echo ''; foreach($results as $i => $result) { echo ''; } echo '
'; _e('Post'); echo ''; _e('Published'); echo ''; _e('Shortcodes'); echo '
'; edit_post_link($result->post_title.' ',' ',' ',$result->ID); echo ''.substr($result->post_date,0,11); if (!($result->post_status == 'publish')) _e($result->post_status); echo ''; preg_match_all("^\[(.*)\]^",$result->post_content,$matches, PREG_PATTERN_ORDER); foreach ($matches[0] as $j=> $m) { if (!empty($matches[1][$j])) { echo $m; echo '
'; } }; echo '
'; } } }