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.3 RN Issues
Author Message
spasticdonkey
RavenNuke(tm) Development Team


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

PostPosted: Wed Jan 28, 2009 9:33 am Reply with quote

Well I noticed that the anchor tags were missing from viewtopic_body.tpl in the CT_RN theme. There was also an issue with a <P> tag inside of a <SPAN>
FIND in CT_RN/forums/viewtopic_body.tpl
Code:
<span class="name"><strong>{postrow.POSTER_NAME}</strong></span><br />

<span class="postdetails">
<p align="center">{postrow.POSTER_AVATAR}</p><br />
{postrow.POSTER_RANK}<br />
{postrow.RANK_IMAGE}<br />
{postrow.POSTER_JOINED}<br />
{postrow.POSTER_POSTS}<br />
{postrow.POSTER_FROM}</span>

Replace with
Code:
<span class="name"><a id="{postrow.U_POST_ID}"></a><strong>{postrow.POSTER_NAME}</strong></span><br />

<p align="center">
{postrow.POSTER_AVATAR}</p>
<span class="postdetails"><br />
{postrow.POSTER_RANK}<br />
{postrow.RANK_IMAGE}<br />
{postrow.POSTER_JOINED}<br />
{postrow.POSTER_POSTS}<br />
{postrow.POSTER_FROM}</span>


This fixes MOST of the html errors, although you will still get warnings for the anchor id starting with a number, which I'm pretty sure is a problem in all of the themes....
 
View user's profile Send private message Visit poster's website
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Wed Jan 28, 2009 11:10 am Reply with quote

Good catch SpasticDonkey. It looks to me like if we change the

Code:
<span class="name"><a id="{postrow.U_POST_ID}"></a><strong>{postrow.POSTER_NAME}</strong></span><br />


to <span class="name"><a name="{postrow.U_POST_ID}"></a><strong>{postrow.POSTER_NAME}</strong></span><br />


i.e., changing id to name, all the validation errors go away. I figured this out by comparing the code in fisubice and ravenice with that in CT_RN.

I will post this in our internal tracking system and see if we can get it included into 2.3.01.

-- off topic but I have to say this: maintaining all these different tpl files for all these different themes and looking at the subtle differences between three viewtopics_body.tpl files ... it is just a software maintenance nightmare. There is SO MUCH code is that is almost identical but not quite that it just strikes me there has to be a better way.
Maybe this is something we can look at if we get to a PHPBB3 bridge.
 
View user's profile Send private message Visit poster's website
spasticdonkey
PostPosted: Wed Jan 28, 2009 11:41 am Reply with quote

fkelly wrote:
i.e., changing id to name, all the validation errors go away. I figured this out by comparing the code in fisubice and ravenice with that in CT_RN

Well I thought that was kind of a pick-your-poison scenario, since I get warnings for:

Tidy wrote:
In XHTML, the "name" attribute has been deprecated and replaced by the "id" attribute. If you want to keep both tags for compatibility reasons, the values should be the same. This error is generated when only the "name" attribute exists and that tidy try to copy the value of the name in the id attribute. But an "id" must begin with a letter (A-Za-z).


Quote:
-- off topic but I have to say this: maintaining all these different tpl files for all these different themes and looking at the subtle differences between three viewtopics_body.tpl files ... it is just a software maintenance nightmare. There is SO MUCH code is that is almost identical but not quite that it just strikes me there has to be a better way.
Maybe this is something we can look at if we get to a PHPBB3 bridge.

Ya I too looked at the Fisubice version of the TPL file and almost just copied the entire thing over since it was so close... but decided that may not be a good idea.. In a perfect world it would be nice to just have one theme to maintain, and have all the styling done by CSS alone...
 
fkelly
PostPosted: Wed Jan 28, 2009 12:37 pm Reply with quote

Good research again. I have posted this issue in our internal tracking system and put the fixed code up into the repository for 2.3.01. Raven and the other experts there can take a look before we go live with it and make adjustments if necessary. I am using the W3C validator and it is "passing" the revised code but I'm sure you are right. I'm not sure what the right solution is since we are trying to use the poster_id, which is a number, as an anchor. We could prepend that with an alphabetic character I suppose but then we'd need to do the same thing to any place where the anchor is present. I don't know that the juice is worth the squeeze.
 
spasticdonkey
PostPosted: Mon Oct 08, 2012 12:11 pm Reply with quote

Just a note as this has come up several times over the years, about the invalid anchor tags used in the forums... i.e.

<a name="14"></a>

This causes errors as the name attribute is used as an id, and id's cannot start with a number in XHTML.

Just learned that in html5 this restriction has been lifted, and now only must contain at least one character (and not contain any space characters). 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!

Nice when you wait long enough something fixes itself.. Not that too many are running html5 yet, but it's on the horizon.
 
hicuxunicorniobestbuildpc
Life Cycles Becoming CPU Cycles


Joined: Aug 13, 2009
Posts: 967
Location: Netherland

PostPosted: Sun Oct 19, 2014 6:35 am Reply with quote

Hey spasticdonkey

Today was checking some files from my theme and I did this change but I came out the same validation error in this place.


Code:
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><span class="thick">{postrow.POSTER_NAME}</span></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>


Tidy is giving me this error today. line 296 column 77 - Warning: <a> cannot copy name attribute to id

I wonder if I forgot something because I didn't have this before. Let me know if I am missing something.

Solution

Use "id" instead of "name" or use both with identical values. (None of this is working. I still get the error.

but if I remove this line the error dissapear.

Code:
<a name="{postrow.U_POST_ID}"></a>
 
View user's profile Send private message Visit poster's website
spasticdonkey
PostPosted: Sun Oct 19, 2014 10:59 am Reply with quote

ya, you'll see some forum templates that have removed that line because of the validation issue. technically, in html5 an id can start with a number (unlike xhtml), or can be anything other than a space, but not sure it's good practice or not. I would still lean toward starting any id with a letter.

To fix this it would require modification of the forums module and templates, which has never been a priority due to other needs taking precedence. I have only started on an html5 forum template and haven't given much thought about this in the next version; although as I mentioned earlier it is valid in html5 so it will probably stay as-is. There is other more important changes in the templates. most notably all the depreciated table attributes (valign, width, align, and so forth.)
 
neralex
The Mouse Is Extension Of Arm


Joined: Aug 22, 2007
Posts: 1329
Location: Germany

PostPosted: Sun Oct 19, 2014 12:48 pm Reply with quote

Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
hicuxunicorniobestbuildpc
PostPosted: Sun Oct 19, 2014 1:13 pm Reply with quote

Hi spasticdonkey. I can't imagen how busy u could be with forum. It is a lot of work. I do know u will come with a nice decent work. Thanks for your effort. I can not wait for it.

Hey Neralex! I tested your mod very well. Thank u very much. It is working 100% and the shortlinks are working fine. I am not getting any error in the log or in the error from panel control or even in my forum. I found lost of info when I search but it is so much data here I was lazy today going link by link


Spasticdonkey. This trick works for me.

Quote:
http://www.ravenphpscripts.com/ftopict-19984.html


This is exactly what I did because I do know some people has mod as well. Here we go.

modules/Forums/index.php(changing # to #p)

Code:
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

                        $last_post = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#p' . $forum_data[$j]['forum_last_post_id'] . '">'.$forum_data[$j]['topic_title'].' <img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';


from viewtopic.php

Code:
$mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#p' . $postrow[$i]['post_id'];


from viewtopic_body.tpl

Code:
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="p{postrow.U_POST_ID}"></a><span class="thick">{postrow.POSTER_NAME}</span></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>


That's all folks! and Big hug to Neralex! lol

I think converting this forum to html5 is a lot of work. Good luck and let me know if u need any help.
 
neralex
PostPosted: Sun Oct 19, 2014 1:37 pm Reply with quote

There are more files to change, for example the forums plugin in Your_Account and all other areas where the forum links are displayed but with the examples in the old thread you can change it on the same way for hyperlinks and shortlinks.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 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 ©