All pastes #594646 Raw Edit

Something

public text v1 · immutable
#594646 ·published 2007-06-29 01:01 UTC
rendered paste body
<?php

class NewsDefinition extends DatabaseModelDefinition
{
	public function init()
	{
		$this->setTable('news', 'MyISAM');
		
		$this->id('int')->length(11)->primary()->increment();
		$this->title('varchar')->length(255);
		$this->description('text');
		$this->text('text');
		$this->image('varchar')->length(32);
		$this->degree('int')->length(11);
		$this->author_id('int')->length(11);
		$this->created('timestamp')->default('CURRENT_TIMESTAMP');
		$this->category_id('int')->length(11);
		$this->console_id('int')->length(11);
		$this->game_id('int')->length(11);
		$this->status('tinyint')->length(4);
		$this->views('int')->length(11)->default(1);
		
		$this->hasMany('comments');
		$this->hasOne('consoles', 'console');
		$this->hasOne('vbuser', 'author');
		
		$this->hasForeignKey('console_id', 'consoles.id');
		$this->hasForeignKey('author_id', 'vbuser.userid');
	}
}

?>

<?php

class VbuserDefinition extends DatabaseModelDefinition
{
	public function init()
	{
		$this->setTable('vbuser', 'MyISAM');
		
		$this->userid('int')->length(11)->primary()->increment();
		$this->username('varchar')->length(100);
	}
}

?>

<div id="main_column">
	<tpl:if var="story" neq="">
		<div id="full_story">
			<div id="full_story_header">
				<h3>{$story.title}</h3>
				<div class="story_degree degree_large degree_{$story.degree|color}">{$story.degree}&deg;</div>
			</div>
			<div id="full_story_info">
				<div class="mini_avatar left">
					<img src="{/media/images/story_icons/default.gif}" class="right" alt="" />
				</div>
				<div id="full_story_details">
					<a href="#" class="story_author">PSP Crazy</a>
					<span class="user_group contributor">(contributor)</span>
					<a href="#"><img src="{/images/icons/add_me.gif}" /></a>
					<a href="#"><img src="{/images/icons/pm_me.gif}" /></a>
					<ul class="story_info">
						<li>Published: {$story.created|reltotime} | </li>
						<li>{$story.console.name|strtoupper} | </li>
						<li>{$story.category_id} | </li>
						<li>{$story.author.username}</li>
					</ul>
				</div>
			</div>
			<tpl:if var="story.image" neq="">
				<img src="{/media/images/story_icons/}{$story.image}" class="story_image" alt="" />
				
			<tpl:else />
				<img src="{/images/tmp_story_image.png}" class="story_image" alt="" />
			</tpl:if>
			<p>
				{$story.text}
			</p>
			<div class="clear"></div>
		</div>
		<tpl:import file="story_comments.html" />
		
	<tpl:else />
		<tpl:import file="errors/no_content.html" />
	</tpl:if>
</div>
<div id="right_column">
	<div id="column_advert">
		<img src="{/images/tmp_column_advert.jpg}" alt="" />
	</div>
	<div id="site_features" class="block green">
		<h3><em>Site</em> Features</h3>
	</div>
	<tpl:component id="hottest_news" />
</div>