1
bokster
Question About Custom Block...
  • 2007/7/12 18:41

  • bokster

  • Just popping in

  • Posts: 3

  • Since: 2007/3/1 1


Hi all,

I need to insert some PHP codes in one of my custom blocks. I chose the Content Type as both HTML and PHP but it is not showing I have. Tried to echo "Hello World!" but it doesn't show as well.

Does anyone know the solution? Or another alternative to show PHP scripts?

Thanks.

B

2
showcase17
Re: Question About Custom Block...
  • 2007/7/12 19:15

  • showcase17

  • Not too shy to talk

  • Posts: 190

  • Since: 2005/1/6 0


Very easy solution!

delete those 2 lines:
?> (at the end of the script)

Post the module as PHP.

Xoops put those 2 lines in itself so there would by twice the same command... and that just doesn't work
- To Explore and Discover -

3
bokster
Re: Question About Custom Block...
  • 2007/7/16 15:05

  • bokster

  • Just popping in

  • Posts: 3

  • Since: 2007/3/1 1


I tried but it's still not working.I deleted the 2 lines as you adviced, kept echo "Hello World."; in, and posted it as a PHP Script in my block but I got this error message when I view the page :

"PHP Parse error: parse error, unexpected ':' in E:\Inet\wwwroot\small_business\class\xoopsblock.php(146) : eval()'d code on line 1 PHP Parse error: parse error, unexpected '<' in E:\Inet\wwwroot\small_business\class\xoopsblock.php(146) : eval()'d code on line 1""

Any ideas?

Thanks.

B

4
showcase17
Re: Question About Custom Block...
  • 2007/7/16 19:20

  • showcase17

  • Not too shy to talk

  • Posts: 190

  • Since: 2005/1/6 0


can you post the code you'd like to ad?

Quote:
"PHP Parse error: parse error, unexpected ':' in E:\Inet\wwwroot\small_business\class\xoopsblock.php(146) : eval()'d code on line 1 PHP Parse error: parse error, unexpected '<' in E:\Inet\wwwroot\small_business\class\xoopsblock.php(146) : eval()'d code on line 1""


the '<' error looks to me there's still a '<' in line 1 (but I'm no PHP coder and do not pretend to be so ;) !)
If this doesn't work pls post the code and I'll have a look.

BTW: you're hosting the website on your local machine?
- To Explore and Discover -

5
bokster
Re: Question About Custom Block...
  • 2007/7/19 14:15

  • bokster

  • Just popping in

  • Posts: 3

  • Since: 2007/3/1 1


Showcase17:

I got it to work..based on your advice. I don't know why it didn't work the first time.

I am not running the website locally. That is something I tried but there is a problem with database connection. Are you running and testing on your local machine?

Many thanks!

6
smfuser
Re: Question About Custom Block...
  • 2007/8/21 5:57

  • smfuser

  • Not too shy to talk

  • Posts: 103

  • Since: 2006/6/24


Hi I am having kinda the same problem.

I'm using XOOPS 2.0.16 and have SMF 1.1.3 and want to put a SSI PHP code to make some forum stats appear in a custom php block on the XOOPS Site.

I've added the necessary code to the top of the theme.html in the theme i want it to appear in, and i've added the php code in the custom block and set it as php but no block shows up.

When i remove the and set it as php, the page just goes blank white :(

I'm lost, anyone know how to post SMF forum SSI php output to a custom php block ?

thanks in advance :)
I used to be Indecisive ... but now I'm not so sure

Login

Who's Online

306 user(s) are online (243 user(s) are browsing Support Forums)


Members: 0


Guests: 306


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