Support » Themes and Templates » Problem theme wpclassifieds

  • xiscomax

    (@xiscomax)


    I try to use the template wpclassifieds of openclassifieds and causes me a mess of design to visualize single.php

    The template set brings a contact form which is called contact_owner.php found within the same template wpclassifieds

    To call the form in single.php is as follows.

    <?php include(TEMPLATEPATH."/contact_owner.php");?>

    But it seems that this causes a mess when viewing single.php in your browser.

    Therefore:

    If you delete this line <?php include(TEMPLATEPATH."/contact_owner.php");?> design is displayed in the browser correctly.

    If that line keeps breaking design and is displayed incorrectly.

    Deputy single example of php code and contact_owner.php

    single.php

    <?php get_header(); ?>
        <div class="grid_12">
          <?php yoast_breadcrumb(__('Home', 'wpct'), '/','<div class="breadcrumb">','</div>'); ?>
        </div>
        <div class="clear"></div>
        <div class="grid_8" id="content_main">
    	  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
          <div class="single_area">
            <h1><?php the_title(); ?></h1>
            <?php if (get_option("wpClassifieds_ad_code") != "") : ?>
            <p>
              <?php echo stripslashes(get_option('wpClassifieds_ad_code')); ?>
            </p>
            <?php endif; ?>
            <p>
              <strong><?php _e('Publish date', "wpct");?>:</strong> <?php the_time('F j, Y g:i a'); ?>
              <?php if(get_post_meta(get_the_ID(), "contact_name", true)) : ?>
               | <strong><?php _e('Contact Name', "wpct");?>:</strong> <?php echo get_post_meta(get_the_ID(), "contact_name", true); ?>
              <?php endif; ?>
              <?php if(get_post_meta(get_the_ID(), "price", true)) : ?>
               | <strong><?php _e('Price', "wpct");?>:</strong> <?php echo get_post_meta(get_the_ID(), "price", true); ?>
              <?php endif; ?>
              <?php if(get_post_meta(get_the_ID(), "region", true)) : ?>
               | <strong><?php _e('Region', "wpct");?>:</strong> <?php echo get_post_meta(get_the_ID(), "region", true); ?>
              <?php endif; ?>
              <?php if(get_post_meta(get_the_ID(), "place", true)) : ?>
               | <strong><?php _e('Location', "wpct");?>:</strong> <?php echo get_post_meta(get_the_ID(), "place", true); ?>
              <?php endif; ?>
              <?php if(get_post_meta(get_the_ID(), "phone", true)) : ?>
               | <strong><?php _e('Phone', "wpct");?>:</strong> <?php echo get_post_meta(get_the_ID(), "phone", true); ?>
              <?php endif; ?>
              <?php if(get_the_tag_list()) : ?>
               | <strong><?php _e('Tags', "wpct");?>:</strong> <?php echo get_the_tag_list('',', ',''); ?>
              <?php endif; ?>
            </p>
            <?php
    			$pictures = get_post_meta($post->ID, 'images', true);
    		  	if ($pictures) :
    		?>
            <div id="pictures">
              <?php
    		  	$pictures = explode(",", $pictures);
    			$upload_array = wp_upload_dir();
    			foreach($pictures as $picture) :
    				if ($picture != "") :
    			?>
                <a rel="facebox" href="<?php echo trailingslashit($upload_array['baseurl']).$picture ?>"><img src="<?php echo get_bloginfo('template_directory')?>/includes/timthumb.php?src=uploads/<?php echo $picture ?>&w=<?php echo get_option('wpClassifieds_athumb_size_w','110') ?>&h=<?php echo get_option('wpClassifieds_athumb_size_h','80') ?>&zc=1" alt="<?php the_title() ?>" title="<?php the_title()  ?>" /></a>
                <?php
    				endif;
    			endforeach;
    		  ?>
              <div class="clear"></div>
    		</div>
            <?php endif; ?>
            <?php the_content(); ?>
            <p>
              <strong><?php _e('Share', "wpct");?>:</strong>
              <a rel="nofollow" target="_blank" href="http://www.twitter.com/home?status=<?php echo get_the_title()." ".get_permalink();?>" title="Twitter <?php _e('Share', "wpct");?> <?php the_title(); ?>">Twitter</a> |
              <a rel="nofollow" target="_blank" href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>" title="Facebook <?php _e('Share', "wpct");?> <?php the_title(); ?>">Facebook</a> |
              <a rel="nofollow" href="mailto:?body=<?php the_permalink(); ?>&subject=<?php the_title(); ?>" title="Email <?php _e('Share', "wpct");?> <?php the_title(); ?>">Email</a>
            </p>
            <p>
              <?php if (function_exists('wpfp_link')) { wpfp_link(); echo " | "; } ?>
              <a rel="nofollow" href="<?php echo get_permalink(get_option('wpClassifieds_contact_page_id')); ?>?subject=<?php _e('Report bad use or Spam', "wpct");?> (<?php the_ID(); ?>) <?php the_title(); ?>"><?php _e('Report bad use or Spam', "wpct");?></a>
            </p>
          </div>
          <?php include(TEMPLATEPATH."/contact_owner.php");?>
          <?php comments_template(); ?>
          <?php endwhile; endif; ?>
    	</div>
    	<?php get_sidebar(); ?>
    <?php get_footer(); ?>

    contact_owner.php
    `<h3><?php _e(‘Contact Ad Owner’, “wpct”);?></h3>
    <?php
    if (cP(“contact”)==1){
    $error = false;
    $resp = recaptcha_check_answer (get_option(‘wpClassifieds_private_key’),$_SERVER[“REMOTE_ADDR”],$_POST[“recaptcha_challenge_field”],$_POST[“recaptcha_response_field”]);
    if(!$resp->is_valid) {
    $error = true;
    $error_text .= “<p>”.__(‘The captcha is wrong!’, “wpct”).”</p>”;//wrong email address
    }
    if(!isEmail(cP(“email”))) {
    $error = true;
    $error_text .= “<p>”.__(‘Not valid email address’, “wpct”).”</p>”;//wrong email address
    }
    if(isSpam(cP(“name”),cP(“email”),cP(“description”))) {//check if is spam!
    $error = true;
    $error_text .= “<p>”.__(‘Ups!Spam? if you are not spam contact us.’, “wpct”).”</p>”;
    }
    if(cP(“contact_name”) == “” || cP(“email”) == “” || cP(“msg”) == “”) {
    $error = true;
    $error_text .= “<p>”.__(‘Please complete the mandatory fields.’, “wpct”).”</p>”;
    }
    if (!$error){
    //generate the email to send to the client that is contacted
    $subject=”[“.get_bloginfo(‘name’).”] “.__(‘Re:’, “wpct”).” “.get_the_title();
    $body=cP(“contact_name”).” (“.cP(“email”).”) “.__(‘contacted you for the Ad’, “wpct”).”\n”.get_permalink().” \n \n”.cP(“msg”).” \n \n”;

    $headers = ‘From: ‘.cP(“contact_name”).’ <‘.cP(“email”).’>’ . “\r\n\\”;
    wp_mail(get_post_meta(get_the_ID(), “email”, true),$subject,$body,$headers);

    $error_text = “<p>”.__(‘Message sent, thank you.’, “wpct”).”</p>”;
    }
    }//if post
    ?>
    <?php if ($error_text) { echo “<div class=\”error-msg\”>$error_text</div>”; }?>

    <div id=”contactform” class=”contactform form”>
    <form action=”” method=”post”>
    <p>
    <label for=”contact_name”><small><?php _e(‘Your name’, “wpct”);?>*</small></label>
    <br />
    <input type=”text” name=”contact_name” id=”contact_name” class=”ico_person” value=”” />
    </p>
    <p>
    <label for=”email”><small><?php _e(‘Email’, “wpct”);?>*</small></label>
    <br />
    <input type=”text” name=”email” id=”email” class=”ico_mail” value=”” />
    </p>
    <p>
    <label for=”msg”><small><?php _e(‘Message’, “wpct”);?>*</small></label>
    <br />
    <textarea name=”msg” id=”msg” rows=”10″></textarea>
    </p>
    <p>
    <script type=”text/javascript”>
    var RecaptchaOptions = {
    theme : ‘clean’,
    };
    </script>
    <?php echo recaptcha_get_html(get_option(‘wpClassifieds_public_key’)); ?>
    </p>
    <p style=”margin-top:15px;”>
    <input type=”submit” class=”submit” value=”<?php _e(‘Contact’, “wpct”);?>” />
    <input type=”hidden” name=”contact” value=”1″ />
    </p>
    </form>
    </div>`

    Thanks

  • The topic ‘Problem theme wpclassifieds’ is closed to new replies.