This example serves to illustrate for admins of SF networks, the error code display tags (BBCode).
Welcome
The error lies in the fact that if you use code tag in square brackets is the code is ill-formed.
Square brackets is used interchangeably with {} brackets 'Championships' so you can easily see them. In another tako {code} {/code} inserts a piece of code:
Additional suggestion: In the CODE section of text should be a fixed width eg. CourierNew, is more understandable.
<?phpnppUserCommand("NPPM_ACTIVATEDOC",0,0);// activate first view and first document$logtxt=sciGetText();// get text from active document text$logtxt=nl2br($logtxt);$base_url="http://www.google.com/uds/Gtranslate";$l_from="en";// translate language from$l_to="pl";// translate language to$url="$base_url?v=1.0&key=notsupplied&q=".urlencode($logtxt)."&langpair=".$l_from."|".$l_to;$contents=file_post_contents($url);$json=json_decode($contents,true);if($json{'responseStatus'}==200)printpreg_replace("#<br\s*?/?>#si","",$json{'responseData'}{'translatedText'});elseprint"Error Response status:{$json{'responseStatus'}},"." details: {$json{'responseDetails'}}";functionfile_post_contents($url,$remove_headers=true){$url=parse_url($url);if(!isset($url{'port'})){if($url{'scheme'}=='http'){$url{'port'}=80;}elseif($url{'scheme'}=='https'){$url{'port'}=443;}}$url{'query'}=isset($url{'query'})?$url{'query'}:'';$url{'protocol'}=$url{'scheme'}.'://';$eol="\r\n";$headers="POST ".$url{'protocol'}.$url{'host'}.$url{'path'}." HTTP/1.0".$eol."Host: ".$url{'host'}.$eol."Referer: ".$url{'protocol'}.$url{'host'}.$url{'path'}.$eol."Content-Type: application/x-www-form-urlencoded".$eol."Content-Length: ".strlen($url{'query'}).$eol.$eol.$url{'query'};$fp=fsockopen($url{'host'},$url{'port'},$errno,$errstr,30);if($fp){fputs($fp,$headers);$result='';while(!feof($fp)){$result.=fgets($fp,128);}fclose($fp);if($remove_headers){//removes headers$pattern="/^.*\r\n\r\n/s";$result=preg_replace($pattern,'',$result);}return$result;}}?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
… because formData always delivers escaped text, but strip_escape_custom strips escaped conditionally. Instead, try:
$note = strip_escape_custom($_POST['note']);
This code needs a bit of work:
// add message function
addPnote($reply_to, $note, $userauthorized, '1', $form_note_type, $assigned_to);
$row = sqlQuery("SELECT id FROM pnotes order by id DESC limit 0,1");
sqlQuery("update pnotes set message_status='".$form_messsage_status."' where id = '".$row['id']."'");
Problem is, getting the ID after you insert the new note might get you the wrong ID, if someone else added a note at the same time. I'm pretty sure addPnote() returns the new ID, so just use that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This example serves to illustrate for admins of SF networks, the error code display tags (BBCode).
Welcome
The error lies in the fact that if you use code tag in square brackets is the code is ill-formed.
Square brackets is used interchangeably with {} brackets 'Championships' so you can easily see them. In another tako {code} {/code} inserts a piece of code:
Additional suggestion: In the CODE section of text should be a fixed width eg. CourierNew, is more understandable.
Example1 :
It is well-formatted because I swapped the brackets in brackets ().
Example 2:
If in the code inserts NORMAL in PHP sqare brackets with the text inside, ruins the whole BBCode formatting.
regards
Wojtek Jarzecki
if remove square brackets all is good :
If square brackets is in code then be formating error:
breaks all the formatting.
test for any squate brackets and text inside :
if remove square brackets all is good :
If square brackets is in code then be formating error:
test for any squate brackets and text inside :
test code blabla
if remove square brackets all is good :
If square brackets is in code then be formating error:
breaks all the formatting.
$array[$key] = 'value'
$array['first'] = 1;
$array['first'] = 1;
`$array = 1;`
$array[bracket]'first'[/bracket] = 1;
$array = 1;
Have you tested with
set to 0 and 1? Need to make sure those work.
This code in messages.php will not work properly:
… because formData always delivers escaped text, but strip_escape_custom strips escaped conditionally. Instead, try:
This code needs a bit of work:
Problem is, getting the ID after you insert the new note might get you the wrong ID, if someone else added a note at the same time. I'm pretty sure addPnote() returns the new ID, so just use that.
$array['first'] = 1;
Bad is if key is in #39 characters 'bad key'
yeah, we're still playing with this. it's a known bug in nbbc and we're reaching out to them.
https://sourceforge.net/tracker/?func=detail&aid=2931062&group_id=235382&atid=1096820
$code=$arr['test'];
$code=$arr['test'];
$code=$arr['test'];