Forum Replies Created

Viewing 15 replies - 76 through 90 (of 100 total)
  • ptvguy

    (@ptvguy)

    Nevermind, podz, I was overthinking it. Now I’m set up to have accessible external links even where the comment author’s name links to their site, and I’ve eliminated my username in my own comments from having any kind of hyperlink:

    function get_comment_author_link() {
    global $comment;
    $url = get_comment_author_url();
    $author = get_comment_author();

    if ( empty( $url ) || 'http://' == $url || 'ptvGuy' == $author || 'ptvguy' == $author )
    $return = $author;
    else
    $return = "<a href=\"$url\" class=\"externalLink\" rel=\"external\" title=\"$author\">$author</a>";
    return apply_filters('get_comment_author_link', $return);
    }

    Onward to my next battle, how to do the same thing to external hyperlinks contained within the text of a comment…

    ptvguy

    (@ptvguy)

    Podz:

    I’ve been fighting with this one for awhile and no matter what I do, I can’t get it to accept more than two elements through the anchor tag. In other words, if I try to do it like yours, it takes the href and the rel elements and smashes them together into a single href element and adds the target as the second element thus creating a nonworking URL. In my case, I’m also trying to add in a fourth element as a title attribute. (See below.) I’ve also modded the OR conditions to eliminate my own comments from even having a link.

    function get_comment_author_link() {
    global $comment;
    $url = get_comment_author_url();
    $author = get_comment_author();

    if ( empty( $url ) || 'http://' == $url || 'ptvGuy' == $author || 'ptvguy' == $author )
    $return = $author;
    else
    $return = "<a href='$url' rel='external' class='externalLink' title='$author'>$author</a>";
    return apply_filters('get_comment_author_link', $return);
    }

    I’m not sure if this is a theme-related problem or if it has to do with the sprintf. BTW, if you’re wondering what the point of all that is, it’s to add a little accessibility to my comment hyperlinks.

    ptvguy

    (@ptvguy)

    Without changing anything, go to Options >> Permalinks and click the “Update Permalink Structure” button. Every once in a while, WP loses track of where things are–especially after editing or renaming a post or page.

    If that doesn’t work, double-check all of your post, page, and category titles to see if they match the “post slug.” The post slug is the “folder” name where that link goes to and should contain every word in your title separated by single dashes. I’m noticing that your “Civil liberties” category is actually linked to “uncategorized.”

    Hope this helps. Someone had to help me with this problem a while back too.

    ptvguy

    (@ptvguy)

    WordPress does trackbacks automatically. Anyone linking to one of your posts will be automatically “discovered.” You’ll see the trackback appear in your comments unless you’ve disabled that function.

    ptvguy

    (@ptvguy)

    Tom, there are numerous Admin plugins available for WordPress. I caution you, however, to be extremely careful in the use of these. Playing with the WP Dashboard has a lot of potential for hard to correct mistakes. If you do try it, back up everything including your WP database first.

    Also, please consider the fact that you’ve posted a (limited access) username and password into a very public forum, and, once a user gets to your site, they have access to all of your student’s email addresses. Depending on your school’s policies, that could represent a violation of student privacy. Just thought you should know.

    BTW, you might want to check out Andy Carvin’s educational technology blog for his very positive write-up on the use of blogs for teaching.

    Everything from here down is personal opinion and you’re, of course, free to ignore it:

    The kind of “dumbing down” of the WordPress interface that you’re considering would, I think, be a disservice to your students in the long run. The WordPress dashboard is actually quite intuitive. Students that haven’t already mastered at least this limited level of technological interaction by college are facing a future of even more limited prospects.

    Also, one could make the argument that the ability to categorize one’s writing into specific subjects (categories) is an essential part of the writing process itself and failure to do so shows both a lack of thought and focus on the part of the writer. If nothing else, college-level writing should be about doing some hard thinking, and basic categorization just isn’t part of that–unless this is some kind of remedial program you’re teaching.

    ptvguy

    (@ptvguy)

    I use basic DIV tags wrapped around my adSense code as you wrote above, but I added some formatting to the CSS file for my theme so that I could have more control over how each ad displays:

    /* ---------------------------------
    - GOOGLE ADVERTISING CSS -
    --------------------------------- */

    .adleft {
    display: block;
    float: left;
    padding: 0 2px 2px 0;
    }

    .adright {
    display: block;
    float: right;
    padding: 0 0 2px 2px;
    }

    .adtop {
    display: block;
    float: left;
    padding: 3px 0 0 0;
    }

    .adfirefox {
    display: block;
    text-align: center;
    padding: 2px 0 0 0;
    }

    .adside {
    display: block;
    text-align: center;
    padding: 10px 0 0 0;
    }

    .adbottom {
    display: block;
    float: left;
    padding: 3px 0 3px 10px;
    }

    Therefore, to use your example above, I would write it into my post as follows:

    <div class="adright"><script=adsense code blah blah></script></div>

    This allows my post text to wrap around my advertising (which I’ve set up to match my site theme as closely as possible.) If you’re wondering about the rest of those classes defined in there, adtop and adbottom apply to the big “Get Firefox” button/banner at the top and bottom of by pages, the adside controls most of the sidebar advertising, and the adfirefox controls the big “Get Firefox” button on the sidebar. You ought to be able to adapt or delete these to work on your site.

    Also, if you haven’t already gotten it, I highly recommend the Adsense-Deluxe plugin from Acme Technologies.

    ptvguy

    (@ptvguy)

    Some of your CSS is FireFox and Mozilla specific, so that kind of thing will probably never validate. It’s a personal style choice, anyway. I’m seeing some code in the primary style sheet that I would have formulated a little differently. It’s not a big deal, but you could try replacing this:

    h1 a, h1:visited { color: #fff; text-decoration: none; }

    with this:

    h1 a, h1 a:visited { color: #fff; text-decoration: none; }

    And there’s a lot of non-IE code in use in the LIGHTBOX plugin stylesheet. IE doesn’t support the outline attribute for one thing:

    #hoverNav a{ outline: none;}

    Although it doesn’t do the same thing, you’ll probably have to stick with the border attribute for IE. In fact there’s some CSS3 stuff going on in that entire style sheet that is only haphazardly supported in browsers. Believe me, I’d love to make more extensive use of the before and after features of the content attribute, but it just doesn’t work well enough yet.

    Also, using display: inline-block to set a width on an inline element is pretty iffy at best.

    * html>body .clearfix {
    display: inline-block;
    width: 100%;
    }

    Even with all that said, it all seems to work fine for me in both IE 6 and FF 1.5.0.4. So, personally, I wouldn’t worry about it.

    ptvguy

    (@ptvguy)

    Now we need a workaround for it so that it only identifies our own comments as true. Everyone else’s comments should, of course, be taken with a grain of salt. ;>

    ptvguy

    (@ptvguy)

    For any of you that may be interested in web accessibility and current standards, the better method for opening a new window is to use accessible JavaScript. The “target” property has long been deprecated.

    An “externalLink” class attribute tied to the anchor tag as outlined by Paul Boag over on boagworld.com is far more accessible and standards compliant. You can set the function up as outlined above, only using class='externalLink' in place of target='_blank'

    The only problem with using this method is that it will force your own user name in comments to open in a new window as well. The workaround for that is to add an extra OR condition to remove the hyperlink from your own user name. The code outlined below should work for you if you’re using that type of JavaScript pseudo-class.

    function get_comment_author_link() {
    global $comment;
    $url = get_comment_author_url();
    $author = get_comment_author();

    if ( empty( $url ) || 'http://' == $url || get_bloginfo('name') == $author )
    $return = $author;
    else
    $return = "<a href='$url' rel='external nofollow' title='$author' class='externalLink'>$author</a>";
    return apply_filters('get_comment_author_link', $return);
    }

    If, for some reason, the get_bloginfo('name') isn’t excluding your username, then just encase your user name in single quotes in place of that function and remember that it’s case-sensitive. In other words, I could accomplish the same thing on my blog by putting 'ptvGuy' in that position.

    On a side note, you could potentially add more OR conditions to that line and exclude other user names from getting a hyperlink as well.

    ptvguy

    (@ptvguy)

    Sorry, egarcia, but I spoke/wrote too soon. I associated the disappearing category situation with the appearance of a post-dated (?pre-dated?) post, because that was the first time I noticed it. As it turns out (and I would have known this sooner if the forum search hadn’t been down when I was hunting for it) the problem–at least in my case–had to do with a preset WP limit of 100 categories. You can create more, but they won’t show up in your Write or Edit Post sidebar. The fix is posted elsewhere (http://wordpress.org/support/topic/61255?replies=2) but with some pertinent details left out.

    The following function:

    function return_categories_list($parent = 0) {
    global $wpdb;
    return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC LIMIT 100");
    }

    is located in the “wp-admin” folder in a file called “admin-functions.php”. You have to edit that externally from WP and change the default limit to a larger number like 10000 so that it looks like this:

    function return_categories_list($parent = 0) {
    global $wpdb;
    return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC LIMIT 10000");
    }

    ptvguy

    (@ptvguy)

    That happened to me once when I post-dated a post. In other words, I created a post and added the appropriate categories (making sure they were checked to be used) and then used the Edit Time-Stamp function to make sure that the post wouldn’t appear until I wanted it to. When it did finally appear right on time, it had only the categories that were in place prior to that posting. None of the added categories were associated with it or would even show up when I went to edit it. I had to re-add them to the post in the edit window. This resulted in all of those categories being correctly associated with that post, but there were, strangely, just a couple of them that ended up in the category list twice, once associated with the post and once empty. I then had to go back through the Manage Categories list to delete the duplicate, empty categories.

    Anyway, I know this is kind of long, but I thought it might either help your situation or someone else looking through the forums for a similar problem.

    I simply link to my Odeo channel to listen to my podcasts from my podOmatic feed. To save bandwidth, I host my podcasts on a currently free podOmatic account and link each post directly to the podOmatic player in a window that opens seperately. I strip the tags and some other information from the URL parameter pass in order to minimize the podOmatic exit points from the resulting page.

    I like Odeo, but their player requires users to have Flash. I know that most people do, but I don’t want to require it for hearing my podcast. There are a number of WP media player plugins that I was going to check out later after I finished with some other stuff I’m setting up for my site.

    If you’re going to actually use the Odeo player, then you should wrap the embed tags up with object tags (and the appropriate parameters) for cross-browser compatibility. That may be your problem.

    BTW, I love your inaugural broadcast on web accessibility. Very pragmatic. ;> I’ll be linking to it from my own accessibility series.

    If your planning to move the blog to a subfolder later, you might as well start it out there. (Moving it later can be a pain.) You can always make the homepage in the root folder into a cover page lead-in for your blog while you build the rest of your non-blog site.

    Cool. Glad it worked out. Make sure you mark this post “resolved.”

    Go back to the phpMyAdmin and make sure that you’ve already set up a mySQL database for WordPress and created a user for it with appropriate permissions to access and modify it. Then make sure that you have modified the wp-config.php file appropriately:

    define(‘DB_NAME’, ‘YOURDATABASENAMEHERE’); // The name of the database
    define(‘DB_USER’, ‘YOURDATABASEUSERNAMEHERE’); // Your MySQL username
    define(‘DB_PASSWORD’, ‘YOURDATABASEPASSWORDHERE’); // …and password

Viewing 15 replies - 76 through 90 (of 100 total)