Edit: PR created https://github.com/mybb/mybb/pull/1077 ( i hope that i got it right, if not remove it)
After revamping new thread template i have noticed that w3 validator is returning error reports on few areas. I have double checked my templates i have noticed that smilieinsert_smilie has a tr tag wrapped around it (for 3 smilies in each row), since all hardcoded HTML was pushed into templates i started to digg around and found out that that area still has hardcoded HTML:
Edits:
functions.php
Line 3057 - 3060
should be
and
Line 3070 - 3074
should be
Line 3080 - 3084
Should be
$templatelist updates:
calendar.php
Line 16
Replace
With
editpost.php
Line 14
Replace
with
modcp.php line 22
replace
with
Newreply line 15
Replace
with
Newthread.php line 20
Replace
with
private.php line 18
replace
with
Usercp.php line 23
replace
with
warnings.php line 15
replace
with
New templates
smilieinsert_wraper_start
smilieinsert_wraper_end
smilieinsert_empty
New content in mybb-theme:xml (mybb 1.8 beta 3)
after line 10432
add
<template name="smilieinsert_empty" version="1800"><![CDATA[<td colspan="{$colspan}"> </td></tr>]]></template>
after line 10436
After revamping new thread template i have noticed that w3 validator is returning error reports on few areas. I have double checked my templates i have noticed that smilieinsert_smilie has a tr tag wrapped around it (for 3 smilies in each row), since all hardcoded HTML was pushed into templates i started to digg around and found out that that area still has hardcoded HTML:
Edits:
functions.php
Line 3057 - 3060
if($counter == 0)
{
$smilies .= "<tr>\n";
}
should be
if($counter == 0)
{
$smilies .= $templates->get("smilieinsert_wrapper_start");
$smilies .= "\n";
}
and
Line 3070 - 3074
if($counter == $mybb->settings['smilieinsertercols'])
{
$counter = 0;
$smilies .= "</tr>\n";
}
should be
if($counter == $mybb->settings['smilieinsertercols'])
{
$counter = 0;
$smilies .= $templates->get("smilieinsert_wrapper_end");
$smilies .= "\n";
}
}
Line 3080 - 3084
if($counter != 0)
{
$colspan = $mybb->settings['smilieinsertercols'] - $counter;
$smilies .= "<td colspan=\"{$colspan}\"> </td>\n</tr>\n";
}
Should be
if($counter != 0)
{
$colspan = $mybb->settings['smilieinsertercols'] - $counter;
$smilies .= $templates->get("smilieinsert_empty");
$smilies .= "\n";
}
$templatelist updates:
calendar.php
Line 16
Replace
$templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_dayview_event,calendar_dayview,codebuttons,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty";
With
$templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_dayview_event,calendar_dayview,codebuttons,smilieinsert,smilieinsert_empty,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert_wrapper_end,smilieinsert_wrapper_start";
editpost.php
Line 14
Replace
$templatelist = "editpost,previewpost,changeuserbox,codebuttons,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,post_attachments_attachment_postinsert,post_attachments_attachment_mod_unapprove";
with
$templatelist = "editpost,previewpost,changeuserbox,codebuttons,smilieinsert,smilieinsert_empty,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert_wrapper_end,smilieinsert_wrapper_start,post_attachments_attachment_postinsert,post_attachments_attachment_mod_unapprove";
modcp.php line 22
replace
$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,modcp_announcements_forum_nomod,modcp_announcements_announcement";
with
$templatelist .= ",modcp_warninglogs,modcp_modlogs_result,modcp_editprofile_signature,forumjump_advanced,smilieinsert_empty,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert_wrapper_end,smilieinsert_wrapper_start,modcp_announcements_forum_nomod,modcp_announcements_announcement";
Newreply line 15
Replace
$templatelist .= ",smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,codebuttons,post_attachments_new,post_attachments,post_savedraftbutton,newreply_modoptions,newreply_threadreview_more,newreply_disablesmilies,postbit_online";
with
$templatelist .= ",smilieinsert,smilieinsert_empty,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert_wrapper_end,smilieinsert_wrapper_start,codebuttons,post_attachments_new,post_attachments,post_savedraftbutton,newreply_modoptions,newreply_threadreview_more,newreply_disablesmilies,postbit_online";
Newthread.php line 20
Replace
$templatelist .= ",postbit_attachments_thumbnails,postbit_attachments_images,postbit_attachments,postbit_gotopost,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,attachment_icon,postbit_reputation_formatted_link,global_moderation_notice";
with
$templatelist .= ",postbit_attachments_thumbnails,postbit_attachments_images,postbit_attachments,postbit_gotopost,smilieinsert_empty,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert_wrapper_end,smilieinsert_wrapper_start,attachment_icon,postbit_reputation_formatted_link,global_moderation_notice";
private.php line 18
replace
$templatelist .= ",private_messagebit,codebuttons,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,posticons,private_send_autocomplete,private_messagebit_denyreceipt,private_read_to,postbit_online";
with
$templatelist .= ",private_messagebit,codebuttons,smilieinsert,smilieinsert_empty,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert_wrapper_end,smilieinsert_wrapper_start,posticons,private_send_autocomplete,private_messagebit_denyreceipt,private_read_to,postbit_online";
Usercp.php line 23
replace
$templatelist .= ",codebuttons,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert,usercp_nav_messenger_compose,usercp_options_language_option,usercp_editlists";
with
$templatelist .= ",codebuttons,smilieinsert,smilieinsert_empty,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert_wrapper_end,smilieinsert_wrapper_start,usercp_nav_messenger_compose,usercp_options_language_option,usercp_editlists";
warnings.php line 15
replace
$templatelist .= ",warnings_view_post,warnings_view_user,warnings_view_revoke,warnings_view_revoked,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert,warnings_warn_type_result";
with
$templatelist .= ",warnings_view_post,warnings_view_user,warnings_view_revoke,warnings_view_revoked,smilieinsert,smilieinsert_empty,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,smilieinsert_wrapper_end,smilieinsert_wrapper_start,warnings_warn_type_result";
New templates
smilieinsert_wraper_start
<tr>
smilieinsert_wraper_end
</tr>
smilieinsert_empty
<td colspan="{$colspan}"> </td></tr>
New content in mybb-theme:xml (mybb 1.8 beta 3)
after line 10432
add
<template name="smilieinsert_empty" version="1800"><![CDATA[<td colspan="{$colspan}"> </td></tr>]]></template>
after line 10436
<template name="smilieinsert_wrapper_end" version="1800"><![CDATA[</tr>]]></template>
<template name="smilieinsert_wrapper_start" version="1800"><![CDATA[<tr>]]></template>