wat function or declaration.

Started on the old forum in November 2009 · view the original in the archive · old links redirect here

9 replies · 418 views · started 17 years ago · 1 min read

3 participants
icedroplet1987 Senior · 258 posts #1

wat function or declaration sud i add in this to also show topic poster name with the topic. // it is the code.

///////////pinned topics
      $topics = mysql_query("SELECT id, name, closed, views, pollid FROM ibwf_topics WHERE fid='".$fid."' AND pinned='1' ORDER BY lastpost DESC, name, id LIMIT 0,5");
      while($topic = mysql_fetch_array($topics))
    {
      //$iml = "<img src=\"http://coding-talk.com/images/normal.gif\" alt=\"*\"/>";
      $iml = "*";
      $atxt ="";
      if($topic[2]=='1')
      {
        //closed
        $atxt = "(X)";
      }
      if($topic[4]>0)
      {
        $pltx = "(P)";
      }else{
        $pltx = "";
      }
      $tnm = htmlspecialchars($topic[1]);
      $nop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE tid='".$topic[0]."'"));
      echo "<a href=\"index.php?action=viewtpc&sid=$sid&tid=$topic[0]\">[COLOR="Red"](i need to add it here)[/COLOR]$pltx$tnm($nop[0])$atxt</a><br/>";

    }
    echo "<br/>";
	echo "<br/>";
  }

but nt getting the function to declair it.

kiLLeR-eyEd_14 Senior · 382 posts #2

Add authorid in the array..

$topics = mysql_query("SELECT id, name, closed, views, pollid, authorid FROM ibwf_topics WHERE fid='".$fid."' AND pinned='1' ORDER BY lastpost DESC, name, id LIMIT 0,5");

and this is what you want:

echo "<a href=\"index.php?action=viewtpc&sid=$sid&tid=$topic[0]\">".getnick_uid($topic[5]).": $pltx$tnm($nop[0])$atxt</a><br/>";
Mysterio Lead · 630 posts #3

I was happy i had an answer, but killer_eyed-14 answered before me! No luck!

mysterio.al - programming is a functional art

icedroplet1987 Senior · 258 posts #6

something wron in it. it is done wat i said. but the hell, it is showing unlimited same topics which page didnt got fully load even on broadband. // showing 1 topic many many many times. when i did this.

icedroplet1987 Senior · 258 posts #7

it worked sucessfully for pinned topics. but nt working in normals.

icedroplet1987 Senior · 258 posts #10

its nt done.. name not coming with normal topics. obly done for pinned.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close