News:

Wondering if this will always be free?  See why free is better.

Main Menu

What is failing on this operation?

Started by Patrick D, February 29, 2012, 05:03:49 PM

Previous topic - Next topic

Patrick D

Hello. I have this operation in a mod:

<search position="before">
<![CDATA[// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>


The code have some error, but i can't see it. The code what i want search in Display.template.php is:

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';


Some solution?
Thanks

Oldiesmann

Quote from: Lord Raider on February 29, 2012, 05:03:49 PM
Hello. I have this operation in a mod:

<search position="before">
<![CDATA[// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>


The code have some error, but i can't see it. The code what i want search in Display.template.php is:

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';


Some solution?
Thanks

The first line of the code you're searching for isn't indented after the <![CDATA[ tag, so it's not finding it.
Michael Eshom
Christian Metal Fans

Patrick D

Quote from: Oldiesmann on March 01, 2012, 12:38:30 AM
Quote from: Lord Raider on February 29, 2012, 05:03:49 PM
Hello. I have this operation in a mod:

<search position="before">
<![CDATA[// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>


The code have some error, but i can't see it. The code what i want search in Display.template.php is:

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';


Some solution?
Thanks

The first line of the code you're searching for isn't indented after the <![CDATA[ tag, so it's not finding it.

Thanks, but i didn't understend a lot...

Te functional code how will be?

Patrick D

I put it:

<file name="$themedir/Display.template.php">
<operation>
<search position="before">
<![CDATA[if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>
</operation>
</file>


It doesn't work.

Matthew K.

Probably should be in coding discussion, as it's not a support request, it's custom code work.
Quote from: Lord Raider on March 01, 2012, 01:18:11 PM
I put it:

<file name="$themedir/Display.template.php">
<operation>
<search position="before">
<![CDATA[if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>
</operation>
</file>


It doesn't work.
And Oldies answer explained it. The original code has tabs ahead of the code, ignoring the tabs will result in the edit not being found. Do a copy paste of the code you want to find into the CDATA tags and that should work for you.

Patrick D

Quote from: тнє נя. on March 01, 2012, 01:19:36 PM
Probably should be in coding discussion, as it's not a support request, it's custom code work.
Quote from: Lord Raider on March 01, 2012, 01:18:11 PM
I put it:

<file name="$themedir/Display.template.php">
<operation>
<search position="before">
<![CDATA[if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>
</operation>
</file>


It doesn't work.
And Oldies answer explained it. The original code has tabs ahead of the code, ignoring the tabs will result in the edit not being found. Do a copy paste of the code you want to find into the CDATA tags and that should work for you.

Original code:

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';


I try it:

<search position="before">
<![CDATA[// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>


And it:

<search position="before">
<![CDATA[ // Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>


doesn't work...

Matthew K.

Okay, let's try a different question then. What "doesn't work"?

Patrick D

When I'm gonna install the modification, it throw error.

Matthew K.

You're going to have to give more details than that. Saying your arm hurts doesn't do anything to have someone help you.

Patrick D


Kermit

Try this one

<file name="$themedir/Display.template.php">
<operation>
<search position="before">
<![CDATA[ // Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>
</operation>
</file>
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Patrick D

Quote from: Kermit on March 01, 2012, 02:49:49 PM
Try this one

<file name="$themedir/Display.template.php">
<operation>
<search position="before">
<![CDATA[ // Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="blurb">', $message['member']['blurb'], '</li>';]]>
</search>
<add>
<![CDATA[
//HELLO
]]>
</add>
</operation>
</file>


The same error...

Kermit

Attach related file then,so we can have a look
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Matthew K.

The whole package would be very useful...

Patrick D

Here the modification:

It's for forums with SMFShop.

forum must be 2.0.x

Kermit

My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Patrick D


Matthew K.

* тнє נя. thinks WinMerge is an extremely helpful tool.

Kermit

Quote from: Lord Raider on March 01, 2012, 03:13:48 PM
Perfect. How u did to repair it?

I can't say exactly where was wrong,but I just took from another mod install.xml file and inserted your codes
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Patrick D


Advertisement: