SimplePortal

Support => English Support => Topic started by: ramzesito on January 25, 2016, 02:47:21 AM

Title: Incorrect pagination in articles
Post by: ramzesito on January 25, 2016, 02:47:21 AM
Hello,
help to solve my problem, please:

I have some articles on my portal (www.sportgen.ru),
Maximum Articles Per Page set to 4,

I noticed if Author is not me (Ramzesito), second admin is Malex, then folowing articles after his article on curernt page are not displayed  :(
error log is empty

thank you
Title: Re: Incorrect pagination in articles
Post by: emanuele on January 25, 2016, 06:08:39 PM
Which one is the articles block?
Is the one with the title "Сертификаты на Обнинских(Калужских) гонках"?
Title: Re: Incorrect pagination in articles
Post by: ramzesito on January 26, 2016, 02:36:54 AM
Which one is the articles block?
Is the one with the title "Сертификаты на Обнинских(Калужских) гонках"?

yes , it is a first article, but there are 3 more after it, but they are invisible (approved),
page2 shows 5,6,7,8 articles and so on...
Title: Re: Incorrect pagination in articles
Post by: emanuele on January 26, 2016, 04:07:14 PM
Would you mind taking a screenshot (in English please) of the configuration page of the block?
Title: Re: Incorrect pagination in articles
Post by: ramzesito on January 27, 2016, 04:09:49 AM
here are (see attach)
Title: Re: Incorrect pagination in articles
Post by: Burke Knight on January 27, 2016, 07:20:32 AM
I think he meant the configuration of the article block.
But what you posted, is also good info, too. :)
Title: Re: Incorrect pagination in articles
Post by: emanuele on January 28, 2016, 02:22:31 AM
Yep, the configuration of the block.
Title: Re: Incorrect pagination in articles
Post by: ramzesito on January 28, 2016, 02:06:26 PM
Sorry, I don't understand,
there are such type of blocks in config: Header, Left, Right, Top, Bottom, Footer.
Articles is absent  :o
To create an article I click in the topic - Add as article...
Title: Re: Incorrect pagination in articles
Post by: emanuele on January 29, 2016, 04:47:42 AM
The one that you created and that is causing problems, go to modify that block:
* go to the list of blocks you have (admin > simple portal > blocks)
* find the block that is causing problems,
* click on the (http://www.italiansmf.net/forum/Themes/premiummgc/images/sp/modify.png) icon
* and take a screenshot of the page.
Title: Re: Incorrect pagination in articles
Post by: ramzesito on January 29, 2016, 12:59:56 PM
emanuele, are you SP developer?
are you sure that ArticleBlock is exist?
I can't find it,
I see just Header, Left, Right, Top, Bottom, Footer blocks

Burke Knight, am I not right?
Title: Re: Incorrect pagination in articles
Post by: Burke Knight on January 29, 2016, 09:54:04 PM
No, you are not.
You have a block set up, so in the listing of blocks, you should be able to find the one with the name of your articles block.
Looks like it is either under the Top blocks section, or maybe at top of the Bottom blocks section.
I am unable to determine which.
Title: Re: Incorrect pagination in articles
Post by: ramzesito on January 30, 2016, 01:56:34 PM
is it?
Title: Re: Incorrect pagination in articles
Post by: Burke Knight on January 30, 2016, 06:09:41 PM
I do not see an articles block listed in there.
A Board news is, but deactivated.
Looks like your articles block, is done maybe as a custom BBC block, but not sure, maybe the one named News For Portal Only.
Unsure if that is it, since not know your language, or all the blocks there.
Title: Re: Incorrect pagination in articles
Post by: emanuele on January 31, 2016, 05:30:43 AM
are you sure that ArticleBlock is exist?
I mentioned "articles" because you wrote articles in your first message.
I cannot know if you found some "article" block around the forum here, or at sm.org, or somewhere on the internet.

That's why I asked you for the picture of "The [block] that is causing problems".
Judging from the look of it, it may be the "Board News", even though it looks disabled.

I need to see the configuration of this particular block that is not working the way you want.
Maybe [SiNaN], knowing SP much better than me could give you an answer without that information, but I don't know what suggest you without... :(
Title: Re: Incorrect pagination in articles
Post by: ramzesito on February 01, 2016, 08:03:18 AM
Dear colleagues,
I tested a second forum and portal (the same versions)
http://www.sportgen.ru/forumtest/

I deactivated all central blocks, as you can see in attach
and as you can see , that portal shows articles anyway

So, I see, that Articles shown are not depend on any block in configuration  :0

May be, we need to consult some more advanced user (or admin) of Simple Portal?
Title: Re: Incorrect pagination in articles
Post by: Burke Knight on February 01, 2016, 12:04:42 PM
You do not get more "advanced" than a developer, answering your questions, like Emanuele is. XD

Please, post all from the Articles settings page, then.
Seems we were under the impression that the articles section was done as a block, as is usually how people set it up.
Title: Re: Incorrect pagination in articles
Post by: emanuele on February 01, 2016, 04:30:07 PM
Well, even though I'm a developer I don't know for sure all the SP internals.
So other may very well know much more than I do. ;)
Title: Re: Incorrect pagination in articles
Post by: ramzesito on February 03, 2016, 01:03:39 AM
Well, even though I'm a developer I don't know for sure all the SP internals.

Emanuele,
so, who is the super man, who are coding SP internals by his own hands?
Who can explain how *.php file is working and processing data from SQL database?

Now I see just administration support, not programming  :(
Title: Re: Incorrect pagination in articles
Post by: ♦ Ninja ZX-10RR ♦ on February 03, 2016, 02:02:56 AM
Can we please stay on topic? It derailed from trying to describe and solve the problem to who is doing what about SimplePortal. Kindly try to describe what is the problem as per the requests above.

As for the off-topic, emanuele knows the code pretty well, he is just being humile, he always is. However, the main coder is [SiNaN], who hasn't been on for a while.
Title: Re: Incorrect pagination in articles
Post by: ramzesito on February 03, 2016, 02:17:28 PM
Ninja,
my problem was described at first post:

Not all articles displayed on pages (must be 4 per page),
now it may be 1, 2, 3, or 4...
I noticed that articles disappear after article by author Malex only

I have been told to check an ArticleBlock config, but it is not exist in my SP version (2.3.6),

I am ready to check a php-code step-by-step to reveal a bug

help me, please

Title: Re: Incorrect pagination in articles
Post by: Burke Knight on February 03, 2016, 03:58:31 PM
Please, post all from the Articles settings page, then.
Seems we were under the impression that the articles section was done as a block, as is usually how people set it up.
Title: Re: Incorrect pagination in articles
Post by: emanuele on February 04, 2016, 12:46:03 PM
So much for not knowing articles are displayed in the home page when "enable articles" is checked.

What we know up until now is that when the article are shown on the portal page, some may be missing (see the OP (http://simpleportal.net/index.php?topic=14265.msg71100#msg71100)).

Why articles do not show up?
I have close to no idea.

But, looking carefully (see the attachment) in some articles malex is colored in red (admin groun), in others is not.
So a question arises: could it be you did some change somewhere in the past to the way articles are picked and shown?
Do you have other mods installed?
Title: Re: Incorrect pagination in articles
Post by: [SiNaN] on February 04, 2016, 05:07:17 PM
This looks quite curious indeed. I don't see why something like this should ever happen unless some other mod or modification is doing something unusual, but you never know!

In addition to emanuele's questions; please attach the following files from your forum for starters: ./Sources/PortalArticles.php and ./Themes/default/PortalArticles.template.php
Title: Re: Incorrect pagination in articles
Post by: ramzesito on February 05, 2016, 04:32:36 PM
In addition to emanuele's questions; please attach the following files from your forum for starters: ./Sources/PortalArticles.php and ./Themes/default/PortalArticles.template.php

SiNaN, thank you for forwarding me  :nervous-happy:

I carefully checked PortalArticles.php,
exactly the code:

Code: [Select]
$article_request = $smcFunc['db_query']('','
SELECT
a.id_article, a.id_category, a.id_message, a.approved, c.name as cname, c.picture, m.id_member,
IFNULL(mem.real_name, m.poster_name) AS poster_name, m.icon, m.subject, m.body, m.poster_time,
m.smileys_enabled, t.id_topic, t.num_replies, t.num_views, t.locked, b.id_board, b.name as bname,
mem.avatar, at.id_attach, at.attachment_type, at.filename
FROM {db_prefix}sp_articles AS a
INNER JOIN {db_prefix}sp_categories AS c ON (c.id_category = a.id_category)
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_message)
INNER JOIN {db_prefix}topics AS t ON (t.id_first_msg = a.id_message)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
LEFT JOIN {db_prefix}attachments AS at ON (at.id_member = mem.id_member)
WHERE {query_see_board}
AND a.approved = {int:approved}
AND publish = {int:publish}
ORDER BY a.id_message DESC' . (empty($modSettings['articleperpage']) ? '' : '
LIMIT {int:start}, {int:end}'),
array(
'approved' => 1,
'publish' => 1,
'start' => $context['start'],
'end' =>  $modSettings['articleperpage'],
)
);

I run it as test and saw dublicated rows for Malex...

Some time ago I changed Avatars folder on server for users,
The snag - Malex had 2 avatars in attachments table, see attach,
I don't know which bug is it in Articles, SMF or SP,
but after deletion a dublicate I got a right Article visualisation!  :nervous-happy:

I'm very glad!

Thank you all for help
Title: Re: Incorrect pagination in articles
Post by: emanuele on February 07, 2016, 03:59:45 PM
Track when the second avatar was added may be rather tricky indeed.
Judging by the look of the name, the "old" avatar is pre-2.0 RC1-1, while the other is post.
Probably something happened and SMF was not able to drop the old one in favour of the new and things got messed up.
Title: Re: Incorrect pagination in articles
Post by: mariakatosvich on August 05, 2016, 07:13:25 AM
yes , it is a first article, but there are 3 more after it, but they are invisible (approved),
page2 shows 5,6,7,8 articles and so on...
SimplePortal 2.3.8 © 2008-2024, SimplePortal