Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z adresem url w php ;/
Rajdon
post 24.10.2010, 17:04:46
Post #1





Grupa: Zarejestrowani
Postów: 73
Pomógł: 0
Dołączył: 7.06.2009

Ostrzeżenie: (0%)
-----


Witam, mam problem z adresem url w module lastcomments skrypt działa tak, że jesli ktoś skomentuje artykul to on w tabelce "ostatnio komentowane" wyświetli link do artykuu. Problem jest jednak taki, że skrypt został tak napisany, że wyświetla na stronie inny link niż ten oryginalny do artykułu. Ponieważ mam na stronie zainstalowany jeszcze jeden moduł "topnews" (najwyzej oceniane artykuły) który wyswietla dobry / poprawny link więc na poczatku modułu lastcomments dodałem include 'topnews.php'; oraz podmieniłem sam kod linka na prawidłowy ale skrypt nie odczytuje mi zmiennych i warosci linka nie wiem czemy ;/ ?



Oto zminiony kod:

  1. include 'topnews.php';
  2. $query_comm_temp = "SELECT * FROM " . PREFIX . "_comments ORDER BY date DESC LIMIT " . $comm_num.";";
  3. $query_comm = $db->query($query_comm_temp);
  4.  
  5.  
  6. while ($comment = $db->get_row($query_comm))
  7. {
  8. $comment_tpl = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td style='padding-top: 4px;'>Autor: ";
  9. $comment_tpl .= "<a href=". link_user($comment['autor']).">". $comment['autor']."</a> W artykule:</td></tr><tr><td style='border-bottom: 1px solid #d1d7dc; padding-bottom: 4px;'>";
  10.  
  11. $query_news_temp = "SELECT * FROM ". PREFIX ."_post WHERE id=". $comment['post_id'] .";";
  12. $query_news = $db->query($query_news_temp);
  13.  
  14. while ($novost = $db->get_row($query_news))
  15. {
  16. $novost['date'] = strtotime($novost['date']);
  17.  
  18. if (strlen($novost['title']) > 35)
  19. $news = substr ($novost['title'], 0, 35)." ...";
  20. else
  21. $news = $novost['title'];
  22.  
  23. if ($conf_url == "yes") {
  24. $ssilka = $config['http_home_url'] . get_url( $row['category'] ) . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
  25. }
  26. else {
  27. $ssilka = $novost['id'];
  28. }
  29. $comment_text = htmlspecialchars($comment['text']);
  30. if ($hint == "yes") $hint_show = "onMouseover=\"showhint('<b>Treść:</b><br>".$comment_text."', this, event, '200px')\"";
  31. $comment_tpl .= lastcomm_getscript()."<a href=\"".link_news().$ssilka."\"". $hint_show .">".$news. "</a></td></tr></table>";
  32. }
  33. $ready_tpl .= $comment_tpl;
  34. }
  35. $lastcomment = $ready_tpl;
  36. ?>
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 00:21