The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#91
|
|||
|
|||
![]()
perfect timing...i just switched to VB today!
|
#92
|
|||
|
|||
![]()
I can't wait to see this released...
|
#93
|
|||
|
|||
![]() Quote:
Yep, yep =D :squareeyed: |
#94
|
||||
|
||||
![]()
LOL, I just got this PM over at vbulletin.com:
Quote:
Quote:
|
#95
|
||||
|
||||
![]() Quote:
|
#96
|
||||
|
||||
![]()
I've been looking for something like this myself, so a HUGE thanks to Sonia for coding this
![]() |
#97
|
|||
|
|||
![]()
Hi Everyone...
Thanks for the input on the database question, I will use (2) as the way of doing the edit! One other question! image = height / width! Lets say a image 200 pixles in width! My question... What should I use as a rule to convert ( number of pixels = 1 character) What I mean... Say a smilies is 15X15, height/width, and the font size is 10 pixles So if I divided ( 15 / 10 ) then that smilie would = 1.5 characters! So that is my question... (what should be the divider? 10 or maybe the size between the minimum and maximum allowed)! I'll give you a idea of why I am asking! After a signature has been validated, there is a chance that a line will have image(s) and text together.... Like so..... this was a very sunny day [image]100X400[/image] and I enjoyed it very much! [image]100X400[/image] The maximum line length is 120! The example line above is ( 55 characters + ( 400/10 = 40) + (400/10 =40) So it ends up being 135 characters, (15) over the limit, so if that happens, we do this! reverse the string if we have more than one image, then line break it. The result! this was a very sunny day [image]100X400[/image] and I enjoyed it very much! [image]100X400[/image] This way signatures never push the forum into a scroll view! Note this is a option that you can turn on or off... Here is the function that does this! Code:
/* this is only called to do line breaks on images with text (admin option) */ function sig_last_process ( $str, $uo ) { /* get each line */ $lines = preg_split ( '#\r?\n#', $str ); /* get the smilies they are waiting for us, static */ $sc = sig_smilies (); /* the maximum line length */ $line = $uo['line']; /* all the images in this signature in a nice array */ $each = $uo['img']; /* loop de loop, easy stuff (lines loop) */ for ( $i = 0; $i < sizeof ( $lines ); $i++ ) { /* set are values, reset them for each line */ $lc = 0; $it = 0; $hold = array (); $temp = $lines[$i]; /* check if we find a image in this line */ for ( $j = 0; $j < sizeof ( $each ); $j++ ) { if ( ( $is = substr_count ( $lines[$i], $each[$j][0] ) ) > 0 ) { /* found a image convert from pixels to characters */ $it += ceil ( ( ( $is * $each[$j][2] ) / 10 ) ); /* remove the image and all of it's bbcode or html if it's on */ $temp = preg_replace ( '!\[.*' . $each[$j][0] . '\[\/.*\]|\<.*' . $each[$j][0] . '.*>!is', '', $temp ); /* load the remember array with this image. (used to do the line break loop) */ $hold[] = $each[$j][0]; /* loop the smilies and count them as we go */ for ( $k = 0; $k < sizeof ( $sc['text'] ); $k++ ) { if ( ( $ts = substr_count ( $temp, $sc['text'][$i] ) ) > 0 ) { /* found a smile get it's height/width and convert it to total characters */ // I am going to kill this, and just add the sizes to the smiliescache $ss = getimagesize ( './' . $sc['code'][$sc['text'][$i]][0] ); $lc += ceil ( ( ( $ss[0] * $ts ) / 10 ) ); /* remove this smilie so it does not count into the character count */ $temp = sig_remove_smilie ( $temp, $sc['text'][$i] ); } } } } /* done with this line, do we have a image? */ if ( ! empty ( $it ) ) { /* we need to remove URL bbcode so it does not play into the character count */ $temp = preg_replace ( '!\[url=.*\]|\[\/url\]|\<a.*\>|\<\/a\>!is', '', $temp ); /* the total character in this line (images converted to characters, and real characters left in the line */ $total = ( strlen ( $temp ) + $it + $lc ); /* loop the line add the line break where it is needed */ if ( $total > $line ) { for ( $l = 0; $l < sizeof ( $hold ); $l++ ) { $lines[$i] = preg_replace ( "!(\[.*" . $hold[$l] . "\[\/.*\]|\<.*" . $hold[$l] . ".*\<\/a\>)!is", "\r\n\\1", $lines[$i] ); } } } } /* all done, give the signature back to the update user signature function */ // another signature that passed the test, !!YA!! return ( implode ( "\r\n", $lines ) ); } demo will finally be up tomorrow morning, beta release for sure sometime tomorrow! Sonia |
#98
|
||||
|
||||
![]()
sounds like you solved your own problem.
|
#99
|
||||
|
||||
![]()
Any chance of this being released soon? It looks like you just about got it nailed down several days ago. Thanks for coding this much-needed hack!
|
#100
|
|||
|
|||
![]() Quote:
http://forum.ya-right.com/index.php? you need to create an account to demo the control, no validation needed! I will be releasing it on Sunday, I just need to finish a few minor things (more phrases) for the extra stuff I added and the (help system / Forum Facts) needs to be updated to add the information for the new options! I think I may have went a little over board, but total control you will have!!! c, ya... Sonia |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|