Forum Replies Created

Viewing 15 replies - 1 through 15 (of 20 total)
  • did you ever solve this?

    if you didnt, there are 2 options that i know of:

    1. you download a plug in that allows you to add attributes to built in functions. I have never tried this but it looks cool! https://guff.szub.net/2005/01/27/add-link-attribute/

    2. you edit the file wp-includes/comment-template.php, around line # 48. Add target=’_blank’

    Hope that helps

    Thread Starter andyb2

    (@andyb2)

    I’ve sorted it out!

    The reason this works is that there is a function comment_author_link() which does that. I didnt have that function in my code, just comment_author() and comment_author_url() which i was trying to use to achieve what comment_author_link() does.

    Thanks for making me look into the code

    Thread Starter andyb2

    (@andyb2)

    so did you convince yourself of the issue?
    What do you suggest?

    Thread Starter andyb2

    (@andyb2)

    i am not concerned with validation right now. The script above doesnt work.

    All i am trying to do is hyperlink a commenters name if they leave a web site URL when making a comment. If they dont leave a url i just want to dosplay the name with no hyperlink.

    The reason i am doing this is that i noticed that if you hyperlink all names with the url, then if the filed was left blank then the the default url is the name of the post. i dont want that!!

    so i tried this php code, but it is giving me strange results:-

    <?php
                $urlentered = comment_author_url();
               if (!empty($urlentered))
                    echo '<span class="commentauthor"><a href="',comment_author_url(),'" target="_blank">',  comment_author(), ' </a></span>';
               else
                    echo '<span class="commentauthor">',  comment_author(), ' </span>';
              ?>

    The strange result is that the url – when present- gets printed before the span tag.

    I’ve been struggling with this for days now!!!
    cheers

    Thread Starter andyb2

    (@andyb2)

    So i tried this piece of javascript

    <script language="JavaScript" type="text/Javascript">
    	if (<?php comment_author_url(); ?> != null) {
     	  document.write('<span class="commentauthor">  <a href="<?php comment_author_url(); ?>"><?php comment_author(); ?></a></span>');
    	} else {
              document.write('<span class="commentauthor">  <?php comment_author(); ?></span>');
    	}
    </script>

    but i have now read that document.write is not supported un xhtml.

    Any ideas what i could do??
    cheers

    Thread Starter andyb2

    (@andyb2)

    <a href="<?php comment_author_url(); ?>"><?php comment_author(); ?></a>

    Thread Starter andyb2

    (@andyb2)

    woops i guess i didn’t escape my characters
    here it is again, kind of!

    “><?php comment_author(); ?>

    Thread Starter andyb2

    (@andyb2)

    does anyone know where wp-die function is located?

    thanks

    Thread Starter andyb2

    (@andyb2)

    ok. nevermind.
    I had erroneously made changes in post.php to redirect to post-thanks.php.

    I guess post.php is called after an admin post

    where wp-comments-post.php is called after a reply to a post

    does that sound right?

    thanks

    Thread Starter andyb2

    (@andyb2)

    Hi,

    So i created a redirect but …

    After comments are sent the user is redirected to a thank you page which looks great. I acheived this by modifying the $location variable in wp-comments-post.php.

    However when i create new posts in the wordpress admin interface i get the following message

    Parse error: syntax error, unexpected ‘<‘ in /home/…/post-thanks.php on line 2

    Any ideas what this means?
    thanks

    Thread Starter andyb2

    (@andyb2)

    Works like a charm. Thanks

    Thread Starter andyb2

    (@andyb2)

    Thanks guys,
    I’ll give the plug in a try and see if i can customize it to my liking

    Thread Starter andyb2

    (@andyb2)

    Hi,
    So to answer, i do not have WordPress installed on the new server. I just copied the files from the old server.

    So i do not have a database associated with wordpress on the new server.

    thanks

    Thread Starter andyb2

    (@andyb2)

    Initially i installed WP on my new server. I then uninstalled it. It was a different version. Old vesion is 2.1.3.

    I then, as per the instruction from the above link said, copied all of the files that used to reside in my previous blog.

    I did not create a new database either. All i did was to log into cpanel choose my sql databases then through phpmyadmin, i just tried to import the old database that i’d downloaded from my old server 10 minutes previous.

    Thanks for the help
    Andy

    Thread Starter andyb2

    (@andyb2)

    Thanks
    That was great!

    However, I have had a hickup. I downloaded the database as instructed, but when i try to upload the database (using import in myphpadmin) i get the following error:

    SQL query:

    — phpMyAdmin SQL Dump
    — version 2.9.0.2
    https://www.phpmyadmin.net

    — Host: localhost
    — Generation Time: Jun 08, 2007 at 01:17 PM
    — Server version: 5.0.27
    — PHP Version: 4.4.2

    — Database: bello3_wrdp1

    — ——————————————————–

    — Table structure for table wp_categories

    DROP TABLE IF EXISTS wp_categories ;

    MySQL said: Documentation
    #1046 – No database selected

    What is this telling me i am doing wrong?
    Any ideas?

    Thanks

Viewing 15 replies - 1 through 15 (of 20 total)