SimplePortal

Support => Install and Upgrade => Topic started by: patalete on October 18, 2009, 05:48:54 PM

Title: Complete forum index being showed in Portal.(?)
Post by: patalete on October 18, 2009, 05:48:54 PM
This is kinda weirdo...

We were running SMF RC 1.2 with SP 2.2.2 without problems and errors.

Today we went through the update to SP 2.3.1 so we uninstalled 2.2.2 first, cleanup some missing lines from index.php to allow forum work as regular SMF.

Installed SP 2.3.1 with some lines error at installation..

exactly at ./sources/subs.php
Find
Code: [Select]
// Action and board are both empty... BoardIndex!Replace
Code: [Select]
// Go catch it boy! Catch it!
$sp_action = sportal_catch_action();
if ($sp_action)
return $sp_action;

// Action and board are both empty... BoardIndex!


That lines couldnt be added with pacakge installer and cant find a place to add them manually.

After installation now the  Portal is showing the blocks as usual but now between the articles and the footer, it is showing the complete "forum" index layout making the portal page awfull large and long..

We never had that layout before with 2.2.2 and it seems there are no option to enable/disable that behaviour so I assume is something worng/missing in index.php  itself...

Here you can see the site, thepsyfamily.net, basically we just want the portal (Home) with the articles and blocks but not with the whole forum showing there below articles...
Im at a dead point now so where to look now in order to fix it?

Also we are getting some error in logs like
Code: [Select]
: Undefined index: sp-make_article

File: html/forum/Themes/psythemev1/Display.template.php (main sub template - eval?)
Line: 648

or

Code: [Select]
8: Undefined index: can_make_article

File: /html/forum/Themes/psythemev1/Display.template.php (main sub template - eval?)
Line: 130

thanks
Title: Re: Complete forum index being showed in Portal.(?)
Post by: Norv on October 18, 2009, 06:03:50 PM

Installed SP 2.3.1 with some lines error at installation..

exactly at ./sources/subs.php
Find
Code: [Select]
// Action and board are both empty... BoardIndex!Replace
Code: [Select]
// Go catch it boy! Catch it!
$sp_action = sportal_catch_action();
if ($sp_action)
return $sp_action;

// Action and board are both empty... BoardIndex!


That lines couldnt be added with pacakge installer and cant find a place to add them manually.


Note that the code above cannot be found in Subs.php, but instead, in index.php from the forum directory.
Please open index.php from the forum directory and replace manually the lines as exactly you say above.
Title: Re: Complete forum index being showed in Portal.(?)
Post by: patalete on October 18, 2009, 06:39:24 PM
yeah thats right,
but where are supposed those lines to be added...cause the reference line its not present in our index.php

and any idea about the other errors codes? most of them are happening with guests...

---edit---

Found the place from older backups...now it seems to be working...
will keep an eye on it and check for errors.

thanks

btw simplemachines package parser says SP 2.3.1 its not compatible with RC1.2 when tryin to execute it in order to see the code changes.
Title: Re: Complete forum index being showed in Portal.(?)
Post by: Nathaniel on October 19, 2009, 01:40:30 AM
Did you manage to resolve all the errors?

btw simplemachines package parser says SP 2.3.1 its not compatible with RC1.2 when tryin to execute it in order to see the code changes.

Unfortunately the SMF customization site uses a version of the package version detection function (from the SMF 2RC2 Charter Release) that has some issues, so it won't parse SP 2.3.1 (or 2.3) for SMF 2RC1.2, despite the fact that SimplePortal installs fine for SMF 2RC1.2.
Title: Re: Complete forum index being showed in Portal.(?)
Post by: patalete on October 19, 2009, 10:09:33 AM
I see you guys are aware of that issue. :)

About the undefinex errors  there have been like 12hrs since last one appeared in logs. so by now seems to be running Ok.

now derrailing... how its supposed I can configure the layout of articles in portal? so it show articles from All categories based on posting dates and without grouping them by categories into blocks?
Title: Re: Complete forum index being showed in Portal.(?)
Post by: Nathaniel on October 20, 2009, 04:21:20 AM
now derrailing... how its supposed I can configure the layout of articles in portal? so it show articles from All categories based on posting dates and without grouping them by categories into blocks?

At the moment, doing that would require some hard-coded edits. Although the point of articles, is that you can choose which topics are articles and limit the number shown on the portal. So you should be able to have only the latest articles/news on the portal, either by restricting the number of articles that are shown, or by removing old articles (removing them as articles, not as topics).
Title: Re: Complete forum index being showed in Portal.(?)
Post by: patalete on October 20, 2009, 05:22:15 AM
Yep I understand the point of having them categorized and grouped together.

but when you browse a site you understand that the deeper you go scrolling the older the news are..

but in SP case..if You keep scrolling down you keep finding newer articles mixed with older ones....

Not all people always realize about the new articles in different categories.

This is my case I feel it not "natural" and people miss articles due think they have already read them all, seeing that the first one haven't changed but that maybe there is another one that is new into other category that its not showing up in the initial screen without scrolling down... ;P

Also as every category has its own custom Icon it makes it easy to identify whether that article belongs to in case of having all categories mixed and sorted only by date.

then I must request this feature to be available in future versions by default  ;D
If not a long and hard change in code could you point out how to do it?
 Im willing to try it if you can tell me how it would be..

something like,
Sort portal articles based on Date / Sort portal articles based on date & grouped by category.


thanks
Title: Re: Complete forum index being showed in Portal.(?)
Post by: Nathaniel on October 20, 2009, 05:33:06 AM
Hmm, okay I see what you mean.

Although each category can have its own custom image, so that should help people to know where each article comes from.

How would you want to group articles by category? Grouping by category and keeping them in the same list would make it confusing as old articles from a certain category would come before newer articles from a different category.

I think the best way to archieve what you want, would be to have separate lists, one for each category. Or something similar.
Title: Re: Complete forum index being showed in Portal.(?)
Post by: patalete on October 20, 2009, 01:03:56 PM
dunno if I really explained myself what I had on mind, english is not my mother language.

lets try visually :P

say we have cataegories: A, B, C...
say the articles dates: 1,2,3,4... (bigger means newer)

so currently SP does this..

A4
A3
A2
A1
---
B3
B2
B1
---
C2
C1

so if you have set to show 3 articles per category you will be seeing 3x3=9 articles in 3 different blocks.

what I do would like to see is

A4
B4
C4
A3
C3
B3
C2
A2
B2
.....

so If I set a maximum of ..say..6 articles on portal..it will show only the 6 msot recent ones even if they belong to different categories..

Like any other regular blog style...all would be shown in portal  only one list.

so what really matters is the article date no matter the category as it will be visible with its own custom icon and maybe then if you click the category icon you will be lead to a new page with category articles also sorted by date from newer to older..

better now? :D
Title: Re: Complete forum index being showed in Portal.(?)
Post by: Nathaniel on October 20, 2009, 10:33:49 PM
I believe that the edit below does what you want, or at least its similar. Basically, you can set how many articles you want per page. The first page will show the latest 6 articles, the second page the next 6 articles, etc. On each page, the 6 relevant articles will be sorted by category.

Replace this code (sources/PortalArticles.php):
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'],
)
);

With this code:
Code: [Select]
$article_id_request = $smcFunc['db_query']('','
SELECT
a.id_article
FROM {db_prefix}sp_articles AS a
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_message)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
INNER JOIN {db_prefix}sp_categories AS c ON (c.id_category = a.id_category)
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'],
'guest' => 0,
)
);
$article_ids = array();
while($row = $smcFunc['db_fetch_assoc']($article_id_request))
$article_ids[] = $row['id_article'];
$smcFunc['db_free_result']($article_id_request);

$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 a.id_article IN ({array_int:articles})
ORDER BY a.id_category',
array(
'approved' => 1,
'publish' => 1,
'start' => $context['start'],
'end' =>  $modSettings['articleperpage'],
'articles' => $article_ids,
)
);
Title: Re: Complete forum index being showed in Portal.(?)
Post by: patalete on October 21, 2009, 05:37:33 AM
OMG so fast :D

Will be adding the changes later today and report back with results.

Thank you :)

---edit---

got some time to perform the changes now..
 and it seems to be working fine and without errors or warnings, except for the articles being sorted by date from older (top) to newer (bottom) instead newer in top of portal and older at the bottom

Also still the sorting by category its not exactly what I mean..

after the previous edits, we have 3 categories currently at portal,(News,Technology, Games) layout is as this:

News-Newer
News-Old
News-Older
----
Tech-Older
Tech-Old
Tech-New
Games-Older
Games-Old
Games-New
Title: Re: Complete forum index being showed in Portal.(?)
Post by: Nathaniel on October 22, 2009, 01:33:32 AM
For the last query, change this:
Code: [Select]
ORDER BY a.id_categoryTo this:
Code: [Select]
ORDER BY a.id_category, a.id_message DESC
That will ensure that the articles on each page are listed by category then age.
Title: Re: Complete forum index being showed in Portal.(?)
Post by: patalete on October 22, 2009, 06:25:01 AM
Thats (90%) it!  >:-D

I finally got what we were thinking of:

Find:
Code: [Select]
ORDER BY a.id_category, a.id_message DESCReplace:
Code: [Select]
ORDER BY a.id_message DESC, a.id_category
 8)

thank you!

I think more people could be interested in this style of Articles layout..would be cool having it available from an option at SP Admin settings or something :P
Title: Re: Complete forum index being showed in Portal.(?)
Post by: Nathaniel on October 23, 2009, 01:38:57 AM
Well, as far as I can see, performing that edit, will just make it sort by the age of the article regardless of the category... Which means it should be the same as leaving the function unedited.
Title: Re: Complete forum index being showed in Portal.(?)
Post by: patalete on October 24, 2009, 07:57:42 AM
yep but with the last edit done articles started sorting in a different way of "sorted by date" than without the edit..and that was the behaviour we were looking for :)

or maybe I were too sleepy to notice it in previous edits. :P

thanks
SimplePortal 2.3.8 © 2008-2024, SimplePortal