Nieuws script PHP HELP!

Status
Niet open voor verdere reacties.

RobW41

Gebruiker
Lid geworden
6 aug 2003
Berichten
128
Hallo allemaal,

Ik heb op mijn website een mooie goedwerkende newsscript draaien de PHPNews maar ik zou hem wel willen uitbreiden. als er nu iemand een nieuwsitem plaatst en iemand anders plaatst daarop een commentaar dan moet de persoon die het nieuws geplaatst heeft elke keer kijken op de website of iemand commentaar heeft geplaatst. is er niet iets wat ik aan mijn script kan koppelen die ervoor zorgt dat de persoon die het nieuws heeft geplaatst een e-mail krijgt wanneer iemand commentaar heeft geplaatst op zijn nieuwsitem?

of als je een beter script weet die dat wel heeft is het het mooist als het ook nederlands is.
 
tuurlijk kan dat...
ik ben niet bekend met PHPNews, maar wel met PHP :)
ik hoop dat je wat php-kennis hebt, want wat je moet doen is naar het bestand gaan waar wanneer mensen een reply hebben gepost, deze informatie wordt verwerkt...
bij deze pagina moet je zoeken naar het punt dat wanneer alle informatie goed verwerkt is....op dat punt moet je een commando toevoegen:
PHP:
<?
mail($emailadresvannieuwsposter,$onderwerp,"Er is op je nieuwsbericht gereageerd");
?>
$emailadresvannieuwsposter kun je ophalen uit de database waar de nieuwsposter geregistreerd staat (als dat geregistreerd wordt)...

succes :)
 
wow ik heb niet zo veel kaas gegeten van PHP ik zal het scxript effe posten. ik hoop dat je me kan helpen en ja ze moeten zich registreren

hieronder vindt je het gehele script in zip.
 
ik denk dat de bijlage te groot is zal ik hem naar je emailadres sturen? als je te minste wilt helpen:)
 
Jpeetje hieronder is de code van het script ik denk dat deze het is waar het geplaatst moet worden maar ik heb weinig kennis van PHP
PHP:
<?php
error_reporting (E_ALL ^ E_NOTICE);
/*********************************************
* ------------                               *
* | News.php |                               *
* ------------                               *
* PHPNews - 1.1.1 Release                    *
* Open Source Project started by Pierce Ward *
*                                            *
* Software Distributed at:                   *
* [url]http://newsphp.sourceforge.net[/url]             *
* ========================================== *
* (c) 2003 Pierce Ward (Big P)               *
* All rights reserved.                       *
* ========================================== *
* This program has been written under the    *
* terms of the GNU General Public Licence as *
* published by the Free Software Foundation. *
*                                            *
* The GNU GPL can be found in gpl.txt        *
*********************************************/

/* Get the absolute path for including files */
$path = __FILE__;
$path = str_replace('news.php', '', $path);

include_once($path . 'settings.php');

/* Don't edit - Connects to DB */
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);

/* Grabs Settings and puts it in an Array */
$result = mysql_query('SELECT variable,value FROM ' . $db_prefix . 'settings');
$dbQueries++;

$Settings = array();
while ($row = mysql_fetch_array($result))
{
    $Settings[$row['0']] = $row['1'];
}

$lang = $Settings['language'];

/* Opens language file */
if(!file_exists($path . 'languages/' . $lang . '.lng'))
{
    include_once($path . 'languages/en_GB.lng');
}
else
{
    include_once($path . 'languages/' . $lang . '.lng');
}
$language = $lng;

if(!isset($_GET['action']))
{
    news();
}
else if($_GET['action'] == 'fullnews')
{
    fullNews();
}
else if($_GET['action'] == 'post')
{
    post();
}
else if($_GET['action'] == 'showcat' && isset($_GET['catid']))
{
    showCat();
}

function news()
{
  global $Settings, $language, $path, $db_prefix;

/* Prints JavaScript for Send to Friend Link */
if ($Settings['enablestf'] == 1)
{
?>
<script type="text/javascript">
<!--
        function sendtof(desktopURL)
        {
          desktop = window.open(desktopURL, "SendToFriend", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=400,height=275,resizable=no");
        }
// -->
</script>
<?
}
  /* Set up Previous/Next links if enabled */
  if ($Settings['enableprevnext'] == 1)
  {
    /* If we're on the first page set defaults */
    if (!isset($_GET['prevnext']) || $_GET['prevnext'] == 0)
    {
      $_GET['prevnext'] = 0;
      $nextpage = $_GET['prevnext'] + $Settings['numtoshow'];
      $previouspage = $_GET['prevnext'];
      
      /* Find total number of News Posts */
      $numPosts = mysql_query('SELECT count(*) as total FROM ' . $db_prefix . 'news');
      $var = mysql_fetch_assoc($numPosts);

      if ($var['total'] > $Settings['numtoshow'])
      {
        $include = 1;
      }
    }
    /* Otherwise calculate prev/next links */
    else if (isset($_GET['prevnext']) && is_Numeric($_GET['prevnext']))
    {
      $previouspage = $_GET['prevnext'] - $Settings['numtoshow'];

      /* Find total number of News Posts */
      $numPosts = mysql_query('SELECT count(*) as total FROM ' . $db_prefix . 'news');
      $var = mysql_fetch_assoc($numPosts);

      /* If the number of posts is greater, there's enough room for another page */
      if ($var['total'] > ($_GET['prevnext'] + $Settings['numtoshow']))
      {
        $nextpage = $_GET['prevnext'] + $Settings['numtoshow'];
      }
      else
      {
        $nextpage = 0;
      }
      
      /* Include Previous/Next Template */
      $include = 1;
    }
  }
  else
  {
    $_GET['prevnext'] = 0;
  }
  
  
  /* Get information about the News Post */
  $SQL_query = mysql_query('SELECT id,posterid,postername,time,subject,titletext,maintext,catid FROM ' . $db_prefix . 'news ORDER BY id DESC LIMIT ' . $_GET['prevnext'] . ', ' . $Settings['numtoshow'] . '');

  while($news = mysql_fetch_array($SQL_query))
  {
    /* Set Variables */
    $time = strftime($Settings['timeformat'], $news['time']);
    $subject = $news['subject'];
    $titletext = $news['titletext'];

    /* Find out who made the post (keeps track of usernames) */
    $query = mysql_query('SELECT username,email,avatar FROM ' . $db_prefix . 'posters WHERE id = ' . $news['posterid'] . ' OR username = \'' . $news['postername'] . '\'');
    $row = mysql_fetch_array($query);
    $username = $row['username'];

    /* Print Comments if enabled */
    if ($Settings['enablecomments'] == 1)
    {
      $query2 = mysql_query('SELECT count(*) as total FROM ' . $db_prefix . 'comments WHERE mid = ' . $news['id'] . '');
      $var = mysql_fetch_assoc($query2);
      $comments = '<a href="' . $PHP_SELF . '?action=fullnews&amp;showcomments=1&amp;id=' . $news['id'] . '">' . $language['CONTENT_NEWSCOMMENTS'] . ' (' . $var['total'] . ')</a>';
    }

    /* If Categories are enabled... */
    if ($Settings['enablecats'] == 1)
    {
      $cat_query = mysql_query('SELECT * FROM ' . $db_prefix . 'categories WHERE id = ' . $news['catid'] . '');
      $cat = mysql_fetch_array($cat_query);

      if ($news['catid'] != 0)
      {
        if ($cat['catname'] != '')
        {
          $category = '<a href="' . $PHP_SELF . '?action=showcat&amp;catid=' . $cat['id'] . '">' . $cat['catname'] . '</a>';
        }
        
        if ($cat['caticon'] != '')
        {
          $caticon = '<img src="' . $cat['caticon'] . '" border="0" alt="' . $cat['catname'] . '" />';
        }
      }
    }

    if (!$username)
    {
      $username = $news['postername'];
    }

    if ($Settings['enableavatars'] == 1)
    {
      if($row['avatar'] != '')
      {
        $avatar = '<img src="' . $row['avatar'] . '" border="0" alt="' . $username . '\'s avatar" />';
      }
      else
      {
        $avatar = '';
      }
    }

    if ($row['email'] != '')
    {
      $username = '<a href="mailto:' . $row['email'] . '">' . $username . '</a>';
    }
    else
    {
      $username = $username;
    }

    /* Display link to show comments & news if enabled */
    if ($news['maintext'] != '' && $Settings['showcominnews'] == 1 && $Settings['enablecomments'] == 1)
    {
      $maintext = '<a href="' . $PHP_SELF . '?action=fullnews&amp;showcomments=1&amp;id=' . $news['id'] . '">' . $language['CONTENT_NEWSFULLSTORY'] . '</a>';
    }
    else if ($news['maintext'] != '')
    {
      $maintext = '<a href="' . $PHP_SELF . '?action=fullnews&amp;id=' . $news['id'] . '">' . $language['CONTENT_NEWSFULLSTORY'] . '</a>';
    }
    else
    {
      $maintext = '';
    }

    if ($Settings['enablestf'] == 1)
    {
      $sendtofriend = '<a href="javascript:sendtof(\'' . $Settings['phpnewsurl'] . 'sendtofriend.php?mid=' . $news['id'] . '\')">' . $language['CONTENT_NEWSSTFLINK'] . '</a>';
    }
    
    echo '<a name="' , $news['id'] , '"><!--' , $news['id'] , '--></a>' , "\n";
    include($path . 'templates/news_temp.php');
    echo "\n";
    
    /* Clear Variables */
    $category = '';
    $caticon = '';
  }

  /* If previous/next links are enabled, include the template */
  if ($Settings['enableprevnext'] == 1 && $include == 1)
  {
    include($path . 'templates/prevnext_temp.php');
    echo "\n";
  }
}

function fullNews()
{
  global $Settings, $language, $path, $showcomments, $db_prefix;

  $SQL_query = mysql_query('SELECT posterid,postername,time,subject,titletext,maintext,catid FROM ' . $db_prefix . 'news WHERE id = ' . $_GET['id'] . '');

  if (!$_GET['id'])
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_GENERALERROR'];
  }
  else if (!mysql_numrows($SQL_query))
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_NOTEXISTS'];
  }
  else
  {
    /* Prints JavaScript for Send to Friend Link */
    if ($Settings['enablestf'] == 1)
    {
?>
<script type="text/javascript">
<!--
        function sendtof(desktopURL)
        {
          desktop = window.open(desktopURL, "SendToFriend", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=400,height=275,resizable=no");
        }
// -->
</script>
<?
    }

    /* Put News Post Info into an Array */
    $news = mysql_fetch_array($SQL_query);

    /* Set the Variables */
    $time = strftime($Settings['shorttimeformat'], $news['time']);
    $subject = $news['subject'];
    $titletext = $news['titletext'];
    $maintext = $news['maintext'];

    /* Find out who made the post */
    $query = mysql_query('SELECT username,email,avatar FROM ' . $db_prefix . 'posters WHERE id = ' . $news['posterid'] . ' OR username = \'' . $news['postername'] . '\'');
    $row = mysql_fetch_array($query);
    $username = $row['username'];
    $email = $row['email'];

    /* Print Comments if enabled */
    if ($Settings['enablecomments'] == 1)
    {
      $query2 = mysql_query('SELECT count(*) as total FROM ' . $db_prefix . 'comments WHERE mid = ' . $_GET['id'] . '');
      $var = mysql_fetch_assoc($query2);
      $comments = '<a href="' . $PHP_SELF . '?action=fullnews&amp;showcomments=1&amp;id=' . $_GET['id'] . '">' . $language['CONTENT_NEWSCOMMENTS'] . ' (' . $var['total'] . ')</a>';
    }

    /* If Categories are enabled... */
    if ($Settings['enablecats'] == 1)
    {
      $cat_query = mysql_query('SELECT * FROM ' . $db_prefix . 'categories WHERE id = ' . $news['catid'] . '');
      $cat = mysql_fetch_array($cat_query);

      if ($news['catid'] != 0)
      {
        $category = '<a href="' . $PHP_SELF . '?action=showcat&amp;catid=' . $cat['id'] . '">' . $cat['catname'] . '</a>';

        if ($cat['caticon'] != '' && is_array($cat))
        {
          $caticon = '<img src="' . $cat['caticon'] . '" border="0" alt="' . $cat['catname'] . '" />';
        }
        else
        {
          $caticon = '';
        }
      }
    }
    
    if ($Settings['enableavatars'] == '1' && $row['avatar'] != '')
    {
      $avatar = '<img src="' . $row['avatar'] . '" border="0" alt="' . $username . '\'s avatar" />';
    }

    if (!$username)
    {
      $username = $news['postername'];
    }

    if ($email != '')
    {
      $username = '<a href="mailto:' . $email . '">' . $username . '</a>';
    }
    else
    {
      $username = $username;
    }
  
    if ($Settings['enablestf'] == 1)
    {
      $sendtofriend = '<a href="javascript:sendtof(\'' . $Settings['phpnewsurl'] . 'sendtofriend.php?mid=' . $_GET['id'] . '\')">' . $language['CONTENT_NEWSSTFLINK'] . '</a>';
    }

    include($path . 'templates/fullnews_temp.php');
  }
  
  /* Include the Comments */
  if ($_GET['showcomments'] == 1 && $Settings['enablecomments'] ==1)
  {
    comments();
  }
}

function comments()
{
  global $_SERVER, $Settings, $language, $path, $db_prefix;

  /* Check if a News post with this ID exists */
  $exists = mysql_query('SELECT id FROM ' . $db_prefix . 'news WHERE id = \'' . $_GET['id'] . '\'');

  if ($Settings['enablecomments'] != 1)
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_DISABLED'];
  }
  else if (mysql_numrows($exists) == 0)
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_NOTEXISTS'];
  }
  else
  {
    /* Order comments */
    if ($Settings['showoldcomfirst'] != 1)
    {
      $order = ' DESC';
    }

    /* Get the data for all the Comments */
    $com_Query = mysql_query('SELECT time,name,message,email,website FROM ' . $db_prefix . 'comments WHERE mid = ' . $_GET['id'] . ' ORDER by id' . $order . '');

    while ($comment = mysql_fetch_array($com_Query))
    {
      $time = strftime($Settings['shorttimeformat'], $comment['time']);
      $message = $comment['message'];

      if ($comment['website'] != "")
      {
        $link = '[<a href="' . $comment['website'] . '">' . $language['CONTENT_NEWSWEBSITE'] . '</a>]';
      }
      else
      {
        $link = '';
      }

      /* Censor comment if it is enabled */
      if ($Settings['enablecensor'] == 1)
      {
        $comment['name'] = censor($comment['name']);
        $message = censor($message);
      }

      if ($comment['email'] != '')
      {
        $name = '<a href="mailto:' . $comment['email'] . '">' . $comment['name'] . '</a>';
      }
      else
      {
        $name = $comment['name'];
      }

      /* Include Template for Added Comments */
      include($path . 'templates/comments_temp.php');
    }

    /* Check if User is banned from making Comments */
    $isBanned = checkUserIP($_SERVER['REMOTE_ADDR']);

    /* If the person is banned, print warning message */
    if ($isBanned == 1)
    {
      echo '<br /><b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_BANNED'];
    }
    else
    {
      /* Otherwise, print the form and include the template for adding comments */
      echo '
<form action="?action=post" method="post">
<input type="hidden" name="mid" value="' , $_GET['id'] , '" />' , "\n";

      include($path . 'templates/comment_temp.php');

      echo '
</form>' , "\n";
    }
  }
}

function showCat()
{
  global $Settings, $language, $path, $db_prefix;

  /* Display Category News if it's enabled */
  if ($Settings['enablecats'] != 1)
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_DISABLED'];
  }
  else
  {
    /* Prints JavaScript for Send to Friend Link */
    if ($Settings['enablestf'] == 1)
    {
?>
<script type="text/javascript">
<!--
        function sendtof(desktopURL)
        {
          desktop = window.open(desktopURL, "SendToFriend", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=400,height=275,resizable=no");
        }
// -->
</script>
<?
    }
    
    /* Set up Previous/Next links if enabled */
    if ($Settings['enableprevnext'] == 1)
    {
      /* If we're on the first page set defaults */
      if (!isset($_GET['prevnext']) || $_GET['prevnext'] == 0)
      {
        $_GET['prevnext'] = 0;
        $nextpage = $_GET['prevnext'] + $Settings['numtoshowcat'];
        $previouspage = $_GET['prevnext'];
        
        /* Find total number of News Posts */
        $numPosts = mysql_query('SELECT count(*) as total FROM ' . $db_prefix . 'news WHERE catid=' . $_GET['catid'] . '');
        $var = mysql_fetch_assoc($numPosts);
        
        /* Only Include Previous/Next links if there is another page! */
        if ($var['total'] > $Settings['numtoshowcat'])
        {
          $include = 1;
        }
      }
      /* Otherwise calculate prev/next links */
      else if (isset($_GET['prevnext']) && is_Numeric($_GET['prevnext']))
      {
        $previouspage = $_GET['prevnext'] - $Settings['numtoshowcat'];

        /* Find total number of News Posts */
        $numPosts = mysql_query('SELECT count(*) as total FROM ' . $db_prefix . 'news WHERE catid=' . $_GET['catid'] . '');
        $var = mysql_fetch_assoc($numPosts);

        /* If the number of posts is greater, there's enough room for another page */
        if ($var['total'] > ($_GET['prevnext'] + $Settings['numtoshowcat']))
        {
          $nextpage = $_GET['prevnext'] + $Settings['numtoshowcat'];
        }
        else
        {
          $nextpage = 0;
        }
        
        /* Include Previous/Next Template */
        $include = 1;
      }
    }
    else
    {
      $_GET['prevnext'] = 0;
    }

    $SQL_query = mysql_query('SELECT id,posterid,postername,time,subject,titletext,maintext,catid FROM ' . $db_prefix . 'news WHERE catid = ' . $_GET['catid'] . ' ORDER by id DESC LIMIT ' . $_GET['prevnext'] . ', ' . $Settings['numtoshowcat'] . '');

    while($news = mysql_fetch_array($SQL_query))
    {
      /* Set Variables */
      $time = strftime($Settings['timeformat'], $news['time']);
      $subject = $news['subject'];
      $titletext = $news['titletext'];

      /* Find out who made the post (keeps track of usernames) */
      $query = mysql_query('SELECT username,email,avatar FROM ' . $db_prefix . 'posters WHERE id = ' . $news['posterid'] . ' OR username = \'' . $news['postername'] . '\'');
      $row = mysql_fetch_array($query);
      $username = $row['username'];

      /* Print Comments if enabled */
      if ($Settings['enablecomments'] == 1)
      {
        $query2 = mysql_query('SELECT count(*) as total FROM ' . $db_prefix . 'comments WHERE mid = ' . $news['id'] . '');
        $var = mysql_fetch_assoc($query2);
        $comments = '<a href="' . $PHP_SELF . '?action=fullnews&amp;showcomments=1&amp;id=' . $news['id'] . '">' . $language['CONTENT_NEWSCOMMENTS'] . ' (' . $var['total'] . ')</a>';
      }

      $cat_query = mysql_query('SELECT * FROM ' . $db_prefix . 'categories WHERE id = ' . $news['catid'] . '');
      $cat = mysql_fetch_array($cat_query);

      $category = '<a href="' . $PHP_SELF . '?action=showcat&amp;catid=' . $cat['id'] . '">' . $cat['catname'] . '</a>';

      if ($cat['caticon'] != '')
      {
        $caticon = '<img src="' . $cat['caticon'] . '" border="0" alt="' . $cat['catname'] . '" />';
      }
      else
      {
        $caticon = '';
      }
      
      if (!$username)
      {
        $username = $news['postername'];
      }

      if ($Settings['enableavatars'] == 1)
      {
        if($row['avatar'] != '')
        {
          $avatar = '<img src="' . $row['avatar'] . '" border="0" alt="' . $username . '\'s avatar" />';
        }
        else
        {
          $avatar = '';
        }
      }

      if ($row['email'] != '')
      {
        $username = '<a href="mailto:' . $row['email'] . '">' . $username . '</a>';
      }
      else
      {
        $username = $username;
      }

      /* Display link to show comments & news if enabled */
      if ($news['maintext'] != '' && $Settings['showcominnews'] == 1 && $Settings['enablecomments'] == 1)
      {
        $maintext = '<a href="' . $PHP_SELF . '?action=fullnews&amp;showcomments=1&amp;id=' . $news['id'] . '">' . $language['CONTENT_NEWSFULLSTORY'] . '</a>';
      }
      else if ($news['maintext'] != '')
      {
        $maintext = '<a href="' . $PHP_SELF . '?action=fullnews&amp;id=' . $news['id'] . '">' . $language['CONTENT_NEWSFULLSTORY'] . '</a>';
      }
      else
      {
        $maintext = '';
      }

      if ($Settings['enablestf'] == 1)
      {
        $sendtofriend = '<a href="javascript:sendtof(\'' . $Settings['phpnewsurl'] . 'sendtofriend.php?mid=' . $news['id'] . '\')">' . $language['CONTENT_NEWSSTFLINK'] . '</a>';
      }

      include($path . 'templates/news_temp.php');
      echo "\n";
    }

    /* If previous/next links are enabled, include the template */
    if ($Settings['enableprevnext'] == 1 && $include == 1)
    {
      $catid = $_GET['catid'];
      include($path . 'templates/prevnextcat_temp.php');
      echo "\n";
    }
  }
}

function post()
{
  global $_SERVER, $language, $Settings, $db_prefix;

  /* Clean up */
  $_POST['name'] = str_replace(array('&', '"', '<', '>', '|'), array('&amp;', '&quot;', '&lt;', '&gt;', '|'), trim($_POST['name']));
  $_POST['message'] = str_replace(array('&', '"', '<', '>', '|'), array('&amp;', '&quot;', '&lt;', '&gt;', '|'), trim($_POST['message']));

  $_POST['email'] = trim($_POST['email']);
  $_POST['email'] = strip_tags($_POST['email']);

  $_POST['website'] = trim($_POST['website']);
  $_POST['website'] = strip_tags($_POST['website']);

  /* Make sure set amount of time has passed since last post by this person */
  $query = mysql_query('SELECT time FROM ' . $db_prefix . 'comments WHERE ip = \'' . $_SERVER['REMOTE_ADDR'] . '\' ORDER by id DESC LIMIT 1');
  $result = mysql_fetch_array($query);

  /* Make sure there are no problems with the Post */
  if ($Settings['enablecomments'] != 1)
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_DISABLED'];
  }
  else if (!$_POST['mid'])
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_GENERALERROR'];
  }
  else if (time()-$result['time'] < $Settings['floodprotection'])
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_ERRORWAIT'];
  }
  /* Check if it's a valid email */
  else if ($_POST['email'] != '' && !eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$', $_POST['email']))
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_ERROREMAIL'];
  }
  else if (!$_POST['message'])
  {
    echo '<b>' , $language['CONTENT_ERROR'] , '</b>: ' , $language['CONTENT_SENDTOFRIENDMSG'];
  }
  /* Everything is okay! */
  else
  {
    /* Set final defaults */
    if($_POST['website'] == 'http://')
    {
      $_POST['website'] = '';
    }
  
    if (!$_POST['name'])
    {
      $_POST['name'] = 'Guest';
    }
    
    $time = time();
    mysql_query('INSERT INTO ' . $db_prefix . 'comments (ip,mid,time,name,message,email,website) VALUES (\'' . $_SERVER['REMOTE_ADDR'] . '\', \'' . $_POST['mid'] . '\', \'' . $time . '\', \'' . $_POST['name'] . '\', \'' . $_POST['message'] . '\', \'' . $_POST['email'] . '\', \'' . $_POST['website'] . '\')');

    /* Display the comments */
    $_GET['showcomments'] = 1;
    $_GET['id'] = $_POST['mid'];
    fullnews();
  }
}

/* Censors Comments */
function censor($text)
{
  global $Settings;
  static $goodword, $badword;

  /* Checks if good/bad words list has already been done (stored in static variable to increase speed) */
  if (!is_array($goodword))
  {
    $badword = array();
    $goodword = array();

    /* Format the censor list */
    $array = explode('|', $Settings['censorlist']);

    /* Put the list of words in Arrays */
    foreach ($array as $i)
    {
      list($badword[], $goodword[]) = explode('=', $i);
    }
  }

  /* Replace bad words with clean words */
  for($i = 0; $i < count($goodword); $i++)
  {
    $text = preg_replace('/' . preg_quote($badword[$i], '/') . '/i', $goodword[$i], $text);
  }

  /* Return the censored text */
  return $text;
}

/* Checks Banned IPs */
function checkUserIP($ip)
{
  global $db_prefix;
  
  /* Search the 'banned' table for occurences of this IP */
  $query = mysql_query('SELECT * FROM ' . $db_prefix . 'banned WHERE ip = \'' . $ip . '\'');
  $request = mysql_fetch_array($query);
  
  /* If the User is banned, return a 1 */
  if ($request['isbanned'] == 1)
  {
    return 1;
  }
  else
  {
    return 0;
  }
}
?>
 
Laatst bewerkt door een moderator:
Allereerst wil ik je verzoeken de PHP code tussen
PHP:
 tags te zetten. Zo is het natuurlijk geen gezicht..

Ten tweede is het de vraag of je wel de code van een ander zomaar mag aanpassen / uitbreiden?

Op [url]www.hotscripts.com[/url] zijn erg veel scripts en er is vast wel 1 die aan al je eisen voldoet.
 
Hoi breezer het klopt wat jij zegt en deze komt ook bij hotscripts vandaan maar ik kan er nog geen een vinden die een email terug stuurt.
 
www.nucleuscms.org

Is een CMS (Content Management System) met als einddoel een Blogger te creeeren maar aangezien hij perfect werkt als nieuwsscript EN hij de mogelijkheid biedt tot notices van replies op berichten lijkt me dit het ideale script voor je, jongen. Laat je niet afschrikken door het feit dat het niet met de intentie van een nieuwsscript is geschreven want ik heb hem ook naar alle tevredenheid lang gebruikt.

@Breezer: zolang het freeware, open source of onder de (L)GPL License is gepubliceerd is het volstrekt legaal om scripts aan te passen. Sterker nog, je mag het script met 1 teken veranderen en dan publiceren onder je eigen naam, merk, technologie, site noem maar op. Bekende voorbeelden hiervan zijn Invision Board (van Ikonboard afgeleid) en PostNuke (van PHPNuke afgeleid).
 
Hoi PCFixer degene die jij nu noemt heb ik inderdaad uitgeprobeert maar het geheel voor de mensen die het nieuws moeten plaatsen is deze nogal ingewikkeld vandaar dat ik weer tergu was gegaan naar mijn oude script waar ik nu ook al redelijk veel nieuwsitems in heb staan dus het mooiste zou zijn als ik die kon aanpassen.
 
ik kan wel uitleggen waarom niemand je tot nu toe heeft geholpen...
1. Het script is niet van jezelf
2. Je script is 5 pagina's lang :8-0:
verwacht je nou echt dat mensen dan zin krijgen om zo'n script voor 1 zo'n klein detail aan te passen ? :rolleyes:
 
Probeer het stuk code te minimaliseren zodat het wat makkelijker is. Heb nu een beetje het idee dat je de hele code hier paste van dat script. "Hier moet ie ergens zitten" tsjah dat is tegen 1 iemand in New York zeggen "Hij is zwart, normaal postuur, loopt op gympen en heeft een NY-petje op en hij moet hier ergens zitten".

Zo werkt het natuurlijk niet.
 
Klopt dat de code erg langs is maar ik heb zelf weinig kaas gegeten van PHP vandaar de hulp die ik inschakel en ik weet niet tot waar ik de code kan knippen zodat iemand er nog uitkomt. ik zet hem hier nu neer als zip.
 

Bijlagen

En opnieuw...
Geplaatst door JPeetje
1. Het script is niet van jezelf
2. Je script is 5 pagina's lang :8-0:
verwacht je nou echt dat mensen dan zin krijgen om zo'n script voor 1 zo'n klein detail aan te passen ? :rolleyes:
of je het nou in een zip plaatst of niet :confused:...
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan