Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1775

PostPosted: Fri Jun 10, 2011 7:50 pm Reply with quote

hey!

i have found in many themes the same xHTML error. i mean the anchor to display the last post in a thread.

example file: themes/fisubice/forums/viewtopic_body.tpl

search:
php Code:
<a name="{postrow.U_POST_ID}"></a>


this is not XHTML valid. in xHTML must start the name with a letter, not with with a number only. after a look into the Forums module, i found a solution for me.

open modules/Forums/index.php and search:
php Code:
$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';

look to: '#'
and change to: '#p'


open modules/Forums/viewforum.php and search:
php Code:
$last_post_url = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $topic_rowset[$i]['topic_last_post_id']) . '#' . $topic_rowset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>';

look to: '#'
and change to: '#p'


open modules/Forums/viewtopic.php and search:
php Code:
$mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#' . $postrow[$i]['post_id'];

look to: '#'
and change to: '#p'


example for fisubice theme:
open themes/fisubice/forums/viewtopic_body.tpl and search:
php Code:
<a name="{postrow.U_POST_ID}"></a>


change it to:
php Code:
<a name="p{postrow.U_POST_ID}"></a>


Edit (19.10.2014): added shortlinks changes

open /ShortLinks/GT-Forums.php

find:
php Code:
'"(?<!/)modules.php\?name=Forums&amp;file=viewtopic&amp;(t|p)=([0-9]*)#([0-9]*)((\")|(&amp;sid=[a-zA-Z0-9]*))"',


change it to:
php Code:
'"(?<!/)modules.php\?name=Forums&amp;file=viewtopic&amp;(t|p)=([0-9]*)#p([0-9]*)((\")|(&amp;sid=[a-zA-Z0-9]*))"',


find:
php Code:
'ftopic\\1-\\2.html#\\3\\4',


change it to:
php Code:
'ftopic\\1-\\2.html#p\\3\\4',


open .htaccess

find Rewrite rule:
apache Code:
RewriteRule ^ftopic(t|p)-([0-9]*).html#([0-9]*) modules.php?name=Forums&file=viewtopic&$1=$2#$3 [L]


change it to:
apache Code:
RewriteRule ^ftopic(t|p)-([0-9]*).html#p([0-9]*) modules.php?name=Forums&file=viewtopic&$1=$2#p$3 [L]



done!


Last edited by neralex on Sun Oct 19, 2014 1:01 pm; edited 4 times in total 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Jun 11, 2011 8:43 pm Reply with quote

Just an fyi (I agree with the approach by the way), this could break existing ShortLinks and/or SE cached links. One might want to figure out a nice .htaccess 301 redirect rule to cover the change once made.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
neralex







PostPosted: Sun Jun 12, 2011 5:47 am Reply with quote

do you have another issue to fix it, without a crash of your shortlinks?
 
montego







PostPosted: Sun Jun 12, 2011 8:16 am Reply with quote

The RN team will have to see this and respond as I cannot speak for them. I just wanted to point out the potential "snags" that will need to be addressed.

BTW, ShortLinks won't "crash" per se, but these links may not be tapped properly. The issue of links not being found is an issue even if one is not using ShortLinks.
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sun Jun 12, 2011 3:23 pm Reply with quote

While I agree in a perfect world this should be addressed, there is unfortunately more involved in fixing this than the template files. These links persist within the forums search functions, as well as nukeFEED, most forum blocks, Your_Account, and probably a multitude of other places Sad

This same discussion came up 2-3 years ago, and at the time I think the consensus was there were more important issues to address. The same probably holds true today considering the amount of work involved and the fact that it is phpbb2 related.

I've noticed some themes have achieved compliance by removing the anchor tags altogether.. Although many links will forward to the page and not jump to the post in question as intended. For me personally, I would rather have it work correctly and tolerate a few minor compliance errors.
 
View user's profile Send private message Visit poster's website
neralex







PostPosted: Mon Jun 13, 2011 2:35 pm Reply with quote

...it's pity, but i can understand that.
 
64bitguy
The Mouse Is Extension Of Arm



Joined: Mar 06, 2004
Posts: 1164

PostPosted: Tue Jun 14, 2011 1:33 pm Reply with quote

neralax... While the comments above are indeed true, don't lose faith in the fix... Some of us changed all of our templates and globals for GoogleTap way (way... ) back to your "p" or even "post" (I think raven changed his in GT like 6 or 7 years ago!).

I'm a compliance nut, so while it may not be adapted into the core RN Solution, having it work and be standards compliant is truly the way to go.

If you were to find them all as well as fix any impacted GT relationships (if there are any) so the links are all functional and compliant from all pages that use them, I would only comment that I doubt the community would feel badly about you doing that work. I would simply continue to modify your original post to add whatever other pages need the fix.

Given evolution directions of the RN solution however, again I would comment that these fixes may not become part of the baseline; but from a user perspective a fix is still a fix!

The SE rule would be a wildcard to replace all # calls with a #p btw.... and the same thing would apply in the outbound GT rule. Smile

Just my two cents.

_________________
Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©