Advertisement:

Author Topic: TinyPortal  (Read 806469 times)

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2820 on: November 22, 2020, 01:31:54 PM »
The user added photos in the post, the photo under the photo without spaces. His article was added to the home page of the portal. I edited this post and separated the links from each other so that the gaps between the photos were kept. And unfortunately in this article the photos are still displayed without spacing on the home page of the portal. I cleared the forum cache and it doesn't work. I am using TP 2.0 in the forum, everything was fine on earlier TP versions.
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,757
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: TinyPortal
« Reply #2821 on: November 23, 2020, 02:23:34 AM »
The user added photos in the post, the photo under the photo without spaces. His article was added to the home page of the portal. I edited this post and separated the links from each other so that the gaps between the photos were kept. And unfortunately in this article the photos are still displayed without spacing on the home page of the portal. I cleared the forum cache and it doesn't work. I am using TP 2.0 in the forum, everything was fine on earlier TP versions.

Sorry for delay in responding. 

What front page settings are you using? and what version of SMF? just so we can check.  A link to the page would also be handy, via PM if you don't want it posted here.

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2822 on: November 23, 2020, 05:27:39 AM »
What front page settings are you using? and what version of SMF? just so we can check.  A link to the page would also be handy, via PM if you don't want it posted here.

You mean this setting? I use this setting:

What to display on frontpage: Promoted topics + articles - sorted on date

The forum runs on SMF 2.0.17

I sent you a private message.
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2823 on: December 20, 2020, 03:08:19 AM »
Could it be possible to insert the code from this modification into the TinyPortal block?

Google Translate for SMF 2.0

https://custom.simplemachines.org/mods/index.php?mod=3213

Code: [Select]
// Google Translate Mod
if (!empty($modSettings['enable_google_translate']))
{
echo '
<table border="0" width="100%" height="55px">
<tr>
<td>
<div align="' . $modSettings['google_translate_location'] . '"><div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
pageLanguage: \''. $modSettings['google_translate_language'] . '\',
autoDisplay: \'' . $modSettings['google_translate_autodisplay'] . '\',
multilanguagePage: \'' . $modSettings['google_translate_multilanguage'] . '\',
gaTrack: \'' . $modSettings['google_translate_analytics'] . '\',
gaId: \'' . $modSettings['google_translate_analytics_id'] . '\',
layout: google.translate.TranslateElement.InlineLayout.' . $modSettings['google_translate_style'] . '
  }, \'google_translate_element\');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script></div><br />
</td>
</tr>
</table>';
}
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline @rjen

  • Full Member
  • ***
  • Posts: 699
  • Gender: Male
    • FJR-club Nederland
Re: TinyPortal
« Reply #2824 on: December 20, 2020, 03:11:11 AM »
Did you try?
Running SMF 2.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2825 on: December 20, 2020, 04:12:55 AM »
Yes, but this menu does not appear in the block. The block is empty. When PHP block type is set. When I set the type of HTML & JavaScript block, only this is displayed in the block:

Code: [Select]
// Google Translate Mod if (!empty($modSettings['enable_google_translate'])) { echo '

'; }

The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline @rjen

  • Full Member
  • ***
  • Posts: 699
  • Gender: Male
    • FJR-club Nederland
Re: TinyPortal
« Reply #2826 on: December 20, 2020, 04:17:08 AM »
What kind of block did you try? I should be php...

May need some variables set...
I can have a look at it tonight
Running SMF 2.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2827 on: December 20, 2020, 04:23:10 AM »
When PHP block type is set then the block is empty. Translator is not displayed.

It would be nice if you could help me with that.
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline @rjen

  • Full Member
  • ***
  • Posts: 699
  • Gender: Male
    • FJR-club Nederland
Re: TinyPortal
« Reply #2828 on: December 20, 2020, 04:50:36 AM »
Just to be sure. Did you actually install the mod? The code you provided looks for the enable_google_translate setting, so you will still need to install that mod for the code to work!

Perhaps you can explain what you want to accomplish... because there may be easier ways than trying to implement half a mod in a block.
Running SMF 2.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2829 on: December 20, 2020, 05:36:01 AM »
Yes, the modification is installed. When installing this modification, I was informed that this code must be added to the index.template.php file for the theme I'm using.

I would like a Google translator to be embedded in the TP block.

I mean it:

The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,757
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: TinyPortal
« Reply #2830 on: December 20, 2020, 05:43:42 AM »
Yes, the modification is installed. When installing this modification, I was informed that this code must be added to the index.template.php file for the theme I'm using.

I would like a Google translator to be embedded in the TP block.

I mean it:



Then you don't need a mod at all, just add the google translate code to a html block,

Code: [Select]
<div id="google_translate_element3"></div>

<script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script>

<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

Offline @rjen

  • Full Member
  • ***
  • Posts: 699
  • Gender: Male
    • FJR-club Nederland
Re: TinyPortal
« Reply #2831 on: December 20, 2020, 09:35:08 AM »
Thats what I thought
Running SMF 2.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2832 on: December 20, 2020, 03:22:36 PM »
@lurkalot

Thanks for your help, but after adding this code to the HTML & Javascript block, the google translate does not display. The block is empty.
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline lurkalot

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,757
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: TinyPortal
« Reply #2833 on: December 20, 2020, 03:46:41 PM »
@lurkalot

Thanks for your help, but after adding this code to the HTML & Javascript block, the google translate does not display. The block is empty.

Using the code I posted?  Strange it works fine on all my sites.  :o

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2834 on: December 20, 2020, 04:02:22 PM »
@lurkalot

Thanks for your help, but after adding this code to the HTML & Javascript block, the google translate does not display. The block is empty.

Using the code I posted?  Strange it works fine on all my sites.  :o

Yes, I used this code. For me it is also strange.
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline @rjen

  • Full Member
  • ***
  • Posts: 699
  • Gender: Male
    • FJR-club Nederland
Re: TinyPortal
« Reply #2835 on: December 20, 2020, 04:16:22 PM »
Try this...

Code: [Select]
<center><div id="google_translate_element" style="height:50px; overflow:hidden"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}
</script><script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script></center>
Running SMF 2.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2836 on: December 21, 2020, 02:29:40 AM »
@rjen

Thanks for the code, this code works, the google translate is displayed. However, I have to use this modification because in the modification I can set the language that is used in the forum and I can enable the function: Automatically display the translation banner.

@lurkalot, @rjen

Thanks for the help. :)
The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline @rjen

  • Full Member
  • ***
  • Posts: 699
  • Gender: Male
    • FJR-club Nederland
Re: TinyPortal
« Reply #2837 on: December 21, 2020, 02:34:29 AM »
You set the language in the code: change language: ‘en’ to your language.

What does ‘automatically show the translation banner’ do ?
Running SMF 2.0 with Tinyportal 2.0.1 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Offline jsx

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
Re: TinyPortal
« Reply #2838 on: December 21, 2020, 07:25:48 AM »
Thanks for the tip.

What does ‘automatically show the translation banner’ do ?

I thought this was the function that displayed this banner:



But that's not it. I turned off this function and after entering the forum a banner from Google Translate appears (the one from the screen).

Google Chrome and Microsoft Edge automatically propose to translate the page content into the language used by the browser. So this modification that I have installed is unnecessary. But thank you for the code you gave me, because eg Opera does not offer to translate the content of the page, so embedded translator in the menu block is needed, always someone can manually choose to translate the content.

Would it be possible to change the style of Google Translate in the code to a drop-down menu that can be selected in this modification? Could you give me a code for this style of Google Translate?

The Great Winged Hussars

https://www.youtube.com/watch?v=eWkrQQly6xU

We remember
In september
When The Winged Hussars arrived!

Offline Nodaz

  • Full Member
  • ***
  • Posts: 499
Re: TinyPortal
« Reply #2839 on: December 21, 2020, 11:13:27 AM »
why do i keep getting notification of unread post for this topic?
 I cannot figure out how to turn that off, its not listed anywhere in my notifivcation settings or otherwise