76

(8 replies, posted in Programming)

Thanks Smartys.

Got it working for firefox.

IE is not working.

77

(8 replies, posted in Programming)

When I open punnBB page, I see an icon before http address. I was wondering where and how do I set it

Thanks Connorhd.
I lost track of this thread.

oops, it is beyond my reach

80

(25 replies, posted in Feature requests)

I agree, it is not foolproof, but it is easy until someone creates a foolproof mode

81

(25 replies, posted in Feature requests)

I think, you cld remove the edit/delete links on the post by adding a chek on 'posted' with current time.

viewtopic.php

line 268 ....

I created a revised version, which fixes the numbering and search for the same. I renamed the file as today.php

http://jobs.gotoguide.org/today.zip

83

(1,382 replies, posted in General discussion)

Last of the Mohicans

Are you  planning to add pictures in PunBB menu bar or Creating a new menu bar ?

where is the link to your test post

I think you should be, but as you have a working solution, why bother wink.

Thanks - Miles and Smartys.

I modified the code.

thanks again Miles.

See  #106 post( by codeXP) in this thread http://punbb.org/forums/viewtopic.php?pid=37484#p37484

Smartys wrote:

Erm, I think that has an SQL inject in it smile Edit: I'm talking about the exclusion

Sorry, I dint follow you. Did you receive any err msgs.
If you are talking abt the SQL change, I jst added a NOT IN ($exclude_forum_ids).  it can be reversed by making it IN for include.

Another silly modification, basically allows to exclude forum id's from search.

For example,  Insted of using search.php?action=show_24h, which retrives posts from all forums, I added an exclude param, which excludes specified forum id's from search. eg.  search.php?action=show_24h&exclude=8,10,15

Changed files: footer.php and search.php

Demo: http://jobs.gotoguide.org/index.php - try 'show recent posts' and 'show unasnwered posts'

in case anyone think this can be useful, download http://www.gotoguide.org/jobs.zip

in footer.php file, line 47, modify $exclude_forum_ids ="8,10,15";  change '8,10,15' with your forum ids.

In case anyone decide to use this, please make the following changes also to make the pics more managable.

change line 498 as follows - basically moves the png files to their own directory

$filename ="img/imagize/".substr($email, 0,strrpos($email, '.')).".png";

and create a directory called imagize inside the img directory.

I wanted to try something in php to start with, sort of glad that my first prg in php works ok !

(PHP 4 >= 4.0.6, PHP 5) and  GD 2.0.1 or later.

Add the following lines to userlist.php

To give permission only to admis and mods

if($pun_user['g_id']  != PUN_ADMIN || $pun_user['g_id'] != PUN_MOD)
    message($lang_common['No permission']);

or use this, to give access only to logged in people.

if ($pun_user['is_guest'] )
        message($lang_common['No permission']);

Add either of the code blocks just above this line. (line no 33 - 34  range)

// Load the userlist.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/userlist.php';

I modified parser.php file to add  a new bbcode namely [x] -[/x]. if you place an email address between them, then it will be converted to a .png (1k approx), file.

demo:
http://jobs.gotoguide.org/viewtopic.php?id=400
see the emai, it is a png file created on the fly

In case anyone want try it, upload this new  parser.php file.

http://www.gotoguide.org/parser.zip

all code to create image is at the end of the file, modify  $foreground and $background  for diff color pics.

any suggestions, comments !

96

(9 replies, posted in Programming)

thanks guys. I got it working.

http://jobs.gotoguide.org/viewtopic.php?pid=3#p3

97

(9 replies, posted in Programming)

Thanks. I havent thgt abt  the filenames yet.

I am able to execute and see the values with this line

<h5><?php $text= "[x]druvans@gmail.com[/x]"; $text=preg_replace('#\[x\](.*?)\[/x\]#e','imagize(\'$1\')',$text); echo $text;  ?></h5

I still cldnt figure out, how to integrate it to bbcode

98

(9 replies, posted in Programming)

I am not sure what exactly you mean by that.

thanks

99

(9 replies, posted in Programming)

able to get it work, trying to integrate to bbcode

<h5><?php $text= "[x]druvans@gmail.com[/x]"; $text=preg_replace('#\[x\](.*?)\[/x\]#e','imagize(\'$1\')',$text); echo $text;  ?></h5>

<?php

/***********************************************************************
Druvan (druvan@gmail.com)
Use it anyway you want it.
************************************************************************/
function imagize($email){

$fontsize=4;
// Create the image
$im = @imagecreatetruecolor( strlen($email)*8, 16 ) or die( "Cannot Initialize new GD image stream" );
//Create background color
$background = imagecolorallocate($im, 255,  255,255);
imagefilledrectangle( $im, 0,0,strlen($email)*8, 16, $background);

// Create foreground color
$foreground = imagecolorallocate($im, 125,  125,125);
// write the string at the top left
imagestring($im,$fontsize, 0, 0, $email, $foreground);


// Using imagepng() results in clearer text compared with imagejpeg()
$filename =substr($email, 0,strrpos($email, '@')).".png";
imagepng($im,$filename);
return "<img src='".$filename."' />";
}

?>


?>

My forum is giving an error as follows,

Error: Unable to connect to MySQL and select database. MySQL reported: Too many connections.


what shld I do to fix this