Dont lought

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

3 replies · 365 views · started 17 years ago · 1 min read

3 participants
Ponick Developer · 216 posts #1

Im gonna make shout comment system . Like waplive lyrics c0mment . I tryed it with waplive article comment cod . Every things is ok but problem is that when some one comment in any users shout thats comment also showed in all users shout ! 🙁

some one please help me .

/* I don't know everything hehe */

Find me on facebook

djdevil89 Senior · 287 posts #2

show some code here and i will have a look 😉

foreach ($_SERVER as $server => $value)
{
echo "$server is $value<br />";
}
Ponick Developer · 216 posts #3

drwap wrote: show some code here and i will have a look ;)

this is in index

echo getshoutbox($sid);

  echo "<br/><input name=\"shtxt\" maxlength=\"420\"/><br/>";

  echo "<anchor>Update";

  echo "<go href=\"genproc.php?action=shout&sid=$sid&artid=$artid\" method=\"post\">

  <postfield name=\"shtxt\" value=\"$(shtxt)\"/></go>";

  echo "</anchor><br/>";

  
    $who = $_GET["who"];

    //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;

    if($who=="")

    {

    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts"));

    }else{

    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'"));

    }

    $num_items = $noi[0]; //changable

    $items_per_page= 5;

    $num_pages = ceil($num_items/$items_per_page);

    if(($page>$num_pages)&&$page!=1)$page= $num_pages;

    $limit_start = ($page-1)*$items_per_page;

    //changable sql

    if($who =="")

    {

        $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";

}else{

    $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts  WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";

}

echo "</p>";

    echo "<p>";

    $items = mysql_query($sql);

    echo mysql_error();

    if(mysql_num_rows($items)>0)

    {

    while ($item = mysql_fetch_array($items))

    {

        $shnick = getnick_uid($item[2]);
	  $sht2 = parsepm($item[1], $sid);

        $shdt = date("H:i a", $item[3]);
		
		
		

		
$countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_cwart WHERE artid='".$artid."'"));

      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a> $sht2 <i><small> <a href=\"index.php?&action=artcom&sid=$sid&id=$id&artid=$id&cid=$cid\">Comments($countpics[0])</a> - at $shdt</small></i>";

i think problem in shout sql n comment sql adjust . can you help me ?

to comment action

else if($action=="artcom2")

{
$text = $_POST["text"];
  $artid = $_GET["artid"];
  //$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Adding Article Comment","index.php?action=main");

    echo "<card id=\"main\" title=\"Clubs Menu\">";
	    echo "<p align=\"left\">";

$crdate = time();
      $uid = getuid_sid($sid);
      $res = false;

      if(trim($text)!="")
      {
        
      $res = mysql_query("INSERT INTO ibwf_cwart SET uid='".$uid."', text='".$text."', crdate='".$crdate."', artid='".$artid."'");
      }
      if($res)
      {
        echo "Comment submitted<br/><br/><br/>";
      }else{
        echo "Error Adding Comment<br/>";
  
  }      
   

	
	

    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";

echo "Home</a>";

  echo "</p>";

    echo "</card>";

}

else if($action=="artcom")

{
$id = $_GET["id"];
$cid = $_GET["cid"];
$artid = $_GET["artid"];
    addonline(getuid_sid($sid),"Status Comments","lists.php?action=$action&who=$who&bid=$bid");
     $uid = getuid_sid($sid);
    echo "<card id=\"main\" title=\"Clubs Menu\">";

    

    echo "<p align=\"left\">";
	
	
	 if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_cwart WHERE artid='".$artid."'"));
    $num_items = $noi[0]; //changable
    $items_per_page= 5;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    
      $sql = "SELECT id, artid, text, uid, crdate FROM ibwf_cwart WHERE artid='".$artid."' ORDER BY crdate DESC LIMIT $limit_start, $items_per_page";
      

  
    $items = mysql_query($sql);
     $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
        
          if(isonline($item[3]))
  {
    $iml = "[•]";
    
  }else{
    $iml = "[x]";
  }
    $snick = getnick_uid($item[3]);
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$iml$snick</a>:";
      
    $tmstamp = $item[4];
    $bs = date("D,dMy-h:i:s a",$tmstamp);
      
      echo "$lnk<br/><small>";
      
$me = getuid_sid($sid);
if($who=="$me") {
$can = "a";
}else{
$can = "b";
}
  if(ismod($uid)||$can=="a")
  {
   $delnk = "<a href=\"articles.php?action=delart&sid=$sid&id=$item[0]\">[x]</a>";
      }else{
        $delnk = "";
      }
      $text = parsepm($item[2], $sid);
      echo "$text $delnk<br/>";
echo "$bs";
echo "<br/>";
      echo "</small>";

    }
    }
 echo "</p><p align=\"left\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"index.php?action=artcom&page=$ppage&sid=$sid&id=$artid&cid=$cid&artid=$artid&type=send\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"index.php?action=artcom&page=$npage&sid=$sid&id=$artid&cid=$cid&artid=$artid&type=send\">Next»</a>";
    }
    echo "<br/>$page/$num_pages<br/>";

   
$me = getuid_sid($sid);
if($me!="$id") {
$artid = $_GET["artid"];
    echo "<form action=\"index.php?action=artcom2&sid=$sid&artid=$artid\" method=\"post\">";
echo "<input name=\"text\" maxlength=\"3000\"/><br/>";
  
 echo "<input type=\"submit\" value=\"Add Comments\"/>";
           echo "</form>";
}
echo "<a href=\"articles.php?action=viewart&sid=$sid&cid=$cid&artid=$artid&id=$id&browse?\">";
    echo "Back to article</a><br/>";

    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";

echo "Home</a>";

  echo "</p>";

    echo "</card>";

}

and nedded table is

--
-- Table structure for table `ibwf_cwart`
--

CREATE TABLE `ibwf_cwart` (
  `id` int(255) NOT NULL auto_increment,
  `artid` int(255) NOT NULL default '0',
  `uid` int(255) NOT NULL default '0',
  `text` varchar(255) NOT NULL default '',
  `crdate` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=95 ;

--
-- Dumping data for table `ibwf_cwart`
--

INSERT INTO `ibwf_cwart` (`id`, `artid`, `uid`, `text`, `crdate`) VALUES
(94, 91, 10, 'hghjgj', '1256559509');

-- --------------------------------------------------------

pleaseeee;( ;(🙁

/* I don't know everything hehe */

Find me on facebook

something else Fellow · 2,296 posts #4

the codes are really screwed up as u are mixing wml with xhtml the main problem is $artid your not assigning it to to a shout id number

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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