Board index   FAQ   Search  
Register  Login
Board index php forum :: Bar Free time

Numbering

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

Moderators: macek, egami, gesf

Numbering

Postby Virtuoso » Sat Apr 09, 2005 7:10 am

It would be nice to have a line numbering for [code] tags.
User avatar
Virtuoso
php-forum Active User
php-forum Active User
 
Posts: 268
Joined: Mon Jul 21, 2003 7:05 am

Postby Alexej Kubarev » Sat Apr 09, 2005 7:16 am

thats true and not hard to implement.. i will talk to admin :)
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby ruturajv » Sun Apr 10, 2005 10:12 pm

ya please enable the php syntax highlighting ... Please.... :shock:
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby Alexej Kubarev » Sun Apr 10, 2005 10:42 pm

line numbering has been done several times but due to upgrade of the phpBB removed.. it will be enbled soon again...

highliting will take a bit longer... we will see what we can do.. :)
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby sadisticmachine » Mon Apr 11, 2005 7:38 am

maybe you could ask someone at php.net to spot you a copy of the code they used to color-code the user comments in the manual.
sadisticmachine
New php-forum User
New php-forum User
 
Posts: 109
Joined: Tue Nov 02, 2004 5:33 am

Postby Alexej Kubarev » Mon Apr 11, 2005 10:08 am

not really need3ed as i think syntax_highlight() function exists... i think so...
we will do it asap
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby Alexej Kubarev » Tue Apr 12, 2005 6:19 am

okej... those requestes fuctionalities are now being tested as my modifications worked fine on my testing server... now it will be tested on php-forum and if it will work: it will be available for you VERY soon (like in a few days..)
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby Alexej Kubarev » Tue Apr 12, 2005 1:00 pm

Well.. im gonna tell you this: tomorrow we are installing the upgrade and the code below should be highlighted and with line numbers:
If its not: the update is not installed yet..

Code: Select all
<?php
echo("Testing the code future");

function my_func(){
  //Nothing important below
  $i++;
  return $i;
}

ob_start();
echo (myfunc ());
ob_clean();

#Thats is!
?>

<script>alert('test');</script>
<body>
Something
</body>
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby swirlee » Wed Apr 13, 2005 7:16 am

The line numbering should be done with an ordered list so as not to clutter the content and also so that lines wrap, they do so in an intelligent way that doesn't foul up the numbering. There's a good example here. Also, code needs to be in a monospaced font.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Alexej Kubarev » Wed Apr 13, 2005 7:40 am

however there is no way to make that in correct order: so thats impossible to be done... not if the user defines the line start..

however the code is conflicting with some other addons which i was not aware of... so therefore i will have to edit it again...

not sure about the font thou... as ina code tag the code is being highlighted by the highlight_string() and it looks quite good as far as i can see...
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby swirlee » Thu Apr 14, 2005 6:00 am

Alexei Kubarev wrote:however there is no way to make that in correct order: so thats impossible to be done... not if the user defines the line start..


But as far as I can tell, that's not possible the way you're doing it now. And we don't really gain anything by letting the user define the starting line (and really, how many newbies would actually use it? We have a hard enough time getting them to use the code tags in the first place).

not sure about the font thou... as ina code tag the code is being highlighted by the highlight_string() and it looks quite good as far as i can see...


No, seriously, it really needs to be monospaced. When was the last time you used an IDE that defaulted to a non-monospaced font? And what about indenting within lines (e.g. if I have a bunch of assignments and want the right-hand parts of each to line up)? That doesn't work without a monospaced font. It might "look quite good" to you, but it makes my job more difficult.

Anyway, right now it's clearly borked. I just posted the following code:

<?php
$states_counties = array(
'NY' => array(
'Orange',
'Westchester',
'Rockland',
'Bergen',
'Milford',
/* ... */
),
'CA' => array(
'Orange',
/* ... */
);
?>


And this is what it looks like with code tags:

Code: Select all
<?php
$states_counties = array(
  'NY' => array(
    'Orange',
    'Westchester',
    'Rockland',
    'Bergen',
    'Milford',
    /* ... */
  ),
  'CA' => array(
    'Orange',
    /* ... */
);
?>


Please change it back to a version that works until you get all the bugs worked out.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Alexej Kubarev » Thu Apr 14, 2005 7:04 am

i know!

but its not me who changed the files... its graz... i never got ftp access... i just sent files to him that worked perfectly on a clean phpBB but not the one that has already been edited...

not sure if its possible to change the font due to the built in function into PHP but i can always buffer the output and replace the font its using (in case its adding font-face property to its font tags...)

about line numbering: looks quite nice with line numbering so why not?

I hope graz will remove those files and send we the php-forum source so i can make it work...
i have absolutely no idea what he've changed there so i need the source files... or an ftp account...
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby swirlee » Thu Apr 14, 2005 9:17 am

Alexei Kubarev wrote:not sure if its possible to change the font due to the built in function into PHP


I can't imagine that it would be that difficult. Just change the CSS (as I can see that the code is already wrapped in a span that would be easy to style).

about line numbering: looks quite nice with line numbering so why not?


I have no problem with line numbering -- it's very helpful to me. I just don't see a reason not to use an ordered list so that lines which wrap are easily identified.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Alexej Kubarev » Thu Apr 14, 2005 9:24 am

aha... thats what you mean.. sure..that way i can do that.. however i dont really see why... all i did was added a span infront (i think i added span however dont remember.. tested several different solutions).. i made those changes in 15 minutes so it was just a test that graziano was going to try... still waiting for him to respond in some way..

But thanx for suggestions... about the f*cked up code view i can say only one thing: it totaly because of the non-original files used on php-forum... somehwew it replaces htmlentiteties..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby ruturajv » Sun Apr 17, 2005 7:55 pm

further I would like you guys to add...
That if there is an exceptionally long line [without any spaces...] eg. some php code or a long url,
the content should be set a max CSS width with
Code: Select all
overflow: auto;

I guess that the above scenario should be applicable to the Code tags .. atleast to start with ..!!! ;)
:)
Hope we make the forum totally cool to browse with...
and we can get more styles to the forum..
user can select what he wants
I think Pejone can help us on that.
Where has he been all this time.. ?
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby Alexej Kubarev » Sun Apr 17, 2005 10:40 pm

ive talked to him for a few days ago... he is extremely busy... i finally got a full access to the stuff i need..so i will make changes to my "almost-working" code :) asap..

Sorry for the delay..just have to finish one of the projects first..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby ruturajv » Mon Apr 18, 2005 7:39 pm

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

Postby WiZARD » Thu Apr 28, 2005 3:38 am

Pipl! do not forget what sometimes other pipl use only part of script and string where is number for example 10 in real mean string 1001!
Be carefuly! :-o
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Postby Alexej Kubarev » Thu Apr 28, 2005 4:10 am

we know..but how about letting a user to define a start line number : this will require majour rewriting.. oh well some big part anyways..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby swirlee » Thu Apr 28, 2005 6:49 am

Alexei Kubarev wrote:we know..but how about letting a user to define a start line number : this will require majour rewriting.. oh well some big part anyways..


How many users do you think would really use this? My guess? None. Or maybe one, ever.

We have a hard enough time getting people to use the [code] tags in the first place -- do you really expect them bother to learn how to set a custom line number?
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Alexej Kubarev » Thu Apr 28, 2005 7:06 am

well..would you use it?!

I would, i guess some people also would... so why not?!
I already asked before: some better suggestions?
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby swirlee » Thu Apr 28, 2005 10:58 am

Alexei Kubarev wrote:well..would you use it?!


No, not really.

so why not?!


For the reasons outlined above, including "this will require majour rewriting".
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby sadisticmachine » Thu Apr 28, 2005 6:46 pm

All its for is so people providing aid can call out numbers to identify problems. The person implementing can figure out the offset when they copy and paste.
sadisticmachine
New php-forum User
New php-forum User
 
Posts: 109
Joined: Tue Nov 02, 2004 5:33 am

Postby Virtuoso » Fri Apr 29, 2005 7:04 pm

I would use it if you could fix all the bugs in it.
I use a simple line numbering for codes on my test forum, but it seems to add extra characters when you copy and paste them.
User avatar
Virtuoso
php-forum Active User
php-forum Active User
 
Posts: 268
Joined: Mon Jul 21, 2003 7:05 am

Postby Alexej Kubarev » Sat Apr 30, 2005 1:12 am

exactly...therefore my solution was editing the way code tags are displayed and not saved... however i still dont get what a hell was changed in those files in comparison to the original version... as it worked on original version but not on php-forum's one...

just got some problems with time...

Swirlee: i dont mind rewriting the files... but okej... BEFORE we start using that function: i wills tart a pole here and ask people to say what they think about..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Next

Return to Free time

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron