Location: PHPKode > projects > BNews Multiple Site News System > bNews/Docs/bDocs.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>bNews bDocs for v [0.5]</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.title
{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 36pt;
	font-weight: bold;
	color: #000000;
	margin-left: 30px;
}
.section
{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 18pt;
	font-weight: bold;
	color: #000000;
	margin-left: 40px;
}
.text
{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
	// margin-left: 50px;
}
.divsection
{
	margin-left: 50px;
}
.line
{
	background-color: #000000;
	padding-top: 2px;
	width: 80%;
	margin-left: 20px;
	// margin-right: 20px;
}
.sline
{
	background-color: #CC5555;
	padding-top: 1px;
	width: 40%;
	margin-top: 3px;
	margin-bottom: 5px;
	margin-left: 10px;
}
.td
{
	font-family: Arial, Helvetica, sans-serif; font-size: 12px;
	border: #000000 solid;
	border-width: 1px;
}
.tdgray
{
	font-family: Arial, Helvetica, sans-serif; font-size: 12px;
	border: #000000 solid;
	border-width: 1px;
	background-color: #EEEEEE;
}
.tdtop
{
	font-family: Arial, Helvetica, sans-serif; font-size: 12px;
	border: #000000 solid;
	border-width: 1px;
	background-color: #CCCCCC;
}
.table
{
	margin-left: 10px;
}
-->
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="95%" border="0" cellspacing="0" cellpadding="2" bgcolor="#000000" align="center">
	<tr>
		<td>
			<table width="100%" border="0" cellspacing="1" cellpadding="2">
				<tr>
					<td bgcolor="#FFFFFF">
						<font class="title">bNews Docs</font>
						<br />
						<br />
						
						<!-- bCode -->
						<font class="section">bCode</font>
						<div align="center" class="line"></div>
						<br />
						<div class="divsection">
							<font class="text">
								Available bCode tags:
							</font>
							<table width="80%" border="0" cellspacing="0" cellpadding="5" class="table">
								<tr> 
									<td class="tdtop"><b>Tags or Examples</b></td>
									<td class="tdtop"><b>Information</b></td>
								</tr>
								<tr> 
									<td class="tdgray">[b][/b]</td>
									<td class="td">Bold</td>
								</tr>
								<tr> 
									<td class="tdgray">[u][/u]</td>
									<td class="td">Underline</td>
								</tr>
								<tr> 
									<td class="tdgray">[i][/i]</td>
									<td class="td">Italics</td>
								</tr>
								<tr> 
									<td class="tdgray">
										[url="http://massassi.net"]massassi[/url]<br />
										[url="massassi.net"]massassi[/url]<br />
										[url]www.massassi.net[/url]<br />
										[url]http://www.massassi.net[/url]
									</td>
									<td class="td">Links</td>
								</tr>
								<tr> 
									<td class="tdgray">
										[img]http://someplace.com/image.jpg[/img]<br />
										[img]someplace.com/image.jpg[/img]
									</td>
									<td class="td">Images</td>
								</tr>
							</table>
						</div>
						<br />
						
						<!-- Templates -->
						<font class="section">Templates</font>
						<div align="center" class="line"></div>
						<br />
						<div class="divsection">
							<font class="text">
								This section of the docs outlines how templates work in bNews.
							</font>
							<br />
							<br />
							<table width="80%" border="0" cellspacing="0" cellpadding="5" class="table">
								<tr> 
									<td class="tdtop"><b>Tagset</b></td>
									<td class="tdtop"><b>Information</b></td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;bnews&gt;<br />&lt;/bnews&gt;</td>
									<td class="td"><b>Parent Tagset</b>: Independent<br /><div class="sline"></div>This tagset encapsulates the news section of a template. bNews will only parse tags within the &lt;bnews&gt; tagset. You may want to use this carefully if you are not including bnews/view.php from your front page but are instead just storing your entire front page in the site template. The less data bnews needs to parse, the faster it will render news.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;bcomment&gt;<br />&lt;/bcomment&gt;</td>
									<td class="td"><b>Parent Tagset</b>: Independent<br /><div class="sline"></div>Similar to the above tagset. Data within this tagset is discarded when not rendering comments in comments.php. The method for rendering these tags is similar to &lt;category:&gt;, in that the data within the tags is rendered once per comment.<br /><b>NOTE</b>: This tagset SHOULD NOT be in the &lt;bnews&gt; tagset, but instead, *AFTER* it's close.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;date&gt;<br />&lt;/date&gt;</td>
									<td class="td"><b>Parent Tagset</b>: &lt;bnews&gt;<br /><div class="sline"></div>Encapsulates the section of data that will be placed above every day of news. Data within this tagset will only be displayed once per day of news. <br /><b>NOTE</b>: The only tag that will be parsed in the data encapsulated by this tagset is &lt;tag:date /&gt;<br /><b>NOTE</b>: Data encapsulated by this tagset will be discarded like any other data not encapsulated by &lt;category:&gt;, &lt;itemheader&gt;, or &lt;itemfooter&gt; tagsets when the 'amount of news to render' setting is set to 'posts'.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;category:&gt;<br />&lt;/category:&gt;</td>
									<td class="td"><b>Parent Tagset</b>: &lt;bnews&gt;<br /><div class="sline"></div>Encapsulates news of a given category. If a category in bNews Control is set as 'Special TPL Definition', it is EXPECTED that the template has a category tag for it, like &lt;category:waffle news&gt;&lt;/category:waffle news&gt;. If 'Special TPL Definition' is not set for a category, the pseudo-category default is used in the template. <b>Therefore, every template <u>must</u></b> have a &lt;category:default&gt;&lt;/category:default&gt; tagset somewhere in it. The data is rendered once for every news post in the given category.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;mainpage&gt;<br />&lt;/mainpage&gt;</td>
									<td class="td"><b>Parent Tagset</b>: Independent<br /><div class="sline"></div>Encapsulates data which should only be displayed when view.php renders news, not comments.php. Data within the tagset will be nullified by comments.php, while view.php will simply nullify the tags themselves.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;commpage&gt;<br />&lt;/commpage&gt;</td>
									<td class="td"><b>Parent Tagset</b>: Independent<br /><div class="sline"></div>Exactly the same as &lt;mainpage&gt; tagset, except data encapsulated by these tags will be nullified by view.php and outputted by comments.php.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;itemheader&gt;<br />&lt;/itemheader&gt;</td>
									<td class="td"><b>Parent Tagset</b>: &lt;category:&gt;<br /><div class="sline"></div>Encapsulates data which will be outputted above every news post.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;itemfooter&gt;<br />&lt;/itemfooter&gt;</td>
									<td class="td"><b>Parent Tagset</b>: &lt;category:&gt;<br /><div class="sline"></div>Encapsulates data which will be outputted below every news post.</td>
								</tr>
							</table>
							<br />
							<font class="text">
								The following tags differ by news post and can be placed in the &lt;category:&gt; tagset.<br />(Exception: &lt;tag:date /&gt; can be placed in the &lt;category:&gt; tagset <b>and</b> the &lt;date&gt; tagset.)
							</font>
							<br />
							<br />
							<table width="80%" border="0" cellspacing="0" cellpadding="5" class="table">
								<tr> 
									<td class="tdtop"><b>Tag</b></td>
									<td class="tdtop"><b>Information</b></td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:title /&gt;</td>
									<td class="td">The title entered in the news post.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:time /&gt;</td>
									<td class="td">The time of the news post.<br /><b>NOTE</b>: Format is specified in view.php. Please see view.php docs for info on how to change the format.)</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:content /&gt;</td>
									<td class="td">The main content of the news post.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:poster /&gt;</td>
									<td class="td">The username of the user who posted the news.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:cat_name /&gt;</td>
									<td class="td">The name of the category the news has been posted under.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:date /&gt;</td>
									<td class="td">The date of the news post.<br /><b>NOTE</b>: See &lt;tag:time /&gt; above for format info).</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:id /&gt;</td>
									<td class="td">The NEWSID of the post. Most likely used in the following fashion:<br />&lt;a href=&quot;comments.php?id=&lt;tag:id /&gt;&quot;&gt;Click to view comments&lt;/a&gt;</td>
								</tr>
								<tr> 
									<td class="tdgray" nowrap>&lt;tag:num_comments /&gt;</td>
									<td class="td">The number of comments that have been posted about a news post.</td>
								</tr>
							</table>
							<br />
							<font class="text">
								The following tags differ by comments post and can be placed in the &lt;bcomment&gt; tagset.
							</font>
							<br />
							<br />
							<table width="80%" border="0" cellspacing="0" cellpadding="5" class="table">
								<tr> 
									<td class="tdtop"><b>Tag</b></td>
									<td class="tdtop"><b>Information</b></td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:poster /&gt;</td>
									<td class="td">The username of the user who posted the comment</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:content /&gt;</td>
									<td class="td">The content of the comment.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:date /&gt;</td>
									<td class="td">The date of the comment. See &lt;tag:date /&gt; above.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:time /&gt;</td>
									<td class="td">The time of the comment. See &lt;tag:time /&gt; above.</td>
								</tr>
								<tr> 
									<td class="tdgray">&lt;tag:id /&gt;</td>
									<td class="td">The id of the comment. Most likely used in the following fashion:<br />&lt;a href=&quot;comments.php?a=moderate&amp;commentid=&lt;tag:id /&gt;&quot;&gt;Moderate&lt;/a&gt;</td>
								</tr>
							</table>
							<br />
							<font class="text">
								The following tag is global and can be used anywhere in the template as many times as you want.
							</font>
							<br />
							<br />
							<table width="80%" border="0" cellspacing="0" cellpadding="5" class="table">
								<tr> 
									<td class="tdtop"><b>Tag</b></td>
									<td class="tdtop"><b>Information</b></td>
								</tr>
								<tr> 
									<td class="tdgray" nowrap>&lt;tag:timer /&gt;</td>
									<td class="td">The amount of time it took to generate the page.<br /><b>NOTE</b>: When placed in a template where the news outputs to file, this will look weird because the number will be the same every time the pre-outputted news displays.</td>
								</tr>
								<tr> 
									<td class="tdgray" nowrap>&lt;tag:base_path_web /&gt;</td>
									<td class="td">This is set in setup.inc.php, and is supposed to be the URL of the bnews directory, for instance, "http://woof.com/bNews/".</td>
								</tr>
								<tr> 
									<td class="tdgray" nowrap>&lt;tag:nid /&gt;</td>
									<td class="td">Id of the news item being looked at in comments.php.<br /><b>NOTE</b>: this tag is always parsed, although only in comments.php. For this reason, it should always be inside the <commpage> tagset.</td>
								</tr>
							</table>
							<br />
							<br />
							<font class="text">
								The following is a visual diagram to help you out with the main &lt;bnews&gt; tagset.
							</font>
							<br />
							<img src="tpls.png" border="2" alt="Template Layout">
						</div>
						<br />
						
						<!-- View.php -->
						<font class="section">View.php</font>
						<div align="center" class="line"></div>
						<br />
						<div class="divsection">
							<font class="text">
								view.php can be manipulated without editing the file!<br />
								<!-- <b>NOTE</b>: the path to setup.inc.php must be specified as an absolute path in view.php for this to work.<br /> -->
								Here is an example:<br />
								&lt;?<br />
								$setup = 'bnews/setup.inc.php'; // specifies the location of setup.inc.php relative to the current file<br />
								$sid = '1'; // specifies the site id<br />
								$amnt = '7'; // specifies the amount of news to display<br />
								$amnt_type = 'days'; // specifies the unit for $amnt: can be 'days' or 'posts'<br />
								$dateform = 'm/d/y'; // specifies time/date forms for use in the template parser. more on this later<br />
								$timeform = 'g:i A';<br />
								$dateform2 = 'l, F d, Y'; // this variable is for the &lt;tag:date /&gt; in the &lt;date&gt;&lt;/date&gt; tagset<br />
								$outside_control = 'on'; // tells view.php to listen to outside control<br />
								include('bnews/view.php');<br />
								?&gt;<br /><br />

								<b>NOTE</b>: If you wish to use outside control, you *MUST* have all of the variables listed above defined *BEFORE* including the file via PHP.<br /><br />
								Or you can edit the settings in view.php
							</font>
						</div>
						<br />

						<!-- Timeform/Dateform -->
						<font class="section">Timeform & Dateform in View.php</font>
						<div align="center" class="line"></div>
						<br />
						<div class="divsection">
							<font class="text">
								These forms are specified in http://www.php.net/manual/en/function.date.php<br />
								$dateform2 is used to describe the form of the date in &lt;tag:date /&gt; when it is in the &lt;date&gt;&lt;/date&gt; tagset<br />
								$dateform is used to describe the form of the date in &lt;tag:date /&gt; when it is in the &lt;category:&gt;&lt;/category:&gt; tagset<br />
								$timeform is used to describe the form of the date/time in &lt;tag:time /&gt; when it is in the &lt;category:&gt;&lt;/category:&gt; tagset<br />
							</font>
						</div>
						<br />
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<div align="center">
	<font class="text" style="font-size: 10px;">
		(c) Copyright 2002 Brad Huizenga
	</font>
</div>
</body>
</html>
Return current item: BNews Multiple Site News System