pninc/functions.inc.php
|
Neu in Zeile 1096-1109
if ($pnconfig[relatedlinks] == "YES") {
for ($i = 0; $i < count($pn_config[rltargets]); $i++) {
$targets .= '<option value="'.$pn_config[rltargets][$i].'">'.$pn_config[rltargets][$i].'</option>';
}
$relatedlinks = '<table border="0" cellpadding="3" cellspacing="0" width="100%"><tr><td><b>'.L_NEWS_RL_TITLE.'</b></td><td><b>'.L_NEWS_RL_URL.'</b></td><td><b>'.L_NEWS_RL_TARGET.'</b></td></tr>';
/* List forms for related links */
for ($i = 0; $i < $pnconfig[relatedlinks_num]; $i++) {
$relatedlinks .= '<tr><td><input name="pndata[rl_title][]" size="25" maxlength="50"></td><td><input name="pndata[rl_url][]" size="25" maxlength="250"></td><td><select name="pndata[rl_target][] size="1">';
$relatedlinks .= $targets;
$relatedlinks .= '</select></td></tr>';
}
$relatedlinks .= '</table>';
}
$sendnewsform = preg_replace("!{RELATEDLINKS}!", $relatedlinks, $sendnewsform);
Überarbeitete Funktion ab Zeile 322
// User sendnews
function sendnews () {
global $pn_config, $pnconfig, $pnuser, $pn_handler;
$template = new pn_template;
if ($pnconfig[sendnews] == "YES") {
// Check if categories are enabled and generate selectbox
if ($pnconfig[categories] == "YES") {
$catresult = mysql_query("SELECT * FROM $pn_config[cattable] WHERE status = 'Activated'", $pn_handler);
$catnum = mysql_num_rows($catresult);
if ($catnum > 0) {
$catselect = "<select name=\"pndata[catid]\" size=\"1\">\n";
$catselect .= "<option value=\"\">".L_NEWS_CHOOSECAT."</option>\n";
while ($catrow = mysql_fetch_array($catresult)) {
$catselect .= "<option value=\"$catrow[id]\">".stripslashes($catrow[name])."</option>\n";
}
$catselect .= "</select>";
} else {
$catselect = L_NEWS_NOCATS;
}
} else {
$catselect = L_NEWS_CATSDEACTIVATED;
}
// Prepare title, text and related links
$title = addslashes($_POST[pndata][title]);
$text = addslashes($_POST[pndata][text]);
$moretext = addslashes($_POST[pndata][moretext]);
$catid = $_POST[pndata][catid];
for ($i = 0; $i < count($_POST[pndata][rl_title]); $i++) {
if (trim($_POST[pndata][rl_title][$i]) AND trim($_POST[pndata][rl_url][$i])) {
$relatedlinks .= $_POST[pndata][rl_title][$i]."!@!@!".$_POST[pndata][rl_url][$i]."!@!@!".$_POST[pndata][rl_target][$i]."\n";
}
}
// Check who can send news
if ($pnconfig[newssending] == "Registered" AND $pnuser[loggedin] == "NO") {
$template->message(L_NEWS_CANNOTSENDNEWS, $pn_config[userfile]."?page=login");
} else {
if ($_GET[pndata][send] == "YES") {
if (!trim($title) OR !trim($text) OR ($pnconfig[categories] == "YES" AND !$catid)) {
$template->message(L_ALL_FILLALL, "javascript:history.back()");
} else {
$now = time();
mysql_query("INSERT INTO $pn_config[newstable] (userid, time, catid, title, text, moretext, status, relatedlinks) VALUES('$pnuser[id]', '$now', '$catid', '$title', '$text', '$moretext', 'Unchecked', '$relatedlinks')", $pn_handler);
$template->message(L_NEWS_NEWSSENTIN, $pn_config[newsfile]);
}
} else {
if ($pnuser[loggedin] == "YES") {
$user = "<a href=\"mailto:$pnuser[email]\">$pnuser[nickname]</a>";
} else {
$user = "Gast";
}
$template->sendnewsform($user, $catselect);
}
}
} else {
$template->message(L_NEWS_NONEWSSENDIN, $pn_config[newsfile]);
}
}
Neu in Zeile 1114 und Veränderung in Zeile 1115
global $pn_config;
?><p align="center" class="copyright"><font size="1">PowerNews <?PHP echo $pn_config[version]; ?> © Copyright 2003 by <a href="http://www.powerscripts.org" target="_blank">PowerScripts</a></font></p><?PHP
Veränderung in Zeile 572
mysql_query("UPDATE $pn_config[usertable] SET nickname = '".$_POST[pndata][nickname]."', email = '".$_POST[pndata][email]."', password = '$password', showemail = '".$_POST[pndata][showemail]."', realname = '".$_POST[pndata][realname]."', city = '".$_POST[pndata][city]."', age = '".$_POST[pndata][age]."', homepage = '".$_POST[pndata][homepage]."', icq = '".$_POST[pndata][icq]."' WHERE id = '$pnuser[id]'", $pn_handler);
Neu in Zeile 1017-1021
$profileform = preg_replace("!{REALNAME}!", "$pnuser[realname]", $profileform);
$profileform = preg_replace("!{CITY}!", "$pnuser[city]", $profileform);
$profileform = preg_replace("!{AGE}!", "$pnuser[age]", $profileform);
$profileform = preg_replace("!{HOMEPAGE}!", "$pnuser[homepage]", $profileform);
$profileform = preg_replace("!{ICQ}!", "$pnuser[icq]", $profileform);
Veränderung in Zeile 226
$template->message(L_NEWS_COMMENTPOSTED, $pn_config[detailfile]."?newsid=$newsid&showcomments=YES");
|
pnadmin/functions.inc.php
|
Veränderung in Zeile 1395
<textarea name="commenttext[]" cols="60" rows="5"><?PHP echo stripslashes($row[text]); ?></textarea>
Veränderung in Zeile 1426
function checkcomment ($commentid, $commenttext) {
Veränderung in Zeile 1431
$num = mysql_num_rows(mysql_query("SELECT id FROM ".$pn_config[commenttable]." WHERE id = '".$commentid[$i]."'", $pn_handler));
Veränderung in Zeile 1434
} elseif (!trim($commenttext[$i])) {
Neu in Zeile 1363-1365
$commentid = array();
$commentdelete = array();
$commenttext = array();
Veränderung in Zeile 1358
$result = mysql_query("SELECT * FROM ".$pn_config[commenttable]." WHERE newsid = '".$newsid."' ORDER BY id DESC", $pn_handler);
Veränderung in Zeile 1373
<input type="checkbox" name="commentdelete[]" value="<PHP echo $row[id]; ?>">
Überarbeitete Funktion in Zeile 1447-1463
// Edit comment
function editcomment ($commentid, $commenttext, $commentdelete) {
global $pn_config, $pn_handler;
for ($i = 0; $i < count($commentid); $i++) {
$commenttext[$i] = addslashes($commenttext[$i]);
mysql_query("UPDATE ".$pn_config[commenttable]." SET text = '".$commenttext[$i]."' WHERE id = '".$commentid[$i]."'") OR $error = L_NEWS_COMMENTEDITERROR;
for ($i2 = 0; $i2 < count($commentdelete); $i2++) {
if ($commentdelete[$i2] == $commentid[$i]) {
mysql_query("DELETE FROM ".$pn_config[commenttable]." WHERE id = '".$commentid[$i]."'", $pn_handler) OR $error = L_NEWS_COMMENTEDITERROR;
}
}
}
// Return error
return $error;
}
|