Get started with PHP-Fusion

Start a New Thread

Users Participated

  • Falk
    Post made: 1

Related Threads

Event Calendar V9
updated 1 year ago

  1. PHP-Fusion Support Forums
  2. General Addon and Modification Support
  3. Panels and Infusions

Upgrading v7 Infusions to v9 - Sticky

Help and support for problems with infusions and panels

0 Reply 771 Views Last Updated on 6 months ago

Falk


Super Admin

#1

Posted 6 months ago

In infusion.php you will need to add ,
Code Gist: Download source  

$settings = fusion_get_settings();

This might also be required in other places depending on the complexity of your infusion.

In this section ,
Code Gist: Download source  

$inf_adminpanel[] = array(

Add, under rights page 5 as follows. Do not miss the , on the rights line.
Code Gist: Download source  

   
"rights" => "DEMO",
"page" => 5


page 5 means that it will be listed under Infusions, 1-4 is the other tabs.

$inf_newtable[1] etc can all be striped of the number , like :
$inf_newtable[] row1;
$inf_newtable[] row2;
etc
The system will enumrate automatically.

TYPE = MyIsam should always be ENGINE = MyISAM,
preferably like,
Code Gist: Download source  

ENGINE=MyISAM DEFAULT CHARSET=UTF8 COLLATE=utf8_unicode_ci";

Since we use UTF8 in 9.

You need to replace all <form> with openform(); and all </form> with closeform();
Since many old infusions use formaction, this is how you would make it work with openform();

Code Gist: Download source  

$formaction = "".INFUSIONS."yourinfusion/target.php";
echo openform('inputform', 'post', $formaction, array('enctype' => 1,'class' => 'm-t-20'));

If you do not want to use the new form system you can manually insert tokens like,

Code Gist: Download source  

               // Token data
               $options['form_id'] = "12345678";
               $options['max_tokens'] = "1";
               $options['remote_url'] = fusion_get_settings('site_path').'infusions/myinfusion/post.php';
               $token = \Defender\Token::generate_token($options['form_id'], $options['max_tokens'], $options['remote_url']);

               // Begin Form
               echo "<form id='".$options['form_id']."' name='postform' method='POST' action='".$options['remote_url']."'>\n";
               echo "<input type='hidden' name='fusion_token' value='".$token."' />\n";
               echo "<input type='hidden' name='form_id' value='".$options['form_id']."' />\n";
               
               // Form content as usual
               
               echo "</form>\n";


Please note that any MySQL errors will halt the Infuse as a whole, generic upgrade lines that fail or generic table modification attempts on non existing tables will result in a failure.

Posts: 3844

Joined: 27/09/2005

Jump to Forum:
9 users are online
0 member and 9 guests