Signature.xsl

Ok, I solved my big display issue so back to the important stuff.

I want banners in my signature lines.

Here is the signature.xsl code. I would like to change this in a way that will allow my members to link to an outside image and display it here. How can I make that happen?

 

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">

    <xsl:template name="signature">
        <xsl:param name="text" />

                    <div class="forum_default_margin_top">
                        <a href="javascript:void(0);" onclick="jQuery('#forum_signature').toggle(f._speed);">[L[Change Signature]]</a>
                        <div id="forum_signature" style="display:none;">
                            <div class="forum_field_error_message" style="display:none" id="err_signature">[L[Signature text Error]]</div>
                            <input type="text" name="signature" style="width:70%;" value="{$text}" maxlength="100" />
                        </div>
                    </div>

    </xsl:template>

</xsl:stylesheet>

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 10 Feb 2012

I tried just doing an img src tag but it's stripping it out. If I could find out how to lift that restriction, I'd have what I want

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 10 Feb 2012

C'mon you guys! Make my day! Show me how to get this done! BTW, don't forget to show me how to limit the banner size to 468x60....

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 10 Feb 2012

I'm just gonna keep bumpin it and bumpin it and bumpin it....Cool

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 11 Feb 2012

BAM!

Bumped again....

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 11 Feb 2012

There's a reason why you're the only one posting in this topic...

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 11 Feb 2012

Enlighten me...

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Feb 2012

I had my team compile the following possibilities:

  1. The work required is too much for a measly forum topic;
  2. The person who would know what to do is not around;
  3. That person was "transferred away" or eaten by badgers;
  4. Pancakes

Pick one.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 12 Feb 2012

Ok, so what you are saying is that it's a lot of work to allow the signature to not only show text but to display an image?

I don't even care if it can be uploaded there or not. I would be satisfied by just allowing my members to display a banner they uploaded themselves to their photo albums. I know this isn't a big deal. Make the page alloow adding <img src="blahdeblah.blah">

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Feb 2012

Let me ask this. I do not know what you have done so far.

But i found that dolphin does allow html in sigs in the forum. It's just disabled by default. Have you tried turning it on so it will save a HTML sig to the database.

modules\boonex\forum\classes\Forum.php at about line 2018

    function _handleSignature (&$p, $user) {

        if (isset($p['signature']))
            $p['signature'] = trim ($p['signature']);
        if (!isset($p['signature']) || !$p['signature'])
            return true;

        prepare_to_db ($p['signature'], 0); // Change the 0 to a 1 here to allow HTML in the sig.

        return $this->fdb->updateSignature ($p['signature'], $user);
    }


Once you change the 0 to a 1 in that line, you should be able to save HTML sigs.With html allowed in the sig you should be able to also include a image tag as well.

But i do not really know what you have attempted to do so far, or what kind of code edits you have done so far.


https://www.deanbassett.com
Quote · 12 Feb 2012

I haven't changed anything because I didn't know where to start. Is there a way we can limit the html to just the image tag? <img src."">

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Feb 2012

Perhaps. Most likley would require a boat load of coding. I would have to look deeper into the code.

https://www.deanbassett.com
Quote · 12 Feb 2012

I changed the code as directed. Still doesn't allow html...

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Feb 2012

Hmmm. back to the drawing board. Sometimes i hate dolphin. Tracking down some things is a nightmare. And i absolutely hate doing anything with the forums.

https://www.deanbassett.com
Quote · 12 Feb 2012

LOL. I understand. I tried to get someone to help me replace them with phpbb and got even less response than I got to this....

Any help you provide would be much appreciated. Most people don;t see the value in this. My site is like a big trade association for towers and allowing them to display a company banner is a pretty big deal.

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Feb 2012

after making the changes did you recompile the forum lang. I know when i was making some changes to the forum nothing worked till i recompiled the lang.

Quote · 12 Feb 2012

Oh crap..... I knew I forgot something. Let me try again

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Feb 2012

Nope.

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Feb 2012

Well i managed to get it to take HTML. But when it gets displayed, it shows it as is. It's converting the html code such as < to &gt; which obviously does not work.

I still have not found a way to do it.

Oh and signature.xsl is just the form that allows you to change the signature. It's what pops up the box that appears when you click the change signature link. Any edits there will not acomplish anything. It's just a form. So i do know that your looking in the wrong location but so far i have not come up with a solution either.

https://www.deanbassett.com
Quote · 12 Feb 2012

Ok. I'll keep poking around. I do appreciate you all taking a look...

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 13 Feb 2012

Ok, stupid question. I did find that there is a forum.php in the classes folder and a forum.php in the classes/en folder. Making the changes to the en folder yielded results like Deanos.

I still think the signature.xsl file has something to dom with it even though it's a form.

Isn't this line relegating the input as text only?

<input type="text" name="signature" style="width:70%;" value="{$text}" maxlength="100" />

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 13 Feb 2012

no need to make any changes to files in en folders, all the files are created after you compile the en lang in forum.

Quote · 13 Feb 2012

 


<input type="text" name="signature" style="width:70%;" value="{$text}" maxlength="100" />

Thats the form input box. So to some degree yes. It accepts the input. and it is processed in Forum.php.

It is getting stored correctly in the database as well. So again. No changes to the form will help as the data is already getting stored in the database as html with the edit i provided. The problem now is when the forum is pulling that code from the database to display it, it is getting converted. That is what i now have to find and correct.


https://www.deanbassett.com
Quote · 13 Feb 2012

 

no need to make any changes to files in en folders, all the files are created after you compile the en lang in forum.

 Well.....

I made the changes to the forum.php file, compiled it, still wasn't working, went into the en folder, found the forum.php didn't reflect the changes so I made them there as well.

I don't know if I didn't wait long enough or maybe I didn't refresh that file properly but it wasn't changed.

No matter, it's changed now....

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 13 Feb 2012

 

 


<input type="text" name="signature" style="width:70%;" value="{$text}" maxlength="100" />

Thats the form input box. So to some degree yes. It accepts the input. and it is processed in Forum.php.

It is getting stored correctly in the database as well. So again. No changes to the form will help as the data is already getting stored in the database as html with the edit i provided. The problem now is when the forum is pulling that code from the database to display it, it is getting converted. That is what i now have to find and correct.


 Got it. That's why I refer to you...

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 13 Feb 2012

To make html showing as formatted html but not html code you need to change the following code:

<div class="forum_post_signature">
    <xsl:value-of select="user/signature" />
</div> 

to:

<div class="forum_post_signature">
    <xsl:value-of select="user/signature" disable-output-escaping="yes" />
</div> 

in modules/boonex/forum/layout/base/xsl/forum_posts.xsl
and recompile forum lang file.

Well i managed to get it to take HTML. But when it gets displayed, it shows it as is. It's converting the html code such as < to &gt; which obviously does not work.

I still have not found a way to do it.

Oh and signature.xsl is just the form that allows you to change the signature. It's what pops up the box that appears when you click the change signature link. Any edits there will not acomplish anything. It's just a form. So i do know that your looking in the wrong location but so far i have not come up with a solution either.

 

Rules → http://www.boonex.com/terms
Quote · 15 Feb 2012

Thank You!

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 15 Feb 2012

Oh lord. No worky.

Just to make sure. I made the change. Then cleared the cache (all of it), then recompiled the orca forum language file. Then dumped my browser cache and no change.

Then I went back in and put the forum.php file back to default, recompiled the language file and ...

No change.

Well, adding disable-output-escaping="yes" has made it where we don't need to change the forum.php file but we still have the problem of the script not acting on the html code. It's still displaying it as text.

grrrrr.

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 15 Feb 2012

I think there's some confusion here.

I want to allow html in my signature line, not just display it. I am trying to allow my members to add a small image banner to their signature.

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 15 Feb 2012

Tested with

prepare_to_db ($p['signature'], 0); // Change the 0 to a 1 here to allow HTML in the sig.

and

<div class="forum_post_signature">
    <xsl:value-of select="user/signature" disable-output-escaping="yes" />
</div>

recompiled forums and cleared caches manually and html links are working in signature line.

Quote · 15 Feb 2012

Really? how come it won't work for me?

grrrr.

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 16 Feb 2012

Ok. LOLOL!

If I recompile the forum language from the administration screen, it doesn't take. I did it twice and still could not get the HTMLd to work.

After failing at that, I opened the forum itself, clicked on the manage tab and compiled the language from there. Worked perfectly.

Just another wonderful day in the dolphin neighborhood I guess.

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 16 Feb 2012

NOW WE'RE COOKIN!

Ok, next question. (I know, I'm a real bother).

How do we apply the sites built in html protection? Would like to limit the html to href and img tags....??

Thanks in advance!

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 16 Feb 2012

Bumpity bump bump....

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 19 Feb 2012

Ok, want to clean this up. I got it all working on the new 7.1. Also eliminated a problem with the editing of a post by adding the

disable-output-escaping="yes" />

To edit_post.xsl as well. Works like a charm. (gettin dangerous, watch out!)

Now I'd like to secure it a bit. Is there a way we can add the html purifier in here so I can limit what can be done in the sig line? I see a big security issue here that I need to deal with.

All I really want my members to be able to do is add a text line or display a banner image with a link back to their sites. Nothing more..... Any ideas?

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 18 Feb 2013

Change:

    function _handleSignature (&$p, $user)
    {
        if (isset($p['signature']))
            $p['signature'] = trim ($p['signature']);
        if (!isset($p['signature']) || !$p['signature'])
            return true;

        prepare_to_db ($p['signature'], 0);

        return $this->fdb->updateSignature ($p['signature'], $user);
    }

to:

    function _handleSignature (&$p, $user)
    {
        if (isset($p['signature']))
            $p['signature'] = trim ($p['signature']);
        if (!isset($p['signature']) || !$p['signature'])
            return true;

        prepare_to_db ($p['signature'], 1);

        return $this->fdb->updateSignature ($p['signature'], $user);
    }

in modules/boonex/forum/classes/Forum.php file, then recompile forum languages.

Rules → http://www.boonex.com/terms
Quote · 19 Feb 2013

Ok, I don't see the difference. How does this protect me from a user adding destructive html?

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 19 Feb 2013

I did not see a difference at first. But there is one.

This line was changed from this.

prepare_to_db ($p['signature'], 0);

To this.

prepare_to_db ($p['signature'], 1);

But i think that just enables HTML where it was disabled before. So i am not sure what this is going to do to help you. I think he was pointing out how to allow html in your sig by just changing one line. Not sure what else you modified to do that.

But the forums are not my thing, so i don't know. But this seems to be a way of enabling html, not running it through the purifier.

EDIT: Oh lookie. I see i already posted this here back 373 days ago.



https://www.deanbassett.com
Quote · 19 Feb 2013

Yes, that's what I saw. I think he scanned the post not really reading it. I already have it working, just want to secure it up a bit....

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 19 Feb 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.