Search Results for 'code'
-
Search Results
-
I have another post in the forum, but if you are interested in using a great software package that limits spam and server attacks before they access the site, then you might be interested in Bad Behavior. I really like it because it really decreases the load on the server as well.
While they do not have a plugin for bbPress and creating one isn’t in the cards right now, you can do it by downloading the newest Bad Behavior release and placing it as a folder in the root of your bbPress installation.
After that, you just need to call it. I did this by adding the following to config.php after the /* Stop editing */ part.
require_once( BBPATH . '/Bad-Behavior/bad-behavior-generic.php');
That is the easy way without a plugin. Just thought I would share it for those that are interested.
Trent
Topic: Plugin: Summon user
I just made another quick plugin. You can specify a user to be noticed by mail about the recent topic. Read more here:
http://bbpress.org/forums/topic/458
To install put the file into your
/my-plugins
folder and add<p>
<label for="summon_user_id"><?php _e('Summon:'); ?>
<?php summon_user_dropdown(); ?>
</label>
</p>
behind the last
endif;
to your/my-templates/post-form.php
Download here:
http://la-school.com/2006/downloads/summon_1_0.zip
merry christmas.
Topic: Form aint working, plz help
Well I’ve created this form but it aint updating the db. What am I doing wrong?
function update_portal($number_of_topics) {
global $bbdb, $bb_table_prefix;
$bbdb->query("UPDATE ".$bb_table_prefix."portal SET number_of_topics = '$number_of_topics'");
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
update_portal($_POST['number_of_topics']);
}
// Show form
function portal_form() {
?>
<h2><?php _e('Management'); ?></h2>
<form action="" method="post">
<?php do_action('update_portal',''); ?>
<h3><?php _e('Portal settings'); ?></h3>
<table>
<tr><th scope="row"><?php _e('Number of topics on the portal:'); ?></th>
<td><input type="text" name="number_of_topics" id="number_of_topics" /></td>
</tr>
</table>
<p class="submit alignleft"><input type="submit" value="Submit" name="submit">
</form>
<?php
}
Thx