1
mcvegan
News1.55 changing the form
  • 2007/9/25 14:25

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Hello, i have posted before the same question, but since my question is changed, i`l try it here again.

If you install News.155 as default, it's not really possible to let post anonymous users. Because as a anonymous user, you can't fill in a name, email, webadress and also the extended textarea is hidden. Because of this, i`m trying to change the form a little bit, but i still not now exactly how to do this.

I already got the name, email, webadres and the extended textarea in the form, but when i submit this form it must of course put it also in the database and this is where i run in to problems.

I know that there are two files submit.php and storyform.inc, but where can i find the query what puts it in the story table?

I know my english is crappy and so my description of my problem is, but i hope someone can help me a little bit to fix this problem. Right know i`m working for a client of me, and i promissed that i would have solved the problem at the end of this week.

Please someone?

Thanx already.

2
mcvegan
Re: News1.55 changing the form
  • 2007/9/25 15:16

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Alright in storyform.inc i added the following code under the title field.

$sform->addElement(new XoopsFormText(_NW_TITLE'title'50255$title), true);
$sform->addElement(new XoopsFormText(_NW_AUTHOR'author'2020$authorr), true);
$sform->addElement(new XoopsFormText(_NW_EMAIL'email'2040$emaill), true);
$sform->addElement(new XoopsFormText(_NW_WEB'web'2050$webb), false);


So i thought that i have to add in submit.php the following.

$story->setTitle($_POST['title']);
$story->setAuthor($_POST['authorr']);
$story->setEmail($_POST['emaill']);
$story->setWeb($_POST['webb']);


But this gives the following error:

Fatal error: Call to undefined method NewsStory::setAuthor() in D:\apache\htdocs\axoops\modules\news\submit.php on line 333

Why do i get this error?

I also added the tables to the mysql.

3
iHackCode
Re: News1.55 changing the form

Quote:

mcvegan wrote:

Fatal error: Call to undefined method NewsStory::setAuthor() in D:\apache\htdocs\axoops\modules\news\submit.php on line 333

Why do i get this error?


i dont think that method exists in the XoopsStory or the NewsStory class. So you will have to create it.. I would suggesting making the anonymous authors names to show when the uid is 0. like how cbb has for anonymous posts. as they say 'There’s more than one way to skin a cat!', so there are other ways to do it.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

4
mcvegan
Re: News1.55 changing the form
  • 2007/9/26 16:47

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


uhmmmm, i found out that

$story->setAuthor($_POST['authorr']);


was set in xoopsstory. Because of that i decided to add setauthor to the xoopstory class. Now the error is gone, but still it puts nothing in the mysql, does someone know how to do put the information in the mysql>?

thanx already.

5
iHackCode
Re: News1.55 changing the form

check out the store method in the NewsStory class.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

6
mcvegan
Re: News1.55 changing the form
  • 2007/9/28 11:48

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Wow, for the biggest part i fixed it. Right now it's saving the information en showing it in the article, and there is one small problem to solve. If i i`m trying to edit, it gives this errors:

Notice: Undefined variable: authorr in file /modules/news/include/storyform.inc.php line 44
Notice: Undefined variable: emaill in file /modules/news/include/storyform.inc.php line 45
Notice: Undefined variable: webb in file /modules/news/include/storyform.inc.php line 46

If someone can give me a hint, thanx.

And Bandit-X thank you :)

Login

Who's Online

131 user(s) are online (72 user(s) are browsing Support Forums)


Members: 0


Guests: 131


more...

Donat-O-Meter

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

Latest GitHub Commits