-3

Hello I am hoping someone can help I am trying to use Syntax Highlighter on a web page of mine. I have followed the installation instructions by extracting the following files:

shCore.css
shThemeDefault.css
shCore.js
shBrushPowerShell.js

Basically all I can see is the code from the script file but it isn't highlighted. Here is my code on script.php

<html>
<head>
<link href="../stylesheets/shCore.css" rel="stylesheet" type="text/css" />
<link href="../stylesheets/shThemeDefault.css" rel="stylesheet" type="text/css" />
</head>

<body>
<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shBrushPowerShell.js"></script>
<script type="text/javascript">
     SyntaxHighlighter.all()
</script>

<pre class="brush: ps">
<?php
    $filename = $_GET['file'];
    $filecontent = file_get_contents($filename);
    echo $filecontent;
?>
</pre>
</body>

</html>

Can anyone see what the problem is here? I am a bit stuck, have I missed something fundamental? Any help would be greatly appreciated.

PS - all links to CSS and JS files are working as tested clicking them in "View Source" in chrome.

d4rkcell
  • 147
  • 3
  • 4
  • 11

2 Answers2

1

Can you try to put the following just before the closing body tag </body>

<script type="text/javascript">
     SyntaxHighlighter.all()
</script>

And the following code in the head

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shBrushPowerShell.js"></script>
CMPS
  • 7,733
  • 4
  • 28
  • 53
  • Hi Amir, thanks for replying. Indeed, this is how I had it to begin with, it makes no difference still the same result. Can see the code to be highlighted but it isn't highlighted. – d4rkcell Jun 22 '14 at 20:12
  • Hi Amir, thanks, I have never used jsfiddle here's my attempt. http://jsfiddle.net/29rgp/ - PS adding the script tags to the header also made no difference. – d4rkcell Jun 23 '14 at 04:47
0

I figured this out.

I had only uploaded the files mentioned above. I uploaded the whole of the zip file and used absolute URL's in the and tabs and it started working. Thanks to Amir for trying to help.

d4rkcell
  • 147
  • 3
  • 4
  • 11