Odpowiedź forum utworzona

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter legwan1414

    (@legwan1414)

    Ok znalazłem. Jeżeli kogoś interesuje to jest to wtyczka
    Page Link Manager

    Forum: Zaawansowane
    W odpowiedzi na: Edycja wtyczki
    Thread Starter legwan1414

    (@legwan1414)

    Serwer Xampp’a

    Forum: Zaawansowane
    W odpowiedzi na: Edycja wtyczki
    Thread Starter legwan1414

    (@legwan1414)

    Hmm to pewnie w tym kodzie bo oprócz tego zostały już tylko pliki-text-expander/readme.txt

    <?php
    /*
    Plugin Name: Text Expander
    Plugin URI: http://www.ali.dj/wordpress-plugin-text-expander/
    Description: Allows you to define areas of text that expand/collapse when clicked. It is an improved version of Dagon Design's Expanding Text-Plugin.
    Author: Alexander Zigelski
    Version: 0.3
    Author URI: http://www.ali.dj
    */
    
    // add the options page
    add_action('admin_menu', 'text_expander_admin_add_page');
    add_action('wp_print_scripts', 'load_jquery');
    add_action('wp_head', 'expander_javascript');
    add_filter('the_content', 'expander_process');
    $wp_text_expander_url = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__));
    
    function text_expander_admin_add_page() {
    add_options_page('Text Expander Settings', 'Text Expander', 'manage_options', 'text_expander', 'text_expander_options_page');
    }
    
    // display the options page
    function text_expander_options_page() {
    ?>
    <div>
    <h2>Text Expander Settings</h2>
    Options relating to the Custom Plugin.
    <form action="options.php" method="post">
    <?php settings_fields('text_expander_options'); ?>
    <?php do_settings_sections('text_expander'); ?>
    <br />
    <input name="Submit" type="submit" value="<?php esc_attr_e('Save Changes'); ?>" />
    </form></div>
    
    <?php
    }
    add_action('admin_init', 'plugin_admin_init');
    
    function plugin_admin_init(){
    register_setting( 'text_expander_options', 'text_expander_options', 'expand_text_validate' );
    add_settings_section('text_expander_main', 'Expand/Collapse-link', 'text_expander_main_section_text', 'text_expander');
    add_settings_field('expand_text', 'Before collapse link:', 'text_expander_expand_text_string', 'text_expander', 'text_expander_main');
    add_settings_field('collapse_text', 'Before expand link:', 'text_expander_collapse_text_string', 'text_expander', 'text_expander_main');
    }
    
    register_activation_hook(__FILE__, 'add_defaults_fn');
    
    // Define default option settings
    function add_defaults_fn() {
    	$tmp = get_option('text_expander_options');
        if(($tmp['chkbox1']=='on')||(!is_array($tmp))) {
    		$arr = array("expand_text"=>"&uArr;", "collapse_text" => "&dArr;");
    		update_option('text_expander_options', $arr);
    	}
    }
    
    function text_expander_main_section_text() {
    echo '<p>Here you can adjust which character or string is shown before the expand or collapse link.<br />
    		Default values are a down-and up-arrow</p>';
    }
    
    function text_expander_expand_text_string() {
    $options = get_option('text_expander_options');
    echo "<input id='expand_text_string' name='text_expander_options[expand_text]' size='40' type='text' value='{$options['expand_text']}' />";
    }
    
    function text_expander_collapse_text_string() {
    $options = get_option('text_expander_options');
    echo "<input id='collapse_text_string' name='text_expander_options[collapse_text]' size='40' type='text' value='{$options['collapse_text']}' />";
    }
    
    // validate our options
    function expand_text_validate($input) {
    $options = get_option('text_expander_options');
    $options['expand_text'] = trim($input['expand_text']);
    $options['collapse_text'] = trim($input['collapse_text']);
    return $options;
    }
    
    function expander_str_replace_once($needle , $replace , $haystack){
        // Looks for the first occurence of $needle in $haystack
        // and replaces it with $replace.
        $pos = strpos($haystack, $needle);
        if ($pos === false) {
            // Nothing found
        return $haystack;
        }
        return substr_replace($haystack, $replace, $pos, strlen($needle));
    }
    
    function wp_text_expander_add_media_button() {
    	GLOBAL $wp_text_expander_url;
    	$url = $wp_text_expander_url.'/media-button-expander.php?tab=add&TB_iframe=true&height=300&width=640';
    	if (is_ssl()) $url = preg_replace( '/^http:\/\//', 'https://',  $url );
    	echo '<a href="'.$url.'" class="thickbox" title="'.'Add Text Expander'.'"><img src="'.$wp_text_expander_url.'/img/media-button-text-expander.gif" alt="'.'Add Text Expander'.'"></a>';
    }
    
    add_action('media_buttons', 'wp_text_expander_add_media_button', 20);
    
    function load_jquery(){
        wp_enqueue_script('jquery');
    }
    
    function expander_process($content) {
    
    	$offset = 0;
    	$stag = '[EXPAND ';
    	$etag = '[/EXPAND]';
    	while (stripos($content, $stag, $offset)) {
    
    		// string to replace
    		$s = stripos($content, $stag, $offset);
    		$e = stripos($content, $etag, $s) + strlen($etag);
    
    		// inside data
    		$ds = stripos($content, ']', $s) + 1;
    		$de = $e - strlen($etag);
    
    		// style tag
    		$ss = $s + strlen($stag);
    		$se = $ds - 1;
    
    		$sstring = substr($content, $s, $e - $s);
    		$sdesc = substr($content, $ss, $se - $ss);
    		$sdata = substr($content, $ds, $de - $ds);
    
    		mt_srand((double)microtime()*1000000);
    		$rnum = mt_rand();
    
    		$new_string = '<a style="display:none;" id="te' . $rnum;
    		$new_string .= '" href="javascript:expand(\'#te' . $rnum . '\')">';
    		$new_string .= $sdesc . '</a>' . "\n";
    		$new_string .= '<div class="te_div" id="te' . $rnum . '">';
    		$new_string .= '<script language="JavaScript" type="text/javascript">expander_hide(\'#te' . $rnum . '\');</script>';
    
    		$sdata = preg_replace('<code>^<br /></code>sim', '', $sdata);
    		$content = expander_str_replace_once($sstring, $new_string . $sdata . '</div>', $content);
    		$offset = $s + 1;
    	}
    	return $content;
    }
    
    function expander_javascript() {
      	$options = get_option('text_expander_options');
    	echo '
    <script language="JavaScript" type="text/javascript"><!--
    
    function expand(param) {
     jQuery("div"+param).stop().slideToggle("slow", function() {
        linkname = jQuery("a"+param).html();
        if( jQuery("div"+param).is(":visible") ) {
          jQuery("a"+param).html(expand_text+" "+linkname.substring(collapse_text_length));
        }
        else {
            jQuery("a"+param).html(collapse_text+" "+linkname.substring(expand_text_length));
        }
      });
    
    }
    function expander_hide(param) {
            jQuery("div"+param).hide();
    		linkname = jQuery("a"+param).html();
            collapse_text  = "'.$options['collapse_text'].'";
            expand_text    = "'.$options['expand_text'].'";
            collapse_text_length = jQuery("<span />").html(collapse_text).text().length;
            expand_text_length = jQuery("<span />").html(collapse_text).text().length;
            jQuery("a"+param).html(collapse_text + " " + linkname);
            jQuery("a"+param).show();
    }
    //--></script>
    ';
    }
    
    ?>
    Thread Starter legwan1414

    (@legwan1414)

    Dzięki wielki ! 🙂

    Thread Starter legwan1414

    (@legwan1414)

    Hmm nikt nie wie w jaki sposób mogę cos takiego dadać??
    Tekst schowany w odnośniku, wysuwający sie po kliknięciu

    Thread Starter legwan1414

    (@legwan1414)

    */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <link rel=”shortcut icon” href=”http://satixs.pl/wp-content/uploads/2011/02/dfdf..png” />
    tutaj wkleiłem kod ikonki
    <meta charset=”<?php bloginfo( 'charset’ ); ?>” />
    <title><?php

    wkleiłem tam ale ikona jest widoczna na środku nagłówka z prawej strony

    Thread Starter legwan1414

    (@legwan1414)

    ale ja nie wiem który obsługuje ikonki i dlatego się pytam:)
    byłbym wdzięczny za jakąś krótka instrukcję jak mam to zrobić

    Thread Starter legwan1414

    (@legwan1414)

    Ikonki tutaj nie ma w tym kodzie.

    Style

    * 2010style.css
    (2010style.css)
    * Arkusz RTL stylu
    (rtl.css)
    * Arkusz stylu
    (style.css)
    * Arkusz stylu wizualnego edytora
    (editor-style.css)
    * child-style.css
    (child-style.css)
    * editor-style-rtl.css
    (editor-style-rtl.css)
    * ttw-admin-style.css
    (ttw-admin-style.css)

    Który mam tutaj wkleić?

    Thread Starter legwan1414

    (@legwan1414)

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="main">
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <link rel="shortcut icon" href="http://satixs.pl/wp-content/uploads/2011/02/dfdf..png" />
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
    
    	?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <?php
    	/* We add some JavaScript to pages with the comment form
    	 * to support sites with threaded comments (when in use).
    	 */
    	if ( is_singular() && get_option( 'thread_comments' ) )
    		wp_enqueue_script( 'comment-reply' );
    
    	/* Always have wp_head() just before the closing </head>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to add elements to <head> such
    	 * as styles, scripts, and meta tags.
    	 */
    	wp_head();
    ?>
    </head>
    <body <?php body_class(); ?>>
    <div id="wrapper" class="hfeed">
    <a href="http://satixs.pl"><img src="http://satiss.pl/wp-content/uploads/2010/12/new3-e1297686981659.jpg" alt="" title="new3" width="850" height="194" class="alignleft size-full wp-image-271" /></a>
    <div id="header">
    <?php if (is_active_sidebar('header-widget-area')) { // header widget
    	ob_start(); /* let's use output buffering to allow use of Dynamic Widgets plugin and not have empty sidebar */
    	$success = dynamic_sidebar('header-widget-area');
    	$content = ob_get_clean();
    	if ($success) {
    	?>
    	<div id="ttw-head-widget" class="ttw-head-widget-area" role="complementary" >
    	<?php echo($content) ; ?>
    	</div> <!-- #ttw-header-widget -->
    <?php 	} } ?>
    <div id="masthead">
    			<div id="branding" role="banner">
    				<div id="ttw-site-logo"></div>
    				<div id="ttw-site-logo-link" onclick="location.href='<?php echo home_url( '/' ); ?>';" style="cursor:pointer;"></div>
    				<?php if (!ttw_getopt('ttw_hide_site_title')){	/* TTW - hide site title */ ?>
    				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>
    				<div id="site-description"><?php bloginfo( 'description' ); ?></div>
    				<?php } /* end hide site title if */ ?>
    
    				<?php
    				     if (!ttw_getopt('ttw_hide_menu') && ttw_getopt('ttw_move_menu')) { 	/* TTW: move header */ ?>
    					<div id="access" role="navigation">
    					<?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    					<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    					<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    					<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    					</div><!-- #access -->
    				<?php } ?>
    				<?php
    				     if (!ttw_getopt('ttw_hide_menu') && !ttw_getopt('ttw_move_menu')) { 	/* don't move header */ ?>
    					<div id="access2" role="navigation">
    					<?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    					<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    					<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    					<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'secondary', 'fallback_cb' => '' ) ); ?>
    					</div><!-- #access2 -->
    				<?php } ?>
    				<?php if (ttw_getopt('ttw_header_insert')) {	/* header insert defined? */
    						if (ttw_getopt('ttw_header_frontpage_only')) {
    							if (is_front_page()) echo (do_shortcode(str_replace("\\", "", ttw_getopt('ttw_header_insert'))));
    						} else {
    							echo (do_shortcode(str_replace("\\", "", ttw_getopt('ttw_header_insert'))));
    						}
    					}
    
    				// The Dynamic Headers shows headers on a per page basis - will also optionally add site link
    				if(function_exists('show_media_header')) show_media_header();  // **Dynamic Headers** built-in support for plugin
    
    				do_action('ttwx_extended_header_insert');				/* add any extension header insert */
    				do_action('ttwx_super_header_insert');		// future extension
    
    				if (HEADER_IMAGE_HEIGHT > 0 && !(ttw_getopt('ttw_header_frontpage_only') && is_front_page() )) {
    					if (ttw_getopt('ttw_link_site_image')) { ?>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    					<?php }
    					// Check if this is a post or page, if it has a thumbnail,  and if it's a big one
    					if ( is_singular() &&
    					   has_post_thumbnail( $post->ID ) &&
    					   ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    					   $image[1] >= HEADER_IMAGE_WIDTH ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    					else : ?>
    						<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    					<?php endif;
    					if (ttw_getopt('ttw_link_site_image')) echo("</a>");
    				} /* } closes header > 0 */ ?>
    			</div><!-- #branding -->
    
    			<?php if (!ttw_getopt('ttw_hide_menu') && !ttw_getopt('ttw_move_menu')) { 	/* ttw - move header */ ?>
    			<div id="access" role="navigation">
    			  <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    				<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    			</div><!-- #access -->
    			<?php } ?>
    			<?php if (!ttw_getopt('ttw_hide_menu') && ttw_getopt('ttw_move_menu')) { 	/* ttw - move header */ ?>
    			<div id="access2" role="navigation">
    			  <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    				<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'secondary', 'fallback_cb' => '' ) ); ?>
    			</div><!-- #access2 -->
    			<?php } ?>
    		</div><!-- #masthead -->
    	</div><!-- #header -->
    
    	<div id="main">

    wklejam cały kod pliku header.php 🙂
    strona jeszcze nie jest w sieci

    Thread Starter legwan1414

    (@legwan1414)

    dzięki już sobie poradziłem 🙂

    Mam to samo, w jaki sposób można teraz to poprawić?
    z góry dzięki

    Thread Starter legwan1414

    (@legwan1414)

    powiem Ci że nawet pomogło, dzięki 😉

    Thread Starter legwan1414

    (@legwan1414)

    Sorry przypadkowo wyskoczył drugi wątek. To jest jedyny sposób? Nie znam się na html’u na tyle. Chyba że jest to gdzieś opisane.

Viewing 13 replies - 1 through 13 (of 13 total)