Neustes Thema....

Du suchst einen bestimmten Mod, weißt aber nicht genau wo bzw. ob er überhaupt existiert? Wenn dir dieser Artikel nicht weiterhilft, kannst du hier den von dir gewünschten/gesuchten Mod beschreiben ...
Falls ein Mod-Autor eine der Anfragen hier aufnimmt, um einen neuen Mod zu entwickeln, geht's in [3.0.x] Mods in Entwicklung weiter.
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf die neuste phpBB-Version, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Eliteboy1994
Mitglied
Beiträge: 7
Registriert: 23.03.2011 19:22

Neustes Thema....

Beitrag von Eliteboy1994 »

Hallo,
der Folgende Script gibt ja die neuen Themen aus, von den Foren.

Kann den jemand so ändern, das man auch nur von einem Bestimmten Forum oder einer bestimmten Kategorie die letzten Themen ausgibt, wie z.B für News

Code: Alles auswählen

<?php
// ############         Edit below         ########################################
$topic_length = '20';   // length of topic title
$topic_limit = '12';   // limit of displayed topics
$special_forums = '0';   // specify forums ('0' = no; '1' = yes)
$forum_ids = '3,5,6,7';      // IDs of forums; separate them with a comma

$config_path = '/';   // path to config.php
$root_path = 'http://www.deinforum.de/phpbb/';      // link path
// ############         Edit above         #######################################

$path = dirname(__FILE__);
include_once($path.$config_path .'config.php');
mysql_connect($dbhost, $dbuser, $dbpasswd) OR die('Unable to select server.');
mysql_select_db($dbname) OR die('Unable to select database.');

// ############## output ##############
echo '<table border="0" cellpadding="0" cellspacing="0" style="width: 100%" id="Table_DSF-Top5">
<body text="#000000" link="#000000" vlink="#333333" alink="#333333">
         <tr>
           <td colspan="4"><span class="small"><font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">
           Die '. $topic_limit .' letzten Themen im Forum</font></span></td><br>
         </tr>
         <tr>

            <td style="width: 20%"><span class="small">
            <strong>
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">Foren</font></strong>
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:9px"></font
            </strong></span></td>
            <td style="width: 20%"><span class="small">
            <strong>
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">User</font>
            </strong>
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:9px"></font
            </strong></span></td>
            <td style="width: 20%"><span class="small">
            <strong>
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">Datum</font>
            </strong></span></td>
            <td style="width: 20%"><span class="small"><strong>
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">Thema</font>
            </strong>
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:9px"></font
            </strong></span></td>

         </tr>';
// ############## output ##############

$where_forums = ( $special_forums == '0' ) ? '' : 't.forum_id NOT IN ('. $forum_ids .') AND ';
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username AS first_poster, u.user_id AS first_poster_id, u2.username AS last_poster, u2.user_id AS last_poster_id, p.post_username AS first_poster_name, p2.post_username AS last_poster_name, p2.post_time
   FROM ". $table_prefix ."topics t, ". $table_prefix ."forums f, ". $table_prefix ."users u, ". $table_prefix ."posts p, ". $table_prefix ."posts p2, ". $table_prefix ."users u2
   WHERE $where_forums t.topic_poster = u.user_id AND f.forum_id = t.forum_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id
   ORDER BY t.topic_last_post_id DESC LIMIT $topic_limit";
$result = mysql_query($sql);
if( !$result )
{
   die('SQL Statement Error: '. mysql_error());
   exit();
}

$line = array();
while( $row = mysql_fetch_array($result) )
{
   $line[] = $row;
}

for( $i = 0; $i < count($line); $i++ )
{
   $forum_id = $line[$i]['forum_id'];
   $forum_url = $root_path .'viewforum.php?f='. $forum_id;
   $topic_id = $line[$i]['topic_id'];
   $topic_url = $root_path .'viewtopic.php?t='. $topic_id;

   $topic_title = ( strlen($line[$i]['topic_title']) < $topic_length ) ? $line[$i]['topic_title'] : substr(stripslashes($line[$i]['topic_title']), 0, $topic_length) .'...';

   $topic_type =  ( $line[$i]['topic_type'] == '2' ) ? 'Announcement ': '';
   $topic_type .= ( $line[$i]['topic_type'] == '3' ) ? 'Global Announcement ': '';
   $topic_type .= ( $line[$i]['topic_type'] == '1' ) ? 'Sticky ': '';
   $topic_type .= ( $line[$i]['topic_vote'] ) ? 'Poll ': '';

   $views = $line[$i]['topic_views'];
   $replies = $line[$i]['topic_replies'];

   $first_time = date('d.m.Y', $line[$i]['topic_time']);
   $first_author = ( $line[$i]['first_poster_id'] != '-1' ) ? '<a href="'. $root_path .'profile.php?mode=viewprofile&u='. $line[$i]['first_poster_id'] .'" target="_blank">'. $line[$i]['first_poster'] .'</a>' : ( ($line[$i]['first_poster_name'] != '' ) ? $line[$i]['first_poster_name'] : 'guest' );
   $last_time = date('d.m.Y', $line[$i]['post_time']);
   $last_author = ( $line[$i]['last_poster_id'] != '-1' ) ? $line[$i]['last_poster'] : ( ($line[$i]['last_poster_name'] != '' ) ? $line[$i]['last_poster_name'] : 'guest' );
   $last_url = '<a href="'. $root_path .'viewtopic.php?p='. $line[$i]['topic_last_post_id'] .'#'. $line[$i]['topic_last_post_id'] .'" target="_blank">'. $last_author .'</a>';

   // ############## output ##############
   echo '<tr>

            <td style="width: 20%"><a href="'. $forum_url .'" target="_blank">
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">'. $line[$i]['forum_name'] .'</font></a></td>
            <td style="width: 20%">
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">'. $last_url .'</font></td>
            <td style="width: 20%">
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">'. $last_time .'</font></td>
            <td style="width: 20%"><a href="'. $topic_url .'" target="_blank">
            <font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">'. $topic_title .'</font></a></td>

        </tr>';

   // ############## output ##############
}

echo '</table>';
mysql_close();
?>
Benutzeravatar
Superanton
Ehemaliges Teammitglied
Beiträge: 174
Registriert: 24.02.2008 11:07
Wohnort: Bayern

Re: Neustes Thema....

Beitrag von Superanton »

Hallo Eliteboy,

schau mal in Zeile 6:

Code: Alles auswählen

$forum_ids = '3,5,6,7';      // IDs of forums; separate them with a comma
Dort kannst du festlegen welche Foren IDs anzeigt werden sollen.

Beste Grüße,
Anton
Eliteboy1994
Mitglied
Beiträge: 7
Registriert: 23.03.2011 19:22

Re: Neustes Thema....

Beitrag von Eliteboy1994 »

okay
Eliteboy1994
Mitglied
Beiträge: 7
Registriert: 23.03.2011 19:22

Re: Neustes Thema....

Beitrag von Eliteboy1994 »

Klappt nicht, der gibt mir trotzdem alle aus :s
Benutzeravatar
AmigaLink
Mitglied
Beiträge: 1417
Registriert: 09.06.2003 21:56
Wohnort: NRW
Kontaktdaten:

Re: Neustes Thema....

Beitrag von AmigaLink »

Code: Alles auswählen

$special_forums = '0';   // specify forums ('0' = no; '1' = yes)
Änder die 0 mal in eine 1, dann klappt's auch mit dem Nachbarn. ;)
Benutzeravatar
welshp
Mitglied
Beiträge: 47
Registriert: 03.11.2009 18:06

Re: Neustes Thema....

Beitrag von welshp »

Eliteboy1994 hat geschrieben:Hallo,
der Folgende Script gibt ja die neuen Themen aus, von den Foren.
Moin.
Wo finde ich denn dieses script?
Ist das ein Mod oder kommt das von Hause aus vor?
Gruß, Klaus
aus Berlin
Eliteboy1994
Mitglied
Beiträge: 7
Registriert: 23.03.2011 19:22

Re: Neustes Thema....

Beitrag von Eliteboy1994 »

Also, der Script befindet sich so hier im Forum von jemanden.

Ich habe das probiert, das mit auf Ja stellen, klappt auch nicht, auch wenn ich keine ID einfüge, zeugt der alle^^
Benutzeravatar
AmigaLink
Mitglied
Beiträge: 1417
Registriert: 09.06.2003 21:56
Wohnort: NRW
Kontaktdaten:

Re: Neustes Thema....

Beitrag von AmigaLink »

Superanton hat geschrieben:Hallo Eliteboy,

schau mal in Zeile 6:

Code: Alles auswählen

$forum_ids = '3,5,6,7';      // IDs of forums; separate them with a comma
Dort kannst du festlegen welche Foren IDs anzeigt werden sollen.
Diese Aussage stimmt nicht so ganz. Die angegebenen Forum-IDs werden nicht angezeigt.

Wenn du möchtest das die angegebenen Foren angezeigt werden, dann musst du diese Zeile noch ändern:

Code: Alles auswählen

$where_forums = ( $special_forums == '0' ) ? '' : 't.forum_id NOT IN ('. $forum_ids .') AND ';
Und zwar so:

Code: Alles auswählen

$where_forums = ( $special_forums == '0' ) ? '' : 't.forum_id IN ('. $forum_ids .') AND ';
Voraussetzung ist aber nach wie vor das $special_forums auf 1 gesetzt ist.
Antworten

Zurück zu „[3.0.x] Mod Suche/Anfragen“