Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

December 08, 2021, 06:10:56 AM

Login with username, password and session length
Members
  • Total Members: 3831
  • Latest: pulgoki
Stats
  • Total Posts: 192617
  • Total Topics: 21020
  • Online Today: 152
  • Online Ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 44
Total: 44

Author Topic: Categories on Frontpage Bug&Fix  (Read 5465 times)

0 Members and 1 Guest are viewing this topic.

Offline hidden69

  • Jr. Member
  • **
  • Posts: 9
    • Treasure Trove
Categories on Frontpage Bug&Fix
« on: October 29, 2010, 09:54:10 PM »
Hi,

if you have more then 1 categorylist in a block f.e. on the frontpage, then only the last one is shown. To fix this find in the TPortal.php

Code: [Select]
  // any cat listings from blocks?
    if(isset($test_catbox) && $fetchtitles!='')
{
$request =  tp_query("SELECT art.id, art.subject, art.date, art.category, art.author_id as authorID, art.shortname,
IFNULL(mem.real_name,art.author) as realName FROM " . $tp_prefix . "articles AS art
LEFT JOIN " . $db_prefix . "members AS mem ON (art.author_id = mem.id_member)
WHERE " . $fetchtitles . "
AND art.off=0
AND ((art.pub_start=0 AND art.pub_end=0) OR (art.pub_start!=0 AND art.pub_start<".$context['tportal']['now']." AND art.pub_end=0) OR (art.pub_start=0 AND art.pub_end!=0 AND art.pub_end>".$context['tportal']['now'].") OR (art.pub_start!=0 AND art.pub_end!=0 AND art.pub_end>".$context['tportal']['now']." AND art.pub_start<".$context['tportal']['now']."))
AND art.approved=1", __FILE__, __LINE__);

$context['TPortal']['blockarticle_titles']=array();

and replace it with
Code: [Select]
  // any cat listings from blocks?
    if(isset($test_catbox) && $fetchtitles!='')
{
$request =  tp_query("SELECT art.id, art.subject, art.date, art.category, art.author_id as authorID, art.shortname,
IFNULL(mem.real_name,art.author) as realName FROM " . $tp_prefix . "articles AS art
LEFT JOIN " . $db_prefix . "members AS mem ON (art.author_id = mem.id_member)
WHERE " . $fetchtitles . "
AND art.off=0
AND ((art.pub_start=0 AND art.pub_end=0) OR (art.pub_start!=0 AND art.pub_start<".$context['tportal']['now']." AND art.pub_end=0) OR (art.pub_start=0 AND art.pub_end!=0 AND art.pub_end>".$context['tportal']['now'].") OR (art.pub_start!=0 AND art.pub_end!=0 AND art.pub_end>".$context['tportal']['now']." AND art.pub_start<".$context['tportal']['now']."))
AND art.approved=1", __FILE__, __LINE__);

if (!$context['TPortal']['blockarticle_titles']){
$context['TPortal']['blockarticle_titles']=array();
}

another fix, where the realname of the author isnt shown on the frontpage, is fixed by

find this in the TPortal.php
Code: [Select]
    if(isset($test_catbox) && $fetchtitles!='')
{
$request =  tp_query("SELECT art.id, art.subject, art.date, art.category, art.author_id as authorID, art.shortname,
IFNULL(mem.real_name,art.author) as real_name FROM " . $tp_prefix . "articles AS art
LEFT JOIN " . $db_prefix . "members AS mem ON (art.author_id = mem.id_member)
WHERE " . $fetchtitles . "
AND ((art.pub_start=0 AND art.pub_end=0) OR (art.pub_start!=0 AND art.pub_start<".$context['tportal']['now']." AND art.pub_end=0) OR (art.pub_start=0 AND art.pub_end!=0 AND art.pub_end>".$context['tportal']['now'].") OR (art.pub_start!=0 AND art.pub_end!=0 AND art.pub_end>".$context['tportal']['now']." AND art.pub_start<".$context['tportal']['now']."))
AND art.off=0
AND art.category>0
AND art.approved=1", __FILE__, __LINE__);

and replace it with
Code: [Select]
    if(isset($test_catbox) && $fetchtitles!='')
{
$request =  tp_query("SELECT art.id, art.subject, art.date, art.category, art.author_id as authorID, art.shortname,
IFNULL(mem.real_name,art.author) as realName FROM " . $tp_prefix . "articles AS art
LEFT JOIN " . $db_prefix . "members AS mem ON (art.author_id = mem.id_member)
WHERE " . $fetchtitles . "
AND ((art.pub_start=0 AND art.pub_end=0) OR (art.pub_start!=0 AND art.pub_start<".$context['tportal']['now']." AND art.pub_end=0) OR (art.pub_start=0 AND art.pub_end!=0 AND art.pub_end>".$context['tportal']['now'].") OR (art.pub_start!=0 AND art.pub_end!=0 AND art.pub_end>".$context['tportal']['now']." AND art.pub_start<".$context['tportal']['now']."))
AND art.off=0
AND art.category>0
AND art.approved=1", __FILE__, __LINE__);

Annotation:
Maybe the "Display Author" setting from the respective article should be used, to print or not print the author (as this can be a valid feature request).

regards

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Categories on Frontpage Bug&Fix
« Reply #1 on: June 15, 2011, 04:38:33 AM »
Not working, still on my frontpage news are from only one category (I have selected 3 of them) ;/

Offline IchBin

  • Developer
  • *
  • Posts: 16231
Re: Categories on Frontpage Bug&Fix
« Reply #2 on: June 15, 2011, 11:52:42 AM »
I've added in the fix above. Nolt, are you referring to front page news? This is for the category blocks.

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Categories on Frontpage Bug&Fix
« Reply #3 on: June 16, 2011, 01:24:48 AM »
Yest, I was talking about page news. Sorry for reply on wrong topic.