We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Bind to Event Post | Forum

Marcus
Marcus Aug 20 '19

What is the name of the event that hold form post data?

if ( OW::getRequest()->isPost()


some like this maybe: OW_EventManager::ON_FORM_RENDER

Thanks

The Forum post is edited by Marcus Aug 20 '19
dave Leader
dave Aug 20 '19
Ill have to check, im not sure if there is one or not because you form submission post is sent when you press send form so if you want to grab it then just follow below.    



But basically here is how the form works. 

 
the html file sets the fields and the form namethen the php file you have   


$form = new Form('formname');  


then in the php file you set the fields to what you want 


example:  you can call it whatever you want, such as  $MyFormData         


         $MyFormData = new TextField('fieldname');

         $MyFormData->setLabel($language->text('pluginname', 'lang key here'));

         $MyFormData->setRequired(); 

         $MyFormData->addAttribute('size','10');

         $MyFormData->addAttribute('maxlength','30');

         $form->addElement($MyFormData); 

then once you have all your fields assigned then you just add the form
$this->addForm($form);  

Then when you submit the form it looks for the request that is a post request which is secure (there is post and get)  and you also run it through the validator


  if( OW::getRequest()->isPost() )         

  {           

      if ( $form->isValid($_POST) )             

       {

    then to get the values of the form  
    $values = $form->getValues();

     
example of one value would be 


     $vidtitle = $values['vidtitle'];  whatever you called your fieldname


if you want to view the whole array of the form you can do 


echo "<pre>";

print_r($values);

exit;

does that help?

The Forum post is edited by dave Aug 20 '19
dave Leader
dave Aug 20 '19
If you want to trap an event like before profile save, or after pic upload, those are listed in the eventhandler file in the core, there are a bunch of them..  
Marcus
Marcus Aug 20 '19
Thanks Dave for your code. Let me explain let say there is a page with a form in it now the code you posted is in the controller OK. Now there is no event triggered when that form gets submitted. I thought there is a way to intercept $_post parameters from outside of the controller like from the plug-in.

Basically I'm trying to check forum reply message. Currently there is no before save post event triggered so I can't prossess the text before it gets saved 
The Forum post is edited by Marcus Aug 20 '19
dave Leader
dave Aug 20 '19
OH ok now i get what you need...  let me do some poking around and see what i find... 
dave Leader
dave Aug 20 '19
I did find these in the blog classes listener so it might also work for forum.  


        OW::getEventManager()->bind(PostService::EVENT_AFTER_ADD, array($this, "onAfterPostAdd"));


        OW::getEventManager()->bind(PostService::EVENT_AFTER_EDIT, array($this, "onAfterPostEdit"));


also there is a save event in the blogs controllers save.php file 


                OW::getEventManager()->trigger(new OW_Event(PostService::EVENT_AFTER_ADD, array(


so you might be able to work that same logic using the postservice into your plugin or find same event in forum 



The Forum post is edited by dave Aug 20 '19
Marcus
Marcus Aug 20 '19
Great Dave it's already too late here I'll try it out tomorrow. Really appreciate your support
amritajain
amritajain Oct 6 '22

I'm interested in your article that you published on this website, Dehradun Escort Service so please keep sharing insightful facts.

tinmach
tinmach Dec 11 '22
To put it simply, I want to verify a forum post of response. Unfortunately, I am unable to process the content prior to saving since no pre-save post event is currently being fired.  geometry dash subzero


poojapandit
poojapandit Feb 15 '23
Owner Mumbai escorts service in Mumbai are so famous and popular for their sexiness and hotness they are on high demand. These married ladies are greedy for sex and are very affectionate to their customers. Furthermore, their overall costumes and makeup which include red and golden bangles on their hand’s, indoor and creams lipstick makes them look more sexy and attractive and become like a magnet. Malabar Hill Escorts || Bandra Escorts Service || Panvel Escorts || Escorts in Lucknow || Hyderabad Escort || Kochi Escorts Service || Escorts in Thane || Jaipur Escorts Service || Worli Escorts Service ||Escorts in Versova |
Saxenda kopen
Saxenda kopen Mar 19

Our goal is to deliver quality of care in a courteous, respectful, and compassionate manner. We hope you will allow us to care for you and strive to be the first and best choice of pharmaceutical products. Buy diazepam 2mg pil

https://ukpharmameds.com/

diazepam 2mg pil

Saxenda kopen
Saxenda kopen Mar 19

Our goal is to deliver quality of care in a courteous, respectful, and compassionate manner. We hope you will allow us to care for you and strive to be the first and best choice of pharmaceutical products. Buy diazepam 2mg pil

diazepam 2mg pil

Saxenda kopen
Saxenda kopen Mar 19

kopen sie Ozempic® De inhoud van generieke pillen en merkgeneesmiddelen is precies hetzelfde. Het enige verschil is de naam

Ozempic kopen


Saxenda kopen
Saxenda kopen Mar 19

Saxenda® kaufen Der Inhalt von generischen Pillen und Markenmedikamenten ist genau gleich. Der einzige Unterschied ist der Name

Saxenda kaufen

Saxenda kopen
Saxenda kopen Mar 19

koop-saxenda® De inhoud van generieke pillen en merkgeneesmiddelen is precies hetzelfde. Het enige verschil is de naam

Saxenda kopen

Saxenda kopen
Saxenda kopen Mar 19

kopen sie oxycodon kruidvat® De inhoud van generieke pillen en merkgeneesmiddelen is precies hetzelfde. Het enige verschil is de naam

Oxycodon kopen kruidvat

Saxenda kopen
Saxenda kopen Mar 19

shipping container® for sale in the USA and Canada online only with Queen Containers your most trusted and reliable shipping container supplier. We operate out of Texas and California. Buy Container Chassis, Shipping Container Accessories, Cold Containers, Blast freezers, etc.

Container chassis for sale

Saxenda kopen
Saxenda kopen Mar 19

Ozempic senza ricetta (semaglutide) è un’iniezione settimanale utilizzata per migliorare i livelli di zucchero nel sangue negli adulti con diabete mellito di tipo 2.

trulicity fa dimagrire

Saxenda kopen
Saxenda kopen Mar 19

Zeecontainer kopen in Europe online only with ASHCCO your most trusted and reliable shipping container supplier. We operate out of Antwerp Belgiun. Buy Container Chassis, Shipping Container Accessories, Cold Containers, Blast freezers, etc.

container kopen 20ft