Numbering

Bar discussions . Talk about everything not only php !. Guests are welcome here , forum registration is not required.

Moderators: macek, egami, gesf

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Sun May 01, 2005 5:59 pm

I like this code table and it does that wrapping thing.
Also there must be some mod for this.

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Sun May 01, 2005 7:48 pm

why not just get php highlighting first before the numbering debate ! :(

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sun May 01, 2005 10:50 pm

well.. it was the problem: numbering worked..however the code displayed by highlighting looked a bit weird...

There is something else that has been changed in php-forum files that simly screws everything up... but i think i know what the problem was..

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Sun May 01, 2005 11:47 pm

Of course ruturajv. The code hilite is the most important part.
I was just helping on the ideas.

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Mon May 02, 2005 10:58 am

I don't know what the poll is for -- I don't think anybody objects to line numbering. I certainly think it's useful. I just don't think we need this "custom starting line" business.

User avatar
admin
Site Admin
Site Admin
Posts: 123
Joined: Wed Apr 17, 2002 7:49 am
Location: Rome, Italy
Contact:

Postby admin » Wed May 04, 2005 3:09 am

Hi !

I removed old forum and installed latest phpbb 2.0.14 (new) ;0 mod/hacks at this time,
only original code .

Bye
Graziano

User avatar
Virtuoso
php-forum Active User
php-forum Active User
Posts: 268
Joined: Mon Jul 21, 2003 7:05 am
Contact:

Postby Virtuoso » Wed May 04, 2005 3:51 am

Aiyeeee!
Awesome skin!!!!!! 8)

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Wed May 04, 2005 4:32 am

It really is great skin :D

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Wed May 04, 2005 7:07 am

Alexei, did you design this skin? It's gorgeous.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Wed May 04, 2005 11:16 am

I wish! I should ask graz, whose skin it is..
I really suck in design :(

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Wed May 04, 2005 11:16 am

:offtopic: we are however... but well... who cares here! :D

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu May 05, 2005 5:25 am

As it looks like to me: everything is working...

please test the function of highliting and give feedback...

Code: Select all

<?php
phpinfo();
echo("Whatever Just writing lots of BS to test the wrapping... i dont really think its going to work but i can hope that it will.. right? ehh... i hope you guys agree with me... if not -- well... sorry to hear that..");

function my_func(){
  //Do nothing
  $malaka = "test";
}
?>
<html>
<script>alert("test");</script>
</html>
Last edited by Alexej Kubarev on Thu May 05, 2005 7:39 am, edited 1 time in total.

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Thu May 05, 2005 5:45 am

Great!
And now I see a line numbering can help a bit...
Just for that cases that we post a lot of code and we need to refer some line...
What do you all think ?

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu May 05, 2005 5:53 am

well... the way swirlie sudgested it will be a bit harder.. my way however has some problems as well.. in both ways there will have to be lots of string replaces..

my way's problm consists that if you will use no line break after opening a code tag: the first line will not be numbered..
and swirlies way will involve much more replacements...

but i will try to figure something out... the most irritating thing is that even if im running the local copy of phpbb with php-forum files (simply installed a backup of this forum on my machine) -- my copy works different from how it works here.. :S

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Thu May 05, 2005 6:21 am

I'm not as close to the code as you are Alexei, so I defer to your expertise, but couldn't it be done as an unordered list in the following way?:

Strip out all of the <br>s, then split the string on line breaks and iterate through each line, adding a <li> before and </li> after each line, and finally wrapping the whole thing in <ul></ul>. The rest would be done in CSS.

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Thu May 05, 2005 6:33 am

BTW guys, we have some problems here!
Example:

Code: Select all

<?php

$_SERVER['PHP_SELF'];

?>

Like Swirlee said, i think it's a better solution using CSS!
Last edited by gesf on Thu May 05, 2005 6:36 am, edited 1 time in total.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu May 05, 2005 6:36 am

Thats pretty much what im tring to do right now..however i hae regexp's and therefore this becomes a bit hard... but its exactly what im doing...
The only problem accures when user writes this:

[ code ]bla bla
[ /code ]


if user does this:
[ code ]
its okej
[ /code ]


with both ways... but in the first case: there is no <br /> :S so im thinking of how to go around this

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu May 05, 2005 6:42 am

thanx gesf!

Ive fixed it :D

It should be wirking now... please post more code to find more possible erros.. this is not 100% optimized solution yet..
CSS IS a best solution...however coding gets a bit harder after applying highlighting..
dont worry..i will fix this soon

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu May 05, 2005 7:46 am

What do you guys think about line numbering?

Its not 100% done yet thou... but i hope you will like it :D

User avatar
Virtuoso
php-forum Active User
php-forum Active User
Posts: 268
Joined: Mon Jul 21, 2003 7:05 am
Contact:

Postby Virtuoso » Thu May 05, 2005 12:43 pm

Code: Select all

<?php
echo 'test';
echo 'sdjfksljflkasj;fljdsaklfjkldsjaf;jasdfjfsdjfksljflkasj;fljdsaklfjkldsjaf;jasdfjfsdjfksljflkasj;fljdsaklfjkldsjaf;jasdfjfsdjfksljflkasj;fljdsaklfjkldsjaf;jasdfjf';
?>


*edit
lol, it goes off the page

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Thu May 05, 2005 12:49 pm

It looks great except where lines wrap. E.g., your code from above:

Code: Select all

<?php
phpinfo();
echo("Whatever Just writing lots of BS to test the wrapping... i dont really think its going to work but i can hope that it will.. right? ehh... i hope you guys agree with me... if not -- well... sorry to hear that..");

function my_func(){
  //Do nothing
  $malaka = "test";
}
?>
<html>
<script>alert("test");</script>
</html>


Look what happens to line 3. The part that gets wrapped should be indented.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu May 05, 2005 12:52 pm

hmmz.. okej... im taking suggestions on that matter..

Vituoso: i think its because you never add any spaces.. adding one will wrap it... however i need to fix that intend as well..

What do you guys thin would be a best way to do it?

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu May 05, 2005 1:30 pm

Okej guys... problem is solved :D

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu May 05, 2005 3:45 pm

Okej.. one more surprise:

All the code from Code tags is downloadble from now on..
there is a [ Download ] link in the code tag header.. you willbe prompted to save the file upon clicking

Please check this function for any possible problems and give your feedback..
This is a custom module that couldnt be found for downloading anywhere... however the idea comes from http://www.phpbbstyles.com

http://www.phpbbstyles.com/viewtopic.php?t=4873

I hope you will like it! :D

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Thu May 05, 2005 7:26 pm

Great Alexei!
And now that i know you know the code, can you please give an idea on how that download part works ?
I know how to make file downloadable, but seems that it will create a temporary file, am i right ?
Well... this is almost the answer i need. Somethimes i just can't get things :P
I would like to add that option in my website code box too ;)

Btw Alexei, another problem:

Code: Select all

<?php

print '&nbsp;&raquo;&nbsp;';

?>
It should really print: &nbsp;&raquo;&nbsp;
The downloadable code is in the right format!


Return to “Free time”

Who is online

Users browsing this forum: No registered users and 1 guest