Forums / Cotonti / Support / How do I replace a tag with an image?

Kingsley
#1 2009-10-21 02:01
I've tried it with this:

<a href="{FORUMS_POSTS_ROW_QUOTE}"><img border="0" src="skins/{PHP.skin}/img/system/button-quote.gif"/></a>

but then i get the image and next to it: Quote"/> :(
SunChase
#2 2009-10-21 02:19
The simplest way is to do a corehack:

line 619(system/core/forums/forums.posts.inc.php)


from:
$rowquote  = ($usr['id']>0) ? "<a href=\"".sed_url('forums', "m=posts&s=".$s."&q=".$q."&quote=".$row['fp_id']."&n=last", "#np")."\">".$L['Quote']."</a>" : "&nbsp;";
to:
$rowquote  = ($usr['id']>0) ? sed_url('forums', "m=posts&s=".$s."&q=".$q."&quote=".$row['fp_id']."&n=last", "#np") : "&nbsp;";

or change the $L['Quote'] to <img border="0" src="skins/{PHP.skin}/img/system/button-quote.gif"/>
like this:
$rowquote  = ($usr['id']>0) ? "<a href=\"".sed_url('forums', "m=posts&s=".$s."&q=".$q."&quote=".$row['fp_id']."&n=last", "#np")."\"><img border="0" src="skins/{PHP.skin}/img/system/button-quote.gif"/></a>" : "&nbsp;";
[url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
Kingsley
#3 2009-10-21 02:20
Well, I'm no fan of core hacks, for all the obvious reasons..
SunChase
#4 2009-10-21 02:27
or a corehack or a plugin with hook to this parameter...
the html wont understand if you write that string directly
[url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
GHengeveld
#5 2009-10-21 02:53
Images should not be included in core. Its best to use a resource string for this (similar to the language system). In system/resources.php you should add a resource string for the $rowquote value. It should be the original value by default (<a href=...) and you can overwrite it in your skinname/skinname.php file with your own value.
SunChase
#6 2009-10-21 03:00
oops.Forgot about that... :/
[url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
Kingsley
#7 2009-10-21 04:25
# Koradhil : Images should not be included in core. Its best to use a resource string for this (similar to the language system). In system/resources.php you should add a resource string for the $rowquote value. It should be the original value by default (<a href=...) and you can overwrite it in your skinname/skinname.php file with your own value.

Can you explain to me how? Am not that familiar with php..

thank you.
SunChase
#8 2009-10-21 18:56
insert this :
$L['Quote'] = '<img src="skins/{PHP.skin}/img/system/button-quote.gif"/>';
in skinname.en.lang.php
[url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
GHengeveld
#9 2009-10-22 00:54
Changing your language file will work but it's not the nicest way to do it, because the language file is meant to be used only for text, not for html code. The only right way to do it is through the resource string system, so that's what I've done. I've fixed this in trunk, see changeset 1001 and 1002.

If you want to use an image instead of the default text, put the following line in your skinname/skinname.php file.

$R['frm_rowquote'] = '<a href="{$url}"><img src="skins/'.$skin.'/img/system/button-quote.gif"></a>';
This post was edited by Koradhil (2009-10-22 01:05, 15 years ago)
donP
#10 2009-10-26 16:34
# Koradhil : Images should not be included in core. Its best to use a resource string for this (similar to the language system). In system/resources.php you should add a resource string for the $rowquote value. It should be the original value by default (<a href=...) and you can overwrite it in your skinname/skinname.php file with your own value.

I haven't got system/resources.php in my Cotonti package... :/
in [color=#729FCF][b]BLUES[/b][/color] I trust
Kingsley
#11 2010-08-08 17:10
# Koradhil :
$R['frm_rowquote'] = '<a href="{$url}"><img src="skins/'.$skin.'/img/system/button-quote.gif"></a>';

is there something in this code that I must change? still get Quote"> as a result.