MyBB Community Forums

Full Version: External Site with News Post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all! I am here attempting and failing trying to make a Index.php on my root files of my website. But, the thing I am trying to do it put the Latest post of my News Board. So..... What do i need to do? This is the Website that i want to put it on www.chillax-mc.com/index.php . If you need the coding for that Website Here then TAKE IT Smile

As you can notice I have attempted to find help and get this to work but I failed.

Mybb Version: 1.6.5

<?php
chdir("./forums/"); // path to MyBB
define("IN_MYBB", 1);
require("./global.php");
?>
	<head>
		<title>
			Chillax - Home
		</title>
		<link rel="stylesheet" type="text/css" href="/Chillax.css"/>
		<style type="text/css">

		input.groovybutton
		{
		   font-size:20px;
		   font-family:Georgia,serif;
		   font-weight:bold;
		   color:#FFFFFF;
		   width:100px;
		   height:51px;
		   background-color:#000000;
		   background-image:url(/chest.png);
		}

		</style>
		<script language="javascript">
		function goLite(FRM,BTN)
		{
		   window.document.forms[FRM].elements[BTN].style.color = "#330066";
		   window.document.forms[FRM].elements[BTN].style.backgroundImage = "url(/chest.png)";
		}
		function goDim(FRM,BTN)
		{
		   window.document.forms[FRM].elements[BTN].style.color = "#FFFFFF";
		   window.document.forms[FRM].elements[BTN].style.backgroundImage = "url(chest.png)";
		}
		</script>
		<style type="text/css">
		input.groovybutton1
		{
		   font-size:20px;
		   font-family:Georgia,serif;
		   font-weight:bold;
		   color:#FFFFFF;
		   width:100px;
		   height:51px;
		   background-color:#000000;
		   background-image:url(/chest.png);
		}
		</style>
		<script language="javascript">
		jQuery(function($) {
		    $.fn.equalHeight = function() {
        		var highest = 0;
	        $(this).each(function() {
    	        if ($(this).height() > highest) { highest = $(this).height(); }
    	    });
        	$(this).height(highest);
    		};
		    $('.column').equalHeight();
			});
		function goLite1(FRM,BTN)
		{
		   window.document.forms[FRM].elements[BTN].style.color = "#330066";
		   window.document.forms[FRM].elements[BTN].style.backgroundImage = "url(/chest.png)";
		}
		function goDim1(FRM,BTN)
		{
		   window.document.forms[FRM].elements[BTN].style.color = "#FFFFFF";
		   window.document.forms[FRM].elements[BTN].style.backgroundImage = "url(/chest.png)";
		}
		</script>


	</head>
	<body>
	<div id="d">
		<a href="/forums/donate.php">
		<br class="column" />
		<center>
			&ensp;&emsp;<img height="36px" src="/Paypal-donate.gif" title="Donate"/>&ensp;&ensp;&ensp;
		</center>
		<br />
		</a>
	</div>
	<br />
	<div id="ip" >
		<h3>&ensp;&ensp;&ensp;IP Address&ensp;&ensp;&ensp;</h3>
		<p>
			&ensp;&ensp;IP : play.chillax-mc.com:25571&ensp;&ensp;&ensp;&ensp;
		</p>
		<br />
	</div>
		<center>
			<table id="h">
				<tr id="h">
					<td id="h">
						<form METHOD="LINK" ACTION="">
						<input
						   type="submit"
						   class="groovybutton"
						   value="Home"
						   title="Link to our Home Page"
						   onMouseOver="goLite(this.form.name,this.name)"
						   onMouseOut="goDim(this.form.name,this.name)" />
						</form>

					</td>
					<td id="h">
						<form METHOD="LINK" ACTION="forums/" >
						<input
						   type="submit"
						   class="groovybutton1"
						   value="Forums"
						   title="Link to our Forums"
						   onMouseOver="goLite1(this.form.name,this.name)"
						   onMouseOut="goDim1(this.form.name,this.name)">
						</form>

					</td>
				</tr>
			</table>
<div id="p2" >
		<br />
		<H3>Welcome to Chillax</h3>
		<br />
		<p>
			We would like welcome you to Chillax.
		</p>
		<br />
		<br />
		
		<?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, 10" // 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 "<div id='p2'>";
	echo $list;
	echo "</div>";
?>

</div>
</body>


Thanks!
the closest thing i can see to this is
download prostats HERE

when installed activate it then go down to the bottom of the settings page in your admincp and activate xml feed

goto www.chillax-mc.com/forums/index.php?stats=xml

if it works then download this

upload it wherever you want to show the stats but if you want to show it on your main page www.chillax-mc.com add an iframe to the xml2html.php file if you need any further help reply back