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! |
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! |
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! |
I'm just gonna keep bumpin it and bumpin it and bumpin it.... http://towtalk.net ... Hosted by Zarconia.net! |
http://towtalk.net ... Hosted by Zarconia.net! |
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 |
http://towtalk.net ... Hosted by Zarconia.net! |
I had my team compile the following possibilities:
- The work required is too much for a measly forum topic;
- The person who would know what to do is not around;
- That person was "transferred away" or eaten by badgers;
- Pancakes
Pick one.
BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin |
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! |
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 |
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! |
Perhaps. Most likley would require a boat load of coding. I would have to look deeper into the code. https://www.deanbassett.com |
I changed the code as directed. Still doesn't allow html... http://towtalk.net ... Hosted by Zarconia.net! |
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 |
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! |
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. |
Oh crap..... I knew I forgot something. Let me try again http://towtalk.net ... Hosted by Zarconia.net! |
http://towtalk.net ... Hosted by Zarconia.net! |
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 > 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 |
Ok. I'll keep poking around. I do appreciate you all taking a look... http://towtalk.net ... Hosted by Zarconia.net! |
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! |
no need to make any changes to files in en folders, all the files are created after you compile the en lang in forum. |
<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 |
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! |
<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! |
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 > 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 |
http://towtalk.net ... Hosted by Zarconia.net! |
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! |
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! |
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.
|
Really? how come it won't work for me?
grrrr.
http://towtalk.net ... Hosted by Zarconia.net! |
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! |
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! |
http://towtalk.net ... Hosted by Zarconia.net! |
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! |
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 |
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! |
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 |
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! |