Thread Rating:
  • 6 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forum Integration - Recent Posts on Main Site
#11
<?php
chdir("./board/"); // path to MyBB
define("IN_MYBB", 1);
require("./global.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FP SharePoints : A Starvoice community Initiative</title>

<META http-equiv=Content-Type content="text/html; charset=utf-8"><LINK
href="style.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #F8FCFC;
background-image: url(bg.jpg);
}
.style1 {
color: #FFFFFF;
font-size: 14px;
font-weight: bold;
}
.style3 {color: #FFFFFF; font-size: 10px; font-weight: bold; }
.style8 {
font-size: 8.5pt;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000000;
font-weight: bold;
}
a:link {
color: #183C4A;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #183C4A;
}
a:hover {
text-decoration: underline;
color: #0099CC;
}
a:active {
text-decoration: none;
color: #0099CC;
}
.style10 {color: #FFFFFF}
.style11 {
color: #000000;
font-weight: bold;
}
.style12 {
font-size: 12
}
-->
</style>
<script type="text/javascript">
<!--
function MM_jumpMenuGo(objId,targ,restore){ //v9.0
var selObj = null; with (document) {
if (getElementById) selObj = getElementById(objId);
if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0; }
}
//-->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24%" height="50" background="h1.jpg"><img src="headerlogo.jpg" alt="" width="300" height="50" /></td>
<td width="43%" background="h1.jpg">&nbsp;</td>
<td width="15%" background="h1.jpg"><img src="TOPSTRIP.jpg" width="181" height="50" border="0" usemap="#Map2" /></td>
<td width="18%" background="h1.jpg">&nbsp;</td>
</tr>
</table>
<br />
<br />
<table width="968" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="360" height="30" valign="middle" class="style8">&nbsp;</td>
<td width="520" rowspan="5">&nbsp;</td>
<td width="88" rowspan="5" valign="top">&nbsp;</td>
</tr>
<tr>
<td height="150" valign="top" bgcolor="#FFFFFF"><?php

$query = mysql_query("
SELECT t.*, u.username
FROM mybb_threads t
LEFT JOIN mybb_users u ON (u.uid=t.uid)
WHERE 1=1 AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.lastpost DESC
LIMIT 0, 6" // Change the last digit to how many recent post you want to be shown
);

$list = '';
while($fetch = mysql_fetch_array($query))
{
$list .= "<strong><a href=\"forums/showthread.php?tid={$fetch['tid']}\">".htmlspecialchars_uni($fetch['subject'])."</a></strong><br />";
$poster = "<a href=\"forums/member.php?action=profile&uid=".$fetch['uid']."\">{$fetch['username']}</a>";
$list .= "Created by: {$poster}<br />";
$list .= "<i>" .$fetch['replies']. " Replies</i>";
$list .= "<i> , " .$fetch['views']. " Views</i><br />";
$list .= " (<i>Last post by: " .$fetch['lastposter']. "</i>)<br /><hr width=\"50\"><br />";

}
//output
echo $list;

?></td>
</tr>
<tr>
<td height="30" valign="middle">&nbsp;</td>
</tr>
<tr>
<td height="25" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
</tr>
<tr>
<td height="27" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
</tr>
</table>
<p><br />
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" height="50" align="center" valign="middle" background="h1.jpg"><span class="style3">All copy right reserved by Four Points by Shearton</span> <span class="style3">| Share Point A starvoice Community Initiative |</span></td>
<td width="50%" background="h1.jpg">&nbsp;</td>
</tr>
</table>


<map name="Map2" id="Map2"><area shape="rect" coords="12,21,79,31" href="home.php" alt="Home Page" />
<area shape="rect" coords="111,18,162,33" href="http://www.fpsharepoints.com/board/memberlist.php" alt="Associates Details" />
</map></body>
</html>
Reply
#12
I'm not at my home computer but I don't think you need the ./

<?php
chdir("board/"); // path to MyBB
define("IN_MYBB", 1);
require("./global.php");
?>
Reply
#13
(02-15-2010, 08:46 AM)punked Wrote:  I'm not at my home computer but I don't think you need the ./

<?php
chdir("board/"); // path to MyBB
define("IN_MYBB", 1);
require("./global.php");
?>

& my question is that if i want recent post from only for section " like i have Forum and there is category " Downtown Property" i want to show only downtown Property Recent post is it possible? not all indivisual posts only from one speifice category

Kind Regards, Muneeb
Reply
#14
& my question is that if i want recent post from only for section " like i have Forum and there is category " Downtown Property" i want to show only downtown Property Recent post is it possible? not all indivisual posts only from one speifice category

Kind Regards, Muneeb
Reply
#15
Thanks man.
Reply
#16
my index is http://www.tech2game.com and forum is http://www.forum.tech2game.com can you tell the both codes for my forum properly?
[Image: eyadHiR.png]
Reply
#17
How could I do this for news posts? Maybe even who's online?
Reply
#18
(03-21-2010, 05:40 PM)tech2game Wrote:  my index is http://www.tech2game.com and forum is http://www.forum.tech2game.com can you tell the both codes for my forum properly?

hm ? didn't you pay someone to get it coded ?
[Image: 350x19.jpg][Image: tstargermany.png]
Reply
#19
hi.
can we the use of this for weblog?
Reply
#20
I'd love to use this, as the snippet I'm currently using isn't as refined.

... but I'm getting the following error
Quote:WARNING: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

My host says I have currently MySQL version 5.0.89-community and PHP version 5.2.12.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)