My code

by Andy on December 28th, 2009
No notes
Syntax: PHP
Show lines - Hide lines - Show in textbox - Download
1.First I made file called smsad.php
 
1.1Content:
 
<?php
define('IN_PHPBB', true);
define('SMS_TABLE', $table_prefix . 'sms');
$mode = request_var('mode', '');
switch ($mode)
{
	default:
		$sql = 'SELECT * FROM ' . SMS_TABLE . ' ORDER BY sms_id DESC';
		$result = $db->sql_query_limit($sql, 25);
		$rows = $db->sql_fetchrowset($result);
 
		foreach ($rows as $row)
		{
			if ($count++ == 0)
			{
				$last_id = $row['sms_id'];
			}
			$template->assign_block_vars('smsrow', array(
				'SMS_ID'	=> $row['sms_id'],
				'NR'				=> $row['nr'],
				'TEXTAS'	=> $row['textas'],
			));
		}
		$db->sql_freeresult($result);
}
?>
 
2.Then I included it in index.php
 
include($phpbb_root_path . 'smsad.' . $phpEx);
 
3. Then just added in overall_header.html and I have my messages
								<!-- BEGIN smsrow -->
{smsrow.TEXTAS} {smsrow.NR}
								<!-- END smsrow -->

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS