Page 1 of 1

Neue Beiträge in Bekanntmachungen

Posted: 2. January 2010 17:04
by AuroraXF
Deine Portal Version: 1.0.0RC3
Typ Deines phpBB Forums: Standard phpBB3
MODs installiert: Ja
Dein Wissensstand: Einsteiger
Link zu Deinem Forum: http://jagdkommando.game-server.cc

PHP Version: 5.3.1
MySQL Version: 5.0.88

Was hast Du gemacht, bevor das Problem aufgetreten ist?


Was hast Du bereits versucht um das Problem zu lösen?


Fehlerbeschreibung und Nachricht
Guten Tag,

es ist ja so das wenn ich ein Thema als Bekanntmachung oder Globale Bekanntmachung eröffne es nicht mit unter den Aktuellen Beiträgen aufgeführt wird. Auch nicht wenn dort Antworten etc gepostet werden.
Ich weiß das das wohl so gewollt war und als Lösungsansatz hier schon gepostet wurde das man zu der Bekanntmachung noch einen Diskussionsthread erstellen solle.
Ich allerdings möchte es doch gerne so haben das auch Bekanntmachungen und Globale ... mit überprüft werden und bei den Aktuellen beiträgen angezeigt werden. Nur wie realisiere ich das? Leider habe ich dazu bisher nichts gefunden.

Mit freundlichen Grüßen

Marcel B.

Re: Neue Beiträge in Bekanntmachungen

Posted: 2. January 2010 18:02
by Marc
Ich glaube das hier sollte funktionieren:
Öffne portal/includes/functions.php
Finde (ca. Zeile 94):

Code: Select all

$global_f = 0; 
Ersetze mit:

Code: Select all

$global_f = 1; 

Re: Neue Beiträge in Bekanntmachungen

Posted: 3. January 2010 02:59
by AuroraXF
nein das bringt leider nichts. ich sehe auch gerade das ich im ersten Post vergessen habe anzugeben welche Portal Version ich habe. Es war zu dem Zeitpunkt 1.0.3 jetzt allerding nutze ich 1.0.4 falls dies relevant ist.

Mit freundlichen Grüßen

Re: Neue Beiträge in Bekanntmachungen

Posted: 4. January 2010 18:30
by Marc
Das oben war so überhaupt nicht korrekt, also bitte rückgängig machen.

Öffne portal/includes/functions.php
Finde:

Code: Select all

    switch( $type )
    {
        case "announcements":
            $topic_type = '(( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . '))';
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (t.forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : '';
            $user_link = 't.topic_poster = u.user_id';
            $post_link = 't.topic_first_post_id = p.post_id';
            $topic_order = 't.topic_time DESC';
        break;
        case "news":
            $topic_type = 't.topic_type = ' . POST_NORMAL;
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
            $user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
            $post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
            $topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
        break;
        case "news_all":
            $topic_type = '( t.topic_type <> ' . POST_ANNOUNCE . ' ) AND ( t.topic_type <> ' . POST_GLOBAL . ')';
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
            $user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
            $post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
            $topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
        break;
    } 
Ersetze mit:

Code: Select all

    switch( $type )
    {
        case "announcements":
            $topic_type = '(( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . '))';
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (t.forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : '';
            $user_link = 't.topic_poster = u.user_id';
            $post_link = 't.topic_first_post_id = p.post_id';
            $topic_order = 't.topic_time DESC';
        break;
        case "news":
            $topic_type = '((t.topic_type = ' . POST_NORMAL . ') OR ( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . '))';
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
            $user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
            $post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
            $topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
        break;
        case "news_all":
            $topic_type = '';
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
            $user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
            $post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
            $topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
        break;
    } 

Re: Neue Beiträge in Bekanntmachungen

Posted: 4. January 2010 20:54
by AuroraXF
Hm wenn ich das mache bekomme ich beim aufrufen der Seite folgenden Fehler

Code: Select all

SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND t.topic_status <> 2 AND t.topic_approved = 1 AND t.topic_moved_id = ' at line 37 [1064]

SQL

SELECT t.forum_id, t.topic_id, t.topic_last_post_id, t.topic_last_post_time, t.topic_time, t.topic_title, t.topic_attachment, t.topic_views, t.poll_title, t.topic_replies, t.topic_replies_real, t.topic_poster, t.topic_type, t.topic_status, t.topic_last_poster_name, t.topic_last_poster_id, t.topic_last_poster_colour, t.icon_id, u.username, u.user_id, u.user_type, u.user_colour, p.post_id, p.poster_id, p.post_time, p.post_text, p.post_attachment, p.post_username, p.enable_smilies, p.enable_bbcode, p.enable_magic_url, p.bbcode_bitfield, p.bbcode_uid, f.forum_name, f.enable_icons, tp.topic_posted FROM (phpbb_topics t) LEFT JOIN phpbb_users u ON (t.topic_poster = u.user_id) LEFT JOIN phpbb_forums f ON (t.forum_id=f.forum_id) LEFT JOIN phpbb_posts p ON (t.topic_first_post_id = p.post_id) LEFT JOIN phpbb_topics_posted tp ON (tp.topic_id = t.topic_id AND tp.user_id = 2) WHERE AND t.topic_status <> 2 AND t.topic_approved = 1 AND t.topic_moved_id = 0 ORDER BY t.topic_last_post_time DESC LIMIT 5

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: includes/db/mysql.php
LINE: 221
CALL: dbal_mysql->sql_query()

FILE: includes/db/dbal.php
LINE: 170
CALL: dbal_mysql->_sql_query_limit()

FILE: portal/includes/functions.php
LINE: 231
CALL: dbal->sql_query_limit()

FILE: portal/block/news.php
LINE: 26
CALL: phpbb_fetch_posts()

FILE: portal.php
LINE: 119
CALL: include('portal/block/news.php')
Mit freundlichen Grüßen

Re: Neue Beiträge in Bekanntmachungen

Posted: 10. January 2010 06:43
by AuroraXF
keine Lösung?
Kenne mich mit mysql nicht aus, sollte ich lieber im offiziellen phpbb Forum diesbezüglich nachfragen?

Re: Neue Beiträge in Bekanntmachungen

Posted: 20. January 2010 02:59
by AuroraXF
Durch den entstandenen mysql fehler, haben sich wohl weitere fehler in der Datenbank eingeschlichen und ich musste ein Backup einspielen.
Also schien das leider auch nicht so korrekt zu sein.
Muss ich wohl doch ein seperates Diskussionsthema zu Bekanntmachungen erstellen.
Trotzdem danke für den Versuch :D

MfG AuroraXF

Re: Neue Beiträge in Bekanntmachungen

Posted: 20. January 2010 10:57
by Marc
Also durch ein SELECT kann man eigentlich keine Datenbank Fehler verursachen, da man nur liest und nichts schreibt. :?

Re: Neue Beiträge in Bekanntmachungen

Posted: 30. March 2010 09:25
by JokerGSI
Hallo!

Gibt es hierfür keine Lösung?

Edit:

Auch hier hab ich mal selber probiert, ich weiß nicht bzw. ich glaube nicht, dass es die optimale Lösung ist, aber sie funktioniert:

Öffne portal/includes/functions.php

finde:

Code: Select all

case "news_all":
	$topic_type = '( t.topic_type <> ' . POST_ANNOUNCE . ' ) AND ( t.topic_type <> ' . POST_GLOBAL . ')';
	$str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
	$user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
	$post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
	$topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
break;
ersetze durch:

Code: Select all

case "news_all":
	$topic_type = '((t.topic_type = ' . POST_NORMAL . ') OR (t.topic_type = ' . POST_STICKY . ') OR (t.topic_type = ' . POST_ANNOUNCE . ') OR (t.topic_type = ' . POST_GLOBAL . '))';
	$str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
	$user_link = ($portal_config['portal_news_style']) ? 't.topic_poster = u.user_id' : (($portal_config['portal_news_show_last']) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
	$post_link = ($portal_config['portal_news_style']) ? 't.topic_first_post_id = p.post_id' : (($portal_config['portal_news_show_last']) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
	$topic_order = ($portal_config['portal_news_show_last']) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
break;
Geändert wird nur die $topic_type = Zeile. Hierbei wird ausgewählt welche Topic-Typen er auswählen soll. Wenn man die Zeile einfach raus löscht oder leer lässt gibts nen Fehler also habe ich einfach alle 4 Topic Typen rein geschrieben und immer mit OR verknüpft.

Edit2: Nicht vergessen im ACP unter Mods -> Aktuelle Beiträge den Punkt Zeige alle Beiträge dieses Forums: auf Ja zu setzen.

Re: Neue Beiträge in Bekanntmachungen

Posted: 28. July 2010 22:07
by 3nV|Tr0
Funktionieren tut es ohne das es nen Fehler bei mir gab ... Dachte schon das ich nen fehler beim update gemacht hatte .. aber nach dem ich gelesen habe das noch mehr leute das prob haben war ich beruhigt .)