Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter pils.schouler

    (@pilsschouler-1)

    Lovely chatting with you.
    :]

    Thread Starter pils.schouler

    (@pilsschouler-1)

    ok, so, the answer appears to be (when custompage/themetemplate has no ‘content section’ / is NOT a post):

    1. use the osm (as normal) in admin/page/custompage. This will set the ‘wp_postmeta’ in SQL required for the marker_icon/marker_name and SAVE page.
    2. Add <php echo do_shortcode etc> to your custompage template.
    3. This will pick up the ‘wp_postmeta’ stored in the SQL, by page_id…(trusting that your shortcode has the correct details in)

    Do tell me if I’ve missed something simple.

    Thread Starter pils.schouler

    (@pilsschouler-1)

    @jdembowski
    awww, thanks Jan
    (ps. also thanks for the facebook myinfo post)

    Thread Starter pils.schouler

    (@pilsschouler-1)

    damn, just realised I@ve given my gps away!
    s##t!
    :]

    Thread Starter pils.schouler

    (@pilsschouler-1)

    Hi Takayuki
    GENIUS!
    Yes, that is my question.
    AND
    once the email/attachment is sent I assume one is reliant upon the Secure SSL/TLS Settings of the mail server/client

    Thank you for the speedy reply.

    Thread Starter pils.schouler

    (@pilsschouler-1)

    cheers James

    Thread Starter pils.schouler

    (@pilsschouler-1)

    resolved.

    Thread Starter pils.schouler

    (@pilsschouler-1)

    damn you’re good!

    I mean it.

    problem solved!

    Thread Starter pils.schouler

    (@pilsschouler-1)

    oop, sorry about that… :]

    anyway, you’re correct; it’s fixed.

    nice one!
    five gold stars to you!

    Forum: Plugins
    In reply to: [Hammy] .png files
    Thread Starter pils.schouler

    (@pilsschouler-1)

    Hi Noel

    Thank you!

    Thread Starter pils.schouler

    (@pilsschouler-1)

    ok. to be more specific:

    the code wherein I believe this should be placed is in (for instance) contact-form-7\modules\text.php (for the input type “text”).

    code as is WITH CAPITALIZED UPDATES=

    <?php
    /**
    ** A base module for [text], [text*], [email], and [email*]
    **/
    
    /* Shortcode handler */
    
    wpcf7_add_shortcode( 'text', 'wpcf7_text_shortcode_handler', true );
    wpcf7_add_shortcode( 'text*', 'wpcf7_text_shortcode_handler', true );
    wpcf7_add_shortcode( 'email', 'wpcf7_text_shortcode_handler', true );
    wpcf7_add_shortcode( 'email*', 'wpcf7_text_shortcode_handler', true );
    
    function wpcf7_text_shortcode_handler( $tag ) {
    	if ( ! is_array( $tag ) )
    		return '';
    
    	$type = $tag['type'];
    	$name = $tag['name'];
    	$options = (array) $tag['options'];
    	$values = (array) $tag['values'];
    /* CODE ADDED HERE FOR THE TAG onfocus */
    	$onfocus = $tag['onfocus'];
    /* END CODE ADDED */
    
    	if ( empty( $name ) )
    		return '';
    
    	$atts = '';
    	$id_att = '';
    	$class_att = '';
    	$size_att = '';
    	$maxlength_att = '';
    	$tabindex_att = '';
    	$title_att = '';
    
    	$class_att .= ' wpcf7-text';
    
    	if ( 'email' == $type || 'email*' == $type )
    		$class_att .= ' wpcf7-validates-as-email';
    
    	if ( 'text*' == $type || 'email*' == $type )
    		$class_att .= ' wpcf7-validates-as-required';
    
    	foreach ( $options as $option ) {
    		if ( preg_match( '%^id:([-0-9a-zA-Z_]+)$%', $option, $matches ) ) {
    			$id_att = $matches[1];
    
    		} elseif ( preg_match( '%^class:([-0-9a-zA-Z_]+)$%', $option, $matches ) ) {
    			$class_att .= ' ' . $matches[1];
    
    		} elseif ( preg_match( '%^([0-9]*)[/x]([0-9]*)$%', $option, $matches ) ) {
    			$size_att = (int) $matches[1];
    			$maxlength_att = (int) $matches[2];
    
    		} elseif ( preg_match( '%^tabindex:(\d+)$%', $option, $matches ) ) {
    			$tabindex_att = (int) $matches[1];
    
    		}
    	}
    
    	$value = (string) reset( $values );
    
    	if ( wpcf7_script_is() && $value && preg_grep( '%^watermark$%', $options ) ) {
    		$class_att .= ' wpcf7-use-title-as-watermark';
    		$title_att .= sprintf( ' %s', $value );
    		$value = '';
    	}
    
    	if ( wpcf7_is_posted() )
    		$value = stripslashes_deep( $_POST[$name] );
    
    	if ( $id_att )
    		$atts .= ' id="' . trim( $id_att ) . '"';
    
    	if ( $class_att )
    		$atts .= ' class="' . trim( $class_att ) . '"';
    
    	if ( $size_att )
    		$atts .= ' size="' . $size_att . '"';
    	else
    		$atts .= ' size="40"'; // default size
    
    	if ( $maxlength_att )
    		$atts .= ' maxlength="' . $maxlength_att . '"';
    
    	if ( '' !== $tabindex_att )
    		$atts .= sprintf( ' tabindex="%d"', $tabindex_att );
    
    	if ( $title_att )
    		$atts .= sprintf( ' title="%s"', trim( esc_attr( $title_att ) ) );
    
    /* THIS LINE AS IS */
    	$html = '<input type="text" name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' />';
    /* UPDATED TO THIS INSTEAD */
    	$html = '<input type="text" onfocus="value=''" name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' />';
    /* END UPDATE - NOTHING ELSE CHANGED*/
    
    	$validation_error = wpcf7_get_validation_error( $name );
    
    	$html = '<span class="wpcf7-form-control-wrap ' . $name . '">' . $html . $validation_error . '</span>';
    
    	return $html;
    }
    
    /* Validation filter */
    
    add_filter( 'wpcf7_validate_text', 'wpcf7_text_validation_filter', 10, 2 );
    add_filter( 'wpcf7_validate_text*', 'wpcf7_text_validation_filter', 10, 2 );
    add_filter( 'wpcf7_validate_email', 'wpcf7_text_validation_filter', 10, 2 );
    add_filter( 'wpcf7_validate_email*', 'wpcf7_text_validation_filter', 10, 2 );
    
    function wpcf7_text_validation_filter( $result, $tag ) {
    	$type = $tag['type'];
    	$name = $tag['name'];
    
    	$_POST[$name] = trim( strtr( (string) $_POST[$name], "\n", " " ) );
    
    	if ( 'text*' == $type ) {
    		if ( '' == $_POST[$name] ) {
    			$result['valid'] = false;
    			$result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
    		}
    	}
    
    	if ( 'email' == $type || 'email*' == $type ) {
    		if ( 'email*' == $type && '' == $_POST[$name] ) {
    			$result['valid'] = false;
    			$result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
    		} elseif ( '' != $_POST[$name] && ! is_email( $_POST[$name] ) ) {
    			$result['valid'] = false;
    			$result['reason'][$name] = wpcf7_get_message( 'invalid_email' );
    		}
    	}
    
    	return $result;
    }
    
    /* Tag generator */
    
    add_action( 'admin_init', 'wpcf7_add_tag_generator_text_and_email', 15 );
    
    function wpcf7_add_tag_generator_text_and_email() {
    	wpcf7_add_tag_generator( 'text', __( 'Text field', 'wpcf7' ),
    		'wpcf7-tg-pane-text', 'wpcf7_tg_pane_text' );
    
    	wpcf7_add_tag_generator( 'email', __( 'Email field', 'wpcf7' ),
    		'wpcf7-tg-pane-email', 'wpcf7_tg_pane_email' );
    }
    
    function wpcf7_tg_pane_text( &$contact_form ) {
    	wpcf7_tg_pane_text_and_email( 'text' );
    }
    
    function wpcf7_tg_pane_email( &$contact_form ) {
    	wpcf7_tg_pane_text_and_email( 'email' );
    }
    
    function wpcf7_tg_pane_text_and_email( $type = 'text' ) {
    	if ( 'email' != $type )
    		$type = 'text';
    
    ?>
    <div id="wpcf7-tg-pane-<?php echo $type; ?>" class="hidden">
    <form action="">
    <table>
    <tr><td><input type="checkbox" name="required" />&nbsp;<?php echo esc_html( __( 'Required field?', 'wpcf7' ) ); ?></td></tr>
    <tr><td><?php echo esc_html( __( 'Name', 'wpcf7' ) ); ?><br /><input type="text" name="name" class="tg-name oneline" /></td><td></td></tr>
    </table>
    
    <table>
    <tr>
    <td><code>id</code> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br />
    <input type="text" name="id" class="idvalue oneline option" /></td>
    
    <td><code>class</code> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br />
    <input type="text" name="class" class="classvalue oneline option" /></td>
    </tr>
    
    <tr>
    <td><code>size</code> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br />
    <input type="text" name="size" class="numeric oneline option" /></td>
    
    <td><code>maxlength</code> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br />
    <input type="text" name="maxlength" class="numeric oneline option" /></td>
    </tr>
    
    <tr>
    <td colspan="2"><?php echo esc_html( __( 'Akismet', 'wpcf7' ) ); ?> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br />
    <?php if ( 'text' == $type ) : ?>
    <input type="checkbox" name="akismet:author" class="exclusive option" />&nbsp;<?php echo esc_html( __( "This field requires author's name", 'wpcf7' ) ); ?><br />
    <input type="checkbox" name="akismet:author_url" class="exclusive option" />&nbsp;<?php echo esc_html( __( "This field requires author's URL", 'wpcf7' ) ); ?>
    <?php else : ?>
    <input type="checkbox" name="akismet:author_email" class="option" />&nbsp;<?php echo esc_html( __( "This field requires author's email address", 'wpcf7' ) ); ?>
    <?php endif; ?>
    </td>
    </tr>
    
    <tr>
    <td><?php echo esc_html( __( 'Default value', 'wpcf7' ) ); ?> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br /><input type="text" name="values" class="oneline" /></td>
    
    <td>
    <br /><input type="checkbox" name="watermark" class="option" />&nbsp;<?php echo esc_html( __( 'Use this text as watermark?', 'wpcf7' ) ); ?>
    </td>
    </tr>
    </table>
    
    <div class="tg-tag"><?php echo esc_html( __( "Copy this code and paste it into the form left.", 'wpcf7' ) ); ?><br /><input type="text" name="<?php echo $type; ?>" class="tag" readonly="readonly" onfocus="this.select()" /></div>
    
    <div class="tg-mail-tag"><?php echo esc_html( __( "And, put this code into the Mail fields below.", 'wpcf7' ) ); ?><br /><span class="arrow">⬇</span>&nbsp;<input type="text" class="mail-tag" readonly="readonly" onfocus="this.select()" /></div>
    </form>
    </div>
    <?php
    }
    
    ?>

    I’m sure you can see the problem:

    /* THIS LINE AS IS */
    	$html = '<input type="text" name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' />';
    /* UPDATED TO THIS INSTEAD */
    	$html = '<input type="text" onfocus="value=''" name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' />';
    /* END UPDATE - NOTHING ELSE CHANGED*/

    the onfocus="value=''" is causing an unexpected T_CONSTANT_ENCAPSED_STRING on this line.

    any ideas…

    Hi Calicosun

    I’ll be v.honest, I’ve completely forgotten what the heck I did with the above…soz…

    :[

    hello anan

    please don’t confuse me with someone who knows what they’re doing but I’ve got the above to work, though with variation:

    index.php

    <?php get_header(); ?>
    
    	<div id="mid" class="index">
    
    		<!-- Start slider -->
    		<div class="stripViewer">
    			<div class="panelContainer">
    
    			<?php if (have_posts()) : ?>
    
    				<?php while (have_posts()) : the_post(); ?>
    
    				<div class="panel" id="post-<?php the_ID(); ?>" title="<?php the_title() ?>">
    					<div class="wrapper">
    
    <?php
    $media_type = get_post_meta($post->ID, 'lead_type', true);
    $media = get_post_meta($post->ID, 'lead_image', true);
    /* Display relevant code based on media type */
    if(stristr($media, '.flv') || $media_type == 'flash') {
    /* Grab video preview image if the user has added one */
    $video_preview = get_post_meta($post->ID, 'video_preview', true); ?>
    <span id="video-<?php the_ID(); ?>" class="flashvideo" style="height: 600px; width: 940px;">
    <script type="text/javascript">
    var s<?php the_ID(); ?> = new SWFObject("<?php bloginfo('template_directory'); ?>/flash/player.swf","n0","940","600","7");
    s<?php the_ID(); ?>.addParam("allowfullscreen","false");
    s<?php the_ID(); ?>.addParam("allowscriptaccess","always");
    s<?php the_ID(); ?>.addParam("wmode","transparent");
    s<?php the_ID(); ?>.addVariable("javascriptid","n0");
    s<?php the_ID(); ?>.addVariable("controlbar","none");
    s<?php the_ID(); ?>.addVariable("stretching","fill");
    s<?php the_ID(); ?>.addVariable("height","600");
    s<?php the_ID(); ?>.addVariable("width","940");
    s<?php the_ID(); ?>.addVariable("searchbar","false");
    s<?php the_ID(); ?>.addVariable("screencolor","0xffffff");
    s<?php the_ID(); ?>.addVariable("overstretch","true");
    s<?php the_ID(); ?>.addVariable("showeq","false");
    s<?php the_ID(); ?>.addVariable("showicons","false");
    s<?php the_ID(); ?>.addVariable("shownavigation","false");
    s<?php the_ID(); ?>.addVariable("showstop","false");
    s<?php the_ID(); ?>.addVariable("showdigits","false");
    s<?php the_ID(); ?>.addVariable("showdownload","false");
    s<?php the_ID(); ?>.addVariable("usefullscreen","true");
    s<?php the_ID(); ?>.addVariable("autoscroll","false");
    s<?php the_ID(); ?>.addVariable("thumbsinplaylist","false");
    s<?php the_ID(); ?>.addVariable("autostart","false");
    s<?php the_ID(); ?>.addVariable("bufferlength","3");
    s<?php the_ID(); ?>.addVariable("repeat","false");
    s<?php the_ID(); ?>.addVariable("rotatetime","5");
    s<?php the_ID(); ?>.addVariable("shuffle","false");
    s<?php the_ID(); ?>.addVariable("smoothing","true");
    s<?php the_ID(); ?>.addVariable("volume","100");
    s<?php the_ID(); ?>.addVariable("enablejs","true");
    s<?php the_ID(); ?>.addVariable("linkfromdisplay","false");
    s<?php the_ID(); ?>.addVariable("linktarget","_self");
    s<?php the_ID(); ?>.addVariable("image","<?php echo $preview_image; ?>");
    s<?php the_ID(); ?>.addVariable("file","<?php echo $media; ?>");
    s<?php the_ID(); ?>.write("video-<?php the_ID(); ?>");
    </script>
    </span>
    
    <? } elseif(stristr($media, 'iframe') || $media_type == 'iframe') {
    
    /* Insert Iframe directly, stripping slashes from links etc */
    
    echo stripslashes($media);
    
    } else {
    
    /* Else default behaviour is to display image */ ?>
    
    <img src="<?php echo $media; ?>" alt="" width="940" height="600" />
    
    <? }
    ?>
    
    						<!-- <?php $image = get_post_meta($post->ID, 'lead_image', true); ?> -->
    						<!-- <img src="<?php echo $image; ?>" alt="" width="940" height="600" />  -->
    
    						<div class="post-title">
    							<!-- <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> -->
    							<?php the_title(); ?>
    							<!-- </a> -->
    						</div>
    						<div class="entry">
    							<?php the_content(); ?>
    						</div>
    					</div>
    				</div>
    
    <?php endwhile; ?>
    
    <?php else : ?>
    
    <?php endif; ?>
    
    				<div class="panel" id="nav-panel">
    					<div class="wrapper">
    						<img src="<?php bloginfo('template_directory'); ?>/images/where.jpg" alt="" width="940" height="600" />
    						<div class="post-title">
    							Where next?
    						</div>
    						<div class="entry">
    							<span class="big"><a href="<?php bloginfo('comments_rss2_url'); ?>" class="rss-big">Recent Comments</a></span>
    							<ul><li></li><?php dp_recent_comments(); ?></ul>
    							<span class="big"><span class="left"><?php previous_posts_link('&laquo; Newer Entries') ?></span>
    							<span class="right"><?php next_posts_link('Older Entries &raquo;') ?></span></span>
    						</div>
    					</div>
    				</div>
    
    			</div><!-- .panelContainer -->
    		</div><!--.stripViewer -->
    
    	</div><!-- .mid -->
    
    	<div class="stripNavL" id="stripNavL0"><a href="#"><img src="<?php bloginfo('template_directory'); ?>/images/left.png" alt="Left" /></a></div>
    	<div class="stripNavR" id="stripNavR0"><a href="#"><img src="<?php bloginfo('template_directory'); ?>/images/right.png" alt="Right" /></a></div>
    
    <?php get_footer(); ?>

    header.php (for js files):

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head profile="https://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <?php if(is_home() || is_category()) : ?>
    	<script src="<?php bloginfo('template_directory'); ?>/js/jquery-1.2.1.pack.js" type="text/javascript"></script>
    	<script src="<?php bloginfo('template_directory'); ?>/js/jquery-easing.1.2.pack.js" type="text/javascript"></script>
    	<script src="<?php bloginfo('template_directory'); ?>/js/jquery-easing-compatibility.1.2.pack.js" type="text/javascript"></script>
    	<script src="<?php bloginfo('template_directory'); ?>/js/coda-slider.1.1.1.js" type="text/javascript"></script>
    	<script src="<?php bloginfo('template_directory'); ?>/js/swfobject2.js" type="text/javascript"></script>
    	<script src="<?php bloginfo('template_directory'); ?>/js/scale.js" type="text/javascript"></script>
    	<script type="text/javascript">
    		jQuery(window).bind("load", function() {
    			jQuery("div#mid").codaSlider()
    		});
    	</script>
    
    	<script src="<?php bloginfo('template_directory'); ?>/js/imgSizer.js" type="text/javascript"></script>
    
    <?php endif; ?>
    
    <?php if(get_background()!="") : ?>
    <style type="text/css">
    	body {
    		background: <?php echo get_background(); ?>;
    	}
    </style>
    <?php endif; ?>
    
    <?php wp_head(); ?>
    </head>
    <body>
    <div id="page">
    
    <div id="header">
    	<!-- <h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1> -->
    <h1><a href="<?php echo get_option('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.png"></a></h1>

    The only thing I’ve failed to get to work (that I tried to) was the preview_image…

    Hope you get this, or you’ve worked it out.

    kindest

    pils

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