|
BBcode parser problem 5 Months ago
|
|
i got a problem with the BBCODE parser for the 'Code' Function, im trying to post tab seperated values and wow wat a mess, i need peopel to be able to copy them and get the tab seperated value back, but its just giving a space, also it makes it all red and goes waaaaaaaaay off the page, ill post below and u can look.
| Code: |
0001 someunicodetextgoeshere w0001 10100001 01010001 02010001 0 0 0 00 1 10 0 0 7 1 1 1 1 1 1 1 1015 2,1 10 1,8,9,10 0 0 9,6 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,10 0,10 0,10 0,10 0,10 0,0 0,0 0,0 30,58 38,70 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 1 0,1000 10000,10000 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 moreunicodetextgoeshere
|
|
|
venomus (User)
Fresh Boarder
Posts: 12
|
Logged
|
|
|
|
|
|
Re:BBcode parser problem 5 Months ago
|
|
|
0001 someunicodetextgoeshere w0001 10100001 01010001 02010001 0 0 0 00 1 10 0 0 7 1 1 1 1 1 1 1 1015 2,1 10 1,8,9,10 0 0 9,6 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,10 0,10 0,10 0,10 0,10 0,0 0,0 0,0 30,58 38,70 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 1 0,1000 10000,10000 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 moreunicodetextgoeshere
|
|
grinchy (User)
Senior Boarder
Posts: 355
|
Logged
|
|
|
|
|
|
Re:BBcode parser problem 5 Months ago
|
|
|
Looks like it started to do just that and then some CSS selector took over and messed it up.
If you reply to this message and look in the topic history at the bottom it does what it's supposed to. No scrolling off the page.
|
|
grinchy (User)
Senior Boarder
Posts: 355
|
Logged
|
|
|
|
|
|
Re:BBcode parser problem 5 Months ago
|
|
|
div .msgtext
might be the culprit. It isn't a parser issue.
|
|
grinchy (User)
Senior Boarder
Posts: 355
|
Logged
|
|
|
|
|
|
Re:BBcode parser problem 5 Months ago
|
|
|
its still stripping the TAB's out though, if i hit edit the tabs are still in the source but not displayed, its replacing them with spaces.
SMF forum does what i want but i like this forum better, is there somehow i can take their parser for code and put it into this forum?
or is there a way i can include TAB in the parser code
|
|
venomus (User)
Fresh Boarder
Posts: 12
|
Logged
|
|
|
Last Edit: 2008/08/11 03:30 By venomus.
|
|
|
|
|
|
Re:BBcode parser problem 5 Months ago
|
|
this is strange cause if i veiw the source code of the webpage after its posted u can see the tabs are still there in the source code, but if u copy and paste off the webpage its not.
i tried changing the div.msgtext and a few others but nothing changed.
this is in the interpreter.fireboard.inc.php and seems to control the display of the code thing, it changes the <code class="php"> but i cant find anything in any CSS regarding PHP mysql or watever
| Code: |
$types = array ("php", "mysql", "html", "js", "javascript");
$code_start_html = '<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr><td><b>'._FB_MSG_CODE.'</b></td></tr><tr><td><hr />';
if (in_array($tag->options["type"], $types)) {
$t_type = $tag->options["type"];
}
else {
$t_type = "mysql";
}
|
this is the source code from webpage after loaded, as u can see above its also stripping line returns or soemthing and bunching all the code together
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr><td><b>Code: </b></td></tr><tr><td><hr /><code class="php">
0001 短剑 w0001 10100001 01010001 02010001 0 0 0 00 1 10 0 0 7 1 1 1 1 1 1 1 1015 2,1 10 1,8,9,10 0 0 9,6 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,10 0,10 0,10 0,10 0,10 0,0 0,0 0,0 30,58 38,70 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 1 0,1000 10000,10000 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 比长剑还短一点的剑
</code><hr /></td></tr></table></div>
|
|
venomus (User)
Fresh Boarder
Posts: 12
|
Logged
|
|
|
Last Edit: 2008/08/11 03:55 By venomus.
|
|
|
|
|
|
Re:BBcode parser problem 5 Months ago
|
|
ok i changed a couple things in the code, this makes a really nice code box that looks good and works decent,
However i still have the problem with the red text and no tab spaces, also i just noticed that in the preview when u hold your mouse over the thread, the tabs are shown there.
i changed this in the css file
| Code: |
div.msgtext pre,div.msgtext .code{border-left: 5px solid #F4A94F;border-right: 1px solid #CCC; border-top: 1px solid #CCC; border-bottom: 1px solid #CCC;font-family: "Courier News", monospace;font-size-adjust: none;font-stretch: normal;font-style: normal;font-variant: normal;font-weight: normal;line-height: 1.5;margin: 5px 0pt 15px;padding: 10px 15px;width: 500px;overflow:auto;}
|
to
| Code: |
div.msgtext pre{border-left: 5px solid #F4A94F;border-right: 1px solid #CCC; border-top: 1px solid #CCC; border-bottom: 1px solid #CCC;font-family: "Courier News", monospace;font-size-adjust: none;font-stretch: normal;font-style: normal;font-variant: normal;font-weight: normal;line-height: 1.5;margin: 5px 0pt 15px;padding: 10px 15px;width: 100%;overflow:auto;}
div.msgtext .code{border-left: 5px solid #F4A94F;border-right: 1px solid #CCC; border-top: 1px solid #CCC; border-bottom: 1px solid #CCC;font-family: "Courier News", monospace;font-size-adjust: none;font-stretch: normal;font-style: normal;font-variant: normal;font-weight: normal;line-height: 1.5;margin: 5px 0pt 15px;padding: 10px 15px;width: 500px;overflow:scroll;}
|
then added, to line 269 of the interpreter.fireboard.inc
| Code: |
<div class="code">the table there atm</div>
|
now i need to move 'Code:' to the outside of the box so i can add a select all function, and then need to get TAB to be able to copy and paste still, and to fix that red syntax highlighting from going spastic
|
|
venomus (User)
Fresh Boarder
Posts: 12
|
Logged
|
|
|
Last Edit: 2008/08/12 02:54 By venomus.
|
|
|
|
|
|
Re:BBcode parser problem 5 Months ago
|
|
oh also somehow the spaces in the code box need to be replaced with non breaking spaces, and we need line return to work
--edit--
ok i been working on it and this is what i have come up with so far,
i still got the red and no tab stuff =(
|
|
venomus (User)
Fresh Boarder
Posts: 12
|
Logged
|
|
|
Last Edit: 2008/08/11 05:40 By venomus.
|
|
|
|
|
|
Re:BBcode parser problem 5 Months ago
|
|
ok ive fixed everything with the box layout, i dont care about the stupid red crap goin all over the place i dont think its really a big problem atm, but im trying to make it display tabs, so i edited the file interpreter.fireboard.inc and done this
| Code: |
$between = preg_replace('/t/', '	', $between); --- i added this line
|
above this line
| Code: |
$tag_new = $code_start_html. htmlspecialchars($between, ENT_QUOTES).$code_end_html;
|
god how can i make it use line returns, 2 boxes to get a dam code to appear below like its meant to
i added that line for some reason its now outputting 	 instead of tabs and spaces, so its putting it where i want but not displaying it as a tab its just inputting it as raw code, any idea how to fix this? i was looking at changing htmlspecialchars to htmlentites but i dunno how to use php so thats kinda outta my league it took me all day to get this far =
|
|
venomus (User)
Fresh Boarder
Posts: 12
|
Logged
|
|
|
Last Edit: 2008/08/11 11:26 By venomus.
|
|
|
|
|
|
Re:BBcode parser problem 4 Months, 4 Weeks ago
|
|
|
i got this code to work, it does the replace and everything like it should,
it remmoves the tab and puts in its html equivilent successfully, but it wont
show as a tab on the webpage, how do i force it to show as a tab or at least look
like a space and be able to copy and paste as a tab
$between = htmlspecialchars($between, ENT_QUOTES);
$between = str_replace("t", '	', $between);
$between = str_replace(' ', ' ', $between);
$between = str_replace(' ', ' ', $between);
$tag_new = $code_start_html.$between.$code_end_html;
|
|
venomus (User)
Fresh Boarder
Posts: 12
|
Logged
|
|
|
|
|
|