Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-07-14 17:30:18

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

Re: integrate with poll script

does the poll script work outside txp?

ie create a standard xhtml page with php extension (test.php) and insert the required poll code there…


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

Offline

#14 2010-07-14 17:35:00

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

Re: integrate with poll script

yes, it’s works…


<txp:txp_me />

Offline

#15 2010-07-14 17:44:09

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: integrate with poll script

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. Maybe it’s just a matter to cleverly integrate both databases, let TXP manage the DB connection, and my the poll script play nicely with that situation.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,254
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,254
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

Board footer

Powered by FluxBB