Posts Tagged php 5.2.12

SuzanneHow to separate the trackbacks and pingbacks from comments?

Thursday, February 18th, 2010

Comments on blogs are often criticized as lacking authority, since anyone can post anything using any name they like: there’s no verification process to ensure that the person is who they claim to be. Trackbacks and Pingbacks both aim to provide some verification to blog commenting.

But having trackbacks, pingbacks and comments all mixed up in one place can get really messy and confusing. Let’s separate the trackbacks and the pingbacks from comments-
<strong><?php if ($comments) : ?>
<ol>
<?php foreach ($comments as $comment) : ?>
<li id=”comment-<?php comment_ID() ?>” class=’commentItem’>
<!– THE COMMENT LAYOUT –>
</li>
<?php endforeach; /* end for each comment */ ?>
</ol>
<?php endif; ?></strong>
Above we can see a stripped version of an ordinary comment loop which will show comments, trackbacks and pingbacks all in one place. Let’s change that.
<strong><?php if ($comments) : ?>
<ol>
<?php foreach ($comments as $comment) : ?>
<?php
$commentType = get_comment_type();
if($commentType == ‘comment’) :
?>
<li id=”comment-<?php comment_ID() ?>” class=’commentItem’>
<!– THE COMMENT LAYOUT –>
</li>
<?php endif;/* end if comment check */ ?>
<?php endforeach; /* end for each comment */ ?>
</ol>
<?php endif; ?></strong>
get_comment_type is a function that returns “comment”, “trackback” or “pingback” depending what type the current comment is.
Now just copy paste the same code again and just change “if($commentType == ‘comment’)” toif($commentType != ‘comment’) which is the opposite of “==” and change the class from“commentItem” to “trackbackItem” so you can easily make different styles.
<strong><?php if ($comments) : ?>
<ol>
<?php foreach ($comments as $comment) : ?>
<?php
$commentType = get_comment_type();
if($commentType != ‘comment’) :
?>
<li id=”comment-<?php comment_ID() ?>” class=’trackbackItem’>
<!– THE PINGS LAYOUT –>
</li>
<?php endif;/* end if NOT comment check */ ?>
<?php endforeach; /* end for each comment */ ?>
</ol>
<?php endif; ?></strong>
Making the layout for pingbacks/trackbacks is very simple, there is only 1 function we are going to use, comment_author_link(). It just echoes the trackback/pingbacks link and that’s all we need.
<strong><li id=”comment-<?php comment_ID() ?>” class=’trackbackItem’>
<?php comment_author_link(); ?>
</li></strong>

Having trackbacks, pingbacks and comments all mixed up in one place can get really messy and confusing. Let’s separate the trackbacks and the pingbacks from comments-

<?php if ($comments) : ?>

<ol>

<?php foreach ($comments as $comment) : ?>

<li id=”comment-<?php comment_ID() ?>” class=’commentItem’>

<!– THE COMMENT LAYOUT –>

</li>

<?php endforeach; /* end for each comment */ ?>

</ol>

<?php endif; ?>

Above we can see a stripped version of an ordinary comment loop which will show comments, trackbacks and pingbacks all in one place. Let’s change that.

<?php if ($comments) : ?>

<ol>

<?php foreach ($comments as $comment) : ?>

<?php

$commentType = get_comment_type();

if($commentType == ‘comment’) :

?>

<li id=”comment-<?php comment_ID() ?>” class=’commentItem’>

<!– THE COMMENT LAYOUT –>

</li>

<?php endif;/* end if comment check */ ?>

<?php endforeach; /* end for each comment */ ?>

</ol>

<?php endif; ?>

get_comment_type is a function that returns “comment”, “trackback” or “pingback” depending what type the current comment is.

Now just copy paste the same code again and just change “if($commentType == ‘comment’)” toif($commentType != ‘comment’) which is the opposite of “==” and change the class from“commentItem” to “trackbackItem” so you can easily make different styles.

<?php if ($comments) : ?>

<ol>

<?php foreach ($comments as $comment) : ?>

<?php

$commentType = get_comment_type();

if($commentType != ‘comment’) :

?>

<li id=”comment-<?php comment_ID() ?>” class=’trackbackItem’>

<!– THE PINGS LAYOUT –>

</li>

<?php endif;/* end if NOT comment check */ ?>

<?php endforeach; /* end for each comment */ ?>

</ol>

<?php endif; ?>

Making the layout for pingbacks/trackbacks is very simple, there is only 1 function we are going to use, comment_author_link(). It just echoes the trackback/pingbacks link and that’s all we need.

<li id=”comment-<?php comment_ID() ?>” class=’trackbackItem’>

<?php comment_author_link(); ?>

</li>

http://www.all1Press.com

http://www.all1martpro.com

Tags: , , , ,
Posted in Opensource, Purely Technical | 2 Comments »

NaggiePHP 5.2.12 Release Announcement

Wednesday, January 27th, 2010

The PHP development team would like to announce the immediate availability of PHP 5.2.12. This release focuses on improving the stability of the PHP 5.2.x branch with over 60 bug fixes, some of which are security related. All users of PHP 5.2 are encouraged to upgrade to this release.

Security Enhancements and Fixes in PHP 5.2.12:

  1. Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak. (CVE-2009-3557, Rasmus)
  2. Fixed a open_basedir bypass in posix_mkfifo() identified by Grzegorz Stachowiak. (CVE-2009-3558, Rasmus)
  3. Added “max_file_uploads” INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion, identified by Bogdan Calin. (CVE-2009-4017, Ilia)
  4. Added protection for $_SESSION from interrupt corruption and improved “session.save_path” check, identified by Stefan Esser. (CVE-2009-4143, Stas)
  5. Fixed bug #49785 (insufficient input string validation of htmlspecialchars()). (CVE-2009-4142, Moriyoshi, hello at iwamot dot com)

Key enhancements in PHP 5.2.12 include:

  • Fixed unnecessary invocation of setitimer when timeouts have been disabled. (Arvind Srinivasan)
  • Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre)
  • Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery() when calling using Reflection. (Felipe)
  • Fixed crash when instantiating PDORow and PDOStatement through Reflection. (Felipe)
  • Fixed memory leak in openssl_pkcs12_export_to_file(). (Felipe)
  • Fixed bug #50207 (segmentation fault when concatenating very large strings on 64bit linux). (Ilia)
  • Fixed bug #50162 (Memory leak when fetching timestamp column from Oracle database). (Felipe)
  • Fixed bug #50006 (Segfault caused by uksort()). (Felipe)
  • Fixed bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault). (Felipe)
  • Fixed bug #49174 (crash when extending PDOStatement and trying to set queryString property). (Felipe)
  • Fixed bug #49098 (mysqli segfault on error). (Rasmus)
  • Over 50 other bug fixes.

http://www.all1martpro.com

http://get-a-designer.com

Tags: , , , , , ,
Posted in Company Activity, New Product, Team's Blogs | No Comments »