Browse Source

SMF is HTML5 now, so SSI should be as well.

Signed-off-by: Michael Eshom <[email protected]>
Michael Eshom 10 years ago
parent
commit
ba0278dbec
3 changed files with 75 additions and 75 deletions
  1. 33 33
      SSI.php
  2. 4 4
      ssi_examples.php
  3. 38 38
      ssi_examples.shtml

+ 33 - 33
SSI.php

@@ -400,19 +400,19 @@ function ssi_queryPosts($query_where = '', $query_where_params = array(), $query
 		return $posts;
 
 	echo '
-		<table border="0" class="ssi_table">';
+		<table style="border: none" class="ssi_table">';
 	foreach ($posts as $post)
 		echo '
 			<tr>
-				<td align="right" valign="top" nowrap="nowrap">
+				<td style="text-align: right; vertical-align: top; white-space: nowrap">
 					[', $post['board']['link'], ']
 				</td>
-				<td valign="top">
+				<td style="vertical-align: top">
 					<a href="', $post['href'], '">', $post['subject'], '</a>
 					', $txt['by'], ' ', $post['poster']['link'], '
 					', $post['is_new'] ? '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><span class="new_posts">' . $txt['new'] . '</span></a>' : '', '
 				</td>
-				<td align="right" nowrap="nowrap">
+				<td style="text-align: right; white-space: nowrap">
 					', $post['time'], '
 				</td>
 			</tr>';
@@ -556,19 +556,19 @@ function ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boar
 		return $posts;
 
 	echo '
-		<table border="0" class="ssi_table">';
+		<table style="border: none" class="ssi_table">';
 	foreach ($posts as $post)
 		echo '
 			<tr>
-				<td align="right" valign="top" nowrap="nowrap">
+				<td style="text-align: right; vertical-align: top; white-space: nowrap">
 					[', $post['board']['link'], ']
 				</td>
-				<td valign="top">
+				<td style="vertical-align: top">
 					<a href="', $post['href'], '">', $post['subject'], '</a>
 					', $txt['by'], ' ', $post['poster']['link'], '
 					', !$post['is_new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><span class="new_posts">' . $txt['new'] . '</span></a>', '
 				</td>
-				<td align="right" nowrap="nowrap">
+				<td style="text-align: right; white-space: nowrap">
 					', $post['time'], '
 				</td>
 			</tr>';
@@ -654,16 +654,16 @@ function ssi_topBoards($num_top = 10, $output_method = 'echo')
 	echo '
 		<table class="ssi_table">
 			<tr>
-				<th align="left">', $txt['board'], '</th>
-				<th align="left">', $txt['board_topics'], '</th>
-				<th align="left">', $txt['posts'], '</th>
+				<th style="text-align: left">', $txt['board'], '</th>
+				<th style="text-align: left">', $txt['board_topics'], '</th>
+				<th style="text-align: left">', $txt['posts'], '</th>
 			</tr>';
 	foreach ($boards as $board)
 		echo '
 			<tr>
 				<td>', $board['link'], $board['new'] ? ' <a href="' . $board['href'] . '"><span class="new_posts">' . $txt['new'] . '</span></a>' : '', '</td>
-				<td align="right">', comma_format($board['num_topics']), '</td>
-				<td align="right">', comma_format($board['num_posts']), '</td>
+				<td style="text-align: right">', comma_format($board['num_topics']), '</td>
+				<td style="text-align: right">', comma_format($board['num_posts']), '</td>
 			</tr>';
 	echo '
 		</table>';
@@ -737,18 +737,18 @@ function ssi_topTopics($type = 'replies', $num_topics = 10, $output_method = 'ec
 	echo '
 		<table class="ssi_table">
 			<tr>
-				<th align="left"></th>
-				<th align="left">', $txt['views'], '</th>
-				<th align="left">', $txt['replies'], '</th>
+				<th style="text-align: left"></th>
+				<th style="text-align: left">', $txt['views'], '</th>
+				<th style="text-align: left">', $txt['replies'], '</th>
 			</tr>';
 	foreach ($topics as $topic)
 		echo '
 			<tr>
-				<td align="left">
+				<td style="text-align: left">
 					', $topic['link'], '
 				</td>
-				<td align="right">', comma_format($topic['num_views']), '</td>
-				<td align="right">', comma_format($topic['num_replies']), '</td>
+				<td style="text-align: right">', comma_format($topic['num_views']), '</td>
+				<td style="text-align: right">', comma_format($topic['num_replies']), '</td>
 			</tr>';
 	echo '
 		</table>';
@@ -898,7 +898,7 @@ function ssi_queryMembers($query_where = null, $query_where_params = array(), $q
 	// Draw the table!
 	if ($output_method == 'echo')
 		echo '
-		<table border="0" class="ssi_table">';
+		<table style="border: none" class="ssi_table">';
 
 	$query_members = array();
 	foreach ($members as $member)
@@ -914,7 +914,7 @@ function ssi_queryMembers($query_where = null, $query_where_params = array(), $q
 		if ($output_method == 'echo')
 			echo '
 			<tr>
-				<td align="right" valign="top" nowrap="nowrap">
+				<td style="text-align: right; vertical-align: top; white-space: nowrap">
 					', $query_members[$member]['link'], '
 					<br>', $query_members[$member]['blurb'], '
 					<br>', $query_members[$member]['avatar']['image'], '
@@ -1043,21 +1043,21 @@ function ssi_login($redirect_to = '', $output_method = 'echo')
 
 	echo '
 		<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
-			<table border="0" cellspacing="1" cellpadding="0" class="ssi_table">
+			<table style="border: none" class="ssi_table">
 				<tr>
-					<td align="right"><label for="user">', $txt['username'], ':</label>&nbsp;</td>
+					<td style="text-align: right; border-spacing: 1"><label for="user">', $txt['username'], ':</label>&nbsp;</td>
 					<td><input type="text" id="user" name="user" size="9" value="', $user_info['username'], '" class="input_text"></td>
 				</tr><tr>
-					<td align="right"><label for="passwrd">', $txt['password'], ':</label>&nbsp;</td>
+					<td style="text-align: right; border-spacing: 1"><label for="passwrd">', $txt['password'], ':</label>&nbsp;</td>
 					<td><input type="password" name="passwrd" id="passwrd" size="9" class="input_password"></td>
 				</tr>';
 
 	// Open ID?
 	if (!empty($modSettings['enableOpenID']))
 		echo '<tr>
-					<td colspan="2" align="center"><strong>&mdash;', $txt['or'], '&mdash;</strong></td>
+					<td colspan="2" style="text-align :center"><strong>&mdash;', $txt['or'], '&mdash;</strong></td>
 				</tr><tr>
-					<td align="right"><label for="openid_url">', $txt['openid'], ':</label>&nbsp;</td>
+					<td style="text-align: right"><label for="openid_url">', $txt['openid'], ':</label>&nbsp;</td>
 					<td><input type="text" name="openid_identifier" id="openid_url" class="input_text openid_login" size="17"></td>
 				</tr>';
 
@@ -2026,23 +2026,23 @@ function ssi_recentAttachments($num_attachments = 10, $attachment_ext = array(),
 
 	// Give them the default.
 	echo '
-		<table class="ssi_downloads" cellpadding="2">
+		<table class="ssi_downloads">
 			<tr>
-				<th align="left">', $txt['file'], '</th>
-				<th align="left">', $txt['posted_by'], '</th>
-				<th align="left">', $txt['downloads'], '</th>
-				<th align="left">', $txt['filesize'], '</th>
+				<th style="text-align: left; padding: 2">', $txt['file'], '</th>
+				<th style="text-align: left; padding: 2">', $txt['posted_by'], '</th>
+				<th style="text-align: left; padding: 2">', $txt['downloads'], '</th>
+				<th style="text-align: left; padding: 2">', $txt['filesize'], '</th>
 			</tr>';
 	foreach ($attachments as $attach)
 		echo '
 			<tr>
 				<td>', $attach['file']['link'], '</td>
 				<td>', $attach['member']['link'], '</td>
-				<td align="center">', $attach['file']['downloads'], '</td>
+				<td style="text-align: center">', $attach['file']['downloads'], '</td>
 				<td>', $attach['file']['filesize'], '</td>
 			</tr>';
 	echo '
 		</table>';
 }
 
-?>
+?>

+ 4 - 4
ssi_examples.php

@@ -413,8 +413,8 @@ function template_ssi_above()
 {
 	global $settings, $context, $scripturl;
 
-	echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+	echo '<!DOCTYPE html>
+<html>
 	<head>
 		<title>SMF 2.1 Alpha 1 SSI.php Examples</title>
 		<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/index.css?alp21">
@@ -555,8 +555,8 @@ function template_homepage_sample1($method = 'source')
 {
 	global $user_info, $boarddir;
 
-	$header = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+	$header = '<!DOCTYPE html>
+<html>
 <head>
 	<title>SSI.php example for home page</title>
 	<style type="text/css">

+ 38 - 38
ssi_examples.shtml

@@ -1,159 +1,159 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!DOCTYPE html>
+<html>
 	<head>
 		<title> &lt;&lt; :: SMF SSI.php 2.1 Alpha 1 :: &gt;&gt; </title>
 	</head>
 	<body style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;">
 			<h1>SMF SSI.php Functions</h1>
-			Current Version 2.1 Alpha 1<br />
-			<br />
-			This file is used to demonstrate the capabilities of SSI.php using SHTML include functions.<br />
-			The examples the include tag, then the results of it. Examples are separated by horizontal rules.<br />
+			Current Version 2.1 Alpha 1<br>
+			<br>
+			This file is used to demonstrate the capabilities of SSI.php using SHTML include functions.<br>
+			The examples the include tag, then the results of it. Examples are separated by horizontal rules.<br>
 
-		<hr />
+		<hr>
 
 			<h3>Recent Topics Function: &lt;!--#include virtual="./SSI.php?ssi_function=recentTopics" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=recentTopics" -->
 
-		<hr />
+		<hr>
 
 			<h3>Recent Posts Function: &lt;!--#include virtual="./SSI.php?ssi_function=recentPosts" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=recentPosts" -->
 
-		<hr />
+		<hr>
 
 			<h3>Recent Poll Function: &lt;!--#include virtual="./SSI.php?ssi_function=recentPoll" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=recentPoll" -->
 
-		<hr />
+		<hr>
 
 			<h3>Top Boards Function: &lt;!--#include virtual="./SSI.php?ssi_function=topBoards" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=topBoards" -->
 
-		<hr />
+		<hr>
 
 			<h3>Top Topics by View Function: &lt;!--#include virtual="./SSI.php?ssi_function=topTopicsViews" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=topTopicsViews" -->
 
-		<hr />
+		<hr>
 
 			<h3>Top Topics by Replies Function: &lt;!--#include virtual="./SSI.php?ssi_function=topTopicsReplies" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=topTopicsReplies" -->
 
-		<hr />
+		<hr>
 
 			<h3>Top Poll Function: &lt;!--#include virtual="./SSI.php?ssi_function=topPoll" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=topPoll" -->
 
-		<hr />
+		<hr>
 
 			<h3>Top Poster Function: &lt;!--#include virtual="./SSI.php?ssi_function=topPoster" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=topPoster" -->
 
-		<hr />
+		<hr>
 
 			<h3>Topic's Poll Function: &lt;!--#include virtual="./SSI.php?ssi_function=showPoll;ssi_topic=##" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=showPoll;ssi_topic=1" -->
 
-		<hr />
+		<hr>
 
 			<h3>Latest Member Function: &lt;!--#include virtual="./SSI.php?ssi_function=latestMember" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=latestMember" -->
 
-		<hr />
+		<hr>
 
 			<h3>Random Member Function: &lt;!--#include virtual="./SSI.php?ssi_function=randomMember" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=randomMember" -->
 
-		<hr />
+		<hr>
 
 			<h3>Board Stats: &lt;!--#include virtual="./SSI.php?ssi_function=boardStats" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=boardStats" -->
 
-		<hr />
+		<hr>
 
 			<h3>Who's Online Function: &lt;!--#include virtual="./SSI.php?ssi_function=whosOnline" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=whosOnline" -->
 
-		<hr />
+		<hr>
 
 			<h3>Log Online Presence + Who's Online Function: &lt;!--#include virtual="./SSI.php?ssi_function=logOnline" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=logOnline" -->
 
-		<hr />
+		<hr>
 
 			<h3>Welcome Function: &lt;!--#include virtual="./SSI.php?ssi_function=welcome" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=welcome" -->
 
-		<hr />
+		<hr>
 
 			<h3>News Function: &lt;!--#include virtual="./SSI.php?ssi_function=news" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=news" -->
 
-		<hr />
+		<hr>
 
 			<h3>Board News Function: &lt;!--#include virtual="./SSI.php?ssi_function=boardNews" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=boardNews" -->
 
-		<hr />
+		<hr>
 
 			<h3>Menubar Function: &lt;!--#include virtual="./SSI.php?ssi_function=menubar" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=menubar" -->
 
-		<hr />
+		<hr>
 
 			<h3>Quick Search Function: &lt;!--#include virtual="./SSI.php?ssi_function=quickSearch" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=quickSearch" -->
 
-		<hr />
+		<hr>
 
 			<h3>Login Function: &lt;!--#include virtual="./SSI.php?ssi_function=login" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=login" -->
 
-		<hr />
+		<hr>
 
 			<h3>Log Out Function: &lt;!--#include virtual="./SSI.php?ssi_function=logout" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=logout" -->
 
-		<hr />
+		<hr>
 
 			<h3>Today's Birthdays Function: &lt;!--#include virtual="./SSI.php?ssi_function=todaysBirthdays" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=todaysBirthdays" -->
 
-		<hr />
+		<hr>
 
 			<h3>Today's Holidays Function: &lt;!--#include virtual="./SSI.php?ssi_function=todaysHolidays" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=todaysHolidays" -->
 
-		<hr />
+		<hr>
 
 			<h3>Today's Events Function: &lt;!--#include virtual="./SSI.php?ssi_function=todaysEvents" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=todaysEvents" -->
 
-		<hr />
+		<hr>
 
 			<h3>Today's Calendar Function: &lt;!--#include virtual="./SSI.php?ssi_function=todaysCalendar" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=todaysCalendar" -->
 
-		<hr />
+		<hr>
 
 			<h3>Recent Calendar Events Function: &lt;!--#include virtual="./SSI.php?ssi_function=recentEvents" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=recentEvents" -->
 
-		<hr />
+		<hr>
 
 			<h3>Recent Attachments Function &lt;!--#include virtual="./SSI.php?ssi_function=recentAttachments" --&gt;</h3>
 			<!--#include virtual="./SSI.php?ssi_function=recentAttachments" -->
 
-		<hr />
+		<hr>
 
-		<br />
-		<br />
+		<br>
+		<br>
 		<span style="font-size: smaller;">
 			<a href="http://www.simplemachines.org/" title="Simple Machines Forum" target="_blank" class="new_win">SMF &copy; 2011, Simple Machines</a>
 		</span>
-		<br />
-		<br />
+		<br>
+		<br>
 		<span style="font-size: smaller; color: #CCCCCC;">
 			*ssi_examples.shtml last modified on <!--#config timefmt="%m/%d/%y" --><!--#echo var="LAST_MODIFIED" -->
 		</span>