TinyPortal

Development => Support => Topic started by: Ephemeral on February 27, 2007, 08:41:28 AM

Title: Article Block shows 'by admin' after each article name?
Post by: Ephemeral on February 27, 2007, 08:41:28 AM
I have an article block on my home page, which displays all of the recently created articles of a certain catagory. The problem is, even though I have unchecked 'show author' it still says 'by admin' after each article name. (You can see for yourself here, on the lefthand side block: http://philosophy-forums.com).

Anyway to remove this 'by admin' thing? It makes it a bit awkward. And secondly, can I increase the link size of the article titles in the block?

Thanks.
Title: Re: Article Block shows 'by admin' after each article name?
Post by: G6Cad on February 27, 2007, 08:47:55 AM
LoL, just to give a notice here, you have reached the TinyPortal mod site, and TinyPortal are used and wrapped around the forumsoftware called Simplemachines.
Your link point to a forum that's builded on Invision Power Board, and that is not exactly our support frame we have here on TinyPortal  :2funny:
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Ephemeral on February 27, 2007, 09:59:13 AM
Quote from: G6â„¢ on February 27, 2007, 08:47:55 AM
LoL, just to give a notice here, you have reached the TinyPortal mod site, and TinyPortal are used and wrapped around the forumsoftware called Simplemachines.
Your link point to a forum that's builded on Invision Power Board, and that is not exactly our support frame we have here on TinyPortal  :2funny:

Sorry, I mistyped the link. The real link is the one depicted beneath my signature: http://philosophy-forums.com

I ommited the "s"
Title: Re: Article Block shows 'by admin' after each article name?
Post by: IchBin on February 27, 2007, 04:52:43 PM
I cannot see the block in question. Can you make it so guests can view the block, or give us a test account to view your site with please?
Title: Re: Article Block shows 'by admin' after each article name?
Post by: staticroot on April 11, 2007, 03:05:25 PM
Hi there,
I, too, would like to remove the author name from links in 'article category' blocks.
I'm trying to use 'article category' blocks more like a menu to articles I've created (which are usually less like articles and more like webpages)
Example from my site as of April 11th 2007:
www.teamsnackattack.com  (see the left side for 'live server stats' under the category 'information center'

I think for my purposes, listing of the author in the block clutters the block.

Any ideas how to remove?
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Zetan on April 11, 2007, 04:16:33 PM
Quote from: staticroot on April 11, 2007, 03:05:25 PM
Hi there,
I, too, would like to remove the author name from links in 'article category' blocks.

Are you refering to this:
QuoteLive Server Stats
by =TSA=PizzaRoll
?

If you are, you could make a menu and create a link to it.
Manage Blocks > Menu Manager > Add Menu Item.
Give the link a title.. Select the Link radio button.. paste the URL of the Article you wish to link to.
Make sure the menu item is switched on.

You should now have a link with no author.
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Lesmond on April 11, 2007, 04:33:58 PM
Or you could make your own block with links to your Articles, using a script block,
Something Like this
<div class="smalltext"><b><a href="http://www.yoursite.com/index.php?page=56">YOUR ARTICLE 1</a></b><br><b>
<a href="http://www.yoursite.com/index.php?page=55">YOUR ARTICLE 2</a></b><br><b>
<a href="http://www.yoursite.com/index.php?page=57">YOUR ARTICLE 3</a></b></br></div>
Title: Re: Article Block shows 'by admin' after each article name?
Post by: staticroot on April 11, 2007, 05:16:22 PM
Thanks to both of you!
I ended up using the menu box solution because of the closer spacing.
I tried putting html in a scriptbox before but everything seemed to be double spaced?

thanks again.. I'm messing with it now :)
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Lesmond on April 11, 2007, 05:29:07 PM
I have just tested it using the code I gave, I don't see any double spacing, See att img
Title: Re: Article Block shows 'by admin' after each article name?
Post by: staticroot on April 11, 2007, 05:51:34 PM
Well HECK.. that worked fine, Lesmondâ„¢  (haha.. you are trademarked?)
I must have put my links into an html box before.
Thanks again.. I have much more control over the way links look in a script box.. cheers!
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Silversound on August 26, 2007, 11:29:28 PM
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>';
        }
}
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Zetan on August 26, 2007, 11:45:34 PM
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.
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Silversound on August 26, 2007, 11:54:56 PM
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
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Zetan on August 26, 2007, 11:57:42 PM
Is it a block or an article?

If it's an article, it may well be in a different file.
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Silversound on August 27, 2007, 12:05:34 AM
It is this block that I want to change
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Zetan on August 27, 2007, 12:12:52 AM
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.
Title: Re: Article Block shows 'by admin' after each article name?
Post by: Silversound on August 27, 2007, 01:34:59 AM
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.
Title: Re: Article Block shows 'by admin' after each article name?
Post by: capitalpyro on December 20, 2007, 03:02:00 AM
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 

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Foldpyro.com%2Fquestion%2Fblock_catagory.jpg&hash=d3635793a760d448791a12de2a95abe5258099b0)
Title: Re: Article Block shows 'by admin' after each article name?
Post by: IchBin on December 20, 2007, 06:43:09 PM
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 />';
Title: Re: Article Block shows 'by admin' after each article name?
Post by: capitalpyro on December 20, 2007, 09:28:06 PM
Most Excellent! Thank you for your straight forward reply. I  really do appreciate it.

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Foldpyro.com%2Fquestion%2Fresults.jpg&hash=41b56fbab9bd4c74798dd16492cfab59351d815f)