ogd39 wrote:Hello!
Would it be possible to create a blogs counter, which would show in real-time how many blogs do exist on a blogfarm?
and to meke this new data showable in a non-LT page (like "Displaying the most recent posts from all blogs" explanation in the wiki?)
Thanks
Here comes a exmpla, I think you can extent the function by yourself easily.
=== blogcount.php ====
- Code: Select all
<?php
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
$blogs = new Blogs();
$blogCount = $blogs->getNumBlogs();
$javaScript = "document.write("$blogCount");";
echo $javaScript;
?>
=== blogcount.html ====
- Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
</HEAD>
<BODY>
<script type="text/javascript" src="blogcount.php"></script>
</BODY>
</HTML>
try to put both file under your lifetype root, and type
http://yourdomain.blah/blogcount.html
You will see the blog count show up in html.
Mark