forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: mxm1981 on July 13, 2006, 12:49:00 am

Title: Little underscore after name of comment poster
Post by: mxm1981 on July 13, 2006, 12:49:00 am
Hi,

i've been using coppermine for quite a while and I'm redesigning my customised water drop theme. Among other things, I want to underline all links (<a> tags), but as it seems, the underscore appears where it shouldn't do. For example, if I click on a picture and view the comments there is a little underscore after the name of the poster, e.g. "Mike_ (213.101.226.2)". I can only get rid of this by not underlining <a> tags. I also found out by viewing the html-source, that the code goes like this:

<td class="tableh2_compact" nowrap="nowrap">
                                        <b>sadome</b><a name="comment1234">&nbsp;</a>

                                                                                 (213.101.226.2)

</td>


I suppose that the "&nbsp;" between the <a> tags is responsible for that. So, how can I change the code from "&nbsp;</a>" to "</a>&nbsp;".

I tried to figure it out by looking in the displayimage.php, but I can't fix it as I have only very basic php knowledge and it's just to complex for me...

I appreciate any help!!

My coppermine version: 1.4.8
you can have a look at the problem here: http://www.germangothicmodels.de/gallery/displayimage.php?album=lastup&cat=42&pos=3 (http://www.germangothicmodels.de/gallery/displayimage.php?album=lastup&cat=42&pos=3)

thanks
Matt
Title: Re: Little underscore after name of comment poster
Post by: Nibbler on July 13, 2006, 01:17:56 am
Copy the template you want to modify from themes/sample/theme.php to themes/yourtheme/theme.php and modify your copy.

Code: [Select]
// HTML template for the display of comments
$template_image_comments = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">

        <tr>
                <td>
                        <table width="100%" cellpadding="0px" cellspacing="0px">
                           <tr>
                                <td class="tableh2_compact" nowrap="nowrap">
                                        <b>{MSG_AUTHOR}</b><a name="comment{MSG_ID}">&nbsp;</a>
<!-- BEGIN ipinfo -->
                                                                                 ({IP})
<!-- END ipinfo -->
</td>


                                <td class="tableh2_compact" align="right" width="100%">
<!-- BEGIN report_comment_button -->
     <a href="report_file.php?pid={PID}&amp;msg_id={MSG_ID}&amp;what=comment" title="{REPORT_COMMENT_TITLE}"><img src="images/report.gif" width="16px" height="16px" border="0px" align="middle" alt="{REPORT_COMMENT_TITLE}" /></a>
<!-- END report_comment_button -->


<!-- BEGIN buttons -->
                                        <a href="javascript:;" onclick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0px" align="middle" alt="" /></a>
                                        <a href="delete.php?msg_id={MSG_ID}&amp;what=comment"  onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0px" align="middle" /></a>
<!-- END buttons -->
                                </td>
                                <td class="tableh2_compact" align="right" nowrap="nowrap">
                                        <span class="comment_date">[{MSG_DATE}]</span>
                                </td></tr>
                        </table>
                </td>
        </tr>
        <tr>
                <td class="tableb_compact">
                        <div id="cbody{MSG_ID}" style="display:block">
                                {MSG_BODY}
                        </div>
                        <div id="cedit{MSG_ID}" style="display:none">
<!-- BEGIN edit_box_smilies -->
                                <form name="f{MSG_ID}" method="post" action="db_input.php">
                                    <table width="100%" cellpadding="0px" cellspacing="0px">
                                        <tr>
                                            <td valign="top">
                                                <input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
                                                <input type="hidden" name="event" value="comment_update" />
                                                <input type="hidden" name="msg_id" value="{MSG_ID}" />
                                            </td>
                                            <td width="70%">
                                                <textarea cols="40" rows="2" class="textinput" name="msg_body" onselect="storeCaret_f{MSG_ID}(this);" onclick="storeCaret_f{MSG_ID}(this);" onkeyup="storeCaret_f{MSG_ID}(this);" style="width:99%;">{MSG_BODY_RAW}</textarea>
                                            </td>
                                            <td align="right">
                                                <input type="submit" class="comment_button" name="submit" value="{OK}" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="3">
                                                <img src="images/spacer.gif" width="1px" height="2px" />
                                                <br />
                                            </td>
                                        </tr>
                                    </table>
                                </form>
                                {SMILIES}
<!-- END edit_box_smilies -->
<!-- BEGIN edit_box_no_smilies -->
                                <form name="f{MSG_ID}" method="post" action="db_input.php">
                                    <table width="100%" cellpadding="0px" cellspacing="0px">
                                        <tr>
                                            <td valign="top">
                                                <input type="hidden" name="event" value="comment_update" />
                                                <input type="hidden" name="msg_id" value="{MSG_ID}" />
                                                <input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
                                            </td>
                                            <td width="70%">
                                                <textarea cols="40" rows="2" class="textinput" name="msg_body" style="width:99%;">{MSG_BODY_RAW}</textarea>
                                            </td>
                                            <td align="right">
                                                <input type="submit" class="comment_button" name="submit" value="{OK}" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="3">
                                                <img src="images/spacer.gif" width="1px" height="2px" />
                                                <br />
                                            </td>
                                        </tr>
                                    </table>
                                </form>
<!-- END edit_box_no_smilies -->
                        </div>
                </td>
        </tr>
</table>
EOT;
Title: Re: Little underscore after name of comment poster
Post by: Joachim Müller on July 13, 2006, 07:03:59 am
IP address of the poster of a comment will only be visible for you as admin anyway.
An underscore is actually a character, underlining is a formating. Those two things differ and should not be mixed up.
Title: Re: Little underscore after name of comment poster
Post by: mxm1981 on July 13, 2006, 12:03:51 pm
Thank you Nibbler, it works.

I just copied the code you suggested from the theme.php of the sample folder into the theme.php in the water drop folder. To make it work i changed the following line:

Code: [Select]
<b>{MSG_AUTHOR}</b><a name="comment{MSG_ID}">&nbsp;</a>
to

Code: [Select]
<b>{MSG_AUTHOR}</b><a name="comment{MSG_ID}"></a>&nbsp;
regards,
Matt
Title: Re: Little underscore after name of comment poster
Post by: Joachim Müller on July 13, 2006, 01:47:53 pm
OK, you actually discovered a bug (although only a cosmetical one). Thanks for your report and sharing your solution. Moving thread to bugs board.
Title: Re: Little underscore after name of comment poster
Post by: Joachim Müller on July 13, 2006, 07:08:16 pm
Fixed this both in stable and devel on my local copy (haven't committed though because sf.net is down due to maintenance works). Will commit tomorrow.
Title: Re: Little underscore after name of comment poster
Post by: Joachim Müller on July 18, 2006, 04:18:16 pm
Committed to stable and devel branch of svn.
Fix will go into cpg1.4.9 and cpg1.5.0.