SimplePortal

Started by SimplePortal Team, March 10, 2008, 11:16:07 PM

Previous topic - Next topic

Sir Osis of Liver

I've installed TP on 2.1 clone, have asked owner to see if it meets his requirements.  Thanks.

Quote from: dodos26 on April 25, 2023, 06:03:04 PMA man wants to use simpleportal and you tell him to use something else. Why?
If you bothered to read the topic, you'd know we're in need of a 2.1 portal that has the add to frontpage feature.  SP does not support 2.1, and it's unlikely it will be upgraded.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

DeadMan...

Quote from: dodos26 on April 25, 2023, 06:03:04 PMA man wants to use simpleportal and you tell him to use something else. Why?
Because, there's no SimplePortal version for SMF 2.1.x

That's why.
You'd have seen the discussion if you'd have read a bit.
I tell it how I see it... Don't like it? Hit Alt+F4!

Arantor

Quote from: dodos26 on April 25, 2023, 06:03:04 PMA man wants to use simpleportal and you tell him to use something else. Why?

Because SP isn't supported any more, and the choices are LP, TP or a fork of SP that doesn't necessarily have the features the person is asking for. TP at least seems to have the feature being asked about.

dodos26

Quote from: Sir Osis of Liver on April 25, 2023, 06:14:33 PMI've installed TP on 2.1 clone, have asked owner to see if it meets his requirements.  Thanks.

Quote from: dodos26 on April 25, 2023, 06:03:04 PMA man wants to use simpleportal and you tell him to use something else. Why?
If you bothered to read the topic, you'd know we're in need of a 2.1 portal that has the add to frontpage feature.  SP does not support 2.1, and it's unlikely it will be upgraded.


I went to as much trouble as the developers in the 2.0 department. In which my topic with security holes was considered redundant and to install 2.1. I went to as much trouble as the developers reading that I don't want 2.1. :)))

Arantor

So you just admit you're trolling because you didn't like the answer you got?

Sir Osis of Liver

Quote from: dodos26 on April 26, 2023, 09:46:59 AMI went to as much trouble as the developers reading that I don't want 2.1.

As is well known here, I haven't been a big fan of 2.1, and continue to run 2.0 on my own production forums.  But this is a rare case where I'm recommending 2.1 because the owner wants to add multiple forums, each for a different team, so he'll end up with a lot of installs running a basically outdated version, with outdated themes and mods, and it will be a major chore to upgrade everything when 2.0 goes eol.  Much easier to do it now, while we're starting with just one forum.  But he does want to retain the functionality he's currently using, and as noted there is no 2.1 version of SP, and probably never will be.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

dodos26

I found some bug in PortalAdminBlocks.php
This is perhaps related to newer versions of mysql
            $request =  $smcFunc['db_query']('','
                SELECT row
                FROM {db_prefix}sp_blocks
                WHERE col = {int:col}' . (!empty($_REQUEST['block_id']) ? '
                    AND id_block != {int:current_id}' : '' ) . '
                ORDER BY row DESC
                LIMIT 1',
                array(
                    'col' => $_POST['block_column'],
                    'current_id' => $_REQUEST['block_id'],
                )
            );

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM xxx_sp_blocks
WHERE col = 5
ORDER BY row DESC
LIMIT 1' at line 2
Plik: C:\wamp64\www\Sources\PortalAdminBlocks.php
Linia: 680

When fix row to `row` it will start working fine. Probably all rows should be replaced to avoid problems arising from the use of the keyword.
$request = $smcFunc['db_query']('','
    SELECT `row`
    FROM {db_prefix}sp_blocks
    WHERE col = {int:col}' . (!empty($_REQUEST['block_id']) ? '
        AND id_block != {int:current_id}' : '' ) . '
    ORDER BY `row` DESC
    LIMIT 1',
    array(
        'col' => $_POST['block_column'],
        'current_id' => $_REQUEST['block_id'],
    )
);


Yeah i found it
"The "ROW" keyword in MySQL was added in version 8.0.23."

dodos26

I found the place of the problem after wrong redirection when we use some non-standard parameters. Example fbclid.
Open Subs/PortalMain.php and find:
function sportal_main()
Next find:
    global $smcFunc, $context, $sourcedir;and replace:
    global $smcFunc, $context, $sourcedir, $modSettings;Next find:
    if (!isset($_REQUEST['sa']) || !isset($actions[$_REQUEST['sa']]))
        $_REQUEST['sa'] = 'articles';

    if (!empty($actions[$_REQUEST['sa']][0]))
        require_once($sourcedir . '/' . $actions[$_REQUEST['sa']][0]);

    $actions[$_REQUEST['sa']][1]();
And replace:
    if (!empty($modSettings['articleactive']))
    {
        if (!isset($_REQUEST['sa']) || !isset($actions[$_REQUEST['sa']]))
            $_REQUEST['sa'] = 'articles';

        if (!empty($actions[$_REQUEST['sa']][0]))
            require_once($sourcedir . '/' . $actions[$_REQUEST['sa']][0]);

        $actions[$_REQUEST['sa']][1]();
    } else redirectexit();

This solution will come in handy when you don't use articles. If you are using articles but there are no articles in them, it is better to disable them. Otherwise, you will receive an error due to the lack of articles, or add a check of how many articles there are on par with if (!empty($modSettings['articleactive'])).

dodos26

#5708
Ignore the above message, I didn't delete so you know how to undo the changes.

Read it:
For some reason it worked on my local machine with a standard theme and simple portal modem. It doesn't work!,  on another site it didn't work for me, it kept taking me to the forum page. The real cause lies here: Sources/Subs-Portal.php
Code (find) Select
// Function to get a block's display/show information.
function getShowInfo($block_id = null, $display = null, $custom = null)
Quote// Will hopefully get larger in the future.
Clearly this part of the code is unfinished.
Code (find) Select
    // Will hopefully get larger in the future.
    $portal_actions = array(
        'articles' => true,
        'start' => true,
        'theme' => true,
        'PHPSESSID' => true,
        'wwwRedirect' => true,
        'www' => true,
        'variant' => true,
        'language' => true,
        'action' => array('portal'),
    );

    // Set some action exceptions.
    $exceptions = array(
        'post' => array('announce', 'editpoll', 'emailuser', 'post2', 'sendtopic'),
        'register' => array('activate', 'coppa'),
        'forum' => array('collapse'),
        'admin' => array('credits', 'theme', 'viewquery', 'viewsmfile'),
        'moderate' => array('groups'),
        'login' => array('reminder'),
        'profile' => array('trackip', 'viewprofile'),
    );

    // Still, we might not be in portal!
    if (!empty($_GET) && empty($context['standalone']))
        foreach ($_GET as $key => $value)
        {
            if (preg_match('~^news\d+$~', $key))
                continue;

            if (!isset($portal_actions[$key]))
                $portal = false;
            elseif (is_array($portal_actions[$key]) && !in_array($value, $portal_actions[$key]))
                $portal = false;
        }

How fix? Insert (Probably the safest method, but only for known parameters):
Code (select) Select
    $portal_actions = array(
        'articles' => true,
        'start' => true,
        'theme' => true,
        'PHPSESSID' => true,
        'wwwRedirect' => true,
        'www' => true,
        'variant' => true,
        'language' => true,
        'action' => array('portal'),
    );
Example insert for fbclid:
Code ("Insert: 'fbclid' => true,") Select
    $portal_actions = array(
        'articles' => true,
        'start' => true,
        'theme' => true,
        'PHPSESSID' => true,
        'wwwRedirect' => true,
        'www' => true,
        'variant' => true,
        'language' => true,
        'action' => array('portal'),
        'fbclid' => true,
    );


My question is how to add support for unknown parameters. Many sites these days add tracking parameters to links.

Chen Zhen

#5709
@dodos26:

BTW the reserved db name issue was fixed in the 2.3.8-BETA release.

You're asking how to put in support to add unique parameters to that array such as your Facebook identifier? One could add an input to the SP admin section to add unique additions to that array.
You have at least one mod submitted to this forum so perhaps you have the skills to do that on your own?

re. removed as requested.orgFYI - Usually people who remove all copyright links to SMF & its mods on their forum(s) have the ability to code so they aren't asking for support. 

 

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

dodos26

Bro please remove link to this page she doesn't want publicity. If I've posted a link to this page anywhere, I apologize for that, and point me to where I'll remove it. Your solution seems good, I even thought about it. But I still thought it was just a bug where it didn't check the reserved parameters.

In my case, I don't need to create such a modification since I know where to add it, but as part of my training, because I'm still learning, I'm able to do it for the community.

DeadMan...

Quote from: Chen Zhen on May 08, 2023, 07:10:56 PMFYI - Usually people who remove all copyright links to SMF & its mods on their forum(s) have the ability to code so they aren't asking for support.

Isn't it also against ToS to help support with warez sites?
I tell it how I see it... Don't like it? Hit Alt+F4!

Aleksi "Lex" Kilpinen

#5712
We don't officially really say one way or the other about your use of SMF, you are free to do what you want with it and the team is free to choose if they want to provide support for your particular use. But we do not usually provide support to sites that remove copyrights from the core product or break licenses of other SMF related products such as modifications. You are allowed to hide the SMF copyright, but doing so means you have chosen not to seek support from us, you may not be allowed at all to remove copyrights from mods depending on their licensing.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

dodos26

I sensitize you again before removing the link to my private page.

Also, note that the "help" link is in the "Other" tab. And there is information about the modification of simple portal and simple machines forum. Also, as "Aleksi "Lex" Kilpinen says, the BSD license allows me to modify and use the code in any way I want, and forbids redistribution without preserving the information. It does not redistribute modified code anywhere, and information on how to modify is not a modification or redistribution.

I would also like to mention that I showed a solution to a problem that I spent several hours tracking where it is. Asking for help was just an additional form for which I did not expect an answer, when I expected I would write in the support tab.

By the way, your determined attacks against me through all sorts of reports are amazing. Your determination to cause harm without legal knowledge is downright sad.

DeadMan...

You really have not much of sense, do you? I was not attacking, I was merely making a statement due to other topics I have seen where it was stated that support isn't given for sites that have certain things that are not totally legal.

I for one, run a web host, as well as support for a major web host, and sites like that are usually suspended on sight. So, before you start a pity party, you might want to rethink the facts.
I tell it how I see it... Don't like it? Hit Alt+F4!

Aleksi "Lex" Kilpinen

#5715
I want to point out this particular part of my post.

Quote from: Aleksi "Lex" Kilpinen on May 09, 2023, 11:33:43 PMdoing so means you have chosen not to seek support from us, you may not be allowed at all to remove copyrights from mods depending on their licensing.

Yes, you are allowed to remove SMF copyright. This means no support though. This does not extend to mods, mods may have legal requirements outside SMF.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Steve

That will be enough @dodos26@DeadMan... is correct in his statement that we won't knowingly provide support for sites that promote, provide or use illegal products.

And our Project Manager has addressed the copyright issue.
DO NOT pm me for support!

dodos26

It's amazing this toxic community that made ****** storms in an attempt / willingness to help others.
You don't want to support me, remove my private page from the post.
Not to mention that completely one person started a conversation that is completely unrelated to the content of this topic. When I started a topic not related my posts were deleted within 5 minutes. You guys are acting like a bunch of hypocrites right now.

Aleksi "Lex" Kilpinen

Alright, alright. I removed the link, if you want the rest removed please seek them out and report them.
But you should know that public websites are public, it's not a "private page" when anyone can see it.
Also this discussion should end here. Any more and posts will be deleted to clean up this topic.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

aegersz

#5719
HI, I am on version 2.3.6 and I get errors when I just try to preview (no changes) my Custom PHP Block for Recent Topics (see below for the contents). If  I make no changes and save it then the whole thing blows up.

global $txt, $scripturl, $settings, $context, $color_profile;

    $boards = null;
    $limit = 49;
    $type = 'ssi_recentTopics';

    $items = $type($limit, null, $boards, 'array');

    if (empty($items))
    {
        echo '
                                ', $txt['error_sp_no_posts_found'];
        return;
    }
    else
        $items[count($items) - 1]['is_last'] = true;

    $colorids = array();
    foreach ($items as $item)
        $colorids[] = $item['poster']['id'];

    if (!empty($colorids) && sp_loadColors($colorids) !== false)
    {
        foreach ($items as $k => $p)
        {
            if (!empty($color_profile[$p['poster']['id']]['link']))
                $items[$k]['poster']['link'] = $color_profile[$p['poster']['id']]['link'];
        }
    }

    echo '
                            <table class="sp_fullwidth">';

    foreach ($items as $item)
        echo '
                                <tr>
                                    <td class="sp_recent_icon sp_center">
                                        ', $item['new'] ? sp_embed_image('topic') : '<a href="' . $scripturl . '?topic=' . $item['topic'] . '.msg' . $item['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>',
                                    '</td>
                                    <td class="sp_recent_subject">
                                        <a href="', $item['href'], '">', $item['subject'], '</a><br />[', $item['board']['link'], ']
                                    </td>
                                    <td class="sp_recent_info sp_right">
                                        ', $item['poster']['link'], '<br />', $item['time'], '
                                    </td>
                                </tr>';

    echo '
                            </table>';

The error is:

ParseError: syntax error, unexpected '=' in /var/www/html/Sources/PortalBlocks.php(3644) : eval()'d code:7
Stack trace:
#0 /var/www/html/Themes/default/Portal.template.php(242): sp_php(Array, '39')
#1 /var/www/html/Themes/default/Portal.template.php(148): template_block_curve(Array)
#2 /var/www/html/Themes/default/PortalAdminBlocks.template.php(106): template_block(Array)
#3 /var/www/html/Sources/Load.php(2245): template_block_edit()
#4 /var/www/html/Sources/Subs.php(3027): loadSubTemplate('block_edit')
#5 /var/www/html/index.php(191): obExit(NULL, true, true)
#6 {main}

The only way I can make changes is by editing the actual database entry and that works ok.

Do you know why this is ?

I also see these additional errors in the log:

8: A non well formed numeric value encountered
/var/www/html/Sources/PortalAdminBlocks.php
Line: 430

8: A non well formed numeric value encountered
/var/www/html/Sources/PortalAdminBlocks.php
Line: 421
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Advertisement: