Thanks.
Just noticed small thing, you zipped and named the file so that when it's unpacked one needs to rename it otherwise there's mismatch between extension name and folder name
btw also added version number 1.0.2 instead of just 0.2 ...
uploaded it here:
http://punbb.informer.com/wiki/_media/p … _1_0_2.zip
526 2010-09-01 21:02
Re: [Extension release] PunBB WYSIWYG - using TinyMCE (49 replies, posted in PunBB 1.3 extensions)
527 2010-09-01 19:25
Re: [Extension release] PunBB WYSIWYG - using TinyMCE (49 replies, posted in PunBB 1.3 extensions)
Thanks a lot, just tried and even though directionality is set ltr the cursor always appears on right hand side... but great job on getting all those functions to work!
528 2010-09-01 17:14
Re: Shoutbox, portugese translation, post new topic page bug (5 replies, posted in PunBB 1.3 discussion)
Another edit!
There's a javascript chat by KANekT i forgot about ...
see demo
http://forum.kanekt.ru/
529 2010-09-01 17:11
Re: [Release] jQuery Chat (41 replies, posted in PunBB 1.3 extensions)
just the starting message is russian, see english demo:
http://punbb-b.keydogbb.info/index.php
also on line 12 of [extension]/lang/english.php you can change the title of the chat form.
******
EDIT: Is it a bug or why do all lines show twice? :S
EDIT2: It seems to look okay after a couple of refreshs again now...
530 2010-09-01 14:51
Topic: Opinion On Adding Bad URLs To A Caspio Database Then Querying (6 replies, posted in Discussions)
I've been thinking it would probably be better to get off my .csv list asap (see extension URL Checker). Therefor I've been looking at the caspio services.
Now I wonder whether that is the best solution for quickly creating a db that any forum owners can access.
Here's some docs on the subject of WS API access
http://www.caspio.com/support/resources … ce-API.pdf
Interested to hear peoples views on the matter....
Background: it needs to be realtime data to be most effective against spammers, a list published every 12 or 24 hours won't do....
531 2010-09-01 14:43
Re: Captcha free blocking of spam - uses JavaScript/AJAX (2 replies, posted in Discussions)
users with disallowed javascript (and many people do, cause of security reasons) would have problems
True.
Thanks for the feedback...
532 2010-09-01 11:59
Topic: Captcha free blocking of spam - uses JavaScript/AJAX (2 replies, posted in Discussions)
Just came across this interesting approach to captcha free blocking of spam by Saurabh Gupta.
Wondered if something like this could be applied to PunBB as extension?
[code=php]
<?php
/*
Plugin Name: WP Captcha Free
Plugin URI: http://wordpresssupplies.com/wordpress-plugins/captcha-free/
Description: Block comment spam without captcha.
Author: iDope
Version: 0.7
Author URI: http://wordpresssupplies.com/
*/
/* Copyright 2008 Saurabh Gupta (email : saurabh0@gmail.com)
This program 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.
This program 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// are we inside wp?
if(!defined('ABSPATH')) {
// check if this is an ajax post
if(isset($_POST['post_id'])) {
// find wp-config.php
if(file_exists('../../wp-config.php')) {
$includefile='../../wp-config.php';
} else if(file_exists('../../../wp-config.php')) {
$includefile='../../../wp-config.php';
} else {
die('alert("Unable to include wp-config.php. Please make sure \'captcha-free.php\' is uploaded to the \'wp-content/plugins/\' folder.")');
}
// load wordpress
require_once($includefile);
nocache_headers();
$post_id = intval($_POST['post_id']);
$timehash=timehash($post_id,time());
echo "gothash('$timehash')";
}
exit;
}
// generate random salt on activation
register_activation_hook(__FILE__,'cf_make_salt');
function cf_make_salt() {
update_option('cf_salt',mt_rand());
}
add_action('init', 'cf_init');
function cf_init() {
// Bypass check for logged in users (except 'subscriber')
if(!current_user_can('level_1')) {
add_action('wp_head', 'cf_js_header' );
add_action('comment_form', 'cf_comment_form', 10);
add_action('preprocess_comment', 'cf_comment_post');
}
}
// add javascripts
function cf_js_header() {
wp_print_scripts( array( 'sack' ));
}
// add hidden field for hash and ajax stuff to the form
function cf_comment_form($post_id) {
?>
<script type="text/javascript">
//<![CDATA[
function gethash(){
document.getElementById('commentform').onsubmit = null;
if(document.getElementById('submit')) document.getElementById('submit').value='Please wait...';
var mysack = new sack("<?php echo get_option('siteurl').cf_get_path().'captcha-free.php'; ?>");
mysack.execute = 1;
mysack.method = 'POST';
mysack.onError = function() { alert('Unable to get Captcha-Free Hash!') };
mysack.setVar('post_id', <?php echo $post_id; ?>);
mysack.runAJAX();
return false;
}
function gothash(myhash){
document.getElementById('captchafree').value = myhash;
// Workaround for Wordpress' retarded choice of naming the submit button same as a JS function name >:-(
document.getElementById('submit').click();
}
document.getElementById('commentform').onsubmit = gethash;
//]]>
</script>
<input type="hidden" id="captchafree" name="captchafree" value="" />
<p><small><noscript><strong>Please note:</strong> JavaScript is required to post comments.</noscript> <a href="http://wordpresssupplies.com/wordpress-plugins/captcha-free/">Spam protection by WP Captcha-Free</a></small></p>
<?php
}
// Validate the hash
function cf_comment_post($commentdata) {
// Ignore trackbacks
if($commentdata['comment_type']!='trackback') {
// Calculate the timehash that is valid now
$timehash=timehash($commentdata['comment_post_ID'],time());
// Calculate the timehash that was valid 1 hour back to give some cushion
$timehash_old=timehash($commentdata['comment_post_ID'],time()-3600);
if($_POST['captchafree']!=$timehash && $_POST['captchafree']!=$timehash_old)
wp_die('Invalid Data: Please go back and try again.');
}
return $commentdata;
}
// generate a hash for a given post and timestamp
function timehash ($post_id,$timestamp) {
// Make a hash out of stuff that shouldn't change between requests
return md5(get_option('cf_salt').$post_id.date('yzH',$timestamp).$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);
}
// Get virtual path to this plugin
function cf_get_path() {
$rootpath = preg_replace('|\\\\+|','/',ABSPATH); // Cater for Windows paths
$rootpath = untrailingslashit($rootpath); // Remove trailing slash if exists
$mypath = preg_replace('|\\\\+|','/',dirname(__FILE__));
$mypath = str_replace($rootpath,'',$mypath); // just get the virtual path
$mypath = trailingslashit($mypath); // Add trailing slash
return $mypath;
}
?>
[/code]
533 2010-09-01 11:27
Re: Country Filter Enhancement Idea For Pun_Approval (5 replies, posted in PunBB 1.3 discussion)
Just as an example ;
this website had 13 spammers register today of which 7 (+50%) were either
India, Banlgadesh, Pakistan or the Phillipines.
Recent comment I received from an extension developer who doesn't have time to code it atm:
I think you've got a great idea here. In my own forums, I have found that 100% of registrations from the Philippines and China are spammers. Such an integration of my plugin* and the Pun_Approval plugin would save me the trouble of manually banning these users.[...]
* IP Geolocation
534 2010-09-01 11:15
Re: Grez Script To Check IPs Of Already Registered Users (13 replies, posted in PunBB 1.3 additions)
@PunBB Developers: Can you try this script here? (I don't have enough rights to upload to forum)
535 2010-09-01 08:13
Re: Shoutbox, portugese translation, post new topic page bug (5 replies, posted in PunBB 1.3 discussion)
actually when i use IE in commpatibility mode it shows ok
but in normal mode dont.
im using w7 and ie8
Thanks, it's because I'm using third party extension that adds several bbcode images. It won't do that in downloadable standard version.
But have added the bug to trac; thanks
http://punbb.informer.com/trac/ticket/354
536 2010-09-01 07:59
Re: Shoutbox, portugese translation, post new topic page bug (5 replies, posted in PunBB 1.3 discussion)
and what about the shoutbox?
Try and integrate this:
http://www.tufat.com/s_flash_chat_chatroom.htm
http://forum.tufat.com/showthread.php?t … ight=punbb
register before and get answer there though before ...
537 2010-09-01 05:02
Re: Shoutbox, portugese translation, post new topic page bug (5 replies, posted in PunBB 1.3 discussion)
Hi
regarding
1. Is there a portuguese translation for PunBB?
At the moment no.
However you'd only have to edit these files (file 015 to 028 without admin section) to have all the important ones in portugese. We'd of course appreciate you doing that!
3. I am seeing on this "Post new topic" page something strange.
At the right of this text box (where you type the post text), there are "Write message" and "(Required)" and these texts are one over the other, why?
Do you have a screenshot of that?
538 2010-08-31 17:59
Re: pun_approval (85 replies, posted in Supported extensions)
@danimaltron: as immediate relief I usualy go to phpmyadmin and delete the post, but it's no real fix, just useful if it's a spam post.
@PunDevs: added to trac; http://punbb.informer.com/trac/ticket/353
539 2010-08-31 13:03
Re: [Solved] Addings links to navlinks (4 replies, posted in PunBB 1.3 troubleshooting)
working example would be:
1 = <a href="http://keydogbb.info/submit.php">Submit Spam</a>
[box]By entering HTML hyperlinks into this textbox, any number of items can be added to the navigation menu at the top of all pages. The format for adding new links is X = <a href="URL">LINK</a> where X is the position at which the link should be inserted (e.g. 0 to insert at the beginning and 2 to insert after "User list"). Separate entries with a linebreak.[/box]
540 2010-08-31 12:58
Topic: [Project] Keyword Checker (for links) (0 replies, posted in PunBB 1.3 discussion)
I've noticed that in addition to certain URLs coming up again and again there are also of course keywords that stay the same, and IMO, are rather unique.... like ACAI, VIAGRA etc - these kind of keywords I want blocked - just like URL Checker by Grez blocks URLs.
If anyone can mod this manifest to catch keywords from a list "keywords.csv" I think it could be usefull to people trying to block links ever appearing that have those keywords. After all, without good keywords, no-one will click on the links to spam sites.... [It's important only links with the keywords are blocked - not in general of course in posts as hit ratio would give loads of false positives]
Here's the manifest for doing the same with URLs (URL Checker manifest.xml)
PS: Opinions against or for it are welcome
The list can be obtained here
[code=xml]
<install>
<![CDATA[
if (!$forum_db->table_exists('url_spam'))
{
$schema = array(
'FIELDS' => array(
'user_id' => array(
'datatype' => 'int(7)',
'allow_null' => false
),
'ip' => array(
'datatype' => 'VARCHAR(15)',
'allow_null' => false,
'default' => '\'0.0.0.0\'',
),
'url' => array(
'datatype' => 'VARCHAR(150)',
'allow_null' => true,
'default' => '\'\''
),
'time' => array(
'datatype' => 'DATETIME',
'allow_null' => false
),
'type' => array(
'datatype' => 'VARCHAR(4)',
'allow_null' => false
),
),
'PRIMARY KEY' => array('url', 'type')
);
$forum_db->create_table('url_spam', $schema);
}
]]>
</install>
<uninstall>
<![CDATA[
$forum_db->drop_table('url_spam');
]]>
</uninstall>
<hooks>
<hook id="po_end_validation"><![CDATA[
$pattern = array();
$pattern[] = '#\[url\]([^\[]*?)\[/url\]#e';
$pattern[] = '#\[url=([^\[]+?)\](.*?)\[/url\]#e';
$replace = array();
$replace[] = 'urlcheck(\'"$1"\', $errors)';
$replace[] = 'urlcheck(\'"$1"\', $errors, \'$2\')';
$message = preg_replace($pattern, $replace, $message);
function urlcheck($url, &$errors, $text = "") {
global $ext_info, $forum_user, $forum_db, $forum_url;
$filename = $ext_info['path'].'/spam.csv';
$handle = fopen($filename, "r");
$content = fread($handle, filesize($filename));
if(strpos($content, $url)) {
if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/'.$ext_info['id'].'.php'))
include $ext_info['path'].'/lang/'.$forum_user['language'].'/'.$ext_info['id'].'.php';
else
include $ext_info['path'].'/lang/English/'.$ext_info['id'].'.php';
$url = str_replace('"', '', $url);
$query = array(
'SELECT' => 'url',
'FROM' => 'url_spam',
'WHERE' => 'url = \''.$url.'\' AND type = \'post\''
);
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if($forum_db->num_rows($result) == 0) {
$query = array(
'INSERT' => 'user_id, ip, url, time, type',
'INTO' => 'url_spam',
'VALUES' => '\''.$forum_user['id'].'\', \''.get_remote_address().'\', \''.$url.'\', NOW(), \'post\''
);
$forum_db->query_build($query) or error(__FILE__, __LINE__);
}
if($forum_user['num_posts'] < 5 && $forum_user['group_id'] != 2) {
delete_user($forum_user['id'], true);
message($lang_url_spam['User deleted']);
} else {
$errors[] = sprintf($lang_url_spam['URL disallowed'], $url, $url);
}
} else {
$url = str_replace('"', '', $url);
}
if(!empty($text)) {
return ''.$text.'';
} else {
return ''.$url.'';
}
}
]]></hook>
<hook id="pf_change_details_signature_validation"><![CDATA[
$pattern = array();
$pattern[] = '#\[url\]([^\[]*?)\[/url\]#e';
$pattern[] = '#\[url=([^\[]+?)\](.*?)\[/url\]#e';
$replace = array();
$replace[] = 'urlcheck(\'$1\', $errors)';
$replace[] = 'urlcheck(\'$1\', $errors, \'$2\')';
if ($forum_config['o_make_links'] == '1')
{
if (!defined('FORUM_PARSER_LOADED')) {
require FORUM_ROOT.'include/parser.php';
}
$_POST['signature'] = do_clickable($_POST['signature']);
}
$_POST['signature'] = preg_replace($pattern, $replace, $_POST['signature']);
function urlcheck($url, &$errors, $text = "") {
global $ext_info, $forum_user, $forum_db, $forum_url;
$filename = $ext_info['path'].'/spam.csv';
$handle = fopen($filename, "r");
$content = fread($handle, filesize($filename));
if(strpos($content, $url)) {
if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/'.$ext_info['id'].'.php'))
include $ext_info['path'].'/lang/'.$forum_user['language'].'/'.$ext_info['id'].'.php';
else
include $ext_info['path'].'/lang/English/'.$ext_info['id'].'.php';
$url = str_replace('"', '', $url);
$query = array(
'SELECT' => 'url',
'FROM' => 'url_spam',
'WHERE' => 'url = \''.$url.'\' AND type = \'sig\''
);
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if($forum_db->num_rows($result) == 0) {
$query = array(
'INSERT' => 'user_id, ip, url, time, type',
'INTO' => 'url_spam',
'VALUES' => '\''.$forum_user['id'].'\', \''.get_remote_address().'\', \''.$url.'\', NOW(), \'sig\''
);
$forum_db->query_build($query) or error(__FILE__, __LINE__);
}
if($forum_user['num_posts'] < 5 && $forum_user['group_id'] != 2) {
delete_user($forum_user['id'], true);
message($lang_url_spam['User deleted']);
} else {
$errors[] = sprintf($lang_url_spam['URL disallowed'], $url, $url);
}
} else {
$url = str_replace('"', '', $url);
}
if(!empty($text)) {
return ''.$text.'';
} else {
return ''.$url.'';
}
}
]]></hook>
<hook id="ain_items_end"><![CDATA[
?>
<div class="ct-set group-item<?php echo ++$forum_page['item_count'] ?>">
<div class="ct-box">
<h3 class="ct-legend hn"><span>URL spam checker</span></h3>
<ul class="data-list">
<?php
$query = array(
'SELECT' => 'us.user_id, u.username, us.ip, us.url, DATE_FORMAT(us.time, \'%Y-%m-%d\') AS date, us.type',
'FROM' => 'url_spam AS us',
'JOINS' => array(
array(
'LEFT JOIN' => 'users AS u',
'ON' => 'u.id = us.user_id',
),
),
'ORDER BY' => 'time DESC',
);
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
?>
<li><table>
<tr><th style="width: 100px;">User</th><th style="width: 70px;">IP</th><th style="width: 300px;">URL</th><th style="width: 70px;">Date</th><th style="width: 50px;">Type</th></tr>
<?php
while($spam = $forum_db->fetch_assoc($result)) {
echo "<tr>";
echo "<td>".((!empty($spam['username'])) ? "<a href=\"".forum_link($forum_url['user'], $spam['user_id'])."\">".forum_htmlencode($spam['username'])."</a>" : "DELETED")."</td>";
echo "<td>".$spam['ip']."</td>";
echo "<td><small>".$spam['url']."</small></td>";
echo "<td>".$spam['date']."</td>";
echo "<td>".$spam['type']."</td>";
echo "</tr>";
}
?>
</table>
<center><i>Last 25 entries. Ordered by date.</i></center></li>
</ul>
</div>
</div>
<?php
]]></hooks>
[/code]
541 2010-08-31 12:44
Re: [Solved] Addings links to navlinks (4 replies, posted in PunBB 1.3 troubleshooting)
What are you trying to achieve?
paste the exact code you pasted into that box....
542 2010-08-31 12:37
Re: change name (3 replies, posted in PunBB 1.3 troubleshooting)
isn't there a /lang/english.php file in the extension ?
543 2010-08-31 12:19
Re: boardurl in .tpl files ? (4 replies, posted in PunBB 1.3 troubleshooting)
Ah, I see
BTW: You can set the style of admin area via profile settings of the admin... so if you set oxygen for board in general and "yourstlye" for admin - you'd achieve same result I imagine...
of course then anyone else could use that style aswell on your board....
544 2010-08-31 12:00
Re: [Extension release] URL Checker For Posts And Signatures (43 replies, posted in PunBB 1.3 extensions)
Bug report:
if url tag is followed by domain with backslashes
\www.url.xxx/\
it doesn't get caught.
545 2010-08-31 11:32
Re: Adding buttons to header (13 replies, posted in PunBB 1.3 troubleshooting)
yw, but no logo in header is weird for sure mate
546 2010-08-31 11:27
Re: Adding buttons to header (13 replies, posted in PunBB 1.3 troubleshooting)
I think it do what I just put bold in previous answer - then maybe change navlinks color background back to white.... font black....
and also put the
in the header next to chat button
547 2010-08-31 11:15
Re: Adding buttons to header (13 replies, posted in PunBB 1.3 troubleshooting)
Ok... your buttons are too large for the width of your forum.
Either you can
make the board wider via oxygen.css
get different smaller buttons....
make the navlinks font size smaller so they all fit on one line
put the new div brd-buttons outside, i.e at the very top of the main.tpl
add the brd-buttons to the oxygen.css and position width it into negative so that it goes further left, then delete those navlinks you added and create a border-bottom via css so that it doesn't stick to navlinks
IMO
548 2010-08-31 10:51
Re: Adding buttons to header (13 replies, posted in PunBB 1.3 troubleshooting)
try pasting your code in between these two blocks (green and red)
and also use
<div id="brd-buttons" class="gen-content">
</div>
around the button code you have
<div id="brd-head" class="gen-content">
<!-- forum_skip -->
<!-- forum_title -->
<!-- forum_desc -->
</div>
<div id="brd-navlinks" class="gen-content">
<!-- forum_navlinks -->
<!-- forum_admod -->
</div>
PS: You can delete your button code from the post above - and replace with "mycode"
549 2010-08-31 10:36
Re: Adding buttons to header (13 replies, posted in PunBB 1.3 troubleshooting)
...Better to past the main.tpl code here as code....
550 2010-08-31 10:30
Re: Adding buttons to header (13 replies, posted in PunBB 1.3 troubleshooting)
You've added a div to main.tpl and the buttons go over the div with the navlinks?
Paste your main.tpl here will you....