}
Function ShowWeeklyPoll($color)
{
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_weekQ']." ORDER BY id DESC LIMIT 1") or die("LINE 170:".mysql_error());
if(mysql_num_rows($res)==0) return;
$ar = mysql_fetch_array($res);
if($GLOBALS['weeklypoll'] == $ar[id])
{
$gres = mysql_query("SELECT * FROM ".$GLOBALS['db_weekQ']." ORDER BY id DESC LIMIT 1");
$gar = mysql_fetch_array($gres);
$pid = $gar[id];
$myvote = mysql_query("SELECT COUNT(*) AS suma FROM ".$GLOBALS['db_weekA']." WHERE wid='".$pid."'");
$myvres = mysql_fetch_array($myvote);
$mytxt = _NUMBER_OF_VOTES.": ".$myvres[suma];
echo '
'.$gar[1].'
';
if($myvres[suma]>0)
{
?>
=_ANSWERS;?>
%
$odg = explode (":", $gar[2]);
while ( list ($key,$values)= each($odg))
{
$x++;
$myres = mysql_query("select count(*) as vote from ".$GLOBALS['db_weekA']." where wid=$pid and answer=$key;");
$myar = mysql_fetch_array($myres);
echo "
';
}
return;
}
$odg = explode (":", $ar[2]);
$myvote = mysql_query("SELECT COUNT(*) AS suma FROM ".$GLOBALS['db_weekA']." WHERE wid='".$ar[id]."'");
$myvres = mysql_fetch_array($myvote);
?>
}
function ShowPartners($color="#000000")
{
?>
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_partners']." WHERE main=1 AND gfx=0 ORDER BY name;");
while($ar=mysql_fetch_array($res))
echo '· '.$ar[name].' ';
echo " ";
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_partners']." WHERE main=1 AND gfx=1 ORDER BY name;");
while($ar=mysql_fetch_array($res))
echo ' ';
echo ''._MORE.' ';
echo '
';
echo '
';
echo '
';
echo ' ';
}
function ShowBreakingNews($bgcolor="#fafafa",$border="#eeeeee",$width="100%")
{
?>
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_news']." WHERE type='2'");
$ar = mysql_fetch_array($res);
$datum = formatTimestamp($ar[datum]);
?>
=pic(smiley(ttl($ar[preview])));?>
$res1 = mysql_query("SELECT * FROM ".$GLOBALS['db_news']." WHERE story='".$ar[story]."' AND id<>'".$ar[id]."' ORDER BY datum DESC LIMIT 5");
if(mysql_num_rows($res1)>0)
{
echo '
}
function ShowDailyNews($datum,$page,$hits,$category=0)
{
$start = $hits*($page-1);
$query = "SELECT * FROM ".$GLOBALS['db_news']." WHERE datum LIKE '".$datum."%'";
$query .=" ORDER BY datum DESC LIMIT $start,$hits";
$res = mysql_query($query) or die("".mysql_errno()." Error:".mysql_error());
?>
while ($ar = mysql_fetch_array($res))
{
$res2 = mysql_query("SELECT email FROM ".$GLOBALS['db_admin']." WHERE uname='$ar[author]'");
if(mysql_num_rows($res2) == 0)
mysql_query("SELECT email FROM ".$GLOBALS['db_users']." WHERE uname='$ar[author]'");
$ar2 = mysql_fetch_array($res2);
$res3 = mysql_query("SELECT * FROM ".$GLOBALS['db_topic']." where id='$ar[category]'");
$ar3 = mysql_fetch_array($res3);
$datum = formatTimestamp($ar[datum]);
?>
//added this part to show picture is in the news preview
';?>
//end added
=pic(smiley(ttl(UnConvertHTML($ar[preview]))));?>
}
?>
}
function ShowNews($id)
///preview is a short text line
///tekst is the real news
{
if ($GLOBALS['subaction']=="addcomment")
{
$GLOBALS['comment'] = ereg_replace( "\n"," ",$GLOBALS['comment']);
$GLOBALS['comment'] = ereg_replace( "\"",""",$GLOBALS['comment']);
$GLOBALS['comment'] = ereg_replace( "'","´",$GLOBALS['comment']);
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_news_comments']." WHERE tekst='".$GLOBALS['comment']."'");
$num = mysql_num_rows($res);
if(empty($num)) $num=0;
if($num==0)
$res = mysql_query("INSERT INTO ".$GLOBALS['db_news_comments']." VALUES (0,'$id','".$GLOBALS['login']."',CURRENT_TIMESTAMP,'".$GLOBALS['comment']."')");
}
mysql_query("UPDATE ".$GLOBALS['db_news']." SET views=views+1 WHERE id='".$id."'");
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_news']." WHERE id='".$id."'") or die("LINE 238:".mysql_error());
while ($ar = mysql_fetch_array($res))
{
$res2 = mysql_query("SELECT email FROM ".$GLOBALS['db_users']." WHERE uname='$ar[author]'");
$ar2 = mysql_fetch_array($res2);
$res3 = mysql_query("SELECT topicimage FROM ".$GLOBALS['db_topic']." WHERE id='$ar[category]'");
$ar3 = mysql_fetch_array($res3);
$datum = formatTimestamp($ar[datum]);
?>
=$ar[headline];?>
=_POSTED_BY;?> =$ar[author];?> / =$datum;?>
// added UnconcertHtml to show the image
echo "".pic(smiley(ttl(UnConvertHTML($ar[preview]))))."
";
// added this part to show picture is in the news
if(!empty($ar[picture]) && file_exists.($GLOBALS['news_pics_path'].$ar[picture]))
echo '';
echo "
".pic(ttl(smiley($ar[tekst])));
?>
}
?>
=_USER_COMMENTS;?>
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_news_comments']." WHERE nid='$id' ORDER BY datum") or die("Error:".mysql_error());
$num = mysql_num_rows($res);
$k=0;
while ($ar = mysql_fetch_array($res))
{
$datum = formatTimestamp($ar[datum]);
$k++;
if($k == 2) {$k=0;$mycol ="fefefe";} else $mycol = "f9f9f9";
echo '
';
echo "By ".$ar[author]." on ".$datum.":";
echo smiley(ttl($ar[tekst])).'
';
$res2=mysql_query("SELECT * from ".$GLOBALS['db_users']." where uname='$ar[author]'");
$ar2=mysql_fetch_array($res2);
}
echo "
";
?>
=_WRITE_COMMENT;?>
if (empty($GLOBALS['login']))
echo _PLEASE_LOGIN_FIRST; //echo 'Please login first! If you still dont have an account, register it here';
else
{
?>
}
?>
}
function ShowNewsGroups($type=0,$br=0,$template="")
{
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_topic']);
if(mysql_num_rows($res)>0)
while($ar = mysql_fetch_array($res))
{
if(!empty($template))
{
$temp = eregi_replace("GROUP_NAME",$ar[topictext],$template);
$link = $GLOBALS['PHP_SELF'].'?newsgroup='.$ar[id];
$temp = eregi_replace("GROUP_LINK",$link,$temp);
echo $temp;
}
else
{
if($type == 0 || $type == 2) echo ''.$ar[topictext].'';
if($type == 1 || $type == 2) echo '';
if($br == 1) echo " ";
}
}
}
function ShowGalleryGroups($type=0,$br=0,$template="")
{
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_gallery_groups']." WHERE root='0'") or die(mysql_error());
if(mysql_num_rows($res)>0)
while($ar = mysql_fetch_array($res))
{
if(!empty($template))
{
$temp = eregi_replace("GALLERY_NAME",$ar[name],$template);
$link = $GLOBALS['PHP_SELF'].'?action=show&type=gallery&id='.$ar[id];
$temp = eregi_replace("GALLERY_LINK",$link,$temp);
echo $temp;
}
else
{
if($type == 0 || $type == 2) echo ''.$ar[topictext].'';
if($type == 1 || $type == 2) echo '';
if($br == 1) echo " ";
}
}
}
function ShowStoryGroups($type=0,$br=0,$template="")
{
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_story']);
if(mysql_num_rows($res)>0)
while($ar = mysql_fetch_array($res))
{
if(!empty($template))
{
$temp = eregi_replace("STORY_NAME",$ar[headline],$template);
$link = $GLOBALS['PHP_SELF'].'?action=show&type=story&id='.$ar[id];
$temp = eregi_replace("STORY_LINK",$link,$temp);
echo $temp;
}
else
{
if($type == 0 || $type == 2) echo ''.$ar[topictext].'';
if($br == 1) echo " ";
}
}
}
/// the contentpart of the story below the text to show is called preview
function ShowStoryPage($id)
{
mysql_query("UPDATE ".$GLOBALS['db_story']." SET views=views+1 WHERE id='".$id."'");
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_story']." WHERE id='".$id."'") or die("LINE 238:".mysql_error());
while ($ar = mysql_fetch_array($res))
{
$res2 = mysql_query("SELECT email FROM ".$GLOBALS['db_users']." WHERE uname='$ar[author]'");
$ar2 = mysql_fetch_array($res2);
$res3 = mysql_query("SELECT topicimage FROM ".$GLOBALS['db_topic']." WHERE id='$ar[category]'");
$ar3 = mysql_fetch_array($res3);
$datum = formatTimestamp($ar[datum]);
?>
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_news']." WHERE story='$id' ORDER BY datum DESC") or die("Error:".mysql_error());
$num = mysql_num_rows($res);
echo '
$odg = explode (":", $gar[2]);
while ( list ($key,$values)= each($odg))
{
$x++;
$myres = mysql_query("select count(*) as vote from ".$GLOBALS['db_weekA']." where wid=$pid and answer=$key;");
$myar = mysql_fetch_array($myres);
echo "
';
}
function ShowSearchPage($color1="#fafafa",$color2="#eeeeee")
{
echo '
'._SEARCHING_FOR.': '.$GLOBALS['query'].'
';
$f=1; $tbs=0;
$quer = '%'.$GLOBALS['query'].'%';
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_news']." WHERE (preview like '$quer' or tekst like '$quer')");
if(mysql_num_rows($res)>0)
{
echo '
Your news will be checked by administrator before it will appear on the page.';
}
}
else
{
if(empty($GLOBALS['login']))
return;
echo '
Write News
';
?>
}
}
function ShowChangePassPage()
{
if(empty($GLOBALS['login']))
return;
if($GLOBALS['subaction'] == "changepass")
{
$res = mysql_query("select passwd FROM ".$GLOBALS['db_users']." WHERE uname='".$GLOBALS['login']."'");
$ar = mysql_fetch_array($res);
if ($ar[passwd] == $GLOBALS['oldpass'])
{
if($GLOBALS['newpass'] == $GLOBALS['newpass2'])
$res = mysql_query("UPDATE ".$GLOBALS['db_users']." SET passwd='".$GLOBALS['newpass']."' WHERE uname='".$GLOBALS['login']."'");
echo "";
}
else
echo "";
}
echo '
Wijzig Password voor '.$GLOBALS['login'].'
';
?>
}
function ShowEditUser()
{
if($GLOBALS['subaction'] == "update")
{
mysql_query("UPDATE ".$GLOBALS['db_users']." SET email='".$GLOBALS['email']."', name='".$GLOBALS['names']."', info='".$GLOBALS['infos']."' WHERE uname='".$GLOBALS['login']."'") or die ("ERROR".mysql_error());
echo '
Profiel voor gebruiker '.$GLOBALS['login'].' is gewijzigd.
';
}
else
{
$res = mysql_query("SELECT * FROM ".$GLOBALS['db_users']." WHERE uname='".$GLOBALS['login']."'");
$ar = mysql_fetch_array($res);
echo '
Pas profiel aan voor gebruiker: '.$GLOBALS['login'].'
';
?>
}
}
function ShowLostPassword()
{
if($GLOBALS['subaction'] == "sendpass")
{
$res0 = mysql_query("SELECT * FROM ".$GLOBALS['db_users']." WHERE uname='".$GLOBALS['nlogin']."'");
$ar0 = mysql_fetch_array($res0);
if($ar0[uname] == $GLOBALS['nlogin'])
{
echo '
Je password is naar je email adres gestuurd.
';
mail($ar0[email],"Password","Beste ".$GLOBALS['nlogin'].",\n\n Je password is: $ar0[passwd] \n","From: ".$GLOBALS['admin_email']."\n");
}
}
else
{
echo '
Password Kwijt
';
?>
}
}
function ShowSignup()
{
$res = mysql_query("SELECT uname FROM ".$GLOBALS['db_users']." WHERE uname='".$GLOBALS['nlogin']."'");
$ar = mysql_fetch_array($res);
if($GLOBALS['subaction'] == "save")
if(($GLOBALS['passwd'] <> $GLOBALS['chkpass']) || empty($GLOBALS['nlogin']) || empty($GLOBALS['passwd']) || ($ar[uname] == $GLOBALS['nlogin']))
{
echo "";
unset($GLOBALS['subaction']);
}
if($GLOBALS['subaction'] == "save")
{
mysql_query("INSERT INTO ".$GLOBALS['db_users']." VALUES(0,'".$GLOBALS['nlogin']."','".$GLOBALS['passwd']."','".$GLOBALS['email']."','".$GLOBALS['infos']."','".$GLOBALS['rname']."')") or die("error");
echo '
Welkom, '.$GLOBALS['nlogin'].'
';
echo ''.$GLOBALS['nlogin'].', you\'re member of our service now. Check email box for further instructions.';
echo $GLOBALS['email'];
mail($GLOBALS['email'],"Signup","Dear ".$GLOBALS['nlogin'].",\n\nYour informations:\n\n username: ".$GLOBALS['nlogin']."\npassword: ".$GLOBALS['passwd']."\n\n","From: ".$GLOBALS['admin_email']."\n");
}
else
{
echo '