Permalink
Browse files

Handige functie om er voor te zorgen dat de data ook daadwerkelijk aa…

…nwezig is op het systeem.
  • Loading branch information...
1 parent 4e04434 commit 3f2be59a6bd40e1ef9f6b1dc38a4753e46cd0569 root committed Oct 17, 2011
Showing with 42 additions and 0 deletions.
  1. +42 −0 checkfoto.php
View
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
+ <head>
+ <title><?php echo OWNER; ?></title>
+ <link rel="stylesheet" href="toevoegen.css" type="text/css" />
+ </head>
+ <body>
+ <h1>Ontbrekende foto's (Linker kant)</h1>
+<?php
+
+ require_once('functions.php');
+ $dbh = new PDO(DATABASE, DB_USER, DB_PASSWORD);
+ $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ $stmt = $dbh->prepare('select distinct photo from content_category_image;');
+ $stmt->execute();
+ $result = $stmt->fetchAll();
+
+ foreach ($result as $entry) {
+ if (!file_exists(USER_IMAGEDIR.'/'.$entry['photo'])) {
+ echo $entry['photo'].'<br />';
+ }
+ }
+
+?>
+ <h1>Ontbrekende foto's bij artikelen</h1>
+<?php
+ $stmt = $dbh->prepare('select distinct photo from content_text where photo <> \'\';');
+ $stmt->execute();
+ $result = $stmt->fetchAll();
+
+ foreach ($result as $entry) {
+ if (!file_exists(USER_IMAGEDIR.'/'.$entry['photo'])) {
+ echo $entry['photo'].'<br />';
+ }
+ }
+
+?>
+
+ </body>
+</html>

0 comments on commit 3f2be59

Please sign in to comment.