So egal wie ich es anstelle . jedesmal stimmt bei mehreren das alter nicht
function its_age($date) {
$dif = 1;
$parts = explode ( '-', $date );
if ( $parts[0] < 1970 ) {
$dif = 1970 - $parts[0];
$parts[0] = $parts[0] + $dif;
}
$seconds = mktime ( 0, 0, 0, $parts[2], $parts[1], $parts[0] );
$seconds = time () - $seconds;
$age = date ( 'Y', $seconds ) - 1970 + $dif;
return ($age);
}
So ist es bei mir und 4 anderen von 11 richtig .
function its_age($date) {
$dif = 0;
$parts = explode ( '-', $date );
if ( $parts[0] < 1970 ) {
$dif = 1970 - $parts[0];
$parts[0] = $parts[0] + $dif;
}
$seconds = mktime ( 0, 0, 0, $parts[2], $parts[1], $parts[0] );
$seconds = time () - $seconds;
$age = date ( 'Y', $seconds ) - 1970 + $dif;
return ($age);
}
So ist es bei 5 anderen von 11 richtig
function its_age($date) {
list($y,$m,$d) = explode('-', $date);
$alter = date('Y') - $y;
return $alter;
}
und so das selbe ein paar richtig und die anderen falsch .
Hier nochmal die ganze original datei vieleicht weiss jemand anderes weiter .
<?php
# Copyright by: OloX
# Support: www.ilch.de
# www.dms-gaming.com [+] mairu.ilch.net
defined ('main') or die ( 'no direct access' );
function its_age($date) {
$dif = 0;
$parts = explode ( '-', $date );
if ( $parts[0] < 1970 ) {
$dif = 1970 - $parts[0];
$parts[0] = $parts[0] + $dif;
}
$seconds = mktime ( 0, 0, 0, $parts[2], $parts[1], $parts[0] );
$seconds = time () - $seconds;
$age = date ( 'Y', $seconds ) - 1970 + $dif;
return ($age);
}
$jsdir = 'include/includes/js/teamSlider';
$ILCH_HEADER_ADDITIONS .= sprintf("<link rel=\"stylesheet\" type=\"text/css\" href=\"include/includes/css/teamSlider/teamSlider.css\" />
<script type=\"text/javascript\" src=\"%s/jquery-1.4.2.min.js\"></script>
<script type=\"text/javascript\" src=\"%s/easySlider1.5.js\"></script>
<script type=\"text/javascript\" src=\"%s/teamSlider.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function(){
$(\"#ilchTeamSlider\").ilchTeamSlider({ boxWidth: %d,
pause: %d,
fadeSpeed: %d,
userAvatarHeight: %d,
userAvatarWidth: %d,
showUserData: %s,
userDatabelow: %s,
showUserNavi: %s,
vertical: %s
});
});
</script>", $jsdir, $jsdir, $jsdir, intval($allgAr['its_boxwidth']), intval($allgAr['its_pause']*1000), intval($allgAr['its_fadespeed']), intval($allgAr['Fahohe']), intval($allgAr['Fabreite']), $allgAr['its_showdetails'] == '1' ? 'true' : 'false', $allgAr['its_belowdetails'] == '1' ? 'true' : 'false', $allgAr['its_shownavi'] == '1' ? 'true' : 'false', $allgAr['its_vertical'] == '1' ? 'true' : 'false')."\n";
$tpl = new tpl ( 'box/teamslider' );
$i = 1;
$teamIds = array();
$q = db_query("SELECT `a`.`id`, `a`.`name`, COUNT(`b`.`uid`) AS `useranz`
FROM `prefix_groups` AS `a`
LEFT JOIN `prefix_groupusers` AS `b` ON `a`.`id` = `b`.`gid`
WHERE `a`.`zeigen` = 1 AND `a`.`show_its` = 1
GROUP BY `a`.`id`
HAVING `useranz` > 0
ORDER BY `a`.`pos` ASC");
if (db_num_rows($q) > 0 ) {
$tpl->out(0);
while ($row = db_fetch_object($q)) {
$teamIds[$i] = array('teamid' => $row->id,
'teamname' => $row->name,
'teamanz' => $row->useranz,
'teami' => $i);
$tpl->set_ar_out( array('teamname' => $row->name, 'teamanz' => $row->useranz, 'teami' => $i), 1);
$i++;
}
$tpl->out(2);
foreach ($teamIds as $key => $value) {
$tpl->set_out('teamnumber', $value['teami'], 3);
$query = db_query(sprintf("SELECT `b`.`uid`,`a`.`name`,`a`.`staat`, SUBSTRING_INDEX(`staat`, '.', 1) AS `bstaat` ,`a`.`avatar`,`a`.`gebdatum`,`a`.`wohnort`,`a`.`id` AS `userid`,`c`.`name` AS `teamtask`
FROM `prefix_groupusers` AS `b`
LEFT JOIN `prefix_user` AS `a` ON `b`.`uid` = `a`.`id`
LEFT JOIN `prefix_groupfuncs` AS `c` ON `b`.`fid` = `c`.`id`
WHERE `b`.`gid` = %d
ORDER BY `c`.`pos` ASC", $value['teamid']));
while ($r = db_fetch_object($query)) {
$tpl->set_ar_out( array('userid' => $r->userid,
'username' => $r->name,
'staat' => !empty($r->staat) ? '<img src="include/images/flags/'.$r->staat.'" alt="'.$r->bstaat.'" title="'.$r->bstaat.'" />' : '<img src="include/images/flags/na.png" alt="keine Angabe" title="keine Angabe" />',
'avatar' => file_exists($r->avatar) ? $r->avatar : 'include/images/avatars/wurstegal.jpg',
'age' => $r->gebdatum != '0000-00-00' ? its_age($r->gebdatum).' Jahre' : '0',
'teamtask' => $r->teamtask,
'wohnort' => empty($r->wohnort) ? 'n/a' : $r->wohnort), 4);
}
$tpl->set_out('teamnumber', $value['teami'], 5);
}
$tpl->out(6);
} else {
$tpl->out(7);
}
?>
wäre gut wenn mir da wer unter die arme greifen könnte .
Betroffene HP :
externer Link
Betroffenes Modul: Team Slider Modul 1.0
Herkunft aus erstem post dieses Beitrags ^^
externer Link
Bereich : include/boxes/teamslider.php
Zuletzt modifiziert von lostboy2003 am 03.03.2011 - 19:14:26