Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2010-07-14 17:49:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,397
Website GitHub Mastodon Twitter

Re: integrate with poll script

maniqui wrote:

Disclaimer: I don’t know what I’m talking about below.

I’m not sure if it’s possible to create another DB connection (to a different DB) from within a TXP website…

Hi Julián,

I think that you can. I have slimstat installed on a different db.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#17 2010-07-15 05:15:39

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: integrate with poll script

but without db install (textfile), it works fine


<txp:txp_me />

Offline

#18 2010-07-16 10:01:28

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: integrate with poll script

I’m found a nice poll script called Little Poll

it’s simple in setup. I’ve tested it in simple php page, it’s works fine, but in txp it’s dont work(((
(previous script dont work at all)
Can someone test it in own txp? it’s very nice script, and i want to use it..
in header i get an error:

Tag Error: <txp:php> -> Warning: fopen() [function.fopen]: Filename cannot be empty on line 34

Tag Error: <txp:php> -> Warning: fread() expects parameter 1 to be resource, boolean given on line 35

Tag Error: <txp:php> -> Warning: fclose() expects parameter 1 to be resource, boolean given on line 36

Last edited by Katalonian (2010-07-16 10:01:56)


<txp:txp_me />

Offline

#19 2010-07-16 10:26:58

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: integrate with poll script

I’m more than sure, that problem is with paths within scripts. Try to look though their code and change to absolute paths. For ex. insted of include('script.php'); i should use include('/home/userdir/www/script.php'); – you can look how your absolute url looks like in prefs->diagnostic


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#20 2010-07-16 10:40:34

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: integrate with poll script

No,trouble not in path.

Tag Error: <txp:php> -> Warning: fopen() [function.fopen]: Filename cannot be empty on line 34

global $filename; line 34 in lp_source.php -> $fp=fopen($filename, “r”); line 35 in lp_source.php -> $file_contents=fread($fp,filesize($filename)-1); line 36 in lp_source.php -> fclose($fp);

Last edited by Katalonian (2010-07-16 10:41:40)


<txp:txp_me />

Offline

#21 2010-07-16 13:26:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,397
Website GitHub Mastodon Twitter

Re: integrate with poll script

Do you have raw php enabled in the preferences?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#22 2010-07-16 13:33:42

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: integrate with poll script

yes.


<txp:txp_me />

Offline

#23 2010-07-16 13:59:45

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: integrate with poll script

Why are you so sure that problem is not is path? fread() can’t read resourse which should be opened by fopen()

1. find where var $filename is defined and post here it’s value – or add to script debugging output near fopenprint_r($filename);
2. post here path from diagnostic tab


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#24 2010-07-16 15:49:24

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: integrate with poll script

the_ghost wrote:

Why are you so sure that problem is not is path? fread() can’t read resourse which should be opened by fopen()

Because i do same thing in other simple php file, all work fine

1. find where var $filename is defined and post here it’s value – or add to script debugging output near fopenprint_r($filename);

// File in which voting scores are kept
$filename = “lplist.txt”;

2. post here path from diagnostic tab

D:\xampp\htdocs\adiu\


<txp:txp_me />

Offline

#25 2010-07-16 15:56:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,397
Website GitHub Mastodon Twitter

Re: integrate with poll script

There might be something else… Can we see your diagnostics?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#26 2010-07-16 16:01:47

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: integrate with poll script

colak wrote:

There might be something else… Can we see your diagnostics?

you mean txp diagnostics?


<txp:txp_me />

Offline

#27 2010-07-16 19:28:48

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: integrate with poll script

colak wrote:

There might be something else… Can we see your diagnostics?

And I ensis that problem is in path – it always happens when you run server under Windows – script may operate with normal slash, but windows handles other slash symbol.


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#28 2010-07-16 19:35:59

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: integrate with poll script

colak wrote:

There might be something else… Can we see your diagnostics?

this is short diagnostic of txp
and full


<txp:txp_me />

Offline

#29 2010-07-16 22:10:03

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: integrate with poll script

i thing, it’s may be good, if someone try to use this poll in own txp, and see what’s going on…


<txp:txp_me />

Offline

#30 2010-07-19 13:52:04

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,397
Website GitHub Mastodon Twitter

Re: integrate with poll script

I am not familiar to how windows work but the paths in your diagnostics use a backslash to a foreslash. Did you try using the backslashes?

Also I understand that this is a local install. Will you be migrating it online or will you be setting up a server locally?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB