M
M
Maxim Spiridonov2014-08-20 08:33:17
PHP
Maxim Spiridonov, 2014-08-20 08:33:17

[DLE] How to remove error when inserting php code into tpl?

I actually output the php code to the tpl file as follows: {include file="engine/modules/giveitem.php"}
giveitem.php in turn includes the shop.php file. In the output I get the following error:

Warning: stream_set_timeout() expects parameter 1 to be resource, boolean given in Z:\home\mine.ru\www\engine\modules\shop.php on line 36 Warning: fwrite() expects parameter 1 to be resource, boolean given in Z:\home\mine.ru\www\engine\modules\shop.php on line 57 Warning: fwrite() expects parameter 1 to be resource, boolean given in Z:\home\mine.ru\www\engine\modules\shop.php on line 57 Warning: fwrite() expects parameter 1 to be resource, boolean given in Z:\home\mine.ru\www\engine\modules\shop.php on line 57

Just in case, I provide the code of these php files.
giveitem.php - pastebin.com/ynRyXt91
shop.php - pastebin.com/4RXSR9JW

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Lashchevsky, 2014-08-20
@Alexanevsky

There is a suspicion that the modules you installed are not adapted to your version of DLE.

M
Maxim, 2014-08-20
@maxru

1. The error is that after opening the socket you do not check the success of its opening.
2. Use __construct instead of a method with name = class name
PS There is one more problem, but I don't think it can be fixed.

M
Mark B1, 2014-08-22
@MarkB1

What is the DLE version? Sometimes it is necessary to make changes to index.php in order to correctly process such pieces of code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question