...to update on this, that is on the way bite by bite ...
All has already done, except the more easy output html/css part. Let me write right now what the shortcode will do (so i will paste this explain into documentation as the shortcode has been added and will be ready) ...
Little hard for my Eng to say all what i would like about this, but i will try with a practical example ...
The result can be achieved in various ways, but the fact i said we want all latest updated topics grabbed by the phpBB database in one single query, and with the first attached file on this topic, to display, the new
shortcode will be like this:
Code: Select all
[w3allastopicswithimage cat_id="1" topics_number="5" post_text="1" text_words="30" columns_number="2"]
and will produce this result:
Retrieve all latest topics from sub forums which
belongs to the specified Forum Cat with ID 1
Retrieve last 5 updated topics/posts
With post text
With 30 words
In two columns
The
columns_number param is useful to show more columns per row.
and behind the scene, the code require:
The topic need to have almost an attachment: the query search for all latest updated topics WITH ALMOST ONE ATTACHMENT ON HIS POSTS. Only the first attachment added into the topic will be retrieved to be used as image to display into the WP shortcode output. The attach can be added into any post, BUT ONLY THE ONE THAT WILL RESULT AS THE FIRST ONE ATTACHED (based on related attachments
time value) will be retrieved to display. That so, could be inserted into any topic's posts and not only into the first.
the query will return any kind of attach that is the first inserted on topic, so we need to check also this aspect maybe? If the first attach that belong to the topic isn't an image for example? Or we could assume that using this kind of shortcode, we will go to attach to the topic, ever, for first, an image to display and not some other kind of mime like a .zip or something else. But could be useful any mime, with a file to download, if it is a zip or something else.
... i will follow improving for a more complicate query as i can.
At moment, resuming with another example, this is the result:
Suppose there are forums with
ID-5 and ID-9, that are sub-forums and belongs to the Forum Category with
ID-1.
Then will be retrieved all latest updated topics from forums with ID-5 and ID-9,
that will contain ALMOST one attachment into any of their posts.
ONLY the first inserted attachment will be retrieved to be used and that will display for the post/topic into the WordPress
w3allastopicswithimage shortcode.
As soon i can i will adjust the new file
phpbb_last_topics_withimage_output_shortcode.php to display results in a (i hope) nice way. I will try to make this file easier to be modified for own scopes.
...to update on this, that is on the way bite by bite ...
All has already done, except the more easy output html/css part. Let me write right now what the shortcode will do (so i will paste this explain into documentation as the shortcode has been added and will be ready) ...
Little hard for my Eng to say all what i would like about this, but i will try with a practical example ...
The result can be achieved in various ways, but the fact i said we want all latest updated topics grabbed by the phpBB database in one single query, and with the first attached file on this topic, to display, the new [i]shortcode[/i] will be like this:
[code][w3allastopicswithimage cat_id="1" topics_number="5" post_text="1" text_words="30" columns_number="2"][/code]
and will produce this result:
Retrieve all latest topics from sub forums which [b]belongs to the specified Forum Cat with ID 1[/b]
Retrieve last 5 updated topics/posts
With post text
With 30 words
In two columns
The [i]columns_number[/i] param is useful to show more columns per row.
[b]and behind the scene, the code require:[/b]
The topic need to have almost an attachment: the query search for all latest updated topics WITH ALMOST ONE ATTACHMENT ON HIS POSTS. Only the first attachment added into the topic will be retrieved to be used as image to display into the WP shortcode output. The attach can be added into any post, BUT ONLY THE ONE THAT WILL RESULT AS THE FIRST ONE ATTACHED (based on related attachments [i]time[/i] value) will be retrieved to display. That so, could be inserted into any topic's posts and not only into the first.
the query will return any kind of attach that is the first inserted on topic, so we need to check also this aspect maybe? If the first attach that belong to the topic isn't an image for example? Or we could assume that using this kind of shortcode, we will go to attach to the topic, ever, for first, an image to display and not some other kind of mime like a .zip or something else. But could be useful any mime, with a file to download, if it is a zip or something else.
... i will follow improving for a more complicate query as i can.
At moment, resuming with another example, this is the result:
Suppose there are forums with [b]ID-5 and ID-9[/b], that are sub-forums and belongs to the Forum Category with [b]ID-1[/b].
Then will be retrieved all latest updated topics from forums with ID-5 and ID-9, [b]that will contain ALMOST one attachment into any of their posts.[/b]
ONLY the first inserted attachment will be retrieved to be used and that will display for the post/topic into the WordPress [i]w3allastopicswithimage shortcode[/i].
As soon i can i will adjust the new file [i]phpbb_last_topics_withimage_output_shortcode.php[/i] to display results in a (i hope) nice way. I will try to make this file easier to be modified for own scopes.