Skocz do zawartości

Rekomendowane odpowiedzi

Opublikowano

sorry if i post in the wrong forum but i need a bit of help on this coding. i got the mod working but its just no posting the last post , what is doing is quoting the first post and not the last

                          $this->ipsclass->DB->simple_construct( array( 'select' => '*',
								'from'   => 'posts',
								'where'  => "topic_id ='{$topic['tid']}' AND post_date <= '{$end_date}'",
								'limit'  => array(0,1),
								'order'  => 'post_date ASC'
									) );
			  $this->ipsclass->DB->simple_exec();
			  $p = $this->ipsclass->DB->fetch_row();
			  $p['post_date'] = $this->ipsclass->get_date($p['post_date'], 'LONG', 1 );




                         $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'last_poster_name',
				                                'from'   => 'topics',					  					      
									) );
			  $this->ipsclass->DB->simple_exec();
			  $t = $this->ipsclass->DB->fetch_row();
			  $t['last_poster_name'];


                         $content = "Auction Closed  <br />Last valid Bid is: <br />[quote name='{$t['last_poster_name']}' date='{$p['post_date']}' post='{$p['pid']}'] {$p['post']}[/quote]<br />Thanks for bidding";

Opublikowano (edytowane)


               if ($this->ipsclass->vars['ae_post'] == 1 && $topic['state'] == "open" && $topic['close_auction'] == 0){

                         $this->ipsclass->DB->simple_construct( array( 'select' => '*',
								'from'   => 'posts',
								'where'  => "topic_id ='{$topic['tid']}' AND post_date <= '{$end_date}'",
								'limit'  => array(0,1),
								'order'  => 'post_date ASC'
									) );
			  $this->ipsclass->DB->simple_exec();
			  $p = $this->ipsclass->DB->fetch_row();
			  $p['post_date'] = $this->ipsclass->get_date($p['post_date'], 'LONG', 1 );


			$content = "Auction Closed  <br />Last valid Bid is: <br />[quote name='{$p['author_name']}' date='{$p['post_date']}' post='{$p['pid']}'] {$p['post']}[/quote]<br />Thanks for bidding";


                         $mod     = $this->ipsclass->vars['ae_mod_id'];
                         $t       = $topic['tid'];
                         $api->set_author_by_id($mod);
                         $api->set_post_content($content);
                         $api->set_topic_id($t);
                         $api->post_settings['show_signature'] = 1;
                         $api->create_new_reply();	

                         $this->ipsclass->DB->do_update( 'topics', array( 
		                                  'close_auction' => "1"), 
                                                         'tid='.$topic['tid'] );			
                          }

	if ($this->ipsclass->vars['ae_close'] == 1){
		  $this->ipsclass->DB->do_update( 'topics', array( 
		                                  'state' => "closed"), 
                                                         'tid='.$topic['tid'] );
		          }
                     }
                }
        else{ 
                $topic['auctionends'] = "";
             }

sorry that was the code , well i want just to add to it to get the last post from that topic when the auction ends

Edytowane przez game

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.