TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 09:02:35 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 72
  • Total: 72

Categories on Frontpage Bug&Fix

Started by hidden69, October 30, 2010, 04:54:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hidden69

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

  // 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
  // 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
    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
    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

Nolt

Not working, still on my frontpage news are from only one category (I have selected 3 of them) ;/

IchBin

I've added in the fix above. Nolt, are you referring to front page news? This is for the category blocks.

Nolt

Yest, I was talking about page news. Sorry for reply on wrong topic.