|
You last visited: Today at 23:51
Advertisement
[Frage] Sapphire flyff News
Discussion on [Frage] Sapphire flyff News within the Flyff Private Server forum part of the Flyff category.
10/21/2014, 21:48
|
#1
|
elite*gold: 0
Join Date: Mar 2013
Posts: 157
Received Thanks: 15
|
[Frage] Sapphire flyff News
Hay,
folgendes ich kann bei mir keine News hinzufügen ... immer wenn ich etwas hinzufügen will kommt : Die Neuigkeit wurde erfolgreich eingetragen.
Aber in die DB wird nichts eingetragen und auf der HP wird auch nichts angezeigt ...
Site_news.php
Code:
<?php include('inc/header.php'); ?>
<h1>Settings - Site: News</h1>
<div class="container">
<?php
odbc_exec($odbc_connect, 'USE [' . $_CONFIG['db_databases']['web'] . ']');
if(isset($_GET['newsletter'])) {
if(isset($_POST['sendRundmail'])) {
if(empty($_POST['rundmail_title']) OR empty($_POST['rundmail_content'])) {
echo '<div class="fail">Bitte alle beiden Felder ausfüllen.</div>';
} elseif (!isset($_POST['rundmail_checkbox'])) {
echo '<div class="fail">Du hast vergessen, den Haken zu setzen.</div>';
} else {
$title = $_POST['rundmail_title'];
$message = $_POST['rundmail_content'];
$mails = odbc_exec($odbc_connect, '
SELECT [email]
FROM [' . $_CONFIG['db_databases']['acc'] . '].[dbo].[ACCOUNT_TBL_DETAIL]
GROUP BY [email]
ORDER BY [email] ASC
');
$id = 1;
while($empfaenger = odbc_fetch_array($mails)) {
$id = $id+1;
mail_Rundmail($empfaenger['email'], $title, nl2br($message));
}
echo '<div class="success">E-Mail erfolgreich an '.$id.' registrierte E-Mails gesendet.</div>';
}
}
echo '
<table width="100%" cellpadding="3" cellspacing="0">
<tr><td><a href="site_news.php" title="Zurück" rel="tooltip">Zurück auf die Newsseite wechseln</a></tr>
<tr><td><h2>Rundmail schreiben</h2></td></tr>
<tr><td width="100%">
<form method="post" action="">
<table id="table" width="100%">
<tr>
<td valign="top" width="5%">Betreff:</td><td id="value" width="95%"><input type="text" name="rundmail_title" style="width:90%;"/></td>
</tr>
<tr>
<td valign="top">Nachricht:</td><td id="value"><textarea name="rundmail_content" style="width:90%; height:500px;"></textarea></td>
</tr>
<tr>
<td valign="top"></td><td id="value"><input style="float:left;" type="checkbox" name="rundmail_checkbox" />Ich möchte diese Rundmail wirklich an alle Nutzer von '.$_CONFIG['allg_svr_name'].' senden.</td>
</tr>
<tr>
<td valign="top"></td><td id="value"><br /><input type="submit" name="sendRundmail" value="Rundmail abschicken" /></td>
</tr>
</table>
</form>
</td></tr>
</table>';
}
else {
echo '
<table><tr><td><a href="site_news.php?newsletter" title="Eine Rundmail verfassen" rel="tooltip">Eine Rundmail an alle User verfassen</a></tr></table>
<h2>News</h2>';
if(isset($_POST['newssbm'])) {
if($_POST['title'] == '' || $_POST['category'] == '' || $_POST['content'] == '') {
echo '<div class="fail">Du musst alle Felder richtig ausfüllen!</div>';
}
else {
odbc_exec($odbc_connect, 'INSERT INTO [web_news](title,text,author,category,datetime,forenlink) VALUES(\''.mssql_escape_string($_POST['title']).'\', \''.mssql_escape_string($_POST['content']).'\', \''.mssql_escape_string($_POST['author']).'\', \''.mssql_escape_string($_POST['category']).'\', \''.date('d.m.Y H:i:s').'\',\''.mssql_escape_string($_POST['forenlink']).'\')');
echo '<div class="success">Die Neuigkeit wurde erfolgreich eingetragen.</div>';
}
} elseif(isset($_POST['savenewssbm'])) {
if($_POST['edit_title'] == '' || $_POST['edit_category'] == '' || $_POST['edit_content'] == '') {
echo '<div class="fail">Du musst alle Felder richtig ausfüllen!</div>';
} else {
odbc_exec($odbc_connect, 'UPDATE [web_news] SET title=\''.mssql_escape_string($_POST['edit_title']).'\', category=\''.mssql_escape_string($_POST['edit_category']).'\', text=\''.mssql_escape_string($_POST['edit_content']).'\', forenlink=\''.mssql_escape_string($_POST['edit_forenlink']).'\' WHERE nid=\''.mssql_escape_string($_POST['edit_nid']).'\'');
echo '<div class="success">Die Neuigkeit wurde erfolgreich geändert!</div>';
}
}
$select = odbc_exec($odbc_connect, 'SELECT * FROM [web_news] ORDER BY datetime DESC');
$categories = odbc_exec($odbc_connect, 'SELECT * FROM [web_newscategories]');
echo '<span id="text"></span>';
echo '<div id="box"></div>';
echo '<table><tr><td><a href="javascript:news_addform();" title="Add" rel="tooltip">Neuigkeiten hinzufügen</a></td><td></td></tr></table>';
echo '<form method="post" id="newsaddform" style="display: none;">
<input type="hidden" name="author" value="'.$_SESSION['user'].'" />
<table id="table">
<tr>
<td id="key">Titel:</td>
<td id="value"><input type="text" name="title" style="width: 200px;" /></td>
</tr>
<tr>
<td id="key">Kategorie:</td>
<td id="value">
<select name="category" style="width: 200px;">';
while($category = odbc_fetch_array($categories)) {
echo '<option value="'.$category['ncatid'].'">'.$category['title'].'</option>';
}
echo '</select>
</td>
</tr>
<tr>
<td id="key">Forenlink:</td>
<td id="value"><input type="text" name="forenlink" style="width: 200px;" /></td>
</tr>
<tr>
<td id="key" style="vertical-align: top;">Text:</td>
<td id="value"><textarea name="content" style="width: 500px; height: 150px;"></textarea></td>
</tr>
<tr>
<td id="key"></td>
<td id="value"><input type="submit" name="newssbm" value="Neuigkeiten veröffentlichen" /></td>
</tr>
</table>
</form><br/>';
echo '<table id="table" width="100%">
<tr>
<td id="key">Kategorie</td>
<td id="key">Titel</td>
<td id="key">Autor</td>
<td id="key">Forum</td>
<td id="key">Datum</td>
<td width="15%"></td>
</tr>';
while($result = odbc_fetch_array($select)) {
$category = odbc_exec($odbc_connect, 'SELECT title FROM [web_newscategories] WHERE ncatid=\''.mssql_escape_string($result['category']).'\'');
$content = preg_replace('(<.*/>)', '', $result['text']);
if(strlen($content) > 30) {
$content = substr($content, 0, 30).'...';
}
if(!empty($result['forenlink'])) {$forum = '<a href="'.$result['forenlink'].'" target="_blank">Link</a>';} else {$forum = '';}
echo '<tr id="nid_'.$result['nid'].'" class="row">
<td id="value">'.odbc_result($category, 'title').'</td>
<td id="value">'.$result['title'].'</td>
<td id="value">'.$result['author'].'</td>
<td id="value">'.$forum.'</td>
<td id="value">'.date('d.m.Y, H:i', strtotime($result['datetime'])).'</td>
<td id="value"><a href="javascript:news_edit('.$result['nid'].');" title="Edit" rel="tooltip"><img src="http://www.elitepvpers.com/forum/images/edit.png"></a> <a href="javascript:news_delete('.$result['nid'].');" title="Delete" rel="tooltip"><img src="http://www.elitepvpers.com/forum/images/delete.png"></a></td>
</tr>';
}
echo '</table><br/><br/>';
?>
<h2>Categories</h2>
<?php
if(isset($_POST['categorysbm'])) {
if($_POST['cattitle'] == '' || $_POST['catimage'] == '') {
echo '<div class="fail">Du musst alle Felder richtig ausfüllen!</div>';
} else {
odbc_exec($odbc_connect, 'INSERT INTO [web_newscategories](title,icon) VALUES(\''.mssql_escape_string($_POST['cattitle']).'\', \''.mssql_escape_string($_POST['catimage']).'\')');
echo '<div class="success">Die Kategorie wurde erfolgreich hinzugefügt!</div>';
}
} elseif(isset($_POST['savecatsbm'])) {
if($_POST['edit_cattitle'] == '' || $_POST['edit_catimage'] == '') {
echo '<div class="fail">Du musst alle Felder richtig ausfüllen!</div>';
} else {
odbc_exec($odbc_connect, 'UPDATE [web_newscategories] SET title=\''.mssql_escape_string($_POST['edit_cattitle']).'\', icon=\''.mssql_escape_string($_POST['edit_catimage']).'\' WHERE ncatid=\''.mssql_escape_string($_POST['edit_catid']).'\'');
echo '<div class="success">Die Kategorie wurde erfolgrich geändert!</div>';
}
}
$select = odbc_exec($odbc_connect, 'SELECT * FROM [web_newscategories]');
echo '<span id="text2"></span>';
echo '<div id="box2"></div>';
echo '<table><tr><td><a href="javascript:category_addform();" title="Add" rel="tooltip">Kategorie hinzufügen</a></td><td></td></tr></table>';
echo '<form method="post" id="categoryaddform" style="display: none;">
<table id="table">
<tr>
<td id="key">Title:</td>
<td id="value"><input type="text" name="cattitle" style="width: 200px;" /></td>
</tr>
<tr>
<td id="key">Image:</td>
<td id="value"><input type="text" name="catimage" style="width: 200px;" /></td>
</tr>
<tr>
<td id="key"></td>
<td id="value"><input type="submit" name="categorysbm" value="Add Category" /></td>
</tr>
</table>
</form><br/>';
echo '<table id="table" style="width: 100%;">
<tr>
<td id="key">Title</td>
<td id="key">Image</td>
<td style="width: 50px;"></td>
</tr>';
while($result = odbc_fetch_array($select)) {
echo '<tr id="catid_'.$result['ncatid'].'" class="row">
<td id="value">'.$result['title'].'</td>
<td id="value"><a href="http://www.elitepvpers.com/images/icons/news/'.$result['icon'].'"><img src="http://www.elitepvpers.com/images/icons/news/'.$result['icon'].'" alt="'.$result['icon'].'"/></a></td>
<td id="value"><a href="javascript:category_edit('.$result['ncatid'].');" title="Edit" rel="tooltip"><img src="http://www.elitepvpers.com/forum/images/edit.png"></a> <a href="javascript:category_delete('.$result['ncatid'].');" title="Delete" rel="tooltip"><img src="http://www.elitepvpers.com/forum/images/delete.png"></a></td>
</tr>';
}
echo '</table>';
}
?>
</div>
<?php include('inc/footer.php'); ?>
|
|
|
10/21/2014, 22:00
|
#2
|
elite*gold: 51
Join Date: Sep 2012
Posts: 1,141
Received Thanks: 575
|
Quote:
Originally Posted by NativeGermany
Hay,
folgendes ich kann bei mir keine News hinzufügen ... immer wenn ich etwas hinzufügen will kommt : Die Neuigkeit wurde erfolgreich eingetragen.
Aber in die DB wird nichts eingetragen und auf der HP wird auch nichts angezeigt ...
Site_news.php
Code:
<?php include('inc/header.php'); ?>
<h1>Settings - Site: News</h1>
<div class="container">
<?php
odbc_exec($odbc_connect, 'USE [' . $_CONFIG['db_databases']['web'] . ']');
if(isset($_GET['newsletter'])) {
if(isset($_POST['sendRundmail'])) {
if(empty($_POST['rundmail_title']) OR empty($_POST['rundmail_content'])) {
echo '<div class="fail">Bitte alle beiden Felder ausfüllen.</div>';
} elseif (!isset($_POST['rundmail_checkbox'])) {
echo '<div class="fail">Du hast vergessen, den Haken zu setzen.</div>';
} else {
$title = $_POST['rundmail_title'];
$message = $_POST['rundmail_content'];
$mails = odbc_exec($odbc_connect, '
SELECT [email]
FROM [' . $_CONFIG['db_databases']['acc'] . '].[dbo].[ACCOUNT_TBL_DETAIL]
GROUP BY [email]
ORDER BY [email] ASC
');
$id = 1;
while($empfaenger = odbc_fetch_array($mails)) {
$id = $id+1;
mail_Rundmail($empfaenger['email'], $title, nl2br($message));
}
echo '<div class="success">E-Mail erfolgreich an '.$id.' registrierte E-Mails gesendet.</div>';
}
}
echo '
<table width="100%" cellpadding="3" cellspacing="0">
<tr><td><a href="site_news.php" title="Zurück" rel="tooltip">Zurück auf die Newsseite wechseln</a></tr>
<tr><td><h2>Rundmail schreiben</h2></td></tr>
<tr><td width="100%">
<form method="post" action="">
<table id="table" width="100%">
<tr>
<td valign="top" width="5%">Betreff:</td><td id="value" width="95%"><input type="text" name="rundmail_title" style="width:90%;"/></td>
</tr>
<tr>
<td valign="top">Nachricht:</td><td id="value"><textarea name="rundmail_content" style="width:90%; height:500px;"></textarea></td>
</tr>
<tr>
<td valign="top"></td><td id="value"><input style="float:left;" type="checkbox" name="rundmail_checkbox" />Ich möchte diese Rundmail wirklich an alle Nutzer von '.$_CONFIG['allg_svr_name'].' senden.</td>
</tr>
<tr>
<td valign="top"></td><td id="value"><br /><input type="submit" name="sendRundmail" value="Rundmail abschicken" /></td>
</tr>
</table>
</form>
</td></tr>
</table>';
}
else {
echo '
<table><tr><td><a href="site_news.php?newsletter" title="Eine Rundmail verfassen" rel="tooltip">Eine Rundmail an alle User verfassen</a></tr></table>
<h2>News</h2>';
if(isset($_POST['newssbm'])) {
if($_POST['title'] == '' || $_POST['category'] == '' || $_POST['content'] == '') {
echo '<div class="fail">Du musst alle Felder richtig ausfüllen!</div>';
}
else {
odbc_exec($odbc_connect, 'INSERT INTO [web_news](title,text,author,category,datetime,forenlink) VALUES(\''.mssql_escape_string($_POST['title']).'\', \''.mssql_escape_string($_POST['content']).'\', \''.mssql_escape_string($_POST['author']).'\', \''.mssql_escape_string($_POST['category']).'\', \''.date('d.m.Y H:i:s').'\',\''.mssql_escape_string($_POST['forenlink']).'\')');
echo '<div class="success">Die Neuigkeit wurde erfolgreich eingetragen.</div>';
}
} elseif(isset($_POST['savenewssbm'])) {
if($_POST['edit_title'] == '' || $_POST['edit_category'] == '' || $_POST['edit_content'] == '') {
echo '<div class="fail">Du musst alle Felder richtig ausfüllen!</div>';
} else {
odbc_exec($odbc_connect, 'UPDATE [web_news] SET title=\''.mssql_escape_string($_POST['edit_title']).'\', category=\''.mssql_escape_string($_POST['edit_category']).'\', text=\''.mssql_escape_string($_POST['edit_content']).'\', forenlink=\''.mssql_escape_string($_POST['edit_forenlink']).'\' WHERE nid=\''.mssql_escape_string($_POST['edit_nid']).'\'');
echo '<div class="success">Die Neuigkeit wurde erfolgreich geändert!</div>';
}
}
$select = odbc_exec($odbc_connect, 'SELECT * FROM [web_news] ORDER BY datetime DESC');
$categories = odbc_exec($odbc_connect, 'SELECT * FROM [web_newscategories]');
echo '<span id="text"></span>';
echo '<div id="box"></div>';
echo '<table><tr><td><a href="javascript:news_addform();" title="Add" rel="tooltip">Neuigkeiten hinzufügen</a></td><td></td></tr></table>';
echo '<form method="post" id="newsaddform" style="display: none;">
<input type="hidden" name="author" value="'.$_SESSION['user'].'" />
<table id="table">
<tr>
<td id="key">Titel:</td>
<td id="value"><input type="text" name="title" style="width: 200px;" /></td>
</tr>
<tr>
<td id="key">Kategorie:</td>
<td id="value">
<select name="category" style="width: 200px;">';
while($category = odbc_fetch_array($categories)) {
echo '<option value="'.$category['ncatid'].'">'.$category['title'].'</option>';
}
echo '</select>
</td>
</tr>
<tr>
<td id="key">Forenlink:</td>
<td id="value"><input type="text" name="forenlink" style="width: 200px;" /></td>
</tr>
<tr>
<td id="key" style="vertical-align: top;">Text:</td>
<td id="value"><textarea name="content" style="width: 500px; height: 150px;"></textarea></td>
</tr>
<tr>
<td id="key"></td>
<td id="value"><input type="submit" name="newssbm" value="Neuigkeiten veröffentlichen" /></td>
</tr>
</table>
</form><br/>';
echo '<table id="table" width="100%">
<tr>
<td id="key">Kategorie</td>
<td id="key">Titel</td>
<td id="key">Autor</td>
<td id="key">Forum</td>
<td id="key">Datum</td>
<td width="15%"></td>
</tr>';
while($result = odbc_fetch_array($select)) {
$category = odbc_exec($odbc_connect, 'SELECT title FROM [web_newscategories] WHERE ncatid=\''.mssql_escape_string($result['category']).'\'');
$content = preg_replace('(<.*/>)', '', $result['text']);
if(strlen($content) > 30) {
$content = substr($content, 0, 30).'...';
}
if(!empty($result['forenlink'])) {$forum = '<a href="'.$result['forenlink'].'" target="_blank">Link</a>';} else {$forum = '';}
echo '<tr id="nid_'.$result['nid'].'" class="row">
<td id="value">'.odbc_result($category, 'title').'</td>
<td id="value">'.$result['title'].'</td>
<td id="value">'.$result['author'].'</td>
<td id="value">'.$forum.'</td>
<td id="value">'.date('d.m.Y, H:i', strtotime($result['datetime'])).'</td>
<td id="value"><a href="javascript:news_edit('.$result['nid'].');" title="Edit" rel="tooltip"><img src="http://www.elitepvpers.com/forum/images/edit.png"></a> <a href="javascript:news_delete('.$result['nid'].');" title="Delete" rel="tooltip"><img src="http://www.elitepvpers.com/forum/images/delete.png"></a></td>
</tr>';
}
echo '</table><br/><br/>';
?>
<h2>Categories</h2>
<?php
if(isset($_POST['categorysbm'])) {
if($_POST['cattitle'] == '' || $_POST['catimage'] == '') {
echo '<div class="fail">Du musst alle Felder richtig ausfüllen!</div>';
} else {
odbc_exec($odbc_connect, 'INSERT INTO [web_newscategories](title,icon) VALUES(\''.mssql_escape_string($_POST['cattitle']).'\', \''.mssql_escape_string($_POST['catimage']).'\')');
echo '<div class="success">Die Kategorie wurde erfolgreich hinzugefügt!</div>';
}
} elseif(isset($_POST['savecatsbm'])) {
if($_POST['edit_cattitle'] == '' || $_POST['edit_catimage'] == '') {
echo '<div class="fail">Du musst alle Felder richtig ausfüllen!</div>';
} else {
odbc_exec($odbc_connect, 'UPDATE [web_newscategories] SET title=\''.mssql_escape_string($_POST['edit_cattitle']).'\', icon=\''.mssql_escape_string($_POST['edit_catimage']).'\' WHERE ncatid=\''.mssql_escape_string($_POST['edit_catid']).'\'');
echo '<div class="success">Die Kategorie wurde erfolgrich geändert!</div>';
}
}
$select = odbc_exec($odbc_connect, 'SELECT * FROM [web_newscategories]');
echo '<span id="text2"></span>';
echo '<div id="box2"></div>';
echo '<table><tr><td><a href="javascript:category_addform();" title="Add" rel="tooltip">Kategorie hinzufügen</a></td><td></td></tr></table>';
echo '<form method="post" id="categoryaddform" style="display: none;">
<table id="table">
<tr>
<td id="key">Title:</td>
<td id="value"><input type="text" name="cattitle" style="width: 200px;" /></td>
</tr>
<tr>
<td id="key">Image:</td>
<td id="value"><input type="text" name="catimage" style="width: 200px;" /></td>
</tr>
<tr>
<td id="key"></td>
<td id="value"><input type="submit" name="categorysbm" value="Add Category" /></td>
</tr>
</table>
</form><br/>';
echo '<table id="table" style="width: 100%;">
<tr>
<td id="key">Title</td>
<td id="key">Image</td>
<td style="width: 50px;"></td>
</tr>';
while($result = odbc_fetch_array($select)) {
echo '<tr id="catid_'.$result['ncatid'].'" class="row">
<td id="value">'.$result['title'].'</td>
<td id="value"><a href="http://www.elitepvpers.com/images/icons/news/'.$result['icon'].'"><img src="http://www.elitepvpers.com/images/icons/news/'.$result['icon'].'" alt="'.$result['icon'].'"/></a></td>
<td id="value"><a href="javascript:category_edit('.$result['ncatid'].');" title="Edit" rel="tooltip"><img src="http://www.elitepvpers.com/forum/images/edit.png"></a> <a href="javascript:category_delete('.$result['ncatid'].');" title="Delete" rel="tooltip"><img src="http://www.elitepvpers.com/forum/images/delete.png"></a></td>
</tr>';
}
echo '</table>';
}
?>
</div>
<?php include('inc/footer.php'); ?>
|
Liegt an dem Datum.
|
|
|
10/21/2014, 22:37
|
#3
|
elite*gold: 0
Join Date: Mar 2013
Posts: 157
Received Thanks: 15
|
Yo danke hat geklappt
|
|
|
10/21/2014, 22:55
|
#4
|
elite*gold: 51
Join Date: Sep 2012
Posts: 1,141
Received Thanks: 575
|
was hast du geändert?
|
|
|
10/22/2014, 13:36
|
#5
|
elite*gold: 0
Join Date: Mar 2013
Posts: 157
Received Thanks: 15
|
ich habe das :
Code:
odbc_exec($odbc_connect, 'INSERT INTO [web_news](title,text,author,category,datetime,forenlink) VALUES(\''.mssql_escape_string($_POST['title']).'\', \''.mssql_escape_string($_POST['content']).'\', \''.mssql_escape_string($_POST['author']).'\', \''.mssql_escape_string($_POST['category']).'\', \''.date('d.m.Y H:i:s').'\',\''.mssql_escape_string($_POST['forenlink']).'\')');
mit dem getauscht bzw geändert:
Code:
odbc_exec($odbc_connect, 'INSERT INTO [web_news](title,text,author,category,datetime,forenlink) VALUES(\''.mssql_escape_string($_POST['title']).'\', \''.mssql_escape_string($_POST['content']).'\', \''.mssql_escape_string($_POST['author']).'\', \''.mssql_escape_string($_POST['category']).'\', GETDATE(),\''.mssql_escape_string($_POST['forenlink']).'\')');
|
|
|
All times are GMT +2. The time now is 23:51.
|
|