Initial commit
This commit is contained in:
130
bes_gd.php
Normal file
130
bes_gd.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
# Fuer debugging
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
#echo __LINE__."<br>";
|
||||
*/
|
||||
|
||||
include_once 'classes/lg-on_Smarty.class.php';
|
||||
$smarty = new lgon_Smarty();
|
||||
require_once("config.inc.php");
|
||||
require_once("func_rollenrechte.php");
|
||||
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
||||
require_once "language/german.inc.php";
|
||||
|
||||
$kid=$_GET['kid'];
|
||||
$ukid=$_GET['ukid'];
|
||||
|
||||
#require("func_highlight.php");
|
||||
|
||||
// Rechteüberprüfung
|
||||
$db = dbconnect();
|
||||
if ($user_admin == ""){ require("index.php"); exit;} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
|
||||
if(!rore($user_admin,'b_%','RE')){require("lib/rechte.php");exit;}
|
||||
// Rechteüberprüfung ende
|
||||
|
||||
|
||||
function kurzer_text($string,$laenge){
|
||||
$origin=strlen($string);
|
||||
$stri_arr=explode(" ",$string);
|
||||
$anzzahl=count($stri_arr);
|
||||
$gekuerzt=0;
|
||||
$string="";
|
||||
while($gekuerzt<$anzzahl){
|
||||
$string_alt=$string;
|
||||
$string=$string." ".$stri_arr[$gekuerzt];
|
||||
$gekuerzt++;
|
||||
if(strlen($string)>$laenge){
|
||||
$gekuerzt=$anzzahl;
|
||||
$string=$string_alt;
|
||||
}
|
||||
}
|
||||
if($laenge<$origin){
|
||||
$string=$string."<nobr> <b>...</b></nobr>";
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
$result = $db->query( "SELECT count(*) anz_treffer
|
||||
FROM quelle
|
||||
WHERE kid=$kid
|
||||
AND ukid=$ukid
|
||||
");
|
||||
$res = $result->fetch_array();
|
||||
|
||||
|
||||
$smarty->assign('anzahltreffer', "$res[anz_treffer]");
|
||||
|
||||
$db = dbconnect();
|
||||
|
||||
$sql1 = "SELECT lid, ueberschrift, textstelle, inhalt, textwort, stapgd, kid, ukid, DATE_Format(datum, '%d') tag, DATE_Format(datum, '%m') monat, DATE_Format(datum, '%Y') jahr, DATE_Format(datum, '%Y%m%d') date_sort
|
||||
FROM quelle
|
||||
WHERE kid=$kid
|
||||
AND ukid=$ukid
|
||||
ORDER BY date_sort desc";
|
||||
$result = $db->query( $sql1)
|
||||
or die ("Cannot execute query");
|
||||
// Ergebnisse lesen und an den Client ausgeben
|
||||
|
||||
$ln_zaehler = 0;
|
||||
while ($row = $result->fetch_array()){
|
||||
|
||||
$preview = kurzer_text(strip_tags($row['inhalt']),200);
|
||||
|
||||
|
||||
|
||||
$wochentag = date("l", mktime(0,0,0,$row['monat'],$row['tag'],$row['jahr']));
|
||||
|
||||
switch($wochentag)
|
||||
{
|
||||
case 'Sunday':
|
||||
$wochentag = "So.";
|
||||
break;
|
||||
case 'Monday':
|
||||
$wochentag = "Mo.";
|
||||
break;
|
||||
case 'Tuesday':
|
||||
$wochentag = "Di.";
|
||||
break;
|
||||
case 'Wednesday':
|
||||
$wochentag = "Mi.";
|
||||
break;
|
||||
case 'Thursday':
|
||||
$wochentag = "Do.";
|
||||
break;
|
||||
case 'Friday':
|
||||
$wochentag = "Fr.";
|
||||
break;
|
||||
case 'Saturday':
|
||||
$wochentag = "Sa.";
|
||||
break;
|
||||
}
|
||||
|
||||
$result1 = $db->query( "SELECT bezeichnung FROM kategorie WHERE kid='$row[kid]'");
|
||||
$row1 = $result1->fetch_array();
|
||||
|
||||
$result2 = $db->query( "SELECT bezeichnung FROM unterkategorie WHERE ukid='$row[ukid]'" );
|
||||
$row2 = $result2->fetch_array();
|
||||
|
||||
|
||||
$ln_zaehler = $ln_zaehler + 1;
|
||||
|
||||
# if($art == 'exact'){ // Übergabe für Highligthing. Wenn exact, dann darf bei Begriff nicht Gottesdienst hervorgehoben werden
|
||||
# $suchart = 0;
|
||||
# }else{
|
||||
# $suchart = 1;
|
||||
# }
|
||||
|
||||
$row['kategorie'] = $row1['bezeichnung'];
|
||||
$row['unterkategorie'] = $row2['bezeichnung'];
|
||||
$row['preview'] = $preview;
|
||||
$row['wochentag'] = $wochentag;
|
||||
$value[] = $row;
|
||||
|
||||
}
|
||||
$smarty->assign('table_data', $value);
|
||||
|
||||
$smarty->display("$template/$templatename");
|
||||
?>
|
Reference in New Issue
Block a user