Hey there,
I am really SS. but so far I love it. also i dont have much knowledge about PHP.
I'v been trying to work out a function which store the 'readOnly' threads. Once the thread is taged as IsReadOnly = 1, it will be shifted into ForumArchive page.
the page structure is as following:
InfoPage; Project1 ->
ForumHolder1 ->
- Forum1
- ForumArchive1
InfoPage:Project2 -> ForumHolder2 ->
- Forum2
- ForumArchive2
ForumArchive php:
<?php
class ForumArchive extends Forum {
}
class ForumArchive_Controller extends Forum_Controller {
}
ForumArchive ss:
<% include SideBar %>
<div class="content-container unit size3of4 lastUnit">
<div class="content">
<table class="forum-topics" summary="List of topics in this forum" style="width: 100%">
<tr class="category">
<!--<td colspan="4"><% _t('Forum_ss.THREADS', 'Thread') %></td>-->
</tr>
<tr>
<th class="odd">Query</th> <!--<% _t('Forum_ss.TOPIC','Topic') %> -->
<th class="odd"><% _t('Forum_ss.POSTS','Posts') %></th>
<th class="even"><% _t('Forum_ss.LASTPOST','Last Post') %></th>
</tr>
<% loop ReadOnlyTopics %>
<% include TopicListing %>
<% end_loop %>
</table>
</div>
</div>
I also create a function in forum.php:
function getReadOnlyTopics() {
// Get Threads that are readOnly & in this forum
$where = '("ForumThread"."ForumID" = '.$this->ID.' AND "ForumThread"."IsReadOnly" = 1)';
// Get the underlying query
$query = ForumThread::get()->where($where)->dataQuery()->query();
// Build result as ArrayList
$res = new ArrayList();
$rows = $query->execute();
if ($rows) foreach ($rows as $row) $res->push(new ForumThread($row));
return $res;
}
The result is NULL.
Maybe i should get ForumHolderID for this ForumArchive page, because the Forum page and ForumArchive are the same Parent. but how to it get it?
i have been working on this for one week. but still trying....
Can someone give me a hand? thanks in advance.