View Issue Details

IDProjectCategoryView StatusLast Update
0000074XMB1New Featurespublic2008-11-28 22:08
Reporterv0xel Assigned Tomiqrogroove  
PriorityhighSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Target Version1.9.11Fixed in Version1.9.11 
Summary0000074: Links for Each Post
DescriptionEach post should have a permalink. Anchors are already present and used in search results.

Quoted messages should backlink using those anchors by default.
Additional Informationhttp://forums.xmbforum.com/viewthread.php?tid=772736
TagsNo tags attached.
MySQL Version
PHP Version
Web Server
Browser
Flags
Original Reporter
SVN Revision1373

Activities

2008-08-07 08:19

 

poston.patch (624 bytes)   
Index: templates.xmb
===================================================================
--- templates.xmb	(revision 1221)
+++ templates.xmb	(working copy)
@@ -4639,7 +4639,7 @@
 <td valign="top" class="tablerow" style="height: 30px; width: 82%;">
 <table border="0" cellspacing="0" cellpadding="0" width="100%">
 <tr>
-<td class="smalltxt" valign="top">$post[icon] $poston</td>
+<td class="smalltxt" valign="top">$post[icon] <a href=#pid$post[pid]" title="$lang[Permalink to the current post]" rel="nofollow">$poston</a></td>
 <td class="smalltxt" align="right" valign="top">$edit$repquote$reportlink</td>
 </tr>
 </table>
poston.patch (624 bytes)   

v0xel

2008-08-07 08:23

reporter   ~0000024

I've uploaded the easy part of the patch (against rev. 1221). This covers only permalinks around the $poston variable.

Question:

I've used $lang["Permalink to the current post"] as the title tag in the link. Is there anything else that needs to be done, in order for this to show up in the translations templates?

2008-08-07 08:50

 

permalinks_part2.patch (788 bytes)   
Index: post.php
===================================================================
--- post.php	(revision 1221)
+++ post.php	(working copy)
@@ -557,7 +557,7 @@
 
                 $quoteperms = checkForumPermissions($thaquote);
                 if ($quoteperms[X_PERMS_VIEW] And $quoteperms[X_PERMS_USERLIST]) {
-                    $message = "[quote][i]{$lang['origpostedby']} {$thaquote['author']}[/i]\n".rawHTMLmessage(stripslashes($thaquote['message']))." [/quote]"; //Messages are historically double-quoted.
+                    $message = "[quote][i][url=#pid{$thaquote['pid']}]{$lang['origpostedby']} {$thaquote['author']}[/url][/i]\n".rawHTMLmessage(stripslashes($thaquote['message']))." [/quote]"; //Messages are historically double-quoted.
                 }
             }
 
permalinks_part2.patch (788 bytes)   

v0xel

2008-08-07 08:53

reporter   ~0000025

I've added a second part of the patch, which adds backlinks to repquote messages.

I've tested this a little bit (and it works), but it needs further testing, and review.

miqrogroove

2008-08-07 12:14

administrator   ~0000027

Last edited: 2008-08-07 12:14

It's a good start. Before we proceed on this feature, we should discuss adding new link patterns to the BBCode system. My goals are:

1. The syntax should be as short as practically possible.

2. The code should be portable, that is, it should work from any thread or forum for any user on the same board. Permalinks do not need to be tolerant of thread moves because XMB1 doesn't support this

3. The URL replacement should be an anchor wrapped around the subject, or optionally the 'origpostedby' line, of the linked post. Adding lastpost.gif after the text might be a nice visual touch.

4. The query count for these links should be no more than 2 for displaying an entire thread. One way to accomplish this is to replace the short syntax with an expanded version when the post is saved or previewed.

Examples

Pattern 1: Quote BBCode in post.php
[quote=12345]Quoted text in here.[/quote]
Replacement at save:
[quote=12345&tid=321&author={$plink['author']}]Quoted text in here.[/quote]

Pattern 2: URL BBcode in post.php
[url]#pid12345[/url]
Replacement at save:
[url=viewthread.php?tid=321#pid12345]{$plink['subject']}[/url]

Pattern 3: Quote BBCode in functions.inc.php
[quote=12345&tid=321&author={$plink['author']}]Quoted text in here.[/quote]
Replacement before other bbcodes are parsed:
'[quote][url="'.$full_url.'viewthread.php?tid='.$tid.'#pid'.$pid.']'.$lang['origpostedby'].' '.$author.'[/url]Quoted text in here.[/quote]'

miqrogroove

2008-08-07 12:30

administrator   ~0000028

Pattern 4: URL BBCode in functions.inc.php
[url=({$full_url})?viewthread\.php\?tid=321#pid12345]Subject text in here.[/url]
Replacement at view:
'<a href="'.$full_url.'viewthread.php?tid='.$tid.$pagearg.'#pid'.$pid.'">Subject text in here <img src="images/theme/lastpost.gif" /></a>'

miqrogroove

2008-11-19 22:02

administrator   ~0000070

Many of the details changed to fit the situation, but overall I think you will like the results. Feel free to see this revision in SVN or play with it at the alpha board.

Issue History

Date Modified Username Field Change
2008-07-25 17:06 miqrogroove New Issue
2008-07-25 17:06 miqrogroove Reporter miqrogroove => v0xel
2008-07-25 17:06 miqrogroove Projection none => minor fix
2008-07-25 17:11 miqrogroove Status new => acknowledged
2008-08-07 08:19 v0xel File Added: poston.patch
2008-08-07 08:23 v0xel Note Added: 0000024
2008-08-07 08:50 v0xel File Added: permalinks_part2.patch
2008-08-07 08:53 v0xel Note Added: 0000025
2008-08-07 12:14 miqrogroove Note Added: 0000027
2008-08-07 12:14 miqrogroove Note Edited: 0000027
2008-08-07 12:30 miqrogroove Note Added: 0000028
2008-08-23 19:24 miqrogroove Status acknowledged => confirmed
2008-11-19 17:36 miqrogroove Status confirmed => assigned
2008-11-19 17:36 miqrogroove Assigned To => miqrogroove
2008-11-19 22:02 miqrogroove SVN Revision => 1373
2008-11-19 22:02 miqrogroove Note Added: 0000070
2008-11-19 22:02 miqrogroove Status assigned => resolved
2008-11-19 22:02 miqrogroove Fixed in Version => 1.9.11
2008-11-19 22:02 miqrogroove Resolution open => fixed
2008-11-28 22:08 miqrogroove Status resolved => closed