Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Forum: Plugins
    In reply to: smiletag

    I’m in the same boat but I did get my login info, the login script just spits me back to login. ??

    This chat looks to have the features I would like. Anyone got a download they’d send me?

    I would love to see this plugin also. I have been googling around fully expecting this to have already been written. I have a chat that needs some management. Some users need cool off timeouts and to be taught manners.

    The ban/timeout could be permanent or time dependent. The post login screen should have a default message that could list the reason and how to get un-banned.

    Thread Starter clarkburbidge

    (@clarkburbidge)

    I may do some cleanup in the future, but will let the plugin author do any serious stuff if so desired, thus marked resolved, unless someone wants to offer some code suggestions for better WP & PHP poetry.

    Thread Starter clarkburbidge

    (@clarkburbidge)

    I made some progress on this idea after finding this post on imagemagick center cropping. I was able to add these lines to the random image plugin to get the center cropped images I wanted.

    I would love some feedback! I’m sure the code is ugly and could be full of holes:

    Add the following at line 582

    $SQUARESIZE = 100;
    $convertPath = "/usr/bin/convert";
    $savepath = "[FULL /path/to/cache]";
    $savepathURL = "[FULL https://... URL OF CACHE]";
    $filenamePart = basename($image_src);
    $squarename = "sq_".$filenamePart;
    $filename = $savepath.$squarename;
    if (file_exists($filename)) { } else {
    $squareCommand = $convertPath." \"".$image_src."\" -thumbnail x".($SQUARESIZE*2)." -resize '".($SQUARESIZE*2)."x<' -resize 50% -gravity center -crop ".$SQUARESIZE."x".$SQUARESIZE."+0+0 +repage -format jpg -quality 50 \"".$savepath.$squarename."\"";
    system($squareCommand);
    }

    In line 589 (for me now that I’ve pasted in that code) change from this:

    $image_html = str_replace("%2", "<a href='$post_permalink'><img src='$image_src' alt='$image_alt' $image_attributes /></a>", $image_html);

    to this:

    $image_html = str_replace("%2", "<a href='$post_permalink'><img src='$savepathURL$squarename' alt='$image_alt' $image_attributes /></a>", $image_html);

    Forum: Plugins
    In reply to: Customizable Post Listings

    This code lists all the comments made on your site with the author linked to the author page and the posts title linked to the post with the full comment content.

    <?php $fiveComments = $wpdb->get_results("SELECT wp_comments.comment_author, wp_comments.user_id, wp_comments.comment_content, wp_users.user_login, wp_posts.post_title, wp_posts.guid
    FROM $wpdb->comments						  LEFT JOIN $wpdb->posts ON wp_comments.comment_post_ID = wp_posts.ID
    LEFT JOIN $wpdb->users ON wp_comments.user_id = wp_users.ID
    ORDER BY $wpdb->comments.comment_date DESC"); ?>
    <ul><?php foreach ($fiveComments as $fiveComment) { ?>
    <li><a href="https://www.[yourblog].com/author/<?php echo $fiveComment->user_login; ?>/"><?php echo $fiveComment->comment_author; ?></a>
    on <a href="<?php echo $fiveComment->guid; ?>"><?php echo $fiveComment->post_title; ?></a> said - "<?php echo $fiveComment->comment_content; ?>"</li>
    <?php } ?></ul>

    This lists the last 5 comments made by an author on an author page as described here or by this plugin.

    <?php echo ('<h4>Recent Comments</h4>'); ?>
    <?php $fiveComments = $wpdb->get_results("
    SELECT wp_comments.comment_content, wp_posts.post_title, wp_posts.guid
    FROM $wpdb->comments
    LEFT JOIN $wpdb->posts ON wp_comments.comment_post_ID = wp_posts.ID
    WHERE user_id = $authid
    ORDER BY $wpdb->comments.comment_date
    DESC LIMIT 5
    "); ?>
    <ul>
    <?php foreach ($fiveComments as $fiveComment) { ?>
    <li>
    "<?php echo $fiveComment->comment_content; ?>" - <a href="<?php echo $fiveComment->guid; ?>"><?php echo $fiveComment->post_title; ?></a>
    </li>
    <?php } ?></ul>
    Forum: Plugins
    In reply to: Customizable Post Listings

    comment_approved = ‘1’ ??

    Forum: Plugins
    In reply to: Customizable Post Listings

    I used your post as inspiration to give it the old college try. I found this:

    https://codex.www.ads-software.com/Function_Reference/wpdb_Class#Examples_5

    and was able to get a list of 5 recent posts. But I really want 5 recent comments by an author. I have been unable to adapt the code to get comments.

    $authid is the user ID of the author.

    This worked for posts:

    <?php $fivePosts = $wpdb->get_results("SELECT ID, post_title, guid FROM $wpdb->posts
    	WHERE post_status = 'publish' AND post_author = $authid ORDER BY $wpdb->posts.post_date DESC
      LIMIT 5"); ?>
    <?php echo ('<h4>Recent Posts</h4>'); ?> 
    
    <ul><?php foreach ($fivePosts as $fivePost) { ?>
    		<li><a href="<?php echo $fivePost->guid; ?>"><?php echo $fivePost->post_title; ?></a></li>
    <?php } ?></ul>

    This did not for comments:

    <?php $fiveComments = $wpdb->get_results("SELECT comment_content FROM $wpdb->comments
    	WHERE comment_approved = 1 AND user_id = $authid ORDER BY $wpdb->comments.comment_date DESC
      LIMIT 5"); ?>
    <?php echo ('<h4>Recent Comments</h4>'); ?> 
    
    <ul><?php foreach ($fiveComments as $fiveComment) { ?>
    		<li><?php echo $fiveComment->comment_content; ?></li>
    <?php } ?></ul>

    Any help to get the comments one going?

    Forum: Plugins
    In reply to: Customizable Post Listings

    @andresc

    I’m using this plugin for two lists.

    1. As described in the post above, I’d like a list of the 10 most recent comments by a registered user, in this case user 8, but I will be making that take the user ID from whatever author is being viewed in the author template.

    2. In another instance list all the comments in a long list.

    Neither seem to work, but at the lorelle link above in the comments I was told that this plug in is in the process of being updated. I think that the queries are a bit off in the plugin as offered in the link I mention.

    Thread Starter clarkburbidge

    (@clarkburbidge)

    I solved my own Q. In the calendar_JCM.php are 3 numbers. Adjust them to match the role level of the users you are trying to give access to.

    Forum: Plugins
    In reply to: Customizable Post Listings

    I’ve got some mod code from comment #82 here https://lorelle.wordpress.com/2007/02/14/customizable-post-listings-wordpress-plugin

    I’m not able to get the
    c2c_get_recently_commented(10, "<li>%post_URL%</li>", "", "", "", "", '8'); ?>
    to display the single author’s comments. I’ve tried all sorts of variations 8, “8”, ‘8’, $curauthor->ID and none seem to work. c2c_get_recently_commented(10, "<li>%post_URL%</li>"); gets the last 10 comments from everyone.

    I was so stoked to find this plugin. It should do exactly what I need, but is not working. Any love out there?

    Forum: Fixing WordPress
    In reply to: How THis is work?

    That is very static. How about some example code that will work for every comment user automagically. What and where do I put here? From the K2 comments.php.

    <li class=”<?php /* Style differently if comment author is blog author */ if ($comment->comment_author_email == get_the_author_email()) { echo ‘authorcomment’; } ?> item” id=”comment-<?php comment_ID() ?>”>
    “>
    <?php if (function_exists(‘gravatar’)) { ?><img src=”<?php gravatar(“X”, 32, “”); ?>” class=”gravatar” alt=”Gravatar Icon” /><?php } ?>
    ” class=”counter” title=”Permanent Link to this Comment”><? echo $count_pings; $count_pings++; ?>
    <span class=”commentauthor” style=”font-weight: bold;”><?php comment_author_link() ?></span>
    <?php if ( $user_ID ) { edit_comment_link(‘<img src=”‘.get_bloginfo(template_directory).’/images/pencil.png” alt=”Edit Link” />’,'<span class=”commentseditlink”>’,'</span>’); } ?>
    <small class=”commentmetadata”>” title=”<?php if (function_exists(‘time_since’)) { $comment_datetime = strtotime($comment->comment_date); echo time_since($comment_datetime) ?> ago<?php } else { ?>Permalink to Comment<?php } ?>”><?php comment_date(‘M jS, Y’) ?> at <?php comment_time() ?></small>

    <div class=”itemtext”>

    <?php comment_text() ?>

    </div>

    <?php if ($comment->comment_approved == ‘0’) : ?>
    <p class=”alert”>Your comment is awaiting moderation.</p>
    <?php endif; ?>

    Anyone have any ideas on this? I’m interested in admin email going to two addresses.

Viewing 13 replies - 1 through 13 (of 13 total)