2,601

(4 replies, posted in PunBB 1.2 discussion)

You'd have to change some queries, add some code similar to the subject handling code, and add a copy of the subject field. Enough to do tongue

2,602

(14 replies, posted in PunBB 1.2 bug reports)

Smartys wrote:

To me this means I find where the servers are located, in my case.. Utah (-7 MST), and set accordingly.

I think this has been suggested to Rickard in the past, but PHP can determine the timezone offset for the forums: couldn't this be included at install to auto-set the timezone?

I already did this for my admin_options.php. Would be easy to put in the install script smile

If you have a forum where you have alot of PHP coding withing your code tags, replace line 431 in parser.php (this is in v1.2.10)

$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.$inside[$i].'</pre></div></div></div><p>';

with

$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.highlight_string($inside[$i],true).'</pre></div></div></div><p>';

This should work fine, but as I'm not on my dev machine atm, I didn't get the chance to test it.

Have fun smile

-- Bekko

2,604

(16 replies, posted in PunBB 1.2 discussion)

In parser.php, you could try sending the message() function when a certain word/sentence is in a post.

Something like this (doing this out of my head tongue):

$unallowed_words = array("Viagra","Ciaris"); // add some more in this style
$str_unallowed = implode(", ",$unallowed_words);
if(strpos($text,$unallowed_words)) {
message("This is a message against spam bots. Please remove the words " . $str_unallowed . " from your post.");
}

Yes, get a smaller community tongue Although it would require quite a big community (in the millions or so :S) to reach 30-40 seconds of execution.

Try checking the code for any infinite loops smile

Cherry wrote:

I've just added this, and it works like a charm - that's a big compliment, as I'm not exactly Mrs Code Queen!
Apart from a big THANK YOU, I have these 3 comments:

1] You didn't add your license disclaimer thingy, so I've written one in wink
2] I moved the position to after the ul.bblinks and took the width&margin properties off - as I don't have a mile-wide screen (and nor do most users), that looks neater.
3] As a good webaunty, I need/want to add alt tags to the smilies. Where do I put them?

Just seen that you've released another update, so maybe you've answered the above.
Thanks for the smilies! big_smile

Cx

Well, first of all, thx smile

Then for the comments:

1) Yea, I always forget that tongue When my comp's fixed, I'll add it smile
2) The position is your choice ofcourse smile I originally made it for a friend of mine, who wanted it in there tongue.
-- The width setting is set to 20%, which auto-resizes to your screen wink I tested it on a 1024x768 and it looked quite well. The (top)margin is set to correct the difference between the position of the menu and the message txtbox smile The right-margin is removed in 0.4 smile
3) I'm pretty sure the images have alt tags wink But if you want to set them, it's in the do_smilies function in parser.php. Lemme check if it's set smile

-- Bekko


EDIT: Yeps, I was right tongue

$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);

As you can see, the alt tag is set to show the image name smile (I think, it's rather messy to me :S) But of course, you can easily change that.

Good question tongue Changed smile

2,608

(14 replies, posted in PunBB 1.2 troubleshooting)

You mean embed them with BBCode?

Probably.

This is a screenshot (yes, I know, I have a large screen tongue):
http://icstrategy.midgetforhire.com/Images/SCREEN0001.JPG

This mod adds the possibility to easily add smilies to posts by clicking on them from a small menu next to the message textbox. (much like in phpBB)

##
##
##        Mod title:  Smiley Menu
##
##      Mod version:  0.7
##   Works on PunBB:  Should work on every version
##     Release date:  2006-05-10
##           Author:  El Bekko (elbekko@gmail.com)
##
##      Description:  This tool adds the possibility to 
##                      easily add smileys to posts by
##                      clicking on them in a small menu.
##
##     Difference with  
## previous version:  Quick Post bug fixed. See step 16 & 17 for fix.
##
##   Affected files:  post.php, viewtopic.php
##                    
##       Affects DB:  No
##
##            Notes:  Changed the check for duplicate entries in 0.5
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

[url=http://www.punres.org/files.php?pid=174]Download Here[/url

Just make all forums fully accessible for guests wink

0.5.1 uploaded.

2,613

(4 replies, posted in PunBB 1.2 bug reports)

Your server might automatically close pconnects, but I think that would be rather, ehm, uncommon tongue
I don't think it's a punBB bug neither. But that's just my thought tongue

big_smile

Do note, there seems to be a minor bug in the readme that I'll update today or tomorrow (probably today). I forgot to change the part to paste in parser.php after I updated a db function there sad
So expect another update with some more fixes soon smile

Updated to version 0.5, fixes are described in top post.

It's not so hard for the most stuff, indeed tongue Now come find me on IRC X(

2,617

(132 replies, posted in General discussion)

lol big_smile

K, thx, it worked big_smile

A friend of mine installed 1.2.10 a couple of days ago. He uses a .be domain with domainforwarding (creates a frame on the domain page). Whenever a user with IE tries to log on from the domain he gets the message he's logged in, gets redirected to the main page and isn't logged in. It works fine without the domain's frameset tho.

Any idea what the problem might be? (except for not using IE, as most of his class, what the forum is for, probably is to stupid to get Firefox)

-- Bekko

I saw your memos Smartys... I know it doesn't hae support for anything else than MySQL, and I clearly stated that. I'm trying to make it compatible with all, as you obviously saw on punres.org.

And it would also help if you state EXACTLY where those errors are, as I'm not suhc a 1337 coder as you that has written numerous mods tongue I'm looking into fixing it now (installer were some copy errors sad).

But I don't like modifying code without adding an extra feature ontop tongue So tell me what should be improved/added smile

Code:

if ($id == 1,2,3,4,8,9)

? Not specifically those, but can you make this affect multiple forums like that?
Also, the code for viewforum.php, does this need to go in a specific place or overwrite a specific piece of code? I dont think it does, but would like to make sure.

More as in:

$forum_ids = array(1,2,3,4,8,9);
if(in_array($id,$forum_ids))
  {
  ...
  }

2,622

(5 replies, posted in PunBB 1.2 troubleshooting)

True... you could try to ping the server the image is on when the signature gets submitted. If it reaches x ms you don't parse it. Would create a simple solution, but a huge speed decrease in the signature submit part.

2,623

(5 replies, posted in PunBB 1.2 troubleshooting)

getimagesize()

From the PHP manual:

getimagesize

(PHP 3, PHP 4, PHP 5)
getimagesize -- Get the size of an image
Description
array getimagesize ( string filename [, array &imageinfo] )

The getimagesize() function will determine the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM, or WBMP image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML <IMG> tag.

If accessing the filename image is impossible, or if it isn't a valid picture, getimagesize() will return FALSE and generate an error of level E_WARNING.

    Note: Support for JPC, JP2, JPX, JB2, XBM, and WBMP became available in PHP 4.3.2. Support for SWC exists as of PHP 4.3.0 and TIFF support was added in PHP 4.2.0 

    Note: JPEG 2000 support was added in PHP 4.3.2. Note that JPC and JP2 are capable of having components with different bit depths. In this case, the value for "bits" is the highest bit depth encountered. Also, JP2 files may contain multiple JPEG 2000 codestreams. In this case, getimagesize() returns the values for the first codestream it encounters in the root of the file. 

    Note: The getimagesize() function does not require the GD image library. 

Returns an array with 4 elements. Index 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 is a flag indicating the type of the image: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. These values correspond to the IMAGETYPE constants that were added in PHP 4.3.0. Index 3 is a text string with the correct height="yyy" width="xxx" string that can be used directly in an IMG tag.

Example 1. getimagesize (file)
<?php
list($width, $height, $type, $attr) = getimagesize("img/flag.jpg");
echo "<img src=\"img/flag.jpg\" $attr alt=\"getimagesize() example\" />";
?>

URL support was added in PHP 4.0.5

Example 2. getimagesize (URL)
<?php
$size = getimagesize("http://www.example.com/gifs/logo.gif");

// if the file name has space in it, encode it properly
$size = getimagesize("http://www.example.com/gifs/lo%20go.gif");

?>

With JPG images, two extra indexes are returned: channels and bits. channels will be 3 for RGB pictures and 4 for CMYK pictures. bits is the number of bits for each color.

Beginning with PHP 4.3.0, bits and channels are present for other image types, too. However, the presence of these values can be a bit confusing. As an example, GIF always uses 3 channels per pixel, but the number of bits per pixel cannot be calculated for an animated GIF with a global color table.

Some formats may contain no image or may contain multiple images. In these cases, getimagesize() might not be able to properly determine the image size. getimagesize() will return zero for width and height in these cases.

Beginning with PHP 4.3.0, getimagesize() also returns an additional parameter, mime, that corresponds with the MIME type of the image. This information can be used to deliver images with correct HTTP Content-type headers:

So yes, it can be done, assuming that the host's PHP version is > 4.3.0 smile

Try finding those JScript functions

2,625

(55 replies, posted in Feature requests)

Absolutely no idea