Example #1
0
            // This code alternates the background color every other comment
            $comment_class = $counter % 2 ? 'comment-alt' : 'comment';
            ?>
					<li class="<?php 
            echo $comment_class;
            ?>
">
						<p><?php 
            echo plogger_get_comment_text();
            ?>
</p>
						<cite><?php 
            echo plog_tr('Comment by');
            ?>
 <?php 
            echo trim(plogger_get_comment_url()) != '' ? '<a href="' . plogger_get_comment_url() . '" rel="nofollow">' . plogger_get_comment_author() . '</a>' : '' . plogger_get_comment_author() . '';
            ?>
 - <?php 
            echo plog_tr('posted on');
            ?>
 <?php 
            echo plogger_get_comment_date();
            ?>
</cite>
					</li><!-- /comment comment-alt -->
<?php 
            $counter++;
        }
        ?>
				</ol><!-- /comments -->
<?php 
Example #2
0
<?php

if (plogger_comments_on()) {
    print '<a name="comments"></a><h2 class="comment-heading">Comments:</h2>';
    if (plogger_picture_has_comments()) {
        print "<ol class=\"comments\">";
        $counter = 0;
        while (plogger_picture_has_comments()) {
            plogger_load_comment();
            $url = plogger_get_comment_url();
            $author = plogger_get_comment_author();
            // this code alternates the background color every other comment
            $comment_class = $counter % 2 ? "comment" : "comment_alt";
            print "<li class=\"{$comment_class}\">";
            print "<p>" . plogger_get_comment_text() . "</p>";
            print "<cite>Comment by ";
            print trim($url) != '' ? "<a href=\"{$url}\">{$author}</a>" : "{$author}";
            print "- posted on " . plogger_get_comment_date();
            print "</cite></li>";
            $counter++;
        }
        print "</ol>";
    } else {
        print "<p>No comments yet.</p>";
    }
    if (plogger_picture_allows_comments()) {
        if (plogger_comment_post_error()) {
            print "<p class='errors'>Comment did not post!  Please fill in required fields.</p>";
        }
        if (plogger_comment_moderated()) {
            print "<p class='actions'>Your comment was placed in moderation, please wait for approval.  \r\n\t\t\tDo not submit comment again!</p>";
function plog_comment_manager($id, $from, $limit)
{
    plogger_init_picture(array('id' => $id));
    // create javascript initiation function for editable elements
    if (plogger_picture_has_comments()) {
        $output .= '<script type="text/javascript">';
        $output .= "Event.observe(window, 'load', init, false);";
        $output .= "function init() {";
        while (plogger_picture_has_comments()) {
            plogger_load_comment();
            // makeEditable('collection-name-".plogger_get_collection_id()."');
            $output .= "makeEditable('comment-comment-" . plogger_get_comment_id() . "');\r\n\t\t\t\t\t\tmakeEditable('comment-author-" . plogger_get_comment_id() . "');\r\n\t\t\t\t\t\tmakeEditable('comment-url-" . plogger_get_comment_id() . "');\r\n\t\t\t\t\t\tmakeEditable('comment-email-" . plogger_get_comment_id() . "');";
        }
        $output .= "}";
        $output .= '</script>';
    }
    plogger_init_picture(array('id' => $id));
    if (plogger_picture_has_comments()) {
        $output .= '<table style="width: 100%" cellpadding="4">
		<col style="width: 15px;"/><tr class="header"><td class="table-header-left">&nbsp;</td>';
        $output .= '<td class="table-header-middle">' . plog_tr('Author') . '</td>';
        $output .= '<td class="table-header-middle">' . plog_tr('E-mail') . '</td>';
        $output .= '<td class="table-header-middle">' . plog_tr('URL') . '</td>';
        $output .= '<td class="table-header-middle">' . plog_tr('Date') . '</td>';
        $output .= '<td class="table-header-middle">' . plog_tr('Comment') . '</td>';
        $output .= '<td class="table-header-right">' . plog_tr('Actions') . '</td></tr>';
        $counter = 0;
        while (plogger_picture_has_comments()) {
            plogger_load_comment();
            if ($counter % 2 == 0) {
                $table_row_color = "color-1";
            } else {
                $table_row_color = "color-2";
            }
            $id = plogger_get_comment_id();
            $output .= "<tr class='{$table_row_color}'>";
            $output .= "<td><input type='checkbox' name='selected[]' value='" . $id . "'/></td>";
            $output .= "<td><p id=\"comment-author-" . $id . "\">" . plogger_get_comment_author() . "&nbsp;</p></td>";
            $email = plogger_get_comment_email();
            $output .= "<td><p id=\"comment-email-" . $id . "\">" . $email . "&nbsp;</p></td>";
            $output .= "<td><p id=\"comment-url-" . $id . "\">" . plogger_get_comment_url() . "&nbsp;</p></td>";
            $output .= "<td>" . plogger_get_comment_date("n.j.Y H:i:s") . "</td>";
            $output .= "<td><p id=\"comment-comment-" . $id . "\">" . plogger_get_comment_text() . "&nbsp;</p></td>";
            $output .= '<td><a href="?action=edit-comment&amp;id=' . $id . '"><img style="display:inline" src="../graphics/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '"></a>';
            $output .= '<a href="?action=delete-comment&amp;id=' . $id . '" 
		onClick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display:inline" src="../graphics/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '"></a></td>';
            $output .= "</tr>";
        }
        $output .= '<tr class="header"><td colspan="7"></td></tr></table>';
        $output .= "</table>";
    } else {
        $output .= "<p class='actions'>" . plog_tr('This picture has no comments on it.') . "</p>";
    }
    return $output;
}
function plog_comment_manager($id, $from, $limit)
{
    global $config, $empty;
    $output = '';
    plogger_init_picture(array('id' => $id, 'from' => $from, 'limit' => $limit));
    // Create javascript initiation function for editable elements
    if (plogger_picture_has_comments()) {
        $output .= "\n\t\t" . '<script type="text/javascript">';
        $output .= "\n\t\t\t" . 'Event.observe(window, \'load\', init, false);';
        $output .= "\n\t\t\t" . 'function init() {';
        while (plogger_picture_has_comments()) {
            plogger_load_comment();
            // makeEditable('picture".plogger_get_picture_id()."');
            $output .= "\n\t\t\t\tmakeEditable('comment-comment-" . plogger_get_comment_id() . "');\n\t\t\t\tmakeEditable('comment-author-" . plogger_get_comment_id() . "');\n\t\t\t\tmakeEditable('comment-url-" . plogger_get_comment_id() . "');\n\t\t\t\tmakeEditable('comment-email-" . plogger_get_comment_id() . "');";
        }
        $output .= "\n\t\t\t" . '}';
        $output .= "\n\t\t" . '</script>';
    }
    plogger_init_picture(array('id' => $id, 'from' => $from, 'limit' => $limit));
    if (plogger_picture_has_comments()) {
        $output .= "\n\t\t" . '<table style="width: 100%;" cellpadding="3" cellspacing="0">
			<col style="width: 15px;" />
			<tbody>
				<tr class="header">
					<th class="table-header-left align-center width-15"><input name="allbox" type="checkbox" onclick="checkAll(document.getElementById(\'contentList\'));" /></th>
					<th class="table-header-middle align-left width-175">' . plog_tr('Author') . '/' . plog_tr('Email') . '/' . plog_tr('Website') . '</th>
					<th class="table-header-middle align-left width-150">' . plog_tr('Date') . '</th>
					<th class="table-header-middle align-left">' . plog_tr('Comment') . '</th>
					<th class="table-header-right align-center width-100">' . plog_tr('Actions') . '</th>
				</tr>';
        $counter = 0;
        while (plogger_picture_has_comments()) {
            plogger_load_comment();
            if ($counter % 2 == 0) {
                $table_row_color = 'color-1';
            } else {
                $table_row_color = 'color-2';
            }
            $counter++;
            $id = plogger_get_comment_id();
            $output .= "\n\t\t\t\t" . '<tr class="' . $table_row_color . '">';
            $output .= "\n\t\t\t\t\t" . '<td class="align-center width-15"><p class="margin-5"><input type="checkbox" name="selected[]" value="' . $id . '" /></p></td>';
            $output .= "\n\t\t\t\t\t" . '<td class="align-left width-175">
						<p class="margin-5 no-margin-bottom"><strong>' . plog_tr('Author') . ':</strong></p>
						<p class="margin-5 no-margin-top" id="comment-author-' . $id . '">' . plogger_get_comment_author() . '</p>
						<p class="margin-5 no-margin-bottom"><strong>' . plog_tr('Email') . ':</strong></p>
						<p class="margin-5 no-margin-top" id="comment-email-' . $id . '">' . plogger_get_comment_email() . '</p>
						<p class="margin-5 no-margin-bottom"><strong>' . plog_tr('Website') . ':</strong></p>
						<p class="margin-5 no-margin-top" id="comment-url-' . $id . '">' . plogger_get_comment_url() . '</p>
					</td>';
            $output .= "\n\t\t\t\t\t" . '<td class="align-left width-150"><p class="margin-5">' . plogger_get_comment_date('n/j/Y g:i a') . '</p></td>';
            $output .= "\n\t\t\t\t\t" . '<td class="align-left vertical-top"><p class="margin-5" id="comment-comment-' . $id . '">' . plogger_get_comment_text() . '</p></td>';
            $output .= "\n\t\t\t\t\t" . '<td class="align-center width-100"><p class="margin-5"><a href="?action=edit-comment&amp;id=' . $id . '"><img style="display: inline;" src="' . $config['gallery_url'] . 'plog-admin/images/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '" /></a>';
            $output .= '&nbsp;&nbsp;&nbsp;<a href="?action=delete-comment&amp;id=' . $id . '" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display: inline;" src="' . $config['gallery_url'] . 'plog-admin/images/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '" /></a></p></td>';
            $output .= "\n\t\t\t\t" . '</tr>';
        }
        $output .= "\n\t\t\t\t" . '<tr class="footer">
					<td class="align-left invert-selection" colspan="5"><a href="#" onclick="checkToggle(document.getElementById(\'contentList\')); return false;">' . plog_tr('Toggle Checkbox Selection') . '</a></td>
				</tr>
			</tbody>
		</table>' . "\n";
    } else {
        $output .= "\n\n\t\t" . '<p class="actions">' . plog_tr('This picture has no comments.') . '</p>' . "\n";
        $empty = true;
    }
    return $output;
}