News: September 21st, 2019, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.4! GET IT NOW!!!

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

October 19, 2019, 10:05:38 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3756
  • Latest: Ocean
Stats
  • Total Posts: 189092
  • Total Topics: 20765
  • Online Today: 61
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 1
Guests: 39
Total: 40

Author Topic: Categories on Frontpage Bug&Fix  (Read 4263 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: 300
    • 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: 16228
    • My Website
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: 300
    • 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.