gulli:board Logo

Anzeige


  Antwort
Robinhood
Sentenced
 
Benutzerbild von Robinhood
 
Registrierungsdatum: Mar 2000
Ort: ...in your mind
Beiträge: 1.530
Frage zu phpbb und Topics auf webseite anzeigen!

Hiho,
ich möchte topics aus meinem phpbb auf meiner webseite anzeigen lassen und habe dazu folgendes gefunde, weis aber eigntlich nicht WIE ich es nutzen kann, ich hoffe da kann wer helfen

Cheers, Robin

PHP-Code:
<?php
define
('IN_PHPBB'true);
/***************************************************************************
 * Hack:     Recent Topics                    
 * Author:   Acid (acid_junky@web.de)
 ***************************************************************************
 * Description: This hack shows the last # topics on any page...
 ***************************************************************************
 * Installation: You can write the whole code in a file (like index.php) or
 *               include this recent.php wherever you want...
 *               <?php include("path/recent.php");
 *               You have to edit $phpbb_root_path and $limit and $css
 ***************************************************************************/

$css ="http://www.domain.de/board/templates/name/name.css"//path and name to your css_sheet - optional
$limit "10"// how many topics?

$phpbb_root_path "board/"//path to below files
include($phpbb_root_path 'extension.inc');
include(
$phpbb_root_path 'common.'.$phpEx);

echo 
"<link rel=\"stylesheet\" href=\"$css\" type=\"text/css\">"// - optional

$recent_sql "SELECT topic_id,topic_title,topic_last_post_id,forum_id FROM " TOPICS_TABLE " WHERE forum_id !='14' ORDER BY topic_last_post_id DESC LIMIT $limit";
$recent $db->sql_query($recent_sql); 

echo 
"<table width=\"80%\" align=\"center\"><tr><td colspan=\"4\" align=\"left\"><span class=\"gen\"><b>recent topics:</b></span></td></tr>"

while (
$line mysql_fetch_array($recent)) { 
$security=FALSE
if(
$forum_auth == && $userdata['user_level'] == ADMIN) { 
$security=TRUE

if(
$forum_auth == && ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == 2)) { 
$security=TRUE

if(
$forum_auth == 0) { 
$security=TRUE

if(
$security == TRUE


  
$lastpost_array=$db->sql_query("SELECT post_time FROM " POSTS_TABLE " WHERE post_id =" $line['topic_last_post_id']); 
  
$lastpost=mysql_fetch_array($lastpost_array); 
  
$lastpost=$lastpost['post_time']; 
  
$lastpost=create_date($board_config['default_dateformat'], $lastpost$board_config['board_timezone']); 

$j stripslashes($line['topic_title']); 
$k substr($j025) . "..."

  echo 
"<tr><td align=\"left\"><span class=\"gensmall\">&raquo;&raquo; </span> <a href=\"$phpbb_root_path/viewtopic.php?t=" $line['topic_id'] . "\" class=\"genmed\">" $k "</a></td>";
  echo 
"<td align=\"left\" width=\"50%\"><span class=\"genmed\">$lastpost</span></td></tr>";

}}; 

echo 
"</table>"
?>
Alt 02. 10. 2002, 14:34 Robinhood is offline Mit Zitat antworten #1
Robinhood
Sentenced
(Threadstarter)
 
Benutzerbild von Robinhood
 
Registrierungsdatum: Mar 2000
Ort: ...in your mind
Beiträge: 1.530
Hallo?
Alt 03. 10. 2002, 23:57 Robinhood is offline Mit Zitat antworten #2
TheThreaT
Mitglied
 
Registrierungsdatum: Mar 2001
Beiträge: 159
Wie wie du das nutzen kannst?
Ist das nicht einfach ne php Datei?

Ich würde das obige in der Datei recent_topics.php speichern auffen Server klatschen und dann müsste das doch funzen.


greetz
TheThreaT
Alt 04. 10. 2002, 13:07 TheThreaT is offline Mit Zitat antworten #3
FraXXis
BWFH
 
Benutzerbild von FraXXis
 
Registrierungsdatum: Feb 2001
Ort: Australien
Beiträge: 2.133
Zitat:
You can write the whole code in a file (like index.php) or
* include this recent.php wherever you want...
* <?php include("path/recent.php");
* You have to edit $phpbb_root_path and $limit and $css


du musst also nur die variablen $phpbb_root_path, $limit und $css anpassen und dann sollte es gehen. versuch das mal und wenn es dann nicht geht, poste nochmal.
Alt 04. 10. 2002, 13:50 FraXXis is offline Mit Zitat antworten #4
Robinhood
Sentenced
(Threadstarter)
 
Benutzerbild von Robinhood
 
Registrierungsdatum: Mar 2000
Ort: ...in your mind
Beiträge: 1.530
Das funzt ganz gut wenn ich eine php datei erstelle und

PHP-Code:
<?php include("BB2/recent.php");


einfüge.
Nun muss das ganze aber auf einer Portalseite angezeigt werden [eine .inc Datei]
das ist das APPortal vom Mieland. Wenn ich das so wie oben einfügen will bekomme ich folgende Fehlermeldung:

PHP-Code:
Parse errorparse errorunexpected '<' in /raid/domains/de/m/meine domain/htdocs/www/inc/news.inc on line 96 


auf 96 steht aber nur </table> hmm?

Wenn ich eine neue Box erstelle und

PHP-Code:
<?php include("BB2/recent.php");


einfüge, bekomme ich diese Fehlermeldung:


PHP-Code:
parse errorparse errorunexpected '<' in /raid/domains/de/m/meine domain/htdocs/www/inc/navi_links.inc(36) : eval()d code on line 83 


...hoffe da kann wer Helfen
Alt 04. 10. 2002, 18:56 Robinhood is offline Mit Zitat antworten #5
FraXXis
BWFH
 
Benutzerbild von FraXXis
 
Registrierungsdatum: Feb 2001
Ort: Australien
Beiträge: 2.133
versuchs mal nur mit
include("BB2/recent.php");

wenn vorher schon ein php tag geöffnet wurde, darfst du nicht noch einen öffnen.
Alt 04. 10. 2002, 18:58 FraXXis is offline Mit Zitat antworten #6
Robinhood
Sentenced
(Threadstarter)
 
Benutzerbild von Robinhood
 
Registrierungsdatum: Mar 2000
Ort: ...in your mind
Beiträge: 1.530
Das klappt werder in einer Box noch in der .inc datei, bei beiden versuchen steht dann jeweils nur

PHP-Code:
include("BB2/recent.php"); 
ganz normal da drin!?

Hier mal die .inc Datei !

PHP-Code:
<?
//
//
$template1 GetTemp("oben"); 
$template1 str_replace("{TITEL}""Willkommen"$template1); 
echo 
$template1
?> 

<html>
<head>
<title>Top</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" align="center">
  <tr>
    <td>
      <div align="center"> 
        <p><br>
          <img src="waechterin.jpg"> </p>
        <p>Hallo und herzlich willkommen bei den bla bla. </p>
      </div>
      <p align="center">Wir sind eine kleine Gruppe von Frauen, die sich zuerst 
        nur<br>
        zusammengeschlossen hat um Wissen und Erfahrungen auszutauschen, 
bla bla und so weiter.
<br>
        <img src="toptext.gif" width="201" height="54"> </p>
      <p align="center"></p>
    </td>
  </tr>
</table>
include("BB2/recent.php"); 
</body>
</html>

<? 
$template2 
GetTemp("unten"); 
echo 
$template2;
if (
$config["show_private_box"] == "1"
    {
    
$template1 GetTemp("oben");
    
$template1 str_replace("{TITEL}"GetLanguage("313"), $template1);
    echo 
$template1;
    if (!isset(
$user["id"])) { $user["id"] = "0"$user["groupid"] = "0"; }
    
$select_pm_ungelesen "SELECT COUNT(id) FROM page_pm WHERE gelesen='0' AND toid='".$user["id"]."'";
    
$select_pm_ungelesen mysql_query($select_pm_ungelesen);
    
$select_pm_ungelesen mysql_fetch_row($select_pm_ungelesen);
    
$anzahl_ungelesen $select_pm_ungelesen[0];
    
$select_pm_gelesen "SELECT COUNT(id) FROM page_pm WHERE gelesen='1' AND toid='".$user["id"]."'";
    
$select_pm_gelesen mysql_query($select_pm_gelesen);
    
$select_pm_gelesen mysql_fetch_row($select_pm_gelesen);
    
$anzahl_gelesen $select_pm_gelesen[0];
    
$select_usernews "SELECT COUNT(id) FROM page_usernews";
    
$select_usernews mysql_query($select_usernews);
    
$select_usernews mysql_fetch_row($select_usernews);
    
$anzahl_usernews $select_usernews[0];
    
$query_newanzahl "SELECT COUNT(id) FROM page_news";
    
$query_newanzahl mysql_query($query_newanzahl);
    
$newnewsanzahl mysql_fetch_row($query_newanzahl);
    
$newnewsanzahl $newnewsanzahl[0];
    
$uebersicht_table "";
    if (!isset(
$APPCookie)) { $APPCookie ""; }
    if (
$APPCookie == ""
        {
        
$anzahl_news $config["newszahl"];
        
$eingeloggt "<center>[ <a href=\"./index.php?site=register\">".GetLanguage("314")."</a> ]<br></center>";
        }
    else
        {
        
$anzahl_news $user["news_anzahl"];
        
$eingeloggt "<center><b>".GetLanguage("315")."<br><br>[ <a href=\"./index.php?site=admin\">".GetLanguage("316")."</a> | <a href=\"./index.php?site=logout\">".GetLanguage("317")."</a> ]</b><br></center>";
        }
    if (
$newnewsanzahl >= 1)
        {
        
$newnews_query "SELECT id, head FROM page_news ORDER BY date DESC LIMIT 0,".$anzahl_news;
        
$newnews_query mysql_query($newnews_query);
        
$uebersicht_table .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        while (
$thisusernews mysql_fetch_row($newnews_query)) 
            {
            
$query_comment "SELECT COUNT(id) FROM page_comments WHERE newsid='".$thisusernews[0]."'";
            
$query_comment mysql_query($query_comment);
            
$thiscommentanzahl mysql_fetch_row($query_comment);
            
$comments $thiscommentanzahl[0];
            
$uebersicht_table .= "<tr><td><a href=\"#".$thisusernews[0]."\">".$thisusernews[1]."</a></td><td width=\"30\" align=\"right\">".$comments."</td></tr>\n";
            }
        
$uebersicht_table .= "</table>";
        }
    
?>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td valign="top">
              <b><?PHP echo GetLanguage("318"); ?></b><br>
                <?PHP echo $uebersicht_table?>
                </td>
              <td width="10" valign="top">&nbsp;</td>
              <td bgcolor="Maroon" width="1"><img src="gfx/blank.gif" width="1" height="60"></td>
              <td width="10" valign="top">&nbsp;</td>
              <td valign="top" width="180">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td width="40">PMs:</td>
                    <td><font size="1"><?PHP echo GetLanguage("319"); ?></font></td>
                    <td width="30"><?PHP echo $anzahl_ungelesen?></td>
                  </tr>
                  <tr> 
                    <td width="40">&nbsp;</td>
                    <td><font size="1"><?PHP echo GetLanguage("320"); ?></font></td>
                    <td width="30"><?PHP echo $anzahl_gelesen?></td>
                  </tr>
                  <tr> 
                    <td width="40">News:</td>
                    <td><font size="1"><?PHP echo GetLanguage("321"); ?></font></td>
                    <td width="30"><?PHP echo $anzahl_usernews?></td>
                  </tr>
                  <tr> 
                    <td width="40">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td width="30">&nbsp;</td>
                  </tr>
                  <tr> 
                    <td colspan="3"><?PHP echo $eingeloggt?></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <?PHP
    $template2 
GetTemp("unten");
    echo 
$template2;
    }
if (!isset(
$APPCookie)) { $APPCookie ""; } 
if (
$APPCookie == ""

$anzahl_news $config["newszahl"]; 

else 

$anzahl_news $user["news_anzahl"]; 
}
$query2 "SELECT * FROM page_news ORDER BY date DESC LIMIT 0,".$anzahl_news;
$query2 mysql_query($query2);
echo 
mysql_error();
while (
$news mysql_fetch_array($query2)) 
    {
    
$id $news["id"];
    
$head $news["head"];
    
$text $news["text"];
    
$date $news["date"];
    
$userid $news["userid"];
    
$views $news["views"];
    
$time HackDate($date);
    
$query3 "SELECT * FROM page_user WHERE id='".$userid."'";
    
$query3 mysql_query($query3);
    
$you mysql_fetch_array($query3);
    
$text RemoveCrap($text);
    echo 
"<a name=\"".$news["id"]."\">";
    
$template1 GetTemp("oben");
    
$template1 str_replace("{TITEL}",$head$template1);
    echo 
$template1;
    
$laenge $config["news_laenge"];
    if (
strlen($text) >= $laenge
        {
        
$text substr ($text0$laenge);
        
$text $text."&nbsp;&nbsp;.&nbsp;.&nbsp;.&nbsp;&nbsp;&nbsp;<a href=\"./index.php?site=showmore&id=".$id."\"><font size=\"1\">[more]</font></a>";
        
$show_more "1";
        }
    else
        {
        
$show_more "0";
        }
    echo 
"<br>".$text;
    if (!isset(
$APPCookie)):
        
$editgif    "";
        
$deletegif    "";
    elseif (isset(
$APPCookie)):
        
$query1 "SELECT caneditnews, candelnews FROM page_group WHERE id='".$user["groupid"]."'";
        
$query1 mysql_query($query1);
        echo 
mysql_error();
        
$can mysql_fetch_array($query1);
        echo 
mysql_error();
        if (
$can["caneditnews"] == "1"):
            
$editgif    "&nbsp;&nbsp;<a href=\"./index.php?site=admin&action=news&newsaction=edit&choose=isset&id=".$id."\"><img src=\"".$href_gfxdir."n_edit.gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"".GetLanguage("100")."\" title=\"".GetLanguage("100")."\"></a>";
        elseif (
$can["caneditnews"] == "0"):
            
$editgif    "";
        endif;
        if (
$can["candelnews"] == "1"):
            
$deletegif    "&nbsp;&nbsp;<a href=\"./index.php?site=admin&delete=".$id."&set=delete&what=news&action=save\"><img src=\"".$href_gfxdir."n_delete.gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"".GetLanguage("101")."\" title=\"".GetLanguage("101")."\"></a>";
        elseif (
$can["candelnews"] == "0"):
            
$deletegif    "";
        endif;
    endif;
    if (
$you["email"] == "") { $mail1 ""$mail2 ""$mailgif ""; }
    if (
$you["email"] != "") { $mail1 "<a href=\"./index.php?site=userdetails&toid=".$you["id"]."\">"$mail2 "</a>"$mailgif $mail1."<img src=\"".$href_gfxdir."n_email.gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"".GetLanguage("97")."\" title=\"".GetLanguage("97")."\">".$mail2; }
    if (
$you["username"] == "") { $thisuser "*deleted*"; }
    if (
$you["username"] != "") { $thisuser $mail1.$you["username"].$mail2; }
    
$comment_query "SELECT COUNT(id) FROM page_comments WHERE newsid='".$id."'";
    
$comment_query mysql_query($comment_query);
    
$comment_anzahl mysql_fetch_row($comment_query);
    
$comm_anzahl $comment_anzahl[0];
    if (
$comm_anzahl >= "1"
        { 
        if (
$comm_anzahl == "1") { $kommentare "<a href=\"./index.php?site=showcomments&&newsid=".$id."\">".$comm_anzahl." ".GetLanguage("322")."</a>"; }
        if (
$comm_anzahl >= "2") { $kommentare "<a href=\"./index.php?site=showcomments&&newsid=".$id."\">".$comm_anzahl." ".GetLanguage("323")."</a>"; }
        }
    else
        {
        
$kommentare "";
        }
    if (!isset(
$editgif)) { $editgif ""; }
    if (!isset(
$deletegif)) { $deletegif ""; }
    
$printgif    "&nbsp;&nbsp;<a href=\"./print.php?what=news&id=".$id."\"><img src=\"".$href_gfxdir."n_drucken.gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"".GetLanguage("98")."\" title=\"".GetLanguage("98")."\"></a>";
    
    if (
$show_more == "1")
        {
        
$moregif    "&nbsp;&nbsp;<a href=\"./index.php?site=showmore&id=".$id."\"><img src=\"".$href_gfxdir."n_more.gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"".GetLanguage("99")."\" title=\"".GetLanguage("99")."\"></a>";
        }
    else
        {
        
$moregif    "";
        }
    
$commentgif    "&nbsp;&nbsp;<a href=\"./index.php?site=comment&what=news&newsid=".$id."\"><img src=\"".$href_gfxdir."n_comment.gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"".GetLanguage("263")."\" title=\"".GetLanguage("263")."\"></a>";
    echo 
"<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td colspan=\"2\">&nbsp;</td></tr><tr><td colspan=\"2\"><hr></td></tr>";
    echo 
"<tr><td>".GetLanguage("96")." ".$thisuser." @<br>".$time."</td><td align=\"right\" width=\"150\">".$mailgif.$printgif.$moregif.$commentgif.$editgif.$deletegif."<br>".$kommentare."</td></tr></table>";
    
$template2 GetTemp("unten");
    echo 
$template2;
    }
?>
Alt 04. 10. 2002, 19:22 Robinhood is offline Mit Zitat antworten #7
TheThreaT
Mitglied
 
Registrierungsdatum: Mar 2001
Beiträge: 159
Code:
</tr> </table> include("BB2/recent.php"); </body> </html>

Wäre mir neu, wenn man in nem html part includen kann.
Alt 05. 10. 2002, 14:18 TheThreaT is offline Mit Zitat antworten #8
Robinhood
Sentenced
(Threadstarter)
 
Benutzerbild von Robinhood
 
Registrierungsdatum: Mar 2000
Ort: ...in your mind
Beiträge: 1.530
Ja aber.....wie mache ich es dann?
Alt 06. 10. 2002, 02:24 Robinhood is offline Mit Zitat antworten #9
FraXXis
BWFH