1
patagon
Another article 1.0 question
  • 2007/7/8 4:09

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Hi,

Is there any way of customizing the article submit form? in form.article.config, I can set the elements that will show up in the aricle submit form, but I would need to customize the form itself (I want to add a little javascript in one of the fields). I dont see any template for the submit part, and I tried to track where the form gets written without luck...any help is appreciated.

thanks

2
Tobias
Re: Another article 1.0 question
  • 2007/7/8 4:59

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


The form gets populated in /modules/article/include/form.article.php and written by /class/xoopsformloader.php. That's pretty much standard in all the modules across XOOPS as far as I can see. If you want to amend it, I think it's easiest if you stick with the objects, functions and methods defined in xoopsformloader.php. If you dig into that one, you might find a template for some body.onload javascript firework or whatever you're up to, but it might be difficult to target the precise form you want to target.

3
patagon
Re: Another article 1.0 question
  • 2007/7/8 16:32

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks, I'm going to explore that to see if I understand it...however I decided my other way of doing this (here) would be easier...

I noticed you speak spanish, so I can show you what it is. See here http://descontrol.org on the right it shows 'denuncias'. each of them has a 'status' (red and green button on the homepage), in order to do that I use one of the article fields, repurposed to show that. My problem is that I have to limit users to one of 3 predefined 'status'. Right now I do this mannually, but eventually there will be many of these, and users will have to auto-update them...

I managed to modify one of the fields to show a select box (with the 3 options) when they submit, but whenever they edit their submissions, this value changes to 'array'.

4
Tobias
Re: Another article 1.0 question
  • 2007/7/8 16:47

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


Hm, that sounds more like you have to hack the database and to have a field which can only have the three intended values. In any case, if the script returns the word "array," then there's apparently a problem with reading out the correct data from the database. Sounds more like a little php hacking than like dropping a javascript into a template. Something like that.

In any case, that's a little beyond my scope I'm afraid.

That's a very good and important site, by the way. Buenos Aires?

5
patagon
Re: Another article 1.0 question
  • 2007/7/8 17:07

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks, at least its important to us you are right, its buenos aires, and we are basically non government organizations trying to protect some classical neighborhoods/buildings from dissapearing (basically by showing the irregularities on the contructions and providing a site for many organizations that have the same goal).

The javascript came as an option because I couldnt manage to do that with the php...it works when submitting, but for whatever the reason gets lost when editing...I figured I could use javascript to have a normal text box and limit its content, but it wasnt as easy as I figured, so I went back to trying to modify the php...no luck so far ;-P

6
Tobias
Re: Another article 1.0 question
  • 2007/7/8 17:41

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


It doesn't really surprise me that it's getting lost if it's not written to the database. I've tried to understand the exchange you've had with phppp in the other thread, and I might be misunderstanding something. But if it's not written to a database, and not stored in a cookie (bad idea for your purposes), then it's going to be lost.

Now it seems that that's not the problem here as you can see the status of the item in the article display. Just the form doesn't retrieve the status while it's being built. And that's where you might have to step in and make a database query. But I would be lying did I say I understood what that art_source variable is and where it comes from.

I don't think it's only important to you people. On a larger scale, it matters that there're folks watching out for the common good, and not leaving it all to those who only seek to maximize their profit. Now, in Argentina, you might be currently supported by broadly shared sentiment. Even so, the people of Buenos Aires will have to thank you one day.

7
patagon
Re: Another article 1.0 question
  • 2007/7/8 18:35

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


I just lost a long reply because of a time out

Anyway, what I wrote is that art_source is one of the fields of article. I guess its for showing the source of the article, but since I didnt use it, I replaced the language file to hold the contents of 'stauts'. based on phpbb advice on the other thread I changed it from a text field to a select box with the 3 options. that works, and the content of the field gets written to the database. the problem is that when I edit the article, even if it shows the select field as it should, once the edit is submitted this value (the selected option in the select field) is replaced by 'array'...so I can submit and everything works, but I cant edit, which is very important here, because users are suposed to edit their articles if they get a reply.

8
patagon
Re: Another article 1.0 question
  • 2007/7/8 18:46

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


As for the last paragraph, I meant that the site didnt have the sucess I hope it eventually has (whihc in a way its good since parts of it, like this one, are not 100% ready yet). This is a vey important topic here now. unfortunately it seems people forget about these issues until something tragic happens (for example workers dying in illegal constructions, it happened not long ago). even if we are lucky and this doesnt happen, buenos aires is a very nice city that a lot of people seem to enjoy (there are more tourists than ever), and parts of it, including historic buildings and neighborhoods, are being lost forever in order to make a quick buck...

9
Tobias
Re: Another article 1.0 question
  • 2007/7/8 22:18

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


As for the technical problem: I've reproduced it on my sandbox install, and I see what you're talking about. I think it may have to do with the variable not being flushed before the new value gets written to it. That's a wicked and probably wrong way of putting it, but the symptoms:

1. No value in database + new value being put in through the form --> value gets written to the database correctly. Doesn't matter whether it's a new submission or an old submission without the respective value in db.
2. Value in database + no new selection being made in the form --> nothing written to db, and old value stands correctly.
3. Value in database + selection being made in the form --> writes the word "Array" to the db.

I have a few ideas what to do about that, and I'll probably get a chance to look into it over the next days. Not promising anything, though.

As for them friggin real estate sharks: I think you might get much more traffic through your site if you drop the word "Buenos Aires" in a prominent position. As far as I can see, it's not really mentioned anywhere --> Google won't send you the people who want to know about that sort of abuse in that place. Perhaps, you can do some semantic search engine optimization with your front page.

10
patagon
Re: Another article 1.0 question
  • 2007/7/8 22:48

  • patagon

  • Quite a regular

  • Posts: 235

  • Since: 2002/1/8 0


Thanks Tobias, you are helping a lot and I really appreciate it your suggestion about adding buenos aires is also a good idea I overlooked...I guess i need to do some changes everywhere to make it SEO friendly. I am doing some promotion offline (there are many groups here who work on these issues, but communication among them is somewhat lacking, that is one of the main ideas behind the site) but getting them online (and to the site) is not that easy.

Login

Who's Online

173 user(s) are online (102 user(s) are browsing Support Forums)


Members: 0


Guests: 173


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits