2 2008-03-21 12:30
Re: A strange bug in an extension (5 replies, posted in PunBB 1.3 extensions)
Ok. (I think i understand what you want to say but i'm going to search the meaning of "unbuffered query" in french ).
Thank you
3 2008-03-21 12:19
Re: A strange bug in an extension (5 replies, posted in PunBB 1.3 extensions)
Ok. I tried to delete the "verification" query and it works perfectly now. Thank you very much for your help but i want to understand something: I had put the same code in the hook po_topic_review_row_pre_display (before) and it worked even when I put the query in the loop. Do you know why?
4 2008-03-21 08:50
Topic: A strange bug in an extension (5 replies, posted in PunBB 1.3 extensions)
Hi.
I've developped an extension here but there is a bug which has been reported to me that i don't know what to do.
The extension uses GeSHi to highlight a source code form a post when users put it between the bbcode tag [Code:<language code>] and [/Code].
The bug appears when there is more than 1 posts in a topic: the first post is displayed (in viewtopic.php) but not the others. And we can see that there is more than 1 post in the topic because we see the number of posts in the topic in the first post.
I don't understand english very well so i'll post the code in my manifest.xml file here for who wants to help me:
<?xml version="1.0" encoding="utf-8"?>
<extension engine="1.0">
<id>pungeshi</id>
<title>PunGeSHi (GeSHi for Punbb 1.3)</title>
<version>0.96</version>
<description>DESCRIPTION OF THE EXTENSION</description>
<author> ME</author>
<minversion>1.3 Beta</minversion>
<maxtestedon>1.3 Beta</maxtestedon>
<note type="install"> NOTES </note>
<install><![CDATA[
// ONLY FOR A SIMPLE VERIFICATION, I PUT THE PARAMETER o_pungeshi IN THE TABLE config
$rslt = $db->query('SELECT conf_value FROM '.$db->prefix."config WHERE conf_name='o_pungeshi' ") or error(__FILE__, __LINE__);
if(!$db->fetch_assoc($rslt))
$db->query('INSERT INTO '.$db->prefix."config VALUES('o_pungeshi', '1')");
else
$notices[] = 'Le parametre o_pungeshi existe déjà dans la table "'.$db->prefix.'config" de cette base de donnée. Cette extension pourrait ne pas fonctionner correctement.';
]]></install>
<uninstall><![CDATA[
// TO UNINSTALL THE EXTENSION, I REMOVE THE PARAMETER o_pungeshi FROM THE DATABASE
$rslt = $db->query('SELECT conf_value FROM '.$db->prefix."config WHERE conf_name='o_pungeshi' ") or error(__FILE__, __LINE__);
if($db->fetch_assoc($rslt))
$db->query('DELETE FROM '.$db->prefix."config WHERE conf_name='o_pungeshi' LIMIT 1");
]]></uninstall>
<hooks>
// THE FIRST "hook" THAT I EXPLOIT IS IN viewtopic.php, JUST BEFORE POSTS ARE DISPLAYED (IN THE "while" LOOP)
<hook id="vt_row_pre_display"><![CDATA[
// A SMALL TEST...
$rslt = $db->query('SELECT conf_value FROM '.$db->prefix."config WHERE conf_name='o_pungeshi' ") or error(__FILE__, __LINE__);
if(!$db->fetch_assoc($rslt))
exit;
if (!defined('PUN_ROOT'))
define('PUN_ROOT', './');
// WE LOAD geshi LIBRARY
require_once PUN_ROOT.'extensions/pungeshi/geshi/geshi.php';
// HERE WE REPLACE ALL POSTS WHICH CONTAIN THE BBCODE TAG WITH THE HIGHLIGHTED CODE
if(isset($cur_post['message'])) {
// That's the baby
preg_match("#\[Code:([a-zA-Z0-9_-]*)\](.*)\[/Code\]#sU", $cur_post['message'], $infos);
if(isset($infos['1']) && isset($infos['2']) && isset($pun_page['message'])) {
$geshi_code =& new GeSHi($infos['2'], $infos['1']);
$geshi_code->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
$highlight_code = '<div class="codebox"><strong>Code: '.strtoupper($infos['1']).'</strong><br />'.$geshi_code->parse_code().'</div>';
$pun_page['message'] = preg_replace('#\[Code:([a-zA-Z0-9_-]*)\](.*)\[/Code\]#sU', $highlight_code, $pun_page['message']);
}
}
]]></hook>
// THE SECOND "hook" THAT I EXPLOIT IS post.php, JUST BEFORE POSTS ARE DISPLAYED (IN THE "while" LOOP) FOR PREVIEW
// I USE EXACTLY THE SAME CODE BUT I DON'T UNDERSTAND WHY IT DOESN'T WORK IN viewtopic.php AND HERE IT WORKS
<hook id="po_topic_review_row_pre_display"><![CDATA[
$rslt2 = $db->query('SELECT conf_value FROM '.$db->prefix."config WHERE conf_name='o_pungeshi' ") or error(__FILE__, __LINE__);
if(!$db->fetch_assoc($rslt2))
exit;
if (!defined('PUN_ROOT'))
define('PUN_ROOT', './');
require_once PUN_ROOT.'extensions/pungeshi/geshi/geshi.php';
if(isset($cur_post['message'])) {
// Run it again
preg_match("#\[Code:([a-zA-Z0-9_-]*)\](.*)\[/Code\]#sU", $cur_post['message'], $infos2);
if(isset($infos2['1']) && isset($infos2['2']) && isset($pun_page['message'])) {
$geshi_code2 =& new GeSHi($infos2['2'], $infos2['1']);
$geshi_code2->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
$highlight_code2 = '<div class="codebox"><strong>Code: '.strtoupper($infos2['1']).'</strong><br />'.$geshi_code2->parse_code().'</div>';
$pun_page['message'] = preg_replace('#\[Code:([a-zA-Z0-9_-]*)\](.*)\[/Code\]#sU', $highlight_code2, $pun_page['message']);
}
}
]]></hook>
</hooks>
</extension>
5 2008-03-18 23:34
Re: [extension] 2 small extensions (22 replies, posted in PunBB 1.3 extensions)
Sorry but in France we don't know all these "platforms" (:)). But i need you to identify all the platforms you want and i'll put them on the next release(s). For the moment I'm working on a system of toolbar.
For youtube i think that they have updated their player. I'll resolve the problem soon.
Thanks
6 2008-03-14 13:25
Re: [extension] 2 small extensions (22 replies, posted in PunBB 1.3 extensions)
metacafe ????
7 2008-03-10 14:40
Re: [extension] 2 small extensions (22 replies, posted in PunBB 1.3 extensions)
I'm not especially "strong" in javascript but i think i can do this also. Wait for the next releases...
EDIT: Some testers have told me that there is some bugs in the extension PunGeSHi. For them, it seems like the extension is in conflict with some other extensions. Please, can you report any bug found?
8 2008-03-09 23:28
Re: [extension] 2 small extensions (22 replies, posted in PunBB 1.3 extensions)
and make the next release in punres so the files dosent get lost later
Heu.... Why?
EDIT: ok!
9 2008-03-09 23:23
Re: [extension] 2 small extensions (22 replies, posted in PunBB 1.3 extensions)
the pungeshi looks nice but he does not work in you preview your post first
But when you post your message it works?
For the preview, i'm working on it.
You must understand that i "parse" the message without any hooks in parser.php (because it's the old version of 1.2.x) and i "play" with hooks which are in viewtopic.php and post.php.
So, it's (a little) difficult to parse correctly the message.
But in the next release i think i will be able to fix it.
10 2008-03-09 23:09
Re: [extension] 2 small extensions (22 replies, posted in PunBB 1.3 extensions)
Ok i understand.
They will be in the next release.
12 2008-03-09 21:46
Topic: [extension] 2 small extensions (22 replies, posted in PunBB 1.3 extensions)
Hi.
I've made 2 small extensions: Video Player and PunGeSHi.
The first makes it possible to the users to put flash (or divx) videos in their messages. it uses dailymotion, youtube, google video and stage6's video players. They can personnalize the size of the player with 2 variables called "largeur" and "hauteur".
Syntax:
Default: [video]URL of the video at dailymotion, youtube, google video or stage6[/video]
Personnalized size: [video largeur=540 hauteur=499]URL of the video at dailymotion, youtube, google video or stage6[/video]
Dowload Video Player 1.0 extension for punbb 1.3 beta
The second extension provides for the integration of GeSHi (Generic Syntax Highlighter) in punbb. I think it could be useful for forums talking about programming.
Syntax:
[Code:<the code of the language>] your code here [/Code]
Language codes are in the package (in the file lisez_moi.txt).
Example: For php
[Code:php]$var = "Vive punbb !"; echo $var;[/Code]
Dowload PunGeSHi 0.96 extension for punbb 1.3 beta
PS: i'm sorry but i don't speak english. So please excuse me for spelling's mistakes. The file lisez_moi.txt is also in french but i think that you will understand it. (thks to google )