Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
plugin not always working
Hi all,
I am trying to create my first plugin.
The plugin gets images from the db from a specific category. Then i show them on the page.
when i enter the url http://www.example.com/category1 the plugin works great, but when i enter http://www.example.com/category1/ it goes wrong. The images aren’‘t shown. When i put the mouse on the thumbnail i see read this: http://www.example.com/category1/images/18.jpg. When the last ‘/’ isn’t in the URL everything works fine.
Is there anyone how can tell me how to solve this problem?
Thanks in advance.
Kind regards,
Maarten.
Kind regards,
Maarten
Offline
Re: plugin not always working
it goes wrong = the plugin generates an incorrect URL for the image or it doesn’t generate an URL at all.
Please provide more details.
Offline
#3 2008-05-16 04:38:02
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: plugin not always working
You need to be using an absolute URL. The PHP constant hu
contains the full url to the site with an ending slash.
Offline
Re: plugin not always working
Hello guys,
thx for the replies.
What i do to create the url is this:
$thumb = $img_dir.'/' . $id . 't' . $ext;
the variable $thumb
is placed in the href
tag.
I do the same for the full image.
Hope anybody can help.
Kind regards,
Maarten.
Kind regards,
Maarten
Offline
Re: plugin not always working
$thumb = hu. $img_dir.'/' . $id . 't' . $ext;
Offline
Re: plugin not always working
Hello all,
thanks for the answers. Now it works.
What i would like to know is, is hu
a constant variable of textpattern or PHP. If it’s PHP can you tell me were i can find some documentation about constants in PHP?
Thx in advance.
Maarten.
Kind regards,
Maarten
Offline
Re: plugin not always working
It’s a TXP-defined constant (see L85 of textpattern/publish.php).
Constants and how to define them.
Last edited by jm (2008-05-16 21:22:45)
Offline
Pages: 1