Recent Topics

1 Aug 20, 2006 15:01    

Is there a way you can actualy see the content of the comments you have to moderate in the frontoffice if you are logged in as an admin ?

Then next to the comment you can put a link to 'publish_comment' or 'deprecate_comment'

That saves you a trip to the backoffice...

Is that possible ?

2 Mar 21, 2007 12:38

If possible this would be great.

However I'd also be happy to see a note next to a post that states 'x unmoderated comments'.

3 Mar 22, 2007 11:40

I think you can do it by editing skins/_lastcomments.php. Open it up and find this:

$CommentList = & new CommentList( $blog, "'comment','trackback','pingback'", array('published'), '', '', 'DESC', '', 20 );


Then replace it with this:

if( is_logged_in() ) {
	$CommentList = & new CommentList( $blog, "'comment','trackback','pingback'", array('published','protected'), '', '', 'DESC', '', 20 );
	} else {
	$CommentList = & new CommentList( $blog, "'comment','trackback','pingback'", array('published'), '', '', 'DESC', '', 20 );
	}

4 Aug 09, 2007 18:22

Hmmm, that isn´t working for me... logged in I see not the one comment that is currently in draft mode... but why? Is "protected" the setting for a draft comment that is waiting for moderation?

And by the way... it it possible to have a message (only if logged in), that says: "you have x comments for moderation"?

(I´m using b2evo v1.9.2)

5 Aug 09, 2007 18:32

Somewhere we have a plugin that will show you comments awaiting moderation ...... buggered if I can find it, but when I do I'll link it ;)

¥

6 Aug 09, 2007 18:40

Ok, would be nice, because besides this topic I haven´t found it here in the forum (yet)...

What about my first question above... any suggestions?

D.

7 Oct 08, 2007 14:38

Hmmm, still not solved... any ideas how to show comments awaiting moderation when logged in as well in the sidebar for b2evo 1.9.2 ???

8 Oct 08, 2007 14:41

Oh... using the element index this was easy...

$CommentList = & new CommentList( $blog, "'comment','trackback','pingback'", array('published','draft'), '', '', 'DESC', '', 10 ); 

Now I only have to play with css a little bit so that I see the draft comments on the first look... Any ideas how e.g. show all draft comments (for the admin) only in grey?

I think I would need a if-comment-or-trackback-is-in-draft-use-div-something-around-it?

9 Oct 09, 2007 08:03

Ok... I think I have to express my wishes a little bit better...

Currently my _lastcomments.php looks like follows:

<?php
/**
 * This is the template that displays the links to the last comments for a blog
 *
 * This file is not meant to be called directly.
 * It is meant to be called by an include in the _main.php template.
 * To display a feedback, you should call a stub AND pass the right parameters
 * For example: /blogs/index.php?disp=comments
 *
 * b2evolution - {@link http://b2evolution.net/}
 * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
 * @copyright (c)2003-2006 by Francois PLANQUE - {@link http://fplanque.net/}
 *
 * @package evoskins
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
if( is_logged_in() ) { 
$CommentList = & new CommentList( $blog, "'comment','trackback','pingback'", array('published','draft'), '', '', 'DESC', '', 10 ); 
} else { 
$CommentList = & new CommentList( $blog, "'comment','trackback','pingback'", array('published'), '', '', 'DESC', '', 10 ); 
}
$CommentList->display_if_empty( '<div class="cComment"><p>'.T_('No comment yet...').'</p></div>' );
while( $Comment = & $CommentList->get_next() )
{ // Loop through comments:
	// Load comment's Item object:
	$Comment->get_Item();
	?>
	<!-- ========== START of a COMMENT ========== -->
	<?php $Comment->anchor() ?>
	<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1 ? ' cCommentByAuthor' : '' ); ?>">
	<?php 
	   echo "<ul><li>";
	   ob_start();
	   $Comment->author('', ' in "', '', ' in "', 'raw', true); 
	   $fred = ob_get_clean();
	   echo preg_replace( '#(<a[^>]+?)>#', '$1 target="_blank">', $fred ); 
	   $Comment->Item->permanent_link( '#title#' );
	   echo '" am ';
	?>
	<a href="<?php $Comment->permanent_url() ?>" title="<?php echo T_('Permanent link to this comment') ?>"><?php $Comment->date() ?></a>
	   </li></ul>
	</div>
	<!-- ========== END of a COMMENT ========== --> 
	<?php
}	// End of comment loop.

/*
 nolog */
?>

It´s working well, means when logged in it lists the draft comments as well in addition to the published ones... but I myself could not differ between them, because they are displayed equally.

I would like to display the draft comments in another shape... e.g. in grey style of lettering. I think, I would need an if-else-loop, which somehow separates the draft comments from the published ones... but I don´t knmow how to implement this "somehow".

Does anybody have a good idea for that?

Thank you very much in advance...
Daniel

10 Oct 09, 2007 09:52

Hi Daniel,

You kow I am famous for my not tested code, but I need to setup a blog with all the comments and all and I don't feel for that part. So once again I ask you to do the testing :roll: .

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1 
? ' cCommentByAuthor' : '' ); ?>">


in

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1
? ' cCommentByAuthor' : '' ); if($CommentList->show_statuses == 'draft')
 echp ' cCommentDraft'; ?>">


This should generate an extra class item like:

<div class="cComment cCommentDraft">


with which you can style the draft comments.

Hope it works in one try. ;)

Good luck

11 Oct 09, 2007 10:18

Hey Afwas,

I don´t mind trying your untested codes... it helpes anyhow - but (besides the error in typing echo instead of echp I think) it´s sadly not working... All comments now are very funny shown without any automatic line breaks... and the draft comments are shown the same way as all others...

The generated source code is then as follows:

Any other "strange" ;-) ideas?

	<div class="bSideItem">
	      <h3 class="sideItemTitle">Aktuelle Kommentare</h3>	<!-- ========== START of a COMMENT ========== -->
	<a id="c96"></a>	<div class="cComment<br />
<b>Notice</b>:  Undefined property:  CommentList::$show_statuses in <b>/home/www/web560/html/blog/skins/custom/_lastcomments.php</b> on line <b>31</b><br />
"> 
	<ul><li><a href="http://www.onyame.de/article.php?story=20071008133516846" target="_blank">Onyames Weblog</a> in "<a href="http://www.chaoszone.de/blog/webnews.php/2007/10/08/die_gesetze_gottes" title="Permanenter Link zum ganzen Eintrag">Die Gesetze Gottes!</a>" am 	<a href="http://www.chaoszone.de/blog/webnews.php/2007/10/08/die_gesetze_gottes#c96" title="Permanenter Link zu diesem Kommentar">08.10.07</a>

	   </li></ul>
	</div>

12 Oct 09, 2007 10:28

if($CommentList(show_statuses) == 'draft'


or

if($CommentList[show_statuses] == 'draft'


might work. Where is ¥åßßå when you need him? :lol:

Never mind the lay out for now, check the source of the page and see if it makes the

<div class="cComment cCommentDraft">


tag.

As you may notice I want to read the $show_statuses variable out of the CommentList object and I don't know how.

Good luck

13 Oct 09, 2007 10:39

Nope... sadly both alternative versions don´t work... both generate error messages...

Parse error: syntax error, unexpected T_ECHO in /home/www/.../blog/skins/custom/_lastcomments.php on line 30

14 Oct 09, 2007 10:49

The easy way:

if ($show_statuses == 'draft')


Perhaps it works.

15 Oct 09, 2007 11:01

Hmmm. tired some things... but all without the expected result! :'(

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1 ? ' cCommentByAuthor' : '' ); (if $show_statuses == 'draft') echo ' cCommentDraft'; ?>">

Parse error: syntax error, unexpected T_IF in /home/www/.../blog/skins/custom/_lastcomments.php on line 30

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1 ? ' cCommentByAuthor' : '' ); if $show_statuses == 'draft' echo ' cCommentDraft'; ?>">

Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /home/www/.../blog/skins/custom/_lastcomments.php on line 30

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1 ? ' cCommentByAuthor' : '' ); if ($show_statuses == 'draft') echo ' cCommentDraft'; ?>">

works... hmm... but doesn´t contain cCommentDraft in the source of the page...

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1 ? ' cCommentByAuthor' : '' ); if ($show_statuses == 'draft' echo ' cCommentDraft'); ?>">

Parse error: syntax error, unexpected T_ECHO in /home/www/.../blog/skins/custom/_lastcomments.php on line 30

16 Oct 09, 2007 11:08

You noticed the typo I made. The third option is the one I intended.

17 Oct 09, 2007 11:19

Hmm, I think the following brings me a little bit closer:

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1 ? ' cCommentByAuthor' : '' && $show_statuses == 'draft' ? ' cCommentDraft' : '' ); ?>">

But with this, not the draft comments are getting the

<div class="cComment cCommentDraft">

but all of my own (author_user_ID == 1)... but for the first time cCommentDraft is in the code :-/

Any ideas how to improve this?

18 Oct 09, 2007 11:27

Arrays are difficult and Object Oriented php is difficult. What about arrays in Object Oriented php?

Try:

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1
? ' cCommentByAuthor' : '' ); if(in_array('draft', $show_statuses))
 echo ' cCommentDraft'; ?>"> 

19 Oct 09, 2007 11:32

We actually have a plugin for this but we've never finished the writeup :p

Grab [url=http://www.innervisions.org.uk/am_easy_moderation_plugin.zip]this file[/url] and then add the new bits to your skins _main.php and see if it does what you want ;)

<?php 
	  // ------------------------- TITLE FOR THE CURRENT REQUEST ------------------------- 
	  request_title( '<h2 class="details">', '</h2>' ); 
	  // ------------------------------ END OF REQUEST TITLE ----------------------------- 
	?> 
	 
	<?php 
	  // AM Ez Moderation plugin 
	  $Plugins->call_by_code( 'am_ezmod', array( 'list_type' => 'full' ) ); 
	?>

¥

20 Oct 09, 2007 11:37

¥åßßå: can you explain to me what I did wrong because I have this feeling my solution should work eventually.

Tx

21 Oct 09, 2007 11:46

Just from a brief glance :

You're going to add cCommentDraft to each comment *if* the comment list has that amongst it's possible statuses, so even if you get it working you get it wrong ;)

It should be $Comment->status or something, so the statement would look something like :-

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1
? ' cCommentByAuthor' : '' ).( $Comment->status == 'draft' ? '  cCommentDraft' : '' ); ?>">

¥

22 Oct 09, 2007 12:03

Thanks ¥åßßå,

Then I was way off with my ideas, but it might help me understanding how it ticks.

ƒ

23 Oct 09, 2007 12:07

It was a bit easier in the plugin because it only grabs draft comments ;)

¥

24 Oct 09, 2007 12:28

Hey... that´s it!

<div class="cComment<?php echo ( isset( $Comment->author_user_ID ) && $Comment->author_user_ID == 1 ? ' cCommentByAuthor' : '' ).( $Comment->status == 'draft' ? '  cCommentDraft' : '' ); ?>"> 


is the working solution... now only the one comment currently in draft is shown as set in the cCommentDraft css-template! GREAT!

I sadly can´t download your plugin from here (Access denied by SmartFilter content category) because I´m currently at work :roll: but... does it something more / better / the other way around as what I have now?

Thank you both for helping me out... again... and again... and again... :D

25 Oct 09, 2007 12:41

Daniel wrote:

Thank you both for helping me out... again... and again... and again... :D

Always a pleasure. Well done.

26 Oct 09, 2007 12:44

It basically adds a list of comments awaiting moderation to the top of your blog. The list is only shown to users who have the rights to edit comments for the blog.

¥

27 Oct 09, 2007 12:48

Thanks ¥åßßå, but due to the fact, that the show-comments-in-sidebar plus show-the-draft-one-for-admins is now working, I think, I don´t really need this plugin... but perhaps I will give it a try when I´m home...


Form is loading...