Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-11-01 06:40:17

acleese
New Member
Registered: 2009-05-04
Posts: 8

Using other PHP files alongside TXP install...how?

Hi, I’ve been using Textpattern for several years and have recently switched hosts. I was using a PHP-based fundraiser thermometer on my old host by calling it within an <img> tag, and the thermo.php file would dynamically return an image showing how much money has been raised to date in the form of a thermometer. The thermo.php file was located in the public html directory of another site on the same hosting plan.

Now that I’m on Bluehost it won’t work. I believe it’s because all of my domains are now in subfolders of my main domain and my textpattern installation is disabling foreign PHP file. I tried putting the file within the ‘sites/site1/public’ directory and now I get the base thermometer image, but the monetary data is not merged into the image so it looks as if the PHP is only being allowed to execute partially. I would try to debug, but I don’t know PHP very well and have no debugger.

I’ve tried some other dynamic thermometers available on the ‘net but they don’t work very well over the black background of my site.

Are there any workarounds for this?

The thermometer files can be downloaded from here.

Last edited by acleese (2011-11-01 06:42:17)

Offline

#2 2011-11-01 23:32:27

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: Using other PHP files alongside TXP install...how?

and my textpattern installation is disabling foreign PHP file

Why would it do that? I don’t think it’s doing that. I use “foreign” PHP files all the time, in my Textpattern folder, without problems.

Offline

#3 2011-11-02 02:03:13

acleese
New Member
Registered: 2009-05-04
Posts: 8

Re: Using other PHP files alongside TXP install...how?

I read somewhere before that Textpattern disables non-Textpattern PHP files within the same directory to avoid the possibility of their operations accidentally affecting the operation of a Textpattern install. Maybe it’s bogus, but in in this situation it seems that it might be true.

Maybe one of the TXP developers could confirm or deny whether Textpattern somehow impedes non-TXP PHP files…?

Offline

#4 2011-11-02 07:39:39

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Using other PHP files alongside TXP install...how?

Like marc, I also sometimes use external scripts for certain tasks (like image processing) and have no problems. Have you checked that the path to thermo.php is correct and accessible from your site (try putting something else in the same place and check if you can access that) and that the images required for the script are located with the script. Perhaps the server versions have changed and the script uses code that is now deprecated.

That said, you can achieve a progress bar more simply with css. As you know your progress and total values in advance you can use adi_calc (or a short bit of php) to calculate the percentage complete value and then use that to control the length of a nested progress div with css. The principle is a container div with your background graphic and a contained div or span for the progress bar that you give a percentage height or width with a background fill colour or graphic. Here’s a simple example that shows the principle (use height instead of width for a vertical ‘thermometer’) and here’s a flashy example. You’ll find many more via google if you look for “css progress bar” or “pure css bar chart” (think just one bar).


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB