Images from posts

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Get Involved
joe92
Registered User
Posts: 51
Joined: Sun Oct 04, 2015 1:04 pm

Images from posts

Post by joe92 »

Hi

after upgrade from version 3.24 to 3.3 this extension don't work

someone of goodwill could fix this extension for version 3.3

the source code are here

viewtopic.php?t=2274841

Thanks
PT-NGS-
Registered User
Posts: 28
Joined: Sun Jun 12, 2005 1:12 pm

Re: Images from posts

Post by PT-NGS- »

I have it..
It is a "special" mode that has been changed specifically for a forum.

Image
jonasj
Registered User
Posts: 120
Joined: Tue Jan 06, 2009 8:06 pm
Location: Stockholm, Sweden
Contact:

Re: Images from posts

Post by jonasj »

Did also like it too and had extension before 3.3 :|
fred_76
Registered User
Posts: 24
Joined: Thu Feb 05, 2015 7:35 pm

Re: Images from posts

Post by fred_76 »

This is exactly what I am looking for. Too bad this extension has been abandoned.

Such ability should be integrated in phpBB !

Fred
bttan
Registered User
Posts: 68
Joined: Mon Feb 16, 2015 4:37 pm

Re: Images from posts

Post by bttan »

PT-NGS- wrote:
Tue Jul 14, 2020 11:23 am
I have it..
It is a "special" mode that has been changed specifically for a forum.

Image
Hi is this a mod or extension? If it is an extension, can you show me the link to download?
bttan
Registered User
Posts: 68
Joined: Mon Feb 16, 2015 4:37 pm

Re: Images from posts

Post by bttan »

joe92 wrote:
Sun May 24, 2020 1:28 am
Hi

after upgrade from version 3.24 to 3.3 this extension don't work

someone of goodwill could fix this extension for version 3.3

the source code are here

viewtopic.php?t=2274841

Thanks
Hi, the original source is here https://github.com/bb3mobi/imgposts

This instruction from a user of the author forum is here http://bb3.mobi/forum/viewtopic.php?t=29&start=180

Quote " But i had problem too - i was updating on Centos php5.4 to 5.6, and i have not got installed all php mods soo " Images from posts "needs GD library after i installed php-gd" Images from posts "works

It continues to work fine on both 3.3.1 and 7.3
only in services.yml
A single quote is missing when preceeding either “@” or “%” "unQuote

So I changed the services.ymi to:-

services:
bb3mobi.imgposts.listener:
class: bb3mobi\imgposts\event\listener
arguments:
- '@template'
- '@config'
- '@dbal.conn'
- '%core.root_path%'
- '@bb3mobi.imgposts.helper'
tags:
- { name: event.listener }
bb3mobi.imgposts.helper:
class: bb3mobi\imgposts\core\helper
arguments:
- '@template'
- '@log'
- '@config'
- '@user'
- '@auth'
- '@dbal.conn'
- '%core.root_path%'
- '%core.php_ext%'

bb3mobi.imgposts.cron.task.tidy_images:
class: bb3mobi\imgposts\cron\task\tidy_images
arguments:
- '@config'
- '@log'
- '@user'
- '@template'
- '@auth'
- '@dbal.conn'
- '%core.root_path%'
- '%core.php_ext%'

calls:
- [set_name, [cron.task.core.bb3mobi_tidy_images]]
tags:
- { name: cron.task }

and the extension was successfully installed but after enabled, this problem:- (domain in bold and underlined was my website and i changed it to "domain")

General Error
SQL ERROR [ mysqli ]

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'domain.a.attach_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [1055]

SQL

SELECT a.attach_id, a.post_msg_id, a.extension, p.post_id, p.topic_id, p.post_time, p.post_visibility FROM phpbb_attachments a, phpbb_posts p WHERE a.post_msg_id = p.post_id AND (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif") AND p.post_visibility = 1 GROUP BY a.post_msg_id DESC LIMIT 9

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 1023
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 195
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/mysql_base.php
LINE: 45
CALL: phpbb\db\driver\mysqli->sql_query()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 296
CALL: phpbb\db\driver\mysql_base->_sql_query_limit()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 337
CALL: phpbb\db\driver\driver->sql_query_limit()

FILE: [ROOT]/ext/bb3mobi/imgposts/core/helper.php
LINE: 474
CALL: phpbb\db\driver\factory->sql_query_limit()

FILE: [ROOT]/ext/bb3mobi/imgposts/cron/task/tidy_images.php
LINE: 78
CALL: bb3mobi\imgposts\core\helper->clear_cache()

FILE: [ROOT]/ext/bb3mobi/imgposts/cron/task/tidy_images.php
LINE: 71
CALL: bb3mobi\imgposts\cron\task\tidy_images->cron_tidy_images()

FILE: [ROOT]/phpbb/cron/task/wrapper.php
LINE: 85
CALL: bb3mobi\imgposts\cron\task\tidy_images->should_run()

FILE: [ROOT]/phpbb/cron/manager.php
LINE: 128
CALL: phpbb\cron\task\wrapper->is_ready()

FILE: [ROOT]/phpbb/controller/helper.php
LINE: 362
CALL: phpbb\cron\manager->find_one_ready_task()

FILE: [ROOT]/phpbb/controller/helper.php
LINE: 315
CALL: phpbb\controller\helper->set_cron_task()

FILE: [ROOT]/includes/functions.php
LINE: 4257
CALL: phpbb\controller\helper->display_footer()

FILE: [ROOT]/index.php
LINE: 252
CALL: page_footer()


Anybody able to help?

This extension seems working fine in this forum http://apwa.ru/
bttan
Registered User
Posts: 68
Joined: Mon Feb 16, 2015 4:37 pm

Re: Images from posts

Post by bttan »

I googled this Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

and found the instruction https://dev.mysql.com/doc/refman/5.7/en ... dling.html

and I changed helper.php to these:-

$sql = 'SELECT min(p.post_id), min(p.topic_id), min(p.forum_id), min(p.post_text), min(p.post_subject), p.post_time, min(t.topic_id), min(t.topic_title)
FROM ' . POSTS_TABLE . ' p
LEFT JOIN ' . TOPICS_TABLE . ' t ON t.topic_id = p.topic_id
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
' . $sql_where . '
' . $sql_where_forbidden . '
' . $sql_where_topic . '
' . $sql_forum . '
AND p.post_visibility = 1
AND p.post_id = t.topic_first_post_id
ORDER BY p.post_time DESC';


$sql = 'SELECT min(a.attach_id), a.post_msg_id, min(a.physical_filename), min(a.real_filename), min(a.extension), min(a.filetime), min(t.topic_title)
FROM ' . ATTACHMENTS_TABLE . ' a, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t
' . $sql_where . '
AND (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND a.topic_id = t.topic_id
AND t.topic_first_post_id = a.post_msg_id
GROUP BY a.post_msg_id DESC';


$sql = 'SELECT min(post_id), min(post_text), post_time
FROM ' . POSTS_TABLE . ' p
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
AND post_visibility = 1
GROUP BY post_time
ORDER BY post_time DESC';


$sql = 'SELECT min(a.attach_id), a.post_msg_id, min(a.extension), min(p.post_id), min(p.topic_id), min(p.post_time), min(p.post_visibility)
FROM ' . ATTACHMENTS_TABLE . ' a, ' . POSTS_TABLE . ' p
WHERE a.post_msg_id = p.post_id
AND (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND p.post_visibility = 1
GROUP BY a.post_msg_id DESC';

and listener.php to these

$sql = 'SELECT p.post_id, min(p.topic_id), min(p.forum_id), min(p.post_text), min(t.topic_id), min(t.topic_title)
FROM ' . POSTS_TABLE . ' p
LEFT JOIN ' . TOPICS_TABLE . ' t ON t.topic_id = p.topic_id
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
AND t.topic_id = '. $tid . '
' . $sql_were . '
' . $sql_were_topic . '
GROUP BY p.post_id
ORDER BY p.post_id ASC';

$sql = 'SELECT min(physical_filename), min(extension), topic_id, min(post_msg_id)
FROM ' . ATTACHMENTS_TABLE . '
WHERE (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND ' . $this->db->sql_in_set('topic_id', $topic_ids) . '
GROUP BY topic_id
ORDER BY min(post_msg_id) ASC';

and the General Error SQL ERROR [ mysqli ] goes away

But what i get is only a no-photo.png on page 2 only.

Anybody has any idea?
User avatar
david63
Registered User
Posts: 19056
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Images from posts

Post by david63 »

First of all changing core files is not the correct way to do anything as you do not know what impact that will have in other areas of phpBB.

Secondly if you make those changes then you will need to reapply those changes after every update/upgrade (assuming that phpBB does not make some other changes)

Thirdly had you Googled correctly you would have found that it is a server configuration setting (sql_mode=onlY-full_group_by) that needs changing.
bttan wrote:
Tue Jan 26, 2021 12:00 pm
But what i get is only a no-photo.png on page 2 only.

Anybody has any idea?
Ask in the support topic for the extension.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
bttan
Registered User
Posts: 68
Joined: Mon Feb 16, 2015 4:37 pm

Re: Images from posts

Post by bttan »

Hi David,

Thanks for your reply.

"Thirdly had you Googled correctly you would have found that it is a server configuration setting (sql_mode=onlY-full_group_by) that needs changing."

This is very helpful.

Now I changed

Helper.php to:-

$sql = 'SELECT p.post_id, p.topic_id, p.forum_id, p.post_text, p.post_subject, p.post_time, t.topic_id, t.topic_title
FROM ' . POSTS_TABLE . ' p
LEFT JOIN ' . TOPICS_TABLE . ' t ON t.topic_id = p.topic_id
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
' . $sql_where . '
' . $sql_where_forbidden . '
' . $sql_where_topic . '
' . $sql_forum . '
AND p.post_visibility = 1
AND p.post_id = t.topic_first_post_id
ORDER BY p.post_time DESC, p.post_id, p.topic_id, p.forum_id, p.post_text, p.post_subject,t.topic_id, t.topic_title';

$sql = 'SELECT a.attach_id, a.post_msg_id, a.physical_filename, a.real_filename, a.extension, a.filetime, t.topic_title
FROM ' . ATTACHMENTS_TABLE . ' a, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t
' . $sql_where . '
AND (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND a.topic_id = t.topic_id
AND t.topic_first_post_id = a.post_msg_id
GROUP BY a.post_msg_id DESC, a.attach_id, a.physical_filename, a.real_filename, a.extension, a.filetime, t.topic_title';

$sql = 'SELECT post_id, post_text, post_time
FROM ' . POSTS_TABLE . ' p
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
AND post_visibility = 1
ORDER BY post_time DESC, post_id, post_text';

$sql = 'SELECT a.attach_id, a.post_msg_id, a.extension, p.post_id, p.topic_id, p.post_time, p.post_visibility
FROM ' . ATTACHMENTS_TABLE . ' a, ' . POSTS_TABLE . ' p
WHERE a.post_msg_id = p.post_id
AND (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND p.post_visibility = 1
GROUP BY a.post_msg_id DESC, a.attach_id, a.extension, p.post_id, p.topic_id, p.post_time, p.post_visibility ';

and listener to:-

$sql = 'SELECT p.post_id, p.topic_id, p.forum_id, p.post_text, t.topic_id, t.topic_title
FROM ' . POSTS_TABLE . ' p
LEFT JOIN ' . TOPICS_TABLE . ' t ON t.topic_id = p.topic_id
WHERE post_text '. $this->db->sql_like_expression($this->db->get_any_char() . $chars . $this->db->get_any_char()) . '
AND t.topic_id = '. $tid . '
' . $sql_were . '
' . $sql_were_topic . '
ORDER BY p.post_id ASC, p.topic_id, p.forum_id, p.post_text, t.topic_id, t.topic_title';

$sql = 'SELECT physical_filename, extension, topic_id, post_msg_id
FROM ' . ATTACHMENTS_TABLE . '
WHERE (mimetype = "image/jpeg" OR mimetype = "image/png" OR mimetype = "image/gif")
AND ' . $this->db->sql_in_set('topic_id', $topic_ids) . '
GROUP BY topic_id, physical_filename, extension, post_msg_id
ORDER BY post_msg_id ASC, physical_filename, extension, topic_id ';

and it is working.
bttan
Registered User
Posts: 68
Joined: Mon Feb 16, 2015 4:37 pm

Re: Images from posts

Post by bttan »

Dear PHPBB Team,

This extension by Registered User Anv@r.all is working fine, at least on my board, except some syntax issues due to updated sql version.

And I have corrected them and I would like to submit this extension for validation for the common good of the phpbb community.

My questions are:-

1. where to upload the updated zip file to phpbb?

2. How to submit to phpbb for validation?

I do not have any knowledge of programming but I do hope this extension will be supported by the members of the community who are interested in this extension.
bttan
Registered User
Posts: 68
Joined: Mon Feb 16, 2015 4:37 pm

Re: Images from posts

Post by bttan »

mystery solved - why block scrolling images are not moving?

Maximum number of images in block was set to 9 by default and h/phone has 2 images in the block when phone is held vertically and 4 images horizontally and the block images are scrolling.

On computer, the screen is wide and i have 8 images in the block on the screen and the block is not scrolling.

so i set Maximum number of images in block to 10 and it is scrolling both on my handphoe and computer.
ivma
Registered User
Posts: 3
Joined: Sun Jan 17, 2021 8:12 am

Re: Images from posts

Post by ivma »

Hi, where can I find your extension to try it out on my forum?
Thank you
bttan
Registered User
Posts: 68
Joined: Mon Feb 16, 2015 4:37 pm

Re: Images from posts

Post by bttan »

Hi,

This is not my extension. This is Registered User Anv@r.all's extension.

This extension is not validated by phpbb and not supported by any developers.

Install at your own risk.

https://github.com/bttan39/images-from-posts

for my board image type is set to all
bttan
Registered User
Posts: 68
Joined: Mon Feb 16, 2015 4:37 pm

Re: Images from posts

Post by bttan »

bttan wrote:
Thu Feb 04, 2021 11:44 am
mystery solved - why block scrolling images are not moving?

Maximum number of images in block was set to 9 by default and h/phone has 2 images in the block when phone is held vertically and 4 images horizontally and the block images are scrolling.

On computer, the screen is wide and i have 8 images in the block on the screen and the block is not scrolling.

so i set Maximum number of images in block to 10 and it is scrolling both on my handphoe and computer.
programmatically speaking, this is not a right way to fix a code so I googled again and found this tutorial https://www.html.am/html-codes/marquees ... -image.cfm

while comparing the code, i found a typo error in the css file and i changed to:-

#scroll-jq {
max-width: 1200px;
margin-top: -12px; /* Top -12 ??? */
position: relative;
padding: 0;
left: 0;
margin: 0 auto;
}
Post Reply

Return to “Extension Requests”