1. Este site usa cookies. Ao continuar a usar este site está a concordar com o nosso uso de cookies. Saber Mais.

Configurar plugin no wordpress

Discussão em 'Web Development' iniciada por uterrorista, 24 de Dezembro de 2007. (Respostas: 3; Visualizações: 1510)

  1. uterrorista

    uterrorista Suspenso

    Estou com problemas a configurar um plugin no wordpress.
    Aviso desde já que qualquer linguagem de 'web' não é comigo (Só C..)..

    Estou a tentar configurar o Math Comment Spam Protection Plugin.
    que consiste em instalar o plugin etc.. e colocar:
    Código:
    <?php 
    /****** Math Comment Spam Protection Plugin ******/
    if ( function_exists('math_comment_spam_protection') ) { 
        $mcsp_info = math_comment_spam_protection();
    ?>     <p><input type="text" name="mcspvalue" id="mcspvalue" value="" size="22" tabindex="4" />
        <label for="mcspvalue"><small>Spam protection: Sum of <?php echo $mcsp_info['operand1'] . ' + ' . $mcsp_info['operand2'] . ' ?' ?></small></label>
        <input type="hidden" name="mcspinfo" value="<?php echo $mcsp_info['result']; ?>" />
    </p>
    <?php } // if function_exists... ?>
    no comments.php.



    o meu (comments.php) é este:
    Código:
    <?php // Do not delete these lines
        if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
            die ('Please do not load this page directly. Thanks!');
    
            if (!empty($post->post_password)) { // if there's a password
                if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
                    ?>
    
                    <p class="nocomments">This post is password protected. Enter the password to view comments.<p>
    
                    <?php
                    return;
                }
            }
        
    
            /* This variable is for alternating comment background */
            $oddcomment = 'alt';
    ?>
    
    <!-- You can start editing here. -->
    
    <a name="respond" id="respond"> </a>
    <?php $i = 0; ?>
    <?php if ($comments) : ?>
    <div id="comments">
        <h2><?php comments_number('No comments as yet','1 person has left a comment','Horaayy..there are % comment(s) for me so far ;)'); ?></h2>
    
    
        <?php foreach ($comments as $comment) : ?>
        <div class="comment">
            <?php $i++; ?>
            <a name="comment-<?php comment_ID(); ?>" id="comment-<?php comment_ID(); ?>" ></a>
                
            <span class="comment-number"><?php echo "#"; echo $i; ?></span>
            <?php if ($comment->comment_approved == '0') : ?>
                <span class="moderate"> Thank you for your comment. Your comment is now awaiting moderation.</span>
            <?php endif; ?>
            <div class="commenttext">
                <?php comment_text() ?>
            </div>
    
            <div class="data">
                <span class="comment-footer"><strong><a href="<?php comment_author_url(); ?>" target="_blank"><?php comment_author() ?></a></strong> wrote on <?php comment_date() ?> - <?php comment_time() ?> <?php edit_comment_link('Edit this comment','&nbsp;&nbsp;',''); ?></span>
            </div>
            
        </div>
            
        <?php endforeach; /* end for each comment */ ?>
        
        <div id="trackback">
            <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
            // Both Comments and Pings are open ?>
            You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
            <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
            // Only Pings are Open ?>
            Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
            <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
            // Comments are open, Pings are not ?>
            You can skip to the end and leave a response. Pinging is currently not allowed.
            <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
            // Neither Comments, nor Pings are open ?>
            Both comments and pings are currently closed.
            <?php } ?>
        </div>
        
    </div>
    
     <?php else : // this is displayed if there are no comments so far ?>
    
      <?php if ('open' == $post->comment_status) : ?> 
            <!-- If comments are open, but there are no comments. -->
        <div class="no-comments"><h2><?php _e('Sorry, no comments yet.'); ?></h2></div>
         <?php else : // comments are closed ?>
            <!-- If comments are closed. -->
        <div class="no-comments"><h2>Sorry, comments are closed.</h2></div>
    
        <?php endif; ?>
    
        <p>
        <!-- ?php comments_rss_link(__('<abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.')); ? --> 
        <?php if ( pings_open() ) : ?>
            <!-- a href="<?php trackback_url() ?>" rel="trackback"><?php _e('TrackBack <abbr title="Uniform Resource Identifier">URI</abbr>'); ?></a -->
        <?php endif; ?>
        </p>
    
    <?php endif; ?>
    
    
    <div id="commentform">
        <a name="write-comment" id="write-comment"> </a>
        <?php if ('open' == $post->comment_status) : ?>
        <h2>Write Your Comment</h2>
    
        <!-- registration required message -->
        <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    
            <p class="guidelines">You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
        
        <?php else : ?>
    
            <p class="guidelines"><strong>Comment Guidelines:</strong> Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.</p>
    
            <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="form">
    
        <?php if ( $user_ID ) : ?>
    
            <p class="guidelines">Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout &raquo;</a></p>
            
        <dl>
        <dt>
            <label for="comments">Comments:</label>
        </dt>
        <dd>
            <textarea name="comment" id="comment" rows="10" cols="40"></textarea>
            <span class="hint">This is where you type your comments.<span class="hint-pointer">&nbsp;</span></span>    
        </dd>
        
        </dt>
        <dd>
            <input type="submit" value="Submit" class="submit" id="submit" />
            <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
        </dd>
        
        </dl>
            
            
        <?php else : ?>
    
            <dl>
    
        <dt>
            <label for="username">Name:</label>
        </dt>
        <dd>
        <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" />
            <span class="hint">You should have a name, right?<span class="hint-pointer">&nbsp;</span></span>    </dd>
        
        
        <dt>
            <label for="email">Your email address:</label>
        </dt>
        <dd>
        <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" />
            <span class="hint">Your email address, I promised I won't tell it to anyone.<span class="hint-pointer">&nbsp;</span></span>    </dd>
        
        <dt>
            <label for="url">Website / Blog URL:</label>
        </dt>
        <dd>
            <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" />
            <span class="hint">If you have a web site or blog, you can type the URL right here.<span class="hint-pointer">&nbsp;</span></span>    
        </dd>
        
    [COLOR=Red]/** a caixa de verificação deve ficar por aqui.. **/[/COLOR]
    
        <dt>
            <label for="comments">Comments:</label>
        </dt>
        <dd>
            <textarea name="comment" id="comment" rows="10" cols="35"></textarea>
            <span class="hint">This is where you type your comments.<span class="hint-pointer">&nbsp;</span></span>    
        </dd>
        
        <dd><input type="checkbox" name="remember" /> Remember my information for the next time I visit.</dd>
        
        <dt class="button">&nbsp;</dt>
        <dd class="button">
            <input type="submit" value="Submit" class="submit" id="submit" />
            <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
        </dd>
    </dl>
            
    
        <?php endif; ?>
    
        <?php do_action('comment_form', $post->ID); ?>
        </form>
    
    
        <?php endif; // If registration required and not logged in ?>
    
    <?php endif; // if you delete this the sky will fall on your head ?>
    
    </div>
    
    tentei colar o código directamente na zona escrita a vermelho.
    como pude verificar a pintura ficou logo toda borrada.

    Queria ajuda para saber onde colocar o código...
     
  2. rpnetwork

    rpnetwork Power Member

    Acho que tens de ir ao /wp-admin/ e deve tar escrito o nome do plugin em algum lado pa tu activares ...
    Há mais procedimentos a ter em relação a aplicação do plugin?
     
  3. uterrorista

    uterrorista Suspenso

    01 - OK - Eu já coloquei o plugin no sitio correcto.
    02 - KO - Agora tenho de editar o ficheiro comments.php e colocar o um bocado de código no sitio certo. a minha dúvida é esta...

    Os procedimentos todos estão no link do 1º post.
     

Partilhar esta Página