Page 1 of 1

Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 6:40 pm
by Nullig
I'm trying to post news articles to a subcategory from the Front End. My link to fesubmit is:

Code: Select all

index.php?page=post-news&category=Family | Events
The "post-news" page has the News tag as follows:

Code: Select all

{news action='fesubmit' category=$params['category'] formtemplate='Family'}
I also tried:

Code: Select all

{news action='fesubmit' category="$params['category']" formtemplate='Family'}
I changed this part of the action.fesubmit.php from:

Code: Select all

if( isset( $params['category'] ) )
  {
    $query = 'SELECT news_category_id FROM '.cms_db_prefix().'module_news_categories WHERE news_category_name = ?';
    $tmp = $db->GetOne($query,array($params['category']));
    if( $tmp ) $category_id = $tmp;
  }
to:

Code: Select all

if( isset( $params['category'] ) )
  {
    $query = 'SELECT news_category_id FROM '.cms_db_prefix().'module_news_categories WHERE long_name = ?';
    $tmp = $db->GetOne($query,array($params['category']));
    if( $tmp ) $category_id = $tmp;
  }
hoping that by using long_name in the query it would work, but it still posts the article to the "Family" category.

Any ideas?

Nullig

Re: Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 6:50 pm
by calguy1000
well, anything in  your URL will be available in $smarty.get, not $params

i.e: if you have Add a new family event
on a page,  you would have to trap the category with {$smarty.get.category}

also, the | character could be getting lost in the url..... try printing out {$smarty.get.category} to see what it's like on the destination page.

Also, yeah, that query looks a little off and long name looks like the correct solution, IF | the character is not being translated somewhere.

Re: Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 6:58 pm
by Nullig
{$smarty.get.category} prints the full subcategory correctly.

Now how do I pass that on?

Nullig

Re: Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 7:06 pm
by calguy1000
because of some recent wierdities I've recently found in smarty, I recommend you try this:

{assign var='tmp' value=$smarty.get.category}
{news action='fesubmit' category="$tmp"}

Notice the double quotes around $tmp

Re: Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 7:12 pm
by Nullig
Thanks, calguy. That did the trick.

Nullig

Re: Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 8:53 pm
by blast2007
Nullig wrote: I'm trying to post news articles to a subcategory from the Front End. My link to fesubmit is:
Dear Nullig,
I have a problem similar to yours.
I'm trying to force a group of users to create/edit/delete news in a specific subcategory using FEU/CC.

The question is: "is it possible to use a kind of WYSIWYG editors within FEU to edit/create news?"

Sorry if this question was already posted.

Regards
blast

Re: Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 9:13 pm
by Nullig
Currently, there's no way to edit/delete news articles, but frontend users can create articles.

The WYSIWYG editor is available to the frontend, if you select an editor in Admin/Global Settings via the "Frontend wysiwyg:" field.

Nullig

Re: Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 9:18 pm
by blast2007
Nullig wrote: The WYSIWYG editor is available to the frontend, if you select an editor in Admin/Global Settings via the "Frontend wysiwyg:" field.
Ops...I miss that field! Thanks
Nullig wrote: Currently, there's no way to edit/delete news articles, but frontend users can create articles.
Nullig
I know, infact I'm trying to create an UDT for editing/deleting  news articles with FEU/CC modules.

Someone has already tried this.

Regards
blast

Re: Posting a News Article to a Subcategory

Posted: Wed Mar 26, 2008 11:19 pm
by Nullig
If you do find a way to edit/delete, please post the code here - I, for one, would be interested in using it.

Nullig

Re: Posting a News Article to a Subcategory

Posted: Thu Apr 03, 2008 2:32 pm
by blast2007
Nullig wrote: If you do find a way to edit/delete, please post the code here - I, for one, would be interested in using it.

Nullig
The code is almost ready.

Using a simple UDT and modules FormBuilder, FEU, CC you can edit/delete all news in frontend, limiting also activities to specific category "per user".

Stay tuned ;)

Regards
blast

Re: Posting a News Article to a Subcategory

Posted: Thu Apr 03, 2008 3:10 pm
by Nullig
Looking forward to this...

Nullig

Re: Posting a News Article to a Subcategory

Posted: Sun Aug 24, 2008 4:05 pm
by xmas3
Hi, I would like to do the same, let the users using FEU edit/modify news they submitted.
Is the UDT already available?
Thanks a lot,
Miro

Re: Posting a News Article to a Subcategory

Posted: Tue Dec 01, 2009 2:02 pm
by clj83
Hi,

Did you ever manage to create a UDT to allow a front end user to edit the news article they submitted through the fesubmit function?

Thanks

Chris

Re: Posting a News Article to a Subcategory

Posted: Mon Jan 24, 2011 1:42 pm
by Schaboo
Hi. Im trying to do exactly what Nullig (above) did i.e. use a smarty variable (passed from another page as a param) to specify the category in fesubmit i.e {assign var='tmp' value=$smarty.get.category}{news action='fesubmit' category="$tmp"}.
BUT, when a user submits the fesubmit form , the page refreshes (rather than redirecting to my specified page_id), and the news story is not added.
If I hardcode the category name eg. {news action='fesubmit' category="myname"}, the fesubmit form works perfectly and news stories can be added fine by front end users.
The smarty variable is definately passed to the page - I can print it using {$smarty.get.category} and feuser even selects the default category on the pulldown menu based on this variable.
Ive also tied passing the variable using POST. Again, I can print the variable {$smarty.post.category}, and FEuser recognises it for the pull down menu, but the submit fails. Can anyone help?