Firefox PHP

customization - beyond templating : HELP needed

Posted by anatroll 
customization - beyond templating : HELP needed
January 04, 2010 02:19PM
Hello world and thanks for this great script (first post).

Here's my problem in a nutshell :

I want to change substantially the way my Phorum displays content, in particular :

- I want a complete threaded view for my topics (PHorum already does that, so kudos)
- I want this thread list to remain open at all times on one half of the screen, including when :
- replying to an existing thread, causing the post form to open on the other half of the screen
- starting a new thread (same effect)
- reading a thread in detail (thus opening the read.php code on the other half of the screen, the one not taken by the thread list)

In short, I want my list.php to remain active and displayed at all time whatever the user does, effectively splitting the screen in half for content displaying purposes.

Also, goes without saying, any frames / frameset on my site will be shot on sight (simply way too ugly)

You should also know that although I understand html and css rather well - even designed my own template -, and although I have a rough, basic understanding of the basics behind php programing, I do not code in php, simply because I CANT (in short, i'm a php noob).

However, i am sure I can learn by myself if someone here puts me on the right track , so my detailed questions would be :
- is this even possible ?
- is there any way to do that changing only the .tpl files ? (seems NOT, but i might be wrong here) ?
- assuming I would also have to change the php code in various core files (list.php, read.php, posting.php come to mind), what kind of changes would I be contemplating here ? how important would common.php be in that light ?

note : merging list.php/tpl and posting.php/tpl into a single "list_and_post.php" doesn't seem to be working, although I am unable to grasp exactly why ; it seems the php code in list.php and posting.php don't mix too well.

- why is that ? From my naive perspective if a .php file was to include every component needed by both the thread listing function and the post-form display one, it should be able to perform both right ?

- would all this be handled best by writing a dedicated module ?

I realize this is asking a lot, so my eternal gratitude will go to those who attempt ANY answer to my problem.

thanks again and keep up the great work.



Edited 1 time(s). Last edit at 01/04/2010 02:19PM by anatroll.
Re: customization - beyond templating : HELP needed
January 04, 2010 03:12PM
Quote

... effectively splitting the screen in half for content displaying purposes.
Also, goes without saying, any frames / frameset on my site will be shot on sight (simply way too ugly)

Strange remark. What you describe sounds like frames to me. So whay are they too ugly? Even with frames, this would be quite a daunting task though. Add to that the fact that the structure of Phorum does not really support this kind of page by default, it seems quite the task to me.

- is this even possible ?

Possibly yes, but not without programming.

- is there any way to do that changing only the .tpl files ? (seems NOT, but i might be wrong here) ?

I agree. Most probably, this is not possible.

- assuming I would also have to change the php code in various core files (list.php, read.php, posting.php come to mind), what kind of changes would I be contemplating here ? how important would common.php be in that light ?

common.php is important, since it hold all kind of important core feature implementation code. But I'm not sure what your question about common.php is about. You need common.php. It would not need big changes IMO. The changes would be more in the rest of the code. You would defenitely have to write a module that copies code from various places to collect all the data that you need for the full page. That is what the scripts do: they collect data thata are required for building the requested view. You want a combination of the list.php, read.php and possibly posting.php script it seems, to have the output from all those scripts on one page. But you seem to be trying something like that already.

note : merging list.php/tpl and posting.php/tpl into a single "list_and_post.php" doesn't seem to be working, although I am unable to grasp exactly why ; it seems the php code in list.php and posting.php don't mix too well.

No surprise there. I don't know how you mixed them, but reading your remark about not being a programmer, it's likely that code gets wrecked when you start copying and combining code from two random scripts into one script.

- why is that ? From my naive perspective if a .php file was to include every component needed by both the thread listing function and the post-form display one, it should be able to perform both right ?

No, that is indeed a naive perspective. If strawberry ice cream tastes good and a rare steak tastes good, it doesn't mean that mixing them up would give me great taste as a result.

- would all this be handled best by writing a dedicated module ?

Always. That is the Phorum way. A module would gather the additional data that is needed for building the screen. So on the posting page, it would gather the required info for the message list to show. The template would have to be modified to make use of this new data (or possibly, the module could output the information on its own after the page header or before the page footer).

I'm sorry, but I don't have the ultimate solution for you, but maybe learning PHP and then learning the structure of the Phorum code will get you to the point where you can implement this feature and release it as a module to the public.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: customization - beyond templating : HELP needed
January 04, 2010 09:39PM
Maurice,

I didn't expect such a swift answer ; many thanks for your insights and, most of all, for your time.

You confirmed most of my suspicions - the need to edit the .php code in particular - so I suppose I will have to dive into it and completely dissect the php core files.

From what I am seeing now anyway, the code seems so well-written, so nicely commented, that even I should be able to figure it out.

When I reach the layout I intended and if you think it deserves to be compiled into a module that's just what I'll do.

A.Troll.
Re: customization - beyond templating : HELP needed
January 05, 2010 01:10AM
Quote
anatroll
- I want a complete threaded view for my topics (PHorum already does that, so kudos)
- I want this thread list to remain open at all times on one half of the screen, including when :
- replying to an existing thread, causing the post form to open on the other half of the screen
- starting a new thread (same effect)
- reading a thread in detail (thus opening the read.php code on the other half of the screen, the one not taken by the thread list)

Oh, you want frames

Quote
anatroll
In short, I want my list.php to remain active and displayed at all time whatever the user does, effectively splitting the screen in half for content displaying purposes.

Yep, that is frames alright

Quote
anatroll
Also, goes without saying, any frames / frameset on my site will be shot on sight (simply way too ugly)

Uh, you want them though. Deep down inside, you want them.

Quote
anatroll
- is this even possible ?

With Frames

Quote
anatroll
- is there any way to do that changing only the .tpl files ? (seems NOT, but i might be wrong here) ?

With Frames

Quote
anatroll
- assuming I would also have to change the php code in various core files (list.php, read.php, posting.php come to mind), what kind of changes would I be contemplating here ? how important would common.php be in that light ?

Nah, use frames

Quote
anatroll
- would all this be handled best by writing a dedicated module ?

No, you want this thing they call frames

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: customization - beyond templating : HELP needed
January 05, 2010 02:05AM
NEVER !

frames are ugly, inefficient, unmanageable, they create recursivity issues and more generally simply look lame. Not to mention google doesn't really like em. I run whenever I see frames, and so do 90% of all internet users.

so regarding your witty concatenation of the word "frame" allow me to answer : over my dead body.
Re: customization - beyond templating : HELP needed
January 05, 2010 02:35AM
You do not see a frame. They cannot be ugly. Unless you do not style them at all, in which case you'll get a fat grab bar to resize the frame. If you think that you cannot get rid of that, then you haven't used frames a lot I guess.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: customization - beyond templating : HELP needed
January 05, 2010 02:38AM
Bad direction. Do not start out by hacking the core files and maybe turning into a module later. That does not happen in general. Once people have hacked up Phorum, they tend to stick with that and never upgrade again, even nog when security issues arise.

If you are going to do this, then please do it the right way. I know on beforehand that things always deserve to be put in a module really. Whether it's a useful feature that you cooked up (looks like that's your definition of "deserves") is up to the community.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login