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?

Minds drawing a blank?????

Asked Modified Viewed 2,063 times
D
daimonbok1
D
Into The Nebula! Is it Science or Science Fiction?
  • Senior Member, joined since
  • Contributed 626 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
asked
Senior Member

I'm trying to add code to the bottom of the footer.php and it's blowing up the site causing the theme to fail.

Original Footer.php
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) PHPFusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: footer_includes.php
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
//Add your custom include files for the footer here


Then I add the code and footer.php is now
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) PHPFusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: footer_includes.php
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
//Add your custom include files for the footer here
<?php include '/home/xxxxxx/public_html/ads/ads.php'; ?>

/* Code to display  ad(s) */
<?php $buttons1 = new digiAds (null, ); ?>


Or would this javascript link work better?
<script language="javascript" type="text/javascript" src="/ads/js.php"></script>


WHere can I fix this. This banner rotator at least allows a size choice....
Edited by daimonbok1 on 21-10-2016 18:28,
0 replies

2 posts

C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

I will give you lots of information... relevant and unrelevant ones, but aiming to increase your knowledge a little of the CMS.

Mistake: See your Line 1 has <?php already, unless you close it '?>' , you are doubling on the <?php open tags.
Fix: Remove the <?php and ?> if the language contained in it is still PHP.

2. In Script, there is no need to modify any core files AT ALL.

Say, custom.php

<?php
add_to_head("<link ref='....'>");    will add your stylesheet into the header of the HTML when PHPFusion reloads.
add_to_footer("<script type='text/javascript' src='.....'>"); will add it to the very bottom of the HTML when PHPFusion Reloads.
add_to_jquery("
// purely JS code
alert('hi');
"); // will add it to the Jquery compiler of the PHPFusion when reload
?>


Everything can be done in your own file. The core has APIs to parse your page according to your wishes. We call this 'output handling'
Read the documentation here of it's usage: https://www.php-fusion.co.uk/infusions/wiki/documentation.php?page_id=31

I want to add here, that you will be in a big trouble to sync with our Repository IF You Edit Core Files. (Core Files is all files that is part of the Github Repository, including the theme - i.e every file).

You need to fork, and make additional files so that when you pull new updates you will not need to think twice.

If you are using Septenary Theme, and want to modify it..... Copy and Paste back Septenary as another name, and assign your theme to the new theme. This way, when we push Septenary new version (if we do), you just need to pull it straight down. No conflict whatsoever.

Same goes with footer.php..... in your case. Use in your script ...

add_to_footer(" put everything in here ");


And say if there is an echo in the function..


function theme_functions($param, $param2, $param3) {
// has echo
echo "something";
}

// and you do this..

theme_functions($a,$b,$c); // already has echo.... but you need to push it to footer section...

// what you do is...

// But caution.... PHP version less than 5.4 have Memory Overflow hackers intrusion vulnerability.
ob_start();
theme_functions($a, $b, $c);
$html_of_the_above = ob_get_contents();
ob_end_clean();
add_to_footer($html_of_the_above);


The Entire of PHPFusion is cached and output at footer.php. If we are runnng PHP 5.4 and below and your theme is very graphic intensive, your server will be compromised. http://www.infoworld.com/article/3020451/application-development/patch-your-php-security-fixes-released-for-all-branches.html ... Upgrade Soonest possible guys.

Quote

Due to this inflexibility in earlier functions which contains ECHO. Refrain from doing so when coding your own function. Return as a string in your design. It makes using that function twice as easy -- at least it will be output handler friendly stuff..



$buttons1 = new digiAds (null, 'what-is-this');


The new digiAds is a constructor object method. Does it already contain echo "" inside the object? You're trying to bind the object to $buttons1.

So, if the constructor object is returning a string, then you need to add a line after that so PHP will echo (a.k.a render) it.

echo $buttons1


Anyway, please refer the usage of the digiAds in it the creator's support side. But I can only tell you... new class('' , ); will crash. you have a wrong delimiter "," without the second parameter. It's definitely crash. It's new object("param1", "param2") or new object("param1"); only. no object("param1" , ")
Edited by Chan on 22-10-2016 08:32,
0 replies
D
daimonbok1
D
Into The Nebula! Is it Science or Science Fiction?
  • Senior Member, joined since
  • Contributed 626 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
answered
Senior Member

Sorry Chan, Went way above my knowledge level....:| Gotta get more reading done...

Thanks..

Did finally find a banner rotator, that installed without error. Easy for a non programmer to do. If anyone want's it for thier Fusion Sites, let me know..
Edited by daimonbok1 on 24-10-2016 04:45,
0 replies

Category Forum

General Discussion

Labels

None yet

Statistics

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

2 participants

C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
D
D
Into The Nebula! Is it Science or Science Fiction?
  • Senior Member, joined since
  • Contributed 626 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet