PDA

View Full Version : Vbulletin Recent posts code?


penmai.com
11-26-2010, 03:26 AM
Hi, i had recently added customized side bar which displays on every page. To display the recent post code i had used this code.

<script language="" src="http://www.penmai.com/forums/external.php?type=js" type="text/javascript">
</script>
<script language="" type="text/javascript">
<!--
for (i = 0; i < 10; i++)
{
document.writeln("<tr><td colspan=2 height=18><span class=smallfont><b><a href=\"http://www.penmai.com/forums/showthread.php?threadid="+threads[i].threadid+"\">"+threads[i].title+"</a></b>&nbsp;&nbsp;-<i>"+threads[i].poster+"</i><br /></span></td></tr>");
}
//-->
</script>

The code is working fine. This code just diplays,
1. The newly created threads and that too only title of the thread

What i need is
1. Not only newly started threads but also recent replies and
2. To display first 30 or 50 characters of the post message.

Can any of you please tell me how to change this code to display like what i have stated above.

I will be satisfied if i get code used by vbulletin (default) to show recent post in the forum. Is there is any possibility to use that code. Because it strongly matches my question

Thanks in advance...

Lynne
11-26-2010, 02:00 PM
You won't be able to use the javascript to get replies and pagetext. You will need to write a query to do this instead. (I think there are forum blocks that do this.)

penmai.com
11-27-2010, 04:20 AM
thanks Lynne for your reply!!! "Exactly i need the coding of Forum blocks recent posts."

Since vbulletin forum block manager are not visible in some versions of IE i need this coding.

Lynne
11-27-2010, 03:12 PM
Did you look at the code? /includes/block/newposts.php

penmai.com
11-27-2010, 04:45 PM
Thanks lynne, I got the code may i replace the code
<script language="" src="http://www.penmai.com/forums/external.php?type=js" type="text/javascript">
</script>
<script language="" type="text/javascript">
<!--
for (i = 0; i < 10; i++)
{
document.writeln("<tr><td colspan=2 height=18><span class=smallfont><b><a href=\"http://www.penmai.com/forums/showthread.php?threadid="+threads[i].threadid+"\">"+threads[i].title+"</a></b>&nbsp;&nbsp;-<i>"+threads[i].poster+"</i><br /></span></td></tr>");
}
//-->
</script>

with the code in /includes/block/newposts.php.

Lynne
11-27-2010, 05:03 PM
I do not believe you may simple copy it, no. You were asking about the query to use and I simply said it is in that file. You will have to write your own block of code for this.