hier mein modul:
include/includes/func/all.php
nach dem
##
###
####
##### generey key with x length
function genkey ( $anz ) {
$letterArray = array ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9','0');
$key = '';
for ($i=0;$i < $anz ; $i ++)
{
mt_srand((double)microtime()*1000000);
$zufallZahl = mt_rand(0,62);
$key .= $letterArray[$zufallZahl];
}
return ( $key );
}
Das einfügen:
##
###
####
##### teamsals bildausgeben
function getteams ($id) {
$games='';
$ergg = db_query("SELECT b.name,b.id FROM prefix_groupusers a left join prefix_groups b ON a.gid = b.id WHERE uid =".$id);
if ( db_num_rows($ergg) == 0 ) {
$games="keine";
} else {
while ($rowg = db_fetch_assoc($ergg) ) {
if(file_exists('include/images/wargames/'.$rowg['name'].'.gif')){
$games.='<a href="index.php?team-show-'.$rowg['id'].'"><img src="include/images/wargames/'.$rowg['name'].'.gif" title="'.$rowg['name'].'" alt="'.$rowg['name'].'" border="0"></a> ';
} else {
$games.='<a href="index.php?team-show-'.$rowg['id'].'">'.$rowg['name'].'</a> ';
}
}
}
return ($games);
}
Meine include/contents/team.php (man achte auf das fehlende "s" )
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
function show_members ($gid,$tpl) {
global $allgAr;
# icq team bild, hier die zahl aendern.
$teams_show_icq_pic = 5;
$tpl->out(1);
$class = 'Cnorm';
$q = "SELECT b.uid, a.icq, a.avatar, a.status, a.name, c.name as posi, staat FROM prefix_groupusers b LEFT JOIN prefix_user a ON a.id = b.uid LEFT JOIN prefix_groupfuncs c ON b.fid = c.id WHERE b.gid = ".$gid." ORDER BY c.pos ASC, a.name ASC";
$erg = db_query($q);
while($row = db_fetch_assoc($erg) ) {
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$row['class'] = $class;
if ( $row['staat'] != '' ) {
$row['staat'] = '<img src="include/images/flags/'.$row['staat'].'" alt="" border="0">';
} else {
$row['staat'] = 'n/a';
}
$row['status'] = ($row['status']? 'aktiv' : 'inaktiv' );
if(!empty($row['icq'])){
$row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$row['icq'].'&action=add"><img src="http://wwp.icq.com/scripts/online.dll?icq='.$row['icq'].'&img='.$teams_show_icq_pic.'" valign="bottom" border="0"></a>';
} else {
$row['icq'] = '';
}
$row['games'] = getteams ($row['uid']);
if($allgAr['teams_show_list']==1){
if(empty($row['avatar'])){
$row['avatar'] = 'n/a';
} else {
$row['avatar'] = '<img src="'.$row['avatar'].'" alt="Avatar von '.$row['name'].'" border="0" >';
}
$tpl->set_ar_out($row,2);
} else {
$tpl->set_ar_out($row,3);
}
}
$tpl->out(4);
}
if ($menu->get(1) == 'show') {
$gid = escape($menu->get(2), 'integer');
$name = @db_result (db_query("SELECT name FROM prefix_groups WHERE zeigen = 1 AND id =".$gid));
$bild = @db_result (db_query("SELECT img FROM prefix_groups WHERE zeigen = 1 AND id =".$gid));
$title = $allgAr['title'].' :: Teams :: '.$name;
$hmenu = '<a class="smalfont" href="?team">Teams</a> » '.$name;
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('team');
if (!empty($bild) ) {
$show = '<img src="'.$bild.'" title="'.$name.'" alt="'.$name.'" border="0"></a>';
} else {
$show = '<b>'.$name.'</b>';
}
$tpl->set_out('show', $show,0);
show_members ($gid,$tpl);
} else {
$title = $allgAr['title'].' :: Teams';
$hmenu = 'Teams';
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('team');
$erg1 = db_query("SELECT name,img,id as gid FROM prefix_groups WHERE zeigen = 1 ORDER BY pos");
while ($row = db_fetch_assoc($erg1) ) {
if (!empty($row['img']) ) {
$row['show'] = '<a href="index.php?team-show-'.$row['gid'].'"><img src="'.$row['img'].'" title="'.$row['name'].'" alt="'.$row['name'].'" border="0"></a>';
} else {
$row['show'] = '<a href="index.php?team-show-'.$row['gid'].'"><b>'.$row['name'].'</b></a>';
}
$tpl->set_ar_out($row,0);
if ($allgAr['team_show_cat'] == 0) {
show_members ($row['gid'],$tpl);
}
}
}
$design->footer(0);
?>
Und meine include/templates/team.htm (man achte auf das fehlende "s" )
<table width="100%" cellpadding="3" border="0" cellspacing="3" class="border">
<tr class="Cdark">
<td colspan="6" valign="bottom" align="center">{show}</td>
</tr>
</table>
{EXPLODE}
<table width="100%" cellpadding="3" border="0" cellspacing="3" class="border">
{EXPLODE}
<tr class="{class}">
<td>
<table width="100%" cellpadding="2" border="0" cellspacing="1" colspan="3">
<tr class="{class}">
<td rowspan="3" width="20%" align="center" valign="middle"><a href="index.php?user-details-{uid}">{avatar}</a></td>
<td width="60%" align="center">
<a href="index.php?user-details-{uid}"><h3>{name}</h3></a><br/>
ICQ: {icq} <br/>
Land: {staat} <br/>
Position: {posi} <br/>
Status: {status} <br/>
Games: {games} <br/><br/>
</td></tr>
</table>
{EXPLODE}
<tr class="{class}">
<td width="25%"><a href="index.php?user-details-{uid}">{name}</a></td>
<td width="5%" align="center">{icq}</td>
<td width="15%">{posi}</td>
<td width="5%" align="center">{staat}</td>
<td width="15%">{status}</td>
<td width="35%">{games}</td>
</tr>
{EXPLODE}
</table>
<br />
Son nun noch im include/images/wargames Ordner die nötigen images rein bzw icons für die teams.
Im adminbereich teams anlegan mit dem name von den teambildern zB Bild heißt counterstrike.gif --- teamname ist counterstrike
Ich hoffe ich hab nix vergessen ....
EDIT: 8so im adminbereich unter navigation den link ändern zum sqard bzw zum memberlink von teams.php zu team.php
Zuletzt modifiziert von IceT33 am 10.03.2007 - 01:27:44