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

Recent

Welcome to TinyPortal. Please login or sign up.

Recent posts

#1
Support / Re: Squished Avatars, Missing ...
Last post by Senkusha - March 21, 2025, 09:44:16 PM
I added the following to my /css/custom_edits.css file:

img.avatar {
   width: var(--avatar-size) !important;
   height: var(--avatar-size) !important;
}

And it seems to be working good!

You cannot view this attachment.
#2
Resources / Re: [How-To] Using a TinyPorta...
Last post by Senkusha - March 21, 2025, 09:20:58 PM
Thank you for sharing this!  I made my own, rather dynamic 404 page.  I want to add some more personality to it to fit my site theme!
Custom 404 Page
#3
Support / Re: Squished Avatars, Missing ...
Last post by [chrisB] - March 21, 2025, 08:13:43 PM
@Senkusha: Sorry, it shows the code is in your index.php file - this is where you should look to edit.



Changing to the above doesn't cause any issues elsewhere from what I could see.



If you want the avatars to be bigger than in the screenshot, it would mean making the classes in the code custom and adding those custom classes to your file. If the size is fine, simply use.

img.avatar {
    width: var(--avatar-size) !important;
    height: var(--avatar-size) !important;
}

I wished I could be of more help with the block error, but this would be something the TinyPortal team would be best handling. If you have any CSS problems, I can suss out a lot of them. I hope this helps.

PS. Prior to turning off the Minimize CSS and JavaScript, it would just say "index" so I assumed it would be index.css - once all your problems are resolved with CSS you turn it back on. 👍🏻
#4
Support / Re: Squished Avatars, Missing ...
Last post by Senkusha - March 21, 2025, 07:48:51 PM
Okay, I disabled the Minimize CSS and JavaScript files setting.  Thank you for pointing that out.  :)
#5
Support / Re: Squished Avatars, Missing ...
Last post by [chrisB] - March 21, 2025, 06:11:47 PM
@Senkusha:

To fix the avatar sizing issue, you should change your CSS.

index.css

img.avatar {
    max-width: 150px !important;
    max-height: 150px !important;
}

Remove the "max" and just stick with width and height as standard.

img.avatar {
    width: 150px !important;
    height: 150px !important;

Reduce the 150px to whatever size you want.

-Edit-

Just use this actually:

img.avatar {
    width: var(--avatar-size) !important;
    height: var(--avatar-size) !important;
}

I'm sorry I can't help with the block.

-Edit-

Allowing the location of the CSS would help with figuring out what's going on with the CSS, but the above change would fix your size issue. If you wanted it to be bigger, then it could cause issues to your forum index within the post area.

-Edit-
It seems that there may be some conflicting styles in your CSS.

Can you please disable the setting to minimize CSS and Javascript? This would help the TinyPortal team too.

If you don't know where the setting is, search CSS and then click on this. Disabling it will allow the file location to be found much easier, instead of it being minified.


See, I noticed you also have this within your CSS.
img.avatar {
    border-radius: var(--avatar-border-radius);
    height: var(--avatar-size);
    width: var(--avatar-size);
}

If you change and use 150px, the avatars will be huge, and any px size will cause issues with the forum index. Use the recommended CSS.
#6
Resources / [PHP] TP Support Helper Page
Last post by Senkusha - March 21, 2025, 04:13:18 PM
I developed this special article page when filling out my Support Ticket, and thought it might be helpful, especially if your forum is like mine, with many Packages.  This script began as just a easy compiler for that list, but I expanded it to include as much as I could automate.

Edit:  I found I didn't resolve all the errors before publishing this.  Fixed now, no errors found.

Issues:
  • Language doesn't populate, and I'm not entirely sure why, even after I've forced the variable.  Maybe a second set of (more experienced) eyes can see the problem?    But, I'm still unsure where to collect the Default Language in SMF.
  • I also looked to see if there was a reliable way to get the browser and version, and from what I can find, there isn't any reliable way that can be guaranteed.
  • The Theme that you're using isn't correctly being identified.  It does determine the forum default, but for example, in my case, I've got a different Theme selected, yet it's not reporting it.  Maybe the id_theme in the members table isn't the place to locate that information anymore?

There are a few variables that can be customized:
  • firstUserID is typically the (read: assumed) Administrator, the member that installed the forum.  Default is 1, feel free to change it if needed.
  • errCnt is the number of errors from the log to count backwards from (meaning the top listed error is going to be the most recent one.  By default only the last 24 hours are retrieved, and the default value of entries is 5.
  • defaultLanguage is the language of the forum.  Default is English, but feel free to change this if needed.  Hopefully, I can figure out why and where the Default Language is set and just use that in the future.
  • browser is the name of the browser (and version) that you're using.  Feel free to go to Help in your browser and copy/paste that information.  I routinely use two browsers, so I have both of them listed.

global $smcFunc, $db_prefix, $scripturl, $boardurl, $modSettings, $settings;

// Initialize all the internal variables!
$firstUserID = 1;     // Usually the first account is the Administrator account, right?
$errCnt = 5;             // Five is a nice round number-- we don't want to overwhelm the Devs!
$defaultLanguage = 'English';
$browser = 'FireFox (136.0.1 (64-bit)), Chrome (134.0.6998.90 (Official Build) (64-bit))';
$minTime = mktime(date("H"),date("m"),date("s"),date("m"),date("d")-1,date("Y"));  // When was 24 hours ago, exactly?

// Verify the board URL?
if (isset($boardurl))
  $boardURL = $boardurl;

// Get some SMF settings.
$query = $smcFunc['db_query']('','
  SELECT variable, value
  FROM {db_prefix}settings
  WHERE variable = {string:smfv} OR variable = {string:smftd}',
  array('smfv' => 'smfVersion',
           'smftd' => 'theme_default')
);
while ($result = $smcFunc['db_fetch_assoc']($query))
{
  switch ($result['variable'])
  {
    case 'smfVersion' :
    {
      $SMFversion = $result['value'];
      break;
    }
    case 'theme_default' :
    {
      $SMFdefaultTheme = $result['value'];
      break;
    }
  }
}
$smcFunc['db_free_result']($query);

// Let's get some Admin info, just in case we need it.
$query = $smcFunc['db_query']('','
    SELECT lngFile, id_theme FROM {db_prefix}members
    WHERE id_member = {int:adminID}',
    array('adminID' => $firstUserID)
  );
  $result = $smcFunc['db_fetch_assoc']($query);
  $adminLanguage = $result['lngFile'];
  $adminTheme = $result['id_theme'];

// Figure out the default language.
$query = $smcFunc['db_query']('','
  SELECT value FROM {db_prefix}settings
  WHERE variable = {string:lang}',
  array('lang' => 'language')
);
while ($result = $smcFunc['db_fetch_assoc']($query))
  $defaultLanguage = $result['value'];
$smcFunc['db_free_result']($query);

if (!isset($defaultLanguage) || $defaultLanguage == '')
{
  // Looks like the default language hasn't been specified!!  Look in the Administrator User account?
  $defaultLanguage = $adminLanguage; 
}

if (!isset($defaultLanguage) || $defaultLanguage == '')
{
  // Looks like even the Admin didn't select a default language.  Last resort is the Almighty Settings file??
  if (isset($settings['language']))
    $defaultLanguage = $settings['language'];
}
else
  $defaultLanguage = 'Unknown';

// Alrighty!  Let's gather a list of all the Themes installed, shall we?
$counter = 0;
$themeList = '';
$query = $smcFunc['db_query']('','
  SELECT id_theme, value
  FROM {db_prefix}themes
  WHERE variable = {string:nameField} AND id_member= {int:masterThemeID}
  ORDER BY value',
  array (
    'nameField' => 'name',
    'masterThemeID' => '0'
  )
);
while ($result = $smcFunc['db_fetch_assoc']($query))
{
  if ($counter > 0)
    $themeList .= ', ';

  if ($adminTheme == $result['id_theme'] || $adminTheme == $SMFdefaultTheme)
    $themeList .= '[b][i]' . $result['value'] . '[/i][/b]';
  else if ($adminTheme == 0 && $result['id_theme'] == $SMFdefaultTheme)
    $themeList .= '[b][i]' . $result['value'] . '[/i][/b]';
  else
    $themeList .= $result['value'] . ' (' . $result['id_theme'] . ')';

  $counter ++;
}

// Can we get the browser being used?

// Get all INSTALLED packages.
$counter = 0;
$packages = '';
$query = $smcFunc['db_query']('','
  SELECT name, version,  install_state
  FROM {db_prefix}log_packages
  WHERE install_state = {int:inPack}
  ORDER BY name',
  array('inPack' => 1)
);
while ($result = $smcFunc['db_fetch_assoc']($query))
{
  if ($counter > 0)
    $packages .= ', ';
  if ($result['name'] == 'TinyPortal')
    $TPversion = $result['version'];

  $packages .= $result['name'] . ' (' . $result['version'] . ')';
  $counter ++;
}
$smcFunc['db_free_result']($query);

// Finally, let's get a look at that log file...
$counter = 0;
$errorLogEntries = '';
$query = $smcFunc['db_query']('','
  SELECT log_time, url, message, error_type, file, line, backtrace
  FROM {db_prefix}log_errors
  WHERE log_time >= {int:timeRange}
  ORDER BY log_time DESC
  LIMIT {int:errorCount}', array (
    'timeRange' => $minTime,
    'errorCount' => $errCnt
  )
);
while ($result = $smcFunc['db_fetch_assoc']($query))
{
  // Let's make this output look presentable before taking it out on that date!
  $errorLogEntries .= $errCnt - $counter . '.  [b]' . $result['error_type'] . '[/b]<br />
Error:  ' . $result['message'] . '<br />
URL:  [url="' . $scripturl . $result['url'] . '"]' . $scripturl . $result['url'] . '[/url]<br />
File:  ' . $result['file'] . ' (Line:  ' . $result['line'] . ')<br />
<br />';

$counter ++;
}
$smcFunc['db_free_result']($query);

// But, what if there weren't any errors logged??
if ($errorLogEntries == '')
  $errorLogEntries = 'No errors were logged.';

// Finally!  The output!! :)
echo '
[b]Link to my forum: [/b] [url="' . $boardURL . '"]' . $boardURL . '[/url]<br />
[b]SMF version: [/b] ' . $SMFversion . '<br />
[b]TP version: [/b] ' . $TPversion . '<br />
[b]Default Forum Language: [/b] ' . $defaultLanguage . '<br />
[b]Theme name and version: [/b] ' . $themeList , '<br />
[b]Browser Name and Version: [/b] ' . $browser . '<br />
[b]Mods installed: [/b] ' . $packages . '<br />
[b]Related Error messages: [/b] <br />' . $errorLogEntries . '<br />
<br />';

Here is an example.  The errors listed below are only because I didn't want to clear out my log while testing.  As of right now, you have to manually Select All and Copy, however, I'm hoping that I can find a way to just click on a link/button and have the output automatically copied to the Clipboard.  Maybe somebody already knows how to do that?

QuoteLink to my forum: https://forum.animerpgs.com
SMF version: 2.1.4
TP version: 3.0.1
Default Forum Language:
Theme name and version: Reseller_v2.0.4 (2), SMF Default Theme - Curve2
Browser Name and Version: FireFox (136.0.1 (64-bit)), Chrome (134.0.6998.90 (Official Build) (64-bit))
Mods installed: Activity Bar (2.0.1), Alternate User Posting (2.1.2), Anime Avatars (1.0), Awesome Post Ratings (2.0.4b), Badge Awards (2.6.2b), Battle (1.17.9.4), Battle Image Expansion 1 (1.2), Battle Image Expansion 2 (1.1), Battle Image Expansion 3 (1.1), Battle Image Expansion 4 (1.1), Board Sorting Method (1.0.1), Country Flags (3.0), Curve2 Color Changer (1.4.2), Custom Board Icons (2.0.0), Dice Roller BBcode (2.0), Downloads Pro Addon - Display Credits (1.0), Emoji Pro (2.1a), Message Bookmarks (0.9.5), More Spiders (1.3.1), Optimus (3.0 RC3), Similar Topics (1.3.1), Simple Referrals (1.4.7), SimpleDesk - Integrated Helpdesk for Simple Machines Forum (2.1.3), SMF Arcade (2.7.0.6), SMF Classifieds (5.1.10), SMF Gallery Pro (10.2.2a), SMF Post Prefix (4.3.4), SMF Store (5.0.1), Spoiler (0.3.2), ST Shop (4.1.13), Stop Forum Spam (1.5.6), TinyPortal (3.0.1), Topic Solved (1.1.3)
Related Error messages:
5. undefined_vars
Error: 2: Undefined variable $packages
URL: https://forum.animerpgs.com/index.php?page=6
File: /home/animerpgs/www/forum/Sources/TPSubs.php(1482) : eval()'d code (Line: 120)

4. undefined_vars
Error: 2: Undefined variable $themeList
URL: https://forum.animerpgs.com/index.php?page=6
File: /home/animerpgs/www/forum/Sources/TPSubs.php(1482) : eval()'d code (Line: 97)

3. general
Error: 2: Trying to access array offset on value of type null
URL: https://forum.animerpgs.com/index.php?page=6
File: /home/animerpgs/www/forum/Sources/TPSubs.php(1482) : eval()'d code (Line: 57)

2. undefined_vars
Error: 2: Undefined variable $packages
URL: https://forum.animerpgs.com/index.php?page=6
File: /home/animerpgs/www/forum/Sources/TPSubs.php(1482) : eval()'d code (Line: 120)

1. undefined_vars
Error: 2: Undefined variable $themeList
URL: https://forum.animerpgs.com/index.php?page=6
File: /home/animerpgs/www/forum/Sources/TPSubs.php(1482) : eval()'d code (Line: 97)
#7
Support / Squished Avatars, Missing Bloc...
Last post by Senkusha - March 21, 2025, 01:31:20 AM
Link to my forum: http://www.animerpgs.com/forum/
SMF version: 2.1.4
TP version: 3.0.1
Default Forum Language: English
Theme name and version: Reseller (2.0.10)
Browser Name and Version: FireFox (136.0.1 (64-bit)), Chrome (134.0.6998.90 (Official Build) (64-bit))
Mods installed: Activity Bar (2.0.1), Alternate User Posting (2.1.2), Awesome Post Ratings (2.0.4b), Badge Awards (2.6.2b), Battle (1.17.9.4), Battle Image Expansion 1 (1.2), Battle Image Expansion 2 (1.1), Battle Image Expansion 3 (1.1), Battle Image Expansion 4 (1.1), Board Sorting Method (1.0.1), Country Flags (3.0), Curve2 Color Changer (1.4.2), Custom Board Icons (2.0.0), Dice Roller BBCode (2.0), Downloads Pro Addon - Display Credits (1.0), Downloads System Pro (6.2.2), Emoji Pro (2.1a), Message Bookmarks (0.9.5), More Spiders (1.3.1), Optimus (3.0 RC3), SMF Arcade (2.7.0.6), SMF Classifieds (5.1.10), SMF Gallery Pro (10.2.2a), SMF Post Prefix 4.3.4), SMF Store (5.0.1), ST Shop (4.1.13), Similar Topics (1.3.1), Simple Referrals (1.4.7), SimpleDesk - Integrated Helpdesk for Simple Machines Forum (2.1.3), Spolier (0.3.2), Stop Forum Spam (1.5.6), TinyPortal (3.0.1), Topic Solved (1.1.3)
Related Error messages: No error messages.

I've noticed three issues.  The first one is my Avatars on my Members Online seem to be squished, and they appear to be smaller than I remember, however, I could just be misremembering, because I'm old  ::) .  I've attempted to override the height setting (up to 400) in both Top and Center panels (I've tried both placements sequentially.  The block did not increase in size.
You cannot view this attachment.

Another issue I have is that I have a block of text that I only want to appear on the Board Index.  The option is checked for only the Board Index, yet the block does not appear, unless Front Page is also checked.
You cannot view this attachment.

One final issue I've noticed is that Emojis don't seem to work when using them in HTML blocks:
You cannot view this attachment.
#8
Chit chat / Re: Do you use Articles?
Last post by Senkusha - March 20, 2025, 02:31:49 PM
Okay, so for example, I saw that (after I posted this), that somebody is using Articles for some of their static site pages.  I do enjoy having the ability to modify my code anywhere using the SMF and TP system! 

But, I'm going to try my hand at writing a custom PHP Article.  I noticed that the <tab> key doesn't exactly work like it would, say in Notepad.  Is there an easy way to indent without having to <space> five times?
#9
Support / A couple more questions (sorry...
Last post by [chrisB] - March 19, 2025, 09:49:07 PM
As I have mentioned before, I use VBGamers Pretty URL Pro mod. (I know how many SMF users feel about it) 😆

I would like to add all the TinyPortal URLs to the sitemap it generates, with the following area being mentioned as needing to be modified.

$context['sitemap']['items'] = array();
The thing, I can only assume what should be there.

I know this code isn't correct, as I have tried it, but if someone could please amend it (no rush) - I would be very grateful.

    // TinyPortal Content
if (isset($modSettings['tp_enable_sitemap']) && $modSettings['tp_enable_sitemap'])
{
    // Add TinyPortal pages or blocks to the sitemap
    $context['sitemap']['items'] = array_merge($context['sitemap']['items'], pretty_TinyPortalXML());
}

I know this is a big ask, but having the URLs generated nicely with the sitemap would be nice.
----

Lastly, I did search here and I found a topic that seemed to be very similar. However, I wasn't sure how it would be applied in my scenario but honestly I do use the search function.
I even asked on SMF's forums here, but I still can't suss it out: https://www.simplemachines.org/community/index.php?topic=591292.msg4187692#msg4187692

I would like to sort out what shows as active when visiting.

Currently, the about page I created links to home, which has been described as the default behaviour but I don't know how to change this. Please could you explain how I can add the missing active tabs to my site, so I can get everything showing as active in the right area?
#10
Chit chat / Re: Do you use Articles?
Last post by lurkalot - March 19, 2025, 03:25:10 PM
The articles system is pretty handy, not just for pages or articles, but you can run other stuff in those pages as they come in different flavours. bbc, html, php etc.