11
Mithrandir
Re: NewBB2 Posttonews.php modified for AMS

You are not sending a variable with the name "title" to the page and therefore you cannot use it in the PHP file and therefore you get the warning message.

AMS submit form DOES send a variable with the name "title" and therefore it CAN be used in the PHP file.

Add: The send-to-news works fine, it is just the notification email that is sent without the title in the subject line.

to get rid of the error and set the subject title, use this:
$title $post->getVar('subject','e');/**/
$story->setTitle($title);

instead of line 62 - then $title is set and can be used further down.

12
jdseymour
Re: NewBB2 Posttonews.php modified for AMS

Thanks Mith,

Like I said in my post, I am no php programmer. But am trying to learn and get things to work the way I want.

Edited the file, tested. The error is gone.

Thanks again.

Added your code fix. Tested it. Works great.
Updated the file on the server.

13
jdseymour
Re: NewBB2 Posttonews.php modified for AMS

OK, this has been working great, but since the last update to XOOPS, AMS, or CBB something has broken, not sure what has changed so I will ask here.

Now when I submit a post to AMS, all looks correct, I get the screen confirming to post to news, I click on the submit button and the AMS edit page is shown, but all is blank, nothing filled out in any of the forms. If I click on cancel, the article is still saved to my AMS article list posted as anonymous (well actually the submitter is blank), but anonymous users are not allowed to post to AMS.

Furthermore, I cannot directly delete the article through the article manager, happens with all my test post, and end up having to delete through the database.

If anyone can give me an idea of what has changed, I know it worked with the original release of AMS, and I believe with XOOPS 2.0.9.2. I am leaning towards changes to these two items are breaking the hack, I currently use AMS 2.41, XOOPS 2.0.10, and CBB 1.14. The download link is unchanged as earlier in this post, if you would like to review the code.

14
Mithrandir
Re: NewBB2 Posttonews.php modified for AMS

Any new debug messages or errors?

15
jdseymour
Re: NewBB2 Posttonews.php modified for AMS

No, no errors with PHP debug turned on. Just end up with a blank article, with the author of (Guest).

But then in the manage articles section of AMS it is listed:

Re: Custom Avitar Upload (Will Re-enable) 2005/6/22 John Seymour Delete

When I click on delete, I get the database updated successfully, but the article is still there.

Get this on AMS article management page:

Notice [PHP]: Undefined index: 0 in file modules/AMS/class/class.newsstory.php line 82

MySQL debug when deleting:

DELETE FROM xxxxxxps_ams_text WHERE storyid=
Error number1064
Error message
You have an error in your SQL syntaxCheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1


TIA

Since I got that error on delete, enabled MySQL debug on submit and got the following:

SELECT FROM XXXXXxps_ams_files WHERE storyid=
Error number1064
Error message
You have an error in your SQL syntaxCheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1


MySQL version 4.0.24 PHP 4.3.11

16
m0nty
Re: NewBB2 Posttonews.php modified for AMS
  • 2005/6/22 12:09

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


yep same here. debug shows nothing on submit.

17
jdseymour
Re: NewBB2 Posttonews.php modified for AMS

Further investigation shows that the text of the article seems to be in the hometext field of the ams_text table in the database. It does not show in the submit or edit forms when either submitted from posttonews, or edit from admin.

ams_files, I am assuming has to do with attachments, which of course is empty.

As I said before, upon submission, the author of the article shows (Guest). When viewing the waiting article in admin, it shows the author properly as me. But still clicking to edit the text in the form is not there. And the author is still listed as (Guest).

Have gone through class.newsstory.php but there is a lot of items in that file. And not even sure if I am looking in the right place.

It does look like posttonews.php, uses the get function to pull the post from the database, then the post function to enter it into the article form. Any idea on what is causing this SQL error?

18
jdseymour
Re: NewBB2 Posttonews.php modified for AMS

Small *bump*

Any Idea?

Login

Who's Online

337 user(s) are online (244 user(s) are browsing Support Forums)


Members: 0


Guests: 337


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