Tangler Discussion Forums

Discuss

Topics

Click a Topicto start discussing

    For the affiliate link to be opened in a new window, where should I put the

    TARGET="_blank" code?

    Here is the affiliate php code in its entirety. Thanks in advance. 

    ================================
     

    <?php
        if (isset($_POST['rs_keywords'])) {
            $keywords = array();
            foreach ($_POST['rs_keywords'] as $id => $keyword)
                if (!empty($keyword) && !empty($_POST['rs_urls'][$id])) {
                    $keywords[] = array(str_replace('"', '', stripslashes($keyword)), stripslashes($_POST['rs_urls'][$id]));
                }
                   
            update_option('rs_keywords', $keywords);
        }

        $keywords = get_option('rs_keywords');
        $css = get_option('rs_css');
    ?>

    <script type="text/javascript">

        function removeElement(id) {
            var pd = document.getElementById('keywords_td');
            var old = document.getElementById('rs_keywords_' + id);
            pd.removeChild(old);
            var old = document.getElementById('rs_urls_' + id);
            pd.removeChild(old);
            var old = document.getElementById('rs_remove_' + id);
            pd.removeChild(old);
        }

    </script>

    <div class="wrap">
    <h2>WP Review Site Affiliate Link Settings</h2>
    <form method="post" action="" id="rs_aff_conf">

    <p>WP Review Site can automatically turn keywords in your post text into affiliate links. Specify keywords on the left,
    and the URL those keywords should be linked to on the right.</p>

    <table class="form-table">
    <tr valign="top">
    <th scope="row"><label for="keywords">Edit Keywords</label></th>
    <td id="keywords_td">
        <?php
            if (!empty($keywords)) {
                foreach ($keywords as $id => $arr) {
                    $keyword = $arr[0];
                    $url = $arr[1];
                   
                    echo 'Keyword: <input type="text" id="rs_keywords_' . $id . '" name="rs_keywords[' . $id . ']" value="' . $keyword . '" /> ';
                    echo 'URL: <input type="text" id="rs_urls_' . $id . '" name="rs_urls[' . $id . ']" value="' . $url . '" /> ';
                    ?>
                    <a href="" id="rs_remove_<?php echo $id; ?>" />

    </form>
    </div>

    ======================

    Roy

    2009-03-20 10:28:46.0

    Hi Dan, following your advice and included the /, I still could not get that right. Would you be kind enough to show me the light? Thanks!

    2009-03-20 22:55:32.0

    This is not the right file, the function is in review-site.php called "rs_affiliate_markup".

    Here is the modified version of the line to change:

    $content = str_replace($keyword, "<a href=\"" . $url . "\" target=\"_blank\">" . $keyword . "</a>", $content);

    2009-03-21 00:14:02.0

    Dear Dan, it's like music in my ears. Thank you! Thank you! Thank you!

    2009-03-21 01:38:04.0
To send a message, Join Now (it's quick and free) or Sign In
Edit Topic
Delete Topic
Are you sure you want to delete the topic