added tab styles for overview.php
addon.php
    created file to pass addon information to addon.tpl, partially done
lib/addon.class.php
    class for gathering addon information, all inclusive -- it will make it much easier in the long run
tpl/addon.tpl
    general template for an addon summary - equivalent to "moreinfo.php"
This commit is contained in:
mike.morgan%oregonstate.edu 2005-07-19 00:22:46 +00:00
Родитель 4948577775
Коммит adf09be917
4 изменённых файлов: 68 добавлений и 7 удалений

Просмотреть файл

@ -1,5 +1,24 @@
<?php
$foo = new AddOn();
print_r($foo->getAddOn(10));
$foo->finish();
/**
* Addon summary page. Displays a top-down view of all Addon properties.
*
* @package amo
* @subpackage docs
*/
// Arrays to store clean inputs.
$clean = array(); // General array for verified inputs.
$sql = array(); // Trusted for SQL.
// Get our addon ID.
$clean['ID'] = intval($_GET['id']);
$sql['ID'] =& $clean['ID'];
$addon = new AddOn($sql['ID']);
// Assign template variables.
$tpl->assign(
array( 'addon' => $addon,
'content' => 'addon.tpl')
);
?>

Просмотреть файл

@ -150,10 +150,11 @@ p.security-update {
.tabs a.active-tab {
border-bottom: 1px solid #fff;
background-color: #fff;
font-weight:bold;
color: #000;
}
.tabs a {
float: left;
font-weight:bold;
display: inline;
border: 1px solid #000;
background-color: #69c;

Просмотреть файл

@ -6,6 +6,7 @@
*/
class AddOn extends AMO_Object
{
// AddOn metadata.
var $ID;
var $GUID;
var $Name;
@ -21,10 +22,17 @@ class AddOn extends AMO_Object
var $db;
var $tpl;
// AddOn author metadata.
var $UserID;
var $UserName;
var $UserEmail;
var $UserWebsite;
var $UserEmailHide;
/**
* Class constructor.
*/
function AddOn()
function AddOn($ID=null)
{
// Our DB and Smarty objects are global to save cycles.
global $db, $tpl;
@ -32,11 +40,35 @@ class AddOn extends AMO_Object
// Pass by reference in order to save memory.
$this->db =& $db;
$this->tpl =& $tpl;
// If $ID is set, attempt to retrieve data.
if (!empty($ID)) {
$this->getAddOn($ID);
}
}
function getAddOn($ID)
{
$this->db->query("SELECT * FROM main WHERE ID = '{$ID}'", SQL_ALL, SQL_ASSOC);
return $this->db->record;
$this->db->query("
SELECT
main.*,
userprofiles.UserID,
userprofiles.UserName,
userprofiles.UserEmail,
userprofiles.UserWebsite,
userprofiles.UserEmailHide
FROM
main
INNER JOIN authorxref ON authorxref.ID = main.ID
INNER JOIN userprofiles ON userprofiles.UserID = authorxref.UserID
WHERE
main.ID = '{$ID}'
", SQL_INIT, SQL_ASSOC);
if (!empty($this->db->record)) {
foreach ($this->db->record as $key=>$val) {
$this->$key = $val;
}
}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
<script language="Javascript" type="text/javascript" src="/js/auto.js"></script>
<h2><a href="./addon.php?id={$addon->ID}">{$addon->Name}</a> by <a href="./author.php?id={$addon->UserID}">{$addon->UserName}</a></h2>