1
pembis
How to include my own php code?
  • 2005/4/24 21:21

  • pembis

  • Just popping in

  • Posts: 20

  • Since: 2005/4/20


I want to add my own php code as counter or so. I tried to iclude it in theme.html but didnt work. Then i tried adding it as a block again noway. What can i do?

2
ackbarr
Re: How to include my own php code?

in theme.html; php code can be added by using the <{php}> ... <{/php}> smarty tags.

3
pembis
Re: How to include my own php code?
  • 2005/4/24 22:20

  • pembis

  • Just popping in

  • Posts: 20

  • Since: 2005/4/20


When i add it like this in a page that is on root



it works.

But when i add it to the theme.html it never works? I tried adding my url at the beging of the code or the root path both didnt work?

4
ackbarr
Re: How to include my own php code?

<{php}>
include(
XOOPS_ROOT_PATH."uo/huc.php");
<{/
php}>

5
pembis
Re: How to include my own php code?
  • 2005/4/25 19:55

  • pembis

  • Just popping in

  • Posts: 20

  • Since: 2005/4/20


I added in theme.html and also as php module but no way ... What you think the problem can be coz its still not showing up?

6
ackbarr
Re: How to include my own php code?

remove all files from your /templates_c folder to ensure that your site isn't running a cached copy of your theme.html template

7
pembis
Re: How to include my own php code?
  • 2005/4/28 0:36

  • pembis

  • Just popping in

  • Posts: 20

  • Since: 2005/4/20


I added the block as php file and the command. i deleted everything in template_c and even the block title doesnt appear. I am completly lost help pls! :(

8
tripmon
Re: How to include my own php code?
  • 2005/4/28 0:50

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


Quote:

I added the block as php file and the command.


Not sure exactly what that means.

I'm guessing you created a Custom Block from Admin->Blocks.

Could you post the code you entered into the custom block, as well as the 'content type' that you have set.

Can you also verify that you have set group and block permissions for the custom block you created?

9
AAINC
Re: How to include my own php code?
  • 2005/4/28 3:07

  • AAINC

  • Not too shy to talk

  • Posts: 121

  • Since: 2003/10/18


Quote:

pembis wrote:
When i add it like this in a page that is on root
"uo/huc.php");?>


it works.

But when i add it to the theme.html it never works? I tried adding my url at the beging of the code or the root path both didnt work?


Place the huc.php in your theme directory.

Call into theme.html like this.
<{include_php file="$xoops_rootpath/themes/your_theme/huc.php"}>



See this thread.

https://xoops.org/modules/newbb/viewtopic.php?topic_id=34191&start=19

Hope you figure it out.


PEACE

10
pembis
Re: How to include my own php code?
  • 2005/4/30 1:22

  • pembis

  • Just popping in

  • Posts: 20

  • Since: 2005/4/20


Okey it worked this way thanks so much. And if i want this code appear in a block? I added it as php file type didnt work also HTML type didnt work too and the other 2 one too. I tried to modify the user online template as :

<{$block.online_total}><br /><br />Here is my code <{include_php file="$xoops_rootpath/themes/phpkaox/huc.php"}><br /><br /><{$block.lang_members}>: <{$block.online_members}><br /><{$block.lang_guests}>: <{$block.online_guests}><br /><br /><{$block.online_names}> <a href="javascript:openWithSelfMain('<{$xoops_url}>/misc.php?action=showpopups&type=online','Online',420,350);"><{$block.lang_more}>a>


Still didnt work. How can i make show it in a block?

Login

Who's Online

174 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 174


more...

Donat-O-Meter

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

Latest GitHub Commits