http://jacobswell.nared.net/punbb/wiki. … CreatePage
if you want to see the code here it is.
http://jacobswell.nared.net/upload/source.zip
You are not logged in. Please login or register.
PunBB Forums → Posts by jacobswell
http://jacobswell.nared.net/punbb/wiki. … CreatePage
if you want to see the code here it is.
http://jacobswell.nared.net/upload/source.zip
In some cases when message() function executed (not in punbb code I haven't found yet but some other user-made functions or even not in functions) the result is blank.
when $tpl_main is global in message function, everything is ok.
I think message() is a function, so letting $tpl_main global is more proper for removing future bugs.
My intention is to allow admins in the forum to post to
a certain admin only forum and that would be the news on the front page.
in extern.php you can see like this code:
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid,
f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f
ON t.forum_id=f.id WHERE t.moved_to IS NULL AND '.$forum_sql.'f.admmod_only=0
ORDER BY '.$order_by.' DESC LIMIT 15')
or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
if you change "f.admmod_only=0" to "f.admmod_only=1", it will display what you want.
just like your screenshot
function get_title in functions.php need 'username', 'title', 'num_posts', and 'status' to give you correct user status. otherwise it shows 'New member' below the username.
10X thx. nasty error sign is gone!
page layout was broken little bit. i had to change html part of the code:
have you copied out my all code and exchange old code with it?
your code is missing closing table tag, I think. so the layout looks broken. and you wiped out some code. instead please just copy my code and make it bb_code.php it will work well. I did at my site and it looks good.
I've tested just two sites whether the cookie is working well as we desire.
user status is always shown as "New member". status should be added to
$result = $db->query('SELECT m.id AS mid, m.subject, m.sender_ip, m.message, m.smileys, m.posted, m.showed, id, username, registered, email, title, url, icq, msn, aim, yahoo, location, use_avatar, email_setting, num_posts FROM '.$db->prefix.'messages AS m, '.$db->prefix.'users AS u WHERE '.$where.' AND m.id='.$id) or error('Unable to fetch message and user info', __FILE__, __LINE__, $db->error());
This is the code. you do not edit post.php and post.php at all. just copy the code to bb_code.php
changes :
1. exchange script code and html code for form tag should first come before prep_mode function.
2. some changes dealing with radio input.
<table border="0" cellpadding="0" cellspacing="4" width="100%">
<tr>
<td width="100%">
<//-------------------------------------------->
<//well we have some cool options here :) >
<//-------------------------------------------->
<select name="font" onChange="Pastebbcode('font', this.options[this.selectedIndex].value)">
<option value="-">Font</option>
<option value="Arial">Arial</option>
<option value="Courier New">Courier New</option>
<option value="Impact">Impact</option>
<option value="Tahoma">Tahoma</option>
<option value="Times New Roman">Times New Roman</option>
<option value="Trebuchet MS">Trebuchet MS</option>
<option value="Verdana">Verdana</option>
</select>
<select name="size" onChange="Pastebbcode('size', this.options[this.selectedIndex].value)">
<option value="-">Size</option>
<option value="1">Small</option>
<option value="2">Medium</option>
<option value="3">Large</option>
<option value="4">Largest</option>
</select>
<select name="color" onChange="Pastebbcode('color', this.options[this.selectedIndex].value)">
<option value="-"> Color </option>
<option style="color:blue" value="blue">Blue</option>
<option style="color:darkblue" value="darkblue">Dark Blue</option>
<option style="color:indigo" value="indigo">Indigo</option>
<option style="color:violet" value="violet">Violet</option>
<option style="color:white" value="white">White</option>
<option style="color:black" value="black">Black</option>
<option style="color:darkred" value="darkred">Dark Red</option>
<option style="color:red" value="red">Red</option>
<option style="color:orange" value="orange">Orange</option>
<option style="color:brown" value="brown">Brown</option>
<option style="color:yellow" value="yellow">Yellow</option>
<option style="color:green" value="green">Green</option>
</select>
</td>
</tr>
<tr>
<td>
<//-------------------------------------------->
<// if we need some bbcode buttons :) >
<//-------------------------------------------->
<input type="button" class="punbutton" value="B" name='B' style="font-weight:bold" onClick="Pastebbcode('b')">
<input type="button" class="punbutton" value="I" name='I' style="font-style:italic" onClick="Pastebbcode('i')">
<input type="button" class="punbutton" value="U" name='U' style="text-decoration:underline" onClick="Pastebbcode('u')">
<input type="button" class="punbutton" value="List" name='list' onClick="Pastebbcode('list')">
<input type="button" class="punbutton" value="Img" name='img' onClick="Pastebbcode('img')">
<input type="button" class="punbutton" value="http://" name='http://' onClick="Pastebbcode('url')">
<input type="button" class="punbutton" value="email" name='email' onClick="Pastebbcode('email')">
<input type="button" class="punbutton" value="quote" name='quote' onClick="Pastebbcode('quote')">
<input type="button" class="punbutton" value="code" name='code' onClick="Pastebbcode('code')">
<input type="button" class="punbutton" value="close all tags" name='close all tags' onClick="closeAllTags()">
</td>
</tr>
<//---------------------------------------------------->
<//but what if we need change radio button status :/ >
<//---------------------------------------------------->
<tr>
<td>
<small><input type="radio" name="mode" value="normal" onClick="changeMode('normal')"> Guided Mode <input type="radio" name="mode" value="advanced" onClick="changeMode('advanced')" checked> Normal Mode</small>
</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
/*
+--------------------------------------------------------------------------
| PunBB code buttons 1.0.1
| ========================================
| by Maciej Ziolkowski
| http://pubbmod.wz.cz/forum
| ========================================
| Time: Fri, 28 May 2004 13:08:30 GMT+1
| Email:
+---------------------------------------------------------------------------
*/
//--------------------------------------------
// Determine browser type and stuff.
//--------------------------------------------
var comp = navigator.userAgent.toLowerCase();
var vers = parseInt(navigator.appVersion);
var msie = ((comp.indexOf("msie") != -1) && (comp.indexOf("opera") == -1));
var nets = ((comp.indexOf('spoofer')==-1) && (comp.indexOf('compatible') == -1) && (comp.indexOf('opera')==-1) && (comp.indexOf('webtv')==-1) && (comp.indexOf('hotjava')==-1));
var moz = ((comp.indexOf("msie") == -1) && (comp.indexOf('mozilla')!=-1) && (comp.indexOf("opera") == -1));
var win = ((comp.indexOf("win")!=-1) || (comp.indexOf("16bit") != -1));
//--------------------------------------------
// Set up values
//--------------------------------------------
var b_prompt = "Please enter the text to be formatted in bold.";
var i_prompt = "Please enter the text to be formatted in italics";
var u_prompt = "Please enter the text to be underlined.";
var font_prompt = "Please enter the text to be formatted with the font tag.";
var size_prompt = "Please enter the text to be formatted with the size tag.";
var color_prompt = "Please enter the text to be formatted with the color tag.";
var align_prompt = "Please enter the text to be aligned.";
var quote_prompt = "Please enter the text to be quoted.";
var code_prompt = "Please enter the code to be treated as code and unformatted text.";
var myTags = new Array();
var buttonOver = "";
var normalmode = false;
//--------------------------------------------
// Set radio button status
//--------------------------------------------
prep_mode();
function cookieVal(cookieName) {
thisCookie = document.cookie.split("; ");
for (i=0; i<thisCookie.length; i++) {
if (cookieName == thisCookie[i].split("=")[0]) {
return thisCookie[i].split("=")[1];
}
}
return "";
}
function prep_mode() {
expireDate = new Date;
expireDate.setMonth(expireDate.getMonth()+6);
theMode = cookieVal("cb_mode");
if ( theMode == "normal" ) {
document.getElementsByName("mode")[0].checked = true;
document.getElementsByName("mode")[1].checked = false;
normalmode = true;
} else {
document.getElementsByName("mode")[0].checked = false;
document.getElementsByName("mode")[1].checked = true;
normalmode = false;
theMode = "advanced";
}
document.cookie = "cb_mode="+theMode+"; path=/; expires=" + expireDate.toGMTString();
}
function changeMode(newMode) {
expireDate = new Date;
expireDate.setMonth(expireDate.getMonth()+6);
document.cookie = "cb_mode="+newMode+"; path=/; expires=" + expireDate.toGMTString();
if(newMode == "normal") {
normalmode = true;
} else {
normalmode = false;
}
}
//--------------------------------------------
// function Size
//--------------------------------------------
function Size(arrayName) {
for (i=0;i<arrayName.length;i++) {
if((arrayName[i] == "undefined") || (arrayName[i] == "") || (arrayName[i] == null)) {
return i;
}
}
return arrayName.length;
}
//--------------------------------------------
// function Push
//--------------------------------------------
function Push(arrayName, arrayValue) {
arraySize = Size(arrayName);
arrayName[arraySize] = arrayValue;
}
//--------------------------------------------
// function Pop
//--------------------------------------------
function Pop(arrayName) {
arrayMo = Size(arrayName);
arrayValue = arrayName[arrayMo - 1];
delete arrayName[arrayMo - 1];
return arrayValue;
}
//--------------------------------------------
// function inArray
//--------------------------------------------
function inArray(item, arrayName) {
for(i=0;i<arrayName.length;i++) {
if(arrayName[i] == item) {
return true;
}
}
return false;
}
//--------------------------------------------
// function pos
//--------------------------------------------
function Pos(item, arrayName) {
for(i=0;i<arrayName.length;i++) {
if(arrayName[i] == item) {
return i;
}
}
return -1;
}
//--------------------------------------------
// function list
//--------------------------------------------
function List(type) {
if(type) {
theList = "[list="+type+"]\n";
} else {
theList = "[list]\n";
}
promptRes = "1";
while((promptRes != "") && (promptRes != null)) {
promptRes = prompt("Enter a list item. Click cancel or leave blank to end the list.", "");
if((promptRes != "") && (promptRes != null)) {
theList = theList+"[*]"+promptRes+"\n";
}
}
theList = theList+"[/list]\n";
Pastecode(theList);
}
//--------------------------------------------
// function url
//--------------------------------------------
function Hyperlink() {
var url = prompt("Please enter the URL of the website.", "http://");
if(url) {
var urltitle = prompt("If you wish to, you may also insert a title to be shown instead of the URL.", "");
if(urltitle) {
Pastecode("[url="+url+"]"+urltitle+"[/url]");
} else {
Pastecode("[url]"+url+"[/url]");
}
} else {
// should we display errror or not? if you want remove this :)
alert("You must enter a URL and a title.");
// ------------------------------------------------------------
}
}
//--------------------------------------------
// function image
//--------------------------------------------
function Img() {
var image = prompt("Please enter the remote URL of the image.", "http://");
if(image) {
Pastecode("[img]"+image+"[/img]");
} else {
// should we display errror or not? if you want remove this :)
alert("You must enter a URL for the image.");
// ------------------------------------------------------------
}
}
//--------------------------------------------
// function email
//--------------------------------------------
function Email() {
var email = prompt("Please enter the email address.", "");
if(email) {
var emailtitle = prompt("If you wish to, you may also insert a title to be shown instead of the email address.", "My Email Address");
if(emailtitle) {
Pastecode("[email="+email+"]"+emailtitle+"[/email]");
} else {
Pastecode("[email]"+email+"[/email]");
}
} /* added by me */
else {
// should we display errror or not? if you want remove this :)
alert("You must enter a email address.");
// ------------------------------------------------------------
}
}
//--------------------------------------------
// function Paste bbcode
//--------------------------------------------
function Pastebbcode(myCode,selItem) {
if(myCode == "list") {
List(selItem);
} else if(myCode == "url") {
Hyperlink();
} else if(myCode == "img") {
Img();
} else if(myCode == "email") {
Email();
} else {
if(normalmode) {
var prompttext = eval(myCode + "_prompt");
if(selItem) {
if(selItem != "-") {
promptres = prompt(prompttext + "\n["+myCode+"="+selItem+"]xxx[/"+myCode+"]", "");
}
} else {
promptres = prompt(prompttext + "\n["+myCode+"]xxx[/"+myCode+"]", "");
}
if((promptres != null) && (promptres != "")) {
if(selItem) {
if(selItem != "-") {
Pastecode("["+myCode+"="+selItem+"]"+promptres+"[/"+myCode+"]");
}
} else {
Pastecode("["+myCode+"]"+promptres+"[/"+myCode+"]");
}
}
} else {
var thingA = myCode+"_"+selItem;
args = thingA.split("_");
lastIndex = 0;
alreadyopen = false;
for(i=0;i<myTags.length;i++) {
theTag = myTags[i];
if(theTag) {
args2 = theTag.split("_");
if(args2[0] == args[0]) {
alreadyopen = true;
lastIndex = i;
}
}
}
if(alreadyopen) {
while(myTags[lastIndex]) {
tagRemove = Pop(myTags);
thingB = tagRemove.split("_");
Pastecode("[/"+thingB[0]+"]", "", false);
// unclick it
element = eval("document.images['"+tagRemove+"']");
if(element && !element.disabled && element.nodeName == "IMG") {
if(Over == tagRemove) {
}
}
if(thingA == tagRemove) {
noInsert = true;
}
}
}
if(selItem && selItem != "-" && !noInsert) {
isClosed = Pastecode("["+myCode+"="+selItem+"]", "[/"+myCode+"]", true);
if(!isClosed) {
Push(myTags, myCode+"_"+selItem);
} else {
element = eval("document.images['"+myCode+"']");
if(element && !element.disabled && element.nodeName == "IMG") {
element.className = "toolbar";
}
}
}
else if(!selItem && !alreadyopen) {
isClosed = Pastecode("["+myCode+"]", "[/"+myCode+"]", true);
if(!isClosed) {
Push(myTags, myCode);
} else {
element = eval("document.images['"+myCode+"']");
if(element && !element.disabled && element.nodeName == "IMG") {
element.className = "toolbar";
}
}
}
var alreadyopen = false;
var noInsert = false;
}
}
setFocus(document.all.req_message);
}
//--------------------------------------------
// function close all Tags
//--------------------------------------------
function closeAllTags() {
if(myTags[0]) {
while(myTags[0]) {
tagRemove = Pop(myTags);
args = tagRemove.split("_");
isClosed = Pastecode("[/"+args[0]+"]", "", false, true);
element = eval("document.images['"+tagRemove+"']");
if(element && !element.disabled && element.nodeName == "IMG") {
element.className = "toolbar_normal";
}
}
}
myTags = new Array();
setFocus(document.all.req_message);
}
//--------------------------------------------
// function Pastecode
//--------------------------------------------
function Pastecode(myCode, myClose, singleTag, ignoreSel) {
isClosed = true;
if(ignoreSel != true) {
ignoreSel = false;
}
var messageBox = document.getElementById("req_message"); ;
if(msie && win && (vers >= 4)) {
setFocus(messageBox);
var seltext = document.selection;
var range = seltext.createRange();
if(ignoreSel != false) {
range.collapse;
}
if(((seltext.type == "Text" || seltext.type == "None") && range != null) && ignoreSel != true) {
if(myClose && range.text.length > 0) {
myCode = myCode+range.text+myClose;
} else {
if(singleTag) {
isClosed = false;
}
}
range.text = myCode;
} else {
messageBox.value += myCode;
}
}
else if(moz) {
var select_start = messageBox.selectionStart;
var select_end = messageBox.selectionEnd;
if(select_end <= 2) {
select_end = messageBox.textLength;
}
var start = (messageBox.value).substring(0, select_start);
var middle = (messageBox.value).substring(select_start, select_end);
var end = (messageBox.value).substring(select_end, messageBox.textLength);
if((messageBox.selectionEnd - messageBox.selectionStart > 0) && ignoreSel != true) {
middle = myCode+middle+myClose;
} else {
if(singleTag) {
isClosed = false;
}
middle = myCode+middle;
}
messageBox.value = start+middle+end;
}
else {
messageBox.value += myCode;
if(singleTag) {
isClosed = false;
}
}
setFocus(messageBox);
return isClosed;
}
//--------------------------------------------
// function setFocus
//--------------------------------------------
function setFocus(formElement) {
formElement.focus();
}
//--------------------------------------------
// function addsmilies
//--------------------------------------------
function smilie(addemot)
{
Pastecode(" " + addemot + " ", "", false);
}
//--------------------------------------------
// Script End
//--------------------------------------------
</script>
Maciek wrote:Ok try this 1.0.2 version.
ok, tested it. now i'm getting:
Line: 164
Char: 9
Error: 'document.input.mode' is null or not an object
Code: 0(i'm using ie6 + latest updates)
Now I found the reason.
1. open edit.php
2. find
<form method="post" action="edit.php?id=<?php echo $id ?>&action=edit" id="edit" onsubmit="return process_form(this)">
3. replace with
<form method="post" action="edit.php?id=<?php echo $id ?>&action=edit" name="theform" id="edit" onsubmit="return process_form(this)">
4. save and upload
5. open post.php
6. find
$form = '<form method="post" action="post.php?action=post&tid='.$tid.'" id="post" onsubmit="return process_form(this)">';
7. replace with
$form = '<form method="post" action="post.php?action=post&tid='.$tid.'" name="theform" id="post" onsubmit="return process_form(this)">';
8. save and upload
9. open bb_code.php
10. find
function prep_mode() {
expireDate = new Date;
expireDate.setMonth(expireDate.getMonth()+6);
theMode = cookieVal("cb_mode");
if ( theMode == "normal" ) {
document.input.mode[0] = true;
document.input.mode[1] = false;
normalmode = true;
} else {
document.input.mode[0] = false;
document.input.mode[1] = true;
normalmode = false;
theMode = "advanced";
}
document.cookie = "cb_mode="+theMode+"; path=/; expires=" + expireDate.toGMTString();
}
11. replace with
function prep_mode() {
expireDate = new Date;
expireDate.setMonth(expireDate.getMonth()+6);
theMode = cookieVal("cb_mode");
if ( theMode == "normal" ) {
document.theform.input.mode[0] = true;
document.theform.input.mode[1] = false;
normalmode = true;
} else {
document.theform.input.mode[0] = false;
document.theform.input.mode[1] = true;
normalmode = false;
theMode = "advanced";
}
document.cookie = "cb_mode="+theMode+"; path=/; expires=" + expireDate.toGMTString();
}
12. save and upload
can any buddy help me im olmoost finisht http://fun.zenz.nl/forum/
edit bbcode.php beginning </select> like this
</select>
</td>
</tr>
<tr>
<td>
<//-------------------------------------------->
<// if we need some bbcode buttons :) >
<//-------------------------------------------->
<input type="button" class="punbutton" value="B" name='B' style="font-weight:bold" onClick="Pastebbcode('b')">
<input type="button" class="punbutton" value="I" name='I' style="font-style:italic" onClick="Pastebbcode('i')">
<input type="button" class="punbutton" value="U" name='U' style="text-decoration:underline" onClick="Pastebbcode('u')">
<input type="button" class="punbutton" value="List" name='list' onClick="Pastebbcode('list')">
<input type="button" class="punbutton" value="Img" name='img' onClick="Pastebbcode('img')">
<input type="button" class="punbutton" value="http://" name='http://' onClick="Pastebbcode('url')">
<input type="button" class="punbutton" value="email" name='email' onClick="Pastebbcode('email')">
<input type="button" class="punbutton" value="quote" name='quote' onClick="Pastebbcode('quote')">
<input type="button" class="punbutton" value="code" name='code' onClick="Pastebbcode('code')">
<input type="button" class="punbutton" value="close all tags" name='close all tags' onClick="closeAllTags()">
</td>
</tr>
<//---------------------------------------------------->
<//but what if we need change radio button status :/ >
<//---------------------------------------------------->
<tr>
<td>
<small><input type="radio" name="mode" value="normal" onClick="changeMode('normal')"> Guided Mode <input type="radio" name="mode" value="advanced" onClick="changeMode('advanced')" checked="checked"> Normal Mode</small>
</td>
</tr>
</table>
/* +-------------------------------------------------------------------------- | PunBB code buttons 1.0.2 | ======================================== | By Maciej Ziolkowski | http://pubbmod.wz.cz/forum | ======================================== | Time: Mon, 14-o6-2004 10:08:30 GMT+1 | Email: admin@amberapple.pl +--------------------------------------------------------------------------- | Modified by Jacobswell | http://jacobswell.nared.net/ +--------------------------------------------------------------------------- */
Wow... my name is there. actually I apprecate for your code for without yours I would have a hard time to make one.
one more bug patch.
if you use netscape, when you write a littel, you can't insert bbcode at the first position.
in function pastecode you can see the code
else if(moz && messageBox.selectionEnd) {
change like this:
else if(moz) {
I've changed some code, and it work fine!
var normalmode = false;
//--------------------------------------------
// Set radio button status
//--------------------------------------------
prep_mode();
function cookieVal(cookieName) {
thisCookie = document.cookie.split("; ");
for (i=0; i<thisCookie.length; i++) {
if (cookieName == thisCookie[i].split("=")[0]) {
return thisCookie[i].split("=")[1];
}
}
return "";
}
function prep_mode() {
expireDate = new Date;
expireDate.setMonth(expireDate.getMonth()+6);
theMode = cookieVal("cb_mode");
if ( theMode == "normal" ) {
document.input.mode[0].checked = true;
document.input.mode[1].checked = false;
normalmode = true;
} else {
document.input.mode[0].checked = false;
document.input.mode[1].checked = true;
normalmode = false;
theMode = "advanced";
}
document.cookie = "cb_mode="+theMode+"; path=/; expires=" + expireDate.toGMTString();
}
function changeMode(newMode) {
expireDate = new Date;
expireDate.setMonth(expireDate.getMonth()+6);
document.cookie = "cb_mode="+newMode+"; path=/; expires=" + expireDate.toGMTString();
if(newMode == "normal") {
normalmode = true;
} else {
normalmode = false;
}
}
variable normalmode should be declared first!
I've changed it like it works as a function : pun_extern($action, $fid, $show, $type)
It will be more useful when you make a front page. I added "array" type to the last variable $type. see the example 3
this is the code : http://jacobswell.nared.net/upload/punbb_extern.zip
example 1:
<?php
$pun_root = './punbb/';
include $pun_root."punbb_extern.php";
?>
<table cellpadding=1 cellspacing=0 border=0 width=95%><tr><td bgcolor=#A57121>
<table cellpadding=5 cellspacing=1 border=0 width=100%>
<tr>
<td bgcolor=white><?php echo pun_extern('new'); ?></td>
</tr>
<tr>
<td bgcolor=white><?php echo pun_extern('active', 1, 5); ?></td>
</tr>
<tr>
<td bgcolor=white><?php echo pun_extern('stats'); ?></td>
</tr>
</table>
</td></tr></table>
example 2:
<?php
$pun_root = './punbb/';
include $pun_root."punbb_extern.php";
// pun_extern('action','fid','show',type')
exit(pun_extern('active','','','RSS'));
?>
exaple 3: this just shows the array result.
<?php
$pun_root = './punbb/';
include "array_dump.class.php";
$arr_dump = new array_dump;
include $pun_root."punbb_extern.php";
// pun_extern('action','fid','show',type')
?>
<table cellpadding=1 cellspacing=0 border=0 ><tr><td bgcolor=#A57121>
<table cellpadding=5 cellspacing=1 border=0 width=100%>
<td bgcolor=#F7DFAD align=center>Test for pun_extern('new','','','array')</td>
</tr>
<tr>
<td bgcolor=white>
<?php
$r = pun_extern('new','','','array');
$arr_dump->max_length(150);
echo $arr_dump->dump($r); ?>
</td>
</tr>
<tr>
<td bgcolor=#F7DFAD align=center>Test for pun_extern('active','','5','array')</td>
</tr>
<tr>
<td bgcolor=white>
<?php
$r = pun_extern('active', '', 5,'array');
$arr_dump->max_length(150);
echo $arr_dump->dump($r); ?>
</td>
</tr>
<tr>
<td bgcolor=#F7DFAD align=center>Test for pun_extern('active','1','1','array')</td>
</tr>
<tr>
<td bgcolor=white>
<?php
$r = pun_extern('active','1','1','array');
$arr_dump->max_length(150);
echo $arr_dump->dump($r); ?>
</td>
</tr>
<tr>
<td bgcolor=#F7DFAD align=center>Test for pun_extern('stats','','','array')</td>
</tr>
<tr>
<td bgcolor=white>
<?php
$r = pun_extern('stats','','','array');
$arr_dump->max_length(150);
echo $arr_dump->dump($r); ?>
</td>
</tr>
</table>
</td></tr></table>
you can see the result of last example here
I just tested the search engine and found there is no highlighting words that are searched.
after searching the links that have that word are listed. the links will be like this : http://your site/your punbb/viewtopic.php?id=forum_id.
Mine idea is adding "?keywords=keywords" after http://your site/your punbb/viewtopic.php?id=forum_id. by doing this we can highlight those words that are searched. easy to find where those words are located.
How about it?
I see. thanks.
I think we don't need go button at "jump to" for when you choose where you wanna go, it will automatically go there, not by pressing go button.
hmm. anyway this might not be a bug
in parser.php we have do_bbcode function. change some code like this:
$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
'#\[url\](.*?)\[/url\]#e',
'#\[url=(.*?)\](.*?)\[/url\]#e',
'#\[list\](.*?)\[/list\]#si',
'#\[\*\]#si',
'#\[size=(.*?)\](.*?)\[/size\]#si',
'#\[font=(.*?)\](.*?)\[/font\]#si',
'#\[align=(.*?)\](.*?)\[/align\]#si',
'#\[email\](.*?)\[/email\]#',
'#\[email=(.*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
'#\[----\]#s'
);
$replace = array('<strong>$1</strong>',
'<em>$1</em>',
'<u>$1</u>',
'truncate_url(\'$1\')',
'truncate_url(\'$1\', \'$2\')',
'<ul>$1</ul>',
'<li>',
'<font size=\'$1\'>$2</font>',
'<font face=\'$1\'>$2</font>',
'<p align=\'$1\'>$2</p>',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<font color="$1">$2</font>',
'<hr>'
);
You can see it works in my site : http://jacobswell.nared.net
How about have wiki plugin?
I'm just making now not yet finished. anyone who has any good idea, please share with me.
you can see the current job here : http://jacobswell.nared.net/punbb/wiki.php
Another bug found.
select tag is not closed when you press "close all tags" button.
it is because of the function closeTags name.
function closeTags should be named as closeallTags.
in dblayer file( mysql.php, pgsql.php ) __FILE__, __LINE__ order is reversed.
I made a BBCode parser using most of funcitons from punbb parser, changing some code for supporting html code and javascript option.
anyone who need, feel free to use it.
here is the source : bbcode.zip
example is included into the zip file.
in bb_code.php
</select>
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
should be replaced with
</select>
</td>
</tr>
<tr>
<td>
and
</td>
</tr>
</td>
</tr>
<//---------------------------------------------------->
<//but what if we need change radio button status :/ >
<//---------------------------------------------------->
<tr>
<small><input type="radio" name="mode" value="normal" onClick="changeMode('normal')">
Guided Mode
<input type="radio" name="mode" value="advanced" onClick="changeMode('advanced')" checked="checked">
Normal Mode</small>
</tr>
</table>
should be replace with
</td>
</tr>
<//---------------------------------------------------->
<//but what if we need change radio button status :/ >
<//---------------------------------------------------->
<tr>
<td>
<small><input type="radio" name="mode" value="normal" onClick="changeMode('normal')">
Guided Mode
<input type="radio" name="mode" value="advanced" onClick="changeMode('advanced')" checked="checked">
Normal Mode</small>
</td>
</tr>
</table>
something missing in the code of parser.php.
missing code for [*].
$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
'#\[url\](.*?)\[/url\]#e',
'#\[url=(.*?)\](.*?)\[/url\]#e',
'#\[list\](.*?)\[/list\]#si',
'#\[\*\]#si',
'#\[size=(.*?)\](.*?)\[/size\]#si',
'#\[font=(.*?)\](.*?)\[/font\]#si',
'#\[align=(.*?)\](.*?)\[/align\]#si',
'#\[email\](.*?)\[/email\]#',
'#\[email=(.*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
'#\[----\]#s'
);
$replace = array('<strong>$1</strong>',
'<em>$1</em>',
'<u>$1</u>',
'truncate_url(\'$1\')',
'truncate_url(\'$1\', \'$2\')',
'<ul>$1</ul>',
'<li>',
'<font size=\'$1\'>$2</font>',
'<font face=\'$1\'>$2</font>',
'<p align=\'$1\'>$2</p>',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<span style="color: $1">$2</span>',
'<hr>'
);
[----] means horizental line. I added for me. Great Job. thanks.
email code is working the same either the "guided mode" or "normal mode".
is it possible to support for mozilla even though not opera, seeing htmlarea?
PunBB Forums → Posts by jacobswell
Powered by PunBB, supported by Informer Technologies, Inc.