Advertisement:

Author Topic: Topic Count in Profiles  (Read 30935 times)

TheListener

  • Guest
Re: Topic Count in Profiles
« Reply #80 on: July 26, 2010, 07:58:25 PM »
Woohoo

Well done bud.

(Paints Ha2 green).

Grey makes ya look old.

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Topic Count in Profiles
« Reply #81 on: July 26, 2010, 08:43:47 PM »
would having the Ultimate portal mod installed have anyaffect?

No
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

TheListener

  • Guest
Re: Topic Count in Profiles
« Reply #82 on: July 26, 2010, 08:47:36 PM »
It wasn't until I saw the mod in action that I remembered its job.

 ;D

Offline Celia N. Foster

  • Jr. Member
  • **
  • Posts: 152
  • Gender: Female
    • suaviterinmodo on Facebook
    • @suaviterinmodo on Twitter
    • Concrete Angel
Re: Topic Count in Profiles
« Reply #83 on: July 31, 2010, 01:03:43 PM »
When I installed this mod, I got this error:

Template Parse Error!
There was a problem loading the /Themes/default/Profile.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/Profile.template.php on line 130

121:       echo '
122:             <dt>', $txt['profile_posts'], ': </dt>
123:             <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
124:
125:    echo '
126:             <dt>', $txt['profile_topics_started'], ': </dt>
127:             <dd>', $context['member']['topics'], ' ('. $context['member']['topics_per_day'], ' ', $txt['posts_per_day'], ')</dd>
128:             <dt>', $txt['profile_topics_participated'], ': </dt>
129:

130:    // Only show the email address fully if it's not hidden - and we reveal the email.

131:    if ($context['member']['show_email'] == 'yes')
132:       echo '
133:             <dt>', $txt['email'], ': </dt>
134:             <dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';
---------------

How does one fix this error?

Offline Celia N. Foster

  • Jr. Member
  • **
  • Posts: 152
  • Gender: Female
    • suaviterinmodo on Facebook
    • @suaviterinmodo on Twitter
    • Concrete Angel
Re: Topic Count in Profiles
« Reply #84 on: July 31, 2010, 02:46:24 PM »
Now I've got the following error:

Parse error: syntax error, unexpected '<' in .../Themes/default/Profile.template.php on line 118

109:    <div id="detailedinfo">
110:       <div class="windowbg2">
111:       <span class="topslice"><span></span></span>
112:       <div class="content">
113:          <dl>';
114:
115:    if ($context['user']['is_owner'] || $context['user']['is_admin'])
116:       echo '
117:             <dt>', $txt['username'],': </dt>';

118:             <dd>', $context['member']['username'], '</dd>';

119:
120:    if (!isset($context['disabled_fields']['topics']))
121:       echo '
122:             <dt>', $txt['profile_posts'], ': </dt>

----------
How does one fix this? Help!

Offline live627

  • Development Contributor
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Topic Count in Profiles
« Reply #85 on: August 06, 2010, 01:22:18 AM »
Sorry for the late reply.

Change line 118 to this:

echo '<dd>', $context['member']['username'], '</dd>';
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline Fisch.666

  • Jr. Member
  • **
  • Posts: 205
Re: Topic Count in Profiles
« Reply #86 on: August 25, 2010, 03:11:17 AM »
Hi!

I have the same problem, thanks for your reply. After changing this line i get a new error:

Code: [Select]
[25-Aug-2010 09:09:01] PHP Parse error:  syntax error, unexpected '>' in Themes/default/Profile.template.php on line 118

Ah, and you forgot to change the version 1.6 to 2.0 in the new package.  :)

Offline Cal O'Shaw

  • Full Member
  • ***
  • Posts: 444
  • SMF 1.1.14 & 2.0 Sites
Re: Topic Count in Profiles
« Reply #87 on: September 23, 2010, 03:00:01 AM »
Hello,

Any chance you could put 1.5.4 back on the MOD page?  It looks like MODs such as "OS & Browser Detection" and "Reason for editing MOD" fail to install (or uninstall) because of Db Query changes that they can't recognise.  I tried to uninstall 1.5.4 but Profile.php and ModSettings.php had problems and without having the 1.5.4 version up to parse and then compare, I can't make the changes needed .

We're still on 1.1.11 and will be for a few months after 2.0 goes Golden, which means we're going to be on 1.1.11 for some time longer.  Any help in being able to resolve this, even just putting 1.5.4 back up, would be greatly appreciated.

Grazie,

Cal

Offline DeroZ

  • Jr. Member
  • **
  • Posts: 141
Re: Topic Count in Profiles
« Reply #88 on: July 04, 2013, 01:18:43 AM »
smf 2.0.4

install20.xml Modification parse error

Offline ormuz

  • Full Member
  • ***
  • Posts: 689
Re: Topic Count in Profiles
« Reply #89 on: July 15, 2013, 11:14:48 AM »
smf 2.0.4

install20.xml Modification parse error

error...

Offline Deaks

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,156
  • Gender: Male
Re: Topic Count in Profiles
« Reply #90 on: July 15, 2013, 11:18:57 AM »
ok sorted, download 2.1a should fix this :)

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Topic Count in Profiles
« Reply #91 on: July 15, 2013, 11:19:48 AM »
Is there a download link anywhere? :P
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Deaks

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,156
  • Gender: Male
Re: Topic Count in Profiles
« Reply #92 on: July 15, 2013, 11:21:38 AM »
yeh modsite :P

Offline ormuz

  • Full Member
  • ***
  • Posts: 689
Re: Topic Count in Profiles
« Reply #93 on: July 15, 2013, 11:23:27 AM »
ok sorted, download 2.1a should fix this :)

that was fast! Thanks

Offline impreza

  • Sophist Member
  • *****
  • Posts: 1,054
    • infomiasto.eu
Re: Topic Count in Profiles
« Reply #94 on: August 27, 2013, 08:43:35 AM »
In my mod does not install properly - defeat the system. Maybe it's other add-ons
Portal infomiasto.eu - treści w postaci artykułów i filmów tematycznych

Offline Dhayzon

  • Sophist Member
  • *****
  • Posts: 1,165
  • Gender: Male
  • DhayZone RevolutioN
    • Dhayzon on GitHub
    • @dhayzon on Twitter
    • http://dhayzon.com/
Re: Topic Count in Profiles
« Reply #95 on: June 01, 2014, 11:42:00 AM »
no  works in smf 2.0.7

this code is differente :C

Code: [Select]
// Otherwise do!
else
{
echo '
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';

Offline Goten22

  • Semi-Newbie
  • *
  • Posts: 42
Re: Topic Count in Profiles
« Reply #96 on: August 18, 2018, 01:03:52 PM »
Can you count the number of topics for a specific board?

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Topic Count in Profiles
« Reply #97 on: August 18, 2019, 01:20:11 PM »
 ;D any chance on an update for 2.0.15?

getting three errors, one is simple fix
Add After   ./Sources/Profile-View.php   Test failed
it's looking for all of this just to add after
Code: [Select]
// Posting activity by time.
$result = $smcFunc['db_query']('user_activity_by_time', '
SELECT
HOUR(FROM_UNIXTIME(poster_time + {int:time_offset})) AS hour,
COUNT(*) AS post_count
FROM {db_prefix}messages
WHERE id_member = {int:current_member}' . ($modSettings['totalMessages'] > 100000 ? '
AND id_topic > {int:top_ten_thousand_topics}' : '') . '
GROUP BY hour',
array(
'current_member' => $memID,
'top_ten_thousand_topics' => $modSettings['totalTopics'] - 10000,
'time_offset' => (($user_info['time_offset'] + $modSettings['time_offset']) * 3600),
)
);
$maxPosts = 0;
$context['posts_by_time'] = array();
while ($row = $smcFunc['db_fetch_assoc']($result))
{
// Cast as an integer to remove the leading 0.
$row['hour'] = (int) $row['hour'];

if ($row['post_count'] > $maxPosts)
$maxPosts = $row['post_count'];

$context['posts_by_time'][$row['hour']] = array(
'hour' => $row['hour'],
'posts_percent' => $row['post_count']
);
}
$smcFunc['db_free_result']($result);

if ($maxPosts > 0)
for ($hour = 0; $hour < 24; $hour++)
{
if (!isset($context['posts_by_time'][$hour]))
$context['posts_by_time'][$hour] = array(
'hour' => $hour,
'posts_percent' => 0,
);
else
$context['posts_by_time'][$hour]['posts_percent'] = round(($context['posts_by_time'][$hour]['posts_percent'] * 100) / $maxPosts);
}

// Put it in the right order.
ksort($context['posts_by_time']);
so simply changed for it to just look for
Code: [Select]
// Put it in the right order.
ksort($context['posts_by_time']);

Add After   ./Themes/default/Profile.template.php   Test failed
this one I fixed what it was looking for but then got template errors, something about unexpected $context
it wants to find
Code: [Select]
<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';but mine looks like this, i'm sure it's probably something I've installed
Code: [Select]
<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>' . (!empty($context['member']['anonymous']) ? 'but when it adds
Code: [Select]
echo '
', $context['tcip_enabled'] && $context['tcip_show_topic_count'] ? '<dt>'. $txt['profile_topics_started']. ': </dt>
<dd>'. $context['member']['topics']. ' ('. $context['member']['topics_per_day']. ' '. $txt['posts_per_day']. ')</dd>
' : '', $context['tcip_enabled'] && $context['tcip_show_participated_count'] ? '<dt>'. $txt['profile_topics_participated']. ': </dt>
<dd>'. $context['member']['topic_count']. '</dd>' : '', '';
I get template errors

lastly I don't know.....
Replace   ./Themes/default/Profile.template.php   Test failed

instructions are
find
Code: [Select]
// Otherwise do!
else
{
echo '
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';
replace
Code: [Select]
// Otherwise do!
else
{
echo '
<p align="center"><b>', $txt['tcip_posts'] ,'</b></p>
<dl class="stats">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>
<p align="center"><br /><b>', $txt['tcip_topics'] ,'</b></p>
<dl class="stats">';

// The labels.
foreach ($context['topics_by_time'] as $time_of_day)
echo '
<dt>', date('g a', mktime($time_of_day['hour'])), '</dt>
<dd class="statsbar">', !empty($time_of_day['posts_percent']) ? '<span class="left"></span><div style="width: ' . $time_of_day['posts_percent'] . 'px;" class="stats_bar"></div><span class="right"></span><span class="righttext">' . $time_of_day['posts_percent'] . '%</span>' : '', '</dd>';
echo '
</dl>';
I don't have that... I tried to break this apart
find
Code: [Select]
// Otherwise do!
else
{
echo '
after add
Code: [Select]
<p align="center"><b>', $txt['tcip_posts'] ,'</b></p>
but i'm not sure about the last part how to edit and add after
my code is
Code: [Select]
// Otherwise do!
else
{
echo '
<ul class="activity_stats flow_hidden">';

// The labels.
foreach ($context['posts_by_time'] as $time_of_day)
{
echo '
<li', $time_of_day['is_last'] ? ' class="last"' : '', '>
<div class="bar" style="padding-top: ', ((int) (100 - $time_of_day['relative_percent'])), 'px;" title="', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '">
<div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
<span>', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '</span>
</div>
</div>
<span class="stats_hour">', $time_of_day['hour_format'], '</span>
</li>';
}

echo '

</ul>';
}

echo '
<span class="clear" />
</div>
<span class="botslice"><span></span></span>
</div>
</div>';

thank you for any help