Table of Contents

NP_BlogOwner

This plugin shows multiple blog owner names (according to the blog id) with just one skin.

General Plugin info
Author: Rodrigo Moraes
Current Version: 1.1
Download: -
Code: code
Demo: -
Forum Thread: forum thread

Go to this forum thread for more info about this plugin.

Code

Here's the code you need to copy and paste into a file called NP_BlogOwner.php. Save, and upload to your plugins folder on the webserver. After uploading install using the plugin manager from the nucleus adminpanel.

<?php
class NP_BlogOwner extends NucleusPlugin {
	function getName() { return 'Blog Owner'; }
	function getAuthor()  { return 'Rodrigo Moraes'; }
	function getURL() {   return 'http://plugins.nucleuscms.org/blogowner'; }
	function getVersion() {   return '1.1'; }
	function supportsFeature($feature) {
		switch($feature) {
			case 'SqlTablePrefix': return 1;
			default: return 0;
		}
	}
	function getDescription() { return 'This plugin shows the blog owner name depending on the blog id.'; }
 
	function doSkinVar($skinType) {
		global $blogid;
 
		// associate blog ids (line below) with the blog owners (next line).
		// blog id =         0   1    2    3    4    5    ...
		$member_id = array ("", "4", "5", "7", "2", "15");
		// So, in the example above:
		// blog 1 belongs to member 4
		// blog 2 belongs to member 5
		// blog 3 belongs to member 7
		// blog 4 belongs to member 2
		// blog 5 belongs to member 15
		// ...
 
		if ($member_id[$blogid]) {
 
			$res = mysql_query("SELECT mrealname FROM ".sql_table('member')." WHERE mnumber = ".$member_id[$blogid]);
			if(mysql_num_rows($res) > 0) {
				$row = mysql_fetch_object($res);
				$name = $row->mrealname;
				echo $name;
			}
		}
	}
}
?>

Plugin review

NP_BlogOwner version 1.1 works with Nucleus CMS version 3.31 - 2007-10-30 kg

blogowner.txt · Last modified: 2007/10/30 20:19 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki