1
fishspon
Executing custom PHP script at bottom of every page
  • 2006/11/18 12:22

  • fishspon

  • Not too shy to talk

  • Posts: 164

  • Since: 2003/11/23


I'm using XOOPS 2.0.13.2 with various modules, and i need to be able to place some content at the bottom of every single page on my site, just above the "Powered by Xoops" bar.

I have tried doing this with a block, and with things like the forum, is doesn't appear at the bottom of the page. Also, a block is a bit too heavy-weight for what i need. I need somethingg that is basically a couple of lines of text.

The other tricky part is that this text needs to be generated on-the-fly by a PHP script, so somehow, i need to embed a custom PHP script into my site, just above the "Powered by Xoops" line.

Is this possible, and if so, how can it be done?

Thanks in advance, for any suggestions!
[size=x-small]><> fishsponge <><
[HiFi Forum] [UNIX/Linux Forum] [Richard Hobbs][/size]

2
Herko
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 12:31

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Put it in your theme,html file, just below the <{$xoops_content}> module content smarty varable. That'll get it executen on every single page.

Herko

3
Quest
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 12:32

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Try putting it in your theme.html. Maybe in its own table just above the footer.

Quest

4
fishspon
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 12:57

  • fishspon

  • Not too shy to talk

  • Posts: 164

  • Since: 2003/11/23


thanks for the replies, people, but two more questions...

1) i've added a simple line of text that just says "TEST" now, in it's own table just above the footer (this was quite simple) and have re-uploaded the file back to my web server, but i'm not see the modification on the live site. Any ideas?

2) although i can add static text into the theme.html file, how can i add a php script to be executed each time the page is displayed?

Thanks again!
[size=x-small]><> fishsponge <><
[HiFi Forum] [UNIX/Linux Forum] [Richard Hobbs][/size]

5
Quest
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 13:30

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


What did you use to open and close your php code?

6
wizanda
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 13:41

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


    
        
// php code goes here
?>



7
Quest
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 13:50

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Try emptying your template_c folder of everything Ecept the index.html.
Check to see if you have Update Templates/html set in your administration/system/preferences/general_settings then try again to go to your page and refresh page. Sometimes it helps to also empty your browser cache.

HTHs
Quest

8
fishspon
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 14:08

  • fishspon

  • Not too shy to talk

  • Posts: 164

  • Since: 2003/11/23


thanks again for the responses people... still one problem though.

I can now get static content working perfectly, but the PHP code is not being executed. Here's the bottom of theme.html:


      

      <{/if}>

    
  

  
    
      
                  print "advert test";
          
// include("intelliLink/adverts.php");
        
?>
      
    
  

  
    
      poweredby.gif" alt="" />
    
  



Basically, the text "advert test" is not being printed.

If, however, i put the text "advert test" above the
I have already tried making theme.html chmod 755, but that made no difference.

Any further suggestions?
[size=x-small]><> fishsponge <><
[HiFi Forum] [UNIX/Linux Forum] [Richard Hobbs][/size]

9
Quest
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 14:12

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Maybe just maybe it needs to be open and closed like this:
<{php}>
asdlkadkfjakdfa
<{/php}>

Quest

10
fishspon
Re: Executing custom PHP script at bottom of every page
  • 2006/11/18 14:19

  • fishspon

  • Not too shy to talk

  • Posts: 164

  • Since: 2003/11/23


excellent! i can now execute PHP code!

However, i still cannot execute include(""); calls.

print(""); works perfectly, but include(""); does not work at all. it doesn't even produce an error.

Any ideas why this is?

Thanks again people!
[size=x-small]><> fishsponge <><
[HiFi Forum] [UNIX/Linux Forum] [Richard Hobbs][/size]

Login

Who's Online

275 user(s) are online (236 user(s) are browsing Support Forums)


Members: 0


Guests: 275


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits