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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,992
  • Total Topics: 21,323
  • Online today: 347
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 303
  • Total: 303

Article Block shows 'by admin' after each article name?

Started by Ephemeral, February 27, 2007, 08:41:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Silversound

#10
I would also like to remove the "by Admin" part of this block. It takes up a lot of space that I would like to reserve for other things.

I would consider making my own block using the above mentioned method, but that will get very tedious after adding as many articles as I would like to eventually have.

Where in the TP source can I find this block?

Or if anyone has the time and ability... why not make it a switch that can be checked or unchecked in the admin section.

I am willing to mess with the code to simply remove the author, but I have not been able to locate the code for this block.

Thanks in advance for any help.


EDIT: I think it is in here somewhere. This is from themes/default/TPortalBlocks.template.php
// an article
function TPortal_articlebox()
{
        global $context, $settings, $options, $txt, $scripturl;

        $story=array();

        if(isset($context['TPortal']['blockarticles'][$context['TPortal']['blockarticle']])){
                $story=$context['TPortal']['blockarticles'][$context['TPortal']['blockarticle']];

                echo '
                <div style="_height: 1%; overflow: hidden; padding: 4px;">';

                // any options for author and date?
                if(isset($story['options']['author']) || $story['is_boardnews'])
                        echo '<span class="smalltext">' , $txt['tp-author'] , ': <b>' , $story['poster']['link'] , '</b></span><br />';
                if(isset($story['options']['date']) || $story['is_boardnews'])
                        echo '<span class="smalltext"><br />' , $story['time'] , '</span><br />';
                // ..and for views and ratings , even comments?
                $opts=array();
                if(isset($story['options']['views']) || $story['is_boardnews'])
                        $opts[] = '<span class="smalltext">' . $txt['tp-views'] . ': ' . $story['views'] . ' </span>';
                if(isset($story['options']['comments']) || $story['is_boardnews']){
                        if($story['is_boardnews'] && ($story['comments']>1 || $story['comments']==0))
                                $what=$txt[110];
                        elseif($story['is_boardnews'] && $story['comments']==1)
                                $what=$txt[146];
                        else
                                $what=$txt['tp-comments'];

                        $opts[] = '<span class="smalltext">' . $what . ': ' . $story['comments'] . ' </span>';
                }
                if(isset($story['options']['rating']))
                        $opts[] = '<span class="smalltext">' . $txt['tp-ratingaverage'] . ' ' . $story['rating_average'] . ' (' . $story['rating_votes'] . ' ' . $txt['tp-ratingvotes'] . ') </span>';

                echo implode("<br />",$opts);

                // render the text
                echo '
                        <div style="overflow: hidden; _height: 1%;' , (isset($story['options']['author']) || isset($story['options']['date']) || $story['is_boardnews']) ? ' margin-top: 1ex;' : '' , '">';

                // any category icon?
                if(!empty($story['category']))
                        echo $story['category'];

                // set some height to articles too...
                echo '
                                <div style="line-height: 1.3em;">';
                // use a intro when not single page mode?
                if($context['TPortal']['front_type']!='singlepage'){
                        // use intro!
                        if($story['use_intro']=='1' && !isset($context['TPortal']['show_single_page'])){
                                if($story['is_php']){
                                        eval($story['body']);
                                }
                                else{
                                        echo $story['introtext'];
                                        echo '
                                        <div class="smalltext" style="margin-top: 1ex; font-weight: bold;"><a href="' .$story['href']. '">'.$txt['tp-readmore'].'</a></div>';
                                }
                        }
                        else{
                                if($story['is_php'])
                                        eval($story['body']);
                                else
                                        echo $story['body'];
                        }
                }
                else{
                        if($story['is_php'])
                                eval($story['body']);
                        else
                                echo $story['body'];
                }

                echo '
                                </div>
                        </div>';

                // give 'em a edit link? :)
                if(allowedTo('tp_articles') && !$story['is_boardnews'])
                        echo '
                        <div class="smalltext" style="margin: 1ex 1ex 0 0;">
                                <a href="' , $scripturl , '?action=tpadmin;sa=editarticle' , $story['id'] , '">[' , $txt['tp-editarticle'] , ']</a>
                                <a href="' , $scripturl , '?action=tpadmin;sa=editarticle' , $story['id'] , ';visualopts">[' , $txt['tp-editarticle2'] , ']</a>
                        </div>';
                echo '
                </div>';
        }
}

Zetan

At a quick glance, I would say it's in this line

echo '<span class="smalltext">' , $txt['tp-author'] , ': <b>' , $story['poster']['link'] , '</b></span><br />';

Story Poster Link.

I would comment the line out and not just delete it

// echo '<span class="smalltext">' , $txt['tp-author'] , ': <b>' , $story['poster']['link'] , '</b></span><br />';

// for commenting out, that line will now become null.

Silversound

No luck, that is the line i was thinking as well. But no change. Heck I can't even break the block/site.

Is this the right file? It seems that the code is the same in:
TPortalBlocks.template.php & TPortal.template.php

Zetan

Is it a block or an article?

If it's an article, it may well be in a different file.

Silversound


Zetan

I'm sure it's in TPortalBlocks.

And I thought it would be in the line I posted.. I've been playing with posters and links.. without looking, there are other files in Sources. Check there too.

Silversound

Will do. Thank you for helping me out today. I think this is something that I can do. If I find the answer I will post it for other.

Hopefully this can be implemented into one of the next few builds.

capitalpyro

Hello - I have searched the site for an answer to my problem but have come up empty handed. This topic has come the closest to describing the situation in which I would like to get changed. If the answer to this question is somewhere else and I missed it - please accept my apology in advance for giving up on my search too soon.

I have several center blocks that are set up as "Article Category" blocks. I use these blocks to archive the old front page articles that have moved off the front page. What I don't like is that the author is displayed after the name of every article. I have the "show author" box unchecked in the article options but it still show up inside the "article category" box. If someone could explain to me in detail of how to get this removed I would greatly appreciate it. Pictured below is an example of the blocks with the included "By Author" that I would like to get removed. Thanks in advance.

SMF 1.1.1  v0.9.7 


IchBin

In the Themes/default/TPortalBlocks.template.php file look for this code at the end of the file:
echo '<b><a href="'.$scripturl.'?page='.$listing['id'].'">'.$listing['subject'].'</a></b> '.$txt[525].' '.$listing['poster'].'<br />';

Replace with this:
echo '<b><a href="'.$scripturl.'?page='.$listing['id'].'">'.$listing['subject'].'</a></b> <br />';

capitalpyro

Most Excellent! Thank you for your straight forward reply. I  really do appreciate it.


This website is proudly hosted on Crocweb Cloud Website Hosting.