You are not logged in.

#1 2005-10-28 08:48:25

Pajaro
Member
Registered: 2004-04-21
Posts: 884

forum suggestion: expand and collapse embeded code

It would be very useful that code embeds in the forum ([ code ] tags) start collpased with a button to expand/collapse them.

- Programming time: 5 minutes.
- Graphical desig time: it depends, but a simple "expand/collapse" text added on top requires 1 minute.

Total development time: 6 minutes.

A more advanced version would collapse only code tags longer than certain lines (dificult to determine how many lines are the minimal to collapse), or, even better, would have a [code_nocollapse] tag that prevents that code from collapsing.

This would keep the forum pages cleaner.

To keep compatibility you should make embeds be initially expanded and collapse them with javascript, so that non-javascript browsers can read the content.

Offline

#2 2005-10-28 09:10:58

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

Yeah, ok, show us the code then...or is this just one of those fantasy ideas that is easy in theory?

Offline

#3 2005-10-28 09:13:21

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

place the php code that creates the code embeds

Offline

#4 2005-10-28 09:47:12

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

Lets get this straight - do you know how to do this?  If you do then create a phpbb mod and post it here and we might implement it.  If you cannot do it why do you expect that others will?

Offline

#5 2005-10-28 09:52:53

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

i don't know phpbb.
How are phpbb mods? i'll check it and see if i can make a mod... but i don't think that adding 4 lines of code implies creating a mod. But I insist, i don't know phpbb, so i'm gonna check it.

If you have a link to mods documentation it will help.

Thanks

Offline

#6 2005-10-28 09:57:10

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

i think i can make a mod like this:

http://www.phpbb.com/files/mods/scoi-102.mod

Offline

#7 2005-10-28 09:58:18

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

now i need your help. Can you paste the code responsable of adding the code embeds or give a copy of the file?

Offline

#8 2005-10-28 10:43:47

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

Just download the most recent phpbb release, it will all be in there wink

Good luck with it, but oh, by the way, you might want to check to see if someone has already made it...

I would check myself but it is not in my job description to run around after every whim of the user base - bring me something to work with and I am all ears...

Offline

#9 2005-10-28 15:20:03

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

Pajaro:  I must apologise for my harsher manner but I have been faced with several requests like this and it is quite frustrating.  I myself also have no experience of php and I do not have the skills to create solutions for many such proposals.

In the past I have asked how the person suggesting the idea would do these things and invariably they have no idea - they say change the code....this does not help me at all and has resulted in my impatient attitude to suggestions.

I have googled for your idea google:phpbb mod "collapse code" but there is no existing mod that can do it so you would need to write one.  You might find some useful info in the google results.  I cannot direct you to the phpbb code that you need as I don't understand it either but I do wish you the best with developing this mod.  I believ you may need to look at bbcode.php and view_topic.php

You might also be able to get some help at the www.phpbb.com site.

Offline

#10 2005-10-28 18:12:35

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

thank you for your apologies.

you don't have to worry, from the beggining i understood you thought it was one more of several request smile

Offline

#11 2005-10-28 23:31:19

High|ander
Member
From: Skövde, Sweden
Registered: 2005-10-28
Posts: 188
Website

Re: forum suggestion: expand and collapse embeded code

In my opinion this is just bloat because i dont think that many users wants to fold the code. If they open the thread they want to see the "full" thread...

Or am i wrong?


When death smiles at you, all you can do is smile back!
Blog

Offline

#12 2005-10-28 23:44:02

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

I hate having to scroll through a 1500 line xorg log that is entirely unecessary because the actually problem is a missed module in rc.conf, so, yeah, it would be pretty good for me for a start!

Offline

#13 2005-10-28 23:46:41

High|ander
Member
From: Skövde, Sweden
Registered: 2005-10-28
Posts: 188
Website

Re: forum suggestion: expand and collapse embeded code

hm, you have a point there...

hope that someone can make a good patch for this then


When death smiles at you, all you can do is smile back!
Blog

Offline

#14 2005-10-31 12:24:03

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

I did it:

- it converts "Code:" into a link, than when u click the code expand
- it is compatible with non-javascript and old browsers

When i was checking compatibility with browsers (Firefox, Safari, Internet Explorer and Konqueror) I found a konqueror bug (at least in my arch installation): It does not refresh properly, so you have to scroll up and down to make the browser redraw again the content of the page. This a bug of konqueror, so the patch should be implemented anyway and it should be reported to kde people.

you can download it here:
http://www.elpezmandala.com/archlinux/e … llapse.mod

Offline

#15 2005-10-31 14:05:55

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

Ahhh - great work my friend!

Before I install it tho I could you (I can do it) submit the mod to phpbb.com for validation?  I ran it through their validator and the format of the file failed but that was it.  You'd need to change that before submission tho!

I also think it would be a good idea if you post about your MOD on the MOD development boards at phpbb.com first, you can read the guidelines here:

http://www.phpbb.com/phpBB/viewtopic.php?t=266307

That'll be a good way to get testing and feedback smile

Offline

#16 2005-10-31 16:29:38

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

Offline

#17 2005-10-31 16:35:37

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

Fantastic work big_smile

Offline

#18 2005-10-31 16:36:34

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

if i am not wrong there's a test forum of archlinux.

You could try the mod and give your opinion in the phpbb forum.

I found a bug that does not affect this forum or phpbb forum tongue lets see if somebody finds it (of course i'm gonna talk about it if they don't find it)

Offline

#19 2005-10-31 16:37:28

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

well, it is not a bug, it is a limitation.

Offline

#20 2005-10-31 16:48:44

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

I deleted the test forum :oops:

Offline

#21 2005-10-31 17:17:33

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

well,

you can create a local copy in your system tongue

it is easy:

1 - download phpBB2 and create a folder and a database for the test forum
2 - if you use a standard archlinux installation add this:
dl("mysql.so");
at the beggining of:
common.php
and at the beggining of the file responsible of db connection in the installation, if needed (i didn't pay attention to what file it was and to make the forum work you have to delete the install folder)

Well, that's all by now, i'm leaving, so no possibility to answer mails (i am waiting for a connection at work)

Oh, and thank you for your help smile

Offline

#22 2005-10-31 17:34:37

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: forum suggestion: expand and collapse embeded code

Did I help?  I must have missed that!

Offline

#23 2005-10-31 19:08:52

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: forum suggestion: expand and collapse embeded code

keep in mind that what i did was something quick, the main work was to get documented about MODs, and you put that right in my hands smile

Offline

Board footer

Powered by FluxBB