3.2: Latest topics on external homepage

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
beta5
Registered User
Posts: 24
Joined: Sun Jun 10, 2018 8:54 am

3.2: Latest topics on external homepage

Post by beta5 » Thu Jun 21, 2018 8:03 pm

Hello: I want to show the titles and dates of the latest topics (topics with the latest post). I found this tutorial (with is mentioned quiete often):

https://wiki.phpbb.com/Practical.Displa ... rnal_pages

But it seems to be not suitable for phpBB 3.2 as I always get an error.
Allgemeiner Fehler
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 topic_status <> 2 AND topic_visibility = 1 ORDER B' at line 3 [1064]

Beim Laden der Seite ist ein SQL-Fehler aufgetreten. Bitte kontaktiere die Board-Administration, falls dieses Problem fortlaufend auftritt.
The example 1 or the the example 2 should provide the necessary information for my purpose.

I assume the problem is somewhere in the code block functions. This block is not necessary for example 4 and that does work (see also http://www.cricketmx.com/articles/read/ ... in-phpbb3/).

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3297
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: 3.2: Latest topics on external homepage

Post by kasimi » Sat Jun 30, 2018 1:25 pm

What's the complete value of your SQL query (the $topics variable in example 1)?

beta5
Registered User
Posts: 24
Joined: Sun Jun 10, 2018 8:54 am

Re: 3.2: Latest topics on external homepage

Post by beta5 » Thu Jul 05, 2018 5:44 pm

I do not understand your question. As described above, I simply put the code into a file and upload it and then get that error message in the browser.

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3297
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: 3.2: Latest topics on external homepage

Post by kasimi » Thu Jul 05, 2018 6:26 pm

You need to define $forum_id_where to formulate a correct SQL query, for example:

Code: Select all

$forum_id_where = 'WHERE topic_id = 123';

beta5
Registered User
Posts: 24
Joined: Sun Jun 10, 2018 8:54 am

Re: 3.2: Latest topics on external homepage

Post by beta5 » Thu Jul 05, 2018 7:39 pm

Why not use the code that is listed there and simply adapt the forum_id and topic_id and leave in blank for example which is explained to mean no restrictions on topics or forums.

Code: Select all

$search_limit = 5;

    $forum_id = array();
    $forum_id_where = create_where_clauses($forum_id, 'forum');

    $topic_id = array();
    $topic_id_where = create_where_clauses($topic_id, 'topic');

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 4 guests