php Class Controller_panel Extends Controller_Base {
function index() { $this->r['tpl']->define (array ('index.tpl', 'panel/gebruikerspaneel.tpl'));
if($this->r['client']->ingelogd == 1) { $this->r['tpl']->assign ("Gebruikerspaneel", "sProfile_id", $this->r['functions']->strip ($this->r['user']['pid'])); $this->r['tpl']->assign ("Gebruikerspaneel", "sVoornaam", $this->r['functions']->strip ($this->r['user']['voornaam'])); $this->r['tpl']->assign ("Gebruikerspaneel", "sGebruikersnaam", $this->r['functions']->strip ($this->r['user']['gebruikersnaam'])); $this->r['tpl']->Parse ("index", "Gebruikerspaneel", "content"); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen toegang tot het gebruikerspaneel als je niet bent ingelogd.', 'members/login', 3); } function msn_invite () { $this->r['tpl']->define (array ('index.tpl', 'panel/msn_invite.tpl', 'panel/msn_inviten.tpl'));
if($this->r['client']->ingelogd == 1) {
include( 'classes/grabber.class.inc.php' );
if ( $_SERVER[ 'REQUEST_METHOD' ] == 'POST' && isset( $_POST[ 'ophalen' ] ) ) { if ( ( ! empty( $_POST[ 'passport' ] ) ) && ( ! empty( $_POST[ 'password' ] ) ) ) { $MSN = new Grabber; if ( $MSN -> getContacts( $_POST[ 'passport' ], $_POST[ 'password' ] ) ) { $i = 0; if ( count( $MSN -> Contacts ) == 0 ) { echo 'Er zijn helaas geen contacten gevonden.'; } else { foreach( $MSN -> Contacts AS $Mail ) { if ( ! mysql_result( mysql_query( "SELECT COUNT( 1 ) FROM `msnblocked` WHERE `email` = '" . $Mail . "'" ), 0 ) > 0 ) { $sEmail = $this->r['sql']->query ("SELECT pid FROM ##emails WHERE `emailadres` = '" . $Mail . "'" ); $sMember = $this->r['sql']->query ( "SELECT pid FROM ##profielen WHERE `emailadres` = '" . $Mail . "'" ); if ( $this->r['sql']->rows ( $sMember) ) { $this->r['tpl']->assign ("sAdres_R", "sAdres", '<input type="checkbox" name="checkbox[]" value="' . $Mail . '" disabled="disabled" />' . $Mail . ' <b><font color="red">'.($this->r['sql']->rows ($sEmail) ? "[is al ge-emaild]" : "[is al lid]").'</font></b>'); } else { $this->r['tpl']->assign ("sAdres_R", "sAdres", '<input type="checkbox" name="checkbox[]" value="' . $Mail . '" checked />' . $Mail . ''); } $this->r['tpl']->Parse ("Inviten", "sAdres_R"); $i++; } } $this->r['tpl']->assign ("Inviten", "sEmail", $_POST[ 'passport' ]); $this->r['tpl']->Parse ("index", "Inviten", "content"); } } else { echo 'Het is niet gelukt om de contacten op te halen.. <a href="javascript:history.go(-1);">Ga terug!</a>'; } } else { echo 'U heeft geen passport of wachtwoord opgegeven.. <a href="javascript:history.go(-1);">Ga terug!</a>'; } } # Finaly the sending to the checked addresses elseif ( $_SERVER[ 'REQUEST_METHOD' ] == 'POST' && isset( $_POST[ 'submit' ] ) && $_POST[ 'submit' ] == 'Versturen' ) { $Explode = explode( '@', $this->r['cfg']->site_email ); $i = 0;
if ( ! isset( $_POST[ 'checkbox' ] ) ) redirect ('Fout', 'Je moet minimaal ??n persoon aanklikken om uit te nodigen, begin opnieuw.', 'panel/msn_invite', 3); else { foreach( $_POST[ 'checkbox' ] as $Mail ) { $i++; $this->r['functions']->email( $Mail, " Cymid.nl Uitnodiging", " Beste ".$Mail." ".$this->r['user']['gebruikersnaam']." wil graag dat je ook gratis een profiel aanmaakt op http://www.cmyid.nl
* Je eigen profielpagina * Groepen * Forum * MSN Invite * VIP statistieken * SMS center En nog veel meer!"); } $this->r['sql']->query ("INSERT INTO emails (emailadres) VALUES ('".$Mail."')"); $this->r['functions']->redirect ('Succesvol', 'De email(s) is/zijn verzonden. Bedankt!', '', 3); } } else $this->r['tpl']->Parse ("index", "Formulier", "content");
} else $this->r['functions']->redirect ('Fout', 'Je kunt je emaillijst niet uitnodigen als je niet bent ingelogd.', 'members/login', 3); }
function www_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/www_toevoegen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); $sFlood = $this->r['sql']->query ("SELECT * FROM flood WHERE pagina = 'WWW toevoegen' AND ip = '".$this->r['functions']->haal_ip ()."'");
if($this->r['sql']->rows ($sFlood)) $error ['Fwat'] = 'Je hebt zojuist al een WWW toegevoegd.'; if(!isset ($_POST['wat']) || strlen ($_POST['wat']) < 3 || strlen ($_POST['wat']) > 40) $error ['Fwat'] = 'Je hebt geen geldige wat opgegeven.'; if(!isset ($_POST['waar']) || strlen ($_POST['waar']) > 40) $error ['Fwaar'] = 'Je hebt geen geldige waar opgegeven.';
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Toevoegen", "ErrorArea");
foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Toevoegen", "V".$key, $this->r['functions']->strip ($content)); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else { $this->r['sql']->query ("INSERT INTO flood (pagina, ip, datum) VALUES ('WWW toevoegen', '".$this->r['functions']->haal_ip ()."', '".time ()."')"); $this->r['sql']->query ("INSERT INTO www (profile_id, wat, waar, datum) VALUES ('".mysql_real_escape_string ($this->r['user']['pid'])."', '".mysql_real_escape_string ($_POST['wat'])."', '".mysql_real_escape_string ($_POST['waar'])."', '".time ()."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze WWW succesvol toegevoegd.', 'panel/index', 3); } } else $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen WWW toevoegen als je niet bent ingelogd.', 'members/login', 3); }
function welkom() { $this->r['tpl']->define (array ('index.tpl', 'panel/welkom.tpl'));
if($this->r['client']->ingelogd == 1) { $this->r['tpl']->assign ("Welkom", "sProfile_id", $this->r['functions']->strip ($this->r['user']['pid'])); $this->r['tpl']->assign ("Welkom", "sVoornaam", $this->r['functions']->strip ($this->r['user']['voornaam'])); ## Vrienden van jou $vVrienden = ''; $bVrienden = ''; $sVrienden = $this->r['sql']->query ("SELECT * FROM ##vrienden WHERE profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND wederzijds = '1' AND groep != '1'"); if($this->r['sql']->rows ($sVrienden)) { while ($fVrienden = $this->r['sql']->fetch ($sVrienden)) { $vVrienden .= "pid = '".$fVrienden['uid']."' OR "; $bVrienden .= "b.profile_id = '".$fVrienden['uid']."' OR "; }
## Verjaardagen van je vrienden $sVerjaardag = $this->r['sql']->query ("SELECT * FROM ##profielen WHERE verjaardag = '".date ('d')."-".date ('m')."' AND (".substr ($vVrienden, 0, -4).")"); if($this->r['sql']->rows ($sVerjaardag)) { while ($fVerjaardag = $this->r['sql']->fetch ($sVerjaardag)) { $this->r['tpl']->assign ("Verjaardag_R", "sPid", $this->r['functions']->strip ($fVerjaardag['profile_id'])); $this->r['tpl']->assign ("Verjaardag_R", "sVoornaam", $this->r['functions']->strip ($fVerjaardag['voornaam'])); $sDatum = explode ("-", $fVerjaardag['geboortedatum']); $this->r['tpl']->assign ("Verjaardag_R", "sLeeftijd", (date ("y") - $sDatum[2])); $this->r['tpl']->Parse ("Welkom", "Verjaardag_R"); } } else $this->r['tpl']->Parse ("Welkom", "Verjaardag_Geen"); ## Blogs van je vrienden $sBlog = $this->r['sql']->query ("SELECT b.*, p.voornaam FROM ##blog b INNER JOIN ##profielen p ON(p.pid = b.profile_id) WHERE (".substr ($bVrienden, 0, -4).") ORDER BY b.datum DESC LIMIT 0, 5"); if($this->r['sql']->rows ($sBlog)) { while ($fBlog = $this->r['sql']->fetch ($sBlog)) { $this->r['tpl']->assign ("Blog_R", "sProfile_id", $this->r['functions']->strip ($fBlog['profile_id'])); $this->r['tpl']->assign ("Blog_R", "sTitel", $this->r['functions']->strip ($fBlog['titel'])); $this->r['tpl']->assign ("Blog_R", "sBlog", $this->r['functions']->strip ($fBlog['blog'], 200)); $this->r['tpl']->assign ("Blog_R", "sDatum", date ("d-m-Y H:i", $this->r['functions']->strip ($fBlog['datum']))); $this->r['tpl']->assign ("Blog_R", "sVoornaam", $this->r['functions']->strip ($fBlog['voornaam'])); $this->r['tpl']->Parse ("Welkom", "Blog_R"); } } else $this->r['tpl']->Parse ("Welkom", "Blog_Geen"); ## Afbeeldingen van je vrienden $sAfb = $this->r['sql']->query ("SELECT b.*, p.voornaam FROM ##afbeeldingen b INNER JOIN ##profielen p ON(p.pid = b.profile_id) WHERE (".substr ($bVrienden, 0, -4).") ORDER BY b.datum DESC LIMIT 0, 5"); if($this->r['sql']->rows ($sAfb)) { while ($fAfb = $this->r['sql']->fetch ($sAfb)) { $this->r['tpl']->assign ("Afb_R", "sProfile_id", $this->r['functions']->strip ($fAfb['profile_id'])); $this->r['tpl']->assign ("Afb_R", "sVoornaam", $this->r['functions']->strip ($fAfb['voornaam'])); $this->r['tpl']->assign ("Afb_R", "sThumbnail", '<img src="'.$this->r['cfg']->adres.'/upload/thumbnails/'.$fAfb['profile_id'].'/'.$this->r['functions']->strip ($fAfb['naam']).'" border="0" alt="" />'); $this->r['tpl']->Parse ("Welkom", "Afb_R"); } } else $this->r['tpl']->Parse ("Welkom", "Afb_Geen"); ## Video's van je vrienden $sVid = $this->r['sql']->query ("SELECT b.*, p.voornaam FROM ##video b INNER JOIN ##profielen p ON(p.pid = b.profile_id) WHERE (".substr ($bVrienden, 0, -4).") ORDER BY b.datum DESC LIMIT 0, 5"); if($this->r['sql']->rows ($sVid)) { while ($fVid = $this->r['sql']->fetch ($sVid)) { $this->r['tpl']->assign ("Vid_R", "sProfile_id", $this->r['functions']->strip ($fVid['profile_id'])); $this->r['tpl']->assign ("Vid_R", "sVoornaam", $this->r['functions']->strip ($fVid['voornaam'])); $this->r['tpl']->assign ("Vid_R", "sThumbnail", $this->r['functions']->youtube_vriendelijk_klein ($this->r['functions']->strip ($fVid['inhoud']))); $this->r['tpl']->Parse ("Welkom", "Vid_R"); } } else $this->r['tpl']->Parse ("Welkom", "Vid_Geen");
## Video's van je vrienden $sWWW = $this->r['sql']->query ("SELECT b.*, p.voornaam FROM ##www b INNER JOIN ##profielen p ON(p.pid = b.profile_id) WHERE (".substr ($bVrienden, 0, -4).") ORDER BY b.datum DESC LIMIT 0, 5"); if($this->r['sql']->rows ($sWWW)) { while ($fWWW = $this->r['sql']->fetch ($sWWW)) { $this->r['tpl']->assign ("WWW_R", "sWat", $this->r['functions']->strip ($fWWW['wat'])); $this->r['tpl']->assign ("WWW_R", "sWaar", $this->r['functions']->strip ($fWWW['waar'])); $this->r['tpl']->assign ("WWW_R", "sProfile_id", $this->r['functions']->strip ($fWWW['profile_id'])); $this->r['tpl']->Parse ("Welkom", "WWW_R"); } } else $this->r['tpl']->Parse ("Welkom", "WWW_Geen"); } else { $this->r['tpl']->Parse ("Welkom", "Afb_Geen"); $this->r['tpl']->Parse ("Welkom", "Vid_Geen"); $this->r['tpl']->Parse ("Welkom", "Blog_Geen"); $this->r['tpl']->Parse ("Welkom", "Verjaardag_Geen"); $this->r['tpl']->Parse ("Welkom", "WWW_Geen");
} $this->r['tpl']->Parse ("index", "Welkom", "content"); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen toegang tot het gebruikerspaneel als je niet bent ingelogd.', 'members/login', 3); } function tekstballon () { $this->r['tpl']->define (array ('index.tpl', 'panel/tekstballon.tpl'));
if($this->r['client']->ingelogd == 1) { if($this->r['user']['vip'] == 1 || $this->r['user']['credits'] > $this->r['cfg']->credits_ballon || $this->r['user']['credits'] == $this->r['cfg']->credits_ballon) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $this->r['sql']->query ("UPDATE ##profielen SET ".($this->r['user']['vip'] != 1 ? "credits = credits - ".$this->r['cfg']->credits_ballon."," : "")." ballon = '".mysql_real_escape_string ($_POST['tekst'])."' WHERE pid = '".$this->r['functions']->strip ($this->r['user']['pid'])."' AND geactiveerd = '1'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt jouw tekstballon succesvol aangepast (en je credits-aantal is gereduceerd).', 'panel/index', 3); } else { $this->r['tpl']->assign ("Toevoegen", "Vtekst", $this->r['functions']->strip ($this->r['user']['ballon'])); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } } else $this->r['functions']->redirect ('Fout', 'Je kunt je tekstballon niet aanpassen als je geen VIP bent of niet genoeg credits hebt ('.$this->r['cfg']->credits_ballon.').', 'panel/index', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt je tekstballon niet aanpassen als je niet bent ingelogd.', 'members/login', 3); } function omschrijving_bewerken () { $this->r['tpl']->define (array ('index.tpl', 'panel/omschrijving.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $this->r['sql']->query ("UPDATE ##profielen SET omschrijving = '".mysql_real_escape_string ($_POST['omschrijving'])."' WHERE pid = '".$this->r['functions']->strip ($this->r['user']['pid'])."' AND geactiveerd = '1'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt jouw omschrijving succesvol aangepast.', 'panel/index', 3); } else { $this->r['tpl']->assign ("Bewerken", "Vomschrijving", nl2br ($this->r['functions']->strip ($this->r['user']['omschrijving']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } } else $this->r['functions']->redirect ('Fout', 'Je kunt je omschrijving niet aanpassen als je niet bent ingelogd.', 'members/login', 3); } function achtergrond () { $this->r['tpl']->define (array ('index.tpl', 'panel/achtergrond.tpl'));
if($this->r['client']->ingelogd == 1) { if($this->r['user']['vip'] == 1 || $this->r['user']['credits'] > $this->r['cfg']->credits_achtergrond || $this->r['user']['credits'] == $this->r['cfg']->credits_achtergrond) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array ();
$sMB = 0; if(isset ($_FILES)) { foreach ($_FILES AS $key => $content) { if(isset ($_FILES [$key]['name']) && !empty ($_FILES[$key]['name'])) { if(filesize ($_FILES[$key]['tmp_name']) < $this->r['cfg']->max) { $sExtensie = end(explode (".", $_FILES[$key]['name'])); $sGrootte = filesize ($_FILES[$key]['tmp_name']);
if(in_array ($sExtensie, $this->r['cfg']->extensies)) $sMB + $sGrootte; else $error [] = 'Afbeelding '.$key.' heeft een extensie die niet is toegestaan.'; } else $error [] = 'Afbeelding '.$key.' is te groot.'; } } }
if(count ($error) > 0) { $sAfb = $this->r['sql']->query ("SELECT * FROM achtergronden"); if($this->r['sql']->rows ($sAfb)) { while ($fAfb = $this->r['sql']->fetch ($sAfb)) { $this->r['tpl']->assign ("Afb_R", "sPid", $this->r['functions']->strip ($fAfb['pid'])); $this->r['tpl']->assign ("Afb_R", "sAfbeelding", '<img src="'.$this->r['cfg']->adres.'/upload/'.$this->r['functions']->strip ($fAfb['plaatje']).'" />'); $this->r['tpl']->Parse ("Wijzigen", "Afb_R"); } } if($this->r['user']['vip'] == 1) $this->r['tpl']->Parse ("Wijzigen", "sVIP"); $this->r['functions']->error_form ("Wijzigen", $error); } else { if(!is_dir ('upload/achtergronden/'.$this->r['user']['pid'])) mkdir ('upload/achtergronden/'.$this->r['user']['pid']);
if($this->r['user']['vip'] == 1 && is_array ($_FILES['afbeelding_ex']) && !empty ($_FILES['afbeelding_ex']['name'])) { move_uploaded_file($_FILES['afbeelding_ex']['tmp_name'], 'upload/achtergronden/'.$this->r['user']['pid'].'/'.$_FILES['afbeelding_ex']['name']); chmod('upload/achtergronden/'.$this->r['user']['pid'].'/'.$_FILES['afbeelding_ex']['name'], 0777 ) ; $sPlaatje = $_FILES['afbeelding_ex']['name']; } elseif(isset ($_POST['afbeelding']) && !empty ($_POST['afbeelding'])) { $sAchtergrond = $this->r['sql']->query ("SELECT * FROM achtergronden WHERE pid = '".mysql_real_escape_string ($_POST['afbeelding'])."'"); if($this->r['sql']->rows ($sAchtergrond)) { $fAchtergrond = $this->r['sql']->fetch ($sAchtergrond); copy('upload/achtergronden/'.$this->r['functions']->strip ($fAchtergrond['plaatje']), 'upload/achtergronden/'.$this->r['user']['pid'].'/'.$this->r['functions']->strip ($fAchtergrond['plaatje'])); chmod('upload/achtergronden/'.$this->r['user']['pid'].'/'.$this->r['functions']->strip ($fAchtergrond['plaatje']), 0777 ) ; $sPlaatje = $fAchtergrond['plaatje']; } } if($this->r['user']['vip'] != 1) $this->r['sql']->query ("UPDATE ##profielen SET credits = credits - ".$this->r['cfg']->credits_achtergrond." WHERE pid = '".mysql_real_escape_string ($this->r['user']['pid'])."'");
$this->r['sql']->query ("UPDATE ##profielen SET achtergrond = '".mysql_real_escape_string ($_POST['achtergrond'])."', achtergrond_plaatje = '".(isset ($sPlaatje) && !empty ($sPlaatje) ? $sPlaatje : '')."' WHERE pid = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND geactiveerd = '1'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt je achtergrond succesvol aangepast.', 'panel/index', 3); } } else { $sAfb = $this->r['sql']->query ("SELECT * FROM achtergronden"); if($this->r['sql']->rows ($sAfb)) { while ($fAfb = $this->r['sql']->fetch ($sAfb)) { $this->r['tpl']->assign ("Afb_R", "sPid", $this->r['functions']->strip ($fAfb['pid'])); $this->r['tpl']->assign ("Afb_R", "sAfbeelding", '<img height="80" width="100" src="'.$this->r['cfg']->adres.'/upload/achtergronden/'.$this->r['functions']->strip ($fAfb['plaatje']).'" />'); $this->r['tpl']->Parse ("Wijzigen", "Afb_R"); } } if($this->r['user']['vip'] == 1) $this->r['tpl']->Parse ("Wijzigen", "sVIP"); $this->r['tpl']->Parse ("index", "Wijzigen", "content"); } } else $this->r['functions']->redirect ('Fout', 'Je kunt je achtergrond niet aanpassen als je geen VIP bent of niet genoeg credits hebt.', 'panel/index', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt je profiel niet aanpassen als je niet bent ingelogd.', 'members/login', 3); } function wijzigen () { $this->r['tpl']->define (array ('index.tpl', 'panel/profiel.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); if(!isset ($_POST['voornaam']) || strlen($_POST['voornaam']) < 3) $error['Fvoornaam'] = "Uw voornaam is ongeldig."; if(!isset ($_POST['geboorte_dag']) || empty ($_POST['geboorte_dag']) || !is_numeric ($_POST['geboorte_dag']) || $_POST['geboorte_dag'] < 1 || $_POST['geboorte_dag'] > 31) $error ['Fgeboorte_dag'] = 'Uw geboortedatum is ongeldig.'; if(!isset ($_POST['geboorte_maand']) || empty ($_POST['geboorte_maand'])) $error ['Fgeboorte_maand'] = 'Uw geboortedatum is ongeldig.'; if(!isset ($_POST['geboorte_jaar']) || empty ($_POST['geboorte_jaar']) || !is_numeric ($_POST['geboorte_jaar']) || $_POST['geboorte_jaar'] < 1940) $error ['Fgeboorte_dag'] = 'Uw geboortedatum is ongeldig.'; if(!isset ($_POST['achternaam']) || strlen($_POST['achternaam']) > 20) $error['Fachternaam'] = "Uw achternaam is ongeldig."; if(!isset ($_POST['woonplaats']) || strlen($_POST['woonplaats']) > 20) $error['Fwoonplaats'] = "Uw woonplaats is ongeldig."; //if(!isset ($_POST['telefoon']) || strlen($_POST['telefoon']) > 20) $error['Ftelefoon'] = "Uw telefoonnummer is ongeldig."; //if(!isset ($_POST['mobiel']) || strlen($_POST['mobiel']) > 20) $error['Fmobiel'] = "Uw mobiel is ongeldig."; if(!isset ($_POST['geslacht']) || ($_POST['geslacht'] != 'Man' && $_POST['geslacht'] != 'Vrouw')) $error['Fgeslacht'] = "Uw geslacht is ongeldig."; if(!isset ($_POST['geaardheid']) || ($_POST['geaardheid'] != 'Heteroseksueel' && $_POST['geaardheid'] != 'Homoseksueel' && $_POST['geaardheid'] != 'Biseksueel')) $error['Fgeaardheid'] = "Uw geaardheid is ongeldig."; if(!isset ($_POST['relatie']) || ($_POST['relatie'] != 'Ja' && $_POST['relatie'] != 'Nee')) $error['Frelatie'] = "Uw relatie is ongeldig.";
$sGoed = 0; if(isset ($_POST['telefoonnummer']) && !empty ($_POST['telefoonnummer'])) { if($this->r['functions']->vipcontrole ($_POST['pincode']) == true || $this->r['functions']->vipcontrole ($_POST['pincode']) == 1) $sGoed = 1; else $sError['Ftelefoonnummer'] = 'Deze pincode is incorrect!'; }
if(count ($error) > 0) $this->r['functions']->error_form ("Wijzigen", $error); else { $this->r['sql']->query ("UPDATE ##profielen SET voornaam = '".mysql_real_escape_string ($_POST['voornaam'])."', achternaam = '".mysql_real_escape_string ($_POST['achternaam'])."', verjaardag = '".mysql_real_escape_string ($_POST['geboorte_dag'])."-".mysql_real_escape_string ($_POST['geboorte_maand'])."', geboortedatum = '".mysql_real_escape_string ($_POST['geboorte_dag'])."-".mysql_real_escape_string ($_POST['geboorte_maand'])."-".mysql_real_escape_string ($_POST['geboorte_jaar'])."', passies = '".mysql_real_escape_string ($_POST['passies'])."', woonplaats = '".mysql_real_escape_string ($_POST['woonplaats'])."', telefoon = '".(isset ($_POST['telefoonnummer']) && !empty ($_POST['telefoonnummer']) && $sGoed == 1 ? mysql_real_escape_string ($_POST['telefoonnummer']) : '')."', vip = '".($sGoed == 1 ? 1 : 0)."', geboortedatum = '".mysql_real_escape_string ($_POST['geboorte_dag'])."-".mysql_real_escape_string ($_POST['geboorte_maand'])."-".mysql_real_escape_string ($_POST['geboorte_jaar'])."', geslacht = '".mysql_real_escape_string ($_POST['geslacht'])."', geaardheid = '".mysql_real_escape_string ($_POST['geaardheid'])."', relatie = '".mysql_real_escape_string ($_POST['relatie'])."', extra_lengte = '".mysql_real_escape_string ($_POST['lengte'])."', extra_gewicht = '".mysql_real_escape_string ($_POST['gewicht'])."', extra_kleur = '".mysql_real_escape_string ($_POST['kleur'])."', extra_haarkleur = '".mysql_real_escape_string ($_POST['haarkleur'])."', extra_roken = '".mysql_real_escape_string ($_POST['roken'])."', extra_piercings = '".mysql_real_escape_string ($_POST['piercings'])."', extra_tattoo = '".mysql_real_escape_string ($_POST['tattoo'])."', extra_dresscode = '".mysql_real_escape_string ($_POST['dresscode'])."', extra_hobbies = '".mysql_real_escape_string ($_POST['hobbies'])."', extra_sport = '".mysql_real_escape_string ($_POST['sport'])."', extra_muzieksoort = '".mysql_real_escape_string ($_POST['muzieksoort'])."', extra_school = '".mysql_real_escape_string ($_POST['school'])."', extra_partyplace = '".mysql_real_escape_string ($_POST['partyplace'])."', extra_tvserie = '".mysql_real_escape_string ($_POST['tvserie'])."', extra_film = '".mysql_real_escape_string ($_POST['film'])."', extra_drank = '".mysql_real_escape_string ($_POST['drank'])."', extra_vervoer = '".mysql_real_escape_string ($_POST['vervoer'])."', extra_idool = '".mysql_real_escape_string ($_POST['idool'])."', extra_vakantieland = '".mysql_real_escape_string ($_POST['vakantieland'])."', extra_droom = '".mysql_real_escape_string ($_POST['droom'])."', extra_schoenmaat = '".mysql_real_escape_string ($_POST['schoenmaat'])."' WHERE pid = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND geactiveerd = '1'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt je profiel succesvol aangepast.', 'panel/index', 3); } } else { foreach ($this->r['user'] AS $key => $content) { $sExplode = explode ("_", $key); if(count ($sExplode) > 1) $this->r['tpl']->assign ("Wijzigen", "V".$sExplode[1], $this->r['functions']->strip ($this->r['user'][$key])); else $this->r['tpl']->assign ("Wijzigen", "V".(substr (0, 5, $key) == 'extra_' ? substr (6, $key) : $key), $this->r['functions']->strip ($this->r['user'][$key]));
//$this->r['tpl']->assign ("Wijzigen", "V".(substr (0, 5, $key) == 'extra_' ? substr (6, $key) : $key), $this->r['functions']->strip ($this->r['user'][$key])); $this->r['tpl']->assign ("Wijzigen", $this->r['user']['geslacht'], 'checked="checked"'); $this->r['tpl']->assign ("Wijzigen", $this->r['user']['relatie'], 'checked="checked"'); $this->r['tpl']->assign ("Wijzigen", $this->r['user']['geaardheid'], 'selected="selected"');
if($key == 'geboortedatum' && $this->r['user']['geboortedatum'] != '') { $sDatum = explode ("-", $this->r['user'][$key]); $this->r['tpl']->assign ("Wijzigen", $sDatum [0], 'selected="selected"'); $this->r['tpl']->assign ("Wijzigen", 'm'.$sDatum [1], 'selected="selected"'); $this->r['tpl']->assign ("Wijzigen", $sDatum [2], 'selected="selected"'); } } $this->r['tpl']->Parse ("index", "Wijzigen", "content"); } } else $this->r['functions']->redirect ('Fout', 'Je kunt je profiel niet aanpassen als je niet bent ingelogd.', 'members/login', 3); } function interesses () { $this->r['tpl']->define (array ('index.tpl', 'panel/interesses.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $sEten = (isset ($_POST['eten']) ? mysql_real_escape_string (implode (", ", $_POST['eten'])) : ''); $sMuziek = (isset ($_POST['muziek']) ? mysql_real_escape_string (implode (", ", $_POST['muziek'])) : ''); $sMerken = (isset ($_POST['merken']) ? mysql_real_escape_string (implode (", ", $_POST['merken'])) : ''); $sBoeken = (isset ($_POST['boeken']) ? mysql_real_escape_string (implode (", ", $_POST['boeken'])) : ''); $sReizen = (isset ($_POST['reizen']) ? mysql_real_escape_string (implode (", ", $_POST['reizen'])) : ''); $sGames = (isset ($_POST['games']) ? mysql_real_escape_string (implode (", ", $_POST['games'])) : ''); $sTv = (isset ($_POST['tv']) ? mysql_real_escape_string (implode (", ", $_POST['tv'])) : ''); $this->r['sql']->query ("UPDATE ##profielen SET tv = '".$sTv."', tv_extra = '".mysql_real_escape_string ($_POST['tv_extra'])."', reizen = '".$sReizen."', reizen_extra = '".mysql_real_escape_string ($_POST['reizen_extra'])."', boeken = '".$sBoeken."', boeken_extra = '".mysql_real_escape_string ($_POST['boeken_extra'])."', games = '".$sGames."', games_extra = '".mysql_real_escape_string ($_POST['games_extra'])."', eten = '".$sEten."', eten_extra = '".mysql_real_escape_string ($_POST['eten_extra'])."', muziek = '".$sMuziek."', muziek_extra = '".mysql_real_escape_string ($_POST['muziek_extra'])."', merken = '".$sMerken."', merken_extra = '".mysql_real_escape_string ($_POST['merken_extra'])."' WHERE pid = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND geactiveerd = '1'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt je interesses succesvol aangepast.', 'panel/index', 3); } else { ## 2 velden voor bv. merken; merken en merken_extra. In merken de vastgestelde en standaardmerken, in merken_extra de bijgevoegde persoonlijke merken foreach ($this->r['user'] AS $key => $content) { if($key == 'eten' || $key == 'merken' || $key == 'muziek' || $key == 'tv' || $key == 'games' || $key == 'boeken' || $key == 'reizen') { $sExplode = explode (", ", $this->r['user'][$key]); foreach ($sExplode AS $sKey => $sContent) { $this->r['tpl']->assign ('Wijzigen', $sContent, 'checked="checked"'); } } elseif ($key == 'eten_extra' || $key == 'merken_extra' || $key == 'muziek_extra' || $key == 'tv_extra' || $key == 'boeken_extra' || $key == 'reizen_extra' || $key == 'games_extra') $this->r['tpl']->assign ('Wijzigen', 'V'.$key, $this->r['user'][$key]); } $this->r['tpl']->Parse ("index", "Wijzigen", "content"); } } else $this->r['functions']->redirect ('Fout', 'Je kunt je profiel niet aanpassen als je niet bent ingelogd.', 'members/login', 3); }
function polls () { $this->r['tpl']->define (array ('index.tpl', 'panel/polls.tpl'));
if($this->r['client']->ingelogd == 1) { $sPoll = $this->r['sql']->query ("SELECT * FROM polls WHERE profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sPoll)) { while ($fPoll = $this->r['sql']->fetch ($sPoll)) { $this->r['tpl']->assign ("Poll_R", "sPid", $this->r['functions']->strip ($fPoll['pid'])); $this->r['tpl']->assign ("Poll_R", "sProfile_id", $this->r['functions']->strip ($fPoll['profile_id'])); $this->r['tpl']->assign ("Poll_R", "sVraag", $this->r['functions']->strip ($fPoll['vraag'])); $this->r['tpl']->Parse ("Poll", "Poll_R"); } } else $this->r['tpl']->Parse ("Poll", "Poll_Geen");
$this->r['tpl']->Parse ("index", "Poll", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen poll's beheren als je niet bent ingelogd.', 'members/login', 3); }
function poll_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/poll_toevoegen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); $sFlood = $this->r['sql']->query ("SELECT * FROM flood WHERE pagina = 'Poll toevoegen' AND ip = '".$this->r['functions']->haal_ip ()."'");
if($this->r['sql']->rows ($sFlood)) $error ['Ftitel'] = 'Je hebt zojuist al een poll toegevoegd.'; if(!isset ($_POST['vraag']) || empty ($_POST['vraag']) || strlen ($_POST['vraag']) < 3 || strlen ($_POST['vraag']) > 50) $error['Fvraag'] = 'De pollvraag is ongeldig (te groot of te klein).'; if(!isset ($_POST['opties']) || empty ($_POST['opties'])) $error['Fopties'] = 'De opties zijn ongeldig.'; else { $sOpties = explode (",", $_POST['opties']); if(count ($sOpties) > $this->r['cfg']->aantal_opties) $error['Fopties'] = 'Er zijn teveel poll opties.'; foreach ($sOpties AS $key => $content) if(empty ($content) || strlen ($sOpties[$key]) > 30) $error['Fopties'] = '(?n van) de opties zijn ongeldig.'; }
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Toevoegen", "ErrorArea");
foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Toevoegen", "V".$key, $this->r['functions']->strip ($content)); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else { $this->r['sql']->query ("INSERT INTO flood (pagina, ip, datum) VALUES ('Blog toevoegen', '".$this->r['functions']->haal_ip ()."', '".time ()."')"); $this->r['sql']->query ("INSERT INTO polls (pid, profile_id, vraag, datum) VALUES ('', '".$this->r['user']['pid']."', '".mysql_real_escape_string ($_POST['vraag'])."', '".time ()."')"); $sLastid = $this->r['sql']->last_id ();
$sOpties = explode (",", $_POST['opties']); foreach ($sOpties AS $key => $content) { $this->r['sql']->query ("INSERT INTO poll_opties (poll_id, optie) VALUES ('".$sLastid."', '".mysql_real_escape_string ($content)."')"); } $this->r['functions']->redirect ('Succesvol', 'Je hebt deze poll succesvol toegevoegd.', 'panel/polls', 3); } } else $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen poll toevoegen als je niet bent ingelogd.', 'members/login', 3); }
function poll_verwijderen () { $this->r['tpl']->define (array ('index.tpl', 'panel/poll_verwijderen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAlbum = $this->r['sql']->query ("SELECT * FROM polls WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAlbum)) { $this->r['sql']->query ("DELETE FROM polls WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze poll succesvol verwijderd.', 'panel/polls', 3); } else $this->r['functions']->redirect ('Fout', 'Deze poll bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen poll opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen poll's verwijderen als je niet bent ingelogd.', 'members/login', 3); }
function videos () { $this->r['tpl']->define (array ('index.tpl', 'panel/videos.tpl'));
if($this->r['client']->ingelogd == 1) { $sVideo = $this->r['sql']->query ("SELECT * FROM video WHERE profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sVideo)) { while ($fVideo = $this->r['sql']->fetch ($sVideo)) { $this->r['tpl']->assign ("Video_R", "sPid", $this->r['functions']->strip ($fVideo['pid'])); $this->r['tpl']->assign ("Video_R", "sProfile_id", $this->r['functions']->strip ($fVideo['profile_id'])); $this->r['tpl']->assign ("Video_R", "sTitel", $this->r['functions']->strip ($fVideo['titel'])); $this->r['tpl']->Parse ("Video", "Video_R"); } } else $this->r['tpl']->Parse ("Video", "Video_Geen");
$this->r['tpl']->Parse ("index", "Video", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen video's beheren als je niet bent ingelogd.', 'members/login', 3);
}
function video_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/video_toevoegen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); $sFlood = $this->r['sql']->query ("SELECT * FROM flood WHERE pagina = 'Video toevoegen' AND ip = '".$this->r['functions']->haal_ip ()."'");
if($this->r['sql']->rows ($sFlood)) $error ['Ftitel'] = 'Je hebt zojuist al een video toegevoegd.'; if(!isset ($_POST['titel']) || strlen ($_POST['titel']) < 3 || strlen ($_POST['titel']) > 25) $error ['Ftitel'] = 'Je hebt geen geldige titel opgegeven.'; if(!isset ($_POST['video']) || strlen ($_POST['video']) < 3) $error ['Fvideo'] = 'Je hebt geen geldige video opgegeven.';
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Toevoegen", "ErrorArea");
foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Toevoegen", "V".$key, $this->r['functions']->strip ($content)); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else { $this->r['sql']->query ("INSERT INTO flood (pagina, ip, datum) VALUES ('Blog toevoegen', '".$this->r['functions']->haal_ip ()."', '".time ()."')"); $this->r['sql']->query ("INSERT INTO video (profile_id, titel, inhoud, datum) VALUES ('".mysql_real_escape_string ($this->r['user']['pid'])."', '".mysql_real_escape_string ($_POST['titel'])."', '".mysql_real_escape_string ($_POST['video'])."', '".time ()."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze video succesvol toegevoegd.', 'panel/videos', 3); } } else $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen video toevoegen als je niet bent ingelogd.', 'members/login', 3); }
function gadgets () { $this->r['tpl']->define (array ('index.tpl', 'panel/gadgets.tpl'));
if($this->r['client']->ingelogd == 1) { $sVideo = $this->r['sql']->query ("SELECT * FROM gadgets WHERE profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sVideo)) { while ($fVideo = $this->r['sql']->fetch ($sVideo)) { $this->r['tpl']->assign ("Gadgets_R", "sPid", $this->r['functions']->strip ($fVideo['pid'])); $this->r['tpl']->assign ("Gadgets_R", "sProfile_id", $this->r['functions']->strip ($fVideo['profile_id'])); $this->r['tpl']->assign ("Gadgets_R", "sTitel", $this->r['functions']->strip ($fVideo['titel'])); $this->r['tpl']->Parse ("Gadgets", "Gadgets_R"); } } else $this->r['tpl']->Parse ("Gadgets", "Gadgets_Geen");
$this->r['tpl']->Parse ("index", "Gadgets", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen Gadgets beheren als je niet bent ingelogd.', 'members/login', 3);
} function gadget_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/gadget_toevoegen.tpl'));
$sVoorbeelden = $this->r['sql']->query ("SELECT * FROM voorbeelden"); if($this->r['sql']->rows ($sVoorbeelden)) { while ($fVoorbeelden = $this->r['sql']->fetch ($sVoorbeelden)) { $this->r['tpl']->assign ("Voorbeelden_R", "sNaam", $this->r['functions']->strip ($fVoorbeelden['naam'])); $this->r['tpl']->assign ("Voorbeelden_R", "sPid", $this->r['functions']->strip ($fVoorbeelden['pid'])); $this->r['tpl']->assign ("Voorbeelden_R", "sGadget", stripslashes ($fVoorbeelden['voorbeeld']));
$this->r['tpl']->Parse ("Toevoegen", "Voorbeelden_R"); } }
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); $sFlood = $this->r['sql']->query ("SELECT * FROM flood WHERE pagina = 'Gadget toevoegen' AND ip = '".$this->r['functions']->haal_ip ()."'");
if($this->r['sql']->rows ($sFlood)) $error ['Ftitel'] = 'Je hebt zojuist al een gadget toegevoegd.'; if((!isset ($_POST['gadget_ex']) || empty ($_POST['gadget_ex'])) && (!isset ($_POST['titel']) || strlen ($_POST['titel']) < 3 || strlen ($_POST['titel']) > 25)) $error ['Ftitel'] = 'Je hebt geen geldige titel opgegeven.'; if((!isset ($_POST['gadget_ex']) || empty ($_POST['gadget_ex'])) && (!isset ($_POST['gadget']) || strlen ($_POST['gadget']) < 3)) $error ['Fgadget'] = 'Je hebt geen geldige gadget opgegeven.';
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Toevoegen", "ErrorArea");
foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Toevoegen", "V".$key, $this->r['functions']->strip ($content)); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else { $this->r['sql']->query ("INSERT INTO flood (pagina, ip, datum) VALUES ('Gadget toevoegen', '".$this->r['functions']->haal_ip ()."', '".time ()."')");
if(isset ($_POST['gadget_ex']) && !empty ($_POST['gadget_ex'])) { $sGadget = $this->r['sql']->query ("SELECT * FROM voorbeelden WHERE pid = '".mysql_real_escape_string ($_POST['gadget_ex'])."'"); if($this->r['sql']->rows ($sGadget)) { $fGadget = $this->r['sql']->fetch ($sGadget); $this->r['sql']->query ("INSERT INTO gadgets (profile_id, titel, gadget, datum) VALUES ('".mysql_real_escape_string ($this->r['user']['pid'])."', '".mysql_real_escape_string ($fGadget['naam'])."', '".(isset ($_POST['gadget_ex']) && !empty ($_POST['gadget_ex']) ? mysql_real_escape_string ($_POST['gadget_ex']) : mysql_real_escape_string ($_POST['gadget']))."', '".time ()."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze gadget succesvol toegevoegd.', 'panel/gadgets', 3); } else $this->r['functions']->redirect ('Fout', 'Deze gadget bestaat niet (meer).', 'panel/gadgets', 3); } else { $this->r['sql']->query ("INSERT INTO gadgets (profile_id, titel, gadget, datum) VALUES ('".mysql_real_escape_string ($this->r['user']['pid'])."', '".mysql_real_escape_string ($_POST['titel'])."', '".(isset ($_POST['gadget_ex']) && !empty ($_POST['gadget_ex']) ? mysql_real_escape_string ($_POST['gadget_ex']) : mysql_real_escape_string ($_POST['gadget']))."', '".time ()."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze gadget succesvol toegevoegd.', 'panel/gadgets', 3); } } } else $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen gadget toevoegen als je niet bent ingelogd.', 'members/login', 3); } function gadget_bewerken () { $this->r['tpl']->define (array ('index.tpl', 'panel/gadget_bewerken.tpl'));
$sVoorbeelden = $this->r['sql']->query ("SELECT * FROM voorbeelden"); if($this->r['sql']->rows ($sVoorbeelden)) { while ($fVoorbeelden = $this->r['sql']->fetch ($sVoorbeelden)) { $this->r['tpl']->assign ("Voorbeelden_R", "sNaam", $this->r['functions']->strip ($fVoorbeelden['naam'])); $this->r['tpl']->assign ("Voorbeelden_R", "sPid", $this->r['functions']->strip ($fVoorbeelden['pid'])); $this->r['tpl']->assign ("Voorbeelden_R", "sGadget", stripslashes ($fVoorbeelden['voorbeeld'])); $this->r['tpl']->Parse ("Bewerken", "Voorbeelden_R"); } }
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sVideo = $this->r['sql']->query ("SELECT * FROM gadgets WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sVideo)) { $fVideo = $this->r['sql']->fetch ($sVideo);
$error = array (); if((!isset ($_POST['gadget_ex']) || empty ($_POST['gadget_ex'])) && (!isset ($_POST['titel']) || strlen ($_POST['titel']) < 3 || strlen ($_POST['titel']) > 25)) $error ['Ftitel'] = 'Je hebt geen geldige titel opgegeven.'; if((!isset ($_POST['gadget_ex']) || empty ($_POST['gadget_ex'])) && (!isset ($_POST['gadget']) || strlen ($_POST['gadget']) < 3)) $error ['Fgadget'] = 'Je hebt geen geldige gadget opgegeven.';
if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { if(count ($error) > 0) { foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Bewerken", "ErrorArea");
$this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Bewerken", "Vtitel", $this->r['functions']->strip ($_POST['titel'])); $this->r['tpl']->assign ("Bewerken", "Vgadget", nl2br ($this->r['functions']->strip ($_POST['gadget']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } else { if(isset ($_POST['gadget_ex']) && !empty ($_POST['gadget_ex'])) { $sGadget = $this->r['sql']->query ("SELECT * FROM voorbeelden WHERE pid = '".mysql_real_escape_string ($_POST['gadget_ex'])."'"); if($this->r['sql']->rows ($sGadget)) { $fGadget = $this->r['sql']->fetch ($sGadget); $this->r['sql']->query ("UPDATE gadgets SET titel = '".mysql_real_escape_string ($fGadget['naam'])."', gadget = '".(isset ($_POST['gadget_ex']) && !empty ($_POST['gadget_ex']) ? mysql_real_escape_string ($_POST['gadget_ex']) : mysql_real_escape_string ($_POST['gadget']))."' WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze gadget succesvol bewerkt.', 'panel/gadgets', 3); } else $this->r['functions']->redirect ('Fout', 'Deze gadget bestaat niet (meer).', 'panel/gadgets', 3); } else { $this->r['sql']->query ("UPDATE gadgets SET titel = '".mysql_real_escape_string ($_POST['titel'])."', gadget = '".(isset ($_POST['gadget_ex']) && !empty ($_POST['gadget_ex']) ? mysql_real_escape_string ($_POST['gadget_ex']) : mysql_real_escape_string ($_POST['gadget']))."' WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze gadget succesvol bewerkt.', 'panel/gadgets', 3); } } } else { $this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fVideo['pid'])); $this->r['tpl']->assign ("Bewerken", "Vtitel", $this->r['functions']->strip ($fVideo['titel'])); $this->r['tpl']->assign ("Bewerken", "Vgadget", nl2br ($this->r['functions']->strip ($fVideo['gadget']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } } else $this->r['functions']->redirect ('Fout', 'Deze gadget bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen gadget opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen gadget bewerken als je niet bent ingelogd.', 'members/login', 3); }
function gadget_verwijderen () { $this->r['tpl']->define (array ('index.tpl', 'panel/gadget_verwijderen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAlbum = $this->r['sql']->query ("SELECT * FROM gadgets WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAlbum)) { $this->r['sql']->query ("DELETE FROM gadgets WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze gadget succesvol verwijderd.', 'panel/videos', 3); } else $this->r['functions']->redirect ('Fout', 'Deze gadget bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen gadget opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen gadgets verwijderen als je niet bent ingelogd.', 'members/login', 3); }
function video_aanlijst () { $this->r['tpl']->define (array ('index.tpl', 'panel/video_toevoegen.tpl'));
if($this->r['client']->ingelogd == 1) { $sVideo = $this->r['sql']->query ("SELECT * FROM video WHERE pid = '".mysql_real_escape_string ($this->r['key'])."'"); if($this->r['sql']->rows ($sVideo)) { $fVideo = $this->r['sql']->fetch ($sVideo); $this->r['sql']->query ("INSERT INTO video (profile_id, titel, inhoud, datum) VALUES ('".mysql_real_escape_string ($this->r['user']['pid'])."', '".mysql_real_escape_string ($fVideo['titel'])."', '".mysql_real_escape_string ($fVideo['inhoud'])."', '".time ()."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze video succesvol aan jouw profiel toegevoegd.', 'panel/videos', 3); } else $this->r['functions']->redirect ('Fout', 'Deze video bestaat niet (meer).', 'members/login', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen video toevoegen als je niet bent ingelogd.', 'members/login', 3); }
function video_bewerken () { $this->r['tpl']->define (array ('index.tpl', 'panel/video_bewerken.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sVideo = $this->r['sql']->query ("SELECT * FROM video WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sVideo)) { $fVideo = $this->r['sql']->fetch ($sVideo);
$error = array (); if(!isset ($_POST['titel']) || strlen ($_POST['titel']) < 3 || strlen ($_POST['titel']) > 25) $error ['Ftitel'] = 'Je hebt geen geldige titel opgegeven.'; if(!isset ($_POST['video']) || strlen ($_POST['video']) < 3) $error ['Fvideo'] = 'Je hebt geen geldige video opgegeven.';
if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { if(count ($error) > 0) { foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Bewerken", "ErrorArea");
$this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Bewerken", "Vtitel", $this->r['functions']->strip ($_POST['titel'])); $this->r['tpl']->assign ("Bewerken", "Vvideo", nl2br ($this->r['functions']->strip ($_POST['video']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } else { $this->r['sql']->query ("UPDATE video SET titel = '".mysql_real_escape_string ($_POST['titel'])."', inhoud = '".mysql_real_escape_string ($_POST['video'])."' WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze video succesvol bewerkt.', 'panel/videos', 3); } } else { $this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fVideo['pid'])); $this->r['tpl']->assign ("Bewerken", "Vtitel", $this->r['functions']->strip ($fVideo['titel'])); $this->r['tpl']->assign ("Bewerken", "Vvideo", nl2br ($this->r['functions']->strip ($fVideo['inhoud']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } } else $this->r['functions']->redirect ('Fout', 'Deze video bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen video opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen video bewerken als je niet bent ingelogd.', 'members/login', 3); }
function video_verwijderen () { $this->r['tpl']->define (array ('index.tpl', 'panel/video_verwijderen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAlbum = $this->r['sql']->query ("SELECT * FROM video WHERE pid = '".$this->r['key']."' ".(isset ($this->r['user']['status']) && $this->r['user']['status'] == 'Beheerder' ? '' : "AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'")); if($this->r['sql']->rows ($sAlbum)) { $this->r['sql']->query ("DELETE FROM video WHERE pid = '".$this->r['key']."' ".(isset ($this->r['user']['status']) && $this->r['user']['status'] == 'Beheerder' ? '' : "AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'")); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze video succesvol verwijderd.', 'panel/videos', 3); } else $this->r['functions']->redirect ('Fout', 'Deze video bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen video opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen video's verwijderen als je niet bent ingelogd.', 'members/login', 3);
}
function tips () { $this->r['tpl']->define (array ('index.tpl', 'panel/tips.tpl'));
if($this->r['client']->ingelogd == 1) { $sTip = $this->r['sql']->query ("SELECT * FROM tips WHERE profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sTip)) { while ($fTip = $this->r['sql']->fetch ($sTip)) { $this->r['tpl']->assign ("Tips_R", "sPid", $this->r['functions']->strip ($fTip['pid'])); $this->r['tpl']->assign ("Tips_R", "sProfile_id", $this->r['functions']->strip ($fTip['profile_id'])); $this->r['tpl']->assign ("Tips_R", "sNaam", $this->r['functions']->strip ($fTip['naam'])); $this->r['tpl']->Parse ("Tips", "Tips_R"); } } else $this->r['tpl']->Parse ("Tips", "Tips_Geen");
$this->r['tpl']->Parse ("index", "Tips", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen tips beheren als je niet bent ingelogd.', 'members/login', 3);
}
function tip_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/tip_toevoegen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); $sFlood = $this->r['sql']->query ("SELECT * FROM flood WHERE pagina = 'Tip toevoegen' AND ip = '".$this->r['functions']->haal_ip ()."'");
if($this->r['sql']->rows ($sFlood)) $error ['Ftitel'] = 'Je hebt zojuist al een tip toegevoegd.'; if(!isset ($_POST['naam']) || strlen ($_POST['naam']) < 3 || strlen ($_POST['naam']) > 25) $error ['Fnaam'] = 'Je hebt geen geldige naam opgegeven.'; if(!isset ($_POST['tip']) || strlen ($_POST['tip']) < 3) $error ['Ftip'] = 'Je hebt geen geldige tip opgegeven.'; if(!isset ($_POST['categorie']) || ($_POST['categorie'] != 'Films' && $_POST['categorie'] != 'Boeken' && $_POST['categorie'] != 'Websites')) $error ['Fcategorie'] = 'Je hebt geen geldig categorie opgegeven.';
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Toevoegen", "ErrorArea");
foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Toevoegen", "V".$key, $this->r['functions']->strip ($content)); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else { $this->r['sql']->query ("INSERT INTO flood (pagina, ip, datum) VALUES ('Tip toevoegen', '".$this->r['functions']->haal_ip ()."', '".time ()."')"); $this->r['sql']->query ("INSERT INTO tips (profile_id, categorie, naam, review, datum) VALUES ('".mysql_real_escape_string ($this->r['user']['pid'])."', '".mysql_real_escape_string ($_POST['categorie'])."', '".mysql_real_escape_string ($_POST['naam'])."', '".mysql_real_escape_string ($_POST['tip'])."', '".time ()."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze tip succesvol toegevoegd.', 'panel/tips', 3); } } else $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen tip toevoegen als je niet bent ingelogd.', 'members/login', 3); }
function blogs () { $this->r['tpl']->define (array ('index.tpl', 'panel/blog.tpl'));
if($this->r['client']->ingelogd == 1) { $sBlog = $this->r['sql']->query ("SELECT * FROM blog WHERE profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sBlog)) { while ($fBlog = $this->r['sql']->fetch ($sBlog)) { $this->r['tpl']->assign ("Blog_R", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Blog_R", "sProfile_id", $this->r['functions']->strip ($fBlog['profile_id'])); $this->r['tpl']->assign ("Blog_R", "sTitel", $this->r['functions']->strip ($fBlog['titel'])); $this->r['tpl']->Parse ("Blog", "Blog_R"); } } else $this->r['tpl']->Parse ("Blog", "Blog_Geen");
$this->r['tpl']->Parse ("index", "Blog", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen blogs beheren als je niet bent ingelogd.', 'members/login', 3);
} function tip_bewerken () { $this->r['tpl']->define (array ('index.tpl', 'panel/tip_bewerken.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sBlog = $this->r['sql']->query ("SELECT * FROM tips WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sBlog)) { $fBlog = $this->r['sql']->fetch ($sBlog);
$error = array (); if(!isset ($_POST['naam']) || strlen ($_POST['naam']) < 3 || strlen ($_POST['naam']) > 25) $error ['Fnaam'] = 'Je hebt geen geldige naam opgegeven.'; if(!isset ($_POST['tip']) || strlen ($_POST['tip']) < 3) $error ['Ftip'] = 'Je hebt geen geldige tip opgegeven.'; if(!isset ($_POST['categorie']) || ($_POST['categorie'] != 'Films' && $_POST['categorie'] != 'Boeken' && $_POST['categorie'] != 'Websites')) $error ['Fcategorie'] = 'Je hebt geen geldig categorie opgegeven.';
if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { if(count ($error) > 0) { foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Bewerken", "ErrorArea");
$this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Bewerken", "Vnaam", $this->r['functions']->strip ($_POST['naam'])); $this->r['tpl']->assign ("Bewerken", "Vtip", nl2br ($this->r['functions']->strip ($_POST['tip']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } else { $this->r['sql']->query ("UPDATE tips SET categorie = '".mysql_real_escape_string ($_POST['categorie'])."', naam = '".mysql_real_escape_string ($_POST['naam'])."', tip = '".mysql_real_escape_string ($_POST['tip'])."' WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze tip succesvol bewerkt.', 'panel/tips', 3); } } else { $this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Bewerken", "Vnaam", $this->r['functions']->strip ($fBlog['naam'])); $this->r['tpl']->assign ("Bewerken", "Vtip", nl2br ($this->r['functions']->strip ($fBlog['tip']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } } else $this->r['functions']->redirect ('Fout', 'Deze tip bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen tip opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen tip bewerken als je niet bent ingelogd.', 'members/login', 3); }
function tip_verwijderen () { $this->r['tpl']->define (array ('index.tpl', 'panel/tip_verwijderen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAlbum = $this->r['sql']->query ("SELECT * FROM tips WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAlbum)) { $this->r['sql']->query ("DELETE FROM tips WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze tip succesvol verwijderd.', 'panel/tips', 3); } else $this->r['functions']->redirect ('Fout', 'Deze tip bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen tip opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen tips verwijderen als je niet bent ingelogd.', 'members/login', 3); }
function spots () { $this->r['tpl']->define (array ('index.tpl', 'panel/spots.tpl'));
if($this->r['client']->ingelogd == 1) { $sTip = $this->r['sql']->query ("SELECT * FROM spots WHERE profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sTip)) { while ($fTip = $this->r['sql']->fetch ($sTip)) { $this->r['tpl']->assign ("Spots_R", "sPid", $this->r['functions']->strip ($fTip['pid'])); $this->r['tpl']->assign ("Spots_R", "sProfile_id", $this->r['functions']->strip ($fTip['profile_id'])); $this->r['tpl']->assign ("Spots_R", "sNaam", $this->r['functions']->strip ($fTip['naam'])); $this->r['tpl']->Parse ("Spots", "Spots_R"); } } else $this->r['tpl']->Parse ("Spots", "Spots_Geen");
$this->r['tpl']->Parse ("index", "Spots", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen Spots beheren als je niet bent ingelogd.', 'members/login', 3);
}
function spot_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/spot_toevoegen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); $sFlood = $this->r['sql']->query ("SELECT * FROM flood WHERE pagina = 'Spot toevoegen' AND ip = '".$this->r['functions']->haal_ip ()."'");
if($this->r['sql']->rows ($sFlood)) $error ['Ftitel'] = 'Je hebt zojuist al een tip toegevoegd.'; if(!isset ($_POST['naam']) || strlen ($_POST['naam']) < 3 || strlen ($_POST['naam']) > 25) $error ['Fnaam'] = 'Je hebt geen geldige naam opgegeven.'; if(!isset ($_POST['omschrijving']) || strlen ($_POST['omschrijving']) < 3) $error ['Fomschrijving'] = 'Je hebt geen geldige uitleg opgegeven.'; if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Toevoegen", "ErrorArea");
foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Toevoegen", "V".$key, $this->r['functions']->strip ($content)); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else { $this->r['sql']->query ("INSERT INTO flood (pagina, ip, datum) VALUES ('Spot toevoegen', '".$this->r['functions']->haal_ip ()."', '".time ()."')"); $this->r['sql']->query ("INSERT INTO spots (profile_id, naam, uitleg, datum) VALUES ('".mysql_real_escape_string ($this->r['user']['pid'])."', '".mysql_real_escape_string ($_POST['naam'])."', '".mysql_real_escape_string ($_POST['omschrijving'])."', '".time ()."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze spot succesvol toegevoegd.', 'panel/spots', 3); } } else $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen spot toevoegen als je niet bent ingelogd.', 'members/login', 3); }
function spot_bewerken () { $this->r['tpl']->define (array ('index.tpl', 'panel/spot_bewerken.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sBlog = $this->r['sql']->query ("SELECT * FROM spots WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sBlog)) { $fBlog = $this->r['sql']->fetch ($sBlog);
$error = array (); if(!isset ($_POST['naam']) || strlen ($_POST['naam']) < 3 || strlen ($_POST['naam']) > 25) $error ['Fnaam'] = 'Je hebt geen geldige naam opgegeven.'; if(!isset ($_POST['omschrijving']) || strlen ($_POST['omschrijving']) < 3) $error ['Fomschrijving'] = 'Je hebt geen geldige uitleg opgegeven.'; if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { if(count ($error) > 0) { foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Bewerken", "ErrorArea");
$this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Bewerken", "Vnaam", $this->r['functions']->strip ($_POST['naam'])); $this->r['tpl']->assign ("Bewerken", "Vomschrijving", nl2br ($this->r['functions']->strip ($_POST['omschrijving']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } else { $this->r['sql']->query ("UPDATE spots SET naam = '".mysql_real_escape_string ($_POST['naam'])."', uitleg = '".mysql_real_escape_string ($_POST['omschrijving'])."' WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze tip succesvol bewerkt.', 'panel/spots', 3); } } else { $this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Bewerken", "Vnaam", $this->r['functions']->strip ($fBlog['naam'])); $this->r['tpl']->assign ("Bewerken", "Vomschrijving", nl2br ($this->r['functions']->strip ($fBlog['uitleg']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } } else $this->r['functions']->redirect ('Fout', 'Deze spot bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen spot opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen spot bewerken als je niet bent ingelogd.', 'members/login', 3); }
function spot_verwijderen () { $this->r['tpl']->define (array ('index.tpl', 'panel/spot_verwijderen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAlbum = $this->r['sql']->query ("SELECT * FROM spots WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAlbum)) { $this->r['sql']->query ("DELETE FROM spots WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze spot succesvol verwijderd.', 'panel/tips', 3); } else $this->r['functions']->redirect ('Fout', 'Deze spot bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen spot opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen spots verwijderen als je niet bent ingelogd.', 'members/login', 3); }
function blog_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/blog_toevoegen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); $sFlood = $this->r['sql']->query ("SELECT * FROM flood WHERE pagina = 'Blog toevoegen' AND ip = '".$this->r['functions']->haal_ip ()."'");
if($this->r['sql']->rows ($sFlood)) $error ['Ftitel'] = 'Je hebt zojuist al een blog toegevoegd.'; if(!isset ($_POST['titel']) || strlen ($_POST['titel']) < 3 || strlen ($_POST['titel']) > 25) $error ['Ftitel'] = 'Je hebt geen geldige titel opgegeven.'; if(!isset ($_POST['blog']) || strlen ($_POST['blog']) < 3) $error ['Fblog'] = 'Je hebt geen geldige blog opgegeven.';
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Toevoegen", "ErrorArea");
foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Toevoegen", "V".$key, $this->r['functions']->strip ($content)); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else { $this->r['sql']->query ("INSERT INTO flood (pagina, ip, datum) VALUES ('Blog toevoegen', '".$this->r['functions']->haal_ip ()."', '".time ()."')"); $this->r['sql']->query ("INSERT INTO blog (profile_id, titel, blog, datum) VALUES ('".mysql_real_escape_string ($this->r['user']['pid'])."', '".mysql_real_escape_string ($_POST['titel'])."', '".mysql_real_escape_string ($_POST['blog'])."', '".time ()."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze blog succesvol toegevoegd.', 'panel/blogs', 3); } } else $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen blog toevoegen als je niet bent ingelogd.', 'members/login', 3); }
function blog_bewerken () { $this->r['tpl']->define (array ('index.tpl', 'panel/blog_bewerken.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sBlog = $this->r['sql']->query ("SELECT * FROM blog WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sBlog)) { $fBlog = $this->r['sql']->fetch ($sBlog);
$error = array (); if(!isset ($_POST['titel']) || strlen ($_POST['titel']) < 3 || strlen ($_POST['titel']) > 25) $error ['Ftitel'] = 'Je hebt geen geldige titel opgegeven.'; if(!isset ($_POST['blog']) || strlen ($_POST['blog']) < 3) $error ['Fblog'] = 'Je hebt geen geldige blog opgegeven.';
if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { if(count ($error) > 0) { foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Bewerken", "ErrorArea");
$this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Bewerken", "Vtitel", $this->r['functions']->strip ($_POST['titel'])); $this->r['tpl']->assign ("Bewerken", "Vblog", nl2br ($this->r['functions']->strip ($_POST['blog']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } else { $this->r['sql']->query ("UPDATE blog SET titel = '".mysql_real_escape_string ($_POST['titel'])."', blog = '".mysql_real_escape_string ($_POST['blog'])."' WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze blog succesvol bewerkt.', 'panel/blogs', 3); } } else { $this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fBlog['pid'])); $this->r['tpl']->assign ("Bewerken", "Vtitel", $this->r['functions']->strip ($fBlog['titel'])); $this->r['tpl']->assign ("Bewerken", "Vblog", nl2br ($this->r['functions']->strip ($fBlog['blog']))); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } } else $this->r['functions']->redirect ('Fout', 'Deze blog bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen blog opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen blog bewerken als je niet bent ingelogd.', 'members/login', 3); }
function blog_verwijderen () { $this->r['tpl']->define (array ('index.tpl', 'panel/blog_verwijderen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAlbum = $this->r['sql']->query ("SELECT * FROM blog WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAlbum)) { $this->r['sql']->query ("DELETE FROM blog WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt deze blog succesvol verwijderd.', 'panel/blogs', 3); } else $this->r['functions']->redirect ('Fout', 'Deze blog bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen blog opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen blogs verwijderen als je niet bent ingelogd.', 'members/login', 3); }
function albums () { $this->r['tpl']->define (array ('index.tpl', 'panel/albums.tpl'));
if($this->r['client']->ingelogd == 1) { $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAlbums)) { while ($fAlbums = $this->r['sql']->fetch ($sAlbums)) { $this->r['tpl']->assign ("Albums_R", "sPid", $this->r['functions']->strip ($fAlbums['pid'])); $this->r['tpl']->assign ("Albums_R", "sProfile_id", $this->r['functions']->strip ($fAlbums['profile_id'])); $this->r['tpl']->assign ("Albums_R", "sNaam", $this->r['functions']->strip ($fAlbums['naam'])); $this->r['tpl']->Parse ("Albums", "Albums_R"); } } else $this->r['tpl']->Parse ("Albums", "Albums_Geen");
$this->r['tpl']->Parse ("index", "Albums", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen albums beheren als je niet bent ingelogd.', 'members/login', 3); }
function album_bewerken () { $this->r['tpl']->define (array ('index.tpl', 'panel/album_bewerken.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAlbum = $this->r['sql']->query ("SELECT * FROM albums WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAlbum)) { $fAlbum = $this->r['sql']->fetch ($sAlbum);
if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { if(!isset ($_POST['naam']) || strlen ($_POST['naam']) < 3 || strlen ($_POST['naam']) > 25) { ## Foute velden noteren $error [] = 'Je hebt geen naam ingetypt of deze is te groot.'; foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Bewerken", "ErrorArea");
$this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fAlbum['pid'])); $this->r['tpl']->assign ("Bewerken", "Vnaam", $this->r['functions']->strip ($_POST['naam'])); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } else { $this->r['sql']->query ("UPDATE albums SET naam = '".mysql_real_escape_string ($_POST['naam'])."' WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt dit album succesvol bewerkt.', 'panel/albums', 3); } } else { $this->r['tpl']->assign ("Bewerken", "sPid", $this->r['functions']->strip ($fAlbum['pid'])); $this->r['tpl']->assign ("Bewerken", "Vnaam", $this->r['functions']->strip ($fAlbum['naam'])); $this->r['tpl']->Parse ("index", "Bewerken", "content"); } } else $this->r['functions']->redirect ('Fout', 'Dit album bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen album opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen albums bewerken als je niet bent ingelogd.', 'members/login', 3); }
function album_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/album_toevoegen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $sFlood = $this->r['sql']->query ("SELECT * FROM flood WHERE pagina = 'Album toevoegen' AND ip = '".$this->r['functions']->haal_ip ()."'");
if(!isset ($_POST['naam']) || strlen ($_POST['naam']) < 3 || strlen ($_POST['naam']) > 25 || $this->r['sql']->rows ($sFlood)) { ## Foute velden noteren $error [] = 'Je hebt geen naam ingetypt of deze is te groot of je hebt net al een album toegevoegd.'; foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Toevoegen", "ErrorArea");
$this->r['tpl']->assign ("Toevoegen", "Vnaam", $this->r['functions']->strip ($_POST['naam'])); $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else { $this->r['sql']->query ("INSERT INTO flood (pagina, ip, datum) VALUES ('Album toevoegen', '".$this->r['functions']->haal_ip ()."', '".time ()."')"); $this->r['sql']->query ("INSERT INTO albums (naam, profile_id) VALUES ('".mysql_real_escape_string ($_POST['naam'])."', '".mysql_real_escape_string ($this->r['user']['pid'])."')"); $this->r['functions']->redirect ('Succesvol', 'Je hebt dit album succesvol toegevoegd.', 'panel/albums', 3); } } else $this->r['tpl']->Parse ("index", "Toevoegen", "content"); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen albums bewerken als je niet bent ingelogd.', 'members/login', 3); }
function album_verwijderen () { $this->r['tpl']->define (array ('index.tpl', 'panel/album_verwijderen.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAlbum = $this->r['sql']->query ("SELECT * FROM albums WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAlbum)) { $this->r['sql']->query ("DELETE FROM albums WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Je hebt dit album succesvol verwijderd.', 'panel/albums', 3); } else $this->r['functions']->redirect ('Fout', 'Dit album bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen album opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen albums bewerken als je niet bent ingelogd.', 'members/login', 3); }
function uploaden () { $this->r['tpl']->define (array ('index.tpl', 'panel/uploaden.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array (); if($this->r['user']['aantal_kb'] > $this->r['cfg']->max_kb_gebruiker) $error ['Faantal'] = 'Je hebt al het maximum aantal Kb's bereikt.';
$sMB = $this->r['user']['aantal_kb']; if(isset ($_FILES)) { foreach ($_FILES AS $key => $content) { if(isset ($_FILES [$key]['name']) && !empty ($_FILES[$key]['name'])) { if(filesize ($_FILES[$key]['tmp_name']) < $this->r['cfg']->max) { $sExtensie = end(explode (".", $_FILES[$key]['name'])); $sGrootte = filesize ($_FILES[$key]['tmp_name']);
if(in_array ($sExtensie, $this->r['cfg']->extensies)) { if ($this->r['cfg']->controle_mime != 1 || in_array ($_FILES[$key]['type'], $this->r['cfg']->mimetypes)) { if(($sMB + $sGrootte) > $this->r['cfg']->max_kb_gebruiker && $this->r['user']['vip'] != 1 && $this->r['user']['credits'] < 24) $error [] = 'Bij plaatje '.$key.' ('.$_FILES[$key]['name'].') zat u al aan uw limiet.'; else $sMB + $sGrootte; } else $error [] = 'Afbeelding '.$key.' heeft een extensie die niet is toegestaan.'; } else $error [] = 'Afbeelding '.$key.' heeft een extensie die niet is toegestaan.'; } else $error [] = 'Afbeelding '.$key.' is te groot.'; } } }
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Uploaden", "ErrorArea"); foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Uploaden", "V".$key, $this->r['functions']->strip ($content));
if($this->r['user']['aantal_kb'] < $this->r['cfg']->max_kb_gebruiker) { $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".$this->r['user']['pid']."'"); if($this->r['sql']->rows ($sAlbums)) { for ($i = 1; $i < 6; $i++) { $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".$this->r['user']['pid']."'"); while ($fAlbums = $this->r['sql']->fetch ($sAlbums)) { $this->r['tpl']->assign ("Albums_R_".$i, "sPid", $fAlbums['pid']); $this->r['tpl']->assign ("Albums_R_".$i, "sNaam", $this->r['functions']->strip ($fAlbums['naam'])); $this->r['tpl']->Parse ("Uploaden", "Albums_R_".$i); } } $this->r['tpl']->Parse("index","Uploaden","content"); } else $this->r['functions']->redirect('Fout', "Je hebt nog geen albums aangemaakt.", 'panel/albums', 3); } else $this->r['functions']->redirect('Fout', "U hebt al het maximaal aantal mb's aan afbeeldingen bereikt.", $cfg['main']['adres'], 3); } else { $sMB = $this->r['user']['aantal_kb']; foreach ($_FILES AS $key => $content) { if(isset ($_FILES [$key]['name']) && !empty ($_FILES[$key]['name'])) { if(filesize ($_FILES[$key]['tmp_name']) < $this->r['cfg']->max) { $sExtensie = end(explode (".", $_FILES[$key]['name'])); $sGrootte = filesize ($_FILES[$key]['tmp_name']);
if(in_array ($sExtensie, $this->r['cfg']->extensies)) { if($this->r['cfg']->controle_mime != 1 || in_array ($_FILES[$key]['type'], $this->r['cfg']->mimetypes)) { $sMB + $sGrootte; if(!is_dir ('upload/'.(isset ($_POST['profielfoto']) && $_POST['profielfoto'] == $key ? 'profielfotos' : 'afbeeldingen').'/'.$this->r['user']['pid'])) mkdir ('upload/'.(isset ($_POST['profielfoto']) && $_POST['profielfoto'] == $key ? 'profielfotos' : 'afbeeldingen').'/'.$this->r['user']['pid']); if(!is_dir ('upload/thumbnails/'.$this->r['user']['pid'])) mkdir ('upload/thumbnails/'.$this->r['user']['pid']); chmod('upload/'.(isset ($_POST['profielfoto']) && $_POST['profielfoto'] == $key ? 'profielfotos' : 'afbeeldingen').'/'.$this->r['user']['pid'], 0777 ) ; chmod('upload/thumbnails/'.$this->r['user']['pid'], 0777 ) ;
copy($_FILES[$key]['tmp_name'], 'upload/'.(isset ($_POST['profielfoto']) && $_POST['profielfoto'] == $key ? 'profielfotos' : 'afbeeldingen').'/'.$this->r['user']['pid'].'/'.$_FILES[$key]['name']); chmod('upload/'.(isset ($_POST['profielfoto']) && $_POST['profielfoto'] == $key ? 'profielfotos' : 'afbeeldingen').'/'.$this->r['user']['pid'].'/'.$_FILES[$key]['name'], 0777 ) ;
require_once ('classes/image.php'); /* THUMBNAIL MODE */
// save to file (true) or output to browser (false) $save_to_file = true;
// Quality for JPEG and PNG. // 0 (worst quality, smaller file) to 100 (best quality, bigger file) // Note: PNG quality is only supported starting PHP 5.1.2 $image_quality = 100;
// resulting image type (1 = GIF, 2 = JPG, 3 = PNG) // enter code of the image type if you want override it // or set it to -1 to determine automatically $image_type = -1;
// maximum thumb side size $max_x = 121; $max_y = 88;
// cut image before resizing. Set to 0 to skip this. $cut_x = 0; $cut_y = 0;
// Folder where source images are stored (thumbnails will be generated from these images). // MUST end with slash. $images_folder = 'upload/'.(isset ($_POST['profielfoto']) && $_POST['profielfoto'] == $key ? 'profielfotos' : 'afbeeldingen').'/'.$this->r['user']['pid'].'/';
// Folder to save thumbnails, full path from the root folder, MUST end with slash. // Only needed if you save generated thumbnails on the server. // Sample for windows: c:/wwwroot/thumbs/ // Sample for unix/linux: /home/site.com/htdocs/thumbs/ $thumbs_folder = 'upload/thumbnails/'.$this->r['user']['pid'].'/';
/////////////////////////////////////////////////// /////////////// DO NOT EDIT BELOW ///////////////////////////////////////////////////
$to_name = ''; $from_name = $_FILES[$key]['name']; $to_name = $_FILES[$key]['name'];
if (!file_exists($images_folder)) die('Images folder does not exist (update $images_folder in the script)'); if ($save_to_file && !file_exists($thumbs_folder)) die('Thumbnails folder does not exist (update $thumbs_folder in the script)');
// Allocate all necessary memory for the image. // Special thanks to Alecos for providing the code. ini_set('memory_limit', '-1');
// include image processing code //include('include/image.class.php');
$img = new Zubrag_image;
// initialize $img->max_x = $max_x; $img->max_y = $max_y; $img->cut_x = $cut_x; $img->cut_y = $cut_y; $img->quality = $image_quality; $img->save_to_file = $save_to_file; $img->image_type = $image_type;
// generate thumbnail $img->GenerateThumbFile($images_folder . $from_name, $thumbs_folder . $to_name); /* END THUMBNAIL MODE */
$sAfmetingen = @getimagesize ('upload/afbeeldingen/'.$this->r['user']['pid'].'/'.$_FILES[$key]['name']); $this->r['sql']->query ("INSERT INTO afbeeldingen (profile_id, naam, titel, album, datum, omschrijving, breedte, hoogte, grootte, profielfoto) VALUES ('".$this->r['user']['pid']."', '".$_FILES[$key]['name']."', '".mysql_real_escape_string ($_POST['naam_'.$key])."', '".mysql_real_escape_string ($_POST['album_'.$key])."', '".time ()."', '".mysql_real_escape_string ($_POST['omschrijving_'.$key])."', '".$sAfmetingen[0]."', '".$sAfmetingen[1]."', '".$sGrootte."', '".(isset ($_POST['profielfoto']) && $_POST['profielfoto'] == $key ? 1 : 0)."')"); } if (isset ($_POST['profielfoto']) && $_POST['profielfoto'] == $key) $this->r['sql']->query ("UPDATE ##profielen SET profielfoto = '".$_FILES[$key]['name']."' WHERE pid = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND geactiveerd = '1'"); } } } } $this->r['sql']->query ("UPDATE ##profielen SET aantal_kb = '".mysql_real_escape_string ($sMB)."' WHERE pid = '".$this->r['key']."'"); $this->r['functions']->redirect ('Succesvol', 'Al jouw afbeeldingen zijn succesvol geupload.', 'panel/index', 3); } } else { if($this->r['user']['aantal_kb'] < $this->r['cfg']->max_kb_gebruiker) { $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".$this->r['user']['pid']."'"); if($this->r['sql']->rows ($sAlbums)) { for ($i = 1; $i < 6; $i++) { $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".$this->r['user']['pid']."'"); while ($fAlbums = $this->r['sql']->fetch ($sAlbums)) { $this->r['tpl']->assign ("Albums_R_".$i, "sPid", $fAlbums['pid']); $this->r['tpl']->assign ("Albums_R_".$i, "sNaam", $this->r['functions']->strip ($fAlbums['naam'])); $this->r['tpl']->Parse ("Uploaden", "Albums_R_".$i); } } $this->r['tpl']->Parse("index","Uploaden","content"); } else $this->r['functions']->redirect('Fout', "Je hebt nog geen albums aangemaakt.", 'panel/albums', 3); } else $this->r['functions']->redirect('Fout', "U hebt al het maximaal aantal mb's aan afbeeldingen bereikt.", $cfg['main']['adres'], 3); } } else $this->r['functions']->redirect ('Fout', 'Je kunt geen afbeeldingen uploaden als je niet bent ingelogd.', 'members/login', 3); }
function geluid_toevoegen () { $this->r['tpl']->define (array ('index.tpl', 'panel/geluid_toevoegen.tpl')); $this->r['cfg']->max_geluid = 1000000000; $this->r['cfg']->extensies_geluid = array ('mp3', 'wav');
if($this->r['client']->ingelogd == 1) { if($this->r['user']['vip'] == 1 || $this->r['user']['credits'] > $this->r['cfg']->credits_geluid || $this->r['user']['credits'] == $this->r['cfg']->credits_geluid) { if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') {
$error = array ();
$sMB = $this->r['user']['aantal_kb']; if(isset ($_FILES)) { foreach ($_FILES AS $key => $content) { if(isset ($_FILES [$key]['name']) && !empty ($_FILES[$key]['name'])) { if(filesize ($_FILES[$key]['tmp_name']) < $this->r['cfg']->max_geluid) { $sExtensie = end(explode (".", $_FILES[$key]['name'])); $sGrootte = filesize ($_FILES[$key]['tmp_name']);
if(in_array ($sExtensie, $this->r['cfg']->extensies_geluid)) { if ($this->r['cfg']->controle_mime != 1 || in_array ($_FILES[$key]['type'], $this->r['cfg']->mimetypes)) { if(($sMB + $sGrootte) > $this->r['cfg']->max_kb_gebruiker && $this->r['user']['vip'] != 1) $error [] = 'Bij plaatje '.$key.' ('.$_FILES[$key]['name'].') zat u al aan uw limiet.'; else $sMB + $sGrootte; } else $error [] = 'Geluid '.$key.' heeft een extensie die niet is toegestaan.'; } else $error [] = 'Geluid '.$key.' heeft een extensie die niet is toegestaan.'; } else $error [] = 'Geluid '.$key.' is te groot.'; } } } if(!isset ($_FILES)) $error [] = 'Geluid is ongeldig of niet ingevuld.'; if(!isset ($_POST['titel']) || empty ($_POST['titel'])) $error ['Ftitel'] = 'Je hebt geen naam opgegeven!';
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Uploaden", "ErrorArea"); foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Uploaden", "V".$key, $this->r['functions']->strip ($content));
$this->r['tpl']->Parse("index","Uploaden","content"); } else { $sMB = $this->r['user']['aantal_kb'];
foreach ($_FILES AS $key => $content) { if(isset ($_FILES [$key]['name']) && !empty ($_FILES[$key]['name'])) { if(filesize ($_FILES[$key]['tmp_name']) < $this->r['cfg']->max_geluid) { $sExtensie = end(explode (".", $_FILES[$key]['name'])); $sGrootte = filesize ($_FILES[$key]['tmp_name']);
if(in_array ($sExtensie, $this->r['cfg']->extensies_geluid)) { if($this->r['cfg']->controle_mime != 1 || in_array ($_FILES[$key]['type'], $this->r['cfg']->mimetypes)) { $sMB + $sGrootte; if(!is_dir ('upload/geluiden/'.$this->r['user']['pid'])) mkdir ('upload/geluiden/'.$this->r['user']['pid']); copy($_FILES[$key]['tmp_name'], 'upload/geluiden/'.$this->r['user']['pid'].'/'.$_FILES[$key]['name']); chmod('upload/geluiden/'.$this->r['user']['pid'].'/'.$_FILES[$key]['name'], 0777 ) ;
$this->r['sql']->query ("INSERT INTO ##geluiden (naam, titel, datum, profile_id) VALUES ('".$_FILES['bestand']['name']."', '".mysql_real_escape_string ($_POST['titel'])."', '".time ()."', '".$this->r['user']['pid']."')"); if($this->r['user']['vip'] != 1) $this->r['sql']->query ("UPDATE ##profielen SET credits = credits - ".$this->r['cfg']->credits_geluid." WHERE pid = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Dit geluid is succesvol toegevoegd.', '', 3); } } } } } } } else { $this->r['tpl']->Parse("index","Uploaden","content"); } } else $this->r['functions']->redirect ('Fout', 'Je bent geen VIP member of je hebt niet genoeg credits ('.$this->r['cfg']->credits_geluid.').', 'panel/credits', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen afbeeldingen uploaden als je niet bent ingelogd.', 'members/login', 3); }
function afbeelding_bewerken () { $this->r['tpl']->define (array ('index.tpl', 'panel/afbeelding_bewerken.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAfbeelding = $this->r['sql']->query ("SELECT * FROM afbeeldingen WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if($this->r['sql']->rows ($sAfbeelding)) { $fAfbeelding = $this->r['sql']->fetch ($sAfbeelding);
if(isset ($_POST['submit']) || $_SERVER['REQUEST_METHOD'] == 'post') { $error = array ();
if(!isset ($_POST['titel']) || strlen ($_POST['titel']) < 3 || strlen ($_POST['titel']) > 60) $error ['Ftitel'] = 'De titel is te klein of te groot.'; if(!isset ($_POST['omschrijving']) || strlen ($_POST['omschrijving']) < 3 || strlen ($_POST['omschrijving']) > 60) $error ['Fomschrijving'] = 'De omschrijving is te klein of te groot.';
if(count ($error) > 0) { ## Foute velden noteren foreach ($error AS $key => $value) { $this->r['tpl']->assign ("ErrorArea_R", "sFout", $value); $this->r['tpl']->Parse ("ErrorArea", "ErrorArea_R"); } $this->r['tpl']->Parse ("Bewerken", "ErrorArea"); foreach ($_POST AS $key => $content) $this->r['tpl']->assign ("Bewerken", "V".$key, $this->r['functions']->strip ($content));
$this->r['tpl']->assign ("Bewerken", "sPid", $this->r['key']); $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".$this->r['user']['pid']."'"); if($this->r['sql']->rows ($sAlbums)) { for ($i = 1; $i < 6; $i++) { $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".$this->r['user']['pid']."'"); while ($fAlbums = $this->r['sql']->fetch ($sAlbums)) { $this->r['tpl']->assign ("Albums_R_".$i, "sPid", $fAlbums['pid']); $this->r['tpl']->assign ("Albums_R_".$i, "sNaam", $this->r['functions']->strip ($fAlbums['naam'])); $this->r['tpl']->Parse ("Bewerken", "Albums_R_".$i); } } $this->r['tpl']->Parse("index","Bewerken","content"); } else $this->r['functions']->redirect('Fout', "Je hebt nog geen albums aangemaakt.", 'panel/albums', 3); } else { $this->r['sql']->query ("UPDATE afbeeldingen SET titel = '".mysql_real_escape_string ($_POST['titel'])."', omschrijving = '".mysql_real_escape_string ($_POST['omschrijving'])."', album = '".mysql_real_escape_string ($_POST['album'])."' WHERE pid = '".$this->r['key']."' AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $this->r['functions']->redirect ('Succesvol', 'Deze afbeelding is succesvol bewerkt.', 'members/profile/'.$this->r['user']['pid'].'/afbeeldingen/'.$this->r['key'], 3); } } else { $this->r['tpl']->assign ("Bewerken", "sPid", $this->r['key']); $this->r['tpl']->assign ("Bewerken", "Vtitel", $this->r['functions']->strip ($fAfbeelding['titel'])); $this->r['tpl']->assign ("Bewerken", "Vomschrijving", nl2br ($this->r['functions']->strip ($fAfbeelding['omschrijving']))); $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".$this->r['user']['pid']."'"); if($this->r['sql']->rows ($sAlbums)) { for ($i = 1; $i < 6; $i++) { $sAlbums = $this->r['sql']->query ("SELECT * FROM albums WHERE profile_id = '".$this->r['user']['pid']."'"); while ($fAlbums = $this->r['sql']->fetch ($sAlbums)) { $this->r['tpl']->assign ("Albums_R_".$i, "sPid", $fAlbums['pid']); $this->r['tpl']->assign ("Albums_R_".$i, "sNaam", $this->r['functions']->strip ($fAlbums['naam'])); $this->r['tpl']->assign ("Albums_R_".$i, "sSelected", ($fAlbums['pid'] == $fAfbeelding['album'] ? 'selected="selected"' : '')); $this->r['tpl']->Parse ("Bewerken", "Albums_R_".$i); } } $this->r['tpl']->Parse("index","Bewerken","content"); } else $this->r['functions']->redirect('Fout', "Je hebt nog geen albums aangemaakt.", 'panel/albums', 3); } } else $this->r['functions']->redirect ('Fout', 'Deze afbeelding bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen afbeelding opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen afbeeldingen bewerken als je niet bent ingelogd.', 'members/login', 3); }
function afbeelding_verwijderen () { $this->r['tpl']->define (array ('index.tpl', 'panel/afbeelding_bewerken.tpl'));
if($this->r['client']->ingelogd == 1) { if(isset ($this->r['key']) && !empty ($this->r['key']) && ctype_digit ($this->r['key'])) { $sAfbeelding = $this->r['sql']->query ("SELECT * FROM afbeeldingen WHERE pid = '".$this->r['key']."' ".($this->r['user']['status'] != 'Beheerder' ? "AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'" : "")); if($this->r['sql']->rows ($sAfbeelding)) { $fAfbeelding = $this->r['sql']->fetch ($sAfbeelding);
@unlink ('upload/afbeeldingen/'.$fAfbeelding['profile_id'].'/'.$this->r['functions']->strip ($fAfbeelding['naam'])); $this->r['sql']->query ("DELETE FROM afbeeldingen WHERE pid = '".$this->r['key']."' ".($this->r['user']['status'] != 'Beheerder' ? "AND profile_id = '".mysql_real_escape_string ($this->r['user']['pid'])."'" : "")); $this->r['functions']->redirect ('Succesvol', 'Deze afbeelding is succesvol verwijderd.', 'members/profile/'.$fAfbeelding['profile_id'].'/afbeeldingen', 3); } else $this->r['functions']->redirect ('Fout', 'Deze afbeelding bestaat niet (meer) of is niet van jou.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je hebt geen afbeelding opgegeven.', '', 3); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen afbeeldingen bewerken als je niet bent ingelogd.', 'members/login', 3); } function statistieken () { $this->r['tpl']->define (array ('index.tpl', 'panel/statistieken.tpl'));
if($this->r['client']->ingelogd == 1) {
if($this->r['user']['vip'] != 1 && ($this->r['user']['stats_datum'] == 0 || $this->r['user']['stats_datum'] < time ())) { if($this->r['user']['credits'] > $this->r['cfg']->credits_stats || $this->r['user']['credits'] == $this->r['cfg']->credits_stats) { $this->r['sql']->query ("UPDATE ##profielen SET credits = credits - ".$this->r['cfg']->credits_stats.", stats_datum = '".(time () + (60*60*24*31))."' WHERE pid = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); Header ('Location: '.$this->r['cfg']->adres_met.'/panel/statistieken'); } else $this->r['functions']->redirect ('Fout', 'Je kunt geen statistieken bekijken als je geen VIP bent of niet genoeg credits hebt, je eventuele vorige statistieken-credits zijn verlopen!', 'panel/index', 3); } else { ///////// maandvisits $monthvisits = $this->r['sql']->query (" SELECT DISTINCT `user_id` , HOUR( datum ) , `ip` FROM bekeken WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND MONTH( datum ) = MONTH( current_DATE )"); $monthvisits_rows = $this->r['sql']->rows ($monthvisits); $monthvisits_un = $this->r['sql']->query (" SELECT DISTINCT `user_id` , DAY( datum ) , `ip` FROM bekeken WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND MONTH( datum ) = MONTH( current_DATE )"); $monthvisits_un_rows = $this->r['sql']->rows ($monthvisits_un); $monthvisits_friends = $this->r['sql']->query (" SELECT DISTINCT `user_id` , HOUR( datum ) , `ip` FROM bekeken JOIN vrienden ON ( vrienden.profile_id = bekeken.user_id AND vrienden.uid = bekeken.visited_id ) WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND MONTH( datum ) = MONTH( current_DATE ) AND wederzijds =1"); $monthvisits_friends_rows = $this->r['sql']->rows ($monthvisits_friends); $monthvisits_friends_un = $this->r['sql']->query (" SELECT DISTINCT `user_id` FROM bekeken JOIN vrienden ON ( vrienden.profile_id = bekeken.user_id AND vrienden.uid = bekeken.visited_id ) WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND MONTH( datum ) = MONTH( current_DATE ) AND wederzijds =1"); $monthvisits_friends_rows_un = $this->r['sql']->rows ($monthvisits_friends_un); $monthgoogle = $this->r['sql']->query (" SELECT * FROM `bekeken` WHERE `referer` LIKE '%http://www.google.nl/%' AND MONTH( datum ) = MONTH( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $monthgoogle_rows = $this->r['sql']->rows ($monthgoogle); //////////////////////////////////
$monthref = $this->r['sql']->query (" SELECT DISTINCT `referer` FROM `bekeken` WHERE `referer` LIKE '%http://www.cmyid.nl/index/members/profile/%' AND MONTH( datum ) = MONTH( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if ($this->r['sql']->rows ($monthref)) { while ($refs = $this->r['sql']->fetch ($monthref)) { $strip = str_replace('http://www.cmyid.nl/index/members/profile/', '', $refs['referer']); $split = split('[/]', $strip); $id = $split[0]; $array[] = $id; } $result = array_unique($array); foreach($result as $item) { $profilesql = $this->r['sql']->query (" SELECT `gebruikersnaam` FROM `profielen` WHERE `pid` = '".$item."'"); $profile = $this->r['sql']->fetch ($profilesql); $this->r['tpl']->assign ("Statfriendm", "Statfriendm", $profile['gebruikersnaam']); $this->r['tpl']->assign ("Statfriendm", "Statfriendurlm", 'http://www.cmyid.nl/index/members/profile/'.$item); $this->r['tpl']->Parse ("Statistieken", "Statfriendm"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatfriendm"); } $monthimg = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'afbeeldingen' AND `item_id` !=0 AND MONTH( datum ) = MONTH( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($monthimg)) { while ($imgs = $this->r['sql']->fetch ($monthimg)) { $imgsql = $this->r['sql']->query (" SELECT `titel`, `profile_id`, `naam` FROM `afbeeldingen` WHERE `pid` = '".$imgs['item_id']."'"); $images = $this->r['sql']->fetch ($imgsql); $this->r['tpl']->assign ("Statimgm", "Statimgurlm", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/afbeeldingen/'.$imgs['item_id']); $this->r['tpl']->assign ("Statimgm", "Statimgsourcem", 'http://www.cmyid.nl/upload/afbeeldingen/'.$images['profile_id'].'/'.$images['naam']); $this->r['tpl']->assign ("Statimgm", "Statimgviewsm", $imgs['views']); $this->r['tpl']->Parse ("Statistieken", "Statimgm"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatimgm"); } $monthblog = $this->r['sql']->query (" SELECT pid, titel, bekeken FROM `blog` WHERE `profile_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND bekeken > 0 "); if ($this->r['sql']->rows ($monthblog)) { while ($blogs = $this->r['sql']->fetch ($monthblog)) { $this->r['tpl']->assign ("Statblogm", "Statblogurlm", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/blog/'.$blogs['pid']); $this->r['tpl']->assign ("Statblogm", "Statblogtitlem", $blogs['titel']); $this->r['tpl']->assign ("Statblogm", "Statblogviewsm", $blogs['bekeken']); $this->r['tpl']->Parse ("Statistieken", "Statblogm"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatblogm"); } $monthpoll = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'polls' AND `item_id` != 0 AND MONTH( datum ) = MONTH( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($monthpoll)) { while ($polls = $this->r['sql']->fetch ($monthpoll)) { $pollsql = $this->r['sql']->query (" SELECT `vraag` FROM `polls` WHERE `pid` = '".$polls['item_id']."'"); $poll = $this->r['sql']->fetch ($pollsql); $this->r['tpl']->assign ("Statpollm", "Statpollurlm", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/polls/'.$polls['item_id']); $this->r['tpl']->assign ("Statpollm", "Statpolltitlem", $poll['vraag']); $this->r['tpl']->assign ("Statpollm", "Statpollviewsm", $polls['views']); $this->r['tpl']->Parse ("Statistieken", "Statpollm"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatpollm"); } $monthspot = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'spots' AND `item_id` != 0 AND MONTH( datum ) = MONTH( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($monthspot)) { while ($spots = $this->r['sql']->fetch ($monthspot)) { $spotsql = $this->r['sql']->query (" SELECT `naam` FROM `spots` WHERE `pid` = '".$spots['item_id']."'"); $spot = $this->r['sql']->fetch ($spotsql); $this->r['tpl']->assign ("Statspotm", "Statspoturlm", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/spots/'.$spots['item_id']); $this->r['tpl']->assign ("Statspotm", "Statspottitlem", $spot['naam']); $this->r['tpl']->assign ("Statspotm", "Statspotviewsm", $spots['views']); $this->r['tpl']->Parse ("Statistieken", "Statspotm"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatspotm"); }
$monthtip = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'tips' AND `item_id` != 0 AND MONTH( datum ) = MONTH( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($monthtip)) { while ($tips = $this->r['sql']->fetch ($monthtip)) { $tipsql = $this->r['sql']->query (" SELECT `naam` FROM `tips` WHERE `pid` = '".$tips['item_id']."'"); $tip = $this->r['sql']->fetch ($spotsql); $this->r['tpl']->assign ("Stattipm", "Stattipurlm", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/tips/'.$tips['item_id']); $this->r['tpl']->assign ("Stattipm", "Stattiptitlem", $tip['naam']); $this->r['tpl']->assign ("Stattipm", "Stattipviewsm", $tips['views']); $this->r['tpl']->Parse ("Statistieken", "Stattipm"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStattipm"); }
$monthgadget = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'gadgets' AND `item_id` != 0 AND MONTH( datum ) = MONTH( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($monthgadget)) { while ($gadgets = $this->r['sql']->fetch ($monthgadget)) { $gadgetsql = $this->r['sql']->query (" SELECT `titel` FROM `gadgets` WHERE `pid` = '".$tips['item_id']."'"); $gadget = $this->r['sql']->fetch ($gadgetsql); $this->r['tpl']->assign ("Statgadgetm", "Statgadgeturlm", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/gadgets/'.$gadgets['item_id']); $this->r['tpl']->assign ("Statgadgetm", "Statgadgettitlem", $gadget['naam']); $this->r['tpl']->assign ("Statgadgetm", "Statgadgetviewsm", $gadgets['views']); $this->r['tpl']->Parse ("Statistieken", "Statgadgetm"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatgadgetm"); } ////////// ///////// weekvisits $weekvisits = $this->r['sql']->query (" SELECT DISTINCT `user_id` , HOUR( datum ) , `ip` FROM bekeken WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND WEEK( datum ) = WEEK( current_DATE )"); $weekvisits_rows = $this->r['sql']->rows ($weekvisits); $weekvisits_un = $this->r['sql']->query (" SELECT DISTINCT `user_id` , DAY( datum ) , `ip` FROM bekeken WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND WEEK( datum ) = WEEK( current_DATE )"); $weekvisits_un_rows = $this->r['sql']->rows ($weekvisits_un); $weekvisits_friends = $this->r['sql']->query (" SELECT DISTINCT `user_id` , HOUR( datum ) , `ip` FROM bekeken JOIN vrienden ON ( vrienden.profile_id = bekeken.user_id AND vrienden.uid = bekeken.visited_id ) WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND WEEK( datum ) = WEEK( current_DATE ) AND wederzijds =1"); $weekvisits_friends_rows = $this->r['sql']->rows ($weekvisits_friends); $weekvisits_friends_un = $this->r['sql']->query (" SELECT DISTINCT `user_id` FROM bekeken JOIN vrienden ON ( vrienden.profile_id = bekeken.user_id AND vrienden.uid = bekeken.visited_id ) WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND WEEK( datum ) = WEEK( current_DATE ) AND wederzijds =1"); $weekvisits_friends_rows_un = $this->r['sql']->rows ($weekvisits_friends_un); $weekgoogle = $this->r['sql']->query (" SELECT * FROM `bekeken` WHERE `referer` LIKE '%http://www.google.nl/%' AND WEEK( datum ) = WEEK( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $weekgoogle_rows = $this->r['sql']->rows ($weekgoogle); $weekref = $this->r['sql']->query (" SELECT DISTINCT `referer` FROM `bekeken` WHERE `referer` LIKE '%http://www.cmyid.nl/index/members/profile/%' AND WEEK( datum ) = WEEK( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if ($this->r['sql']->rows ($weekref)) { while ($refs = $this->r['sql']->fetch ($weekref)) { $strip = str_replace('http://www.cmyid.nl/index/members/profile/', '', $refs['referer']); $split = split('[/]', $strip); $id = $split[0]; $array[] = $id; } $result = array_unique($array); foreach($result as $item) { $profilesql = $this->r['sql']->query (" SELECT `gebruikersnaam` FROM `profielen` WHERE `pid` = '".$item."'"); $profile = $this->r['sql']->fetch ($profilesql); $this->r['tpl']->assign ("Statfriendw", "Statfriendw", $profile['gebruikersnaam']); $this->r['tpl']->assign ("Statfriendw", "Statfriendurlw", 'http://www.cmyid.nl/index/members/profile/'.$item); $this->r['tpl']->Parse ("Statistieken", "Statfriendw"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatfriendw"); } $weekimg = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'afbeeldingen' AND `item_id` !=0 AND WEEK( datum ) = WEEK( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($weekimg)) { while ($imgs = $this->r['sql']->fetch ($weekimg)) { $imgsql = $this->r['sql']->query (" SELECT `titel`, `profile_id`, `naam` FROM `afbeeldingen` WHERE `pid` = '".$imgs['item_id']."'"); $images = $this->r['sql']->fetch ($imgsql); $this->r['tpl']->assign ("Statimgw", "Statimgurlw", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/afbeeldingen/'.$imgs['item_id']); $this->r['tpl']->assign ("Statimgw", "Statimgsourcew", 'http://www.cmyid.nl/upload/afbeeldingen/'.$images['profile_id'].'/'.$images['naam']); $this->r['tpl']->assign ("Statimgw", "Statimgviewsw", $imgs['views']); $this->r['tpl']->Parse ("Statistieken", "Statimgw"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatimgw"); } $weekblog = $this->r['sql']->query (" SELECT pid, titel, bekeken FROM `blog` WHERE `profile_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND bekeken > 0 "); if ($this->r['sql']->rows ($weekblog)) { while ($blogs = $this->r['sql']->fetch ($weekblog)) { $this->r['tpl']->assign ("Statblogw", "Statblogurlw", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/blog/'.$blogs['pid']); $this->r['tpl']->assign ("Statblogw", "Statblogtitlew", $blogs['titel']); $this->r['tpl']->assign ("Statblogw", "Statblogviewsw", $blogs['bekeken']); $this->r['tpl']->Parse ("Statistieken", "Statblogw"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatblogw"); } $weekpoll = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'polls' AND `item_id` != 0 AND WEEK( datum ) = WEEK( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($weekpoll)) { while ($polls = $this->r['sql']->fetch ($weekpoll)) { $pollsql = $this->r['sql']->query (" SELECT `vraag` FROM `polls` WHERE `pid` = '".$polls['item_id']."'"); $poll = $this->r['sql']->fetch ($pollsql); $this->r['tpl']->assign ("Statpollw", "Statpollurlw", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/polls/'.$polls['item_id']); $this->r['tpl']->assign ("Statpollw", "Statpolltitlew", $poll['vraag']); $this->r['tpl']->assign ("Statpollw", "Statpollviewsw", $polls['views']); $this->r['tpl']->Parse ("Statistieken", "Statpollw"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatpollw"); } $weekspot = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'spots' AND `item_id` != 0 AND WEEK( datum ) = WEEK( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($weekspot)) { while ($spots = $this->r['sql']->fetch ($weekspot)) { $spotsql = $this->r['sql']->query (" SELECT `naam` FROM `spots` WHERE `pid` = '".$spots['item_id']."'"); $spot = $this->r['sql']->fetch ($spotsql); $this->r['tpl']->assign ("Statspotw", "Statspoturlw", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/spots/'.$spots['item_id']); $this->r['tpl']->assign ("Statspotw", "Statspottitlew", $spot['naam']); $this->r['tpl']->assign ("Statspotw", "Statspotviewsw", $spots['views']); $this->r['tpl']->Parse ("Statistieken", "Statspotw"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatspotw"); }
$weektip = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'tips' AND `item_id` != 0 AND WEEK( datum ) = WEEK( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($weektip)) { while ($tips = $this->r['sql']->fetch ($weektip)) { $tipsql = $this->r['sql']->query (" SELECT `naam` FROM `tips` WHERE `pid` = '".$tips['item_id']."'"); $tip = $this->r['sql']->fetch ($spotsql); $this->r['tpl']->assign ("Stattipw", "Stattipurlw", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/tips/'.$tips['item_id']); $this->r['tpl']->assign ("Stattipw", "Stattiptitlew", $tip['naam']); $this->r['tpl']->assign ("Stattipw", "Stattipviewsw", $tips['views']); $this->r['tpl']->Parse ("Statistieken", "Stattipw"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStattipw"); }
$weekgadget = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'gadgets' AND `item_id` != 0 AND WEEK( datum ) = WEEK( current_DATE ) AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($weekgadget)) { while ($gadgets = $this->r['sql']->fetch ($weekgadget)) { $gadgetsql = $this->r['sql']->query (" SELECT `titel` FROM `gadgets` WHERE `pid` = '".$tips['item_id']."'"); $gadget = $this->r['sql']->fetch ($gadgetsql); $this->r['tpl']->assign ("Statgadgetw", "Statgadgeturlw", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/gadgets/'.$gadgets['item_id']); $this->r['tpl']->assign ("Statgadgetw", "Statgadgettitlew", $gadget['naam']); $this->r['tpl']->assign ("Statgadgetw", "Statgadgetviewsw", $gadgets['views']); $this->r['tpl']->Parse ("Statistieken", "Statgadgetw"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatgadgetw"); } //////////
///////// all visits $allvisits = $this->r['sql']->query (" SELECT DISTINCT `user_id` , HOUR( datum ) , `ip` FROM bekeken WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $allvisits_rows = $this->r['sql']->rows ($allvisits); $allvisits_un = $this->r['sql']->query (" SELECT DISTINCT `user_id` , DAY( datum ) , `ip` FROM bekeken WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $allvisits_un_rows = $this->r['sql']->rows ($allvisits_un); $allvisits_friends = $this->r['sql']->query (" SELECT DISTINCT `user_id` , HOUR( datum ) , `ip` FROM bekeken JOIN vrienden ON ( vrienden.profile_id = bekeken.user_id AND vrienden.uid = bekeken.visited_id ) WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND wederzijds =1"); $allvisits_friends_rows = $this->r['sql']->rows ($allvisits_friends); $allvisits_friends_un = $this->r['sql']->query (" SELECT DISTINCT `user_id` FROM bekeken JOIN vrienden ON ( vrienden.profile_id = bekeken.user_id AND vrienden.uid = bekeken.visited_id ) WHERE `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND wederzijds =1"); $allvisits_friends_rows_un = $this->r['sql']->rows ($allvisits_friends_un); $allgoogle = $this->r['sql']->query (" SELECT * FROM `bekeken` WHERE `referer` LIKE '%http://www.google.nl/%' AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); $allgoogle_rows = $this->r['sql']->rows ($allgoogle); $allref = $this->r['sql']->query (" SELECT DISTINCT `referer` FROM `bekeken` WHERE `referer` LIKE '%http://www.cmyid.nl/index/members/profile/%' AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."'"); if ($this->r['sql']->rows ($allref)) { while ($refs = $this->r['sql']->fetch ($allref)) { $strip = str_replace('http://www.cmyid.nl/index/members/profile/', '', $refs['referer']); $split = split('[/]', $strip); $id = $split[0]; $array[] = $id; } $result = array_unique($array); foreach($result as $item) { $profilesql = $this->r['sql']->query (" SELECT `gebruikersnaam` FROM `profielen` WHERE `pid` = '".$item."'"); $profile = $this->r['sql']->fetch ($profilesql); $this->r['tpl']->assign ("Statfrienda", "Statfrienda", $profile['gebruikersnaam']); $this->r['tpl']->assign ("Statfrienda", "Statfriendurla", 'http://www.cmyid.nl/index/members/profile/'.$item); $this->r['tpl']->Parse ("Statistieken", "Statfrienda"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatfrienda"); } $allimg = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'afbeeldingen' AND `item_id` !=0 AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($allimg)) { while ($imgs = $this->r['sql']->fetch ($allimg)) { $imgsql = $this->r['sql']->query (" SELECT `titel`, `profile_id`, `naam` FROM `afbeeldingen` WHERE `pid` = '".$imgs['item_id']."'"); $images = $this->r['sql']->fetch ($imgsql); $this->r['tpl']->assign ("Statimga", "Statimgurla", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/afbeeldingen/'.$imgs['item_id']); $this->r['tpl']->assign ("Statimga", "Statimgsourcea", 'http://www.cmyid.nl/upload/afbeeldingen/'.$images['profile_id'].'/'.$images['naam']); $this->r['tpl']->assign ("Statimga", "Statimgviewsa", $imgs['views']); $this->r['tpl']->Parse ("Statistieken", "Statimga"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatimga"); } $allblog = $this->r['sql']->query (" SELECT pid, titel, bekeken FROM `blog` WHERE `profile_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' AND bekeken > 0 "); if ($this->r['sql']->rows ($allblog)) { while ($blogs = $this->r['sql']->fetch ($allblog)) { $this->r['tpl']->assign ("Statbloga", "Statblogurla", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/blog/'.$blogs['pid']); $this->r['tpl']->assign ("Statbloga", "Statblogtitlea", $blogs['titel']); $this->r['tpl']->assign ("Statbloga", "Statblogviewsa", $blogs['bekeken']); $this->r['tpl']->Parse ("Statistieken", "Statbloga"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatbloga"); } $allpoll = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'polls' AND `item_id` != 0 AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($allpoll)) { while ($polls = $this->r['sql']->fetch ($allpoll)) { $pollsql = $this->r['sql']->query (" SELECT `vraag` FROM `polls` WHERE `pid` = '".$polls['item_id']."'"); $poll = $this->r['sql']->fetch ($pollsql); $this->r['tpl']->assign ("Statpolla", "Statpollurla", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/polls/'.$polls['item_id']); $this->r['tpl']->assign ("Statpolla", "Statpolltitlea", $poll['vraag']); $this->r['tpl']->assign ("Statpolla", "Statpollviewsa", $polls['views']); $this->r['tpl']->Parse ("Statistieken", "Statpolla"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatpolla"); } $allspot = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'spots' AND `item_id` != 0 AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($allspot)) { while ($spots = $this->r['sql']->fetch ($allspot)) { $spotsql = $this->r['sql']->query (" SELECT `naam` FROM `spots` WHERE `pid` = '".$spots['item_id']."'"); $spot = $this->r['sql']->fetch ($spotsql); $this->r['tpl']->assign ("Statspota", "Statspoturla", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/spots/'.$spots['item_id']); $this->r['tpl']->assign ("Statspota", "Statspottitlea", $spot['naam']); $this->r['tpl']->assign ("Statspota", "Statspotviewsa", $spots['views']); $this->r['tpl']->Parse ("Statistieken", "Statspota"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatspota"); }
$alltip = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'tips' AND `item_id` != 0 AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($alltip)) { while ($tips = $this->r['sql']->fetch ($alltip)) { $tipsql = $this->r['sql']->query (" SELECT `naam` FROM `tips` WHERE `pid` = '".$tips['item_id']."'"); $tip = $this->r['sql']->fetch ($spotsql); $this->r['tpl']->assign ("Stattipa", "Stattipurla", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/tips/'.$tips['item_id']); $this->r['tpl']->assign ("Stattipa", "Stattiptitlea", $tip['naam']); $this->r['tpl']->assign ("Stattipa", "Stattipviewsa", $tips['views']); $this->r['tpl']->Parse ("Statistieken", "Stattipa"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStattipa"); }
$allgadget = $this->r['sql']->query (" SELECT item_id, COUNT(item_id) AS views FROM `bekeken` WHERE `pagina` = 'gadgets' AND `item_id` != 0 AND `visited_id` = '".mysql_real_escape_string ($this->r['user']['pid'])."' GROUP BY item_id"); if ($this->r['sql']->rows ($allgadget)) { while ($gadgets = $this->r['sql']->fetch ($allgadget)) { $gadgetsql = $this->r['sql']->query (" SELECT `titel` FROM `gadgets` WHERE `pid` = '".$tips['item_id']."'"); $gadget = $this->r['sql']->fetch ($gadgetsql); $this->r['tpl']->assign ("Statgadgeta", "Statgadgeturla", 'http://www.cmyid.nl/index/members/profile/'.mysql_real_escape_string ($this->r['user']['pid']).'/gadgets/'.$gadgets['item_id']); $this->r['tpl']->assign ("Statgadgeta", "Statgadgettitlea", $gadget['naam']); $this->r['tpl']->assign ("Statgadgeta", "Statgadgetviewsa", $gadgets['views']); $this->r['tpl']->Parse ("Statistieken", "Statgadgeta"); } } else { $this->r['tpl']->Parse ("Statistieken", "noStatgadgeta"); } ////////// $this->r['tpl']->assign ("Statistieken", "sGebruikersnaam", $this->r['functions']->strip ($this->r['user']['voornaam'])); $this->r['tpl']->assign ("Statistieken", "Monthvisits", $monthvisits_rows); $this->r['tpl']->assign ("Statistieken", "Monthunique", $monthvisits_un_rows); $this->r['tpl']->assign ("Statistieken", "Monthfriendvisits", $monthvisits_friends_rows); $this->r['tpl']->assign ("Statistieken", "Monthfrienduniques", $monthvisits_friends_rows_un); $this->r['tpl']->assign ("Statistieken", "Monthgoogle", $monthgoogle_rows); $this->r['tpl']->assign ("Statistieken", "Weekvisits", $weekvisits_rows); $this->r['tpl']->assign ("Statistieken", "Weekunique", $weekvisits_un_rows); $this->r['tpl']->assign ("Statistieken", "Weekfriendvisits", $weekvisits_friends_rows); $this->r['tpl']->assign ("Statistieken", "Weekfrienduniques", $weekvisits_friends_rows_un); $this->r['tpl']->assign ("Statistieken", "Weekgoogle", $weekgoogle_rows); $this->r['tpl']->assign ("Statistieken", "Allvisits", $allvisits_rows); $this->r['tpl']->assign ("Statistieken", "Allunique", $allvisits_un_rows); $this->r['tpl']->assign ("Statistieken", "Allfriendvisits", $allvisits_friends_rows); $this->r['tpl']->assign ("Statistieken", "Allfrienduniques", $allvisits_friends_rows_un); $this->r['tpl']->assign ("Statistieken", "Allgoogle", $allgoogle_rows); $this->r['tpl']->Parse ("index", "Statistieken", "content"); } } else $this->r['functions']->redirect ('Fout', 'Je kunt geen statistieken bekijken als je niet bent ingelogd.', 'members/login', 3); } } ?>
|