Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Adding extra input fields to "New article" page.  (Read 2346 times)

framboos

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
Adding extra input fields to "New article" page.
« on: December 08, 2006, 04:00:54 am »

Hello, first of all, what a wonderful script! I've tested it out at opensourcecms. In the past I've mostly used the flatfile Cutenews and Aj-fork (a modification of Cutenews). So going to a SQL script is a big step for me ;)

I have a question: Is it possible to add extra input fields like "Text" to the "New article" page?
(For example, popular input fields such as: "current mood" or "current music" or "location")

So that I won't have to enter all the information in the "Text" field which is used for the main text of the article.
Because if I do that, the whole text fields becomes a bit cluttered, with all the < div > and styles etc..

In Aj-fork there was a plugin to do this, it was called "Xfields" and one could configure all kinds of fields very easily. I don't need a plugin now, but if someone could tell me how to modify the php script, I'd be very much obliged!

Oh, I saw the mention of the extra() function in some threads. But as far as I understand, this is just a static block of text on the category page - not a part of the content of _each_ article. But perhaps it can be something similar to that?

Anyhow - thanks in advance!
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Adding extra input fields to "New article" page.
« Reply #1 on: December 14, 2006, 02:54:13 am »

Anything is possible... as long as you make it so. sNews comes to you as it is... and it is up to you to add whatever you want to it. That's where the fun and adventure comes in! :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Adding extra input fields to "New article" page.
« Reply #2 on: December 14, 2006, 07:36:21 am »

Well, to be honest, it is possible, but would require a
==>change in the database,  the new field needs to be stored ***
==>a change in all the article display scripts, new field needs to be retrieved for display
==>a change in the admin script. which is what you are asking about.

*** It may even be possible to concatenate your new text fields to the front of the article text being stored, removing need for new database field. You would just need to work out the extraction of it.

You could also look at having a default string that loads in the editor when a new article is generated, that incorporates the desired layout of your extra string display -- save typing them in again.
might look at doing this myself... :D

But, basically, as Keys infers...

If you're game, go for it.

Which isn't meant to be nasty... If you want to have a go, start your own thread in the programming area, and when you hit a problem, make a post... someone will likely pop in and give a few pointers.
Logged
Of all the things I have lost, it is my mind that I miss the most.