Register

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
    Posts
    284
    Member #
    3532
    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=\"http://forum.ev.net/index.php?showtopic=".$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=\"http://forum.ev.net/index.php?showtopic=".$topic_id."&view=findpost&p= ".$row2["pid"]."\"> Read More</a></b><p><hr color=\"#000000\" size=\"1\">";
    echo $text;
    }
    mysql_close();
    ?>
    ************************************************** ********************************

    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= 'http://forum.ev.ne.... 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...

  2.  

  3. #2
    Member Seraph's Avatar
    Join Date
    Sep 2003
    Posts
    81
    Member #
    3090
    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

    $text=preg_replace("/<img(.*)>/i","",$text);

    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: PurevB.com