Initial commit
This commit is contained in:
150
suche_change.php
Normal file
150
suche_change.php
Normal file
@ -0,0 +1,150 @@
|
||||
<?php
|
||||
/*
|
||||
# Fuer debugging
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
#echo __LINE__."<br>";
|
||||
*/
|
||||
#error_reporting(E_ALL);
|
||||
#ini_set('display_errors', 1);
|
||||
|
||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
|
||||
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";
|
||||
|
||||
#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,'a_suche','RE')){require("lib/rechte.php");exit;}
|
||||
// Rechteüberprüfung ende
|
||||
|
||||
if(isset($_GET['action'])){
|
||||
$action = $_GET['action'];
|
||||
}else{
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if($action == ''){
|
||||
$id = $_GET['id'];
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
$db = dbconnect();
|
||||
$result = $db->query("SELECT sql_change
|
||||
FROM changelog
|
||||
WHERE id='$id'");
|
||||
$row = $result->fetch_array();
|
||||
$query = "$row[0]";
|
||||
|
||||
$result = $db->query( $query )
|
||||
or die ("Cannot execute query");
|
||||
$menge = $result->num_rows;
|
||||
|
||||
$ln_zaehler = 0;
|
||||
|
||||
#$abfrage = "SELECT id FROM links"
|
||||
|
||||
|
||||
|
||||
$smarty->assign('anzahltreffer', "$menge");
|
||||
|
||||
while ($row = $result->fetch_array()){
|
||||
|
||||
|
||||
if($inhalt == ''){
|
||||
##$preview = substr(strip_tags($row[inhalt]),0,200)." <b>...</b> ";
|
||||
$preview = kurzer_text(strip_tags($row['inhalt']),200);
|
||||
|
||||
}else{
|
||||
#$preview = preview(strip_tags($row[inhalt]),trim($_POST[inhalt]));
|
||||
##$preview = substr(strip_tags($row[inhalt]),0,200)." <b>...</b> ";
|
||||
$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;
|
||||
}
|
||||
|
||||
$inhalt_hig = urlencode(serialize($_POST['inhalt']));
|
||||
$row['suchart'] = $suchart;
|
||||
$row['inhalt_hig'] = $inhalt_hig;
|
||||
$row['kategorie'] = $row1['bezeichnung'];
|
||||
$row['unterkategorie'] = $row2['bezeichnung'];
|
||||
$row['preview'] = $preview;
|
||||
$row['wochentag'] = $wochentag;
|
||||
$value3[] = $row;
|
||||
}
|
||||
$smarty->assign('table_data3', $value3);
|
||||
|
||||
|
||||
} // Ende $action = suche
|
||||
|
||||
$smarty->assign('action', "$action");
|
||||
$smarty->display("$template/$templatename");
|
||||
?>
|
Reference in New Issue
Block a user