Advertisement:

Author Topic: TinyPortal  (Read 643119 times)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 54,746
  • Gender: Male
    • Kindred-999 on GitHub
Re: TinyPortal
« Reply #2200 on: March 15, 2017, 08:42:34 AM »
When the error is.  The tpsubs file, it is almost always due to a badly coded portal block
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline stog

  • Semi-Newbie
  • *
  • Posts: 84
Re: TinyPortal
« Reply #2201 on: March 15, 2017, 06:45:07 PM »
thx all

yes i have now unchecked the 'evaluate templates' and now get
Code: [Select]
http://www.xxx.com/index.php?
8: Undefined variable: modSettings
File: /home/xxx/user/htdocs/Themes/default/languages/GoogleMap.english.php (tp_below sub template - eval?)
Line: 42

looking at member map -- it seems to be working fine

line 42 is
Code: [Select]
$txt['googleMap_DefaultZoom'] = 'The default Zoom Level';
any ideas thx so far
appreciated

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 47,297
Re: TinyPortal
« Reply #2202 on: March 15, 2017, 06:57:28 PM »
that is from a different mod, you would need to post in that mods support topic.

Offline stog

  • Semi-Newbie
  • *
  • Posts: 84
Re: TinyPortal
« Reply #2203 on: March 16, 2017, 10:21:09 AM »
ok i have just turned off a few php code blocks that i had been playing with, and sure enough the error has gone so it seems that it is indeed a dodgy code block that is causing this ; i wonder if someone can spot what the problem is with the php code  thx again

the code is for top posters of the month (was week), and i was trying to prevent the user's profile name link from duplicating the domain when clicked.
 ie www.xx.com/profile/... was linking as www.xx.com/http://www.xx.com/profile/..

Code: [Select]
global $smcFunc, $scripturl, $context, $settings;

// Top 10 Posters so far this week  (starts sunday)
$starttime = mktime() - 30 * 3600 * 24; 
// Offset based on forum time
$starttime = forum_time(false, $starttime);
// Limit of top posters
$limit = 8;
// Height and width of avatar

$width = '40px';
$height = '40px';

$request = $smcFunc['db_query']('', '
SELECT mem.id_member, mem.real_name, COUNT(*) as count_posts, mem.avatar, a.id_attach, a.attachment_type, a.filename
FROM {db_prefix}messages AS m
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
WHERE m.poster_time > {int:start_time}
AND m.id_member != 0
AND mem.show_online = 1
GROUP BY mem.id_member
ORDER BY count_posts DESC
LIMIT {int:limit}',
array(
'start_time' => $starttime,
'limit' => $limit
)
);

$context['top_posters'] = array();
$max_num_posts = 1;
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$context['top_posters'][] = array(
'name' => $row['real_name'],
'id' => $row['id_member'],
'num_posts' => $row['count_posts'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="http://www.fibsboard.com/' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'avatar' => array(
'image' => empty($row['avatar']) ? ($row['id_attach'] > 0 ? 'src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />' : '') : (stristr($row['avatar'], 'http://') ? 'src="' . $row['avatar'] . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />' : 'src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />'),
),
);

if ($max_num_posts < $row['count_posts'])
$max_num_posts = $row['count_posts'];
}
$smcFunc['db_free_result']($request);

foreach ($context['top_posters'] as $i => $j)
$context['top_posters'][$i]['post_percent'] = round(($j['num_posts'] * 100) / $max_num_posts);

// Tidy up
unset($max_num_posts, $row, $j, $i);

// Output our array of users with avatar, posts, and name
echo '
<table cellpadding="0" cellspacing="8">';

foreach ($context['top_posters'] as $user)
{
echo '
<tr>
<td>',empty($user['avatar']['image']) ? '<a href="http://www.xx.com/'.$user['href'].'"><img src="'.$settings['images_url'].'/noavatar.gif" width="'.$width.'" height="'.$height.'" alt="" title="' . $user['name'] . '" /></a>' : '<a href="http://www.xx.com/' . $user['href'] . '"><img ' . $user['avatar']['image']. '</a>';
echo '
</td>
<td><h5 style="margin: 4px;">' . $user['link'] . '</h5><h5 style="margin: 4px;">' . $user['num_posts'] . '</h5></td>
</tr>';
}

echo '
</table>';

i tried removing the link at href, but after saving it would re-appear

Code: [Select]
<td>',empty($user['avatar']['image']) ? '<a href="'.$user['href'].'"><img src="'.$settings['images_url'].'/noavatar.gif" width="'.$width.'" height="'.$height.'" alt="" title="' . $user['name'] . '" /></a>' : '<a href="' . $user['href'] . '"><img ' . $user['avatar']['image']. '</a>';
either way the block is causing the error?

any help appreciated

many thx

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,387
  • Gender: Male
    • i30 Owners Club
Re: TinyPortal
« Reply #2204 on: March 16, 2017, 10:27:07 AM »
Well, the answer is in the code block you posted. You didn't globalise $modSettings.

Code: (Find & Replace) [Select]
global $smcFunc, $scripturl, $context, $settings, $modSettings;

Offline stog

  • Semi-Newbie
  • *
  • Posts: 84
Re: TinyPortal
« Reply #2205 on: March 16, 2017, 10:29:15 AM »
thx very much! sorted errors gone (the trials of a copy/paste php newbie!)

thx again  -- wierd how when template error was unchecked -- the error  pointed to membermap? -->answer perhaps (Shambles noticed "$modSettings isn't globalised in add_settings.php (not that it matters at runtime)".

also any ideas how i can get the poster to link to the poster profile correctly in my code block btw

sry about this
« Last Edit: March 16, 2017, 11:31:33 AM by stog »

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,387
  • Gender: Male
    • i30 Owners Club
Re: TinyPortal
« Reply #2206 on: March 16, 2017, 10:42:20 AM »
You already have the linkages set up... just delete some spurious stuff

Code: (replace) [Select]
global $smcFunc, $scripturl, $context, $settings, $modSettings;

// Top 10 Posters so far this week  (starts sunday)
$starttime = mktime() - 30 * 3600 * 24; 
// Offset based on forum time
$starttime = forum_time(false, $starttime);
// Limit of top posters
$limit = 8;
// Height and width of avatar

$width = '40px';
$height = '40px';

$request = $smcFunc['db_query']('', '
SELECT mem.id_member, mem.real_name, COUNT(*) as count_posts, mem.avatar, a.id_attach, a.attachment_type, a.filename
FROM {db_prefix}messages AS m
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
WHERE m.poster_time > {int:start_time}
AND m.id_member != 0
AND mem.show_online = 1
GROUP BY mem.id_member
ORDER BY count_posts DESC
LIMIT {int:limit}',
array(
'start_time' => $starttime,
'limit' => $limit
)
);

$context['top_posters'] = array();
$max_num_posts = 1;
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$context['top_posters'][] = array(
'name' => $row['real_name'],
'id' => $row['id_member'],
'num_posts' => $row['count_posts'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'avatar' => array(
'image' => empty($row['avatar']) ? ($row['id_attach'] > 0 ? 'src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />' : '') : (stristr($row['avatar'], 'http://') ? 'src="' . $row['avatar'] . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />' : 'src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />'),
),
);

if ($max_num_posts < $row['count_posts'])
$max_num_posts = $row['count_posts'];
}
$smcFunc['db_free_result']($request);

foreach ($context['top_posters'] as $i => $j)
$context['top_posters'][$i]['post_percent'] = round(($j['num_posts'] * 100) / $max_num_posts);

// Tidy up
unset($max_num_posts, $row, $j, $i);

// Output our array of users with avatar, posts, and name
echo '
<table cellpadding="0" cellspacing="8">';

foreach ($context['top_posters'] as $user)
{
echo '
<tr>
<td>',empty($user['avatar']['image']) ? '<a href="'.$user['href'].'"><img src="'.$settings['images_url'].'/noavatar.gif" width="'.$width.'" height="'.$height.'" alt="" title="' . $user['name'] . '" /></a>' : '<a href="' . $user['href'] . '"><img ' . $user['avatar']['image']. '</a>';
echo '
</td>
<td><h5 style="margin: 4px;">' . $user['link'] . '</h5><h5 style="margin: 4px;">' . $user['num_posts'] . '</h5></td>
</tr>';
}

echo '
</table>';

Offline stog

  • Semi-Newbie
  • *
  • Posts: 84
Re: TinyPortal
« Reply #2207 on: March 16, 2017, 10:48:32 AM »
brill really appreciate your help and everyone else's too

smf ---> giving software a good name cheers

Offline Nory

  • Semi-Newbie
  • *
  • Posts: 45
Re: TinyPortal
« Reply #2208 on: April 17, 2017, 08:09:34 PM »
Hello,

Little question, Is it possible to disable tinyportal on smartphones?

Offline landyvlad

  • Jr. Member
  • **
  • Posts: 261
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: TinyPortal
« Reply #2209 on: April 18, 2017, 08:39:00 AM »
Nory - why? 

Have you tried the responsive beta version of TP ?
(more info on this on the TP forum)
I am running that, it seems very stable, and looks good on the mobile.
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Offline Nory

  • Semi-Newbie
  • *
  • Posts: 45
Re: TinyPortal
« Reply #2210 on: April 20, 2017, 05:53:19 PM »
Hello,

Quote
Have you tried the responsive beta version of TP ?
I don't know that!

I don't find link, could you give me?

Offline landyvlad

  • Jr. Member
  • **
  • Posts: 261
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: TinyPortal
« Reply #2211 on: May 18, 2017, 08:01:35 PM »
Sorry Nory I didn't see your post earlier.  Hopefully someone has let you know by now, but if not:

the setting to access the public beta should be found under your profile.

For full details on how to go about it, have a read of this thread: 
http://www.tinyportal.net/index.php?topic=35780.0

Cheers  :)
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Offline Nory

  • Semi-Newbie
  • *
  • Posts: 45
Re: TinyPortal
« Reply #2212 on: May 20, 2017, 09:02:43 AM »
Hello,

Thank you, it's very good version.

Offline ATAG

  • Newbie
  • *
  • Posts: 3
Re: TinyPortal
« Reply #2213 on: August 11, 2017, 05:34:37 PM »
It works! Thank you very mutch! I've used this mod for 8 years... excellent =)