NEW OPTIONAL ADDITION!
This changes the link in the postbit (it links to the clan page) to a javascript popup sorta like when you click the number of users that have installed a hack. Here's what to do:
STEP 1:
OPEN *FORUMROOT*/admin/functions.php
FIND:
Code:
// SHOW CLAN START
global $DB_site;
$clanfetch=$DB_site->query("SELECT * FROM clan WHERE clanid='$post[clan]'");
$clan=$DB_site->fetch_array($clanfetch);
if ($post[clan]==0 OR !$post[clan]) {
$showuserclan = "Not in Clan";
} else {
$showuserclan = "Clan:<br><a href=\"showclans.php?s=$session[sessionhash]&what=users&clanid='$post[clan]'\">$clan[title]</a>";
}
// END SHOW CLAN
REPLACE THE ENTIRE THING WITH:
Code:
// SHOW CLAN START
global $DB_site;
$clanfetch=$DB_site->query("SELECT * FROM clan WHERE clanid='$post[clan]'");
$clan=$DB_site->fetch_array($clanfetch);
if ($post[clan]==0 OR !$post[clan]) {
$showuserclan = "Not in Clan";
} else {
$showuserclan = "Clan:<br><a href=\"javascript:clanopen($post[clan])\">$clan[title]</a>";
}
// END SHOW CLAN
STEP 2:
Open *FORUMROOT*/misc.php
FIND:
ADD RIGHT ABOVE THAT:
Code:
// ############################### start users ###############################
if ($action=="clanusers") {
$templatesused = "clanusers,clanusersbit";
include("./global.php");
$clanusers = '';
$users = $DB_site->query("SELECT * FROM user WHERE clan='$clanid'");
$usertotal=$DB_site->query("SELECT COUNT(*) AS total FROM user WHERE clan=$clanid");
while ($clanusers=$DB_site->fetch_array($users)) {
if (($counter++ % 2) != 0) {
$backcolor="{firstaltcolor}";
$bgclass="alt1";
} else {
$backcolor = "{secondaltcolor}";
$bgclass="alt2";
}
eval("\$clanuserlist .= \"".gettemplate("clanusersbit")."\";");
}
while ($totalusers = $DB_site->fetch_array($usertotal)) {
$allusertotal += $totalusers[total];
$allusertotal = number_format($allusertotal);
eval("dooutput(\"".gettemplate("clanusers")."\");");
}
}
FINAL STEP:
ENTER YOUR ADMIN CP, GO INTO THE STYLE YOU WILL HAVE THIS IN, THEN GO TO THE "HEAD INSERT" TEXT FIELD.
FIND:
Code:
.sf {
FONT-FAMILY: verdana, arial, helvetica, sans-serif;
FONT-SIZE: 10px;
}
</style>
ADD BELOW:
Code:
<script language="javascript" type="text/javascript">
<!--
function clanopen(clanid) {
window.open("misc.php?s=$session[sessionhash]&action=clanusers&clanid="+clanid,"_blank","toolbar=no,location=no,menubar=no,scrollbars=yes,width=200,height=275,resizeable=no,status=no")
}
// -->
</script>
Wow, wasn't that easy :banana:
THere's a demo
HERE
Click on the clan name (liver)