Location: PHPKode > scripts > Moderator Anchor Text Links > moderator-links/install.xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD. No support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.0.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
		<title lang="en">Moderator Anchor Text Links</title>
		<description lang="en">This mod allows you to display links with user chosen anchor text (link text) for all board moderators on the front page of your forum. This is an excellant incentive for moderators as it gives them a quality link to their website using their chose anchor text for SEO purposes.</description>
		<author-notes lang="en">This mod was designed and tested on pbpBB3 version 3.0.6, it has not been tested on other versions.</author-notes>
		<author-group>
			<author>
				<realname>DamnCoders</realname>
				<email>hide@address.com</email>
				<username>Feydakin</username>
				<homepage>http://damncoders.com</homepage>
			</author>
		</author-group>
		<mod-version>1.0.0</mod-version>
		<installation>
			<level>intermediate</level>
			<time>900</time>
			<target-version>3.0.6</target-version>
		</installation>
		<history>
			<entry>
				<date>2010-14-02</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en">
					<change>Initial release.</change>
				</changelog>
			</entry>
		</history>
		<link-group>
			<link type="template" href="contrib/templates/subsilver2.xml" lang="en">subsilver2</link>
		</link-group>
	</header>
	<action-group>
		<open src="index.php">
			<edit>
				<find><![CDATA[//Generate top poster list if enabled]]></find>
				<action type="above-add"><![CDATA[// Start moderator links mod
$zout = $auth->acl_get_list(false, array('a_', 'm_'), false);
foreach($zout[0][m_] as $zuser_id){
  $sql = "select user_id, username, user_website, user_linktext FROM " . USERS_TABLE . " WHERE user_id='$zuser_id'";
  $result = $db->sql_query($sql);
	while ($user_data = $db->sql_fetchrow($result)){
	  $thisusername = $user_data['username'];
	  $thisuserid = $user_data['user_id'];
	  if($user_data['user_website'] != ""){
		  $moderators .= "<a href='" . generate_board_url() . "/profile.php?mode=viewprofile&u=" . $thisuserid . "' style='text-decoration:none;'><b>" . $thisusername . "</b></a>: \n";	
      $zsql = "select pf_user_linktext FROM " . PROFILE_FIELDS_DATA_TABLE . " WHERE user_id='$zuser_id'";
      $zresult = $db->sql_query($zsql);
	    $zdata = $db->sql_fetchrow($zresult);
		  $temp = $zdata['pf_user_linktext'];
		  if($temp == ""){
			  $temp = str_replace("http://", "",$user_data['user_website']);
		  }
		  $moderators .= "<a href='" . $user_data['user_website'] . "' target='_blank' style='text-decoration:none;'>" . $temp . "</a> &bull;\n";
	  }
  }
}
$moderator_links  = "<div style='line-height:150%;'>\n";
$moderator_links .= $moderators;
$moderator_links .= "</div>\n";
// End moderator links mod]]></action>
			</edit>
			<edit>
				<find><![CDATA[$template->assign_vars(array(]]></find>
				<action type="after-add"><![CDATA['MODERATOR_LINKS' => $moderator_links,]]></action>
			</edit>
		</open>
		<open src="styles/prosilver/template/index_body.html">
			<edit>
				<find><![CDATA[Where ever you want output to be displayed.]]></find>
				<action type="after-add"><![CDATA[{MODERATOR_LINKS}]]></action>
			</edit>
		</open>
		<diy-instructions lang="en">============================================================
Administration Panel: ACP (Setup Custom Field)
============================================================

Click on Users &amp; Groups tab.
Click on Custom profile fields menu item.
Select Single text field from the dropdown.

Click Create new field button.

  For 'Field identification' field put: user_linktext
  For 'Field name/title presented to the user' field put: Website Link Text
  For 'Display in user control panel' checkbox, check it.
  For 'Hide profile field' checkbox, check it.

Click the Profile type specific options button.

  For 'Length of input box' field put: 30
  For 'Maximum number of characters' field put: 60

Click the Language specific options button.

Click the Save button.
</diy-instructions>
	</action-group>
</mod>
Return current item: Moderator Anchor Text Links