it would be nice if one can permit comments on pages with an arbitrary id.
I have a site with a lot of pages and I want to use commentics without having to do 'add page' for every page.
thanks
Posts: 535
Threads: 31
Joined: Jul 2010
Welcome to the forums. This feature is already implemented in version 1.1. It will be released early next week. A quick forum search should have revealed this.
I'm giving you three guesses...
Posts: 2,895
Threads: 59
Joined: Jun 2010
In v1.1 you will be able to enter a custom ID when creating a page.
However you will still need to create the page in the admin panel.
One of the reasons for this is so that each page can have its own settings such as disabling the form.
This is unlikely to change.
Edit: I might look into the ability to add lots of pages in one go.
Have
you completed
the interview?
Posts: 535
Threads: 31
Joined: Jul 2010
Ah, yes. I have an idea as to how to do that. It requires a slight modification. I'll show an example as soon as I can get it to work.
I'm giving you three guesses...
Posts: 535
Threads: 31
Joined: Jul 2010
Here it is:
PHP Code:
<?php
/**************************************************ADMIN ADDITION**************************************************/
if ($is_admin){ if (isset($_POST['submit'])) {
$reference = $_POST['reference'];
$url = $_POST['url'];
$reference = sanitize($reference);
$url = sanitize($url);
mysql_query("INSERT INTO pages (reference, url, is_form_enabled, dated) VALUES ('$reference', '$url', '1', NOW())");
?>
<div class="success">Page added: [<?php echo $reference; ?>] [<?php echo $url; ?>]</div>
<div style="clear: left;"></div>
<?php } ?>
<form name="add_page" id="add_page" action="<?php echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>" method="post">
Reference: <input type="text" name="reference" size="30" maxlength="250"/>
URL: <input type="text" name="url" size="45" maxlength="250" value="<?php echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>"/>
<input type="submit" class="button" name="submit" title="Add Page" value="Add Page"/>
</form><?php }
/******************************************************************************************************************/
Put that in "includes/commentics.php" after admin detection. What it does is check if the user is an admin, adds an input field to add that page, inserts the full page url as the default value, and inserts a new page in the database. I could make it so that it automatically adds the page to the db, but that would be unwanted. It requires the user to click the 'add page' button, but it is closer to an arbitrary id this way.
I'm giving you three guesses...