tags:

views:

56

answers:

2

i am working on an an options panel for a wordpress theme. this problem has started since i tried trying to add jquery, but it doesn't seem like it should be a jquery problem.. and doesn't go away when i delete all my jquery scripts.

anyway PHP determines whether the page was saved, reset, etc and displays an appropriate message at the top of the page. but for some reason, my div (Which ought to appear first) is appearing after my h2 in the #info div that is several lines below. it isn't a css abs positioning issue as when i view source the #message div is contained w/in #info even though it appears first in the and as far as i can tell all my div tags are opened and closed correctly. this behavior resolves if i get rid of the 'updated' class. i don't desperately need to maintain that class (i can just create a new one w/ similar attributes) but i am baffled as to why the heck the php is firing incorrectly.

<?php
  if ($_REQUEST['saved']) {
    echo '<div id="message" class="updated fade"><p><strong>' . $my_themename . ' ' . __('settings saved.', 'thematic') . '</strong></p></div>';
  }
  if ($_REQUEST['reset']) {
    echo '<div id="message" class="updated fade"><p><strong>' . $my_themename . ' ' . __('settings reset.', 'thematic') . '</strong></p></div>';
  }
  if ($_REQUEST['reset_widgets']) {
    echo '<div id="message" class="updated fade"><p><strong>' . $my_themename . ' ' . __('widgets reset.', 'thematic') . '</strong></p></div>';
  }
  if ($_REQUEST['error']) {
    echo '<div id="message" class="updated fade"><p><strong>The file you submitted was not a valid image type.</strong></p></div>';
  }
  if ($_REQUEST['imgremoved']) {
      echo '<div id="message" class="updated fade"><p><strong>'. __('Image Removed') .'</strong></p></div>';
  }
  if ($_REQUEST['imgsaved']) {
      echo '<div id="message" class="updated fade"><p><strong>'. __('Image Uploaded') .'</strong></p></div>';
  } 
?>
<div id="saved"></div>
<div id="header" class="clearfix">
<div id="themelogo"><img src="<?php echo CHILDTHEME_URI .'/functions/css/images/logo.png';?> " / ></div>
<div id="info">
<h1><?php echo $my_themename; ?></h1>
<h2>Built on the Thematic Theme Framework</h2>
</div>

</div>
A: 

One thing that might be worth looking into is whether you are including css files from the jqueryui library. I know I have on several occasions experienced formatting issues when including that css.

spinon
man i was hoping that was it. just commented it out and it made no change.
helgatheviking
A: 

Not really a solution for the reported behaviour, but noticed a small section of code which may be better expressed differently:

<div id="themelogo"><img src="<?php echo CHILDTHEME_URI .'/functions/css/images/logo.png';?> " / ></div>

Might be better as:

<div id="themelogo"><img src="<?php echo CHILDTHEME_URI; ?>'/functions/css/images/logo.png" /></div>

Just one of those things - I am used to debugging code by reading it and trying to optimise it as I go. I presume the affected file is not available anywhere online for us to review and see the error for ourselves?

Lucanos
thanks for the tip. i am learning on the fly as i frankenstein several concepts together. the affected file is indeed on a local host. but i zipped up my theme and posted it : http://www.sendspace.com/file/zxr4bf there are a bunch of repeat files in the admin folder (backups, different tries etc) but the one that is giving me trouble is return-true-admin-ajax-test.php (admin-panel-ajax.php may also be having an effect since that is the one with all the jquery)
helgatheviking
I just downloaded the files you mentioned, and ran them through a local install of XAMPP. I had to remove alot of the code, as it was all dependent on a framework (Wordpress or similar) and as I was looking at this module alone, alot of the functions do not exist. ANYWAY, at it's most basic level, this code behaves as it should. If you would like another set of eyes to look at the problem, as it exists, feel free to shoot me an email at [email protected] with the details.
Lucanos