Well I can guess why it didn't working. Trying to change the body style after the body tag has been loaded will do nothing.
Put
HTML Code:
<style type="text/css">
body {background-image: url('<?php echo $imgURL; ?>');
background-repeat: repeat;
background-attachment: fixed;}
</style>
In the <head> .. </head> of the page or at least before the <body> loads
And the "$imgURL" will need to be defined before that
PHP Code:
<?php
include("config.php");
$cat = $_GET['id'];
$img = $_GET['img'];
$imgURL = ($PBloc == '1') ? $PBURL.'cat/'.$cat.'/'.$img : $site_url.'cat/'.$cat.'/'.$img;
?>
<style type="text/css">
body {background-image: url('<?php echo $imgURL; ?>');
background-repeat: repeat;
background-attachment: fixed;}
</style>
I do hope that the config.php defines $PBURL and/or $site_url otherwise that will cause you issues as well
Next, this
PHP Code:
'<script type="text/javascript">'."\n".
'<!-- //'."\n".
'document.write(\'<div\'+\' class="js-kit-rating" starColor="Blue" view="combo" path="/'.$uniqueID.'"><\/di\'+\'v>\')'."\n".
'//-->'."\n".
'</script>'."\n".
First, path="/'.$uniqueID.'" should be path="\'.$uniqueID. \'"
Second, <\/di\'+\'v>\' should be <\/div>\'
But worse yet you are going to have javascript write that second <div> in stead of PHP, that is a lot of unneeded code I would say
PHP Code:
if($rate == 1){
echo '<div align="center">
<div class="js-kit-rating" starColor="Blue" view="combo" path="\'.$uniqueID. \'"></div>
</div>
<script src="http://js-kit.com/ratings.js"></script>';
}
And as that last line, was called at the end in another "if", identical to the one above so I moved in to clean up your code
Lastly get rid of all the ."\n" they serve no purpose.