Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Upgrading v7 / v8 Infusions to v9

Pinned Asked Modified Viewed 6,116 times
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Started this discussions
  • Answered 11 questions
asked
Super Admin

In infusion.php you will need to add ,
$settings = fusion_get_settings();

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

In this section ,
$inf_adminpanel[] = array(

Add, under rights page 5 as follows. Do not miss the , on the rights line ( Not required on last ).
   
"rights" => "DEMO",
"page" => 5,
"language" => LANGUAGE


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.

For both v8 and v9 Infusions need to have their infusion.php updated with utf8mb4

TYPE = MyIsam should always be ENGINE = MyISAM,
and the lines should look like this,
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Since we use UTF-8mb4 tables in 8 & 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();

$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,

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

Remember to Download the 9.03 SDK as well for more examples. https://www.php-fusion.co.uk/infusion...oad_id=601
Edited by Falk on 06-02-2020 02:49,
0 replies

3 posts

S
SkeeredOfMyMind
S
[size=24]HELP WANTED FOR PHP-FUSION PROJECTS[/size]
[size=12]I am seeking Web Developers & Designers, Graphic Developers & Designers, Web, Mobile App & Computer Program Coders & Programmers & Beta & Alpha Testers for new PHP-Fusion Add-Ons like Themes, Infusions, BB-Codes and ETC, as well as Websites, Mobile App & Computer Programs to help me develop, design, code & program new PHP-Fusion Add-Ons, Websites, Mobile Apps & Computer Programs and I also need some people to test those in the Beta & Alpha stages both. All jobs are paid and are freelance jobs. Please message me here if interested for a list of available positions and projects. [/size]
  • Member, joined since
  • Contributed 120 posts on the community forums.
  • Started 44 threads in the forums
answered
Member

I have been searching for something like this, this is JUST what I needed. I was going to hire someone to update Infusions for me and now I do not have to if this works. Thank you for sharing this Falk!

Now, if we only had this for Themes! Is there a tutorial like this for updating Themes too?
Edited by SkeeredOfMyMind on 21-10-2019 15:32,
0 replies
S
SkeeredOfMyMind
S
[size=24]HELP WANTED FOR PHP-FUSION PROJECTS[/size]
[size=12]I am seeking Web Developers & Designers, Graphic Developers & Designers, Web, Mobile App & Computer Program Coders & Programmers & Beta & Alpha Testers for new PHP-Fusion Add-Ons like Themes, Infusions, BB-Codes and ETC, as well as Websites, Mobile App & Computer Programs to help me develop, design, code & program new PHP-Fusion Add-Ons, Websites, Mobile Apps & Computer Programs and I also need some people to test those in the Beta & Alpha stages both. All jobs are paid and are freelance jobs. Please message me here if interested for a list of available positions and projects. [/size]
  • Member, joined since
  • Contributed 120 posts on the community forums.
  • Started 44 threads in the forums
answered
Member

Quote

In infusion.php you will need to add ,
$settings = fusion_get_settings();

This might also be required in other places depending on the complexity of your infusion.
What other files may this need to be placed in?

In this section ,
$inf_adminpanel[] = array(

Add, under rights page 5 as follows. Do not miss the , on the rights line.
   
"rights" => "DEMO",
"page" => 5

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

I know this is for Infusions that include Admin Panels but what file does this code go in? What are the files for Infusions with Admin Panels typically called? Also, is DEMO what goes in
"rights" => "DEMO",
and what is each of the pages 1-4 if you do not mind explaining a bit more.


$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,
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Since we use UTF-8mb4 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();

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


What file(s) can this code typically be found in?

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

               // 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";


What file(s) is this code in typically also?

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.


I'd greatly appreciate answers to my questions, if you will, please. I am just learning how to update the Infusions so I am a little confused on a few things but would like to update them myself instead of paying someone to do it! It will save me tons of money and make me happy. I will definitely donate some money to the PHPFusion Project if I can figure this out and update all the Infusions I want to use and not have to pay others to do it.
0 replies
— 2 months later —
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Started this discussions
  • Answered 11 questions
answered
Super Admin

Quote

What other files may this need to be placed in?
I know this is for Infusions that include Admin Panels but what file does this code go in? What are the files for Infusions with Admin Panels typically called? Also, is DEMO what goes in


/infusions/infusion.php , is the file for this. See examples, perhaps Shoutbox is least complex to study.

Quote

I know this is for Infusions that include Admin Panels but what file does this code go in? What are the files for Infusions with Admin Panels typically called? Also, is DEMO what goes in

DEMO is Admin rights for the Addon, it should already be present in infusion.php

Quote

what is each of the pages 1-4 if you do not mind explaining a bit more.

1 is Content Admin
2 is User Admin
3 is System Admin
4 is Settings

Quote

What file(s) can this code typically be found in?

Any file that have a submit form.

Quote

What file(s) is this code in typically also?

That code is a work-around to void using new Dynamic forms instead of <form></form> for token generation.
1 reply

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 3 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Started this discussions
  • Answered 11 questions
S
S
[size=24]HELP WANTED FOR PHP-FUSION PROJECTS[/size]
[size=12]I am seeking Web Developers & Designers, Graphic Developers & Designers, Web, Mobile App & Computer Program Coders & Programmers & Beta & Alpha Testers for new PHP-Fusion Add-Ons like Themes, Infusions, BB-Codes and ETC, as well as Websites, Mobile App & Computer Programs to help me develop, design, code & program new PHP-Fusion Add-Ons, Websites, Mobile Apps & Computer Programs and I also need some people to test those in the Beta & Alpha stages both. All jobs are paid and are freelance jobs. Please message me here if interested for a list of available positions and projects. [/size]
  • Member, joined since
  • Contributed 120 posts on the community forums.
  • Started 44 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet