1
mcvegan
Changing a form of news 1.59
  • 2007/11/12 18:53

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Hello, i oned to change the newsform of news 1.59. Ad the bottom of the form is a option field, i don't want this options on my website. So i found out a file storyform.inc, in here i can find the code that's responsible for this part of the form. But if you delete this code, it won't approve the newsitem. This is Because you need the approve option, wich i don't like. Has anyone an idee to delete these option field, so it just automatically approve the newsitem?



2
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 :)



3
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.



4
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.



5
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.



6
mcvegan
Re: anonymous posting with news 1.44
  • 2007/9/21 6:45

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Alright, i changed the storyform.inc so it shows the extra field. I thought that i fixed it, but now i discovered that it won't save the information in the extra field. Please, have someone a solution for me?

Greets,
Mcvegan.



7
mcvegan
anonymous posting with news 1.44
  • 2007/9/19 13:02

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Hello, i installed news 1.44. Everything is working great, but when anonymous users want to post an article, they get only the scoop part and not the extended part of the form, while registered users get the extended part.

Has Anyone an idea, how to get the extended part of the form while being an anonymous user?

thanx already



8
mcvegan
Re: How to disable javescript in adminmenu
  • 2007/9/10 13:27

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Hello, in your include directory of XOOPS there is a file layersmenu.php . Edit this file with a /* in the beginnen of that file end at the end */ then the menu will be disabled. There will be better ways to do this, but this works fast and easy :)



9
mcvegan
Re: using a config file for mysql
  • 2007/8/16 7:13

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


I now know how to connect the database, but i noticed, that this post is at the wrong place of this forum. I`m sorry about that :(



10
mcvegan
using a config file for mysql
  • 2007/8/15 7:43

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Hello, i`m new at working at xoops. Right now, i`m trying to convert an already existing search egine, to a module. Because i found nowhere such a module. Altough, everything is going great, and it already working. But there is still one slightly problem. And i think it's gonna be a big issue, since the search engine has a config file for connecting to the mysql. I can just write my own information in it, and it works. But i one to configure this automatic when someone installs this module. I'l already know about the $xoopsDB option, but is there a way, so that it first loads the XOOPS variables en then change them to the original variables from this script.(sorry, my english is a little bit crappy :() But already thanx.


<?php
    $database
="xoops";
    
$mysql_user "";
    
$mysql_password ""
    
$mysql_host "localhost";
    
$mysql_table_prefix "";



    
$success mysql_pconnect ($mysql_host$mysql_user$mysql_password);
    if (!
$success)
        die (
"<b>Cannot connect to database, check if username, password and host are correct.</b>");
    
$success mysql_select_db ($database);
    if (!
$success) {
        print 
"<b>Cannot choose database, check if database name is correct.";
        die();
    }
?>




TopTop



Login

Who's Online

163 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 163


more...

Donat-O-Meter

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

Latest GitHub Commits