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

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 02:18:45 AM

Login with username, password and session length

Recent posts

#11
Support / Customize menus
Last post by ramiroflores - April 12, 2024, 09:52:09 AM
Hi everybody,

i am new i am looking for solution, how to create a custom menu in smf mini portal with block navigations - links to different forum sections to display like front page style. Block menu section for various forums.

Who can help me?
#12
Modules / Re: Top posts (most liked) mod...
Last post by @rjen - April 11, 2024, 08:49:51 PM
Okay, challenge accepted...

Drop below code into a PHP block and you should be good to go..
There is one parameter you can change to influence the history: $days = '365' change 365 to the period in days you want...

global $scripturl, $smcFunc, $txt, $days, $modSettings;

// Configuration
// Specify number of days for likes.
    $days = '365';
// End Config

// get the likes
    loadLanguage('Stats');

    $max_liked = 1;
    $request = $smcFunc['db_query']('', '
        SELECT m.id_msg, m.subject, l.likes, m.total_likes, m.id_board, m.id_topic, t.approved
        FROM (
            SELECT n.id_msg, n.subject, n.likes AS total_likes, n.id_board, n.id_topic
            FROM {db_prefix}messages as n
            ) AS m
            INNER JOIN
                (SELECT content_id, content_type, count(*) AS likes FROM {db_prefix}user_likes where content_type = "msg" AND like_time > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL {int:days} DAY)) group by content_id, content_type order by likes desc) AS l ON (l.content_id = m.id_msg)
            INNER JOIN {db_prefix}topics AS t ON (m.id_topic = t.id_topic)
            INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
                AND b.id_board != {int:recycle_board}' : '') . ')
        WHERE {query_see_board}' . ($modSettings['postmod_active'] ? '
            AND t.approved = {int:is_approved}' : '') . '
        ORDER BY l.likes DESC
        LIMIT 10',
        array(
            'recycle_board' => $modSettings['recycle_board'],
            'is_approved' => 1,
            'days' => $days,
        )
    );
           
    $messages = array();
   
    while ($row = $smcFunc['db_fetch_assoc']($request))
    {
        censorText($row_liked_message['subject']);
        $messages[] = array(
            'id' => $row['id_topic'],
            'subject' => $row['subject'],
            'num' => $row['likes'],
            'href' => $scripturl . '?msg=' . $row['id_msg'],
            'link' => '<a href="' . $scripturl . '?msg=' . $row['id_msg'] . '">' . $row['subject'] . '</a>'
        );

        if ($max_liked < $row['likes'])
            $max_liked = $row['likes'];
    }
    $smcFunc['db_free_result']($request);

    foreach ($messages as $i => $request)
        $messages[$i]['percent'] = round(($request['num'] * 100) / $max_liked);
   
// output the likes
    echo '
        <div class="content">
            <div class="title_bar">
                <h4 class="titlebg">
                    <span class="main_icons liked_messages"></span> ',  $txt['top_liked_messages'], ' -
                    ',$days,' ',$txt['days_word'],'
                </h4>
            </div>
            <dl class="stats">';

    foreach ($messages as $item)
    {
        echo '
                <dt>
                    ', $item['link'], '
                </dt>
                <dd class="statsbar generic_bar righttext">';

        if (!empty($item['percent']))
            echo '
                    <div class="bar" style="width: ', $item['percent'], '%;"></div>';
        else
            echo '
                    <div class="bar empty"></div>';

        echo '
                    <span>', $item['num'], '</span>
                </dd>';
    }

    echo '
            </dl>
        </div><!-- .content -->';


Result...
You cannot view this attachment.
#13
Modules / Re: Top posts (most liked) mod...
Last post by @rjen - April 08, 2024, 11:48:54 AM
It does not yet exist, but should be possible. Thinking about it: we normally use SMF SSI functions, but I don't think there is an existing function offered that uses likes atm...

So someone would have to create the query...
#14
Modules / Top posts (most liked) module
Last post by IgorS - April 08, 2024, 07:39:03 AM
Hello.

Is there any way to add the module to SMF 2.1.4 with the most liked posts in X days?
Something like "Recent Posts" from TP but sorted with "likes".

I have used the modification Good Post/Bad Post in 2.0.19 and there was a module added below the forum, with the most liked posts in the last 7 days.

#15
German / Deutsche Sprachdateien (Downlo...
Last post by @rjen - April 02, 2024, 10:08:32 PM
Alle Sprachdateien im Downloadbereich *Klick*

- TinyPortal 3.0.0 Sprachdateien.



Installationshinweise:

Einfach die Dateien nach

_FORUMSORDNER_/Themes/default/languages/

kopieren.

Nicht den Paket-Manager benutzen.



Wenn ihr Fehler gefunden oder Vorschläge habt, dann postet sie in diesem Thread!




#16
Support / Re: Combining TP database tabl...
Last post by davo88 - April 01, 2024, 08:15:03 AM
Thanks @rjen.
#17
Support / Re: Combining TP database tabl...
Last post by @rjen - April 01, 2024, 07:39:02 AM
Installing TP will automatically set the image_upload path correctly.

And it also checks and corrects table definitions and settings.
Mind you: if your tp tables are built from the latest tp version all should be okay, but it won't hurt
#18
Support / Re: Combining TP database tabl...
Last post by davo88 - April 01, 2024, 07:32:25 AM
Excellent. Hadn't thought of any of those points. Found the the three path settings in smf_tp_settings - blockcode_upload_path, download_upload_path, image_upload_path.

One question about the rebuilding order. You mention to import the TP tables, then install TP. Is there a reason for doing it in that order?
#19
Support / Re: Combining TP database tabl...
Last post by @rjen - April 01, 2024, 06:06:31 AM
I have moved to data to other installs multiple times. There is only one dependency between SMF tables and the tp tables and those are member id's. Used in articles, shouts, downloads and comments.

As long as you keep those the same you are fine.

But even if they are not the same there's no real issue.
Moving TinyPortal tables you have to be aware of three setting in tp_setting: image path, upload path and block path: if the old install was in a different location you need to manually correct these in the table.

I would setup the forum in the easiest procedure and copy TinyPortal tables over, then install the latest version of TP in the new forum

#20
Support / Combining TP database tables w...
Last post by davo88 - March 31, 2024, 10:42:18 PM
I am planning the changeover process from an SMF 2.0.19 site to an SMF 2.1.4/TP 3.0.0 site on a different server.
As there is a lot of TP configuration and entering of article/block data to do on the new site, I have been considering and testing whether the TP installation data can be pre-configured so it doesn't all have to be done on changeover day.

There seems to be two ways of doing this.

1. Prebuild the final destination site fully including all TP data. Then leave the TP database tables in place and just replace the SMF database tables.
2. Prebuild a separate site fully including all TP data. Then export the TP tables and import them to the final site's database.

Thinking through each of those scenarios, these are the steps I imagine would be required.

Option 1
Prebuild the final site fully using older SMF data and all the new TP data
On conversion day
- Drop only the SMF tables in the final destination site
- Leave the eleven TP tables containing all the TP data in place
- On a completely separate conversion site, convert the latest SMF database to 2.1.4 format
- Import this converted SMF database to the final destination site
- Install the TP mod package to the final site.
- TP then reads the eleven existing TP tables.


Option 2
Prebuild a separate site fully using older SMF data and all the new TP data
On conversion day
- Have a fresh installation of SMF 2.1.4 installed at the final destination with no data at all.
- On a completely separate conversion site, convert the latest SMF database to 2.1.4 format
- Drop the SMF tables in the final destination site
- Import the converted SMF database to the final destination site
- Install the TP mod package to the final destination site
- Export the eleven TP database tables from the prebuilt separate site
- Import the eleven TB database tables to the final destination site

I have tested Option 1 and it appears to work OK. I looked for time stamps in the TP tables that might cause a problem because the timestamps in say the article creation date fields, would be earlier than the TP installation timestamp recorded in smf_log_packages. But it is hard to tell if this could be an issue.

Option 2 is not tested yet but seems to have pretty much the same outcome.

Anyone had experience with doing this sort of thing - combining existing TP data with a new SMF installation?