Jeg er ved at lave så min bruger kan se last-topic fra mit forum på forsiden Se på www.vbt.frac.dk (demo) men her kan i se at der står
{last.topic} {last.username} {last.count} {last.date}
men hvis jeg så går ind i Inkspot (forum)så står der
Prøve abmig 0 Aug. 21st
Og det skulle også gerne ses på forsiden
Dette har jeg gjordt intil nu:
gået ind i min "home.tpl" og tilføjet
<h2>[Last Topics {6605}] </h2>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="30"> </td>
<td><strong>[Topic {545}]</strong></td>
</tr>
<tr>
<td height="1" colspan="5" bgcolor="#BBD4F9"><img src="theme/default/images/frame/spacer.gif" alt="Spacer" height="1" /></td>
</tr>
<LOOP lastTopicsList>
<tr>
<td width="30"><a href="?L=users.profile&id={last.userid}"><img src="system/image.php?file={last.mainpicture}&width=30" alt="{username}" name="picture" hspace="2" border="0" align="left" id="picture" /></a></td>
<td><a href="?L=inkspot.topic&id={last.id}">{last.topic}</a></td>
<td>{last.username}</td>
<td>{last.count}</td>
<td align="right">{last.date}</td>
^ nu kan jeg se "designet" på forsiden, men jeg mangler min "tekst" som den skal hente fra "home.php"
Problemet er HVAD jeg skal tilføje i home.php
Jeg har prøvet at kigge i min inspot fil (forum) den ser sådan ud:
<?php
///////////////////////////////////////////////////////////////////////////////////////
// PHPizabi 0.848b C1 [ALICIA] http://www.phpizabi.net //
///////////////////////////////////////////////////////////////////////////////////////
// Please read the license.txt file before using / modifying this software //
// Original author: Claude Desjardins, R - feedback@realitymedias.com //
// Last modification date: August 26th 2006 //
// Version: PHPizabi 0.848b C1 //
// //
// (C) 2005, 2006 Real!ty Medias / PHPizabi - All rights reserved //
///////////////////////////////////////////////////////////////////////////////////////
/* Check Structure Availability */
if (!defined("CORE_STRAP")) die("Out of structure call");
// TEMPLATE HANDLING ////////////////////////////////////////////////////////////////// FINAL //
/*
Initialize the template engine and
load the template file. Get objects,
convert self user.
*/
$tpl = new template;
$tpl -> Load("index");
$tpl -> GetObjects();
// TEMP //
$s[0]["TITLE"] = "This is a subject";
$s[0]["ID"] = "2147483647";
$s[0]["LOCKED"] = false;
$s[0]["TOPIC_COUNT"] = 1;
$s[0]["POST_COUNT"] = 5;
$s[0]["TYPES"] = "g,u";
$s[1]["TITLE"] = "Yozemite ...";
$s[1]["ID"] = "2147483646";
$s[1]["LOCKED"] = false;
$s[1]["TOPIC_COUNT"] = 10;
$s[1]["POST_COUNT"] = 41;
$s[1]["TYPES"] = "g,u";
$s[2]["TITLE"] = "shouldnt allow guests";
$s[2]["ID"] = "2147483611";
$s[2]["LOCKED"] = false;
$s[2]["TOPIC_COUNT"] = 0;
$s[2]["POST_COUNT"] = 0;
$s[2]["TYPES"] = "u";
$s[3]["TITLE"] = "a locked topic";
$s[3]["ID"] = "2147483610";
$s[3]["LOCKED"] = true;
$s[3]["TOPIC_COUNT"] = 0;
$s[3]["POST_COUNT"] = 0;
$s[3]["TYPES"] = "g,u";
// $handle = fopen("system/cache/inkspot.dat", "w");
// fwrite($handle, pk($s));
// fclose($handle);
// End
// LOAD SUBJECTS /////////////////////////////////////////////////////////////////////
/*
Load the inkspot subjects array
*/
$inkSpotSubjects = unpk(file_get_contents("system/cache/inkspot.dat"));
if (!is_array($inkSpotSubjects)) $inkSpotSubjects = array();
/*
Set a couple cyclic counter variables
*/
$totalSubjects = 0;
$totalTopics = 0;
$totalPosts = 0;
/*
Generate the inkspot subjects list
array to be injected into the spot subjects
block
*/
$i=0;
foreach ($inkSpotSubjects as $key => $spotArray) {
$subjectsReplacementArray[] = array(
"subject.title" => $spotArray["TITLE"],
"subject.topicCount" => $spotArray["TOPIC_COUNT"],
"subject.postCount" => $spotArray["POST_COUNT"],
"subject.id" => $spotArray["ID"]
);
$totalSubjects++;
$totalTopics += $spotArray["TOPIC_COUNT"];
$totalPosts += $spotArray["POST_COUNT"];
$i ++;
}
if (isset($subjectsReplacementArray)) $tpl -> Loop("inkSpotSubjects", $subjectsReplacementArray);
$tpl -> AssignArray(array(
"total.subjects" => $totalSubjects,
"total.topics" => $totalTopics,
"total.posts" => $totalPosts
));
// LOAD POPULAR TOPICS ///////////////////////////////////////////////////////////////
$select = myQ("
SELECT *, COUNT(topic) AS count FROM `[x]inkspot`
GROUP BY `topic`
ORDER BY `count` DESC
LIMIT 10
");
while ($row = myF($select)) {
$popularReplacementArray[] = array(
"pop.date" => date($CONF["LOCALE_HEADER_DATE"], $row["date"]),
"pop.username" => _fnc("user", $row["user"], "username"),
"pop.topic" => $row["topic"],
"pop.count" => $row["count"]-1,
"pop.id" => $row["id"],
"pop.userid" => $row["user"],
"pop.mainpicture" => _fnc("user", $row["user"], "mainpicture")
);
}
if (isset($popularReplacementArray)) {
$tpl -> Loop("popularTopicsList", $popularReplacementArray);
}
// LOAD LAST TOPICS /////////////////////////////////////////////////////////////////
$select = myQ("
SELECT *, COUNT(topic) AS count FROM `[x]inkspot`
GROUP BY `topic`
ORDER BY `date` DESC
LIMIT 10
");
while ($row = myF($select)) {
$lastReplacementArray[] = array(
"last.date" => date($CONF["LOCALE_HEADER_DATE"], $row["date"]),
"last.username" => _fnc("user", $row["user"], "username"),
"last.topic" => $row["topic"],
"last.count" => $row["count"]-1,
"last.id" => $row["id"],
"last.userid" => $row["user"],
"last.mainpicture" => _fnc("user", $row["user"], "mainpicture")
);
}
if (isset($lastReplacementArray)) {
$tpl -> Loop("lastTopicsList", $lastReplacementArray);
}
// LOAD LAST TOPICS /////////////////////////////////////////////////////////////////
$select = myQ("
SELECT *, COUNT(topic) AS count FROM `[x]inkspot`
WHERE `user`='".me("id")."'
GROUP BY `topic`
ORDER BY `date` DESC
LIMIT 10
");
while ($row = myF($select)) {
$participateReplacementArray[] = array(
"par.date" => date($CONF["LOCALE_HEADER_DATE"], $row["date"]),
"par.username" => _fnc("user", $row["user"], "username"),
"par.topic" => $row["topic"],
"par.count" => $row["count"]-1,
"par.id" => $row["id"],
"par.userid" => $row["user"],
"par.mainpicture" => _fnc("user", $row["user"], "mainpicture")
);
}
if (isset($participateReplacementArray)) {
$tpl -> Loop("participateTopicsList", $participateReplacementArray);
}
$tpl -> Flush();
?>
Som I kan se har jeg ikke selv bygget det op, men er lavet fra noget der hedder phpizabi.
Men håber at I kan se en løsning for hvad jeg skal tilføje i home.php