Get started with PHP-Fusion

Start a New Thread

Users Participated

  • Falk
    Post made: 5
  • SnakeEye
    Post made: 4

  1. PHP-Fusion Support Forums
  2. Development & Design
  3. Other Issues (9)

System Stripping HTML

Other Issues (9) Can be weblinks, FaQ and other components that donīt have own forums here.

8 Replies 184 Views Last Updated on 14 days ago

SnakeEye


Junior Member

#1

Posted 19 days ago

This is a HUGE problem and will cause me not to ever use v9. Whenever I try to create a new post for ANYTHING, the system strips my html coding and replaces it with something that the system wants to use which breaks my code. I need it to just take whatever I put in there. It particularly doesn't like JavaScript and will remove important elements of it.

I also don't like it that when you create a custom page it doesn't show up with the link to that custom page so it can be added to the site's links. Where is that custom page? How are custom pages supposed to be added to the site's menu?

Posts: 40

Joined: 22/01/2011

Falk


Super Admin

#2

Posted 19 days ago

Custom Pages should not strip pure HTML. Perhaps some scripts, but if you are going to script why not make a separate file and just link to it?
If you want you can still run php and scripts by allowing script execution found in security settings. This is disabled by default.
As mentioned above, we recommend that you make a separate file for larger files and make them Real panels or Infusions / alternative pages instead of storing large chunks of code in to the database.
The option to auto link from site links do exist, but there is a glitch with current pages as can be seen here : https://github.com/php-fusion/PHP-Fusion/issues...ssues/1566

Custom pages can also easily be linked to manually with this type of line
viewpage.php?page_id=1 < the 1 is page id, this is listed in the far right on all existing pages, simply replace it with page you want to link to.

Posts: 3662

Joined: 27/09/2005

Falk


Super Admin

#3

Posted 19 days ago

This is what you need to make your own files, in the root folder, open a new textfile in editor Notepad++ for example, save in UTF-8 NoBom, name it whatever you want.php
Code Gist: Download source  

<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
?> // Lets turn off PHP if you wanna paste HTML and Script, else remove this line and echo your content.
// Content goes here


<?php
require_once THEMES."templates/footer.php";

This is much cleaner for you and the system.

Posts: 3662

Joined: 27/09/2005

SnakeEye


Junior Member

#4

Posted 18 days ago

Perhaps some scripts, but if you are going to script why not make a separate file and just link to it?


I'm not talking about php scripts. I use JavaScripts for various things and they are third party so I can't just create a separate file for them. For example I use a piece of JavaScript from Feedgrabber that has to be inserted into the page code for it to show the feeds I selected from them. When I paste that code into the custom page the original code looks like this:
Code Gist: Download source  

<div class="feedgrabbr_widget" id="fgid_07399f0d095379edcefa1540e"></div>
<script> if (typeof(fg_widgets)==="undefined") fg_widgets = new Array();fg_widgets.push("fgid_07399f0d095379edcefa1540e");</script>
<script src="http://www.feedgrabbr.com/widget/fgwidget.js"></script>


After I save the page it now looks like this because the system has removed elements of the script:

Code Gist: Download source  

<div id="fgid_07399f0d095379edcefa1540e" class="feedgrabbr_widget"> </div>


After saving the page when I try to view that page it also throws an internal error and tells me unable to retrieve page content. You can get an idea of what the page should look like by going here.
Edited by SnakeEye on 05-04-2017 06:20

Posts: 40

Joined: 22/01/2011

Falk


Super Admin

#5

Posted 18 days ago

Are you running the latest Git version?-

I tested your script and it does not behave as described by you on my test server.

See Image for response
Result output ,

Code Gist: Download source  

  <!--cp_idx-->
<p><div class="feedgrabbr_widget" id="fgid_07399f0d095379edcefa1540e"></div><br />
<script> if (typeof(fg_widgets)==="undefined") fg_widgets = new Array();fg_widgets.push("fgid_07399f0d095379edcefa1540e");</script><br />
<script src="http://www.feedgrabbr.com/widget/fgwidget.js"></script></p><br />

Posts: 3662

Joined: 27/09/2005

SnakeEye


Junior Member

#6

Posted 18 days ago

Gonna go and download what is in the current git and reinstall and see what I get after that. Will update this post.

Posts: 40

Joined: 22/01/2011

Falk


Super Admin

#7

Posted 18 days ago

oh, and in my example you can paste your HTML and Javascript and run a separe file as described. Just paste it below //Content goes here and above last <?php and it will run just fine.
When it comes to boostrap tho, you will need a <div class="container"> to wrap it and avoid full width.

Posts: 3662

Joined: 27/09/2005

SnakeEye


Junior Member

#8

Posted 14 days ago

What is the url to the latest git?

Posts: 40

Joined: 22/01/2011

Falk


Super Admin

#9

Posts: 3662

Joined: 27/09/2005

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