"Login") { $info = base64_decode("$users"); $info = explode(":", $info); $login = $info[0]; $pass = $info[1]; } if ($action == "logout") { unset($login); unset($pass); } if($action == "savevote") { $gres = mysql_query("SELECT * FROM ".$GLOBALS['db_weekQ']." WHERE id='$vid'") or die("LINE 4:".mysql_error()); $gar = mysql_fetch_array($gres); mysql_query("INSERT INTO ".$GLOBALS['db_weekA']." VALUES (0,'$vid','$pool')") or die("LINE 6:".mysql_error()); } function UnConvertHTML($txt) { $txt = eregi_replace( "\n", "
", $txt ); $txt = eregi_replace( "\[b\]", "", $txt ); $txt = eregi_replace( "\[i\]", "", $txt ); $txt = eregi_replace( "\[u\]", "", $txt ); $txt = eregi_replace( "\[/b\]", "", $txt ); $txt = eregi_replace( "\[/i\]", "", $txt ); $txt = eregi_replace( "\[/u\]", "", $txt ); return $txt; } // FRONT END FUNCTIONS /* if you want an image in the news inserted by the ing src html tag you have to mark the lines where target is in so $line 3 4 and 5 */ function ttl ($data='') { if(empty($data)) return $data; $lines = split("\n",$data); while(list($key,$line)=each($lines)) { if(!eregi("\\1",$line); $line = eregi_replace("(https://[^ )\r\n]+)","\\1",$line); $line = eregi_replace("(ftp://[^ )\r\n]+)","\\1",$line); $line = eregi_replace("([-a-z0-9_]+(\.[_a-z0-9-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)+))","\\1",$line); $newText .= $line . "\n"; } else $newText .= $line . "\n"; } return $newText; } function pic($string,$pic=1) { while(preg_match("/\[PIC=(\d+)\:(.+)\]/isU", $string, $data)) { list($null,$id,$align) = $data; $res = mysql_query("SELECT * from ".$GLOBALS['db_news_pics']." WHERE id=".$id) or die("LINE 71:".mysql_error()); $ar = mysql_fetch_array($res); $size = getimagesize($GLOBALS['news_path']."/".$ar[picture]); if($pic == 0) $pix=""; else $pix = '

'.$ar[description].'
'; $string = preg_replace("/(\[PIC=".$id.":".$align."\])/isU", $pix, $string); } return $string; } function Smiley($string) { $getsmiles = mysql_query("SELECT * FROM ".$GLOBALS['db_smileys']) or die (mysql_error()); while($sm = mysql_fetch_array($getsmiles)) $string = str_replace($sm[code], "\"\"", $string); return $string; } function formatTimestamp($time,$type=0) { ereg ("([0-9]{4})([0-9]{1,2})([0-9]{1,2})([0-9]{1,2})([0-9]{1,2})([0-9]{1,2})", $time, $datetime); if($type == 1) $output = "d.m.Y"; else $output = "j. F Y, H:i"; $datetime = date($output, mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); $datetime = eregi_replace("Januari",_JANUAR,$datetime); $datetime = eregi_replace("Februari",_FEBRUAR,$datetime); $datetime = eregi_replace("Maart",_MARCH,$datetime); $datetime = eregi_replace("April",_APRIL,$datetime); $datetime = eregi_replace("Mei",_MAY,$datetime); $datetime = eregi_replace("Juni",_JUNE,$datetime); $datetime = eregi_replace("Juli",_JULY,$datetime); $datetime = eregi_replace("Augustus",_AUGUST,$datetime); $datetime = eregi_replace("September",_SEPTEMBER,$datetime); $datetime = eregi_replace("Oktober",_OCTOBER,$datetime); $datetime = eregi_replace("November",_NOVEMBER,$datetime); $datetime = eregi_replace("December",_DECEMBER,$datetime); return($datetime); } function CheckLogin($login,$pass) { $passek = "notok"; if(empty($login)) return; $result = mysql_query("SELECT passwd FROM ".$GLOBALS['db_users']." WHERE uname='$login'") or die ("LINE 79:".mysql_error()); $ar = mysql_fetch_array($result); if(mysql_num_rows($result) == 1) if($ar[passwd] == "$pass") $passek="ok"; return $passek; } Function ShowLoginMenu($color) { $passek = CheckLogin($GLOBALS['login'],$GLOBALS['pass']); if ($passek <> "ok") { ?>








'._CHANGE_PASSWORD.'
'; echo ''._EDIT_PROFILE.'
'; echo ''._SUBMIT_NEWS.'
'; echo 'Logout

'; } } Function ShowSearch($color) { ?> 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) { ?> $values"; $procent = $myar[vote]/$myvres[suma]*100; printf ("",$procent); echo ""; } echo "
%
%.2f
"; echo '
  • '._WEEKLY_POLL.'
  • '; } 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); ?>
    '; echo ''; echo ''; echo '
    '; } function ShowBreakingNews($bgcolor="#fafafa",$border="#eeeeee",$width="100%") { ?>

    '".$ar[id]."' ORDER BY datum DESC LIMIT 5"); if(mysql_num_rows($res1)>0) { echo '
    '._MORE_ABOUT_IT.':
    '; echo ''; while($ar1 = mysql_fetch_array($res1)) echo ''; echo '
    '.formatTimestamp($ar1[datum],1).' » '.$ar1[headline].'
    '; } ?>


    0) $query .= " AND category=".$category; $query .=" ORDER BY datum DESC LIMIT $start,$hits"; $res = mysql_query($query) or die("".mysql_error()." Error:".mysql_error()); ?>



    ".mysql_errno()." Error:".mysql_error()); ?>
    /

    //added this part to show picture is in the news preview ';?> //end added


    ",$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]); ?>
    /

    ".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]))); ?>


    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 "
    "; ?>
    here'; else { ?>

    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 ''.$ar[topictext].''; 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 ''.$ar[topictext].''; 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]); ?>
    /

    '; echo "".$ar[preview]."

    "; } ?>

    Error:".mysql_error()); $num = mysql_num_rows($res); echo ''; while($ar = mysql_fetch_array($res)) { echo ''; } echo '
    '.formatTimestamp($ar[datum],1).' » '.$ar[headline].'
    '; echo "
    "; } function ShowPartnersPage() { echo '
    '._PARTNERS_LIST.':
    '; echo ''; $res = mysql_query("SELECT * FROM ".$GLOBALS['db_partners']." ORDER BY name;"); while($ar=mysql_fetch_array($res)) { echo ''; } echo '
    '; echo ''.$ar[name].'
    '; echo '
    '.$ar[description].'
    '; echo '
    '; } function ShowWeeklyPollPage($width="100%") { $query = "SELECT * FROM ".$GLOBALS['db_weekQ']; if(!empty($GLOBALS['mpid'])) $query .= " WHERE id='".$GLOBALS['mpid']."' "; $query .= " ORDER BY id DESC LIMIT 1"; $gres = mysql_query($query); $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); ?>
    "; $resf = mysql_query("SELECT * FROM weekQ ORDER BY id DESC"); echo _WEEKLY_POLL.": "; echo ""; echo " "; echo " "; echo "

    "; ?>

    :
    :

    0) { ?> "; echo ""; echo ""; $procent = $myar[vote]/$myvres[suma]*100; printf ("",$procent,$procent); echo ""; } echo "
    space %
    $x$values$myar[vote]%.2f %%
    "; } else echo '

    '._NO_VOTE_YET.'

    '; } 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 ''; echo ''; while ($ar = mysql_fetch_array($res)) { $x++; $ar[description] = ereg_replace($GLOBALS['query'], "".$GLOBALS['query']."", $ar[description]); $ar[name] = ereg_replace($GLOBALS['query'], "".$GLOBALS['query']."", $ar[name]); $ar[uname] = ereg_replace($GLOBALS['query'], "".$GLOBALS['query']."", $ar[uname]); $tb++; $barva=$color1; if ($tb == 2) { $tb=0; $barva=$color2;} echo ''; echo ''; echo ''; } echo '
    #'._NEWS.'
    '.$f++.''.$ar[headline].' / '.$ar[author].'
    '.pic(ttl(smiley($ar[preview]))).'
    '; } else echo '

    '._NO_RESULT_FOUND.'

    '; } function ShowAddNewsPage() { if($GLOBALS['subaction'] == "savenews") { if (!empty($GLOBALS['headline']) && !empty($GLOBALS['preview'])) { $GLOBALS['nmessage'] = ereg_replace( "\n", "
    ",$GLOBALS['nmessage']); $GLOBALS['nmessage'] = ereg_replace( "'", "´",$GLOBALS['nmessage']); $GLOBALS['headline'] = ereg_replace( "\"", """,$GLOBALS['headline']); $GLOBALS['headline'] = ereg_replace( "\n", " ",$GLOBALS['headline']); $GLOBALS['preview'] = ereg_replace( "\n", "
    ",$GLOBALS['preview']); $res2 = mysql_query("SELECT * FROM ".$GLOBALS['db_pnews']." WHERE preview='".$GLOBALS['preview']."'"); if(mysql_num_rows($res2)<1){$res = mysql_query("INSERT INTO ".$GLOBALS['db_pnews']." VALUES(0,'".$GLOBALS['headline']."','".$GLOBALS['login']."','".$GLOBALS['msection']."','',CURRENT_TIMESTAMP,'".$GLOBALS['preview']."','".$GLOBALS['nmessage']."','uk')") or die("error
    ");} echo '

    News Received:

    Your news will be checked by administrator before it will appear on the page.'; } } else { if(empty($GLOBALS['login'])) return; echo '

    Write News

    '; ?>


    :





    alert('Password was gewijzigd.');"; } else echo ""; } echo '

    Wijzig Password voor '.$GLOBALS['login'].'

    '; ?>







    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'].'

    '; ?>







    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

    '; ?>
    :


    $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 '

    '._SIGNUP.'

    '; ?>













    '; for($i=1; $i<$first_week_day; $i++) echo ''; $firstweek = false; } if($wday==0) echo ''; // make each day linkable to the following result.php page if(intval($month_num)<10) $new_month_num = "0$month_num"; elseif(intval($month_num)>=10) $new_month_num = $month_num; if(intval($day)<10) $new_day = "0$day"; elseif(intval($day)>=10) $new_day = $day; $link_date = "$year$new_month_num$new_day"; echo ''; if($wday==6) echo "\n"; $wday++; $wday = $wday % 7; $day++; } if($wday<6) { for($wday;$wday<7;$wday++) echo ''; echo ""; } echo "
    '; if($link_date == $danes) echo ''; $query = "SELECT * FROM ".$GLOBALS['db_news']." WHERE lang='".$GLOBALS['dlang']."' AND datum LIKE '".$year.$new_month_num.$new_day."%' "; $res = mysql_query($query) or die("".mysql_errno()." Error:".mysql_error()); if(mysql_num_rows($res)>0) echo ' '.$day.' '; else echo ''.$day.''; if($link_date == $danes) echo ""; echo '
    "; ?>
    Gallery: '.$ar2[name].'

    '; $res3 = mysql_query("SELECT * FROM ".$GLOBALS['db_gallery_groups']." WHERE root='$id'"); while($ar3 = mysql_fetch_array($res3)) echo '

  • '.$ar3[name].'

    '; echo ''; $res = mysql_query("SELECT * FROM ".$GLOBALS['db_gallery']." WHERE root='".$id."'") or die("LINE 1088:".mysql_error()); $x=0; while ($ar = mysql_fetch_array($res)) { $x++; if($x==1) echo ''; echo ''; if($x==4) {echo '';$x=0;}; } if($x==1) echo ''; echo '
    '; if(!empty($ar[picture]) && file_exists($GLOBALS['gallery_path']."/".$ar[picture])) echo ''.$ar[name].''; // added next line to show name echo '

    '.$ar[name].'
    '; echo '
    '; } function ShowPicture($id) { $res = mysql_query("SELECT * FROM ".$GLOBALS['db_gallery']." WHERE id='".$id."'") or die("LINE 238:".mysql_error()); $ar = mysql_fetch_array($res); $res2 = mysql_query("SELECT * FROM ".$GLOBALS['db_gallery_groups']." WHERE id='$ar[id]'"); $ar2 = mysql_fetch_array($res2); echo '

    Gallery: '.$ar2[name].'

    '; echo '

    '; if(!empty($ar[picture]) && file_exists($GLOBALS['gallery_path']."/".$ar[picture])) echo ''.$ar[name].''; echo '

    '; echo '
    '.$ar[name].'
    '; echo '
    '.$ar[description].'
    '; } function ShowScrollNews($num,$delay=3000,$width=150,$height=150,$type=0) { ?> 0) $query .= " OR "; $datum = date ("Y-m-d", mktime (0,0,0,$now[mon],$now[mday]+$x,$now[year])); $query .= " datum='$datum'"; } $query .= " ORDER BY datum"; $res = mysql_query($query); while($ar = mysql_fetch_array($res)) { $dat = explode("-",$ar[datum]); $datum = date ("Y-m-d", mktime (0,0,0,$dat[1],$dat[2],$dat[0])); $datums = date("d.m", mktime(0,0,0,$dat[1],$dat[2],$dat[0])); $dan = date("D", mktime(0,0,0,$dat[1],$dat[2],$dat[0])); $picture = ''.$datums.''; $link = $GLOBALS['PHP_SELF']."?action=show&type=weather&date=".$datum; $dan = eregi_replace("Ma",_MON,$dan); $dan = eregi_replace("Di",_TUE,$dan); $dan = eregi_replace("Wo",_WED,$dan); $dan = eregi_replace("Do",_THU,$dan); $dan = eregi_replace("Vr",_FRI,$dan); $dan = eregi_replace("Za",_SAT,$dan); $dan = eregi_replace("Zo",_SUN,$dan); $temp = eregi_replace("DATE",$datums,$template); $temp = eregi_replace("DAY",$dan,$template); $temp = eregi_replace("PICTURE",$picture,$temp); $temp = eregi_replace("LINK",$link,$temp); $temp = eregi_replace("MORNING",$ar[morning],$temp); $temp = eregi_replace("DAILY",$ar[daily],$temp); echo $temp; } } function ShowDailyWeather($datum) { $res = mysql_query("SELECT * FROM ".$GLOBALS['db_weather']." WHERE datum='".$datum."'") or die("LINE 1411:".mysql_error()); $ar = mysql_fetch_array($res); $ar[description] = eregi_replace("\n","
    ",$ar[description]); $dat = explode("-",$ar[datum]); $datums = date("d.m, Y", mktime(0,0,0,$dat[1],$dat[2],$dat[0])); $dan = date("l", mktime(0,0,0,$dat[1],$dat[2],$dat[0])); $dan = eregi_replace("Maandag",_MONDAY,$dan); $dan = eregi_replace("Dinsdag",_TUESDAY,$dan); $dan = eregi_replace("Woensdag",_WEDNESDAY,$dan); $dan = eregi_replace("Donderdag",_THURSDAY,$dan); $dan = eregi_replace("Vrijdag",_FRIDAY,$dan); $dan = eregi_replace("Zaterdag",_SATURDAY,$dan); $dan = eregi_replace("Zondag",_SUNDAY,$dan); ?>


    : °C
    : °C

    ".pic(UnConvertHTML($ar[description]));?>