Author Topic: getting "quotes" from forum needs improving...  (Read 157 times)

0 Members and 1 Guest are viewing this topic.

Offline runnerjpTopic starter

  • Addict
    • View Profile
getting "quotes" from forum needs improving...
« on: July 03, 2009, 07:07:22 AM »
ok at the moments this is how i get a quote form the forum...


First i click the quote button which stores the post id
Code: [Select]
<form action="index.php?page=reply&forum=<?php echo $forum?>&id=<? echo
$forumpostid ?>" method="post">
        <input name="quote" type="hidden" value="<? echo $gettopic3['postid']; ?>" />
       <input name="submit" type="submit" value="quote" />
</form>


then on the reply page i do this

Code: [Select]
<textarea id="inputforum" class="inputforum" name='yourpost' rows='5' cols='40'><?php echo
$thePost;
 if (isset(
$_POST['quote']))
{
$quote mysql_fetch_assoc(mysql_query("SELECT * from forumtutorial_posts where postid='".$_POST['quote']."'"));

?>
[quote=<?php echo $quote['author'?> ] <?php echo $quote['post']; ?> [/quote] <?php


}?>
</textarea>

so would you guys say this is the best way to do it or could it be improved??

Offline backie

  • Irregular
    • View Profile
Re: getting "quotes" from forum needs improving...
« Reply #1 on: July 03, 2009, 07:17:29 AM »
It could be improved by removing a $_POST var from being in escaped into the mysql statement.

Also you could think about having
Quote from: author-name;postid
which would link back to the post where the quote has been taken from.


Offline runnerjpTopic starter

  • Addict
    • View Profile
Re: getting "quotes" from forum needs improving...
« Reply #2 on: July 03, 2009, 07:21:50 AM »
dont get last part lol

Offline backie

  • Irregular
    • View Profile
Re: getting "quotes" from forum needs improving...
« Reply #3 on: July 03, 2009, 07:25:29 AM »
Yea the did forum code in a forum, wasn't thinking there.

Code: [Select]
[quote=author;postid]

Which would link back to the orginal post, or just have it quote=postid and have the backend retrive the author's name each time.

Offline runnerjpTopic starter

  • Addict
    • View Profile
Re: getting "quotes" from forum needs improving...
« Reply #4 on: July 04, 2009, 05:23:38 AM »
ok so just add the id into a link

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.