Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Parsowanie bbcode z vbulletin?
ZLoM
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 2.04.2007

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


Witajcie, mam mały problemik, mam taki skrypt o to skrypt:

  1. <?php  
  2.     $forumid=3;
  3.    $howmany=5;
  4.      $query="SELECT threadid,title,postusername FROM thread WHERE forumid=$forumid ORDER BY threadid DESC LIMIT $howmany";
  5.      $list_t=mysql_query($query);
  6.  
  7.      while ($temat=mysql_fetch_array($list_t))
  8.      {
  9.         $psql = mysql_query("SELECT pagetext , dateline FROM post WHERE threadid=".$temat['threadid']." ORDER BY postid ASC LIMIT 1");
  10.         $post=mysql_fetch_array($psql);
  11.         $news['pagetext'] = $post['pagetext'];
  12.         $news['title'] = $temat['title'];
  13.         $news['threadid'] = $temat['threadid'];
  14.         $news['postusername'] = $temat['postusername'];
  15.         $news['date'] = date ("d.m.y H:i" ,$post['dateline']);
  16.        
  17.          print"
  18.          blabalbal
  19.  
  20.        ";
  21.  
  22.  
  23.     }
  24.    ?>


Jego zadaniem jest pobieranie nazwy, id,treści tematu itp. z wybranego działu na forum, wszystko jest ok, prócz tego iż skrypt nie "pobiera" bbcodów z vB, niestety nie mam bladego pojęcia jak mogę to poprawić, słyszałem coś o prasowaniu bbcodów z vB niestety nie wiem jak mam to zastosować w moim skrypcie
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
ZLoM
post
Post #2





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 2.04.2007

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


Winą tego błędu oczywiście była niechciana spacja.

Teraz niestety wywala mi inny błąd, niestety nie wiem dokładnie co on może oznaczać, oraz jak go naprawić?

Kod
Fatal error: Call to a member function query_read() on a non-object in /public_html/forum/includes/class_bbcode.php on line 581


Linia z numerem 581:
  1. <?php
  2. $smilies = $this->registry->db->query_read("
  3. ?>



Linie od 576 do 614 pliku class_bbcode:

  1. <?php
  2. // we have to get the smilies from the database
  3.            DEVDEBUG('querying for smilies');
  4.  
  5.            $this->registry->smiliecache = array();
  6.  
  7.            $smilies = $this->registry->db->query_read("
  8.                SELECT *, LENGTH(smilietext) AS smilielen
  9.                FROM " . TABLE_PREFIX . "smilie
  10.                ORDER BY smilielen DESC
  11.            ");
  12.            while ($smilie = $this->registry->db->fetch_array($smilies))
  13.            {
  14.                if (!$do_html)
  15.                {
  16.                    $find = htmlspecialchars_uni(trim($smilie['smilietext']));
  17.                }
  18.                else
  19.                {
  20.                    $find = trim($smilie['smilietext']);
  21.                }
  22.  
  23.                // if you change this HTML tag, make sure you change the smilie remover in code/php/html tag handlers!
  24.                if ($this->is_wysiwyg())
  25.                {
  26.                    $replace = "<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\" title=\"" . htmlspecialchars_uni($smilie['title']) . "\" smilieid=\"$smilie[smilieid]\" class=\"inlineimg\" />";
  27.                }
  28.                else
  29.                {
  30.                    $replace = "<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\" title=\"" . htmlspecialchars_uni($smilie['title']) . "\" class=\"inlineimg\" />";
  31.                }
  32.  
  33.                $sc["$find"] = $replace;
  34.  
  35.                $this->registry->smiliecache["$smilie[smilieid]"] = $smilie;
  36.            }
  37.        }
  38.  
  39.        return $sc;
  40.    }
  41. ?>


Ten post edytował ZLoM 19.03.2009, 22:13:27
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 26.12.2025 - 21:16