If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member joncom11's Avatar
    Join Date
    Oct 2003
    Member #
    I have a Invision Power Board Forum. I use the following script to show the latest 3 topics on the board:

    ************************************************** ********************************
    $sql = "select * from ibf_topics where forum_id != '14' && forum_id != '13' order by tid desc limit 0, 3 " or die(mysql_error());
    $query = mysql_query($sql);
    while ($row = mysql_fetch_array($query)) {
    $topic_id = $row["tid"];
    $title = $row["title"];

    $sql2 = "select * from ibf_posts where topic_id = '$topic_id' && forum_id != '14' order by pid asc";
    $query2 = mysql_query($sql2);
    $row2 = mysql_fetch_array($query2);

    echo "<b><a href=\"".$topic_id."&view=findpost&p= ".$row2["pid"]."\">".$title."</a></b><br><br>";

    $text = $row2["post"];
    $textnum = strlen($text);
    if ($textnum > 134) {
    $text = substr($text, 0, 134);
    $text .= "...<b><a href=\"".$topic_id."&view=findpost&p= ".$row2["pid"]."\"> Read More</a></b><p><hr color=\"#000000\" size=\"1\">";
    echo $text;
    ************************************************** ********************************

    However, there is a problem.. when someone puts a "smiley face" or something in there topic, I don't want it show up on my news.php page (where this script is located). It shows up as < img src= ' and that isn't really what I want to be shown... is there a way to make the script still show the topics and its content but leave out images, such as smileys and other things?
    Pixel Fuse - Signature webpage, just a spashpage.
    Flash Frogger - Frogger remake, animated/coded in Flash (incomplete/discontinued)
    Daase Art Studio - Homepage of David Daase, a Canadian landscape artist - image gallery/showcase.
    More links if I think of some...


  3. #2
    Member Seraph's Avatar
    Join Date
    Sep 2003
    Member #
    well what you could use is preg_replace function for img tags. I have not learned how to use it compltley but I believe you could do something like this


    Ithink that line will get rid of all img tags

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 03:32 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: