* User

Welcome, Guest. Please login or register.
Did you miss your activation email?

09 Sep 10, 14:36:45

Login with username, password and session length

Select language:

* Recent Topics



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

* Stats

  • *Total Members: 2451
  • *Latest: teste

  • *Total Posts: 10802
  • *Total Topics: 1633
  • *Online Today: 27
  • *Most Online: 157
(27 Aug 09, 03:54:53)
  • *Users: 0
  • *Guests: 21
  • *Total: 21

Author Topic: Free help to make a link to the subject!  (Read 1036 times)

0 Members and 1 Guest are viewing this topic.

Offline neverhurry

  • Full Member
  • ***
  • Posts: 228
  • Gender: Male
  • PortaMX fan
Free help to make a link to the subject!
« on: 06 Nov 09, 17:56:32 »
Hello there,

i am new to php, i try to draw out the solved topics from the SMF database, but i don't know how to make a link to the topic subject. Here is the code:

Code: [Select]
global $settings, $txt;

$result = mysql_query(" SELECT *
FROM `smf_topics` AS t
INNER JOIN smf_messages AS m ON ( m.id_msg = t.id_first_msg )
LEFT JOIN smf_members AS mem ON ( mem.id_member = m.id_member )
WHERE `is_solved` = '1'
ORDER BY poster_time DESC
LIMIT 4 ");

while($row = mysql_fetch_array($result))
  {
echo '<img src="', $settings['images_url'], '/post/topicsolved.gif', '" />'. $row['subject']. " author: " . $row['real_name'] . " replies: " . $row['num_replies'] . "read: " . $row['num_views'] . " <br /><br />" .$row['body']. "<br /><br /><hr>";
  }

what i want is a link to the $row['subject'], so the when the topic subject is clicked it goes to that topic to the newest message. Can anybody here that is so kind to give me a hand? Many thanks in advance.

PS: i forget another thing which could be nice is to trim the $row['body'] to 128 words. Thanks.