Judah Raine
Total posts: 332
22 Сен 2013 05:41

Hi there, I have run into the following:

Parse error: syntax error, unexpected T_STRING in /home/classicr/public_html/components/com_cobalt/fields/url/tmpl/output/bandn.php on line 1

the code in question is:

$value = $this->value;

$options = $this->params->get('params.open_url', 1) ? ' target="_blank"' : '';

echo JHtml:: link('http://' . $value[0]['url'], "<img src='".JURI::root()."images/library/bandn.png'", $options ) ;

?>

I have run this through three different php checkers and all three return a "no error" result, so I'm a little confused.

Also, this is exactly the same as my previous templates which worked (copied and pasted) although they were from cobalt 7, perhaps this is the problem?

Try as I might I cannot find the problem. I'd appreciate your assistance as I have now been at it the whole morning with no result.

Many thanks,

Jude

Последние изменения: 02 Март 2014


Judah Raine
Total posts: 332
23 Сен 2013 23:45

I had another look at this early this morning, and it occurs to me that there is a ">" missing in:

echo JHtml:: link('http://' . $value[0]['url'], "<img src='".JURI::root()."images/library/bandn.png'", $options ) ;

Surely I must "close" the <img src ??

I have tried adding this in various places. I have also tried removing the < altogether but with no response.

My latest foray into the php syntax checker indicates:

Parse error: syntax error, unexpected '<' in [...][...] on line 1 even with the single < removed???

If anyone has just a few moments to look at this I will totally grovel in appreciation.

Thanks,

Jude


Sergey
Total posts: 13,748
24 Сен 2013 05:06

In the code you show everything looks ok. Please attach file.


Judah Raine
Total posts: 332
24 Сен 2013 05:42

Thank you. File attached. I confess I cannot find an error :D


Sergey
Total posts: 13,748
25 Сен 2013 03:17

I do not know what you used but There is no formating. It looks obfuscating. I cannot work with files like this. It should be properly formated with new lines and indentations.


Judah Raine
Total posts: 332
25 Сен 2013 07:59

I used notepad which is what I always use, but I have noticed that with the new version of Filezilla it tends to do that when opening for edit. I will see what I can do.


Judah Raine
Total posts: 332
25 Сен 2013 10:22

I have established that this loss of formatting occurs when I save a file in notepad. Very odd. I have never experienced this before.

In the meantime, I've opened it in a trial php editor and it seems to have saved fine from there once I used the default file to replace all the lines and indentations.

I hope this will prove satisfactory. I am sorry for the previous file, I will try to find out why it's doing that.


Sergey
Total posts: 13,748
26 Сен 2013 01:12

I cannot find any error in this script.


Judah Raine
Total posts: 332
26 Сен 2013 04:01

It's bizarre :D I went ahead and deleted the file. Then I recreated one and pasted in the exact code once again. That seems to have resolved the error as that particular message is not appearing.

I am now getting:

Parse error: syntax error, unexpected T_STRING in /home/classicr/public_html/components/com_cobalt/views/record/tmpl/default_record_library.php on line 1

So I'm off to look at that one. Maybe I'll just do the same thing (delete and recreate) and then see.

Thank you for taking the time to assist me.


Sackgesicht VIP
Total posts: 1,636
26 Сен 2013 04:23

Maybe it is time for you to switch to a "better" editor to support your programming ambitions... :D

Something like Notepad++ or Sublime Text

They can help you with syntax highlighting etc ..


Judah Raine
Total posts: 332
26 Сен 2013 10:50

I will look at sublime text - notepad is what created Sergey's indignation :D


Sackgesicht VIP
Total posts: 1,636
26 Сен 2013 15:40

Actually i was referring to Notepad++ .. check the link above.

You can find an extensive tutorial for Sublime Text here


Judah Raine
Total posts: 332
26 Сен 2013 22:15

Oops. ._. my bad. Too many issues and too little time, I'm afraid. I'll look at them, thank you.


Judah Raine
Total posts: 332
26 Сен 2013 22:57

(Giving notepad++ a whirl, thank you). In the meantime I've traced this error to the table I'm using to define the layout, so it's my bad. No doubt I'll resolve this before I die of old age :D I'll keep working on it.


Judah Raine
Total posts: 332
27 Сен 2013 09:10

Hmmm.... I just cannot seem to make this work. I have traced the error to line 695 which is where my table starts, but no matter what I do it doesn't remove the error code:

Parse error: syntax error, unexpected '<' in /home/classicr/public_html/components/com_cobalt/views/record/tmpl/default_record_library.php on line 695

I've attached the txt file (saved from notepad++, so hopefully it should be in order). I have put off asking for help, was so sure I could resolve it myself with just a little time, but I'm getting nowhere. I hate to bother you, but pretty please, could someone take pity on me...

Thanks so much

Jude


Judah Raine
Total posts: 332
27 Сен 2013 10:55

Please don't worry about this - I found, on going through line by line, that I had duplicated a section of code when copying into notepad++. It appears to be resolved now. thank you

Работает на Cobalt