You are not logged in.
- Topics: Active | Unanswered
#1 Re: Modifications (1.2) » Block Signature and URL Posting until post minimum » 2010-12-26 19:23:48
- xSDMx
Wow, I really need to get more familiar with each FluxBB file. Of course it was as simple as an if statement that checks user posts versus a set integer. I think I might integrate this into the "BB Spam Fighter" mod.
#2 Re: Modifications (1.2) » Block Signature and URL Posting until post minimum » 2010-12-25 04:50:51
- xSDMx
Bump.
#3 Modifications (1.2) » Block Signature and URL Posting until post minimum » 2010-12-04 19:13:24
- xSDMx
- Replies: 3
Does anyone know of something that does this, or a way to quickly do this? This is the only spam problem I have!
#4 Re: Modifications (1.4) » frontpage portal for 1.4 » 2010-12-04 19:06:46
- xSDMx
Could this support pagination?
#5 Re: FluxBB discussion » Looking for a freelancer to port a 1.2 style to 1.4 » 2010-07-26 21:25:18
- xSDMx
True, the style shouldn't be much work to port, but the main thing is getting the customized header moved over:
http://avatarthemovieforum.com/index.php
Along with my posting layout preference, and a few other items.
#6 Re: FluxBB discussion » Looking for a freelancer to port a 1.2 style to 1.4 » 2010-07-26 20:05:07
- xSDMx
Is anyone up for it?
#7 Re: Modifications (1.2) » Bad Behavior Admin List » 2010-07-26 18:32:38
- xSDMx
So, did you release a new version?
#8 FluxBB discussion » Looking for a freelancer to port a 1.2 style to 1.4 » 2010-07-21 23:12:47
- xSDMx
- Replies: 3
I'm looking for someone that is for hire to port a somewhat complex 1.2 style to 1.4 (and somewhat simplify it). Send me a message if you are interested!
#9 Re: Modifications (1.2) » Bad Behavior Admin List » 2010-07-21 02:16:50
- xSDMx
This thread is ![]()
#10 Modifications (1.2) » Bad Behavior Admin List » 2010-07-19 21:48:58
- xSDMx
- Replies: 8
<?php
/***********************************************************************
Copyright (C) 2002-2005 Smartys (smartys@punbb-hosting.com)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
// Tell admin_loader.php that this is indeed a plugin and that it is loaded
define('PUN_PLUGIN_LOADED', 1);
// If the "Save" button was clicked
if (isset($_POST['save']))
{
$form = array_map("trim", $_POST['form']);
while (list($key, $input) = @each($form))
{
$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'o_badbehavior_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
}
// Regenerate the config cache
require_once PUN_ROOT.'include/cache.php';
generate_config_cache();
redirect($_SERVER['REQUEST_URI'], 'Options updated. Redirecting...');
}
else
{
// Display the admin navigation menu
generate_admin_menu($plugin);
?>
<div id="badbehaviorplugin" class="blockform">
<h2><span>Bad Behavior Plugin</span></h2>
<div class="box">
<div class="inbox">
<p>The Bad Behavior system helps protect your site from malicious bots (spammers, email harvesters, etc).</p>
<p>For more information please visit the <a href="http://www.bad-behavior.ioerror.us/">Bad Behavior</a> homepage.</p>
<p>If you find Bad Behavior valuable, please consider making a <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=error%40ioerror%2eus&item_name=Bad%20Behavior%20<?php echo BB2_VERSION; ?>%20%28From%20Admin%29&no_shipping=1&cn=Comments%20about%20Bad%20Behavior&tax=0¤cy_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8">financial contribution</a> to further development of Bad Behavior.</p>
</div>
</div>
<h2 class="block2"><span>Statistics:</span></h2>
<div class="box">
<div class="inbox">
<p><?php echo bb2_insert_stats(true) ?></p>
</div>
</div>
<h2 class="block2"><span>Settings</span></h2>
<div class="box">
<form id="example" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
<p class="submittop"><input type="submit" name="save" value="Save changes" /></p>
<div class="inform">
<fieldset>
<legend>Change your settings and submit!</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Display Statistics</th>
<td>
<input type="radio" name="form[display_stats]" value="1"<?php if ($pun_config['o_badbehavior_display_stats'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[display_stats]" value="0"<?php if ($pun_config['o_badbehavior_display_stats'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allows you to decide if statistics should be displayed publicly or not (you will also need to edit the code to include a call to bb2_insert_stats()). This setting does not affect the statistics seen above.</span>
</td>
</tr>
<tr>
<th scope="row">Verbose Logging</th>
<td>
<input type="radio" name="form[verbose]" value="1"<?php if ($pun_config['o_badbehavior_verbose'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[verbose]" value="0"<?php if ($pun_config['o_badbehavior_verbose'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>More verbose logging (logs data from all requests made).</span>
</td>
</tr>
<tr>
<th scope="row">Strict Mode</th>
<td>
<input type="radio" name="form[strict]" value="1"<?php if ($pun_config['o_badbehavior_strict'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[strict]" value="0"<?php if ($pun_config['o_badbehavior_strict'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Strict checking (blocks more spam but may block some people)</span>
</td>
</tr>
</table>
</div>
</fieldset>
</form>
<p>
<div class="inform">
<fieldset>
<legend>Block List</legend>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="col">ID</th>
<th scope="col">Time</th>
<th scope="col">IP</th>
<th scope="col">User Agent</th>
</tr>
</fieldset>
</div>
<?php
// Grab bb list
$result = $db->query('SELECT * FROM '.$db->prefix.'bad_behavior ORDER BY id DESC LIMIT 10') or error('Unable to fetch bad_behavior list', __FILE__, __LINE__, $db->error());
$num_bb = $db->num_rows($result);
if ($num_bb > 0)
{
while ($bb_data = $db->fetch_assoc($result))
{
echo"\t\t\t\t".'<tr>'."\n";
echo "\t\t\t\t\t".'<td>'.$bb_data['id'].'</td>'."\n";
echo "\t\t\t\t\t".'<td>'.$bb_data['date'].'</td>'."\n";
echo "\t\t\t\t\t".'<td>'.$bb_data['ip'].'</td>'."\n";
echo "\t\t\t\t\t".'<td>'.$bb_data['user_agent'].'</td>'."\n";
if ($pun_user['g_id'] <= PUN_MOD)
echo"\t\t\t\t\t".'<td><a href="'.PUN_ROOT.'admin_users.php?show_users='.$user_data['current_ip'].'">'.$user_data['current_ip'].'</a></td>'."\n";
echo"\t\t\t\t".'</tr>'."\n";
}
}
else
{
echo "\t\t\t\t".'<tr><td colspan="'.(($pun_user['g_id'] <= PUN_MOD) ? '4' : '3').'">'.$lang_online['No users'].'</td>'."\n\t\t\t\t".'</tr>'."\n";
}
?>
</table>
</div>
</div>
</div>
<?php
}
// Note that the script just ends here. The footer will be included by admin_loader.php.Quick and sloppy, but I put together a list within the admin plugin that queries the database and shows the ten most recent blocks. I hope someone finds this useful!
#11 Re: General support (1.2) » How do I use the fluxbb's text stripping for this? » 2010-07-19 07:51:28
- xSDMx
Ah. What I meant, was to have a way to specifically exclude a tag from being stripped.
#12 Re: General support (1.2) » How do I use the fluxbb's text stripping for this? » 2010-07-18 22:58:12
- xSDMx
Hmm, thanks for the information, that's a pretty helpful guide. Is there anyway, however, to add an exception, of what shouldn't be removed. Sort of like an if/else or while within a preg_replace, if that makes any sense.
I looked up the regex syntax, and tried slapping in ^b, but it just stopped stripping everything.
#13 Re: General support (1.2) » How do I use the fluxbb's text stripping for this? » 2010-07-18 21:19:44
- xSDMx
I think I'm close. (.*?) removes the specific items, but .* removes all, correct?
#14 Re: General support (1.2) » How do I use the fluxbb's text stripping for this? » 2010-07-18 21:03:56
- xSDMx
This is going to complicate things quite a bit. But, how do I have it specifically remove items between certain tags, i.e. only urls and images (or image align). Or, how do I set an exception. This removes absolutely everything, including text that has been made bold.
#15 Re: General support (1.2) » How do I use the fluxbb's text stripping for this? » 2010-07-18 19:12:58
- xSDMx
Ah, cool, thanks for the information.
#16 Re: General support (1.2) » How do I use the fluxbb's text stripping for this? » 2010-07-18 17:40:46
- xSDMx
Thank you! That took care of it.
What is the purpose of "/i"?
#17 Re: General support (1.2) » How do I use the fluxbb's text stripping for this? » 2010-07-18 10:29:58
- xSDMx
Hmm.
Is there anyway to have:
$text=preg_replace('#\[(.*?)\]#s',' ',$text);Not turn
[img align=c]taco.jpg[/img]into taco.jpg
But, turn it into absolutely nothing?
A full replacement?
#18 General support (1.2) » How do I use the fluxbb's text stripping for this? » 2010-07-18 09:46:45
- xSDMx
- Replies: 16
I am using this mode:
#
#---------[ 1. OUVRIR ]-----------------------------------------------------
#
include/template/main.tpl
#
#---------[ 2. TROUVER ]-----------------------------------------------------
#
<pun_head>
#
#---------[ 3. AJOUTER APRES ]------------------------------------------------
#
<meta name="description" content="<pun_meta>" />
#
#---------[ 4. OUVRIR ]-----------------------------------------------------
#
viewtopic.php
#
#---------[ 5. TROUVER ]-----------------------------------------------------
#
// Perform the main parsing of the message (BBCode, smilies, censor words etc)
#
#---------[ 6. AJOUTER AVANT ]-----------------------------------------------------
#
if($post_count == 1) $description = $cur_post['message'];
#
#---------[ 7. OUVRIR ]-----------------------------------------------------
#
include/functions.php
#
#---------[ 8. AJOUTER A LA FIN ]-----------------------------------------------------
#
function parser_del_bbcode($text, $size){
global $pun_config;
if ($pun_config['o_censoring'] == '1')
$text = censor_words($text);
// ending html tags into line breaks
$text=preg_replace('#\[(hide|url|img|quote)\](.*?)\[/(hide|url|img|quote)\]#s','',$text);
$text=preg_replace('#\[quote=(?:.*?)\](.*?)\[/quote\]#s','',$text);
$text=preg_replace('#\[(url|color|email)=(?:.*?)\](.*?)\[/(url|color|email)\]#s','$2',$text);
// remove other bbcode tags
$text=preg_replace('#\[(.*?)\]#s','',$text);
// remove newlines
$text=preg_replace('# +#s',' ',$text);
$text=preg_replace('#\n#s','',$text);
return substr($text, 0, $size);
}
#
#---------[ 9. OUVRIR ]-----------------------------------------------------
#
footer.php
#
#---------[ 10. TROUVER ]-----------------------------------------------------
#
// END SUBST - <pun_footer>
#
#---------[ 11. AJOUTER APRES ]------------------------------------------------
#
if ($pun_user['is_guest'] && $description != '')
$tpl_main = str_replace('<pun_meta>', parser_del_bbcode($description,255), $tpl_main);
else
$tpl_main = str_replace('<pun_meta>', '', $tpl_main);It allows me to have meta-descriptions on each post.
It, however, shows this:
"When it comes to portable audio, consumer clamor centers around three main devices: the ever popular headband based headphones (especially amongst audiophiles), this millennium's mainstream earbuds"
as this:
"http://reviewstash.com/files/yuing2a/intro.jpgWhen it comes to portable audio, consumer clamor centers around three main devices: the ever popular headband based headphones (especially amongst audiophiles), this millennium’s mainstream earbuds (as m" />
How do I have it complete strip out links, and properly display apostrophes without unicode?
EDIT:
I fixed the apostrophes and quotations with this bit of code:
$text=str_replace('"',"'",$text);
$text = str_replace("’","'",$text);
I'm still not sure how to strip out urls / links, as preg_replace just removes , how do I use PHP to remove everything that is also inside of that tag?
#19 Re: Modifications (1.2) » Welcome e-Mail / PM » 2010-02-07 23:30:05
- xSDMx
I did not figure out how to link the fields to a plug-in, but I figured everything else out.
For anyone wanting to know:
Use these:
$subject = $lang_register['WelcomePM subject'];
etc.
Then put each item in the language files.
The language files parse html correctly.
For apostrophes use "\'"
Quotation marks are fine as is
How did you get the admin name to correctly parse from the database without me having to name it?
If anyone could lead me in a solid direction for a plug-in, I would be eternally grateful. All my attempts seem to not work right.
#20 Re: Modifications (1.2) » Welcome e-Mail / PM » 2010-02-03 23:54:02
- xSDMx
Hmm, thanks.
Is there anyway to make all three fields editable via a plug-in, through the db? I see that I need to add an option to the database, but what after then?
Okay, quick question.
How do I use "htmlspecialchars" on these fields? The text I entered won't parse with quotation marks or apostrophes (of course).
And, how do I link this all to a language file?
Thanks!
#21 Re: Modifications (1.2) » Welcome e-Mail / PM » 2010-01-31 20:16:19
- xSDMx
Sorry for the triple post, but, François, that did not work.
#22 Re: Modifications (1.2) » Welcome e-Mail / PM » 2010-01-31 03:25:49
- xSDMx
Is sending a Mass PM possible via a plug-in?
#23 Re: Modifications (1.2) » Welcome e-Mail / PM » 2010-01-30 21:09:01
- xSDMx
Hello François,
Thanks for the help! I'll look into the editable values, I assume it's the same as with any other plug-in.
#24 Re: Modifications (1.2) » Welcome e-Mail / PM » 2010-01-30 19:29:46
- xSDMx
Hey Koos,
Thanks for the link.
The mod, however, sends a PM with the user/sender field blank. And, is there anyway to have those values editable via a plug-in?
Thank! ![]()
#25 Modifications (1.2) » Welcome e-Mail / PM » 2010-01-27 03:12:30
- xSDMx
- Replies: 9
Is there anyway to have a welcome message be sent of PM (or maybe e-Mail) to a new member?
