Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Reklama forume

Parašė bruzgis· 2008 Rugp. 5 18:08:27
#21

Sitas taip:

Jeigu neregistruotas ir kas trecias postas yra reklama:

   if ($rows != 0) {
   $result = dbquery(
      "SELECT p.*, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size, u.*, u2.user_name AS edit_name FROM ".$db_prefix."posts p
      LEFT JOIN ".$db_prefix."forum_attachments fa USING(post_id)
      LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id
      LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
      WHERE p.thread_id='$thread_id' ORDER BY post_datestamp LIMIT $rowstart,$posts_per_page"
   );
   $numrows = dbrows($result);
   $postai = '0';
   while ($data = dbarray($result)) {
   
   if ($postai == '2' && (!iMEMBER)) {   echo "<tr style='margin-top:5px'><td  class='tbl2' valign='top' style='margin-top:5px'>Reklama</td><td style='margin-top:5px' class='tbl1' align='center'>";

//reklamos modas prasideda
Cia visas banerio kodas, gali buti ir kokio nors button_panel baneriu rodymo kodas....
//reaklamos modas baiges
   
   echo"</td></tr>";
   $postai = '0';
   }
   $postai++;
      $message = $data['post_message'];
      if ($data['post_showsig']) { $message = $message."\n\n<hr>".$data['user_sig']; }
      if ($data['post_smileys']) { $message = parsesmileys($message); }
      $message = parseubb($message);
      $message = nl2br($message);




Sitas taip: visiem kas ketvirtas postas reklama

   if ($rows != 0) {
   $result = dbquery(
      "SELECT p.*, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size, u.*, u2.user_name AS edit_name FROM ".$db_prefix."posts p
      LEFT JOIN ".$db_prefix."forum_attachments fa USING(post_id)
      LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id
      LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
      WHERE p.thread_id='$thread_id' ORDER BY post_datestamp LIMIT $rowstart,$posts_per_page"
   );
   $numrows = dbrows($result);
   $postai = '0';
   while ($data = dbarray($result)) {
   
   if ($postai == '3' ) {   echo "<tr style='margin-top:5px'><td  class='tbl2' valign='top' style='margin-top:5px'>Reklama</td><td style='margin-top:5px' class='tbl1' align='center'>";

//reklamos modas prasideda
Cia visas banerio kodas, gali buti ir kokio nors button_panel baneriu rodymo kodas....
//reaklamos modas baiges
   
   echo"</td></tr>";
   $postai = '0';
   }
   $postai++;
      $message = $data['post_message'];
      if ($data['post_showsig']) { $message = $message."\n\n<hr>".$data['user_sig']; }
      if ($data['post_smileys']) { $message = parsesmileys($message); }
      $message = parseubb($message);
      $message = nl2br($message);