create a block in the forums block manager (same as you did before)
i called it: recent wiki changes
php
put the following code in the content.
you probably have to replace ALL the text with vb3_ with your own prefix code of your vbulletin tables
Code:
global $db, $vbphrase, $threadinfo, $post, $stylevar, $show;
$threads= $db->query_read_slave("
SELECT thread.title, thread.forumid, thread.threadid, revision.revisionid, revision.reason as reason,
revision.dateline, revision.username as postusername, thread.lastpost AS threadlastpost,
thread.lastposterid, forum.title_clean as forumtitle, user.*, avatar.avatarpath,
NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,
customavatar.width AS avwidth,customavatar.height AS avheight
FROM (
select * from `vb3_vault_revision` order by dateline DESC
) AS revision
LEFT JOIN vb3_thread AS thread ON (thread.threadid = revision.threadid)
INNER JOIN vb3_forum AS forum ON(forum.forumid = thread.forumid)
LEFT JOIN vb3_user AS user ON (user.userid = revision.userid)
LEFT JOIN vb3_avatar AS avatar ON(avatar.avatarid = user.avatarid)
LEFT JOIN vb3_customavatar AS customavatar ON(customavatar.userid = user.userid)
group by thread.title
order by revision.dateline DESC
LIMIT 10
");
while ($thread = $this->registry->db->fetch_array($threads))
{
//echo "title: ".$thread['title'] ."<br>";
// still need to censor the title
$thread['title'] = fetch_censored_text($thread['title']);
$thread['date'] = vbdate($this->registry->options['dateformat'], $thread['dateline'], true);
$thread['time'] = vbdate($this->registry->options['timeformat'], $thread['dateline']);
$thread['lastpostdate'] = vbdate($this->registry->options['dateformat'], $thread['threadlastpost'], true);
$thread['lastposttime'] = vbdate($this->registry->options['timeformat'], $thread['threadlastpost']);
// get avatar
$this->fetch_avatarinfo($thread);
$threadarray[$thread['threadid']] = $thread;
}
foreach ($threadarray as $key => $thread)
{
//echo "<br> - title: ". $threadarray[$key]['title'];
$threadarray[$key]['url'] = fetch_seo_url('thread', $thread);
$threadarray[$key]['newposturl'] = fetch_seo_url('thread', $thread, array('goto' => 'newpost'));
$threadarray[$key]['lastposturl'] = fetch_seo_url('thread', $thread, array('p' => $thread['lastpostid'])) .
'#post' . $thread['lastpostid'];
$threadarray[$key]['title'] = fetch_trimmed_title($thread['title'], $this->config['threads_titlemaxchars']);
}
$templater = vB_Template::create('block_wikichanges');
$templater->register('threads', $threadarray);
return $templater->render();
$db->free_result($threads);
unset($threadarray );
then create a new template in the style manager called: block_wikichanges
with the following code
Code:
<ul id="block_wikichanges_{vb:raw blockinfo.blockid}" >
<vb:each from="threads" key="threadid" value="thread">
<li class="<vb:if condition="!$vboptions['avatarenabled']">no</vb:if>avatarcontent floatcontainer widget_post_bit">
<div class="widget_post_userinfo">
<vb:if condition="$vboptions['avatarenabled']">
<div class="cms_widget_post_useravatar widget_post_useravatar">
<a class="smallavatar comments_member_avatar_link" href="{vb:link member, {vb:raw thread}}">
<vb:if condition="$thread['showavatar']">
<img width="30" title="" src="{vb:raw thread.avatarurl}" alt=""/>
<vb:else />
<img width="30" title="" src="{vb:stylevar imgdir_misc}/unknown.gif" alt=""/>
</vb:if>
</a>
</div>
</vb:if>
</div>
<div class="smallavatartext widget_post_comment<vb:if condition="!$vboptions['avatarenabled']">_noavatar</vb:if>">
<h5 class="widget_post_header"><a href="{vb:raw thread.url}" class="title">{vb:raw thread.title}</a></h5>
<div class="meta">
<vb:if condition="$threadstype == 0">Edited by <a href="{vb:link member, {vb:raw thread}}">{vb:raw thread.postusername}</a> {vb:stylevar dirmark}<vb:if condition="$thread['reason']"><br />(Reason: {vb:raw thread.reason})</vb:if>
<br />{vb:raw thread.date}<vb:if condition="!$show['detailedtime']">, <span class="time">{vb:raw thread.time}</span></vb:if> {vb:rawphrase in_x, {vb:link forum, {vb:raw thread}, null, 'forumid', 'forumtitle'}, {vb:raw thread.forumtitle}}
<vb:else />
{vb:rawphrase last_post_by} <a href="{vb:link member, {vb:raw thread}, null, 'lastposterid', 'lastposter'}">{vb:raw thread.lastposter}</a> {vb:stylevar dirmark}({vb:rawphrase x_replies, {vb:raw thread.replycount}})
<br />
{vb:raw thread.lastpostdate}<vb:if condition="!$show['detailedtime']">, <span class="time">{vb:raw thread.lastposttime}</span></vb:if> {vb:rawphrase in_x, {vb:link forum, {vb:raw thread}, null, 'forumid', 'forumtitle'}, {vb:raw thread.forumtitle}}
</vb:if>
</div>
</div>
</li>
</vb:each>
</ul>
then in the everywhere sidebar you can show hide it where ever you like
that should do it
Bookmarks