need some code work for wordpress done asap..

Discussion in 'Programming' started by johno123, Nov 8, 2008.

  1. #1
    Hi all,

    I need some help with a new project im working on in wordpress.



    I have a question, maybe it is simple for you but im stumped.

    "In wordpress" ...

    I would like to have it so browsing users, that are looking at a post someone posted. Can send an email relating to that post directly to the author. Just by clicking on a button located at the bottom of the post.

    It would be “mailto:” function of sorts i would guess. ?

    I want the button to be able to send the email to the author of that specific post, maybe with the post's title in the emailed subject line..

    If anyone could give me any idea on what to do, i would really appreciate the help.


    [​IMG]



    Offer your help by pm or post
     
    johno123, Nov 8, 2008 IP
  2. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Are you looking for this one?

    
    <a href="mailto:<?php the_author_email(); ?>?subject=<?php the_title(); ?>
    ">Contact the author</a>
    
    PHP:
     
    YIAM, Nov 9, 2008 IP
  3. masgov

    masgov Member

    Messages:
    460
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    i can help you out now... $10 for this
     
    masgov, Nov 9, 2008 IP
  4. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    Oh nice!!!!


    It worked thank you sooooooooooooooooo much,

    Is it possible to have it so link is only seen or clickable to registered users? Or make it go to a form page that hides the authors email for the guests asking?

    (" i am trying to keep away email harvesters and spammers..")


    I also wanted to know if it is possible to show how many posts are shown in the profile page of the author?

    example. ( (2) Articles posted ) - And would also like the number shown, to be clickable to go to the authors articles..

    What file would i edit for this info to go into the profile page of authors?


    thx
     
    johno123, Nov 9, 2008 IP
  5. Belthasar

    Belthasar Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    you can try this

    
    <?php
    if(isset($_COOKIE['wordpress_logged_in_' . COOKIEHASH]))
    {
       echo '<a href="mailto:'.the_author_email().'?subject='.the_title().'">Contact the author</a>';
    }
    ?>
    
    PHP:
     
    Belthasar, Nov 9, 2008 IP
  6. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    hi there Belthasar

    I tried that code and it did not work.

    it came out like this

    article titleContact the author

     
    johno123, Nov 9, 2008 IP