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,973
  • Latest: NonStop
Stats
  • Total Posts: 196,242
  • Total Topics: 21,353
  • Online today: 488
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 491
  • Total: 491

Some TP 1.0 RC1 for RC4 Issues

Started by Skhilled, December 12, 2010, 07:20:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lurkalot

Quote from: IchBin on December 17, 2010, 12:31:43 AM

If one of you wouldn't mind putting something in the bugtracker that would be great.


Thanks for being on the case Brad.  I've added "something" to the bugtracker, just hope it's the required info.  ;)

Skhilled

Quote from: IchBin on December 16, 2010, 12:51:52 AM
QuoteEDIT AGAIN (LOL): I've noticed that most of the blocks have option circles instead of checkboxes. Perhaps, there is something wrong with that?

Are you saying that you have more radio boxes than check boxes? The only radio boxes for blocks that I have are everything down to member group selection. The rest are check boxes.

I just meant that while looking at some of the other blocks, most have radio boxes than checkboxes. I was just wondering if that might of had something to do with it or not...probably not.

Quote from: IchBin on December 17, 2010, 12:31:43 AM
I have not been able to confirm the problem with creating BBC articles.

I'll have to check the code when I get a chance...probably sometime today.

Quote from: IchBin on December 17, 2010, 12:31:43 AM
The reason for the error not pointing to the right file, is because you have disable eval for template in the server settings.

For my site? Hmmm, might explain a few other things then. Thanks.

Skhilled

OK, now for the other error:

http://www.skhilled.com/smf/index.php?action=tpadmin;sa=articles;sa=strays
8: Undefined index: indent
File: /home/skhille1/public_html/smf/Themes/default/languages/TPShout.english.php (main sub template - eval?)
Line: 2091


I get this if I create an article and NOT assign it to a category THEN click on "Uncategorized" to view uncategorized articles.

IchBin

Have you disabled template eval yet? That will give a more specific error. I just tried creating a BBC article without a category. Then clicked on uncategorized, and did not get the same error. So it might help if you can give me an error that points to the proper file so I can take a look at the code.

Skhilled

Sorry, for the delay...Christmas and all.

Here's the error after disabling eval and following it a few lines above and below it. Line 2091 is in red.

Quotehttp://www.skhilled.com/smf/index.php?action=tpadmin;sa=articles;sa=strays
8: Undefined index:  indent
File: /home/skhille1/public_html/smf/Themes/default/TPortalAdmin.template.php
Line: 2091

Quoteif(isset($context['TPortal']['allcats']))
        {
            echo '    <p style="text-align: right;">
                            <select name="tp_article_cat">
                                <option value="0">' . $txt['tp-createnew'] . '</option>';
            foreach($context['TPortal']['allcats'] as $submg)
                      echo '
                                <option value="'.$submg['id'].'">',  $submg['indent']>1 ? str_repeat("-", ($submg['indent']-1)) : '' , ' '. $txt['tp-assignto'] . $submg['name'].'</option>';
            echo '
                            </select>
                            <input name="tp_article_new" value="" size="40"  /> &nbsp;
                        </p>';

IchBin

Try this:
Find in TPortalAdmin.php (about line #1359)
        while ($row = tpdb_fetch_assoc($request))
            $allsorted[$row['id']] = $row;


Replace with this:
        while ($row = tpdb_fetch_assoc($request)) {
            if ($row['parent'] != 0)
                $row['indent'] = 1;
            $allsorted[$row['id']] = $row;
        }


Then in TPortalAdmin.template.php find this: (about line #2091)
<option value="'.$submg['id'].'">',  $submg['indent']>1 ? str_repeat("-", ($submg['indent'])-1) : '' , ' '. $txt['tp-assignto'] . $submg['name'].'</option>';

Replace with this:
<option value="'.$submg['id'].'">',  $submg['indent']>0 ? str_repeat("-", ($submg['indent'])) : '' , ' '. $txt['tp-assignto'] . $submg['name'].'</option>';

Skhilled

#16
Still get the error. However, I "think" I've found a few bugs in the code. In TPortalAdmin.php on line 163 there is the following code which names the vars for the articles and below that code is the code to create those articles...I think. LOL I'm not a coder.

    if(in_array($tpsub,array('articles','addarticle_php','addarticle_html','addarticle_bbc','addarticle_import', 'strays', 'categories', 'addcategory')))


Most of those have "add" something in them. However, the code for some of them below that line are not the same. I also believe that the numbers in the 'text' part have to do with the number errors I was getting. I can't find all of the numbers 1-6 as only some of them are there along with number 11?

            'categories' => array(
                    'lang' => true,
                    'text' => 'tp-tabs5',
                    'url' => $scripturl . '?action=tpadmin;sa=categories',
                    'active' => $tpsub == 'categories',
                ),
                'addcategory' => array(
                    'lang' => true,
                    'text' => 'tp-tabs6',
                    'url' => $scripturl . '?action=tpadmin;sa=addcategory',
                    'active' => $tpsub == 'addcategory',
                ),
                'articles' => array(
                    'lang' => true,
                    'text' => 'tp-articles',
                    'url' => $scripturl . '?action=tpadmin;sa=articles',
                    'active' => ($context['TPortal']['subaction'] == 'articles' || $context['TPortal']['subaction'] == 'editarticle') && $context['TPortal']['subaction'] != 'strays',
                ),
                'articles_nocat' => array(
                    'lang' => true,
                    'text' => 'tp-uncategorised' ,
                    'url' => $scripturl . '?action=tpadmin;sa=articles;sa=strays',
                    'active' => $context['TPortal']['subaction'] == 'strays',
                ),
                'addarticle' => array(
                    'lang' => true,
                    'text' => 'tp-tabs2',
                    'url' => $scripturl . '?action=tpadmin;sa=addarticle_html' . (isset($_GET['cu']) ? ';cu='.$_GET['cu'] : ''),
                    'active' => $context['TPortal']['subaction'] == 'addarticle_html',
                ),
                'addarticle_php' => array(
                    'lang' => true,
                    'text' => 'tp-tabs3',
                    'url' => $scripturl . '?action=tpadmin;sa=addarticle_php' . (isset($_GET['cu']) ? ';cu='.$_GET['cu'] : ''),
                    'active' => $context['TPortal']['subaction'] == 'addarticle_php',
                ),
                'addarticle_bbc' => array(
                    'lang' => true,
                    'text' => 'tp-addbbc',
                    'url' => $scripturl . '?action=tpadmin;sa=addarticle_bbc' . (isset($_GET['cu']) ? ';cu='.$_GET['cu'] : ''),
                    'active' => $context['TPortal']['subaction'] == 'addarticle_bbc',
                ),
                'article_import' => array(
                    'lang' => true,
                    'text' => 'tp-addimport',
                    'url' => $scripturl . '?action=tpadmin;sa=addarticle_import' . (isset($_GET['cu']) ? ';cu='.$_GET['cu'] : ''),
                    'active' => $context['TPortal']['subaction'] == 'addarticle_import',
                ),
                'clist' => array(
                    'lang' => true,
                    'text' => 'tp-tabs11',
                    'url' => $scripturl . '?action=tpadmin;sa=clist',
                    'active' => $tpsub == 'clist',
                ),
            );


but as you can see, almost all of them start with add something and end with the same thing...except for some of them. One in particular doesn't have the same underscore as in line 163 and also does not start with it but ends with it...'addarticle_html'. It starts with 'addarticle' but ends with 'addarticle_html'. Also 'article_import' should read 'addarticle_import'.

When I first opened the file, I noticed a few spelling typos in the comments. While scrolling down the page I noticed all of the above. The comments typos are at a few locations but since they are only comments they don't matter.  :D

Like I said, I'm no coder so forgive me if I'm off base.  ;D

EDIT: Another small issue is when you create an html article and have wysiwyg turned off and type a line or 2 of text then turn it on, the wysiwyg buttons will overlap the first line or 2. The text will still be there and it will fix itself after you save it. If you turn on wysiwyg first then type it will not do this.

IchBin

In my post above changed this code:
        while ($row = tpdb_fetch_assoc($request)) {
            if ($row['parent'] != 0)
                $row['indent'] = 1;
            $allsorted[$row['id']] = $row;
        }


To this:
        while ($row = tpdb_fetch_assoc($request)) {
            $row['indent'] = $row['parent'] != 0 ? 1 : 0;
            $allsorted[$row['id']] = $row;
        }


The code you referenced is ok. All it's doing is creating an array for the sub menu buttons. The index that you mentioned with the word "add" in them should not matter.

Skhilled

Sorry for the delay. Yes, that fixed the error. Also, Lurkalot found out why my BBC articles were not working. It was because I can clicked on "Toggle View". For some reason it is set to enabled or shows as darkened (the bbc button) by default. Changing it allows the bbc articles to be saved.

So, is there a way to change the default setting of that button? I assume this was due to an upgrade, either smf and/or TP.

IchBin

Not that I'm aware of. The BBC editor is the SMF editor from what I can tell. I bet that when you upgrade or something that the wysiwig option is turned on in your profile to show by default.

This website is proudly hosted on Crocweb Cloud Website Hosting.