Page 1 of 1

Template-Problems, Missing pictures, Code at top of the page

Posted: Mon Nov 24, 2008 7:33 am
by mvwd
:!: Possible Problems:
  • Template-Problems: Standard-Template is working correctly, other templates are making problems like: missing pictures, dynamic menu is not working.... -> your template is the reason.
  • Missing pictures: some pictures are missing -> check the path of this picture. If it looks something like this:

    Code: Select all

    http://www.your-domain-name.com/%3C?=$pth[%27folder%27][%27templateimages%27]?%3Eimagename.gif
    -> in most cases, your template is the reason.
  • Code at top of the page: There is some cryptic (PHP-)code on the top of your page? -> a plugin is the reason.
:?: If you have one or more of this problems, check the following:
  • -> Take a look in your PHP-Configuration (phpinfo()), at the parameter 'short_open_tag'. If this parameter is set to 'Off', this can cause this problems.
    Reason of problems with 'short_open_tag=Off' is not PHP or the parameter itself. Problem is that the short-tags shouldn't be used, but lots of the templates do....
:idea: There are two ways to solve the problem:
  1. Search for short-tags ( <? ) and replace with standard-tags ( <?php ) in template.htm (also in some plugins, take a look in the index.php of each of your plugins).
  2. Change your php.ini 'short_open_tag=On'.
  • -> preferred is solution 1.!
mvwd

Re: Template-Problems, Missing pictures, Code at top of the page

Posted: Tue Nov 25, 2008 10:53 am
by Connie
Hi!

I just studied the possibilities to change the option short_open_tag = off

it is not so easy to change this as with PHP <= 4.0.0 it was possible to change the value of that option even in a script
or in .htaccess or in php.ini

with PHP <5.3.0 it is only changeable in configuration files like php.ini or .htaccess
for example:

Code: Select all

php_flag short_open_tag  on 


but this will work only when the provider allows you

- to add .htaccess-files yourself
- to add individual php.ini to your directories
- or when this value is not set to unchangeable by the admin

Code: Select all

php_admin_flag short_open_tag  on 
so what can you do in such a case when you cannot change the value?

It is not necessary to change the hoster ;=)

have a look at the template.htm in your active template-directory:

if there are entries like this:
<? echo head();?> , you have to change it to that: <?php echo head();?>

if you find entries like this (look at <?= ):
<?=$pth['folder']['templateimages']?> you have to change it to that: <?php echo $pth['folder']['templateimages']?>

so do a backup of the template.htm and then start to change these snippets

good luck!

PS: Links:

http://nl3.php.net/manual/en/configuration.changes.php
http://www.php-center.de/quickref/index.php3

Re: Template-Problems, Missing pictures, Code at top of the page

Posted: Sun Oct 23, 2011 4:22 pm
by amccorm
so what path do I put in the code there to have my template images not on the main server but the template folders?
<?php echo $pth['folder']['templateimages']?>
should it be <?php echo $pth['templates/source']['templateimages']?>

Re: Template-Problems, Missing pictures, Code at top of the page

Posted: Sun Oct 23, 2011 5:24 pm
by cmb
Hi amccorm,
amccorm wrote:so what path do I put in the code there to have my template images not on the main server but the template folders?
Usually you have to change nothing, because the template will load it's images from it's own folder structure (say templates/TEMPLATE_NAME/images/). And AFAIK the path is hardcoded in many templates. But if you want to have the images located in another folder and your template uses $pth['folder']['templateimages'] to refer to the images, it should suffice to insert at top of your template:

Code: Select all

<?php $pth['folder']['templateimages'] = './path/to/image/folder'; ?>
If something is not working in your installation, it's best, if you could explain the problem in more detail, or post a link to the website.

Christoph

Re: Template-Problems, Missing pictures, Code at top of the page

Posted: Wed Nov 02, 2011 2:54 pm
by amccorm
No sorry it was my error, I thought that it was just a one time call in the head or body element, I have added it to every image in the template and it now loads correctly. Is this the proper use of it or have I committed over kill lol

Re: Template-Problems, Missing pictures, Code at top of the page

Posted: Wed Nov 02, 2011 3:49 pm
by cmb
Hi amccorm,
amccorm wrote:I have added it to every image in the template and it now loads correctly. Is this the proper use of it or have I committed over kill
That's exactly the way it's meant to be used. :)

Christoph